@designbasekorea/figma-ui 0.1.87 → 0.1.89

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/index.esm.js CHANGED
@@ -622,21 +622,28 @@ const defaultFeatures = [
622
622
  const defaultPricing = {
623
623
  monthly: 2,
624
624
  yearly: 21.6,
625
+ lifetime: 50,
625
626
  };
626
- const PricingComparison = ({ features = defaultFeatures, pricing = defaultPricing, t = (key) => key, className, }) => {
627
+ const PricingComparison = ({ features = defaultFeatures, pricing = defaultPricing, paymentType = 'subscription', t = (key) => key, className, }) => {
627
628
  const [isYearly, setIsYearly] = useState(false);
628
629
  const getPrice = () => {
630
+ if (paymentType === 'lifetime') {
631
+ return `$${pricing.lifetime?.toLocaleString()} - ${t('lifetimeAccess') || '평생 이용'}`;
632
+ }
629
633
  const price = isYearly ? pricing.yearly : pricing.monthly;
630
- return `$${price.toLocaleString()} / ${isYearly ? t('perYear') : t('perMonth')}`;
634
+ return `$${price?.toLocaleString()} / ${isYearly ? t('perYear') : t('perMonth')}`;
631
635
  };
632
636
  const getDiscountPercentage = () => {
633
- const monthlyPrice = pricing.monthly * 12;
634
- const yearlyPrice = pricing.yearly;
637
+ if (paymentType === 'lifetime') {
638
+ return null;
639
+ }
640
+ const monthlyPrice = (pricing.monthly || 0) * 12;
641
+ const yearlyPrice = pricing.yearly || 0;
635
642
  const discount = Math.round(((monthlyPrice - yearlyPrice) / monthlyPrice) * 100);
636
643
  return discount;
637
644
  };
638
645
  return (React.createElement("div", { className: `designbase-figma-pricing-comparison ${className || ''}` },
639
- React.createElement("div", { className: "designbase-figma-pricing-comparison__billing-toggle" },
646
+ paymentType === 'subscription' && (React.createElement("div", { className: "designbase-figma-pricing-comparison__billing-toggle" },
640
647
  React.createElement(SegmentControl, { value: isYearly ? 'yearly' : 'monthly', onChange: (value) => setIsYearly(value === 'yearly'), options: [
641
648
  {
642
649
  value: 'monthly',
@@ -650,7 +657,9 @@ const PricingComparison = ({ features = defaultFeatures, pricing = defaultPricin
650
657
  getDiscountPercentage(),
651
658
  "% \uC808\uC57D"))),
652
659
  },
653
- ], size: "s" })),
660
+ ], size: "s" }))),
661
+ paymentType === 'lifetime' && (React.createElement("div", { className: "designbase-figma-pricing-comparison__lifetime-info" },
662
+ React.createElement("p", { className: "designbase-figma-pricing-comparison__lifetime-text" }, t('oneTimePaymentLifetime') || 'One-time payment for lifetime access!'))),
654
663
  React.createElement("table", { className: "designbase-figma-pricing-comparison__table" },
655
664
  React.createElement("thead", null,
656
665
  React.createElement("tr", null,
@@ -674,7 +683,7 @@ const PricingComparison = ({ features = defaultFeatures, pricing = defaultPricin
674
683
  };
675
684
  PricingComparison.displayName = 'PricingComparison';
676
685
 
677
- const PageLicense = ({ status: initialStatus, onClose, usageCount: initialUsageCount = 0, onLicenseSubmit, licenseKey: initialLicenseKey = '', setPaymentStatus, setUsageCount, setShowLicensePage, paymentPageUrl, t, className, }) => {
686
+ const PageLicense = ({ status: initialStatus, onClose, usageCount: initialUsageCount = 0, onLicenseSubmit, licenseKey: initialLicenseKey = '', setPaymentStatus, setUsageCount, setShowLicensePage, paymentPageUrl, pricingFeatures, pricing, paymentType = 'subscription', t, className, }) => {
678
687
  const [isSubmitting, setIsSubmitting] = useState(false);
679
688
  const [isDeactivating, setIsDeactivating] = useState(false);
680
689
  const [licenseKey, setLicenseKey] = useState(initialLicenseKey);
@@ -759,7 +768,7 @@ const PageLicense = ({ status: initialStatus, onClose, usageCount: initialUsageC
759
768
  React.createElement("p", { className: "designbase-figma-page-license__description" }, isPaid
760
769
  ? resolveText(t, { key: 'license.all_features_available' }, '모든 기능을 사용할 수 있습니다.')
761
770
  : resolveText(t, { key: 'license.purchase_for_unlimited' }, '라이선스 구매 후 무제한 접근이 가능합니다.'))),
762
- React.createElement(PricingComparison, { t: t }),
771
+ React.createElement(PricingComparison, { features: pricingFeatures, pricing: pricing, paymentType: paymentType, t: t }),
763
772
  isPaid && (React.createElement("div", { className: "designbase-figma-page-license__section" },
764
773
  React.createElement("div", { className: "designbase-figma-page-license__section-header" },
765
774
  React.createElement("h3", null, resolveText(t, { key: 'license.activated' }, '라이선스 활성화됨')),