Skip to content

Instantly share code, notes, and snippets.

View sarahbethfederman's full-sized avatar

Sarah Federman sarahbethfederman

View GitHub Profile
<script>// Provides explicit indication of elements receiving focus through keyboard interaction rather than mouse or touch.
(function(document) {
var NAVIGATION_KEYS = [
'Tab',
'ArrowUp',
'ArrowRight',
'ArrowDown',
'ArrowLeft',
'Home',
'End',
import React from 'react';
const NAVIGATION_KEYS = [
'Tab',
'ArrowUp',
'ArrowRight',
'ArrowDown',
'ArrowLeft',
'Home',
'End',
Search Bar*
Inactive*
focused -> Active
Active
canceled -> Inactive
typed -> Text Entry
Empty*
Dropdown*
Inactive*
focus -> Focused
click -> Open
Focused
down arrow key -> Open
Open
arrow key -> Navigating
@sarahbethfederman
sarahbethfederman / RichTextRenderer.js
Last active May 12, 2021 17:56
Using contentful with gatsby and react
import React from 'react';
import { Link as GatsbyLink } from 'gatsby';
import * as deepmerge from 'deepmerge';
import { INLINES, BLOCKS, MARKS } from '@contentful/rich-text-types';
import { documentToJSX } from './../scripts/documentToJSX';
import { getEntry } from './../scripts/getContentfulEntry';
const Link = ({ children, to, activeClassName, ...other }) => {
const internal = /^\/(?!\/)/.test(to);
@sarahbethfederman
sarahbethfederman / Known issues.md
Last active January 11, 2019 04:45
Except from internal project readme
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:22
Yarn-locks-101-1
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to, aka what ends up being bundled
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>"
version: the version that packages depending on pkg-b@<VERSION_RANGE> get
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-101-2
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>, pkg-b@<COMPATIBLE_VERSION_RANGE>"
version: the version that packages depending on pkg-b get
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-101-3
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>"
version: the version that packages depending on pkg-b@<VERSION-RANGE> get
"pkg-b@<INCOMPATIBLE_VERSION_RANGE>"
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-install
"[email protected]"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"
"[email protected]"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"