Assist_Design/apps/portal/public/storybook/assets/PricingDisplay-CBWoWrYN.js

2 lines
7.1 KiB
JavaScript
Raw Normal View History

import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{F as j}from"./InformationCircleIcon-Clz7d-56.js";import{F as w}from"./CurrencyYenIcon-Bf5bmWZc.js";import{F as T}from"./index-9c86oO0t.js";const{formatCurrency:d}=T,b={left:"text-left",center:"text-center",right:"text-right"},x={sm:{price:"text-lg",currency:"h-4 w-4",label:"text-xs"},md:{price:"text-2xl",currency:"h-5 w-5",label:"text-sm"},lg:{price:"text-3xl",currency:"h-6 w-6",label:"text-base"}};function q({currency:s,showCurrencySymbol:r}){return r?s==="JPY"?e.jsx(w,{className:"h-5 w-5"}):e.jsx("span",{children:"$"}):null}function N({price:s,originalPrice:r,sizeKey:a,colorClass:n,periodLabel:t,getCurrencyIcon:l}){const i=x[a],m=r&&r>s;return e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[l(),e.jsx("span",{className:`font-bold ${n} ${i.price}`,children:d(s)}),e.jsx("span",{className:`text-muted-foreground ${i.label}`,children:t})]}),m&&e.jsxs("div",{className:"flex items-baseline gap-1 mt-1",children:[e.jsxs("span",{className:"text-muted-foreground/60 line-through text-sm",children:["¥",d(r)]}),e.jsxs("span",{className:"text-green-600 text-sm font-medium",children:["Save ¥",d(r-s),t==="/month"?"/month":""]})]})]})}function S({tier:s,size:r,getCurrencyIcon:a}){const n=x[r];return e.jsxs("div",{className:`border rounded-lg p-6 ${s.isRecommended?"border-blue-500 ring-2 ring-blue-100 bg-blue-50":"border-border bg-card"}`,children:[s.isRecommended&&e.jsx("div",{className:"text-center mb-4",children:e.jsx("span",{className:"bg-blue-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"Recommended"})}),e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:s.name}),e.jsxs("div",{className:"flex items-baseline justify-center gap-1",children:[a(),e.jsx("span",{className:`font-bold text-foreground ${n.price}`,children:d(s.price)}),e.jsxs("span",{className:`text-muted-foreground ${n.label}`,children:["/",s.billingCycle.toLowerCase()]})]}),s.description&&e.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:s.description})]}),s.features&&s.features.length>0&&e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.features.map((t,l)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-green-600 mr-2",children:"✓"}),t]},l))})]})}function $({features:s}){return s.length===0?null:e.jsxs("div",{className:"mb-4",children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Included:"}),e.jsx("ul",{className:"space-y-1 text-sm text-foreground",children:s.map((r,a)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"text-green-600 mr-2",children:"✓"}),r]},a))})]})}function P({monthlyPrice:s,oneTimePrice:r,originalMonthlyPrice:a,originalOneTimePrice:n,features:t,size:l,getCurrencyIcon:i,children:m}){return e.jsxs("div",{className:"bg-card border border-border rounded-lg p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Pricing"}),s&&e.jsx(N,{price:s,originalPrice:a,sizeKey:l,colorClass:"text-foreground",periodLabel:"/month",getCurrencyIcon:i}),r&&e.jsx(N,{price:r,originalPrice:n,sizeKey:l,colorClass:"text-orange-600",periodLabel:"one-time",getCurrencyIcon:i}),e.jsx($,{features:t}),m]})}function C({monthlyPrice:s,oneTimePrice:r,size:a,getCurrencyIcon:n,children:t}){const l=x[a];return e.jsxs("div",{children:[s&&e.jsxs("div",{className:"flex items-baseline gap-1 mb-2",children:[n(),e.jsx("span",{className:`font-bold text-foreground ${l.price}`,children:d(s)}),e.jsx("span",{className:`text-muted-foreground ${l.label}`,children:"/month"})]}),r&&e.jsxs("div",{className:"flex items-baseline gap-1",children:[n(),e.jsx("span",{className:`font-bold text-orange-600 ${l.price}`,children:d(r)}),e.jsx("span",{className:`text-orange-500 ${l.label}`,children:"one-time"})]}),t]})}function D({monthlyPrice:s,oneTimePrice:r,originalMonthlyPrice:a,originalOneTimePrice:n,tiers:t,currency:l="JPY",showCurrencySymbol:i=!0,fe