open-index/open-npm huggingface dataset:
npm package: @prantlf/baretest
Description: Extremely fast and simple JavaScript test runner (fork).
Author: Ferdinand Prantl
Latest version: 2.0.1

<img src="https://volument.com/blog/img/baretest/logomark.png" width="400">

*Baretest* is an extremely simple JavaScript test runner. It has a tiny footprint, near-instant performance, and a brainless API. It makes testing tolerable.

<img src="https://volument.com/blog/img/baretest/tester-matrix-big.png" alt="How Baretest fits on the testing landscape" width="600">

### Install

```
npm i -D @prantlf/baretest
```

With [pnpm](https://pnpm.js.org)

```
pnpm i -D @prantlf/baretest
```

#### Links

[Documentation](https://volument.com/baretest)

... [Getting started](https://volument.com/baretest#getting-started)

... [API reference](https://volument.com/baretest#api-reference)

... [FAQ](https://volument.com/baretest#faq)


### Why Baretest?

We constantly hit `CMD + B` on *Sublime Text* to test a function we are actively working on. We do this all the time, sometimes hundreds of times a day. With Jest, each of these runs would take seconds, but Baretest runs under 100ms.

<img src="https://volument.com/blog/img/baretest/sublime.png" alt="A typical setup in Sublime Text" width="600">

<img src="https://volument.com/blog/img/baretest/render.gif" alt="Comparing Jest vs Baretest" width="600">

Another reason for building Baretest was to have an extremely simple API. Typically we only use `test()` and the Node's built-in `assert.equals()` methods to run our tests. We've never needed automatic re-ordering, file watchers, "mocking" or "snapshotting".

```js
const test = require('baretest')('My app'),
  assert = require('assert'),
  app = require('my-app')

test('add user', async function() {
  const user = await app.addUser('test@cc.com')
  assert.equals(user.name, 'Test')
})

test('reject duplicate emails', async function() {
  await assert.rejects(async function() {
    await app.addUser('duplicate@address.com')
  })
})

// ...

!(async function() {
  await test.run()
})()
```

We think a good test runner stays out of your way. We want to focus on the task at hand and not deal with the complexities of testing. We don't want to commit to a massive framework that dictates our work.

## License

Copyright (c) 2021 Ferdinand Prantl
Copyright 2020 OpenJS Foundation and contributors. Licensed under [MIT](./LICENSE).
npm package: @prantlf/esbuild
Description: An extremely fast JavaScript bundler minifier, and analyser with an experimental support for dependency analysis, AMD input and UMD output.
Latest version: 0.8.46

# @prantlf/esbuild

This is a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild and the [JavaScript API documentation](https://github.com/prantlf/esbuild/blob/master/docs/js-api.md) for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-darwin-64
Description: The macOS 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the macOS 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-freebsd-64
Description: The FreeBSD 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the FreeBSD 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-freebsd-arm64
Description: The FreeBSD ARM 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the FreeBSD ARM 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-linux-32
Description: The Linux 32-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Linux 32-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-linux-64
Description: The Linux 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Linux 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-linux-arm
Description: The Linux ARM binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Linux ARM binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-linux-arm64
Description: The Linux ARM 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Linux ARM 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-linux-mips64le
Description: The Linux MIPS 64-bit Little Endian binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# esbuild

This is the Linux MIPS 64-bit Little Endian binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
npm package: @prantlf/esbuild-linux-ppc64le
Description: The Linux PowerPC 64-bit Little Endian binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Linux PowerPC 64-bit Little Endian binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-wasm
Description: The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the cross-platform WebAssembly binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://github.com/evanw/esbuild/blob/master/docs/js-api.md) for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-windows-32
Description: The Windows 32-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Windows 32-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/esbuild-windows-64
Description: The Windows 64-bit binary for esbuild, a JavaScript bundler.
Latest version: 0.8.46

# @prantlf/esbuild

This is the Windows 64-bit binary for esbuild, a JavaScript bundler, minifier and analyser. See https://github.com/prantlf/esbuild for details.

This is an experimental fork of the [original project](https://github.com/evanw/esbuild) to explore the [dependency analysis](https://github.com/prantlf/esbuild/commits/analyse), and [AMD input](https://github.com/prantlf/esbuild/commits/amdjs) and [UMD output](https://github.com/prantlf/esbuild/commits/umdjs).
npm package: @prantlf/get-stdin-with-tty
Description: Get stdin as a string or buffer from pipe or TTY
Author: Sindre Sorhus
Latest version: 6.0.1

# @prantlf/get-stdin-with-tty

[![NPM version](https://img.shields.io/npm/v/%40prantlf%2Fget-stdin-with-tty.svg)](https://www.npmjs.com/package/@prantlf/get-stdin-with-tty)
[![Build Status](https://travis-ci.org/prantlf/get-stdin.svg?branch=master)](https://travis-ci.org/prantlf/get-stdin)

> Get [stdin](https://nodejs.org/api/process.html#process_process_stdin) as a string or buffer

This fork of the [original project](https://github.com/sindresorhus/get-stdin) includes support for reading stdin from TTY, not only via pipes.

## Install

```
$ npm install @prantlf/get-stdin-with-tty
```

## Usage

```js
// example.js
const getStdin = require('@prantlf/get-stdin-with-tty');

(async () => {
	console.log(await getStdin({ tty: true }));
	//=> 'unicorns'
})();
```

```
$ echo unicorns | node example.js
unicorns
```

## API

Both methods returns a promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read.

### getStdin([options])

Get `stdin` as a `string`.

In a TTY context, a promise that resolves to an empty string is returned, unless `options.tty` or `getStdin.tty` is true.

### getStdin.buffer()

Get `stdin` as a `Buffer`.

In a TTY context, a promise that resolves to an empty `Buffer` is returned.

### getStdin.tty = true/false

Set global TTY handling.  When true, accepts input from TTY until a new line beginning with Ctrl-d or Ctrl-z (ASCII 04 and 26) is entered. (default = `true`)

When enabled for the example above:

``` 
$ node example.js
foobar
barfoo
^d
// =>
foobar
barfoo
```

## Related

- [get-stream](https://github.com/sindresorhus/get-stream) - Get a stream as a string or buffer

## License

MIT © [Sindre Sorhus](http://sindresorhus.com)
© [Moos](http://github.com/moos)
© [Ferdinand Prantl](github.com/prantlf)
npm package: @prantlf/saz2har
Description: Converts SAZ file (from Fiddler) to HAR file (for Chrome).
Author: Ferdinand Prantl
Latest version: 2.3.1

# @prantlf/saz2har

[![NPM version](https://badge.fury.io/js/%40prantlf%2Fsaz2har.svg)](http://badge.fury.io/js/%40prantlf%2Fsaz2har)
[![Build Status](https://travis-ci.org/prantlf/saz2har.png)](https://travis-ci.org/prantlf/saz2har)
[![Dependency Status](https://david-dm.org/prantlf/saz2har.svg)](https://david-dm.org/prantlf/saz2har)
[![devDependency Status](https://david-dm.org/prantlf/saz2har/dev-status.svg)](https://david-dm.org/prantlf/saz2har#info=devDependencies)

Converts SAZ file (from Fiddler) to HAR file (for Chrome).

This fork of the original project includes the following enhancements:

* Runs on OSX. (Replaced `minizip` with `extract-zip`.)
* The HAR validation can be disabled. (The current validator does not handle date-time values in some Fiddler logs well.)
* The command-like tool is documented and prints usage instructions.
* The dependencies are upgraded to the the most recent versions.

## Installation

Make sure that you use Node.js 6 or newer. Install this package locally if you want to use it programmatically:

```
$ npm i @prantlf/saz2har
```

If you want to use the command-line tool, install the package globally:

```
$ npm i -g @prantlf/saz2har
```

## API

### convert(input, [output], [options])

* `input` - path to the input .saz file
* `output` - path to the output .har file
* `options` - object with conversion options
  * `validate` - enables validation of the the HAR output (default: `true`)

```js
const saz2har = require("@prantlf/saz2har");

saz2har.convert("tmp/log.saz", (err, data) => {
    if (err) {
        return console.error(err);
    }
    console.log(data);
});
```

## Tool

```
$ saz2har --help

Usage: saz2har [options] input.saz [output.har]

Options:
  --help         Show help                                     [boolean]
  --version      Show version                                  [boolean]
  --no-validate  Validate the output HAR file (default: true)  [boolean]

Examples:
  saz2har foo.saz bar.har --no-validate
```

## License

MIT
npm package: @prantlf/storycrawler
Description: Utilities to build Storybook crawling tools with Puppeteer
Author: tsuyoshiwada
Latest version: 8.1.1

# Storycrawler

Utilities to build Storybook crawling tools with Puppeteer.

<!-- toc -->

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [LICENSE](#license)

<!-- tocstop -->

## Install

```sh
$ npm i @prantlf/storycrawler
```

## Usage

```ts
import {
  StorybookConnection,
  StoriesBrowser,
  StoryPreviewBrowser,
  MetricsWatcher,
  createExecutionService,
} from '@prantlf/storycrawler';

(async function () {
  // Connect to the target Storybook server.
  const storybookUrl = 'https://storybookjs.netlify.app/vue-kitchen-sink';
  const connection = await new StorybookConnection({ storybookUrl }).connect();

  // Launch Puppeteer process to fetch stories info.
  const storiesBrowser = await new StoriesBrowser(connection).boot();
  // Item in stories has name, kind and id of the corresponding story
  const stories = await storiesBrowser.getStories();

  // Launce Puppeteer browsers to visit each story's preview window(iframe.html)
  const workers = await Promise.all([0, 1, 2, 3].map(i => new StoryPreviewBrowser(connection, i).boot()));

  try {
    // `createExecutionService` creates a queue of the tasks for each story.
    const service = createExecutionService(workers, stories, story => async worker => {
      // Display story in the worker's preview window
      await worker.setCurrentStory(story);

      // Wait for UI framework updating DOM
      await new MetricsWatcher(worker.page).waitForStable();

      // Extract information from the preview window.
      // You can access Puppeteer's page instance via `worker.page`.
      const m = await worker.page.metrics();
      return { story, nodesCount: m.Nodes };
    });

    // `createExecutionService` register tasks but does not kick them.
    // Tasks in queue start via calling `.execute()`.
    const results = await service.execute();

    results.forEach(({ story, nodesCount }) => console.log(`${story.id}: ${nodesCount}`));
  } finally {
    await storiesBrowser.close();
    await Promise.all(workers.map(worker => worker.close()));
    await connection.disconnect();
  }
})();
```

## API

See [here](https://reg-viz.github.io/storycap/typedoc/storycrawler/index.html).

## LICENSE

MIT
npm package: @pras-ui/config
Description: This package contains the configuration files and utility functions used within the `pras-ui`. It provides shared configurations for tools like ESLint, Prettier, and Rollup to ensure consistency across various packages.
Author: PRAS Samin
Latest version: 1.0.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @pras-ui/config

This package contains the configuration files and utility functions used within the `pras-ui`. It provides shared configurations for tools like ESLint, Prettier, and Rollup to ensure consistency across various packages.

**Note:** This package is **not intended for public use** and is strictly a **helper package** for internal usage within the `pras-ui`. It is designed to standardize and simplify the setup of common development tools and configurations.
npm package: @pras-ui/core
Description: > A collection of low-level hooks and utilities shared across the `@pras-ui` ecosystem.
Author: PRAS
Latest version: 1.0.4

# @pras-ui/core

> A collection of low-level hooks and utilities shared across the `@pras-ui` ecosystem.

This package provides internal helpers for other `@pras-ui` packages and is not typically installed directly.

## Included Utilities

-   **`createContextScope`**: A utility for creating composable and namespaced React contexts.
-   **`composeEventHandlers`**: A helper to compose multiple event handlers into one.
-   **`intercept`**: A powerful utility to orchestrate complex event interactions. It allows you to enhance an event, run a user-provided handler, and then conditionally run default logic based on whether the user cancelled the event by calling `preventDefaultPlus()`.
-   **`useControllableState`**: A hook for creating components that can be either controlled or uncontrolled.
-   **`useId`**: A hook for generating unique, SSR-safe IDs using `React.useId`.
-   **`useMergeRefs`**: A hook for merging multiple refs into a single ref callback.
npm package: @pras-ui/direction
Description: This package is a simple utility to provide and consume text direction (`ltr` or `rtl`) throughout your React application.
Author: PRAS
Latest version: 0.0.1

# @pras-ui/direction

This package is a simple utility to provide and consume text direction (`ltr` or `rtl`) throughout your React application.

## Installation

```bash
npm install @pras-ui/direction
```

## Usage

Wrap your application or a part of it with `DirectionProvider`. Components within this provider can then use the `useDirection` hook to access the current direction.

By default, `DirectionProvider` will infer the direction from the `dir` attribute on the `<html>` element. You can also explicitly set it using the `dir` prop.

```tsx
import React from 'react';
import { DirectionProvider, useDirection } from '@pras-ui/direction';

// A component that uses the direction
function MyComponent() {
  const dir = useDirection();

  return (
    <div>
      The current direction is: <strong>{dir}</strong>
    </div>
  );
}

// Wrap your app in the provider
function App() {
  return (
    <DirectionProvider dir="ltr">
      <MyComponent />
    </DirectionProvider>
  );
}
```

## API

-   **DirectionProvider**: A context provider that should wrap your component tree. It determines the direction and makes it available to all descendants.
-   **useDirection()**: A hook that returns the current direction as either `'ltr'` or `'rtl'`. It must be used within a `DirectionProvider`.
npm package: @pras-ui/floating-kit
Description: > A low-level, headless component for positioning floating elements. This package is built on top of the excellent `@floating-ui/react-dom` to provide a simple, composable API for tooltips, popups, and more.
Author: PRAS
Latest version: 0.0.1

# @pras-ui/floating-kit

> A low-level, headless component for positioning floating elements. This package is built on top of the excellent `@floating-ui/react-dom` to provide a simple, composable API for tooltips, popups, and more.

This package provides the core **puzzle pieces** for creating menu-type components like popups, dropdowns,
and dialogs. It is typically used by other components, like `@pras-ui/popup-menu`, to handle positioning.

## Installation

```bash
npm install @pras-ui/floating-kit
```

## Usage

Here is a basic example of how to make a simple floating element, like a tooltip.

```tsx
import React from "react";
import {
  FloatingRoot,
  FloatingTrigger,
  FloatingContent,
  FloatingPortal,
} from "@pras-ui/floating-kit";

function MyTooltip() {
  const [open, setOpen] = React.useState(false);
  const triggerRef = React.useRef(null);

  return (
    <FloatingRoot>
      <FloatingTrigger virtualTrigger={triggerRef}>
        <button
          ref={triggerRef}
          onMouseEnter={() => setOpen(true)}
          onMouseLeave={() => setOpen(false)}
        >
          Hover me
        </button>
      </FloatingTrigger>

      {open && (
        <FloatingPortal>
          <FloatingContent side="top" align="center">
            <div>My Tooltip</div>
          </FloatingContent>
        </FloatingPortal>
      )}
    </FloatingRoot>
  );
}
```

## Components

- **FloatingRoot**: The root component that provides the context for the floating element.
- **FloatingTrigger**: A component that wraps the reference element (the element the floating content is positioned relative to).
- **FloatingContent**: The component that will be floated. It accepts props like `side`, `align`, and `sideOffset` to control its position.
- **FloatingPortal**: A component that renders its children into a React Portal, ensuring the floating content appears on top of other UI elements.
- **FloatingArrow**: An optional component to render an arrow that points to the trigger element. It should be placed inside `FloatingContent`.
npm package: @pras-ui/menu
Description: > A low-level, headless component for building accessible menus and submenus. This package handles state management, keyboard interactions, and accessibility.
Author: PRAS
Latest version: 0.0.1

# @pras-ui/menu

> A low-level, headless component for building accessible menus and submenus. This package handles state management, keyboard interactions, and accessibility.

This package provides the core **puzzle pieces** for creating menu-type components like popups, dropdowns,
  and dialogs. It's designed to be composed with a positioning library (like @pras-ui/floating-kit) and an
  animation library (like @pras-ui/presence) to create fully-featured, interactive components.

## Installation

```bash
npm install @pras-ui/menu
```

## Usage

Here is a basic example of how to create a menu. Note that this package does **not** handle showing, hiding, or positioning the menu content. It is intended to be used with a presence component (like `@pras-ui/presence`) and a positioning component.

```tsx
import React from 'react';
import {
  MenuRoot,
  MenuTrigger,
  MenuContent,
  MenuItem,
} from '@pras-ui/menu';

function MyMenu() {
  const [open, setOpen] = React.useState(false);

  return (
    <MenuRoot open={open} onOpenChange={setOpen}>
      <MenuTrigger>
        <button>Open Menu</button>
      </MenuTrigger>

      {open && (
        <MenuContent>
          <MenuItem onSelect={() => alert('Copying')}>Copy</MenuItem>
          <MenuItem onSelect={() => alert('Pasting')}>Paste</MenuItem>
        </MenuContent>
      )}
    </MenuRoot>
  );
}
```

## Components

This package exports the following headless components:

### Core Menu
-   **MenuRoot**: The root component that provides the context for the menu state.
-   **MenuTrigger**: The element that opens or closes the menu.
-   **MenuContent**: The wrapper for the menu items which handles keyboard navigation.
-   **MenuItem**: The individual selectable items in the menu.

### Sub-Menu
-   **SubMenuRoot**: The root for a nested menu.
-   **SubMenuTrigger**: The `MenuItem` that opens a sub-menu.
-   **SubMenuContent**: The content wrapper for a sub-menu.

### Choice Items
-   **MenuChoice**: A group of checkable or radio items.
-   **MenuChoiceItem**: A selectable item within a `MenuChoice` group.
-   **MenuChoiceIndicator**: A visual indicator for the selected state of a `MenuChoiceItem`.

### Grouping
-   **MenuGroup**: A component to group related items.
-   **MenuLabel**: The label for a `MenuGroup`.
npm package: @pras-ui/presence
Description: > A low-level, headless hook for managing component presence to allow for animations on mount and unmount.
Author: PRAS
Latest version: 1.0.1

# @pras-ui/presence

> A low-level, headless hook for managing component presence to allow for animations on mount and unmount.

This package provides a `usePresence` hook that delays unmounting a component until its exit animation has completed. It's a critical utility for building animated components like dialogs, popups, and tooltips.

## Installation

```bash
npm install @pras-ui/presence
```

## Usage

The `usePresence` hook is used to conditionally render a component while allowing for exit animations.

It takes a boolean `present` prop and returns `isPresent` (a boolean) and a `ref` that must be attached to the element you want to animate.

- `isPresent`: A boolean that remains `true` during the exit animation, then becomes `false`. Use this to conditionally render your component.
- `ref`: The ref to attach to your animated element.

Here is a basic example of a component that fades in and out.

### Component

```tsx
import React from "react";
import { usePresence } from "@pras-ui/presence";
import "./styles.css"; // Make sure to create and import your CSS

interface FadeInProps {
  open: boolean;
  children?: React.ReactNode;
}

function FadeIn({ open, children }: FadeInProps) {
  const { isPresent, ref } = usePresence(open);

  return isPresent ? (
    <div ref={ref} data-state={open ? "open" : "closed"}>
      {children}
    </div>
  ) : null;
}
```

### CSS for Animations

You can use the `data-state` attribute to apply your animations.

```css
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

[data-state="open"] {
  animation: fadeIn 900ms ease-out;
}

[data-state="closed"] {
  animation: fadeOut 900ms ease-in;
}
```

### Example Implementation

```tsx
function App() {
  const [show, setShow] = React.useState(false);
  return (
    <>
      <button onClick={() => setShow(!show)}>Toggle</button>
      <FadeIn open={show}>
        <div>Hello World</div>
      </FadeIn>
    </>
  );
}
```
npm package: @pras-ui/shared-ui
Description: > A collection of shared, low-level UI components used across the `@pras-ui`.
Author: PRAS
Latest version: 0.0.1

# @pras-ui/shared-ui

> A collection of shared, low-level UI components used across the `@pras-ui`.

This package contains common components that are used as building blocks in other `@pras-ui` packages.

## Installation

```bash
npm install @pras-ui/shared-ui
```

## Components

### Portal

Renders its children into a new React Portal, mounting them at the end of `document.body` by default. This is useful for components like modals and popups that need to appear on top of all other UI.

```tsx
import { Portal } from "@pras-ui/shared-ui";

function MyModal() {
  return (
    <Portal>
      <div className="modal">My Modal Content</div>
    </Portal>
  );
}
```

### Trigger

A simple, unstyled button component with some basic configurations that acts as a base for more complex trigger components in the library.

```tsx
import { Trigger } from "@pras-ui/shared-ui";

function MyButton() {
  return <Trigger onClick={() => alert("Clicked!")}>Click Me</Trigger>;
}
```
npm package: @prasad-edlabadkar/homebridge-wiser
Description: C-Bus Wiser plugin for homebridge: https://github.com/prasad-edlabadka/homebridge-wiser
Latest version: 1.0.9

homebridge-wiser
================

homebridge-wiser is a plug-in for [Homebridge](https://github.com/homebridge/homebridge)
that adds support for the original Clipsal C-Bus Wiser and the Clipsal Wiser 2. This is a fork of version 2.0 of the plugin from [Paul Wilkinson](https://github.com/paulw11/homebridge-wiser). 

Accessories are automatically discovered from the Wiser project.  To add
additional accessories, add them to your Wiser project and restart homebridge.

Installation
------------

You can install the plug-in using `npm`:

`sudo npm install -g @prasad-edlabadkar/homebridge-wiser`

Additional Features
--------------

On top of features supported by the base plugin, following features are added.

* Support for IR controlled AC connected with Wiser 2.
* Support for 3 coloured lights that change color when switched off and on quickly.
* Ability to override device type in configuration depending on what is connected to your Wiser product.
* Light bulb will show sliding control only if it's connected to a dimmer.

Configuration
-------------

### Homebridge Configuration UI
You can configure the plugin using Homebridge configuration UI which will guide you on all aspects.

### Manually configuring config.json
*homebridge-wiser* is added as a `platform` in your config.json:

```JSON
"platforms": [
  {
  "platform": "homebridge-wiser",
  "name": "Wiser",
  "wiserAddress": "1.2.3.4",
  "wiserUsername": "admin",
  "wiserPassword": "yourpassword",
  "wiserPort": "8888",
  "ignoredGAs": [{
                    "network": 254,
                    "ga": 4
                },
                {
                    "network": 254,
                    "ga": 5
                }],
  "deviceTypes": [{
                    "name": "My light",
                    "type": "threeColorLight",
                    "defaultColor": "cool_white",
                    "secondColor": "warm_white",
                    "thirdColor": "day_white"
                },
                {
                    "name": "Guest Fan",
                    "type": "fan"
                },
                {
                    "name": "Dining On Off",
                    "type": "ac"
                }]
    }
]
```

The `ignoredGAs` section is optional.  If a group address is listed in this section, an accessory will not be created
even if it is found in your Wiser project.

The `deviceType` section is optional. The plugin will use device type of each C-bus device connected for creating a homekit device.

After adding the platform, simply restart homebridge and your C-Bus groups will
be added as new accessories automatically.

**Note**: `wiserPort` is *not* the web server port on your wiser (80).  Unless you have changed your Wiser from the default settings,
`8888` is the correct value.

Credits
-------

Thanks to [Paul Wilkinson](https://github.com/paulw11) for this wonderful plugin to enable a legacy product on homekit.
npm package: @prasad-rtns/shared
Description: Shared types, utilities, and middleware for UMP microservices
Author: UMP Team
Latest version: 1.0.2

# @ump/shared

Shared types, utilities, and middleware for UMP microservices platform.

## What's included

- **Types**: `DatabaseType`, `JwtPayload`, `ApiResponse`, common interfaces
- **Utils**: `ResponseUtil`, `JwtUtil`, `CacheService`, `logger`
- **Middleware**: `authenticate`, `authorize`, `departmentScope`, `selfOrAdmin`, security middleware
- **Database**: Multi-DB connection manager

## Installation

```bash
npm install @ump/shared
```

## Usage

```typescript
import { ResponseUtil, authenticate, DatabaseType } from '@ump/shared';

// In controllers
return ResponseUtil.success(res, data);

// In routes
router.get('/protected', authenticate, controller.method);

// In services
import { JwtPayload } from '@ump/shared';
```

## Publishing (maintainers only)

```bash
# Bump version
npm version patch   # or minor / major

# Build and publish to npm
npm publish

# Or publish to GitHub Packages
npm publish --registry=https://npm.pkg.github.com
```

## Development

```bash
# Build
npm run build

# Watch mode
npm run build:watch

# Link locally for development
npm link
cd ../auth-service && npm link @ump/shared
```

## Version History

- `1.0.0` — Initial release with all core utilities