@team-plain/ui-components 0.1.0 → 2.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/LICENSE +21 -0
- package/README.md +58 -0
- package/package.json +9 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Not Just Tickets Ltd.
|
|
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,58 @@
|
|
|
1
|
+
# @team-plain/ui-components
|
|
2
|
+
|
|
3
|
+
Helper functions for building Plain [UI components](https://plain.com/docs). Provides a typed, concise API for constructing `ComponentInput` objects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @team-plain/ui-components @team-plain/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires `@team-plain/sdk` as a peer dependency.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { uiComponent } from "@team-plain/ui-components";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Available Components
|
|
20
|
+
|
|
21
|
+
| Builder | Description |
|
|
22
|
+
|---------|-------------|
|
|
23
|
+
| `uiComponent.text({ text, size?, color? })` | Rich text with optional size and color |
|
|
24
|
+
| `uiComponent.plainText({ text })` | Plain unformatted text |
|
|
25
|
+
| `uiComponent.badge({ label, color? })` | Colored badge |
|
|
26
|
+
| `uiComponent.divider()` | Horizontal divider |
|
|
27
|
+
| `uiComponent.spacer({ size })` | Vertical spacing |
|
|
28
|
+
| `uiComponent.linkButton({ label, url })` | Button that opens a URL |
|
|
29
|
+
| `uiComponent.copyButton({ value, tooltip? })` | Button that copies a value to clipboard |
|
|
30
|
+
| `uiComponent.workflowButton({ label, workflowId })` | Button that triggers a workflow |
|
|
31
|
+
| `uiComponent.container({ content })` | Groups components together |
|
|
32
|
+
| `uiComponent.row({ mainContent, asideContent })` | Two-column layout |
|
|
33
|
+
|
|
34
|
+
### Example
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { uiComponent } from "@team-plain/ui-components";
|
|
38
|
+
|
|
39
|
+
const components = [
|
|
40
|
+
uiComponent.row({
|
|
41
|
+
mainContent: [uiComponent.text({ text: "Customer Plan", size: "L" })],
|
|
42
|
+
asideContent: [uiComponent.badge({ label: "Pro", color: "GREEN" })],
|
|
43
|
+
}),
|
|
44
|
+
uiComponent.divider(),
|
|
45
|
+
uiComponent.text({ text: "Signed up 3 days ago", color: "MUTED" }),
|
|
46
|
+
uiComponent.spacer({ size: "M" }),
|
|
47
|
+
uiComponent.container({
|
|
48
|
+
content: [
|
|
49
|
+
uiComponent.linkButton({ label: "View in Stripe", url: "https://dashboard.stripe.com/..." }),
|
|
50
|
+
uiComponent.copyButton({ value: "cus_abc123", tooltip: "Copy Stripe ID" }),
|
|
51
|
+
],
|
|
52
|
+
}),
|
|
53
|
+
];
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
[MIT](../../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-plain/ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"test": "vitest run"
|
|
22
|
-
},
|
|
23
19
|
"peerDependencies": {
|
|
24
|
-
"@team-plain/sdk": "
|
|
20
|
+
"@team-plain/sdk": "1.0.0"
|
|
25
21
|
},
|
|
26
22
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
23
|
+
"typescript": "^5.7.0",
|
|
24
|
+
"@team-plain/sdk": "1.0.0"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "vitest run"
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|