open-index/open-npm huggingface dataset:
npm package: @snaxfoundation/snax-errors-js
Description: Basic snax errors library
Author: bee-warrior
Latest version: 2.0.3

# snax-errors-js

Basic snax errors library

| Name                | code | Description                                                                                        |
| :------------------ | :--- | :------------------------------------------------------------------------------------------------- |
| AlreadyExistsError  | 1    | Means that something already exists                                                                |
| BadRequestError     | 2    | Means that request payload is not valid                                                            |
| NotFoundError       | 3    | Means that something not found                                                                     |
| GeneralError        | 4    | Means that this error is representing common error and cannot be associated with other error types |
| TwitterError        | 5    | Means that this error was returned from Twitter API                                                |
| SteemitError        | 6    | Means that this error was returned from Steemit Chain                                              |
| RestrictionError    | 7    | Means that not authenticated or not allowed                                                        |
| InternalServerError | 8    | Means that something in general wrong with the server side                                         |
| ResourcesUsageError | 9    | Means that user don't have enough resources to send transactions to the chain                      |
npm package: @snaxfoundation/snaxjs-keygen
Description: General purpose library for private key storage and key management.
Author: jamesc
Latest version: 1.3.2

<!--[![Build Status](https://travis-ci.org/SNAX/snaxjs-keygen.svg?branch=master)](https://travis-ci.org/SNAX/snaxjs-keygen)-->
[![NPM](https://img.shields.io/npm/v/snaxjs-keygen.svg)](https://www.npmjs.org/package/snaxjs-keygen)

# Repository

The purpose of this library is for managing keys in local storage.  This is designed to derive and cache keys but also needs a password manager to store a "root" key. This library does not have secure or password protected storage. It does however figure out permission hierarchies and is configurable enough to only store keys you feel are safe to store.

General purpose cryptography is found in [snaxjs-ecc](http://github.com/snax/snaxjs-ecc) library.  Hierarchical
deterministic key generation uses PrivateKey.getChildKey in snaxjs-ecc.

### Usage

```javascript
let {Keystore, Keygen} = require('snaxjs-keygen')
Snax = require('snaxjs')

sessionConfig = {
  timeoutInMin: 30,
  uriRules: {
    'owner' : '/account_recovery',
    'active': '/(transfer|contracts)',
    'active/**': '/producers'
  }
}

keystore = Keystore('myaccount', sessionConfig)
snax = Snax.Testnet({keyProvider: keystore.keyProvider})

Keygen.generateMasterKeys().then(keys => {
  // create blockchain account called 'myaccount'
  console.log(keys)

  snax.getAccount('myaccount').then(account => {
    keystore.deriveKeys({
      parent: keys.masterPrivateKey,
      accountPermissions: account.permissions
    })
  })

})
```

See [./API](./API.md)

# Development

```javascript
let {Keystore, Keygen} = require('./src')
```

Use Node v8+ (updates `package-lock.json`)

# Browser

```bash
git clone https://github.com/SNAX/snaxjs-keygen.git
cd snaxjs-keygen
npm install
npm run build
# builds: ./dist/snaxjs-keygen.js
```

```html
<script src="snaxjs-keygen.js"></script>
<script>
//kos.Keystore
//kos.Keygen
//...
</script>
```

# Runtime Environment

Node 6+ and browser (browserify, webpack, etc)

Built with React Native in mind, create an issue if you find a bug.
npm package: @snazarkoo/rhumb-circle
Description: turf rhumb-circle module
Author: Turf Authors
Latest version: 6.0.2

# @turf/rhumb-circle

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## rhumbCircle

Takes a [Point][1] and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.

**Parameters**

- `center` **([Feature][2]&lt;[Point][3]> | [Array][4]&lt;[number][5]>)** center point
- `radius` **[number][5]** radius of the circle
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
  - `options.steps` **[number][5]** number of steps (optional, default `64`)
  - `options.units` **[string][7]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`)
  - `options.properties` **[Object][6]** properties (optional, default `{}`)

**Examples**

```javascript
var center = [-75.343, 39.984];
var radius = 5;
var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};
var circle = turf.rhumbCircle(center, radius, options);

//addToMap
var addToMap = [turf.point(center), circle];
```

Returns **[Feature][2]&lt;[Polygon][8]>** circle polygon

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->
npm package: @snazarkoo/rhumb-line-arc
Description: turf rhumb-line-arc module
Author: Turf Authors
Latest version: 6.0.1

# @turf/rhumb-line-arc

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## rhumbLineArc

Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;
0 bearing is North of center point, positive clockwise.

**Parameters**

- `center` **[Coord][1]** center point
- `radius` **[number][2]** radius of the circle
- `bearing1` **[number][2]** angle, in decimal degrees, of the first radius of the arc
- `bearing2` **[number][2]** angle, in decimal degrees, of the second radius of the arc
- `options` **[Object][3]** Optional parameters (optional, default `{}`)
  - `options.steps` **[number][2]** number of steps (optional, default `64`)
  - `options.units` **[string][4]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`)

**Examples**

```javascript
var center = turf.point([-75, 40]);
var radius = 5;
var bearing1 = 25;
var bearing2 = 47;

var arc = turf.rhumbLineArc(center, radius, bearing1, bearing2);

//addToMap
var addToMap = [center, arc];
```

Returns **[Feature][5]&lt;[LineString][6]>** line arc

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.1
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[5]: https://tools.ietf.org/html/rfc7946#section-3.2
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.4

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->
npm package: @snazzah/davey
Description: DAVE protocol implementation
Author: Snazzah
Latest version: 0.1.11

# Davey!

[![NPM version](https://img.shields.io/npm/v/@snazzah/davey?maxAge=3600)](https://www.npmjs.com/package/@snazzah/davey) [![install size](https://packagephobia.com/badge?p=@snazzah/davey)](https://packagephobia.com/result?p=@snazzah/davey) [![NPM downloads](https://img.shields.io/npm/dt/@snazzah/davey?maxAge=3600)](https://www.npmjs.com/package/@snazzah/davey) [![discord chat](https://img.shields.io/discord/311027228177727508?logo=discord&logoColor=white&color=5865F2)](https://snaz.in/discord)

A [Discord Audio & Video End-to-End Encryption (DAVE) Protocol](https://daveprotocol.com/) implementation using [OpenMLS](https://openmls.tech/) built with [NAPI-RS](https://napi.rs/).

> Proper documentation does not exist yet, but you can [read the usage document](https://github.com/Snazzah/davey/blob/master/docs/USAGE.md) and review the [type definitions](https://github.com/Snazzah/davey/blob/master/index.d.ts) for available methods.

```ts
import { DAVESession, ProposalsOperationType, MediaType, Codec } from '@snazzah/davey';

const session = new DAVESession(
  1, // dave version
  '158049329150427136', // user id
  '927310423890473011', // channel id
);

// Set the external sender of the session from opcode 25
session.setExternalSender(externalSenderBuffer);

// Get the key package buffer to send to Discord
session.getSerializedKeyPackage();

// Process a proposals
session.processProposals(
  ProposalsOperationType.APPEND, // the type of proposals operation
  proposalsBuffer, // proposals or proposal refs buffer
  recognizedUserIds, // an array of user IDs in the session, optional but recommended
);

// Process a commit
session.processCommit(commitBuffer);

// Process a welcome
session.processWelcome(welcomeBuffer);

// The current voice privacy code of the session, updated after a commit/welcome
session.voicePrivacyCode; // a 30 digit string or an empty string for not started sessions

// Encrypt/decrypt voice packets
if (session.ready) {
  // Encrypt packets with a specified media type and codec, use this before transport encryption
  session.encrypt(MediaType.AUDIO, Codec.OPUS, packet);
  // Really only opus is supported right now so just use the shorthand method
  session.encryptOpus(packet);
  // Decrypt a packet from a user, use this after transport decryption
  session.decrypt(userId, MediaType.AUDIO, incomingPacket);
}
```

#### References

- [daveprotocol.com](https://daveprotocol.com/)
- [discord/libdave](https://github.com/discord/libdave)
- [Discord Dev Docs - Voice - E2EE](https://discord.com/developers/docs/topics/voice-connections#endtoend-encryption-dave-protocol)
- [NAPI-RS](https://napi.rs/docs/introduction/getting-started)
- [OpenMLS Book](https://book.openmls.tech/introduction.html)
- [Voice Model - High Level Summary - DPP](https://dpp.dev/voice-model.html)
npm package: @snazzah/emoji-sync
Description: Sync Discord emojis with your app
Author: Snazzah
Latest version: 0.1.2

# @snazzah/emoji-sync

A utility package to sync emojis with your Discord application

[![NPM version](https://img.shields.io/npm/v/@snazzah/emoji-sync?maxAge=3600)](https://www.npmjs.com/package/@snazzah/emoji-sync) [![NPM downloads](https://img.shields.io/npm/dt/@snazzah/emoji-sync?maxAge=3600)](https://www.npmjs.com/package/@snazzah/emoji-sync) [![JSR](https://jsr.io/badges/@snazzah/emoji-sync)](https://jsr.io/@snazzah/emoji-sync) [![discord chat](https://img.shields.io/discord/311027228177727508?logo=discord&logoColor=white)](https://snaz.in/discord)

## Installation

```sh
pnpm i @snazzah/emoji-sync
```

## Usage

```ts
import { EmojiManager } from '@snazzah/emoji-sync';

const manager = new EmojiManager({ token: '...' });

// Note: you can add an emoji key type in the emoji manager so methods are typed properly
// new EmojiManager<'success' | 'failure' | 'snazzah'>({ token: '...' })

// Load emojis from a folder to sync with later
await manager.loadFromFolder('./emojis', { recursive: true });

// ...or manually specify emojis as an object of keys
manager.load({
  // file path (detects type from extension)
  success: './emojis/success.png',
  // data image uri
  failure: 'data:image/png;base64,...',
  // http(s) urls (detect from Content-Type or extension)
  snazzah: 'https://cdn.snaz.in/avy/current.min.png'
});

// ...and sync it!
await manager.sync();

// Now that emojis are populated in the manager, you can start using them:

// Get a partial emoji for use in buttons and selects
manager.getPartial('success'); // { id: '123...', name: 'success', animated: false }
// Get the entire emoji object
manager.get('success'); // { id: '123...', ... }
// Get the formatted markdown of an emoji
manager.getMarkdown('success'); // "<:success:123>"
```

## Updating an emoji
If you want to update an emoji, you should:
- Rename the old emoji to something else: `_old_success`
- Upload the new emoji under the same name
- Reload old instances of your application so that all managers use the new ID
- Remove the old emoji once other manager are up to date
npm package: @snazzyui/element
Description: A lightweight wrapper of @snazzyui/snazzyui to create tiny custom web components.
Author: Anthony Bullard
Latest version: 0.2.0

# Snazzy Element

A lightweight wrapper of @snazzyui/snazzyui to create tiny custom web components.

## Why?

The original snazzyui library was created as a personal challenge to create a clean-room implementation of [hyperapp](https://github.com/jorgebucaran/hyperapp) based on [snabbdom](https://github.com/snabbdom/snabbom). It has henceforth been used to rearchitect a side-project of mine, moving away from React.

The hyperapp API is great for developing applications, but there are points where you want just a _smidge_ of local state, mostly for performance. Turns out, the hyperapp API is also great for making small little stateful components. So, since I was looking to leverage the same technology throughout, I created @snazzyui/element.

## Install

Snazzy UI is a dependency of Snazzy Element, and it is assumed you are either only using Snazzy Element, or are embedding Snazzy Elements in a Snazzy UI application.

We recommend playing with this library through Skypack to start (if you are using Snazzy UI, make sure it is pinned at the same version):

```js
import { registerSnazzyElement } from 'https://cdn.skypack.dev/@snazzyui/element';
```

Once you find you like it, install it through npm (or your preferred package manager):

```sh
npm install @snazzyui/element
```

## Usage

Here's a small example that shows 90% of the API surface of the library:

```js
import { registerSnazzyElement } from 'https://cdn.skypack.dev/@snazzyui/element';

const NameChanged = (state, name) => ({ ...state, name });

registerSnazzyElement({
  tagName: 'se-test-component',
  view: (state) =>
    h('div', {}, [
      `Hello, ${state.name}`,
      h(
        'button',
        {
          on: {
            click: (e) => state.emit('SE_TEST_COMPONENT#BUTTON_CLICKED', {}),
          },
        },
        'Click'
      ),
    ]),
  init: (props) => ({ name: props.name }),
  subscriptions: (state) => [
    [
      (dispatch, emit) => {
        const interval = setInterval(
          () => emit('SE_TEST_COMPONENT#TICK'),
          1000
        );
        return () => clearInterval(interval);
      },
      state.emit,
    ],
  ],
  properties: [{ name: 'name', default: 'Foo', onChanged: NameChanged }],
  styles: `
  div {
    color: red;
  }
  `,
});

window.addEventListener('SE_TEST_COMPONENT#BUTTON_CLICKED', () => {
  console.log('Got the event!');
});

window.addEventListener('SE_TEST_COMPONENT#TICK', () => {
  console.log('Got a tick!');
});
```

## Contributing

Snazzy Element is not currently accepting PRs. If you do happen to use this package and find bugs, _please_ open an issue. There is no SLA on issue resolution, and the software contained herein is provided AS IS with no guarantees.

Once the library matures enough to reach v1.0, we will weigh the option to switch to an open contribution model.
npm package: @snazzyui/snazzyui
Description: A modern, functional UI library that is API compatible with Hyperapp, but built on top of the battle-tested Snabbdom VDOM library.  Great for building fast little apps or used with [Snazzy Elements](https://github.com/gamebox/snazzy-elements) to build des
Author: Anthony Bullard
Latest version: 1.0.0

# Snazzy UI

A modern, functional UI library that is API compatible with Hyperapp, but built
on top of the battle-tested Snabbdom VDOM library.  Great for building fast
little apps or used with [Snazzy Elements](https://github.com/gamebox/snazzy-elements)
to build design systems with Custom Web Elements (web components).

## Installation

### npm
```
npm i @snazzyui/snazzy-ui
```
### pnpm
```
pnpm add @snazzyui/snazzy-ui
```

## Getting started

```js
// Import from the package
import { app, h } from '@snazzyui/snazzy-ui';

// An update function, will be passed to your app's dispatch function. It can
// return just a new state, or a tuple of newState and a list of effects to run
// asynchronously after the newState has been applied.
const Increment = (state) => {
    const newCount = state.count + 1;
    const newState = { ...state, count: newCount};

    if (newCount % 15 === 0) {
        return [newState, [[notifyUser, { message: "fizzbuzz" }]]]
    }[
    if (newCount % 5 === 0) {
        return [newState, [[notifyUser, { message: "buzz" }]]];
    } 
    if (newCount % 3 === 0) {
        return [newState, [[notifyUser, { message: "fizz" }]]];
    }
    return newState;
};

// An effect function.  This can be async and do work in the background.  It
// notifies that app of changes to state that need to be made through the
// dispatch function that is passed in.
const notifyUser = (dispatch, payload) => {
    window.alert(payload.message);
};

// This sets up the app
app({
    // This can either be a static object(must be an object), or a function that
    // returns one.
    init: { count: 0 },
    // This is the function that will be called to render your UI whenever the
    // state is changed.
    // The first parameter is the current state
    // The second parameter is a function that will call update functions.  It
    // takes the update function as the first argument, and it's argument as the
    // second argument.
    //
    // Notice that we use the h function imported from the package, this comes
    // directly from Snabbdom. See [Snabbdom docs on h](https://github.com/snabbdom/snabbdom?tab=readme-ov-file#h) to see how to use it.
    view: (state, dispatch) => h('div', {}, [
        h('h1', {}, state.count),
        h('button', { on: { click: () => dispatch(Increment, {}) } }, 'Increment'),
    ]),
    // This is a function that will be called with state on every state change
    // and return a list of subscriptions.  Subscriptions can set up and clean
    // up event watchers or other events you want to listen to outside of the
    // DOM.
    subscriptions: () => [],
    // The second argument of app is the element used to mount your application in.
}, document.querySelector("#app'))
```
npm package: @snc0x/baseupi
Description: Official Node.js SDK for BaseUPI
Latest version: 1.4.0

# baseupi

The official SDK for the BaseUPI payment platform.
Integrate UPI payments into your SaaS frictionlessly without writing raw HTTP requests or complex cryptographic signature validation.

## Installation

```bash
npm install baseupi
# or
yarn add baseupi
# or
pnpm add baseupi
```

## Setup

```javascript
import BaseUPI from 'baseupi';

const baseupi = new BaseUPI('your_baseupi_api_key', {
    baseURL: 'https://your-baseupi-domain.com' // Optional. Defaults to https://baseupi.app
});
```

## Creating an Order

Generate a dynamic payment URL for your customer.

```javascript
const order = await baseupi.orders.create({
    merchant_order_id: 'sub_xyz_123',
    customer_email: 'user@example.com',
    redirect_url: 'https://your-saas.com/success',
    line_items: [
        {
            name: 'Pro Subscription',
            amount_paise: 99900, // ₹999.00
            quantity: 1
        }
    ],
    metadata: {
        userId: 'us_89234'
    }
});

console.log(order.checkout_url); // Redirect user to this URL
```

## Verifying Webhooks securely (Fulfillment)

BaseUPI relies on webhooks to tell you when a user has completed payment via their UPI app. Because webhooks hit your public server, you must cryptographically verify that the request actually came from BaseUPI.

The SDK does this automatically in one line:

```javascript
import express from 'express';
import BaseUPI from 'baseupi';

const app = express();
const baseupi = new BaseUPI('your_baseupi_api_key');

// Crucial: we need the raw body as a string/buffer to verify the signature!
app.post('/api/webhooks/baseupi', express.text({ type: '*/*' }), (req, res) => {
    const signature = req.headers['x-baseupi-signature'];
    const webhookSecret = process.env.BASEUPI_WEBHOOK_SECRET;

    let event;

    try {
        event = baseupi.webhooks.constructEvent(req.body, signature, webhookSecret);
    } catch (err) {
        console.error('Webhook payload was compromised or invalid');
        return res.status(400).send(`Webhook Error: ${err.message}`);
    }

    // Handle the event
    if (event.event === 'payment.completed') {
        const merchantOrderId = event.merchant_order_id;
        console.log(`Order ${merchantOrderId} paid successfully!`);
        // Fulfill the order (e.g. upgrade subscription)
    }

    res.json({ received: true });
});
```

## Retrieving an Order

You can manually poll an order status using its ID.

```javascript
const order = await baseupi.orders.retrieve('saas_sub_987654');
// or retrieve by BaseUPI ID:
// const order = await baseupi.orders.retrieve('ord_K9EFTDQV');

if (order.status === 'COMPLETED') {
    // Payment confirmed
}
```

## Types

The SDK is fully typed with TypeScript, providing rich autocomplete in VS Code for payloads and responses.

## License
MIT
npm package: @snc0x/baseupi-react
Description: Drop-in React Checkout Component for BaseUPI
Author: dietcokezerosugar
Latest version: 1.6.0

# baseupi-react

The official React SDK for BaseUPI. Implement a beautiful, drop-in UPI checkout modal directly on your own website without ever redirecting your users.

## Installation

```bash
npm install baseupi-react
# or
yarn add baseupi-react
# or
pnpm add baseupi-react
```

## Setup & Styles

You must import the CSS file so the modal is styled correctly:

```javascript
// In your App.tsx, _app.tsx, or index.ts
import 'baseupi-react/styles.css';
```

## Usage

Simply wrap any button or element with the `<BaseUPICheckout>` component. When the user clicks the element, the secure UPI QR code modal will appear instantly over your website.

```jsx
import { BaseUPICheckout } from 'baseupi-react';
import 'baseupi-react/styles.css';

export default function PricingPage() {
  
  const handleSuccess = () => {
    alert("Payment successful! Unlocking pro features...");
    // The modal closes automatically before this fires.
  };

  const handleError = (err) => {
    console.error("Payment failed", err);
  };

  return (
    <div>
      <h1>Pro Plan - ₹999</h1>
      
      {/* 
        Pass the BaseUPI order_id you generated from your backend 
        using the `baseupi` Node.js SDK `orders.create()` method.
      */}
      <BaseUPICheckout 
        orderId="ord_your_generated_id_here"
        onSuccess={handleSuccess}
        onError={handleError}
        onClose={() => console.log('User closed the modal without paying')}
      >
        <button className="pay-btn">Pay with UPI</button>
      </BaseUPICheckout>

    </div>
  );
}
```

## How It Works (Secure Iframe Strategy)
1. You create an order securely on your backend using the Node SDK and send the `orderId` to your frontend.
2. The React SDK mounts a highly-optimized, stripped-down BaseUPI checkout iframe inside a beautiful standard popup modal.
3. This prevents any CSS style bleed, completely bypasses CORS errors, and means you don't have to handle complex WebSockets or polling on your frontend to detect when the payment succeeds.
4. When the user scans and pays, BaseUPI securely emits a cross-origin `postMessage` confirming success. The standard modal closes and calls your `onSuccess` function.

## License
MIT
npm package: @sncf/bootstrap-sncf.communication
Description: SNCF frontend framework
Author: Fab Design SNCF
Latest version: 4.3.1-r5

## Builds status

### Master Branch
[![MASTER Build Status](https://travis-ci.com/SNCFdevelopers/bootstrap-sncf.svg?branch=master)](https://travis-ci.com/SNCFdevelopers/bootstrap-sncf) This is the branch you'll see on documentations sites [sn.cf/socledesign](http://sn.cf/socledesign)

### Dev Branch
[![DEV Build Status](https://travis-ci.com/SNCFdevelopers/bootstrap-sncf.svg?branch=dev)](https://travis-ci.com/SNCFdevelopers/bootstrap-sncf) This is developement branch, be careful, it could destroy your computer and burn your mouse.

## Requirements

- `npm 5.6.0` OR `yarn 1.15.2` (follow instructions from Yarn or NPM officials to install last versions on Debian/Ubuntu systems
- `node v8.10.0`

## How to build

First steps, install dependencies, go inside bootstrap-sncf directory, then :

1. `yarn install` to install Node.js dependencies.
2. _Documentation building only_ Run through the [tooling setup](https://getbootstrap.com/docs/4.0/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.

To compile Bootstrap-SNCF you will have to :

1. Decide which version you need (intern or extern, cf. [SNCF Digital resources](http://sn.cf/socledesign))
2. Run `yarn run build-intern` or `yarn run build-extern` to build all the project, including distributed CSS and JavaScript files, as well as our docs assets.
3. Run `yarn run dist-intern` or `yarn run dist-extern` to generate `dist/` folder with minified css & js, and assets (icons & fonts).

### Running documentation locally

Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.

Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/).

1. From the root `/bootstrap-sncf` directory, run `yarn run docs-serve-intern` or `yarn run docs-serve-extern` in the command line **after building the version you want**
2. Open `http://localhost:9001` in your browser, and voilà. Modifications in `template` folder will force regenerating.

Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/home/).

### NPM

Simply use `npm install @sncf/bootstrap-sncf.metier` or `npm install @sncf/bootstrap-sncf.communication` depending on the purpose of your project.

### Icofont

1. Run `yarn run icofont`
npm package: @sncf/eslint-config
Description: SNCF eslint config for Frontend Projects
Author: Alexandre Laval
Latest version: 0.0.1

# eslint-config-sncf

An eslint-config made for TypeScript.

## Installation

```
npm i --save-dev @sncf/eslint-config
```

## Usage

Once the `@sncf/eslint-config` package is installed, you can use it by specifying `"@sncf/eslint-config"` in the [`extends`](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) section of your [ESLint configuration](http://eslint.org/docs/user-guide/configuring).

```js
{
  "extends": "@sncf/eslint-config",
  "rules": {
    // Additional, per-project rules...
  }
}
```
npm package: @sncrr/styled-native
Description: Typed, variant-based styling utility for React Native and React Native Web components.
Author: sncrr
Latest version: 0.1.0

# @sncrr/styled-native

> 🔹`@sncrr/styled-native` is a lightweight utility for **React Native** and **React Native Web** that lets you create styled components with variants, default variants, and style composition. It’s designed around the style prop, making it framework-agnostic and compatible with libraries like `react-native-paper` and `react-native-web`.

[![npm version](https://img.shields.io/npm/v/@sncrr/styled-native.svg?style=flat-square)](https://www.npmjs.com/package/@sncrr/styled-native)
[![npm downloads](https://img.shields.io/npm/dm/@sncrr/styled-native.svg?style=flat-square)](https://www.npmjs.com/package/@sncrr/styled-native)

---

## ✨ Features

- 🎨 Define reusable styled components
- 🔧 Add variants (like size, color, weight)
- ⚡ Supports default variants
- 📦 Works with React Native and React Native Web
- 🔑 Fully typed for TypeScript

---

## 🚀 Install

```bash
npm install @sncrr/styled-native
# or
yarn add @sncrr/styled-native
# or
pnpm add @sncrr/styled-native
# or
bun add @sncrr/styled-native
```

---

## 📖 Usage

```jsx
import { styled } from "@sncrr/styled-native";
import { Text } from "react-native";

const StyledText = styled(Text)(
  { fontSize: 16, color: "black" },
  {
    variants: {
      weight: {
        normal: { fontWeight: "400" },
        bold: { fontWeight: "700" },
      },
      color: {
        primary: { color: "blue" },
        danger: { color: "red" },
      },
    },
    defaultVariants: {
      weight: "normal",
    },
  }
);

export default function App() {
  return (
    <>
      <StyledText>Default text</StyledText>
      <StyledText weight="bold" color="danger">
        Bold red text
      </StyledText>
    </>
  );
}
```

---

## ⚙️ API

```jsx
styled(Component)(baseStyle, options?)
```

### Parameters

- `Component` - Any React Native component (e.g., `Text`, `View`, `Image`).
- `baseStyle` - A base style object.
- `options (optional)`
  - `variants` - Define multiple variant groups (e.g., `size`, `color`).
  - `defaultVariants` - Define default values for variants.

### Returns

A new styled component with variant props and style merging.

---

## 🛠 Example with multiple variants

```jsx
const Button = styled(Pressable)(
  {
    padding: 12,
    borderRadius: 8,
    alignItems: "center",
  },
  {
    variants: {
      variant: {
        solid: { backgroundColor: "blue" },
        outline: { borderWidth: 2, borderColor: "blue" },
      },
      size: {
        sm: { padding: 8 },
        lg: { padding: 16 },
      },
    },
    defaultVariants: {
      variant: "solid",
      size: "sm",
    },
  }
);
```