@adapttable/unstyled 0.1.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # @adapttable/unstyled
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 845ff41: Initial public release of AdaptTable — a headless, UI-agnostic React data
8
+ table: one API, rendered natively by your design system.
9
+ - `@adapttable/core`: the headless engine — declarative `columns` (bare
10
+ keys, dot-paths, auto headers) and `filters` (one definition drives the
11
+ widget, URL params, chips, and predicate, with `"auto"` and async option
12
+ sources), three data tiers (in-memory, server via one consolidated
13
+ `onQueryChange(query, { signal })`, or a full custom `TableSource`),
14
+ URL-synced state with an injectable adapter (`urlSync={false}` for
15
+ in-memory), multi-sort, summary rows, header groups, row expansion,
16
+ saved views, select-all-N-matching, keyboard row navigation, and opt-in
17
+ row/card virtualization that tracks the page or any `maxHeight` scroll
18
+ box — 50,000 rows stay a handful of DOM nodes.
19
+ - Batteries-included adapters for **Mantine**, **MUI**, **Chakra UI**,
20
+ **Ant Design**, and **Tailwind/shadcn** (`@adapttable/unstyled`): native
21
+ filter forms with operator-first number/date ranges, column management
22
+ (hide / reorder / pin / resize — the row-actions column included), a
23
+ built-in saved-views menu, mobile card layouts, and memoized rows.
24
+ - `@adapttable/i18n`: label presets for ten locales (en, ar, de, es, fr,
25
+ he, it, ja, pt, zh) with RTL helpers — headers, cells, sorting and
26
+ filtering can all follow per-locale data paths.
27
+ - `@adapttable/cli`: `npx @adapttable/cli init` detects your kit and
28
+ scaffolds a working table.
29
+
30
+ Highlights: shareable URL state, paging and true infinite scroll (auto by
31
+ device), first-class RTL, seamless dark mode, 100% test coverage, and a
32
+ full headless escape hatch at every layer.
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [845ff41]
37
+ - @adapttable/core@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Orwa Mahmoud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # @adapttable/unstyled
2
+
3
+ The **headless, unstyled** adapter for [AdaptTable](https://github.com/orwa-mahmoud/adapttable).
4
+ Renders semantic HTML with `data-adapttable-part` + `data-*` state hooks
5
+ and per-part `className` overrides — style it with **Tailwind**, **shadcn/ui**,
6
+ or your own CSS. Ships zero styles.
7
+
8
+ ```bash
9
+ pnpm add @adapttable/unstyled @adapttable/core react react-dom
10
+ ```
11
+
12
+ ## Quickstart
13
+
14
+ ```tsx
15
+ import {
16
+ DataTable,
17
+ useFrontendData,
18
+ type ColumnDef,
19
+ } from "@adapttable/unstyled";
20
+
21
+ const columns: ColumnDef<Person>[] = [
22
+ { key: "name", header: "Name", accessor: (r) => r.name, sortable: true },
23
+ { key: "city", header: "City", accessor: (r) => r.city },
24
+ ];
25
+
26
+ export function People({ data }: { data: Person[] }) {
27
+ const source = useFrontendData({ data, columns });
28
+ return (
29
+ <DataTable
30
+ source={source}
31
+ columns={columns}
32
+ rowKey={(r) => r.id}
33
+ classNames={{
34
+ table: "w-full text-sm",
35
+ headerCell: "text-left font-medium text-zinc-500 px-3 py-2",
36
+ row: "border-b hover:bg-zinc-50 data-[selected]:bg-blue-50",
37
+ cell: "px-3 py-2",
38
+ }}
39
+ />
40
+ );
41
+ }
42
+ ```
43
+
44
+ ## Styling hooks
45
+
46
+ Every node carries:
47
+
48
+ - `data-adapttable-part="…"` — `root`, `toolbar`, `search-field`,
49
+ `search-icon`, `search`, `filters-button`, `filters-icon`, `column-menu`,
50
+ `table`, `row`, `cell`, `header-cell`, `sort-button`, `chips`, `chip`,
51
+ `bulk-bar`, `footer`, `empty`, `loading`, `error`, `card`, …
52
+ - `data-*` state — `data-selected` on selected rows/cards, `data-sorted`
53
+ (`asc`/`desc`) on the active header, `data-mobile` on the root, and
54
+ `data-density` (`comfortable`/`compact`) on the root. The adapter ships no
55
+ density styles — drive spacing yourself, e.g.
56
+ `[data-density="compact"] [data-adapttable-part="cell"] { padding: 4px 8px; }`.
57
+ - A per-part `className` from the `classNames` prop.
58
+
59
+ Target them with attribute selectors (`[data-adapttable-part="row"]`),
60
+ Tailwind data variants (`data-[selected]:bg-blue-50`), or class overrides.
61
+
62
+ The leading search/funnel glyphs render as inline `currentColor` SVGs in the
63
+ `search-icon` / `filters-icon` slots, so you can restyle or hide them via the
64
+ `searchIcon` / `filtersIcon` class names (or the matching `data-adapttable-part`
65
+ selectors). `SearchIcon` and `FiltersIcon` are also exported for reuse.
66
+
67
+ ## Empty / loading overrides
68
+
69
+ Replace the empty-state or first-load skeleton with the top-level
70
+ `emptyState` / `loadingState` props, or with the cross-adapter `slots` alias —
71
+ whichever your other adapters already use:
72
+
73
+ ```tsx
74
+ <DataTable
75
+ source={source}
76
+ columns={columns}
77
+ rowKey={(r) => r.id}
78
+ slots={{ empty: <MyEmpty />, skeleton: <MySkeleton /> }}
79
+ />
80
+ ```
81
+
82
+ `slots.empty` / `slots.skeleton` take precedence when both forms are supplied
83
+ (`slots.empty ?? emptyState`, `slots.skeleton ?? loadingState`).
84
+
85
+ Everything else — client/server data, URL state, sorting, filtering,
86
+ selection + bulk actions, RTL (`dir`), auto desktop/mobile — works the same
87
+ as the other adapters, on the headless `@adapttable/core` engine.
88
+
89
+ ## License
90
+
91
+ [MIT](../../LICENSE) © Orwa Mahmoud