@ttoss/react-billing 0.1.1 → 0.1.3
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 +74 -1
- package/dist/esm/index.js +365 -4653
- package/dist/index.d.ts +263 -4
- package/package.json +6 -3
- package/dist/index.d.cts +0 -48
- package/dist/index.js +0 -4912
package/README.md
CHANGED
|
@@ -1,7 +1,80 @@
|
|
|
1
1
|
# @ttoss/react-billing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Billing UI components for React apps.
|
|
4
|
+
|
|
5
|
+
Built on top of `@ttoss/ui`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
pnpm add @ttoss/react-billing
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
This package expects your app to be wrapped with `@ttoss/ui` `ThemeProvider`.
|
|
16
|
+
|
|
17
|
+
### PlanCard
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { PlanCard } from '@ttoss/react-billing';
|
|
21
|
+
|
|
22
|
+
export const Example = () => (
|
|
23
|
+
<PlanCard
|
|
24
|
+
title="Pro"
|
|
25
|
+
subtitle="Best for teams"
|
|
26
|
+
price={{
|
|
27
|
+
value: 'R$ 99,00',
|
|
28
|
+
interval: 'month',
|
|
29
|
+
description: 'Billed monthly',
|
|
30
|
+
}}
|
|
31
|
+
metadata={[
|
|
32
|
+
{ title: 'Seats', value: '5', icon: 'fluent:people-24-regular' },
|
|
33
|
+
{
|
|
34
|
+
title: 'Support',
|
|
35
|
+
value: 'Priority',
|
|
36
|
+
icon: 'fluent:chat-help-24-regular',
|
|
37
|
+
},
|
|
38
|
+
]}
|
|
39
|
+
features={[{ label: 'Unlimited projects' }, { label: 'SSO' }]}
|
|
40
|
+
buttonProps={{ label: 'Choose plan', variant: 'accent' }}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### SubscriptionCard
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { SubscriptionCard } from '@ttoss/react-billing';
|
|
49
|
+
|
|
50
|
+
export const Example = () => (
|
|
51
|
+
<SubscriptionCard
|
|
52
|
+
planName="Pro"
|
|
53
|
+
price={{ value: 'R$ 99,00', interval: 'month' }}
|
|
54
|
+
status={{ status: 'active', interval: 'Monthly' }}
|
|
55
|
+
features={[{ label: 'Unlimited projects' }, { label: 'SSO' }]}
|
|
56
|
+
actions={[{ label: 'Manage', onClick: () => {}, variant: 'accent' }]}
|
|
57
|
+
metrics={[
|
|
58
|
+
{
|
|
59
|
+
type: 'date',
|
|
60
|
+
label: 'Renews on',
|
|
61
|
+
date: '2025-01-15',
|
|
62
|
+
icon: 'fluent:calendar-24-regular',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'percentage',
|
|
66
|
+
label: 'Usage',
|
|
67
|
+
current: 75,
|
|
68
|
+
max: 100,
|
|
69
|
+
icon: 'fluent:data-usage-24-regular',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
```
|
|
4
75
|
|
|
5
76
|
## Exports
|
|
6
77
|
|
|
7
78
|
- `PlanCard`
|
|
79
|
+
- `SubscriptionCard`
|
|
80
|
+
- Types: `PlanCardProps`, `PlanCardVariant`, `PlanCardPrice`, `PlanCardMetadata`, `PlanCardButtonProps`, `PlanCardMetadataSlotService` (and related slot types)
|