open-index/open-npm huggingface dataset:
npm package: @switch-company/keyboard-navigation
Description: Detect and add a class when the keyboard is used, removes it on click or mouse move.
Latest version: 1.0.1

# Switch - keyboard-navigation

Detect and add a class when the keyboard is used, removes it on click or mouse move.

---

This plugin is written in ES2015 and available either in uncompiled form in the `/lib` folder or compiled for ES5 in the `/dist` folder. If your project uses babel with Webpack or Rollup, you should change the exclusion so this plugin gets compiled or force Webpack or Rollup to fetch the compiled version by using the `main` entry of the `package.json` file instead of the `module` entry.

```js
// .babelrc file or configuration within webpack or rollup
{
  "plugins": [...],
  "exclude": "node_modules/!(@switch-company)/**",
}
```

## Installation

```bash
$ npm install @switch-company/keyboard-navigation
```

## Usage

```js
import KB from '@switch-company/keyboard-navigation';

const kb = new KB({
  classElement,
  className,
  moveThreshold,
  rules
});
```

## Parameters

All parameters are optional and have defaults values except `rules`.

| Name            | Type                | Description |
|-----------------|---------------      |-------------|
| `classElement`  | `HTMLElement`       | The element which will receive the class when keyboard is in use (defaults to `document.documentElement`) |
| `className`     | `String`            | The class to apply to the element defined with `classElement` (defaults to `keyboard`) |
| `moveThreshold` | `Number` or `false` | Distance in pixels that the mouse has to move before the class is removed. Can be disabled by passing `false` (defaults to `10`) |
| `rules`         | `Function`          | Custom function that receives the tab event. Allows custom checks to decide if the class can be added. Must return `true` to add the class |

## Example using the `rule` parameter

```js
import KB from '@switch-company/keyboard-navigation';

const kb = new KB({
  // don't add the class if the tab comes from an input element
  rules: event => {
    return event.target.nodeName !== 'INPUT';
  }
});
```
npm package: @switch-kit/cloudflare-kv-adaptor
Description: A Cloudflare KV adaptor for SwitchKit
Author: Matt Hamlin
Latest version: 0.1.4

# `@switch-kit/cloudflare-kv-adaptor`

A Cloudflare KV Adaptor for `switch-kit`!

> Note: This package also exports a `CloudflareKV` class that can be used to interact with Cloudflare KV directly via their REST API ([docs](https://developers.cloudflare.com/api/operations/workers-kv-namespace-list-namespaces))

## Getting Started:

```sh
bun add @switch-kit/cloudflare-kv-adaptor
```

Make sure you also install `switch-kit` if you haven't already:

```sh
bun add switch-kit
```

## Usage:

```tsx
// Create the SwitchKit client
let switchKit = new SwitchKit({
  adaptor: new CloudflareKVAdaptor({
    // Essentially a "scope" for the various switches being stored within Cloudflare KV
    namespace: "my-switches",
    // An Auth Token for your KV instance
    authToken: process.env.CLOUDFLARE_AUTH_TOKEN,
    // A Cloudflare Account ID
    accountID: process.env.CLOUDFLARE_ACCOUNT_ID,

    // Optional:
    // If you use a different cloudflare API URL, or a custom Cloudflare-like API, you can specify it here
    baseAPIURL: "https://api.cloudflare.com/client/v4",
    // If you use a different fetch implementation, you can specify it here
    // This is useful if you wrap `fetch` with additional logic, e.g. timeout middleware etc.
    fetch: globalThis.fetch,
  }),
});

// Initialize the SwitchKit client
// This will create the namespace if it doesn't exist
await switchKit.init();

// Returns either a Switch or undefined
let switchA = await switchKit.get("switch-a");

if (switchA?.value === "on") {
  // do something
}
```

## Contributing:

### Building:

This library uses [`swc`](https://swc.rs/) and [`TypeScript`](https://www.typescriptlang.org/docs/) to build the source code and generate types.

To build the library, run `bun run build` from the root, or from this workspace!

### Code Quality:

#### Type Checking:

This library uses TypeScript to perform type checks, run `bun run type-check` from the root or from this workspace!

#### Linting

This library uses [BiomeJS](https://biomejs.dev/) for linting, run `bun run lint` from the root or from this workspace!

#### Tests

This library uses Bun for running unit tests, run `bun run test` from the root or from this workspace!
npm package: @switch-kit/storage-interface
Description: Switch Kit internal storage interfaces, useful for building adaptors for different storage providers
Author: Matt Hamlin
Latest version: 0.1.0

# `@switch-kit/storage-interface`

The type contracts (as TypeScript types/interfaces) for the Switch Kit ecosystem. Useful if you're implementing a custom Storage Adaptor.

> Note: If you're only looking to use Switch Kit with a pre-built adaptor, you don't need to install this package directly. Instead, install the `switch-kit` package and the adaptor you want to use.

## Getting Started:

```sh
bun add @switch-kit/storage-interface
```

## Usage:

```tsx
import type {
  StorageAdaptor,
  Switch,
  SwitchMetadata,
} from "@switch-kit/storage-interface";

// Implement the StorageAdaptor interface
export class MyAdaptor implements StorageAdaptor {
  constructor() {
    // Initialize your adaptor here
  }

  async init() {
    // Async initialization code
  }

  async get(key: string): Promise<Switch | undefined> {
    // Get a Switch by key
  }

  async set({
    key,
    value,
    metadata = {},
  }: {
    key: string;
    value: string;
    metadata?: SwitchMetadata;
  }): Promise<void> {
    // Set a Switch by key
  }
}
```

## Contributing:

### Building:

This library uses [`swc`](https://swc.rs/) and [`TypeScript`](https://www.typescriptlang.org/docs/) to build the source code and generate types.

To build the library, run `bun run build` from the root, or from this workspace!

### Code Quality:

#### Type Checking:

This library uses TypeScript to perform type checks, run `bun run type-check` from the root or from this workspace!

#### Linting

This library uses [BiomeJS](https://biomejs.dev/) for linting, run `bun run lint` from the root or from this workspace!

#### Tests

This library uses Bun for running unit tests, run `bun run test` from the root or from this workspace!
npm package: @switch_software/ui-components
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.
Author: Agustin Campon
Latest version: 21.1.1

# UiComponents

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.

## Code scaffolding

Run `ng generate component component-name --project ui-components` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ui-components`.
> Note: Don't forget to add `--project ui-components` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build ui-components` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build ui-components`, go to the dist folder `cd dist/ui-components` and run `npm publish`.

## Running unit tests

Run `ng test ui-components` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.