Skip to content
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
65 changes: 62 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,66 @@

[Upstatement](https://upstatement.com/) builds websites for various brands and with various technologies but accessibility _conformance_ is a constant across our work. Toolbelt is meant to bridge the knowledge gap in our web accessibility practice by providing components that adhere to [WCAG](https://www.w3.org/WAI/standards-guidelines/wcag/) and [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) patterns out of the box, regardless of the technology stack we use.

## Repository Structure
## Installation

There are two ways to install Toolbelt. In either case, it might be helpful to read through how [installation works for Alpine core](https://alpinejs.dev/essentials/installation). The following guide skips some details that are already covered in Alpine’s documentation.

### From a script tag

The easiest way to install Toolbelt is to include its CDN link. Because Toobelt is an Alpine plugin, you will have to include Alpine as a dependency. In addition, the [Focus](https://alpinejs.dev/plugins/focus) plugin is a required dependency for Toolbelt. Notice that Toolbelt and Alpine plugins come before Alpine core.

Include the following script tags in your `<head>`:

```html
<head>
<!-- Toolbelt -->
<script
src="https://cdn.jsdelivr.net/npm/@upstatement/toolbelt@1.0.0-alpha/dist/plugin.cdn.js"
defer
></script>

<!-- Focus plugin (Toolbelt dependency) -->
<script
src="https://cdn.jsdelivr.net/npm/@alpinejs/focus@3.14.7/dist/cdn.min.js"
defer
></script>

<!-- Alpine core -->
<script
src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.7/dist/cdn.min.js"
defer
></script>
</head>
```

### As a module

If you prefer bundling Toolbelt and its dependencies in your own Javascript bundle, you can install these packages from the npm registry.

1. Install the following packages:

```sh
npm install alpinejs @alpinejs/focus @upstatement/toolbelt
```

1. Import and initialize the packages like so:

```js
import Alpine from "alpinejs";
import focus from "@alpinejs/focus";
import toolbelt from "@upstatement/toolbelt";

window.Alpine = Alpine;

Alpine.plugin(toolbelt);
Alpine.plugin(focus);

Alpine.start();
```

## Contributing

### Repository Structure

This repository hosts the [Astro Starlight](https://starlight.astro.build/) documentation site and library files for Toolbelt.

Expand All @@ -25,7 +84,7 @@ toolbelt
└── vitest.config.js # (Toolbelt) Vitest configuration
```

## Getting Started
### Getting Started

1. Install and use specified Node version.

Expand All @@ -51,7 +110,7 @@ npm run dev
npm run test:watch
```

## Commands
### Commands

| Command | Action |
| ----------------------- | ------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@upstatement/toolbelt",
"type": "module",
"version": "1.0.0-alpha",
"version": "1.0.0-alpha.1",
"description": "Alpine.js plugin for common accessibility patterns and utilities",
"homepage": "https://toolbelt-ui.netlify.app/",
"main": "dist/module.js",
"keywords": [
"components",
Expand All @@ -16,6 +17,10 @@
"files": [
"dist/"
],
"repository": {
"type": "git",
"url": "https://github.com/Upstatement/toolbelt/settings"
},
"scripts": {
"dev": "astro dev --port 3000",
"start": "astro dev --port 3000",
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The CDN links above hardcode the latest versions of each package. For stability

## As a module

If you prefer bundling Toolbelt and its dependencies in your own Javascript bundle, you can install these packages via from the npm registry.
If you prefer bundling Toolbelt and its dependencies in your own Javascript bundle, you can install these packages from the npm registry.

<Steps>

Expand Down