Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(button): add first version readme #7

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Philosophy

Accesibility shouldn't be a choice, it should be a given. This library tries to be a mirror of the [WAI-ARIA patterns](https://www.w3.org/WAI/ARIA/apg/patterns/). This library effectively export these accesible atoms to be extended with application specific needs but disregarding the accesibility aspect

## Characteristics

- It completely complies to WAI-ARIA specifications
- It's framework agnostic

## Modules

- [button](packages/button/README.md)
7 changes: 1 addition & 6 deletions apps/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
<button is="ariabones-button" _="on click set @disabled to true">
Disable button
</button>
<button
is="ariabones-button"
data-type="toggle"
data-pressed="true"
style="display: flex; align-items: center; justify-content: center"
>
<button is="ariabones-button" data-type="toggle" data-pressed="true">
Toggle button
</button>
</section>
Expand Down
32 changes: 31 additions & 1 deletion packages/button/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,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 |