@mcp-b/react-components 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/dist/Button-QCM8ZKgR.d.ts +98 -0
- package/dist/CodeBlock-CttHhWcb.js +356 -0
- package/dist/CodeBlock-V6pgafSS.d.ts +174 -0
- package/dist/Select-CRsKCJ9x.d.ts +200 -0
- package/dist/class-names-9UtZwb0J.js +12 -0
- package/dist/components/Accordion.d.ts +81 -0
- package/dist/components/Accordion.js +97 -0
- package/dist/components/AgentConnection.d.ts +69 -0
- package/dist/components/AgentConnection.js +176 -0
- package/dist/components/AlertDialog.d.ts +148 -0
- package/dist/components/AlertDialog.js +141 -0
- package/dist/components/Artifact.d.ts +128 -0
- package/dist/components/Artifact.js +115 -0
- package/dist/components/Autocomplete.d.ts +186 -0
- package/dist/components/Autocomplete.js +186 -0
- package/dist/components/Avatar.d.ts +134 -0
- package/dist/components/Avatar.js +118 -0
- package/dist/components/Badge.d.ts +68 -0
- package/dist/components/Badge.js +108 -0
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +73 -0
- package/dist/components/Card.d.ts +87 -0
- package/dist/components/Card.js +81 -0
- package/dist/components/ChainOfThought.d.ts +153 -0
- package/dist/components/ChainOfThought.js +157 -0
- package/dist/components/Checkbox.d.ts +35 -0
- package/dist/components/Checkbox.js +47 -0
- package/dist/components/CheckboxGroup.d.ts +76 -0
- package/dist/components/CheckboxGroup.js +69 -0
- package/dist/components/CodeBlock.d.ts +2 -0
- package/dist/components/CodeBlock.js +2 -0
- package/dist/components/Collapsible.d.ts +127 -0
- package/dist/components/Collapsible.js +103 -0
- package/dist/components/Combobox.d.ts +177 -0
- package/dist/components/Combobox.js +179 -0
- package/dist/components/Commit.d.ts +265 -0
- package/dist/components/Commit.js +282 -0
- package/dist/components/Context.d.ts +129 -0
- package/dist/components/Context.js +309 -0
- package/dist/components/ContextMenu.d.ts +282 -0
- package/dist/components/ContextMenu.js +270 -0
- package/dist/components/Conversation.d.ts +166 -0
- package/dist/components/Conversation.js +202 -0
- package/dist/components/Dialog.d.ts +120 -0
- package/dist/components/Dialog.js +114 -0
- package/dist/components/EnvironmentVariables.d.ts +176 -0
- package/dist/components/EnvironmentVariables.js +221 -0
- package/dist/components/Field.d.ts +281 -0
- package/dist/components/Field.js +274 -0
- package/dist/components/Fieldset.d.ts +93 -0
- package/dist/components/Fieldset.js +81 -0
- package/dist/components/FileTree.d.ts +116 -0
- package/dist/components/FileTree.js +310 -0
- package/dist/components/Form.d.ts +94 -0
- package/dist/components/Form.js +88 -0
- package/dist/components/GithubMotionMark.d.ts +13 -0
- package/dist/components/GithubMotionMark.js +23 -0
- package/dist/components/Input.d.ts +33 -0
- package/dist/components/Input.js +27 -0
- package/dist/components/Label.d.ts +44 -0
- package/dist/components/Label.js +41 -0
- package/dist/components/Menu.d.ts +395 -0
- package/dist/components/Menu.js +338 -0
- package/dist/components/Menubar.d.ts +331 -0
- package/dist/components/Menubar.js +299 -0
- package/dist/components/Message.d.ts +216 -0
- package/dist/components/Message.js +245 -0
- package/dist/components/Meter.d.ts +151 -0
- package/dist/components/Meter.js +121 -0
- package/dist/components/ModelSelector.d.ts +198 -0
- package/dist/components/ModelSelector.js +306 -0
- package/dist/components/NaniteScene.d.ts +33 -0
- package/dist/components/NaniteScene.js +405 -0
- package/dist/components/NavigationMenu.d.ts +256 -0
- package/dist/components/NavigationMenu.js +228 -0
- package/dist/components/NumberField.d.ts +159 -0
- package/dist/components/NumberField.js +123 -0
- package/dist/components/Popover.d.ts +278 -0
- package/dist/components/Popover.js +245 -0
- package/dist/components/PreviewCard.d.ts +156 -0
- package/dist/components/PreviewCard.js +156 -0
- package/dist/components/PricingPage.d.ts +209 -0
- package/dist/components/PricingPage.js +506 -0
- package/dist/components/Progress.d.ts +58 -0
- package/dist/components/Progress.js +51 -0
- package/dist/components/PromptInput.d.ts +399 -0
- package/dist/components/PromptInput.js +737 -0
- package/dist/components/Queue.d.ts +241 -0
- package/dist/components/Queue.js +225 -0
- package/dist/components/RadioGroup.d.ts +78 -0
- package/dist/components/RadioGroup.js +72 -0
- package/dist/components/Reasoning.d.ts +88 -0
- package/dist/components/Reasoning.js +187 -0
- package/dist/components/ScrollArea.d.ts +160 -0
- package/dist/components/ScrollArea.js +145 -0
- package/dist/components/Select.d.ts +2 -0
- package/dist/components/Select.js +260 -0
- package/dist/components/Separator.d.ts +45 -0
- package/dist/components/Separator.js +40 -0
- package/dist/components/Shell.d.ts +163 -0
- package/dist/components/Shell.js +137 -0
- package/dist/components/Slider.d.ts +120 -0
- package/dist/components/Slider.js +115 -0
- package/dist/components/Sources.d.ts +91 -0
- package/dist/components/Sources.js +121 -0
- package/dist/components/Stepper.d.ts +190 -0
- package/dist/components/Stepper.js +315 -0
- package/dist/components/Switch.d.ts +57 -0
- package/dist/components/Switch.js +55 -0
- package/dist/components/Tabs.d.ts +84 -0
- package/dist/components/Tabs.js +78 -0
- package/dist/components/Task.d.ts +100 -0
- package/dist/components/Task.js +120 -0
- package/dist/components/Terminal.d.ts +118 -0
- package/dist/components/Terminal.js +234 -0
- package/dist/components/TestResults.d.ts +236 -0
- package/dist/components/TestResults.js +346 -0
- package/dist/components/Toast.d.ts +192 -0
- package/dist/components/Toast.js +163 -0
- package/dist/components/Toggle.d.ts +69 -0
- package/dist/components/Toggle.js +66 -0
- package/dist/components/ToggleGroup.d.ts +69 -0
- package/dist/components/ToggleGroup.js +99 -0
- package/dist/components/Tool.d.ts +119 -0
- package/dist/components/Tool.js +192 -0
- package/dist/components/Toolbar.d.ts +162 -0
- package/dist/components/Toolbar.js +126 -0
- package/dist/components/Tooltip.d.ts +81 -0
- package/dist/components/Tooltip.js +74 -0
- package/dist/components/WebPreview.d.ts +143 -0
- package/dist/components/WebPreview.js +280 -0
- package/dist/components/useStickToBottom.d.ts +30 -0
- package/dist/components/useStickToBottom.js +95 -0
- package/dist/copy-button-BIATcZWZ.d.ts +16 -0
- package/dist/copy-button-BNgclDrO.js +43 -0
- package/dist/icons-BsWc8g4E.js +221 -0
- package/dist/styles/accordion.css +10 -10
- package/dist/styles/agent-connection.css +18 -17
- package/dist/styles/alert-dialog.css +48 -29
- package/dist/styles/artifact.css +10 -10
- package/dist/styles/autocomplete.css +25 -24
- package/dist/styles/avatar.css +96 -6
- package/dist/styles/badge.css +78 -14
- package/dist/styles/base.css +9 -9
- package/dist/styles/button.css +57 -38
- package/dist/styles/card.css +57 -10
- package/dist/styles/chain-of-thought.css +47 -33
- package/dist/styles/checkbox.css +24 -10
- package/dist/styles/code-block.css +22 -15
- package/dist/styles/collapsible.css +14 -12
- package/dist/styles/combobox.css +26 -25
- package/dist/styles/commit.css +49 -24
- package/dist/styles/context-menu.css +70 -16
- package/dist/styles/context.css +15 -15
- package/dist/styles/conversation.css +12 -12
- package/dist/styles/dialog.css +52 -16
- package/dist/styles/environment-variables.css +19 -19
- package/dist/styles/field.css +184 -22
- package/dist/styles/fieldset.css +5 -4
- package/dist/styles/file-tree.css +17 -17
- package/dist/styles/index.css.d.ts +1 -0
- package/dist/styles/input.css +45 -11
- package/dist/styles/label.css +21 -4
- package/dist/styles/menu.css +55 -32
- package/dist/styles/menubar.css +80 -28
- package/dist/styles/message.css +22 -13
- package/dist/styles/meter.css +8 -8
- package/dist/styles/model-selector.css +33 -21
- package/dist/styles/navigation-menu.css +26 -24
- package/dist/styles/number-field.css +20 -18
- package/dist/styles/popover.css +38 -28
- package/dist/styles/preview-card.css +15 -13
- package/dist/styles/pricing-page.css +53 -53
- package/dist/styles/progress.css +7 -7
- package/dist/styles/prompt-input.css +73 -24
- package/dist/styles/queue.css +58 -32
- package/dist/styles/radio.css +26 -11
- package/dist/styles/reasoning.css +15 -11
- package/dist/styles/scroll-area.css +6 -6
- package/dist/styles/scrollbars.css +4 -4
- package/dist/styles/select.css +84 -25
- package/dist/styles/separator.css +1 -1
- package/dist/styles/shell.css +21 -20
- package/dist/styles/slider.css +35 -11
- package/dist/styles/sources.css +20 -20
- package/dist/styles/stepper.css +22 -22
- package/dist/styles/switch.css +29 -13
- package/dist/styles/tabs.css +23 -16
- package/dist/styles/task.css +27 -23
- package/dist/styles/terminal.css +16 -13
- package/dist/styles/test-results.css +79 -32
- package/dist/styles/toast.css +26 -25
- package/dist/styles/toggle-group.css +12 -12
- package/dist/styles/toggle.css +29 -11
- package/dist/styles/tool.css +54 -32
- package/dist/styles/toolbar.css +30 -28
- package/dist/styles/tooltip.css +10 -8
- package/dist/styles/web-preview.css +37 -21
- package/dist/utils/structured-code.d.ts +10 -0
- package/dist/utils/structured-code.js +81 -0
- package/package.json +17 -8
- package/dist/index.d.ts +0 -7236
- package/dist/index.js +0 -8945
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
|
|
4
|
+
//#region src/components/PreviewCard.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Root component that manages preview card state.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <PreviewCard.Root>
|
|
11
|
+
* <PreviewCard.Trigger href="/profile">
|
|
12
|
+
* View Profile
|
|
13
|
+
* </PreviewCard.Trigger>
|
|
14
|
+
* <PreviewCard.Portal>
|
|
15
|
+
* <PreviewCard.Positioner>
|
|
16
|
+
* <PreviewCard.Popup>
|
|
17
|
+
* <img src="/avatar.jpg" alt="User avatar" />
|
|
18
|
+
* <h3>John Doe</h3>
|
|
19
|
+
* <p>Software Engineer</p>
|
|
20
|
+
* </PreviewCard.Popup>
|
|
21
|
+
* </PreviewCard.Positioner>
|
|
22
|
+
* </PreviewCard.Portal>
|
|
23
|
+
* </PreviewCard.Root>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @see {@link https://base-ui.com/react/components/preview-card | Base UI PreviewCard}
|
|
27
|
+
*/
|
|
28
|
+
const PreviewCardRoot = (props) => {
|
|
29
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Root, { ...props });
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Link element that triggers the preview card on hover.
|
|
33
|
+
*/
|
|
34
|
+
function PreviewCardTrigger({ className = "", ref, ...props }) {
|
|
35
|
+
const classes = ["preview-card__trigger", className].filter(Boolean).join(" ");
|
|
36
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Trigger, {
|
|
37
|
+
ref,
|
|
38
|
+
"data-slot": "hover-card-trigger",
|
|
39
|
+
className: classes,
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Renders preview card content in a portal.
|
|
45
|
+
*/
|
|
46
|
+
const PreviewCardPortal = (props) => {
|
|
47
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Portal, {
|
|
48
|
+
"data-slot": "hover-card-portal",
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Optional backdrop behind the preview card.
|
|
54
|
+
*/
|
|
55
|
+
function PreviewCardBackdrop({ className = "", ref, ...props }) {
|
|
56
|
+
const classes = ["preview-card__backdrop", className].filter(Boolean).join(" ");
|
|
57
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Backdrop, {
|
|
58
|
+
ref,
|
|
59
|
+
"data-slot": "hover-card-backdrop",
|
|
60
|
+
className: classes,
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Positions the preview card relative to the trigger.
|
|
66
|
+
*/
|
|
67
|
+
function PreviewCardPositioner({ className = "", ref, ...props }) {
|
|
68
|
+
const classes = ["preview-card__positioner", className].filter(Boolean).join(" ");
|
|
69
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Positioner, {
|
|
70
|
+
ref,
|
|
71
|
+
"data-slot": "hover-card-positioner",
|
|
72
|
+
className: classes,
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Container for preview card content.
|
|
78
|
+
*/
|
|
79
|
+
function PreviewCardPopup({ className = "", ref, ...props }) {
|
|
80
|
+
const classes = ["preview-card__popup", className].filter(Boolean).join(" ");
|
|
81
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Popup, {
|
|
82
|
+
ref,
|
|
83
|
+
"data-slot": "hover-card-content",
|
|
84
|
+
className: classes,
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function PreviewCardContent({ anchor, positionMethod, side, sideOffset = 4, align = "center", alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, ...props }) {
|
|
89
|
+
return /* @__PURE__ */ jsx(PreviewCardPortal, { children: /* @__PURE__ */ jsx(PreviewCardPositioner, {
|
|
90
|
+
anchor,
|
|
91
|
+
positionMethod,
|
|
92
|
+
side,
|
|
93
|
+
sideOffset,
|
|
94
|
+
align,
|
|
95
|
+
alignOffset,
|
|
96
|
+
collisionBoundary,
|
|
97
|
+
collisionPadding,
|
|
98
|
+
sticky,
|
|
99
|
+
arrowPadding,
|
|
100
|
+
disableAnchorTracking,
|
|
101
|
+
collisionAvoidance,
|
|
102
|
+
children: /* @__PURE__ */ jsx(PreviewCardPopup, { ...props })
|
|
103
|
+
}) });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Decorative arrow pointing to the trigger.
|
|
107
|
+
*/
|
|
108
|
+
function PreviewCardArrow({ className = "", ref, ...props }) {
|
|
109
|
+
const classes = ["preview-card__arrow", className].filter(Boolean).join(" ");
|
|
110
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Arrow, {
|
|
111
|
+
ref,
|
|
112
|
+
"data-slot": "hover-card-arrow",
|
|
113
|
+
className: classes,
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A popup that appears when a link is hovered, showing a preview for sighted users.
|
|
119
|
+
* Useful for showing user profiles, link previews, or additional context.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* // Basic preview card
|
|
124
|
+
* <PreviewCard.Root>
|
|
125
|
+
* <PreviewCard.Trigger href="/users/john">
|
|
126
|
+
* @johndoe
|
|
127
|
+
* </PreviewCard.Trigger>
|
|
128
|
+
* <PreviewCard.Portal>
|
|
129
|
+
* <PreviewCard.Positioner sideOffset={8}>
|
|
130
|
+
* <PreviewCard.Popup>
|
|
131
|
+
* <PreviewCard.Arrow />
|
|
132
|
+
* <div className="preview-content">
|
|
133
|
+
* <img src="/john-avatar.jpg" alt="" />
|
|
134
|
+
* <h4>John Doe</h4>
|
|
135
|
+
* <p>Software Engineer at Acme Corp</p>
|
|
136
|
+
* </div>
|
|
137
|
+
* </PreviewCard.Popup>
|
|
138
|
+
* </PreviewCard.Positioner>
|
|
139
|
+
* </PreviewCard.Portal>
|
|
140
|
+
* </PreviewCard.Root>
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @see {@link https://base-ui.com/react/components/preview-card | Base UI PreviewCard}
|
|
144
|
+
*/
|
|
145
|
+
const PreviewCard = {
|
|
146
|
+
Root: PreviewCardRoot,
|
|
147
|
+
Trigger: PreviewCardTrigger,
|
|
148
|
+
Content: PreviewCardContent,
|
|
149
|
+
Portal: PreviewCardPortal,
|
|
150
|
+
Backdrop: PreviewCardBackdrop,
|
|
151
|
+
Positioner: PreviewCardPositioner,
|
|
152
|
+
Popup: PreviewCardPopup,
|
|
153
|
+
Arrow: PreviewCardArrow
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { PreviewCard };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/PricingPage.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Plan feature definition
|
|
6
|
+
*/
|
|
7
|
+
interface PlanFeature {
|
|
8
|
+
name: string;
|
|
9
|
+
included: boolean;
|
|
10
|
+
tooltip?: string;
|
|
11
|
+
limit?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Plan definition for the pricing page
|
|
15
|
+
*/
|
|
16
|
+
interface Plan {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
monthlyPrice: number;
|
|
21
|
+
yearlyPrice: number;
|
|
22
|
+
features: PlanFeature[];
|
|
23
|
+
popular?: boolean;
|
|
24
|
+
cta?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* FAQ item definition
|
|
28
|
+
*/
|
|
29
|
+
interface FAQItem {
|
|
30
|
+
question: string;
|
|
31
|
+
answer: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Usage tier for calculator
|
|
35
|
+
*/
|
|
36
|
+
interface UsageTier {
|
|
37
|
+
limit: number;
|
|
38
|
+
price: number;
|
|
39
|
+
label: string;
|
|
40
|
+
}
|
|
41
|
+
interface PricingPageProps {
|
|
42
|
+
/**
|
|
43
|
+
* The title of the pricing page
|
|
44
|
+
* @default 'Simple, transparent pricing'
|
|
45
|
+
*/
|
|
46
|
+
title?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The subtitle/description
|
|
49
|
+
*/
|
|
50
|
+
subtitle?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Array of plan definitions
|
|
53
|
+
*/
|
|
54
|
+
plans: Plan[];
|
|
55
|
+
/**
|
|
56
|
+
* FAQ items to display
|
|
57
|
+
*/
|
|
58
|
+
faq?: FAQItem[];
|
|
59
|
+
/**
|
|
60
|
+
* Whether to show the usage calculator
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
showUsageCalculator?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Usage tiers for the calculator
|
|
66
|
+
*/
|
|
67
|
+
usageTiers?: UsageTier[];
|
|
68
|
+
/**
|
|
69
|
+
* Maximum usage value for the slider
|
|
70
|
+
* @default 100000
|
|
71
|
+
*/
|
|
72
|
+
maxUsage?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Usage unit label
|
|
75
|
+
* @default 'API calls'
|
|
76
|
+
*/
|
|
77
|
+
usageUnit?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Callback when a plan is selected
|
|
80
|
+
*/
|
|
81
|
+
onSelectPlan?: (planId: string, billingPeriod: "monthly" | "yearly") => void;
|
|
82
|
+
/**
|
|
83
|
+
* Callback when upgrade is confirmed
|
|
84
|
+
*/
|
|
85
|
+
onConfirmUpgrade?: (planId: string, billingPeriod: "monthly" | "yearly") => void;
|
|
86
|
+
/**
|
|
87
|
+
* Additional class name
|
|
88
|
+
*/
|
|
89
|
+
className?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Style variant for the billing period toggle.
|
|
92
|
+
* When set, hides the style switcher checkbox.
|
|
93
|
+
* @default undefined (shows style switcher for demos)
|
|
94
|
+
*/
|
|
95
|
+
billingToggleVariant?: "switch" | "buttons";
|
|
96
|
+
/**
|
|
97
|
+
* Maps plan ID → Polar product IDs for checkout.
|
|
98
|
+
* When provided, clicking a plan triggers a checkout redirect.
|
|
99
|
+
*/
|
|
100
|
+
productIds?: Record<string, {
|
|
101
|
+
monthly: string;
|
|
102
|
+
yearly: string;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* The Polar product ID of the user's current plan, or null if not subscribed.
|
|
106
|
+
*/
|
|
107
|
+
currentProductId?: string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Whether the user has an active subscription.
|
|
110
|
+
*/
|
|
111
|
+
isSubscribed?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* URL for the checkout API endpoint.
|
|
114
|
+
* @default '/api/checkout'
|
|
115
|
+
*/
|
|
116
|
+
checkoutUrl?: string;
|
|
117
|
+
/**
|
|
118
|
+
* URL for the switch-plan API endpoint (used for existing subscribers).
|
|
119
|
+
* @default '/api/switch-plan'
|
|
120
|
+
*/
|
|
121
|
+
switchPlanUrl?: string;
|
|
122
|
+
/**
|
|
123
|
+
* URL for the customer portal (used when subscription can't be updated inline).
|
|
124
|
+
* @default '/api/portal'
|
|
125
|
+
*/
|
|
126
|
+
portalUrl?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Whether the user is logged in. When false, clicking a paid plan
|
|
129
|
+
* redirects to the login page instead of checkout.
|
|
130
|
+
*/
|
|
131
|
+
isLoggedIn?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* URL to redirect unauthenticated users to.
|
|
134
|
+
* @default '/auth/login'
|
|
135
|
+
*/
|
|
136
|
+
loginUrl?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether the user has a real Polar customer account (has been through checkout before).
|
|
139
|
+
* When true, plan changes go through the customer portal instead of fresh checkout.
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
142
|
+
hasPolarAccount?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Custom checkout handler. When provided, called instead of `window.location.href = checkoutUrl`.
|
|
145
|
+
* Should return the redirect URL or navigate directly.
|
|
146
|
+
*/
|
|
147
|
+
onCheckout?: (productId: string) => Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Custom switch-plan handler. When provided, called instead of `fetch(switchPlanUrl)`.
|
|
150
|
+
* Should return the response status to determine next action.
|
|
151
|
+
*/
|
|
152
|
+
onSwitchPlan?: (productId: string) => Promise<{
|
|
153
|
+
ok: boolean;
|
|
154
|
+
status: number;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Custom portal redirect handler. When provided, called instead of `window.location.href = portalUrl`.
|
|
158
|
+
*/
|
|
159
|
+
onPortalRedirect?: () => Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A comprehensive pricing page component that demonstrates all pricing-related
|
|
163
|
+
* components working together.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* <PricingPage
|
|
168
|
+
* title="Choose your plan"
|
|
169
|
+
* subtitle="Start free, upgrade when you need more"
|
|
170
|
+
* plans={[
|
|
171
|
+
* { id: 'free', name: 'Free', ... },
|
|
172
|
+
* { id: 'pro', name: 'Pro', popular: true, ... },
|
|
173
|
+
* { id: 'enterprise', name: 'Enterprise', ... },
|
|
174
|
+
* ]}
|
|
175
|
+
* faq={[
|
|
176
|
+
* { question: 'Can I cancel anytime?', answer: 'Yes...' },
|
|
177
|
+
* ]}
|
|
178
|
+
* onSelectPlan={(planId, period) => console.log(planId, period)}
|
|
179
|
+
* />
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare function PricingPage({
|
|
183
|
+
title,
|
|
184
|
+
subtitle,
|
|
185
|
+
plans,
|
|
186
|
+
faq,
|
|
187
|
+
showUsageCalculator,
|
|
188
|
+
usageTiers,
|
|
189
|
+
maxUsage,
|
|
190
|
+
usageUnit,
|
|
191
|
+
onSelectPlan,
|
|
192
|
+
onConfirmUpgrade,
|
|
193
|
+
className,
|
|
194
|
+
billingToggleVariant,
|
|
195
|
+
productIds,
|
|
196
|
+
currentProductId,
|
|
197
|
+
isSubscribed,
|
|
198
|
+
checkoutUrl,
|
|
199
|
+
switchPlanUrl,
|
|
200
|
+
portalUrl,
|
|
201
|
+
isLoggedIn,
|
|
202
|
+
loginUrl,
|
|
203
|
+
hasPolarAccount,
|
|
204
|
+
onCheckout,
|
|
205
|
+
onSwitchPlan,
|
|
206
|
+
onPortalRedirect
|
|
207
|
+
}: PricingPageProps): React.JSX.Element;
|
|
208
|
+
//#endregion
|
|
209
|
+
export { FAQItem, Plan, PlanFeature, PricingPage, PricingPageProps, UsageTier };
|