@cristianmpx/react-import-sheet-ui-raw 1.0.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/README.md +67 -0
- package/dist/index.d.mts +750 -0
- package/dist/index.d.ts +750 -0
- package/dist/index.js +1766 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1696 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +114 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @cristianm/react-import-sheet-ui-raw
|
|
2
|
+
|
|
3
|
+
UI components for sheet import — built on [@cristianmpx/react-import-sheet-headless](https://github.com/cristianm-developer/react-import-sheet-headless). **Hooks-first, headless:** no styles; you apply your own CSS and markup.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Hooks** (`useRawFilePicker`, `useRawCell`, `useRawTableBody`, etc.) with prop-getters and DOM contract (`data-*`, `aria-*`).
|
|
8
|
+
- **RawImporterWorkflow** — optional orchestrator for idle → mapping → process → result/error.
|
|
9
|
+
- **Validation errors:** cells expose `data-has-error` and an error message slot (`getErrorProps`, `data-ris-ui="raw-cell-error-message"`). The workflow supports **cellErrorPlacement** (`inline` | `below` | `none`) to show the message inline, on a second line in the cell, or not in the cell (e.g. tooltip elsewhere).
|
|
10
|
+
|
|
11
|
+
**Usage reference:** run `npm run storybook` for live examples and demos.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @cristianm/react-import-sheet-ui-raw @cristianmpx/react-import-sheet-headless react react-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Configure the headless engine with `ImporterProvider`, then use the raw UI components (e.g. `RawProgressMonitor`, `RawAbortController`) inside that tree. See the headless package for layout and pipeline setup.
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { ImporterProvider } from '@cristianmpx/react-import-sheet-headless';
|
|
25
|
+
import { RawProgressMonitor, RawAbortController } from '@cristianm/react-import-sheet-ui-raw';
|
|
26
|
+
|
|
27
|
+
<ImporterProvider layout={myLayout} engine="auto">
|
|
28
|
+
<RawProgressMonitor>
|
|
29
|
+
{({ phase, progressRef, aborted }) => (
|
|
30
|
+
<div>
|
|
31
|
+
{phase} {aborted && 'Aborted'}
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
34
|
+
</RawProgressMonitor>
|
|
35
|
+
<RawAbortController>Cancel</RawAbortController>
|
|
36
|
+
</ImporterProvider>;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Scripts
|
|
40
|
+
|
|
41
|
+
| Script | Description |
|
|
42
|
+
| ------------------------- | ---------------------------------- |
|
|
43
|
+
| `npm run build` | Build ESM + CJS + types to `dist/` |
|
|
44
|
+
| `npm run lint` | Run ESLint |
|
|
45
|
+
| `npm run lint:fix` | ESLint with auto-fix |
|
|
46
|
+
| `npm run format` | Prettier write |
|
|
47
|
+
| `npm run format:check` | Prettier check |
|
|
48
|
+
| `npm run test` | Vitest watch |
|
|
49
|
+
| `npm run test:run` | Vitest run once |
|
|
50
|
+
| `npm run test:coverage` | Vitest with coverage (≥90%) |
|
|
51
|
+
| `npm run storybook` | Storybook dev server |
|
|
52
|
+
| `npm run build-storybook` | Build static Storybook |
|
|
53
|
+
| `npm run commit` | Commitizen (conventional commits) |
|
|
54
|
+
|
|
55
|
+
## Storybook
|
|
56
|
+
|
|
57
|
+
Storybook includes:
|
|
58
|
+
|
|
59
|
+
- **Test widget** (addon-vitest): run component tests on stories from the sidebar; optional Accessibility and Coverage.
|
|
60
|
+
- **Accessibility** (addon-a11y): run a11y checks alongside tests and inspect violations in the Accessibility panel.
|
|
61
|
+
- **Docs** (addon-docs): auto-generated docs and MDX (e.g. **Get started** in the sidebar).
|
|
62
|
+
|
|
63
|
+
Restart Storybook after installing or updating addons.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
ISC
|