open-index/open-npm huggingface dataset:
npm package: @fortisvincere/policy-acceptance-module
Description: A React and Next.js package for policy acceptance workflows with modal and dashboard UIs, version history, and support for individual, company-wide, and hybrid acceptance models.
Latest version: 1.0.4

# Policy Acceptance Module

A React and Next.js package for policy acceptance workflows with modal and dashboard UIs, version history, and support for individual, company-wide, and hybrid acceptance models.

## Features

- Modal and dashboard display modes
- Individual-only, company-only, and hybrid organization presets
- Version history and policy diff support
- Deadline indicators and acceptance status tracking
- TypeScript-first public API

## Install

```bash
npm install @fortisvincere/policy-acceptance-module
```

## Quick Start

```tsx
import { useState } from "react";
import {
  PolicyAcceptanceModal,
  PolicyAcceptanceProvider,
  createIndividualOnlyConfig,
  createUser,
  generateSamplePolicies,
} from "@fortisvincere/policy-acceptance-module";

const user = createUser("user-001", "john@example.com", "John Smith", "user");
const policies = generateSamplePolicies();

const config = createIndividualOnlyConfig(user, {
  dataSource: {
    type: "local",
    localData: {
      policies,
      users: [user],
      companies: [],
      currentUser: user,
    },
  },
});

export function App() {
  const [showModal, setShowModal] = useState(true);

  return (
    <PolicyAcceptanceProvider config={config}>
      <PolicyAcceptanceModal
        isOpen={showModal}
        onClose={() => setShowModal(false)}
      />
    </PolicyAcceptanceProvider>
  );
}
```

## Display Modes

### Modal

```tsx
import { PolicyAcceptanceModal } from "@fortisvincere/policy-acceptance-module";

<PolicyAcceptanceModal
  isOpen={showModal}
  onClose={() => setShowModal(false)}
/>;
```

### Dashboard

```tsx
import { PolicyAcceptanceDashboard } from "@fortisvincere/policy-acceptance-module";

<PolicyAcceptanceDashboard legalHubUrl="https://legal.example.com/policies" />;
```

## Demo

Run the local demo app:

```bash
pnpm dev
```

Available routes:

- `/`
- `/demo/modal`
- `/demo/dashboard`

## Documentation

- [Policy Diff Guide](./docs/policy-diff.md)
- [Examples](./app/examples/README.md)
- [Contributing](./docs/CONTRIBUTING.md)

## Build

Build the demo app:

```bash
pnpm build
```

Build the package output:

```bash
pnpm build:package
```

## License

Released under the MIT License. See [LICENSE](./LICENSE).