@facetui/react 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # FacetUI
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@facetui/react.svg)](https://www.npmjs.com/package/@facetui/react)
4
+  ![types](https://img.shields.io/npm/types/@facetui/react.svg)
5
+  ![React 18](https://img.shields.io/badge/React-18-149eca.svg)
6
+  [![license](https://img.shields.io/badge/license-commercial-blue.svg)](./LICENSE.md)
7
+
3
8
  **FacetUI: The enterprise-grade, fully accessible React grid that replaces the sortable, filterable, paginated table you'd otherwise rebuild on every project** — headless architecture, conditional row selection, and a real controlled filtering pipeline, all styled natively in Tailwind with zero lock-in. Drop it in for a working table in one line, or drive the raw hook yourself when you need total control — same engine, three levels of abstraction. Built for teams who need WCAG-grade accessibility and server-side data out of the box, not bolted on after a support ticket.
4
9
 
5
10
  A production-ready, fully accessible data table component for React and Next.js. Built with TypeScript, [React Aria Components](https://react-spectrum.adobe.com/react-aria/) for the interactive primitives, [TanStack Table](https://tanstack.com/table) for the state engine, and Tailwind CSS v4 for styling. Follows the headless architecture pattern so every visual detail is customizable without forking the logic.
@@ -38,27 +43,44 @@ FacetUI is built to eliminate that trade-off — it ships as a complete, enterpr
38
43
 
39
44
  ## Installation
40
45
 
41
- Get FacetUI running in your project in under five minutes.
42
-
43
- **1. Copy the component folder into your project:**
46
+ ### 1. Install from npm
44
47
 
45
- ```
46
- src/components/data-table/
48
+ ```bash
49
+ npm install @facetui/react
47
50
  ```
48
51
 
49
- **2. Install peer dependencies:**
52
+ Then the peer dependencies (React and ReactDOM you already have):
50
53
 
51
54
  ```bash
52
- npm install react-aria-components @tanstack/react-table lucide-react clsx tailwind-merge
55
+ npm install react-aria-components lucide-react clsx tailwind-merge
53
56
  ```
54
57
 
55
- > Installing the published `@facetui/react` package pulls in `@tanstack/react-table` for you; the line above is the full list for the copy-the-folder route.
58
+ `@tanstack/react-table` is a direct dependency and installs automatically.
59
+
60
+ > **Commercial license.** `@facetui/react` is licensed per developer — see [`LICENSE.md`](./LICENSE.md) for terms.
61
+
62
+ ### 2. Tailwind CSS v4
63
+
64
+ The utility classes are auto-detected — there is no `content` array to update. You only need the FacetUI **token contract** in a global stylesheet: copy the `:root` / `.dark` blocks and the `@theme inline` mapping from [`src/index.css`](./src/index.css). If your project already uses a [shadcn/ui](https://ui.shadcn.com) **v4** theme, the ~16 tokens (`--background`, `--primary`, `--muted`, `--ring`, …) are identical and already in place.
65
+
66
+ See [`THEMING.md`](./THEMING.md) for the full token reference, dark mode, and building your own theme or presets.
67
+
68
+ > **On Tailwind v3?** Add `"./node_modules/@facetui/react/dist/**/*.js"` to your `content` globs, register the tokens under `theme.extend.colors`, and mind the v3→v4 utility renames (`shadow-xs`, `rounded-xs`, `outline-hidden`). Details in [`THEMING.md`](./THEMING.md).
69
+
70
+ ### 3. Next.js App Router
71
+
72
+ Every entry point ships `"use client"` — no extra configuration.
73
+
74
+ ---
56
75
 
57
- **3. Tailwind CSS v4 — no config step.** The utility classes are auto-detected from your source; there is no `content` array to update. (Still on Tailwind v3? Add `"./src/components/data-table/**/*.{ts,tsx}"` to your `content` globs and treat the v3→v4 utility renames in the components — `shadow-xs`, `rounded-xs`, `outline-hidden` — accordingly.)
76
+ ### Alternative: vendor the source
58
77
 
59
- **4. Provide the FacetUI token contract.** The components are written against ~16 semantic CSS custom properties (`--background`, `--foreground`, `--border`, `--primary`, `--primary-foreground`, `--muted`, `--muted-foreground`, `--accent`, `--popover`, `--destructive`, `--ring`, …). Copy the `:root` / `.dark` blocks and the `@theme inline` mapping from [`src/index.css`](./src/index.css) into your global stylesheet or, if your project already uses a [shadcn/ui](https://ui.shadcn.com) **v4** theme, the tokens are identical and already in place. See [`THEMING.md`](./THEMING.md) for the full token reference, dark mode, and a walkthrough for building your own theme or presets.
78
+ Licensees who prefer to copy the component into their own tree rather than depend on the package:
60
79
 
61
- > **Next.js App Router note:** All files include `"use client"` no extra configuration required.
80
+ 1. Copy `src/components/data-table/` into your project.
81
+ 2. `npm install react-aria-components @tanstack/react-table lucide-react clsx tailwind-merge`
82
+ 3. On Tailwind v3, add `"./src/components/data-table/**/*.{ts,tsx}"` to your `content` globs.
83
+ 4. Import from your local path (e.g. `@/components/data-table`) instead of `@facetui/react` — everything below is otherwise identical.
62
84
 
63
85
  ---
64
86
 
@@ -67,8 +89,8 @@ npm install react-aria-components @tanstack/react-table lucide-react clsx tailwi
67
89
  ### Basic example
68
90
 
69
91
  ```tsx
70
- import { DataTable } from "@/components/data-table";
71
- import type { ColumnDef } from "@/components/data-table";
92
+ import { DataTable } from "@facetui/react";
93
+ import type { ColumnDef } from "@facetui/react";
72
94
 
73
95
  interface User {
74
96
  id: string;
@@ -111,12 +133,12 @@ This gives you: global search, client-side sorting on every column, column visib
111
133
  "use client";
112
134
 
113
135
  import { useState } from "react";
114
- import { DataTable } from "@/components/data-table";
136
+ import { DataTable } from "@facetui/react";
115
137
  import type {
116
138
  ColumnDef,
117
139
  PaginationState,
118
140
  SortingState,
119
- } from "@/components/data-table";
141
+ } from "@facetui/react";
120
142
 
121
143
  interface Product {
122
144
  id: string;
@@ -309,7 +331,7 @@ When you need a completely custom render layer, bypass all primitives and drive
309
331
  ```tsx
310
332
  "use client";
311
333
 
312
- import { useDataTable } from "@/components/data-table";
334
+ import { useDataTable } from "@facetui/react";
313
335
 
314
336
  export function MyCustomTable() {
315
337
  const table = useDataTable({ data, columns, enableRowSelection: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@facetui/react",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Production-ready, accessible data table for React and Next.js — built on React Aria Components + TanStack Table + Tailwind CSS.",
5
5
  "author": "Cameron Gates (Redbeard Publishing) <contact@redbeard.au> (https://redbeard.au)",
6
6
  "license": "SEE LICENSE IN LICENSE.md",