@sit-onyx/headless 1.0.0-beta.20 → 1.0.0-beta.21

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 (32) hide show
  1. package/package.json +5 -2
  2. package/src/composables/comboBox/SelectOnlyCombobox.vue +1 -1
  3. package/src/composables/comboBox/TestCombobox.ct.tsx +1 -1
  4. package/src/composables/comboBox/TestCombobox.vue +1 -1
  5. package/src/composables/comboBox/createComboBox.ts +6 -6
  6. package/src/composables/helpers/useDismissible.ts +1 -1
  7. package/src/composables/helpers/useGlobalListener.spec.ts +2 -2
  8. package/src/composables/helpers/useOutsideClick.spec.ts +2 -2
  9. package/src/composables/helpers/useOutsideClick.ts +2 -2
  10. package/src/composables/helpers/useTypeAhead.spec.ts +1 -1
  11. package/src/composables/helpers/useTypeAhead.ts +2 -2
  12. package/src/composables/listbox/TestListbox.ct.tsx +1 -1
  13. package/src/composables/listbox/TestListbox.vue +1 -1
  14. package/src/composables/listbox/createListbox.ts +3 -3
  15. package/src/composables/menuButton/TestMenuButton.ct.tsx +1 -1
  16. package/src/composables/menuButton/TestMenuButton.vue +1 -1
  17. package/src/composables/menuButton/createMenuButton.ts +4 -4
  18. package/src/composables/navigationMenu/TestMenu.ct.tsx +1 -1
  19. package/src/composables/navigationMenu/TestMenu.vue +1 -1
  20. package/src/composables/navigationMenu/createMenu.ts +2 -2
  21. package/src/composables/tabs/TestTabs.ct.tsx +1 -1
  22. package/src/composables/tabs/TestTabs.vue +1 -1
  23. package/src/composables/tabs/createTabs.ts +1 -1
  24. package/src/composables/tooltip/createToggletip.ts +2 -2
  25. package/src/composables/tooltip/createTooltip.ts +2 -2
  26. package/src/index.ts +11 -11
  27. package/src/playwright.ts +5 -5
  28. package/src/utils/builder.ts +1 -1
  29. package/src/utils/keyboard.spec.ts +1 -1
  30. package/src/utils/keyboard.ts +1 -1
  31. package/src/utils/math.spec.ts +1 -1
  32. package/src/utils/object.spec.ts +1 -1
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@sit-onyx/headless",
3
3
  "description": "Headless composables for Vue",
4
- "version": "1.0.0-beta.20",
4
+ "version": "1.0.0-beta.21",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
7
7
  "license": "Apache-2.0",
8
+ "engines": {
9
+ "node": ">=20"
10
+ },
8
11
  "files": [
9
12
  "src"
10
13
  ],
@@ -29,7 +32,7 @@
29
32
  "devDependencies": {
30
33
  "@vue/compiler-dom": "3.5.16",
31
34
  "vue": "3.5.16",
32
- "@sit-onyx/shared": "^1.0.0-beta.3"
35
+ "@sit-onyx/shared": "^1.0.0-beta.4"
33
36
  },
34
37
  "scripts": {
35
38
  "build": "vue-tsc --build --force",
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, useTemplateRef } from "vue";
3
- import { createComboBox } from "./createComboBox";
3
+ import { createComboBox } from "./createComboBox.js";
4
4
 
5
5
  const options = ["a", "b", "c", "d"];
6
6
  const isExpanded = ref(false);
@@ -1,5 +1,5 @@
1
1
  import { test } from "@playwright/experimental-ct-vue";
2
- import { comboboxSelectOnlyTesting, comboboxTesting } from "./createComboBox.testing";
2
+ import { comboboxSelectOnlyTesting, comboboxTesting } from "./createComboBox.testing.js";
3
3
  import SelectOnlyCombobox from "./SelectOnlyCombobox.vue";
4
4
  import TestCombobox from "./TestCombobox.vue";
5
5
 
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, useTemplateRef } from "vue";
3
- import { createComboBox } from "./createComboBox";
3
+ import { createComboBox } from "./createComboBox.js";
4
4
 
5
5
  const options = ["a", "b", "c", "d"];
6
6
  const isExpanded = ref(false);
@@ -1,14 +1,14 @@
1
1
  import { computed, unref, useId, type MaybeRef, type Ref } from "vue";
2
- import { createBuilder } from "../../utils/builder";
3
- import { isPrintableCharacter, wasKeyPressed, type PressedKey } from "../../utils/keyboard";
4
- import type { Nullable } from "../../utils/types";
5
- import { useOutsideClick } from "../helpers/useOutsideClick";
6
- import { useTypeAhead } from "../helpers/useTypeAhead";
2
+ import { createBuilder } from "../../utils/builder.js";
3
+ import { isPrintableCharacter, wasKeyPressed, type PressedKey } from "../../utils/keyboard.js";
4
+ import type { Nullable } from "../../utils/types.js";
5
+ import { useOutsideClick } from "../helpers/useOutsideClick.js";
6
+ import { useTypeAhead } from "../helpers/useTypeAhead.js";
7
7
  import {
8
8
  createListbox,
9
9
  type CreateListboxOptions,
10
10
  type ListboxValue,
11
- } from "../listbox/createListbox";
11
+ } from "../listbox/createListbox.js";
12
12
 
13
13
  /** See https://w3c.github.io/aria/#aria-autocomplete */
14
14
  export type ComboboxAutoComplete = "none" | "list" | "both";
@@ -1,5 +1,5 @@
1
1
  import { computed, type Ref } from "vue";
2
- import { useGlobalEventListener } from "./useGlobalListener";
2
+ import { useGlobalEventListener } from "./useGlobalListener.js";
3
3
 
4
4
  type UseDismissibleOptions = { isExpanded: Ref<boolean> };
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { beforeEach, describe, expect, it, vi } from "vitest";
2
2
  import { ref, type Ref } from "vue";
3
- import { mockVueLifecycle } from "../../utils/vitest";
4
- import { useGlobalEventListener } from "./useGlobalListener";
3
+ import { mockVueLifecycle } from "../../utils/vitest.js";
4
+ import { useGlobalEventListener } from "./useGlobalListener.js";
5
5
 
6
6
  let unmount: () => Promise<void> | undefined;
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { beforeEach, describe, expect, it, vi } from "vitest";
2
2
  import { ref } from "vue";
3
- import { mockVueLifecycle } from "../../utils/vitest";
4
- import { useOutsideClick } from "./useOutsideClick";
3
+ import { mockVueLifecycle } from "../../utils/vitest.js";
4
+ import { useOutsideClick } from "./useOutsideClick.js";
5
5
 
6
6
  describe("useOutsideClick", () => {
7
7
  beforeEach(() => {
@@ -1,7 +1,7 @@
1
1
  import type { Arrayable } from "vitest"; // For an unknown reason removing this import will break the build of "demo-app" and "playground"
2
2
  import { toValue, type MaybeRefOrGetter, type Ref } from "vue";
3
- import type { Nullable } from "../../utils/types";
4
- import { useGlobalEventListener } from "./useGlobalListener";
3
+ import type { Nullable } from "../../utils/types.js";
4
+ import { useGlobalEventListener } from "./useGlobalListener.js";
5
5
 
6
6
  export type UseOutsideClickOptions<TCheckOnTab extends boolean | undefined = undefined> = {
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  import { beforeAll, expect, test, vi } from "vitest";
2
- import { useTypeAhead } from "./useTypeAhead";
2
+ import { useTypeAhead } from "./useTypeAhead.js";
3
3
 
4
4
  beforeAll(() => {
5
5
  vi.useFakeTimers();
@@ -1,5 +1,5 @@
1
- import { isPrintableCharacter } from "../../utils/keyboard";
2
- import { debounce } from "../../utils/timer";
1
+ import { isPrintableCharacter } from "../../utils/keyboard.js";
2
+ import { debounce } from "../../utils/timer.js";
3
3
 
4
4
  /**
5
5
  * Enhances typeAhead to combine multiple inputs in quick succession and filter out non-printable characters.
@@ -1,6 +1,6 @@
1
1
  import { test } from "@playwright/experimental-ct-vue";
2
2
  import TestListbox from "./TestListbox.vue";
3
- import { listboxTesting } from "./createListbox.testing";
3
+ import { listboxTesting } from "./createListbox.testing.js";
4
4
 
5
5
  test("listbox", async ({ mount, page }) => {
6
6
  await mount(<TestListbox />);
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from "vue";
3
- import { createListbox } from "./createListbox";
3
+ import { createListbox } from "./createListbox.js";
4
4
 
5
5
  type Options = (typeof options)[number];
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { computed, nextTick, ref, unref, useId, watchEffect, type MaybeRef, type Ref } from "vue";
2
- import { createBuilder, type VBindAttributes } from "../../utils/builder";
3
- import type { Nullable } from "../../utils/types";
4
- import { useTypeAhead } from "../helpers/useTypeAhead";
2
+ import { createBuilder, type VBindAttributes } from "../../utils/builder.js";
3
+ import type { Nullable } from "../../utils/types.js";
4
+ import { useTypeAhead } from "../helpers/useTypeAhead.js";
5
5
 
6
6
  export type ListboxValue = string | number | boolean;
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { test } from "@playwright/experimental-ct-vue";
2
- import { menuButtonTesting } from "./createMenuButton.testing";
2
+ import { menuButtonTesting } from "./createMenuButton.testing.js";
3
3
  import TestMenuButton from "./TestMenuButton.vue";
4
4
 
5
5
  test("menuButton", async ({ mount, page }) => {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from "vue";
3
- import { createMenuButton } from "./createMenuButton";
3
+ import { createMenuButton } from "./createMenuButton.js";
4
4
 
5
5
  const items = Array.from({ length: 10 }, (_, index) => {
6
6
  const id = index + 1;
@@ -1,8 +1,8 @@
1
1
  import { computed, toValue, useId, watch, type MaybeRef, type Ref } from "vue";
2
- import { createBuilder, createElRef } from "../../utils/builder";
3
- import { debounce } from "../../utils/timer";
4
- import { useGlobalEventListener } from "../helpers/useGlobalListener";
5
- import { useOutsideClick } from "../helpers/useOutsideClick";
2
+ import { createBuilder, createElRef } from "../../utils/builder.js";
3
+ import { debounce } from "../../utils/timer.js";
4
+ import { useGlobalEventListener } from "../helpers/useGlobalListener.js";
5
+ import { useOutsideClick } from "../helpers/useOutsideClick.js";
6
6
 
7
7
  type CreateMenuButtonOptions = {
8
8
  isExpanded: Readonly<Ref<boolean>>;
@@ -1,5 +1,5 @@
1
1
  import { test } from "@playwright/experimental-ct-vue";
2
- import { navigationTesting } from "./createMenu.testing";
2
+ import { navigationTesting } from "./createMenu.testing.js";
3
3
  import TestMenu from "./TestMenu.vue";
4
4
 
5
5
  test("navigationMenu", async ({ mount, page }) => {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import TestMenuButton from "../menuButton/TestMenuButton.vue";
3
- import { createNavigationMenu } from "./createMenu";
3
+ import { createNavigationMenu } from "./createMenu.js";
4
4
 
5
5
  const {
6
6
  elements: { nav },
@@ -1,6 +1,6 @@
1
1
  import { unref, useId, type MaybeRef } from "vue";
2
- import { createBuilder } from "../../utils/builder";
3
- import { MathUtils } from "../../utils/math";
2
+ import { createBuilder } from "../../utils/builder.js";
3
+ import { MathUtils } from "../../utils/math.js";
4
4
 
5
5
  type CreateNavigationMenu = {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { test } from "@playwright/experimental-ct-vue";
2
2
  import TestTabs from "./TestTabs.vue";
3
- import { tabsTesting } from "./createTabs.testing";
3
+ import { tabsTesting } from "./createTabs.testing.js";
4
4
 
5
5
  test("tabs", async ({ mount, page }) => {
6
6
  const component = await mount(<TestTabs />);
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref } from "vue";
3
- import { createTabs } from "./createTabs";
3
+ import { createTabs } from "./createTabs.js";
4
4
 
5
5
  const selectedTab = ref("tab-1");
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { computed, unref, useId, type MaybeRef, type Ref } from "vue";
2
- import { createBuilder } from "../../utils/builder";
2
+ import { createBuilder } from "../../utils/builder.js";
3
3
 
4
4
  type CreateTabsOptions<TKey extends PropertyKey = PropertyKey> = {
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { computed, toRef, toValue, useId, type MaybeRefOrGetter, type Ref } from "vue";
2
- import { createBuilder } from "../../utils/builder";
3
- import { useDismissible } from "../helpers/useDismissible";
2
+ import { createBuilder } from "../../utils/builder.js";
3
+ import { useDismissible } from "../helpers/useDismissible.js";
4
4
 
5
5
  export type CreateToggletipOptions = {
6
6
  toggleLabel: MaybeRefOrGetter<string>;
@@ -1,6 +1,6 @@
1
1
  import { computed, toRef, toValue, useId, type MaybeRefOrGetter, type Ref } from "vue";
2
- import { createBuilder } from "../../utils/builder";
3
- import { useDismissible } from "../helpers/useDismissible";
2
+ import { createBuilder } from "../../utils/builder.js";
3
+ import { useDismissible } from "../helpers/useDismissible.js";
4
4
 
5
5
  export type CreateTooltipOptions = {
6
6
  /**
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
- export * from "./composables/comboBox/createComboBox";
2
- export * from "./composables/helpers/useGlobalListener";
3
- export * from "./composables/listbox/createListbox";
4
- export * from "./composables/menuButton/createMenuButton";
5
- export * from "./composables/navigationMenu/createMenu";
6
- export * from "./composables/tabs/createTabs";
7
- export * from "./composables/tooltip/createToggletip";
8
- export * from "./composables/tooltip/createTooltip";
9
- export * from "./utils/builder";
10
- export { isPrintableCharacter, wasKeyPressed } from "./utils/keyboard";
11
- export { debounce } from "./utils/timer";
1
+ export * from "./composables/comboBox/createComboBox.js";
2
+ export * from "./composables/helpers/useGlobalListener.js";
3
+ export * from "./composables/listbox/createListbox.js";
4
+ export * from "./composables/menuButton/createMenuButton.js";
5
+ export * from "./composables/navigationMenu/createMenu.js";
6
+ export * from "./composables/tabs/createTabs.js";
7
+ export * from "./composables/tooltip/createToggletip.js";
8
+ export * from "./composables/tooltip/createTooltip.js";
9
+ export * from "./utils/builder.js";
10
+ export { isPrintableCharacter, wasKeyPressed } from "./utils/keyboard.js";
11
+ export { debounce } from "./utils/timer.js";
package/src/playwright.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./composables/comboBox/createComboBox.testing";
2
- export * from "./composables/listbox/createListbox.testing";
3
- export * from "./composables/menuButton/createMenuButton.testing";
4
- export * from "./composables/navigationMenu/createMenu.testing";
5
- export * from "./composables/tabs/createTabs.testing";
1
+ export * from "./composables/comboBox/createComboBox.testing.js";
2
+ export * from "./composables/listbox/createListbox.testing.js";
3
+ export * from "./composables/menuButton/createMenuButton.testing.js";
4
+ export * from "./composables/navigationMenu/createMenu.testing.js";
5
+ export * from "./composables/tabs/createTabs.testing.js";
@@ -8,7 +8,7 @@ import {
8
8
  type WritableComputedOptions,
9
9
  type WritableComputedRef,
10
10
  } from "vue";
11
- import type { IfDefined } from "./types";
11
+ import type { IfDefined } from "./types.js";
12
12
 
13
13
  /**
14
14
  * Properties as they can be used by `v-bind` on an HTML element.
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "vitest";
2
- import { isPrintableCharacter, wasKeyPressed } from "./keyboard";
2
+ import { isPrintableCharacter, wasKeyPressed } from "./keyboard.js";
3
3
 
4
4
  test.each([
5
5
  // ARRANGE
@@ -1,4 +1,4 @@
1
- import { isSubsetMatching } from "./object";
1
+ import { isSubsetMatching } from "./object.js";
2
2
 
3
3
  export type PressedKey =
4
4
  | string
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import { MathUtils } from "./math";
2
+ import { MathUtils } from "./math.js";
3
3
 
4
4
  describe("MathUtils.clamp", () => {
5
5
  test.each([
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "vitest";
2
- import { isSubsetMatching } from "./object";
2
+ import { isSubsetMatching } from "./object.js";
3
3
 
4
4
  const referenceObj = { a: 42, b: "foo", c: null, d: true };
5
5