@sikka/hawa
Version:
Modern UI Kit made with Tailwind
700 lines (687 loc) • 30.7 kB
JavaScript
"use client";
import {
Chip,
ScrollArea
} from "../../chunk-FIBEENJA.mjs";
import "../../chunk-47APBDKK.mjs";
import {
Radio
} from "../../chunk-UP7VUUVQ.mjs";
import {
CheckMark,
UncheckMark
} from "../../chunk-DDWOF6SP.mjs";
import {
Button,
Card,
Skeleton,
Tooltip,
cn
} from "../../chunk-5MN7WB7B.mjs";
// blocks/pricing/PricingPlans.tsx
import React8 from "react";
// blocks/cards/ActionCard.tsx
import React, { useState } from "react";
// blocks/cards/AdCard.tsx
import React2, { useState as useState2, useEffect, useRef } from "react";
// blocks/cards/PricingCard.tsx
import React4 from "react";
// elements/separator/Separator.tsx
import * as React3 from "react";
var Separator = ({
className,
orientation = "horizontal",
...props
}) => /* @__PURE__ */ React3.createElement(
"div",
{
className: cn(
"hawa-shrink-0 hawa-bg-border",
orientation === "horizontal" ? "hawa-h-[1px] hawa-w-full" : "hawa-h-full hawa-w-[1px]",
className
),
...props
}
);
// blocks/cards/PricingCard.tsx
var PricingCard = ({
size = "medium",
direction = "ltr",
endButton = true,
recommended,
currentPlan = false,
...props
}) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
let cardSizes = {
small: "hawa-w-full hawa-max-w-sm hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background",
medium: "hawa-w-full hawa-rounded hawa-min-w-fit hawa-border dark:hawa-border-gray-700 hawa-bg-background",
large: "hawa-w-full hawa-max-w-lg hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background"
};
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, props.isLoadingCard ? /* @__PURE__ */ React4.createElement(
Skeleton,
{
className: cn(cardSizes[size], "hawa-h-[200px]"),
fade: "bottom"
}
) : /* @__PURE__ */ React4.createElement(
Card,
{
dir: direction,
className: cn(
currentPlan ? "hawa-border-2 hawa-border-primary dark:hawa-border-primary/70" : "hawa-border",
cardSizes[size],
"hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-gap-4 hawa-p-4",
recommended ? "hawa-rounded hawa-rounded-t-none" : "hawa-rounded"
)
},
recommended && /* @__PURE__ */ React4.createElement(
"div",
{
className: "hawa-absolute -hawa-left-[1px] hawa-top-0 -hawa-translate-y-full hawa-rounded-t hawa-border hawa-bg-primary hawa-p-2 hawa-text-center hawa-text-primary-foreground",
style: { width: "calc(100% + 2px)" }
},
((_a = props.texts) == null ? void 0 : _a.recommended) || "RECOMMENDED"
),
/* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-md hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-font-bold hawa-text-primary/70" }, /* @__PURE__ */ React4.createElement("span", null, (_b = props.texts) == null ? void 0 : _b.title), /* @__PURE__ */ React4.createElement("h5", { className: "hawa-text-sm hawa-font-normal hawa-text-primary/70" }, (_c = props.texts) == null ? void 0 : _c.subtitle), props.discount && /* @__PURE__ */ React4.createElement("span", { className: "hawa-absolute hawa-end-0" }, /* @__PURE__ */ React4.createElement(Chip, { label: props.discount, size: "large", color: "hyper" }))), /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-items-baseline hawa-text-primary" }, props.isLoadingPrice ? /* @__PURE__ */ React4.createElement(Skeleton, { className: "hawa-h-[48px] hawa-w-full hawa-max-w-[200px] hawa-p-0" }) : /* @__PURE__ */ React4.createElement(React4.Fragment, null, props.noPrice ? /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, ((_d = props.texts) == null ? void 0 : _d.priceless) || "Contact Us") : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-end hawa-gap-2" }, props.oldPrice && props.oldPrice > 0 && /* @__PURE__ */ React4.createElement("span", { className: "hawa-line-through hawa-opacity-70" }, props.oldPrice + " " + ((_e = props.texts) == null ? void 0 : _e.currencyText)), /* @__PURE__ */ React4.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, props.price)), /* @__PURE__ */ React4.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, (_f = props.texts) == null ? void 0 : _f.currencyText)), /* @__PURE__ */ React4.createElement("span", { className: "hawa-ml-1 hawa-whitespace-nowrap hawa-text-xl hawa-font-normal hawa-text-primary/70" }, "/ ", (_g = props.texts) == null ? void 0 : _g.cycleText)))), endButton && /* @__PURE__ */ React4.createElement(Separator, null), /* @__PURE__ */ React4.createElement(
"div",
{
className: cn(
"hawa-flex hawa-h-full hawa-justify-between hawa-gap-4",
endButton ? "hawa-flex-col" : "hawa-flex-col-reverse"
)
},
props.features && /* @__PURE__ */ React4.createElement("ul", { role: "list", className: "hawa-space-y-0 hawa-overflow-x-auto" }, (_h = props.features) == null ? void 0 : _h.map((feature, o) => {
var _a2;
return /* @__PURE__ */ React4.createElement(
"li",
{
key: o,
className: cn(
"hawa-flex hawa-flex-row hawa-justify-between hawa-gap-2",
!feature.included && "hawa-line-through"
)
},
/* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center" }, feature.included ? /* @__PURE__ */ React4.createElement(
"svg",
{
"aria-label": "Check Icon",
"aria-hidden": "true",
className: "hawa-m-2 hawa-h-5 hawa-w-5 hawa-flex-shrink-0 hawa-text-primary",
fill: "currentColor",
viewBox: "0 0 20 20"
},
/* @__PURE__ */ React4.createElement(
"path",
{
fillRule: "evenodd",
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
clipRule: "evenodd"
}
)
) : /* @__PURE__ */ React4.createElement("div", { className: "hawa-m-2 hawa-mx-2.5 hawa-h-4 hawa-w-4 hawa-rounded-full hawa-bg-primary/10" }), /* @__PURE__ */ React4.createElement("span", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-text-start hawa-font-normal hawa-leading-tight hawa-text-primary/70" }, feature.text, " ", feature.soon && feature.included && /* @__PURE__ */ React4.createElement(
Chip,
{
label: ((_a2 = props.texts) == null ? void 0 : _a2.soon) || "",
color: "oceanic",
size: "small"
}
))),
feature.hint && /* @__PURE__ */ React4.createElement(
Tooltip,
{
content: feature.hint,
side: feature.hintSide
},
/* @__PURE__ */ React4.createElement(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
},
/* @__PURE__ */ React4.createElement("circle", { cx: "12", cy: "12", r: "10" }),
/* @__PURE__ */ React4.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
/* @__PURE__ */ React4.createElement("path", { d: "M12 17h.01" })
)
)
);
})),
/* @__PURE__ */ React4.createElement(
Button,
{
onClick: props.onPlanClicked,
disabled: currentPlan,
className: "hawa-w-full"
},
(_i = props.texts) == null ? void 0 : _i.buttonText
)
))
));
};
// blocks/cards/ItemCard.tsx
import React6, { useEffect as useEffect2, useState as useState4 } from "react";
// elements/dropdownMenu/DropdownMenu.tsx
import * as React5 from "react";
import { Portal } from "@headlessui/react";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.SubTrigger,
{
ref,
className: cn(
"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent",
inset && "hawa-pl-8",
className
),
...props
},
/* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
" ",
/* @__PURE__ */ React5.createElement(
"svg",
{
"aria-label": "Chevron Right Icon",
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0",
viewBox: "0 0 16 16",
height: "1em",
width: "1em",
className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
},
/* @__PURE__ */ React5.createElement(
"path",
{
fillRule: "evenodd",
d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
}
)
)
));
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.SubContent,
{
ref,
className: cn(
"hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
className
),
...props
}
));
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React5.createElement(Portal, null, /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.Content,
{
ref,
sideOffset,
className: cn(
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
className
),
...props
}
)));
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
var DropdownMenuItem = React5.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
return /* @__PURE__ */ React5.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.Item,
{
disabled: props.disabled,
ref,
className: cn(
"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
inset && "hawa-pl-8",
props.end && Array.isArray(props.children) && props.children[1] && "hawa-gap-6",
className
),
...props
},
/* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, props.children),
props.end && props.end,
!props.end && props.shortcut && /* @__PURE__ */ React5.createElement(DropdownMenuShortcut, null, props.shortcut),
!props.end && badged && /* @__PURE__ */ React5.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
));
});
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.CheckboxItem,
{
ref,
className: cn(
"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
className
),
checked,
...props
},
/* @__PURE__ */ React5.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React5.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React5.createElement(
"svg",
{
"aria-label": "Check Mark",
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0",
viewBox: "0 0 512 512",
height: "0.60em",
width: "0.60em"
},
/* @__PURE__ */ React5.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
), " ")),
children
));
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.RadioItem,
{
ref,
className: cn(
"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
className
),
...props
},
/* @__PURE__ */ React5.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React5.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React5.createElement(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
width: "24",
"aria-label": "Circle",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round",
className: "hawa-h-2 hawa-w-2 hawa-fill-current"
},
/* @__PURE__ */ React5.createElement("circle", { cx: "12", cy: "12", r: "10" })
))),
children
));
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.Label,
{
ref,
className: cn(
"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
inset && "hawa-pl-8",
className
),
...props
}
));
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
var DropdownMenuSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
DropdownMenuPrimitive.Separator,
{
ref,
className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
...props
}
));
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
var DropdownMenuShortcut = ({
className,
...props
}) => {
return /* @__PURE__ */ React5.createElement(
"span",
{
className: cn(
"hawa-text-xs hawa-tracking-widest hawa-opacity-60",
className
),
...props
}
);
};
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
// blocks/cards/LandingCard.tsx
import React7 from "react";
// blocks/pricing/PricingPlans.tsx
var PricingPlans = ({
mainContainerProps,
cardsContainerProps,
...props
}) => {
return /* @__PURE__ */ React8.createElement("div", { ...mainContainerProps }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-justify-between" }, /* @__PURE__ */ React8.createElement(
Radio,
{
name: "cycle",
design: "tabs",
defaultValue: props.currentCycle.value,
options: props.billingCycles,
onChange: (e) => {
if (props.onCycleChange) {
props.onCycleChange(e);
}
}
}
), /* @__PURE__ */ React8.createElement(
Radio,
{
name: "currency",
design: "tabs",
defaultValue: props.currentCurrency.value,
options: props.currencies,
onChange: (e) => {
if (props.onCurrencyChange) {
props.onCurrencyChange(e);
}
}
}
)), /* @__PURE__ */ React8.createElement(
"div",
{
className: "hawa-inline-grid hawa-w-full hawa-grid-cols-[repeat(auto-fit,_minmax(300px,_1fr))] hawa-gap-4",
...cardsContainerProps
},
props.plans.map((plan, index) => {
var _a, _b;
return /* @__PURE__ */ React8.createElement(
PricingCard,
{
key: index,
onPlanClicked: () => {
var _a2, _b2;
if (props.onPlanClicked) {
let clickedData = {
// plan: plan.id,
currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
cycle: (_b2 = props.currentCycle) == null ? void 0 : _b2.value,
...plan
};
props.onPlanClicked(clickedData);
}
},
...plan,
isLoadingCard: props.loadingCards || plan.isLoadingCard,
price: plan.price,
texts: {
...plan.texts,
currencyText: (_a = props.currentCurrency) == null ? void 0 : _a.label,
cycleText: (_b = props.currentCycle) == null ? void 0 : _b.label
}
}
);
})
));
};
// blocks/pricing/ComparingPlans.tsx
import React9 from "react";
var ComparingPlans = (props) => {
const uniqueFeatures = Array.from(
new Set(
props.plans.flatMap(
(plan) => plan.features.map((feature) => feature.text)
)
)
);
return /* @__PURE__ */ React9.createElement("div", { id: "detailed-pricing", className: "hawa-w-full" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-between hawa-gap-2 sm:hawa-flex-row" }, /* @__PURE__ */ React9.createElement(
Radio,
{
name: "cycle",
tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
width: "none",
design: "tabs",
defaultValue: props.currentCycle.value,
options: props.billingCycles,
onChange: (e) => {
if (props.onCycleChange) {
props.onCycleChange(e);
}
}
}
), /* @__PURE__ */ React9.createElement(
Radio,
{
name: "currency",
tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
width: "none",
design: "tabs",
defaultValue: props.currentCurrency.value,
options: props.currencies,
onChange: (e) => {
if (props.onCurrencyChange) {
props.onCurrencyChange(e);
}
}
}
)), /* @__PURE__ */ React9.createElement(
"div",
{
className: cn(
"hawa-sticky hawa-z-10 hawa-grid hawa-grid-cols-4 hawa-gap-x-2 hawa-rounded-t hawa-border hawa-p-4 hawa-text-sm hawa-font-medium",
"hawa-bg-primary-foreground"
),
style: {
top: props.topPosition || 0
}
},
/* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-items-center" }),
props.plans.map((plan, i) => /* @__PURE__ */ React9.createElement(
"div",
{
key: i,
className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2"
},
/* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React9.createElement("span", { className: "hawa-text-md hawa-font-bold" }, plan.texts.title), /* @__PURE__ */ React9.createElement("span", { className: "hawa-text-md hawa-font-normal hawa-text-muted-foreground" }, plan.texts.subtitle)), /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-items-baseline" }, /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, plan.price), /* @__PURE__ */ React9.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, plan.texts.currencyText)), /* @__PURE__ */ React9.createElement("span", { className: "hawa-ml-1 hawa-text-xl hawa-font-normal" }, "/ ", plan.texts.cycleText)))
))
), /* @__PURE__ */ React9.createElement(
ScrollArea,
{
className: "hawa-h-fit hawa-rounded hawa-rounded-t-none hawa-border hawa-border-t-0 hawa-bg-background",
dir: props.direction
},
uniqueFeatures.map((featureText, featureIndex) => {
var _a, _b, _c, _d;
return /* @__PURE__ */ React9.createElement(
"div",
{
key: featureIndex,
className: cn(
"hawa-border-foreground-muted hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5 hawa-text-sm hawa-text-gray-700 dark:text-white",
featureIndex === 0 ? "" : "hawa-border-t"
)
},
/* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-foreground" }, featureText, props.plans.some(
(plan) => plan.features.some(
(feature) => feature.text === featureText && feature.hint
)
) && /* @__PURE__ */ React9.createElement(
Tooltip,
{
side: "right",
content: (_b = (_a = props.plans.find(
(plan) => {
var _a2;
return (_a2 = plan.features.find(
(feature) => feature.text === featureText
)) == null ? void 0 : _a2.hint;
}
)) == null ? void 0 : _a.features.find(
(feature) => feature.text === featureText
)) == null ? void 0 : _b.hint
},
/* @__PURE__ */ React9.createElement(
"svg",
{
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0",
viewBox: "0 0 16 16",
height: "1em",
width: "1em"
},
/* @__PURE__ */ React9.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z" })
)
), props.plans.some(
(plan) => plan.features.some(
(feature) => feature.text === featureText && feature.soon
)
) && /* @__PURE__ */ React9.createElement(
Chip,
{
label: ((_d = (_c = props.plans.find(
(plan) => plan.features.some(
(feature) => feature.text === featureText && feature.soon
)
)) == null ? void 0 : _c.texts) == null ? void 0 : _d.soon) || "Soon"
}
)),
props.plans.map((plan, planIndex) => {
const feature = plan.features.find(
(f) => f.text === featureText
);
return /* @__PURE__ */ React9.createElement(
"div",
{
key: planIndex,
className: "hawa-flex hawa-flex-col hawa-items-center hawa-text-center"
},
(feature == null ? void 0 : feature.included) ? /* @__PURE__ */ React9.createElement(CheckMark, { className: "hawa-text-foreground" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { className: "hawa-text-foreground" })
);
})
);
})
), props.showButtons && /* @__PURE__ */ React9.createElement("div", { className: "hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-items-center" }), props.plans.map((plan, i) => {
var _a;
return /* @__PURE__ */ React9.createElement(
"div",
{
key: i,
className: "hawa-flex hawa-items-center hawa-justify-center"
},
/* @__PURE__ */ React9.createElement(
Button,
{
className: "hawa-w-full hawa-max-w-xs",
onClick: () => {
var _a2, _b;
if (props.onPlanClicked) {
let clickedData = {
// plan: plan.id,
currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
cycle: (_b = props.currentCycle) == null ? void 0 : _b.value,
...plan
};
props.onPlanClicked(clickedData);
}
}
},
((_a = plan.texts) == null ? void 0 : _a.buttonText) || "Get Started"
)
);
})));
};
// blocks/pricing/HorizontalPricing.tsx
import React10, { useState as useState5 } from "react";
var HorizontalPricing = (props) => {
const [selectedCard, setSelectedCard] = useState5("");
let data = [
{ title: "basic", price: "$49", cycle: "/mo" },
{ title: "business", price: "$99", cycle: "/mo" },
{ title: "enterprise", price: "$149", cycle: "/mo" }
];
return /* @__PURE__ */ React10.createElement("div", { className: "hawa-z-10 hawa-w-full hawa-max-w-screen-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "hawa-max-w-2xl" }, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, /* @__PURE__ */ React10.createElement(
Radio,
{
name: "currency",
design: "tabs",
options: props.currencies,
defaultValue: props.currentCurrency
}
), /* @__PURE__ */ React10.createElement(
Radio,
{
name: "cycle",
design: "tabs",
options: props.billingCycles,
defaultValue: props.currentCycle
}
)), data.map((d, i) => /* @__PURE__ */ React10.createElement(
"label",
{
key: i,
htmlFor: d.title,
className: "",
onClick: () => setSelectedCard(d.title)
},
/* @__PURE__ */ React10.createElement(
"input",
{
type: "radio",
name: "radio",
id: d.title,
className: "hawa-peer hawa-appearance-none"
}
),
/* @__PURE__ */ React10.createElement(
"div",
{
className: cn(
selectedCard === d.title ? "peer-checked:hawa-border-primary peer-checked:hawa-ring-4 peer-checked:hawa-ring-primary/20" : "",
"hawa-peer hawa-flex hawa-cursor-pointer hawa-items-center hawa-justify-between hawa-rounded-xl hawa-border hawa-bg-background hawa-px-5 hawa-py-4 hawa-shadow dark:hawa-text-white peer-checked:[&_.active]:hawa-block peer-checked:[&_.default]:hawa-hidden"
)
},
/* @__PURE__ */ React10.createElement("div", { className: "hawa-peer hawa-flex hawa-items-center hawa-gap-4" }, /* @__PURE__ */ React10.createElement(CheckIcons, null), /* @__PURE__ */ React10.createElement(
CardText,
{
title: "Enterprise",
subtitle: "For startups and new businesses"
}
)),
/* @__PURE__ */ React10.createElement(CardPrice, { amount: d.price, cycle: d.cycle })
)
))));
};
var CheckIcons = () => /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
"svg",
{
fill: "none",
viewBox: "0 0 24 24",
strokeWidth: "1.5",
stroke: "currentColor",
className: "hawa-default hawa-h-8 hawa-w-8 hawa-text-neutral-500"
},
/* @__PURE__ */ React10.createElement(
"path",
{
strokeLinecap: "round",
strokeLinejoin: "round",
d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
}
)
), /* @__PURE__ */ React10.createElement(
"svg",
{
viewBox: "0 0 24 24",
fill: "currentColor",
className: "hawa-active hawa-hidden hawa-h-8 hawa-w-8 hawa-text-blue-500"
},
/* @__PURE__ */ React10.createElement(
"path",
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z"
}
)
));
var CardText = (props) => /* @__PURE__ */ React10.createElement("div", { className: "hawa-peer hawa-flex hawa-flex-col hawa-items-start" }, /* @__PURE__ */ React10.createElement("h2", { className: "hawa-font-medium hawa-text-primary/90 sm:hawa-text-xl" }, props.title), /* @__PURE__ */ React10.createElement("p", { className: "hawa-text-sm hawa-text-primary/60" }, props.subtitle, " "));
var CardPrice = (props) => /* @__PURE__ */ React10.createElement("h2", { className: "hawa-peer hawa-text-xl hawa-font-semibold hawa-text-primary sm:hawa-text-2xl" }, props.amount, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-base hawa-font-medium hawa-text-neutral-400" }, props.cycle));
export {
ComparingPlans,
HorizontalPricing,
PricingPlans
};