@aria-ui/menu
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -69,3 +69,3 @@ import * as _aria_ui_core from '@aria-ui/core'; | ||
*/ | ||
declare function useMenuContent(element: ConnectableElement, props?: Partial<MenuContentProps>): SignalState<MenuContentProps>; | ||
declare function useMenuContent(element: ConnectableElement, state: SignalState<MenuContentProps>): void; | ||
@@ -129,3 +129,3 @@ /** | ||
*/ | ||
declare function useMenuItem(element: ConnectableElement, props?: Partial<MenuItemProps>): _aria_ui_core.SignalState<Readonly<MenuItemProps>>; | ||
declare function useMenuItem(element: ConnectableElement, state: SignalState<MenuItemProps>): void; | ||
@@ -161,3 +161,3 @@ declare const MenuRootElement_base: { | ||
*/ | ||
declare function useMenuRoot(element: ConnectableElement, props?: Partial<MenuRootProps>): SignalState<MenuRootProps>; | ||
declare function useMenuRoot(element: ConnectableElement, state: SignalState<MenuRootProps>): void; | ||
@@ -185,4 +185,4 @@ declare const MenuTriggerElement_base: { | ||
declare function useMenuTrigger(element: ConnectableElement): {}; | ||
declare function useMenuTrigger(element: ConnectableElement): void; | ||
export { MenuContentElement, type MenuContentProps, MenuItemElement, type MenuItemProps, MenuRootElement, type MenuRootProps, MenuTriggerElement, type MenuTriggerProps, defaultMenuContentProps, defaultMenuItemProps, defaultMenuRootProps, defaultMenuTriggerProps, useMenuContent as useMenu, useMenuItem, useMenuRoot, useMenuTrigger }; |
// src/menu-content.element.gen.ts | ||
import { ElementMixin } from "@aria-ui/core"; | ||
import { ElementBuilder } from "@aria-ui/core"; | ||
@@ -43,11 +43,4 @@ // src/menu-content.props.ts | ||
// src/menu-content.state.ts | ||
function useMenuContent(element, props) { | ||
var _a; | ||
const popoverState = usePopoverContent(element, props); | ||
const state = { | ||
...popoverState, | ||
onKeydownHandlerAdd: createSignal( | ||
(_a = props == null ? void 0 : props.onKeydownHandlerAdd) != null ? _a : defaultMenuContentProps.onKeydownHandlerAdd | ||
) | ||
}; | ||
function useMenuContent(element, state) { | ||
usePopoverContent(element, state); | ||
useAriaRole(element, "menu"); | ||
@@ -74,3 +67,2 @@ const focusedValue = createSignal(""); | ||
useSelect(element, onOpenChange, selectedValue, collection); | ||
return state; | ||
} | ||
@@ -129,3 +121,3 @@ function useCollectionKeydownHandler(element, collection, focusedValue, selectedValue, onKeydownHandlerAdd) { | ||
// src/menu-content.element.gen.ts | ||
var MenuContentElement = class extends ElementMixin( | ||
var MenuContentElement = class extends ElementBuilder( | ||
useMenuContent, | ||
@@ -137,3 +129,3 @@ defaultMenuContentProps | ||
// src/menu-item.element.gen.ts | ||
import { ElementMixin as ElementMixin2 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder2 } from "@aria-ui/core"; | ||
@@ -151,5 +143,3 @@ // src/menu-item.props.ts | ||
import { | ||
assignProps, | ||
createComputed as createComputed2, | ||
mapSignals, | ||
useAriaAttribute, | ||
@@ -163,4 +153,3 @@ useAriaRole as useAriaRole2, | ||
import { nanoid } from "nanoid"; | ||
function useMenuItem(element, props) { | ||
const state = mapSignals(assignProps(defaultMenuItemProps, props)); | ||
function useMenuItem(element, state) { | ||
if (!state.value.peek()) { | ||
@@ -212,7 +201,6 @@ state.value.set(nanoid()); | ||
usePresence(element, presence); | ||
return state; | ||
} | ||
// src/menu-item.element.gen.ts | ||
var MenuItemElement = class extends ElementMixin2( | ||
var MenuItemElement = class extends ElementBuilder2( | ||
useMenuItem, | ||
@@ -224,3 +212,3 @@ defaultMenuItemProps | ||
// src/menu-root.element.gen.ts | ||
import { ElementMixin as ElementMixin3 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder3 } from "@aria-ui/core"; | ||
@@ -240,4 +228,4 @@ // src/menu-root.props.ts | ||
import { usePopoverRoot } from "@aria-ui/popover"; | ||
function useMenuRoot(element, props) { | ||
const state = usePopoverRoot(element, props); | ||
function useMenuRoot(element, state) { | ||
usePopoverRoot(element, state); | ||
onOpenChangeContext.provide( | ||
@@ -251,7 +239,6 @@ element, | ||
); | ||
return state; | ||
} | ||
// src/menu-root.element.gen.ts | ||
var MenuRootElement = class extends ElementMixin3( | ||
var MenuRootElement = class extends ElementBuilder3( | ||
useMenuRoot, | ||
@@ -263,3 +250,3 @@ defaultMenuRootProps | ||
// src/menu-trigger.element.gen.ts | ||
import { ElementMixin as ElementMixin4 } from "@aria-ui/core"; | ||
import { ElementBuilder as ElementBuilder4 } from "@aria-ui/core"; | ||
@@ -278,7 +265,6 @@ // src/menu-trigger.props.ts | ||
usePopoverTrigger(element); | ||
return {}; | ||
} | ||
// src/menu-trigger.element.gen.ts | ||
var MenuTriggerElement = class extends ElementMixin4( | ||
var MenuTriggerElement = class extends ElementBuilder4( | ||
useMenuTrigger, | ||
@@ -285,0 +271,0 @@ defaultMenuTriggerProps |
{ | ||
"name": "@aria-ui/menu", | ||
"type": "module", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"private": false, | ||
@@ -13,6 +13,6 @@ "sideEffects": false, | ||
"@aria-ui/collection": "^0.0.3", | ||
"@aria-ui/core": "^0.0.15", | ||
"@aria-ui/overlay": "^0.0.16", | ||
"@aria-ui/popover": "^0.0.16", | ||
"@aria-ui/presence": "^0.0.10", | ||
"@aria-ui/core": "^0.0.16", | ||
"@aria-ui/overlay": "^0.0.17", | ||
"@aria-ui/popover": "^0.0.17", | ||
"@aria-ui/presence": "^0.0.11", | ||
"nanoid": "^5.0.7" | ||
@@ -22,3 +22,3 @@ }, | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.4.5" | ||
"typescript": "^5.5.2" | ||
}, | ||
@@ -25,0 +25,0 @@ "publishConfig": { |
@@ -8,3 +8,3 @@ # @aria-ui/menu | ||
```ts | ||
function useMenuTrigger(element: ConnectableElement): object; | ||
function useMenuTrigger(element: ConnectableElement): void; | ||
``` | ||
@@ -79,3 +79,3 @@ | ||
| `defaultOpen` | `boolean` | <p>Whether the popover is open by default.</p><p>**Default**</p><code>false</code> | | ||
| `onOpenChange` | `null` \| (`open`: `boolean`) => `void` | <p>Event handler called when the user opens or closes the popover.</p><p>**Default**</p><code>null</code> | | ||
| `onOpenChange` | `null` \| (`open`: `boolean`) => `void` | <p>Event handler called then the open state changes because of a user interaction.</p><p>**Default**</p><code>null</code> | | ||
| `open` | `boolean` | <p>Whether the popover is open.</p><p>**Default**</p><code>false</code> | | ||
@@ -82,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20386
429
+ Added@aria-ui/core@0.0.16(transitive)
+ Added@aria-ui/overlay@0.0.17(transitive)
+ Added@aria-ui/popover@0.0.17(transitive)
+ Added@aria-ui/presence@0.0.11(transitive)
+ Added@zag-js/dismissable@0.58.3(transitive)
+ Added@zag-js/dom-event@0.58.3(transitive)
+ Added@zag-js/dom-query@0.58.3(transitive)
+ Added@zag-js/interact-outside@0.58.3(transitive)
+ Added@zag-js/text-selection@0.58.3(transitive)
+ Added@zag-js/types@0.58.3(transitive)
+ Added@zag-js/utils@0.58.3(transitive)
- Removed@aria-ui/core@0.0.15(transitive)
- Removed@aria-ui/overlay@0.0.16(transitive)
- Removed@aria-ui/popover@0.0.16(transitive)
- Removed@aria-ui/presence@0.0.10(transitive)
- Removed@zag-js/dismissable@0.57.0(transitive)
- Removed@zag-js/dom-event@0.57.0(transitive)
- Removed@zag-js/dom-query@0.57.0(transitive)
- Removed@zag-js/interact-outside@0.57.0(transitive)
- Removed@zag-js/text-selection@0.57.0(transitive)
- Removed@zag-js/types@0.57.0(transitive)
- Removed@zag-js/utils@0.57.0(transitive)
Updated@aria-ui/core@^0.0.16
Updated@aria-ui/overlay@^0.0.17
Updated@aria-ui/popover@^0.0.17
Updated@aria-ui/presence@^0.0.11