@designa8/vibedesign-linear-internal-v1-2-176b 0.2.3 → 0.2.4
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 +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/styles.css +3 -0
- package/package.json +1 -1
- package/src/atoms/PricingTable/index.ts +1 -0
- package/src/atoms/PricingTable/preview.tsx +57 -5
- package/src/atoms/PricingTableDesktop/PricingTableDesktop.tsx +9 -1
- package/src/atoms/PricingTableDesktop/index.ts +6 -1
- package/src/atoms/PricingTableMobile/PricingTableMobile.tsx +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-linear-internal-v1-2-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.2.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.2.4**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -6966,7 +6966,7 @@ var PricingTableDesktop = React63.forwardRef(
|
|
|
6966
6966
|
tier.current ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "secondary", fullWidth: true, disabled: true, children: "Current plan" }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6967
6967
|
Button,
|
|
6968
6968
|
{
|
|
6969
|
-
variant: "primary",
|
|
6969
|
+
variant: tier.ctaVariant ?? "primary",
|
|
6970
6970
|
fullWidth: true,
|
|
6971
6971
|
onClick: () => onSelectTier?.(tier.id, period),
|
|
6972
6972
|
children: tier.ctaLabel ?? "Upgrade"
|
|
@@ -7056,7 +7056,7 @@ var PricingTableMobile = React64.forwardRef(
|
|
|
7056
7056
|
tier.current ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "secondary", size: "lg", fullWidth: true, disabled: true, children: "Current plan" }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
7057
7057
|
Button,
|
|
7058
7058
|
{
|
|
7059
|
-
variant: "primary",
|
|
7059
|
+
variant: tier.ctaVariant ?? "primary",
|
|
7060
7060
|
size: "lg",
|
|
7061
7061
|
fullWidth: true,
|
|
7062
7062
|
onClick: () => onSelectTier?.(tier.id, period),
|
package/dist/index.js
CHANGED
|
@@ -6842,7 +6842,7 @@ var PricingTableDesktop = React63.forwardRef(
|
|
|
6842
6842
|
tier.current ? /* @__PURE__ */ jsx63(Button, { variant: "secondary", fullWidth: true, disabled: true, children: "Current plan" }) : /* @__PURE__ */ jsx63(
|
|
6843
6843
|
Button,
|
|
6844
6844
|
{
|
|
6845
|
-
variant: "primary",
|
|
6845
|
+
variant: tier.ctaVariant ?? "primary",
|
|
6846
6846
|
fullWidth: true,
|
|
6847
6847
|
onClick: () => onSelectTier?.(tier.id, period),
|
|
6848
6848
|
children: tier.ctaLabel ?? "Upgrade"
|
|
@@ -6932,7 +6932,7 @@ var PricingTableMobile = React64.forwardRef(
|
|
|
6932
6932
|
tier.current ? /* @__PURE__ */ jsx64(Button, { variant: "secondary", size: "lg", fullWidth: true, disabled: true, children: "Current plan" }) : /* @__PURE__ */ jsx64(
|
|
6933
6933
|
Button,
|
|
6934
6934
|
{
|
|
6935
|
-
variant: "primary",
|
|
6935
|
+
variant: tier.ctaVariant ?? "primary",
|
|
6936
6936
|
size: "lg",
|
|
6937
6937
|
fullWidth: true,
|
|
6938
6938
|
onClick: () => onSelectTier?.(tier.id, period),
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +1,71 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
2
3
|
import { PricingTable } from "./PricingTable";
|
|
3
4
|
import type { PricingTier } from "../PricingTableDesktop";
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
{ id: "free", name: "Free", monthlyPrice: 0, note: "Free for everyone",
|
|
6
|
+
const TIERS_DEFAULT: PricingTier[] = [
|
|
7
|
+
{ id: "free", name: "Free", monthlyPrice: 0, note: "Free for everyone", ctaLabel: "Get started" },
|
|
7
8
|
{ id: "basic", name: "Basic", monthlyPrice: 10, yearlyPrice: 8, highlighted: true },
|
|
8
9
|
{ id: "business", name: "Business", monthlyPrice: 16, yearlyPrice: 14 },
|
|
9
10
|
];
|
|
10
11
|
|
|
12
|
+
/** One highlighted tier keeps the only primary action; the others are secondary. */
|
|
13
|
+
const TIERS_SINGLE_PRIMARY: PricingTier[] = [
|
|
14
|
+
{
|
|
15
|
+
id: "free",
|
|
16
|
+
name: "Free",
|
|
17
|
+
monthlyPrice: 0,
|
|
18
|
+
note: "Free for everyone",
|
|
19
|
+
ctaLabel: "Get started",
|
|
20
|
+
ctaVariant: "secondary",
|
|
21
|
+
},
|
|
22
|
+
{ id: "basic", name: "Basic", monthlyPrice: 10, yearlyPrice: 8, highlighted: true },
|
|
23
|
+
{
|
|
24
|
+
id: "business",
|
|
25
|
+
name: "Business",
|
|
26
|
+
monthlyPrice: 16,
|
|
27
|
+
yearlyPrice: 14,
|
|
28
|
+
ctaLabel: "Choose Business",
|
|
29
|
+
ctaVariant: "secondary",
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
11
33
|
export default function PricingTablePreview() {
|
|
12
34
|
const [chosen, setChosen] = React.useState<string | null>(null);
|
|
35
|
+
const [yearly, setYearly] = React.useState(false);
|
|
36
|
+
|
|
13
37
|
return (
|
|
14
|
-
<div className="w-full p-lg">
|
|
15
|
-
<
|
|
16
|
-
|
|
38
|
+
<div className="mx-auto flex w-full max-w-5xl flex-col gap-section p-lg">
|
|
39
|
+
<div className="flex flex-wrap items-center justify-between gap-sm">
|
|
40
|
+
<p className="text-body-sm text-muted">Default: every tier renders a primary CTA</p>
|
|
41
|
+
<Button
|
|
42
|
+
variant="secondary"
|
|
43
|
+
size="sm"
|
|
44
|
+
aria-pressed={yearly}
|
|
45
|
+
onClick={() => setYearly((v) => !v)}
|
|
46
|
+
>
|
|
47
|
+
{yearly ? "Billed yearly" : "Billed monthly"}
|
|
48
|
+
</Button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<PricingTable
|
|
52
|
+
tiers={TIERS_DEFAULT}
|
|
53
|
+
billing={yearly ? "yearly" : "monthly"}
|
|
54
|
+
onSelectTier={(id, billing) => setChosen(`${id} (${billing})`)}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<div className="flex flex-col gap-base border-t border-hairline pt-lg">
|
|
58
|
+
<p className="text-body-sm text-muted">
|
|
59
|
+
With ctaVariant="secondary": only the highlighted tier keeps the primary action
|
|
60
|
+
</p>
|
|
61
|
+
<PricingTable
|
|
62
|
+
tiers={TIERS_SINGLE_PRIMARY}
|
|
63
|
+
billing={yearly ? "yearly" : "monthly"}
|
|
64
|
+
onSelectTier={(id, billing) => setChosen(`${id} (${billing})`)}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<p className="text-body-sm text-muted" aria-live="polite">
|
|
17
69
|
{chosen ? `Selected ${chosen}` : "Pick a plan"}
|
|
18
70
|
</p>
|
|
19
71
|
</div>
|
|
@@ -5,6 +5,8 @@ import { Switch } from "../Switch";
|
|
|
5
5
|
|
|
6
6
|
export type BillingPeriod = "monthly" | "yearly";
|
|
7
7
|
|
|
8
|
+
export type PricingTierCtaVariant = "primary" | "secondary";
|
|
9
|
+
|
|
8
10
|
export interface PricingTier {
|
|
9
11
|
id: string;
|
|
10
12
|
name: string;
|
|
@@ -17,6 +19,12 @@ export interface PricingTier {
|
|
|
17
19
|
/** Replaces the billing switch, e.g. "Free for everyone". */
|
|
18
20
|
note?: string;
|
|
19
21
|
ctaLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Button variant for this tier's call to action. Defaults to "primary";
|
|
24
|
+
* set "secondary" on the non-highlighted tiers so the table keeps exactly
|
|
25
|
+
* one primary action.
|
|
26
|
+
*/
|
|
27
|
+
ctaVariant?: PricingTierCtaVariant;
|
|
20
28
|
/** The plan the workspace is on: its button is disabled and reads "Current plan". */
|
|
21
29
|
current?: boolean;
|
|
22
30
|
/** Draws the brand frame around the tier. */
|
|
@@ -148,7 +156,7 @@ export const PricingTableDesktop = React.forwardRef<HTMLElement, PricingTableDes
|
|
|
148
156
|
</Button>
|
|
149
157
|
) : (
|
|
150
158
|
<Button
|
|
151
|
-
variant="primary"
|
|
159
|
+
variant={tier.ctaVariant ?? "primary"}
|
|
152
160
|
fullWidth
|
|
153
161
|
onClick={() => onSelectTier?.(tier.id, period)}
|
|
154
162
|
>
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export { PricingTableDesktop, useBilling, priceOf, BILLING_OPTIONS } from "./PricingTableDesktop";
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
PricingTableDesktopProps,
|
|
4
|
+
PricingTier,
|
|
5
|
+
PricingTierCtaVariant,
|
|
6
|
+
BillingPeriod,
|
|
7
|
+
} from "./PricingTableDesktop";
|