namps-ui 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/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/index.cjs +976 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +453 -0
- package/dist/index.d.ts +453 -0
- package/dist/index.js +893 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +416 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 paper-ui contributors
|
|
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,133 @@
|
|
|
1
|
+
# paper-ui
|
|
2
|
+
|
|
3
|
+
A warm, accessible React component library inspired by Anthropic's design language — paper-warm surfaces, a confident clay accent, an editorial type system, and a complete set of primitives. Ships a single CSS file with light/dark theming via a `data-theme` attribute.
|
|
4
|
+
|
|
5
|
+
> **Note on naming & brand:** `paper-ui` is a neutral placeholder name. Anthropic's real typefaces (Styrene, Tiempos) are proprietary — this library uses close free substitutes (Hanken Grotesk, Newsreader). Rename the package and swap fonts/tokens to fit your own brand before publishing.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install paper-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependencies: `react >= 18`, `react-dom >= 18`.
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
Import the stylesheet once at your app root and wrap your tree in the providers you need:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { ThemeProvider, ToastProvider } from "paper-ui";
|
|
21
|
+
import "paper-ui/styles.css";
|
|
22
|
+
|
|
23
|
+
export default function App({ children }) {
|
|
24
|
+
return (
|
|
25
|
+
<ThemeProvider defaultTheme="light">
|
|
26
|
+
<ToastProvider>{children}</ToastProvider>
|
|
27
|
+
</ThemeProvider>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`ThemeProvider` stamps `data-theme="light|dark"` on `<html>` and persists the choice to `localStorage`. Use the `ThemeToggle` component or `useTheme()` to switch.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Button, Field, Input, Badge, Table, useToast, Icons } from "paper-ui";
|
|
38
|
+
|
|
39
|
+
function Example() {
|
|
40
|
+
const { toast } = useToast();
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<Field label="Workspace name" hint="Visible to all members.">
|
|
44
|
+
<Input defaultValue="Acme AI" />
|
|
45
|
+
</Field>
|
|
46
|
+
<Button leftIcon={<Icons.Plus className="pui-icon" />} onClick={() => toast({ tone: "success", title: "Saved" })}>
|
|
47
|
+
Save
|
|
48
|
+
</Button>
|
|
49
|
+
<Badge tone="green" dot>Active</Badge>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Components
|
|
56
|
+
|
|
57
|
+
| Group | Exports |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| **Actions** | `Button` |
|
|
60
|
+
| **Forms** | `Field`, `Input`, `SearchInput`, `Textarea`, `Select`, `Checkbox`, `Switch`, `RadioGroup`, `Slider` |
|
|
61
|
+
| **Display** | `Badge`, `Tag`, `Avatar`, `AvatarGroup`, `Card`, `StatCard`, `Progress`, `Spinner`, `Skeleton`, `EmptyState` |
|
|
62
|
+
| **Disclosure** | `Accordion` + `AccordionItem`, `Tabs` + `TabList` / `Tab` / `TabPanel` |
|
|
63
|
+
| **Data** | `Table` (typed, sortable) |
|
|
64
|
+
| **Navigation** | `Breadcrumbs`, `Pagination`, `Segmented` |
|
|
65
|
+
| **Feedback** | `Alert`, `ToastProvider` + `useToast` |
|
|
66
|
+
| **Overlay** | `Modal`, `Tooltip`, `DropdownMenu` + `MenuSeparator` |
|
|
67
|
+
| **Theme** | `ThemeProvider`, `useTheme`, `ThemeToggle` |
|
|
68
|
+
| **Icons** | `Icons.*` (stroke icon set) |
|
|
69
|
+
|
|
70
|
+
Every component is individually tree-shakeable and fully typed.
|
|
71
|
+
|
|
72
|
+
## Theming
|
|
73
|
+
|
|
74
|
+
All visual values are CSS custom properties prefixed `--pui-*`, defined for `[data-theme="light"]` and `[data-theme="dark"]` in `styles.css`. Override them anywhere in your own CSS to re-skin:
|
|
75
|
+
|
|
76
|
+
```css
|
|
77
|
+
:root {
|
|
78
|
+
--pui-accent: #4f7a5b; /* change the brand accent */
|
|
79
|
+
--pui-radius: 12px; /* rounder corners everywhere */
|
|
80
|
+
--pui-font-sans: "Inter", system-ui, sans-serif;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Key tokens: `--pui-bg`, `--pui-panel`, `--pui-card`, `--pui-text`, `--pui-muted`, `--pui-border`, `--pui-accent`, `--pui-green / amber / red / blue`, `--pui-radius*`, `--pui-shadow*`, `--pui-font-*`.
|
|
85
|
+
|
|
86
|
+
## Develop
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install
|
|
90
|
+
npm run build # bundle with tsup → dist/ (esm + cjs + d.ts + styles.css)
|
|
91
|
+
npm run dev # watch mode
|
|
92
|
+
npm run typecheck
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Publish to npm
|
|
96
|
+
|
|
97
|
+
The `paper-ui` name is already taken on npm (v0.6.0). Before publishing, pick a unique name — typically a scoped package such as `@your-npm-username/paper-ui`:
|
|
98
|
+
|
|
99
|
+
1. Edit `package.json` and set `"name": "@your-npm-username/paper-ui"`.
|
|
100
|
+
2. Optionally add repository metadata:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
"repository": {
|
|
104
|
+
"type": "git",
|
|
105
|
+
"url": "https://github.com/your-username/your-repo.git"
|
|
106
|
+
},
|
|
107
|
+
"bugs": "https://github.com/your-username/your-repo/issues",
|
|
108
|
+
"homepage": "https://github.com/your-username/your-repo#readme"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
3. Log in to npm (one-time): `npm login`
|
|
112
|
+
4. From this `paper-ui/` folder (or the monorepo root with `-w paper-ui`):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm run build
|
|
116
|
+
npm run pack:check # preview tarball contents
|
|
117
|
+
npm publish --access public # required for scoped packages
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`prepublishOnly` runs build + typecheck automatically before `npm publish`.
|
|
121
|
+
|
|
122
|
+
### Test locally before publishing
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm run build
|
|
126
|
+
npm pack # creates paper-ui-0.1.0.tgz in this folder
|
|
127
|
+
cd ../example # or any consumer app
|
|
128
|
+
npm install ../paper-ui/paper-ui-0.1.0.tgz
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT
|