@sit-onyx/headless 1.0.0-beta.15 → 1.0.0-beta.16

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
@@ -1,9 +1,5 @@
1
1
  <div align="center" style="text-align: center">
2
- <picture>
3
- <source media="(prefers-color-scheme: dark)" type="image/svg+xml" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-light.svg">
4
- <source media="(prefers-color-scheme: light)" type="image/svg+xml" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg">
5
- <img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg" width="160px">
6
- </picture>
2
+ <img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo.svg" height="96px">
7
3
  </div>
8
4
 
9
5
  <br>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/headless",
3
3
  "description": "Headless composables for Vue",
4
- "version": "1.0.0-beta.15",
4
+ "version": "1.0.0-beta.16",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
7
7
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@vue/compiler-dom": "3.5.13",
31
31
  "vue": "3.5.13",
32
- "@sit-onyx/shared": "^0.0.1-beta.0"
32
+ "@sit-onyx/shared": "^1.0.0-beta.1"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "vue-tsc --build --force",
@@ -107,11 +107,7 @@ export const createMenuButton = createBuilder((options: CreateMenuButtonOptions)
107
107
  };
108
108
 
109
109
  const triggerEvents = () => {
110
- if (options.trigger.value === "click") {
111
- return {
112
- onClick: () => setExpanded(true),
113
- };
114
- } else {
110
+ if (options.trigger.value === "hover") {
115
111
  return {
116
112
  onMouseenter: () => setExpanded(true),
117
113
  onMouseleave: () => setExpanded(false, true),
@@ -142,7 +138,9 @@ export const createMenuButton = createBuilder((options: CreateMenuButtonOptions)
142
138
  "aria-controls": menuId,
143
139
  "aria-expanded": options.isExpanded.value,
144
140
  "aria-haspopup": true,
145
- onFocus: () => setExpanded(true),
141
+ onFocus: () => setExpanded(true, true),
142
+ onClick: () =>
143
+ options.trigger.value == "click" ? setExpanded(!options.isExpanded.value) : undefined,
146
144
  id: buttonId,
147
145
  }) as const,
148
146
  ),