Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solid-aria/overlays

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-aria/overlays - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

69

dist/cjs/index.js

@@ -10,2 +10,3 @@ 'use strict';

var utils$1 = require('@solid-aria/utils');
var platform = require('@solid-primitives/platform');
var visuallyHidden = require('@solid-aria/visually-hidden');

@@ -282,5 +283,8 @@

const modalProps = solidJs.createMemo(() => ({
"data-ismodal": !(props !== null && props !== void 0 && props.isDisabled)
}));
const modalProps = {
get "data-ismodal"() {
return !(props !== null && props !== void 0 && props.isDisabled);
}
};
solidJs.createEffect(() => {

@@ -412,9 +416,8 @@ var _context$parent;

const overlayProps = solidJs.createMemo(() => ({
onKeyDown,
...focusWithinProps()
}));
const underlayProps = solidJs.createMemo(() => ({
const overlayProps = solidJs.mergeProps({
onKeyDown
}, focusWithinProps);
const underlayProps = {
onPointerDown: onPointerDownUnderlay
}));
};
return {

@@ -500,26 +503,34 @@ overlayProps,

*/
function createOverlayTrigger(props) {
function createOverlayTrigger(props, state = createOverlayTriggerState(props)) {
const overlayId = utils$1.createId();
const state = createOverlayTriggerState(props); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
// https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
// However, we only add it for menus for now because screen readers often
// announce it as a menu even for other values.
const triggerProps = {
// Aria 1.1 supports multiple values for aria-haspopup other than just menus.
// https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
// However, we only add it for menus for now because screen readers often
// announce it as a menu even for other values.
get "aria-haspopup"() {
switch (utils.access(props.type)) {
case "menu":
return true;
const ariaHasPopup = solidJs.createMemo(() => {
if (props.type === "menu") {
return true;
case "listbox":
return "listbox";
default:
return;
}
},
get "aria-expanded"() {
return state.isOpen();
},
get "aria-controls"() {
return state.isOpen() ? overlayId : undefined;
}
if (props.type === "listbox") {
return "listbox";
}
});
const triggerProps = solidJs.createMemo(() => ({
"aria-haspopup": ariaHasPopup(),
"aria-expanded": state.isOpen(),
"aria-controls": state.isOpen() ? overlayId : undefined
}));
const overlayProps = solidJs.createMemo(() => ({
};
const overlayProps = {
id: overlayId
}));
};
return {

@@ -563,3 +574,3 @@ triggerProps,

if (utils$1.isIOS()) {
if (platform.isIOS) {
solidJs.onCleanup(preventScrollMobileSafari());

@@ -566,0 +577,0 @@ } else {

{
"name": "@solid-aria/overlays",
"version": "0.0.5",
"version": "0.1.0",
"private": false,

@@ -42,14 +42,23 @@ "description": "Primitives for building accessible overlay components such as dialogs, popovers, and menus.",

],
"scripts": {
"build": "rollup -c",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"dev": "vite serve dev --host",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch --passWithNoTests",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@solid-aria/button": "^0.0.6",
"@solid-aria/i18n": "^0.0.7",
"@solid-aria/interactions": "^0.0.7",
"@solid-aria/types": "^0.0.5",
"@solid-aria/utils": "^0.0.6",
"@solid-aria/visually-hidden": "^0.0.7"
"@solid-aria/button": "workspace:^",
"@solid-aria/i18n": "workspace:^",
"@solid-aria/interactions": "workspace:^",
"@solid-aria/types": "workspace:^",
"@solid-aria/utils": "workspace:^",
"@solid-aria/visually-hidden": "workspace:^",
"@solid-primitives/platform": "^0.0.100"
},
"peerDependencies": {
"@solid-primitives/props": "^2.1.2",
"@solid-primitives/props": "^2.1.4",
"@solid-primitives/utils": "^2.0.1",
"solid-js": "^1.4.3"
"solid-js": "^1.4.4"
},

@@ -64,11 +73,3 @@ "publishConfig": {

"category": ""
},
"scripts": {
"build": "rollup -c",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"dev": "vite serve dev --host",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch --passWithNoTests",
"typecheck": "tsc --noEmit"
}
}
}

@@ -128,5 +128,3 @@ <p>

const rootProps = createMemo(() => {
return combineProps(overlayProps(), dialogProps(), modalProps(), others);
});
const rootProps = combineProps(overlayProps, dialogProps, modalProps, others);

@@ -136,3 +134,3 @@ return (

<div
{...rootProps()}
{...rootProps}
ref={mergeRefs(el => (ref = el), local.ref)}

@@ -176,3 +174,3 @@ style={{

<>
<button {...buttonProps()} {...triggerProps()} ref={triggerRef}>
<button {...buttonProps} {...triggerProps} ref={triggerRef}>
Open Popover

@@ -183,3 +181,3 @@ </button>

<Popover
{...overlayProps()}
{...overlayProps}
ref={overlayRef}

@@ -186,0 +184,0 @@ title="Popover title"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc