@odx/foundation 1.0.0-beta.235 → 1.0.0-beta.237

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/README.md CHANGED
@@ -76,11 +76,9 @@ export class Title {
76
76
 
77
77
  See <a href="https://lit.dev/docs/frameworks/react/" target="_blank">Lit documentation</a> for more information on how to use web components in React.
78
78
 
79
-
80
-
81
79
  ### Documentation
82
80
 
83
- For detailed documentation on how to use the `@odx/foundation` package, including examples and best practices, please visit our <a href="https://odx.draeger.com" target="_blank" rel="noopener">documentation</a>.
81
+ For detailed documentation on how to use the `@odx/foundation` package, including examples and best practices, please visit our <a href="https://ca-odx-storybook-dev.yellowisland-7b13f2d7.westeurope.azurecontainerapps.io/" target="_blank" rel="noopener">storybook documentation</a>.
84
82
 
85
83
  ### Contact
86
84
  For questions, feedback, or support, please reach out to us through our <a href="https://odx.draeger.com/contact" target="_blank" rel="noopener">contact page</a>.
@@ -16,7 +16,7 @@ export declare const defaultBreakpoints: {
16
16
  readonly max: 1199.98;
17
17
  };
18
18
  };
19
- export default function setupBreakpoints(breakpointsConfig?: BreakpointConfig[], root?: HTMLElement): () => void;
19
+ export default function setupBreakpoints(breakpointsConfig?: BreakpointConfig[]): () => void;
20
20
  export * from './models.js';
21
21
  export * from './plugins.js';
22
22
  export * from './utils.js';
@@ -1,10 +1,10 @@
1
- import { Signal } from '@preact/signals-core';
2
- import { Breakpoint, BreakpointChange, BreakpointConfig, BreakpointOperator, BreakpointPlugin } from './models.js';
1
+ import { Signal } from '../signals/main.js';
2
+ import { Breakpoint, BreakpointChange, BreakpointConfig, BreakpointOperator } from './models.js';
3
3
  export declare const breakpointDirective: import('../utils/main.js').StringAttributeDirective<"odx-breakpoint">;
4
4
  export declare function buildBreakpoint(breakpoint: BreakpointConfig, operator?: BreakpointOperator): Breakpoint;
5
- export declare function createBreakpointHandler(plugins: BreakpointPlugin[], targets: HTMLElement[]): (change: BreakpointChange) => void;
6
- export declare function expandBreakpoints(...breakpoints: BreakpointConfig[]): Record<string, Breakpoint>;
5
+ export declare function expandBreakpoints(...breakpoints: BreakpointConfig[]): Breakpoint[];
7
6
  export declare function observeBreakpoint(breakpoint: Breakpoint, initialValue?: boolean): Signal<Breakpoint & {
8
7
  matches: boolean;
9
8
  }>;
9
+ export declare function createBreakpointDirectiveUpdater(breakpoints: Breakpoint[], update: (target: HTMLElement, change: BreakpointChange) => void): () => void;
10
10
  //# sourceMappingURL=utils.d.ts.map
@@ -1,6 +1,5 @@
1
+ import { signal, effect } from '@odx/foundation/signals';
1
2
  import { stringAttributeDirective, observeMedia } from '@odx/foundation/utils';
2
- import { signal } from '@preact/signals-core';
3
- import { k as keyBy, g as groupBy } from './vendor.js';
4
3
 
5
4
  const BreakpointHideTargetPlugin = (target, change) => {
6
5
  target.hidden = !change.matches;
@@ -34,23 +33,10 @@ function buildBreakpoint(breakpoint, operator) {
34
33
  query = `(min-width: ${breakpoint.max + 0.02}px)`;
35
34
  break;
36
35
  }
37
- query = [query, breakpoint.customQuery].filter(Boolean).join(" and ");
38
- return { ...breakpoint, id, operator, query };
39
- }
40
- function createBreakpointHandler(plugins, targets) {
41
- return (change) => {
42
- for (const plugin of plugins) {
43
- for (const target of targets) {
44
- plugin(target, change);
45
- }
46
- }
47
- };
36
+ return { ...breakpoint, id, operator, query: [query, breakpoint.customQuery].filter(Boolean).join(" and ") };
48
37
  }
49
38
  function expandBreakpoints(...breakpoints) {
50
- const expandBreakpoints2 = breakpoints.flatMap(
51
- (breakpoint) => [void 0, ...operators].map((operator) => buildBreakpoint(breakpoint, operator))
52
- );
53
- return keyBy(expandBreakpoints2, (breakpoint) => breakpoint.id);
39
+ return breakpoints.flatMap((breakpoint) => [void 0, ...operators].map((operator) => buildBreakpoint(breakpoint, operator)));
54
40
  }
55
41
  function observeBreakpoint(breakpoint, initialValue = false) {
56
42
  let unobserveMedia;
@@ -68,38 +54,61 @@ function observeBreakpoint(breakpoint, initialValue = false) {
68
54
  }
69
55
  );
70
56
  }
71
-
72
- function unsubscribeAll(subscriptions) {
73
- for (const unsubscribe of subscriptions) {
74
- unsubscribe();
75
- subscriptions.delete(unsubscribe);
76
- }
57
+ function createBreakpointDirectiveUpdater(breakpoints, update) {
58
+ const breakpointObservers = breakpoints.map((breakpoint) => observeBreakpoint(breakpoint));
59
+ return () => {
60
+ const results = breakpointObservers.reduce(
61
+ (breakpoints2, { value }) => {
62
+ breakpoints2[value.id] = value;
63
+ return breakpoints2;
64
+ },
65
+ {}
66
+ );
67
+ const directives = document.querySelectorAll(breakpointDirective.selector);
68
+ let i = directives.length;
69
+ while (i--) {
70
+ const directive = directives[i];
71
+ const result = results[breakpointDirective.value(directive) ?? ""];
72
+ if (!result) continue;
73
+ update(directive, result);
74
+ }
75
+ };
77
76
  }
77
+
78
78
  const defaultBreakpoints = {
79
79
  mobile: { id: "mobile", min: 0, max: 575.98 },
80
80
  tablet: { id: "tablet", min: 576, max: 991.98 },
81
81
  desktop: { id: "desktop", min: 992, max: 1199.98 }
82
82
  };
83
- function setupBreakpoints(breakpointsConfig = [], root = document.documentElement) {
83
+ function setupBreakpoints(breakpointsConfig = []) {
84
84
  const breakpoints = expandBreakpoints(...Object.values(defaultBreakpoints), ...breakpointsConfig);
85
85
  const plugins = [BreakpointHideTargetPlugin, BreakpointClassNamePlugin];
86
- const subscriptions = /* @__PURE__ */ new Set();
87
- const observer = new MutationObserver((mutations) => {
88
- if (mutations.length === 0) return;
89
- const breakpointDirectives = Array.from(document.querySelectorAll(breakpointDirective.selector));
90
- unsubscribeAll(subscriptions);
91
- const breakpointTargets = groupBy(breakpointDirectives, (host) => breakpointDirective.value(host) ?? "");
92
- for (const [breakpointId, targets] of Object.entries(breakpointTargets)) {
93
- const breakpoint = breakpoints[breakpointId];
94
- if (!breakpoint) continue;
95
- subscriptions.add(observeBreakpoint(breakpoint).subscribe(createBreakpointHandler(plugins, targets)));
86
+ const directiveUpdater = createBreakpointDirectiveUpdater(breakpoints, (target, change) => {
87
+ for (const plugin of plugins) {
88
+ plugin(target, change);
96
89
  }
97
90
  });
98
- observer.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: [breakpointDirective.attribute] });
99
- return () => {
100
- unsubscribeAll(subscriptions);
101
- observer.disconnect();
91
+ let mutationObserver;
92
+ let unobserveBreakpoints = () => {
102
93
  };
94
+ function initBreakpoints() {
95
+ destroyBreakpoints();
96
+ mutationObserver = new MutationObserver(directiveUpdater);
97
+ unobserveBreakpoints = effect(directiveUpdater);
98
+ mutationObserver.observe(document.documentElement, {
99
+ attributes: true,
100
+ subtree: true,
101
+ childList: true,
102
+ attributeFilter: [breakpointDirective.attribute]
103
+ });
104
+ }
105
+ function destroyBreakpoints() {
106
+ unobserveBreakpoints();
107
+ mutationObserver?.disconnect();
108
+ globalThis.removeEventListener("DOMContentLoaded", initBreakpoints);
109
+ }
110
+ globalThis.addEventListener("DOMContentLoaded", initBreakpoints);
111
+ return destroyBreakpoints;
103
112
  }
104
113
 
105
- export { BreakpointClassNamePlugin, BreakpointHideTargetPlugin, breakpointDirective, buildBreakpoint, createBreakpointHandler, setupBreakpoints as default, defaultBreakpoints, expandBreakpoints, observeBreakpoint };
114
+ export { BreakpointClassNamePlugin, BreakpointHideTargetPlugin, breakpointDirective, buildBreakpoint, createBreakpointDirectiveUpdater, setupBreakpoints as default, defaultBreakpoints, expandBreakpoints, observeBreakpoint };
@@ -3,12 +3,11 @@ import { CustomElement, customElement, CanBeExpanded, InteractiveControlElement,
3
3
  import { getUniqueId, toAriaBooleanAttribute, getAssignedElements, booleanAttributeDirective, optionalAttr, interactionResponse, getElementFromEvent, observeElementResize, unobserveElementResize, toPx, enableMotion, findClosestDocument, commandDirective, addGlobalEventListener, waitForAnimations, removeGlobalEventListener, getKeyInfo, clickedOutside, setFocusable, optionalSlot, parseDate, supportsHover, forwardEvent } from '@odx/foundation/utils';
4
4
  import { html, isServer, unsafeCSS, css, nothing } from 'lit';
5
5
  import { property, query, state } from 'lit/decorators.js';
6
- import { p as pick, R as RovingTabindexController, e, c as computePosition, o as offset, s as shift, f as flip, a as size, b as arrow, h as hide, d as autoUpdate, r as round, i as debounce } from './vendor.js';
6
+ import { p as pick, R as RovingTabindexController, c as computePosition, o as offset, s as shift, a as flip, b as size, d as arrow, h as hide, e as autoUpdate, r as round, g as debounce } from './vendor.js';
7
7
  import { when } from 'lit/directives/when.js';
8
8
  import { OdxIconElement } from '@odx/icons';
9
9
  import { IsLocalized } from '@odx/foundation/i18n';
10
- import { signal, computed } from '@preact/signals-core';
11
- import 'lit/html.js';
10
+ import { SignalWatcher, signal, computed } from '@lit-labs/preact-signals';
12
11
  import { createContext, consume, provide } from '@lit/context';
13
12
 
14
13
  const styles$1l = ":host{--indent-level:1;border-block-end:var(--odx-border-width-thin)solid transparent;display:block}.content{padding:var(--odx-layout-spacing-md);padding-block-start:0;padding-inline-start:calc(var(--indent-level)*var(--odx-layout-spacing-md))}:host(:not(:last-of-type)){border-block-end-color:var(--odx-color-stroke-neutral-subtle)}::slotted(odx-accordion){--item-indent-level:calc(var(--indent-level) + 1);margin:calc(-1*var(--odx-layout-spacing-md));margin-block-start:0;margin-inline-start:calc(-1*var(--indent-level)*var(--odx-layout-spacing-md))}";
@@ -649,7 +648,7 @@ const hrefIdRegex = /^#([^?]+)/;
649
648
  function getIdFromHref(href) {
650
649
  return href.match(hrefIdRegex)?.[1] || null;
651
650
  }
652
- const _OdxAnchorNavigation = class _OdxAnchorNavigation extends e(CustomElement) {
651
+ const _OdxAnchorNavigation = class _OdxAnchorNavigation extends SignalWatcher(CustomElement) {
653
652
  constructor() {
654
653
  super();
655
654
  this.#items = signal([]);
@@ -1,6 +1,6 @@
1
1
  import { CustomElement } from '../main.js';
2
+ import { ReadonlySignal } from '../signals/main.js';
2
3
  import { Constructor } from '../utils/main.js';
3
- import { ReadonlySignal } from '@preact/signals-core';
4
4
  import { formatDate, formatList, formatNumber, formatRelativeTime } from './format.js';
5
5
  import { getLocale } from './localization.js';
6
6
  import { translate } from './translate.js';
@@ -1,4 +1,4 @@
1
- import { ReadonlySignal } from '@preact/signals-core';
1
+ import { ReadonlySignal } from '../signals/main.js';
2
2
  import { LocaleInput } from './models.js';
3
3
  import { TranslateContext, TranslationNested } from './types.js';
4
4
  export declare function setTranslation(locale: LocaleInput, translation: TranslationNested): void;
package/dist/i18n.js CHANGED
@@ -1,8 +1,8 @@
1
- import { signal, computed } from '@preact/signals-core';
2
- import { j as flattenObject, e } from './vendor.js';
1
+ import { signal, computed } from '@odx/foundation/signals';
2
+ import { f as flattenObject } from './vendor.js';
3
3
  import { parseDate } from '@odx/foundation/utils';
4
4
  import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
5
- import 'lit/html.js';
5
+ import { SignalWatcher } from '@lit-labs/preact-signals';
6
6
  import { property } from 'lit/decorators.js';
7
7
 
8
8
  const I18nConfig = (config) => ({
@@ -114,7 +114,7 @@ function formatRelativeTime(input, options) {
114
114
  }
115
115
 
116
116
  const IsLocalized = (superClass) => {
117
- class IsLocalizedElement extends e(superClass) {
117
+ class IsLocalizedElement extends SignalWatcher(superClass) {
118
118
  constructor() {
119
119
  super(...arguments);
120
120
  this.locale = computed(() => getLocale(this.lang));
@@ -0,0 +1,46 @@
1
+ [
2
+ {
3
+ "name": "es-toolkit",
4
+ "version": "1.40.0",
5
+ "repository": "https://github.com/toss/es-toolkit.git",
6
+ "source": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.40.0.tgz",
7
+ "license": "MIT",
8
+ "licenseText": "MIT License\n\nCopyright (c) 2024 Viva Republica, Inc\n\nCopyright OpenJS Foundation and other contributors\n\nParts of the test suite and compatibility layer in `es-toolkit/compat` are derived from Lodash (https://github.com/lodash/lodash) by the OpenJS Foundation (https://openjsf.org/) and Underscore.js by Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors (http://underscorejs.org/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
9
+ },
10
+ {
11
+ "name": "@spectrum-web-components/reactive-controllers",
12
+ "version": "1.9.0",
13
+ "author": "Adobe",
14
+ "repository": "https://github.com/adobe/spectrum-web-components.git",
15
+ "source": "https://registry.npmjs.org/@spectrum-web-components/reactive-controllers/-/reactive-controllers-1.9.0.tgz",
16
+ "license": "Apache-2.0",
17
+ "licenseText": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
18
+ },
19
+ {
20
+ "name": "@floating-ui/utils",
21
+ "version": "0.2.10",
22
+ "author": "atomiks",
23
+ "repository": "https://github.com/floating-ui/floating-ui.git",
24
+ "source": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz",
25
+ "license": "MIT",
26
+ "licenseText": "MIT License\n\nCopyright (c) 2021-present Floating UI contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
27
+ },
28
+ {
29
+ "name": "@floating-ui/core",
30
+ "version": "1.7.3",
31
+ "author": "atomiks",
32
+ "repository": "https://github.com/floating-ui/floating-ui.git",
33
+ "source": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz",
34
+ "license": "MIT",
35
+ "licenseText": "MIT License\n\nCopyright (c) 2021-present Floating UI contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
36
+ },
37
+ {
38
+ "name": "@floating-ui/dom",
39
+ "version": "1.7.4",
40
+ "author": "atomiks",
41
+ "repository": "https://github.com/floating-ui/floating-ui.git",
42
+ "source": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz",
43
+ "license": "MIT",
44
+ "licenseText": "MIT License\n\nCopyright (c) 2021-present Floating UI contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
45
+ }
46
+ ]
@@ -0,0 +1,188 @@
1
+
2
+ es-toolkit 1.40.0
3
+ License: MIT
4
+
5
+ MIT License
6
+
7
+ Copyright (c) 2024 Viva Republica, Inc
8
+
9
+ Copyright OpenJS Foundation and other contributors
10
+
11
+ Parts of the test suite and compatibility layer in `es-toolkit/compat` are derived from Lodash (https://github.com/lodash/lodash) by the OpenJS Foundation (https://openjsf.org/) and Underscore.js by Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors (http://underscorejs.org/)
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ --------------------------------------------------------------------------------
32
+
33
+ @spectrum-web-components/reactive-controllers 1.9.0
34
+ License: Apache-2.0
35
+
36
+ Apache License
37
+ Version 2.0, January 2004
38
+ http://www.apache.org/licenses/
39
+
40
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
41
+
42
+ 1. Definitions.
43
+
44
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
45
+
46
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
47
+
48
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
49
+
50
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
51
+
52
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
53
+
54
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
55
+
56
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
57
+
58
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
59
+
60
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
65
+
66
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
67
+
68
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
69
+
70
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
71
+
72
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
73
+
74
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
75
+
76
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
77
+
78
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
79
+
80
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
81
+
82
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
83
+
84
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
85
+
86
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
87
+
88
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
89
+
90
+ END OF TERMS AND CONDITIONS
91
+
92
+ APPENDIX: How to apply the Apache License to your work.
93
+
94
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
95
+
96
+ Copyright [yyyy] [name of copyright owner]
97
+
98
+ Licensed under the Apache License, Version 2.0 (the "License");
99
+ you may not use this file except in compliance with the License.
100
+ You may obtain a copy of the License at
101
+
102
+ http://www.apache.org/licenses/LICENSE-2.0
103
+
104
+ Unless required by applicable law or agreed to in writing, software
105
+ distributed under the License is distributed on an "AS IS" BASIS,
106
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107
+ See the License for the specific language governing permissions and
108
+ limitations under the License.
109
+
110
+ --------------------------------------------------------------------------------
111
+
112
+ @floating-ui/utils 0.2.10
113
+ License: MIT
114
+
115
+ MIT License
116
+
117
+ Copyright (c) 2021-present Floating UI contributors
118
+
119
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
120
+ this software and associated documentation files (the "Software"), to deal in
121
+ the Software without restriction, including without limitation the rights to
122
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
123
+ the Software, and to permit persons to whom the Software is furnished to do so,
124
+ subject to the following conditions:
125
+
126
+ The above copyright notice and this permission notice shall be included in all
127
+ copies or substantial portions of the Software.
128
+
129
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
131
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
132
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
133
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
134
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
135
+
136
+ --------------------------------------------------------------------------------
137
+
138
+ @floating-ui/core 1.7.3
139
+ License: MIT
140
+
141
+ MIT License
142
+
143
+ Copyright (c) 2021-present Floating UI contributors
144
+
145
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
146
+ this software and associated documentation files (the "Software"), to deal in
147
+ the Software without restriction, including without limitation the rights to
148
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
149
+ the Software, and to permit persons to whom the Software is furnished to do so,
150
+ subject to the following conditions:
151
+
152
+ The above copyright notice and this permission notice shall be included in all
153
+ copies or substantial portions of the Software.
154
+
155
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
156
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
157
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
158
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
159
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
160
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
161
+
162
+ --------------------------------------------------------------------------------
163
+
164
+ @floating-ui/dom 1.7.4
165
+ License: MIT
166
+
167
+ MIT License
168
+
169
+ Copyright (c) 2021-present Floating UI contributors
170
+
171
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
172
+ this software and associated documentation files (the "Software"), to deal in
173
+ the Software without restriction, including without limitation the rights to
174
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
175
+ the Software, and to permit persons to whom the Software is furnished to do so,
176
+ subject to the following conditions:
177
+
178
+ The above copyright notice and this permission notice shall be included in all
179
+ copies or substantial portions of the Software.
180
+
181
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
182
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
183
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
184
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
185
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
186
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
187
+
188
+ --------------------------------------------------------------------------------
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-export signals from Preact Signals
3
+ */
4
+ export { computed, effect, type ReadonlySignal, type Signal, signal } from '@preact/signals-core';
5
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ export { computed, effect, signal } from '@preact/signals-core';
@@ -0,0 +1,4 @@
1
+ export declare function isDarkModeEnabled(): boolean;
2
+ export declare function getDarkModeUserPreference(): boolean;
3
+ export declare function toggleDarkMode(enabled?: boolean | 'auto', root?: HTMLElement): void;
4
+ //# sourceMappingURL=dark-mode.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { signal } from '@odx/foundation/signals';
2
+
3
+ const darkModeEnabled = signal(getDarkModeUserPreference());
4
+ function isDarkModeEnabled() {
5
+ return darkModeEnabled.value;
6
+ }
7
+ function getDarkModeUserPreference() {
8
+ return matchMedia("(prefers-color-scheme: dark)").matches;
9
+ }
10
+ function toggleDarkMode(enabled, root = document.documentElement) {
11
+ const newState = enabled === "auto" ? getDarkModeUserPreference() : enabled ?? !darkModeEnabled.value;
12
+ if (newState === darkModeEnabled.value) return;
13
+ darkModeEnabled.value = newState;
14
+ root.classList.toggle("odx-dark-mode", darkModeEnabled.value);
15
+ root.classList.toggle("odx-light-mode", !darkModeEnabled.value);
16
+ }
17
+
18
+ export { getDarkModeUserPreference, isDarkModeEnabled, toggleDarkMode };
package/dist/vendor.js CHANGED
@@ -1,31 +1,3 @@
1
- import { effect } from '@preact/signals-core';
2
- import 'lit/html.js';
3
- import { directive } from 'lit/directive.js';
4
- import { AsyncDirective } from 'lit/async-directive.js';
5
-
6
- function groupBy(arr, getKeyFromItem) {
7
- const result = {};
8
- for (let i = 0; i < arr.length; i++) {
9
- const item = arr[i];
10
- const key = getKeyFromItem(item);
11
- if (!Object.hasOwn(result, key)) {
12
- result[key] = [];
13
- }
14
- result[key].push(item);
15
- }
16
- return result;
17
- }
18
-
19
- function keyBy(arr, getKeyFromItem) {
20
- const result = {};
21
- for (let i = 0; i < arr.length; i++) {
22
- const item = arr[i];
23
- const key = getKeyFromItem(item);
24
- result[key] = item;
25
- }
26
- return result;
27
- }
28
-
29
1
  function minBy(items, getValue) {
30
2
  if (items.length === 0) {
31
3
  return undefined;
@@ -107,18 +79,6 @@ function pick(obj, keys) {
107
79
  return result;
108
80
  }
109
81
 
110
- /**
111
- * @license
112
- * Copyright 2023 Google LLC
113
- * SPDX-License-Identifier: BSD-3-Clause
114
- */function e(e){return class extends e{performUpdate(){var e;if(false===this.isUpdatePending)return;null===(e=this._$Oo)||void 0===e||e.call(this);let s=true;this._$Oo=effect((()=>{s?(s=false,super.performUpdate()):this.requestUpdate();}));}connectedCallback(){super.connectedCallback(),this.requestUpdate();}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Oo)||void 0===t||t.call(this);}}}
115
-
116
- /**
117
- * @license
118
- * Copyright 2023 Google LLC
119
- * SPDX-License-Identifier: BSD-3-Clause
120
- */directive(class extends AsyncDirective{render(i){var t;if(i!==this._$Oi){null===(t=this._$Oo)||void 0===t||t.call(this),this._$Oi=i;let s=true;this._$Oo=i.subscribe((i=>{ false===s&&this.setValue(i);})),s=false;}return i.peek()}disconnected(){var i;null===(i=this._$Oo)||void 0===i||i.call(this);}reconnected(){var i;this._$Oo=null===(i=this._$Oi)||void 0===i?void 0:i.subscribe((i=>{this.setValue(i);}));}});
121
-
122
82
  /**
123
83
  * Custom positioning reference element.
124
84
  * @see https://floating-ui.com/docs/virtual-elements
@@ -1988,4 +1948,4 @@ function throttle(func, throttleMs, { signal, edges = ['leading', 'trailing'] }
1988
1948
  return throttled;
1989
1949
  }
1990
1950
 
1991
- export { RovingTabindexController as R, size as a, arrow as b, computePosition as c, autoUpdate as d, e, flip as f, groupBy as g, hide as h, debounce as i, flattenObject as j, keyBy as k, minBy as m, offset as o, pick as p, round as r, shift as s, throttle as t, uniqBy as u };
1951
+ export { RovingTabindexController as R, flip as a, size as b, computePosition as c, arrow as d, autoUpdate as e, flattenObject as f, debounce as g, hide as h, minBy as m, offset as o, pick as p, round as r, shift as s, throttle as t, uniqBy as u };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@odx/foundation",
3
3
  "displayName": "ODX Design System Foundation",
4
4
  "description": "A library of Web Component building blocks for ODX",
5
- "version": "1.0.0-beta.235",
5
+ "version": "1.0.0-beta.237",
6
6
  "author": "Drägerwerk AG & Co.KGaA",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "homepage": "https://odx.draeger.com",
@@ -16,6 +16,7 @@
16
16
  "type": "module",
17
17
  "dependencies": {
18
18
  "@lit/context": "1.1.6",
19
+ "@lit-labs/preact-signals": "1.0.3",
19
20
  "@preact/signals-core": "1.12.1",
20
21
  "lit": "3.3.1"
21
22
  },
@@ -25,10 +26,9 @@
25
26
  },
26
27
  "devDependencies": {
27
28
  "@floating-ui/dom": "1.7.4",
28
- "@lit-labs/preact-signals": "1.0.3",
29
29
  "@lit-labs/rollup-plugin-minify-html-literals": "0.1.0",
30
30
  "@odx/icons": "4.0.0-rc.49",
31
- "@spectrum-web-components/reactive-controllers": "1.8.0",
31
+ "@spectrum-web-components/reactive-controllers": "1.9.0",
32
32
  "es-toolkit": "1.40.0",
33
33
  "sass-embedded": "1.93.2",
34
34
  "stylelint": "16.25.0",
@@ -53,11 +53,6 @@
53
53
  "types": "./dist/breakpoints/main.d.ts"
54
54
  },
55
55
  "./breakpoints/*": null,
56
- "./config": {
57
- "import": "./dist/config.js",
58
- "types": "./dist/config/main.d.ts"
59
- },
60
- "./config/*": null,
61
56
  "./components": {
62
57
  "import": "./dist/components.js",
63
58
  "types": "./dist/components/main.d.ts"
@@ -72,6 +67,15 @@
72
67
  "types": "./dist/i18n/main.d.ts"
73
68
  },
74
69
  "./i18n/*": null,
70
+ "./signals": {
71
+ "import": "./dist/signals.js",
72
+ "types": "./dist/signals/main.d.ts"
73
+ },
74
+ "./theming": {
75
+ "import": "./dist/theming.js",
76
+ "types": "./dist/theming/main.d.ts"
77
+ },
78
+ "./theming/*": null,
75
79
  "./utils": {
76
80
  "import": "./dist/utils.js",
77
81
  "types": "./dist/utils/main.d.ts"
@@ -1,3 +0,0 @@
1
- export declare function observeDarkModeChange(callback: (enabled: boolean) => void): () => void;
2
- export declare function isDarkModeEnabled(): boolean;
3
- //# sourceMappingURL=dark-mode.d.ts.map
package/dist/config.js DELETED
@@ -1,23 +0,0 @@
1
- import { observeMedia } from '@odx/foundation/utils';
2
- import { signal } from '@preact/signals-core';
3
-
4
- let darkModeObserver;
5
- const darkModeEnabled = signal(false, {
6
- watched() {
7
- darkModeObserver ??= observeDarkModeChange((enabled) => {
8
- this.value = enabled;
9
- });
10
- },
11
- unwatched() {
12
- darkModeObserver?.();
13
- darkModeObserver = void 0;
14
- }
15
- });
16
- function observeDarkModeChange(callback) {
17
- return observeMedia("(prefers-color-scheme: dark)", ({ matches }) => callback(matches));
18
- }
19
- function isDarkModeEnabled() {
20
- return darkModeEnabled.value;
21
- }
22
-
23
- export { isDarkModeEnabled, observeDarkModeChange };
File without changes