New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ariabones/button

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ariabones/button - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

15

dist/index.js

@@ -21,9 +21,10 @@ // src/index.ts

this.setAttribute("aria-pressed", pressed ?? "false");
this.setAttribute("_", `
on click
if @aria-pressed equals 'true'
set @aria-pressed to 'false'
else
set @aria-pressed to 'true'
`);
this.addEventListener("click", () => {
const ariaPressed = this.getAttribute("aria-pressed") ?? "false";
if (ariaPressed === "true") {
this.setAttribute("aria-pressed", "false");
} else {
this.setAttribute("aria-pressed", "true");
}
});
}

@@ -30,0 +31,0 @@ if (newValue === "menu") {

{
"name": "@ariabones/button",
"type": "module",
"version": "0.2.1",
"version": "0.3.0",
"author": "Nicolas Accetta",

@@ -6,0 +6,0 @@ "repository": {

@@ -1,1 +0,31 @@

# @ariabones/button
## toggle
### installation
```
npm install @ariabones/button
yarn add @ariabones/button
pnpm install @ariabones/button
```
### usage
```html
<button is="ariabones-button" data-type="toggle" data-pressed="true">
Toggle button
</button>
```
### api
| property | type | default | description |
| ------------ | ----------------- | ------- | --------------------------------------------------- |
| data-pressed | "true" or "false" | "false" | used to set up the initial value of aria-pressed |
| aria-pressed | "true" or "false" | "false" | indicates if the button is currently pressed or not |
### keyboard interaction
| key | description |
| ----- | ------------------ |
| Space | toggles the button |
| Enter | toggles the button |

Sorry, the diff of this file is not supported yet

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