@skapp/skapp-ui 0.0.0-stage → 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/CHANGELOG.md +34 -0
- package/LICENSE +661 -0
- package/README.md +96 -3
- package/dist/cjs/index.cjs +13573 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/index.esm.js +13276 -0
- package/dist/esm/index.esm.js.map +1 -0
- package/dist/index.d.ts +4050 -0
- package/dist/tailwind.css +1 -0
- package/package.json +145 -6
package/README.md
CHANGED
|
@@ -1,3 +1,96 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# skapp-ui
|
|
2
|
+
|
|
3
|
+
React component library for [Skapp](https://github.com/SkappHQ/skapp), built with TypeScript and Tailwind CSS v4.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@skapphq/skapp-ui)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/SkappHQ/skapp-ui/actions/workflows/test.yml)
|
|
8
|
+
[](https://github.com/SkappHQ/skapp-ui/actions/workflows/build.yml)
|
|
9
|
+
|
|
10
|
+
**[Browse the components in Storybook →](https://skapphq.github.io/skapp-ui/)**
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @skapphq/skapp-ui
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The package ships as an ES module with TypeScript types and a prebuilt stylesheet.
|
|
19
|
+
|
|
20
|
+
### Peer dependencies
|
|
21
|
+
|
|
22
|
+
`react` and `react-dom` (18 or 19) are required. The package also lists the libraries below as peer dependencies so your app controls their versions. The bundle is a single file that imports all of them, so install every one even if you only use some of the components:
|
|
23
|
+
|
|
24
|
+
| Used by | Packages |
|
|
25
|
+
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
26
|
+
| `RichTextEditor` and the components built on it (`CommentSection`, `ReplySection`, `ApprovalCard`), `MultiSelectSearch` | `@tiptap/*` (v3), `tiptap-extension-resize-image` |
|
|
27
|
+
| `ApprovalCard`, `CommentSection` | `dompurify` |
|
|
28
|
+
| `DatePicker`, `DateRangePicker` | `react-day-picker` (v9) |
|
|
29
|
+
| `DraggableDeleteTable`, `ListTable` | `@dnd-kit/core`, `@dnd-kit/sortable`, `@dnd-kit/utilities` |
|
|
30
|
+
|
|
31
|
+
npm 7 and later installs peer dependencies automatically. pnpm 8 and later does too. With Yarn, older pnpm versions or `--legacy-peer-deps`, install them all yourself; the full list and version ranges are in [`package.json`](package.json) under `peerDependencies`.
|
|
32
|
+
|
|
33
|
+
## Styles
|
|
34
|
+
|
|
35
|
+
Components are styled with Tailwind CSS, and the package includes a prebuilt stylesheet (`dist/tailwind.css`). Load it once in your app.
|
|
36
|
+
|
|
37
|
+
**Apps using Tailwind CSS v4** – import it from your main CSS file, after Tailwind:
|
|
38
|
+
|
|
39
|
+
```css
|
|
40
|
+
@import "tailwindcss";
|
|
41
|
+
@import "@skapphq/skapp-ui";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Apps without Tailwind** – import the stylesheet from your entry file:
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import "@skapphq/skapp-ui/tailwind.css";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Things to know:
|
|
51
|
+
|
|
52
|
+
- The stylesheet includes Tailwind's base reset (preflight) and the library's theme tokens (for example `--color-primary-*` and `--color-label-*`).
|
|
53
|
+
- It loads the Inter and Noto Color Emoji fonts from Google Fonts with `@import url(...)`. If your app serves fonts itself or your bundler rejects remote imports, strip those rules in your PostCSS pipeline and load the fonts your own way.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { useState } from "react";
|
|
59
|
+
import { Avatar, ButtonV2, InputField, MailIcon } from "@skapphq/skapp-ui";
|
|
60
|
+
|
|
61
|
+
export function InviteMember() {
|
|
62
|
+
const [email, setEmail] = useState("");
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className="flex items-end gap-4">
|
|
66
|
+
<Avatar id="current-user" firstName="Ada" lastName="Lovelace" size="lg" />
|
|
67
|
+
<InputField
|
|
68
|
+
label="Email"
|
|
69
|
+
type="email"
|
|
70
|
+
placeholder="name@example.com"
|
|
71
|
+
value={email}
|
|
72
|
+
onChange={(event) => setEmail(event.target.value)}
|
|
73
|
+
leftIcon={<MailIcon />}
|
|
74
|
+
helperText="We'll send an invite to this address"
|
|
75
|
+
/>
|
|
76
|
+
<ButtonV2 variant="primary" size="md" disabled={!email}>
|
|
77
|
+
Send invite
|
|
78
|
+
</ButtonV2>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Every component, its props and its variants are documented in [Storybook](https://skapphq.github.io/skapp-ui/).
|
|
85
|
+
|
|
86
|
+
## Contributing
|
|
87
|
+
|
|
88
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, the branch flow and the PR checklist, and please follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
89
|
+
|
|
90
|
+
## 📜 License
|
|
91
|
+
|
|
92
|
+
GNU AFFERO GENERAL PUBLIC LICENSE (see **[LICENSE](LICENSE)**).
|
|
93
|
+
|
|
94
|
+
## 🎨 Logo & Trademark
|
|
95
|
+
|
|
96
|
+
Please read our **[Trademark Policy](TRADEMARK_POLICY.md)**.
|