@platned/ui 0.1.2
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 +68 -0
- package/dist/index.cjs +1351 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +293 -0
- package/dist/index.d.ts +293 -0
- package/dist/index.js +1284 -0
- package/dist/index.js.map +1 -0
- package/dist/sidebar.cjs +402 -0
- package/dist/sidebar.cjs.map +1 -0
- package/dist/sidebar.d.cts +13 -0
- package/dist/sidebar.d.ts +13 -0
- package/dist/sidebar.js +367 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +69 -0
- package/tailwind-preset.js +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @platned/ui
|
|
2
|
+
|
|
3
|
+
Platned Design System — React component library used across Platned products.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @platned/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
// Import styles once at your app root
|
|
15
|
+
import '@platned/ui/styles'
|
|
16
|
+
|
|
17
|
+
// Use components
|
|
18
|
+
import { Button, Input, Modal, DataTable } from '@platned/ui'
|
|
19
|
+
import { AppSidebar } from '@platned/ui/sidebar'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Tailwind users
|
|
23
|
+
|
|
24
|
+
If your project uses Tailwind CSS, extend your config with the Platned preset instead of importing the pre-built CSS:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// tailwind.config.js
|
|
28
|
+
module.exports = {
|
|
29
|
+
presets: [require('@platned/ui/tailwind-preset')],
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## AppSidebar
|
|
34
|
+
|
|
35
|
+
The sidebar ships as a separate entry point to avoid forcing `react-router-dom` on consumers who don't need it.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { AppSidebar } from '@platned/ui/sidebar'
|
|
39
|
+
|
|
40
|
+
<AppSidebar
|
|
41
|
+
collapsed={false}
|
|
42
|
+
onToggle={() => {}}
|
|
43
|
+
userName="Jane Smith"
|
|
44
|
+
userRole="Admin"
|
|
45
|
+
onLogout={() => signOut()}
|
|
46
|
+
/>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm run build # build package (tsup + CSS)
|
|
53
|
+
npm run build:watch # watch mode
|
|
54
|
+
npm run typecheck # TypeScript check
|
|
55
|
+
npm run docs # start docs dev server
|
|
56
|
+
npm run docs:build # build docs for deployment
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Docs
|
|
60
|
+
|
|
61
|
+
Run `npm run docs` and open `http://localhost:5173` to browse the component library with live examples.
|
|
62
|
+
|
|
63
|
+
## Publishing
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm run build && npm run typecheck
|
|
67
|
+
npm publish --access public
|
|
68
|
+
```
|