A library of high-quality primitives that help you build accessible user interfaces with SolidJS.

Overview

Solid ARIA

Solid Aria

A library of high-quality primitives that help you build accessible user interfaces with SolidJS.

Primitives

Interactions

  • focus - Primitives for dealing with focus rings and focus management.

Forms

  • checkbox - Provides the behavior and accessibility implementation for checkbox and checkbox group components.
  • label - Provides the the behavior and accessibility implementation for labels and their associated elements.
  • radio - Provides the behavior and accessibility implementation for radio and radio group components.
  • switch - Provides the behavior and accessibility implementation for switch component.
  • toggle - Handles interactions for toggle elements, e.g. checkboxes and switches.

Utilities

  • i18n - Primitives for dealing with locale and layout direction.
  • visually-hidden - Hides its children visually, while keeping content visible to screen readers.

Acknowledgment

This project is inspired by Adobe's React Spectrum Libraries.

Comments
  • Required props object in interaction primitives

    Required props object in interaction primitives

    From what I've seen all of the interaction primitives (createHover, createFocus, etc.) have their props argument set as required instead of optional. Are props actually always required? Seams that you should be fine just doing this in some scenarios: (when you don't need to combine props)

    const { focusProps } = createFocus()
    <input {...forcusProps}/>
    
    opened by thetarnav 9
  • Licensing

    Licensing

    Hey, I work on React Aria. Very happy to see this project extending our work to another framework! It's something I've wanted to experiment with for a long time, but haven't had time.

    React Aria uses the Apache 2.0 license, which is very permissive but requires that the copyright headers in source files, LICENSE, and NOTICE.txt files be included in any redistributions or modifications. Since many of the files in this project appear to be direct ports of code from React Aria, we would really appreciate if you could include the license here as well.

    Also, please let us know if there is anything we can do to help. Like I said, extending React Aria to support other frameworks is something we've had on our long term wishlist for a while. As you build out the primitives here, it would be really great if you could share any learnings with us, or ideas about how some of the code could be shared. Would be great to potentially come up with an abstraction where this stuff could be more easily shared between frameworks rather than duplicating efforts, porting bug fixes back and forth, etc.

    opened by devongovett 7
  •  No matching version found for @solid-aria/types@* inside the workspace

     No matching version found for @solid-aria/types@* inside the workspace

    image

    Was trying to install @solid-aria/interactions.

    Are you sure you want to have ^workspace instead of ^0.1.0 for the dependency version? Changesets will update the versions automatically anyway.

    opened by thetarnav 4
  • Refactor createSlotId

    Refactor createSlotId

    I've refactored the createSlotId helper to work in a way I've described on discord.

    Instead of tracking a fixed array of dependencies to preform document.getElementById check — It'll track the actual id usage via separate track() function.

    This way displaying the element with e.g. descriptionId can to toggled depending on a signal separate from signals that would be tracked with the deps array from before, and update the value of descriptionId accordingly.

    I've run the tests this time! :)

    opened by thetarnav 4
  • fix: change deps versions from

    fix: change deps versions from "workplace" to "^0.1.0"

    • Change dependency versions of packages from "workspace^" to "^0.1.0" (current version) — Fixes #29 0.1.0 instead of 0.1.1 because changesets should update those

    • Move solid-primitives packages from peerDependencies to dependencies. Those are normal dependencies. This may cause missing peerdependency warnings during installs (in this repo), to do that we'd have to add "solid-js" as dev dependency everywhere, but I just didn't have the strength to do it. The warnings are harmless anyway...

    opened by thetarnav 3
  • Setup SSR testing

    Setup SSR testing

    Having automatic tests specifically for SSR should help ensure that solid-aria can be used with solid-start without trouble. Not that it's certain that it'll run, we've seen that there are a lot of random things, especially with jsx transform that could go wrong. But the API itself should benefit from this.

    • moved some of the configs to new /configs dir — frees some space in the root
    • Added jest config & setup files specifically for ssr
    • Added ssr tests to label package (It's a only a start😄)
    • Fixed createSlotId to prevent it from accessing DOM APIs on the server.

    Should I add a changeset for all packages, or only the updated utils?

    opened by thetarnav 2
  • Feat: refactor filterDOMProps util

    Feat: refactor filterDOMProps util

    Refactors the filterDOMProps to do less work, and be easier to use

    const domProps = mergeProps(createMemo(() => filterDOMProps(props, { labelable: true })));
    const domProps = filterDOMProps(props, { labelable: true });
    

    Besides the select package, all tests pass

    opened by thetarnav 1
  • add `.gitpod.yml` and recommended vscode extensions

    add `.gitpod.yml` and recommended vscode extensions

    I'm playing with gitpod to work on this repo. There are some issues with permission, this is why I'm using a fork. But in exchange, I might be able to bypass the mac vs windows differences.

    opened by thetarnav 1
  • feat: progress, separator

    feat: progress, separator

    • @solid-aria/i18n: added createNumberFormatter primitive.
    • @solid-aria/primitives: added progress and separator packages.
    • @solid-aria/utils: added number utilities.
    • @solid-aria/progress: new package.
    • @solid-aria/separator: new package.
    opened by fabien-ml 1
  • Draft: feat(tooltip): create Tooltip

    Draft: feat(tooltip): create Tooltip

    This PR is dependent of https://github.com/solidjs-community/solid-aria/pull/73 since it has changes to createFocusable

    This is the port of Tooltip.

    TODO

    • [ ] Tooltip
    • [ ] Tests
    • [ ] Update doc

    This is my first contribution to the project. I am looking for feedback.

    I have pretty much followed what @react-aria/tooltip is doing.

    I'm having a Typescript error with the return of createTooltipTrigger. I'm getting this error:

    Types of property 'onFocus' are incompatible. 
    Type 'EventHandlerUnion<any, 
    FocusEvent> 
    | EventHandlerUnion<HTMLElement, FocusEvent>
    | undefined' is not assignable to type '((e: FocusEvent) => void) | undefined'.
    

    Looking at the signature of onFocus from FocusEvents => onFocus?: (e: FocusEvent) => void; in @solid-aria/types, this is exactly the same signature as we have in @react-aria/types. In their implementation of onFocus, they are not passing the event to onFocus and it is not complaining in @react-aria

    Looking at createFocusable interface FocusableResult, focusableProps: JSX.HTMLAttributes<any>; and onFocus in HTMLAttributes is indeed onFocus?: EventHandlerUnion<T, FocusEvent>;

    @fabien-ml I see you worked in createFocusable, do you think you could help me out?

    opened by alveshelio 2
  • Accordion Items wrapped in a fragment cannot have children with `<Show when={}>` behaviour

    Accordion Items wrapped in a fragment cannot have children with `` behaviour

    See Stackblitz reproduction repo here: https://stackblitz.com/edit/solidjs-template-r95c6s?file=src/App.tsx

    If I have an Item in the accordion that's wrapped in a fragment, the <Show when={}> component directly within the fragment does not react to state updates.

    Here's the relevant code from the Stackblitz

    import { Item } from '@solid-aria/collection';
    import { createSignal, Show } from 'solid-js';
    import { Accordion } from './Accordion';
    
    /**
     * There are two accordion items in here, one wrapped in a
     * fragment, and one wrapped in a div. When pressing the
     * trigger button, the text to the right of it should
     * disappear/appear, because it's wrapped in a 
     * <Show when={visible()}></Show>. On the one wrapped in a 
     * div it does, but the one wrapped in a fragment you have to
     * collapse & expand the Item header once to trigger the 
     * state update.
     *
     * The accordion code is a straight copy/paste from https://github.com/solidjs-community/solid-aria/blob/main/packages/accordion/README.md
     */
    
    export default function App() {
      const [visible, setVisible] = createSignal(true);
    
      return (
        <Accordion>
          <Item key="fragment" title="With fragment wrapper">
            <>
              <button
                style={{ color: visible() ? 'green' : 'red' }}
                onClick={() => setVisible((v) => !v)}
              >
                Trigger
              </button>
    
              <Show when={visible()}> - Should appear/disappear</Show>
            </>
          </Item>
    
          <Item key="div" title="With div wrapper">
            <div>
              <button
                style={{ color: visible() ? 'green' : 'red' }}
                onClick={() => setVisible((v) => !v)}
              >
                Trigger
              </button>
    
              <Show when={visible()}> - Should appear/disappear</Show>
            </div>
          </Item>
        </Accordion>
      );
    }
    
    
    opened by jakst 2
  • Add VisuallyHidden component

    Add VisuallyHidden component

    Please check if the usage of Solid is correct, I am still learning it. I also found that you are using splitProps instead of restructuring. Not sure why?

    I copied the ElementType from https://github.com/solidjs/solid/issues/701#issuecomment-1007706044

    opened by cedeber 1
  • Error: require() of ES Module not supported

    Error: require() of ES Module not supported

    I'm trying to use solid-aria in Astro but I get :

    require() of ES Module myproject/node_modules/@solid-aria/focus/dist/cjs/index.js from myproject/node_modules/@solid-
    aria/selection/dist/index.cjs not supported. index.js is treated as an ES module file as it is a .js file whose nearest parent package.json 
    contains "type": "module" which declares all .js files in that package scope as ES modules. error. 
    

    Any idea why that happens?

    I'm getting this error only when using solid-aria so I asked here instead of the Astro server, And it doesn't look like an Astro issue.

    Here is a small stackblitz to reproduce. The error is slightly different here but I think it's the same thing.

    https://stackblitz.com/edit/github-7cxbsf?on=stackblitz

    opened by ahhshm 15
  • Move the `ref` from accessor arg to a returned function

    Move the `ref` from accessor arg to a returned function

    Fixes #71

    TODO:

    • [x] createButton
    • [x] createFocusable
    • [ ] createToggleButton
    • [ ] fix createRadio
    • [ ] fix createTextField
    • [ ] add changeset
    • [ ] update docs
    opened by thetarnav 1
Releases(@solid-aria/[email protected])
Owner
SolidJS Community
Community managed SolidJS projects.
SolidJS Community
High-quality, customizable web components for common user interface patterns

Elix is a community-driven collection of high-quality web components for common user interface patterns. Most applications make use of common, general

Elix 699 Dec 19, 2022
High-quality QR Code generator library in Java, TypeScript/JavaScript, Python, Rust, C++, C.

QR Code generator library Introduction This project aims to be the best, clearest QR Code generator library in multiple languages. The primary goals a

Nayuki 3.3k Jan 4, 2023
Awesome critique of crypto / web3. Curated list of high quality critique plus background. Seek to be as constructive as possible.

Awesome critique of crypto/web3 Awesome critique of crypto/web3, etc. Contributions are welcome. Critique General Stephen Diehl series - https://www.s

Rufus Pollock 1.5k Jan 1, 2023
e-ONG, an authorial project, whose objective is to help ONGs to find people who need help or would like to help them

This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: npm start Runs the app in the developmen

Lucas Lima 2 Nov 11, 2022
Javascript (TypeScript) library for building web user interfaces

ivi · ivi is a javascript (TypeScript) library for building web user interfaces. Status Maintenance mode. Bug fixes and documentation updates only. Qu

Boris Kaul 538 Dec 19, 2022
Dyo is a JavaScript library for building user interfaces.

Dyo A JavaScript library for building user interfaces. Installation Use a Direct Download: <script src=dyo.js></script> Use a CDN: <script src=unpkg.c

Dyo 949 Dec 23, 2022
Block Library Primitives by Pew Research Center

A starting point for anyone looking to add functionality, extra control to and or create your own custom block library using core/blocks. Built with easier extensibility in mind

Pew Research Center 8 Nov 5, 2022
Million is a lightweight (<1kb) Virtual DOM. It's really fast and makes it easy to create user interfaces.

?? Watch Video ?? Read the docs ?? Join our Discord What is Million? Million is a lightweight (<1kb) Virtual DOM. It's really fast and makes it easy t

Derek Jones 5 Aug 24, 2022
Provides Lock and RwLock synchronization primitives.

Lock Provides Lock and RWLock (read write lock) synchronization primitives for protecting in-memory state across multiple tasks and/or microtasks. Ins

Rocicorp 4 Apr 27, 2022
📃 Typed primitives for Typescript to work with file paths

typed-file-system-path typed-file-system-path takes inspiration from Path.swift in swift-tools-support-core and provides typed primitives to work with

Craftweg 6 Dec 15, 2022
This package will help parse OData strings (only the Microsoft Dataverse subset). It can be used as a validator, or you can build some javascript library which consumes the output of this library.

@albanian-xrm/dataverse-odata This package will help parse OData strings (only the Microsoft Dataverse subset). It can be used as a validator, or you

AlbanianXrm 3 Oct 22, 2022
This is a demo of updating a map to show air quality data for the user’s current location using Next.js Advanced Middleware, powered by Netlify Edge Functions.

Show Local Air Quality Based on the User's Location Use AQI data to show the air quality near the current user. This is built using Next.js Advanced M

Jason Lengstorf 8 Nov 4, 2022
A prototype on how web3 technology can enable us to build an open, immutable, reproducible, and permanently accessible scientific record.

Web3 Research A prototype on how web3 technology can enable us to build an open, immutable, reproducible, and permanently accessible scientific record

manveer 0 Nov 27, 2022
A form management library for SolidJS that is very lightweight and simple!

solform A form management library for SolidJS that is very lightweight and simple! Why solform Very easy, fast, lightweight and powerful! It has built

Okan YILDIRIM 16 Nov 15, 2022
A modern solidjs based UI library ~ it is very lightweight!

?? 目前正在开发中,敬请期待~ cerises-ui 一个现代的基于 solidjs 的 UI 库~它是非常轻量级的! 官网:https://cerises-ui.edoc.wiki 目前计划组件 组件 说明 认领人 进度 Review & Unit Test Button、ButtonGroup

Cerises UI 4 Jul 19, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

?? Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Frontend Masters 167 Dec 9, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.

?? Remix Fundamentals Build Better websites with Remix Remix enables you to build fantastic user experiences for the web and feel happy with the code

Frontend Masters 204 Dec 25, 2022
AweSome Book App displays the book details entered by user and saves the information in Local storage. User can add and remove a book title/author to the library and from the library.

Awesome Book App with ES6 Used npm init -y command to create package.json file. Created the entry point for the JavaScript code called index.js Create

Krishna Prasad Acharya 8 Aug 15, 2022