@designbasekorea/figma-ui 0.6.3 → 0.6.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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +83 -14
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +336 -127
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +356 -144
- package/dist/index.js.map +1 -1
- package/package.json +13 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { PaymentStatus, UsageResetPeriod, LicenseManagerMessageTypes } from '@designbasekorea/figma-license-core';
|
|
3
|
+
import { GradientScheme, GradientTone } from '@designbasekorea/ui-wc/react';
|
|
4
|
+
export * from '@designbasekorea/ui-wc/react';
|
|
4
5
|
|
|
5
6
|
type I18nText = string | {
|
|
6
7
|
key: string;
|
|
@@ -16,6 +17,7 @@ interface DonationBadgeProps {
|
|
|
16
17
|
size?: 's' | 'm' | 'l';
|
|
17
18
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost';
|
|
18
19
|
fullWidth?: boolean;
|
|
20
|
+
iconOnly?: boolean;
|
|
19
21
|
disabled?: boolean;
|
|
20
22
|
showPrompt?: boolean;
|
|
21
23
|
promptText?: I18nText;
|
|
@@ -43,9 +45,14 @@ interface FigmaContainerProps {
|
|
|
43
45
|
}
|
|
44
46
|
declare const FigmaContainer: React.FC<FigmaContainerProps>;
|
|
45
47
|
|
|
48
|
+
interface FigmaHeaderAction {
|
|
49
|
+
startIcon: string;
|
|
50
|
+
ariaLabel: string;
|
|
51
|
+
onPress?: () => void;
|
|
52
|
+
}
|
|
46
53
|
interface FigmaHeaderProps {
|
|
47
54
|
children?: React.ReactNode;
|
|
48
|
-
actions?:
|
|
55
|
+
actions?: FigmaHeaderAction[];
|
|
49
56
|
searchBar?: React.ReactNode;
|
|
50
57
|
sticky?: boolean;
|
|
51
58
|
className?: string;
|
|
@@ -142,6 +149,7 @@ interface FigmaFooterProps {
|
|
|
142
149
|
paymentStatus?: 'PAID' | 'FREE' | 'TRIAL' | 'BETA';
|
|
143
150
|
usageCount?: number;
|
|
144
151
|
isLoading?: boolean;
|
|
152
|
+
showPaymentStatus?: boolean;
|
|
145
153
|
showUsageInfo?: boolean;
|
|
146
154
|
maxDailyUsage?: number;
|
|
147
155
|
showPaymentBadge?: boolean;
|
|
@@ -165,6 +173,18 @@ interface FigmaFooterProps {
|
|
|
165
173
|
}
|
|
166
174
|
declare const FigmaFooter: React.FC<FigmaFooterProps>;
|
|
167
175
|
|
|
176
|
+
type ToastStatus = 'info' | 'success' | 'warning' | 'error';
|
|
177
|
+
interface ToastItem {
|
|
178
|
+
id: string;
|
|
179
|
+
createdAt: number;
|
|
180
|
+
title?: string;
|
|
181
|
+
description?: string;
|
|
182
|
+
status?: ToastStatus;
|
|
183
|
+
duration?: number;
|
|
184
|
+
showProgress?: boolean;
|
|
185
|
+
showCloseButton?: boolean;
|
|
186
|
+
}
|
|
187
|
+
type ToastPosition = 'top-right' | 'top-center' | 'bottom-center' | 'bottom-right';
|
|
168
188
|
interface ToastContextType {
|
|
169
189
|
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => void;
|
|
170
190
|
removeToast: (id: string) => void;
|
|
@@ -173,7 +193,7 @@ interface ToastContextType {
|
|
|
173
193
|
declare const useToast: () => ToastContextType;
|
|
174
194
|
interface FigmaToastProviderProps {
|
|
175
195
|
children: React.ReactNode;
|
|
176
|
-
position?:
|
|
196
|
+
position?: ToastPosition;
|
|
177
197
|
maxToasts?: number;
|
|
178
198
|
}
|
|
179
199
|
declare const FigmaToastProvider: React.FC<FigmaToastProviderProps>;
|
|
@@ -181,13 +201,13 @@ interface FigmaToastProps {
|
|
|
181
201
|
message: string;
|
|
182
202
|
isVisible: boolean;
|
|
183
203
|
onClose: () => void;
|
|
184
|
-
type?:
|
|
204
|
+
type?: ToastStatus;
|
|
185
205
|
duration?: number;
|
|
186
206
|
className?: string;
|
|
187
207
|
}
|
|
188
208
|
declare const FigmaToast: React.FC<FigmaToastProps>;
|
|
189
209
|
declare const useFigmaToast: () => {
|
|
190
|
-
showToast: (message: string,
|
|
210
|
+
showToast: (message: string, _type?: ToastStatus) => void;
|
|
191
211
|
toastComponent: React.JSX.Element | null;
|
|
192
212
|
};
|
|
193
213
|
|
|
@@ -239,19 +259,68 @@ interface PricingComparisonProps {
|
|
|
239
259
|
}
|
|
240
260
|
declare const PricingComparison: React.FC<PricingComparisonProps>;
|
|
241
261
|
|
|
262
|
+
interface WordPressLinks {
|
|
263
|
+
purchaseUrl?: string;
|
|
264
|
+
accountUrl?: string;
|
|
265
|
+
helpUrl?: string;
|
|
266
|
+
}
|
|
267
|
+
interface LicensePageState {
|
|
268
|
+
paymentStatus: PaymentStatus;
|
|
269
|
+
licenseKey: string;
|
|
270
|
+
planTier: string;
|
|
271
|
+
hasLicenseKey: boolean;
|
|
272
|
+
isLicenseRegistered: boolean;
|
|
273
|
+
activationLimit: number;
|
|
274
|
+
activationUsage: number;
|
|
275
|
+
usageCount: number;
|
|
276
|
+
remainingUsage: number;
|
|
277
|
+
usageUsed: number;
|
|
278
|
+
usageLimit: number | 'unlimited';
|
|
279
|
+
usageReset: UsageResetPeriod;
|
|
280
|
+
canUseFeature: boolean;
|
|
281
|
+
usageReason?: 'USAGE_LIMIT_REACHED' | 'FEATURE_NOT_ALLOWED';
|
|
282
|
+
lastMessage?: string;
|
|
283
|
+
lastErrorCode?: string;
|
|
284
|
+
}
|
|
285
|
+
declare const DEFAULT_LICENSE_MESSAGE_TYPES: LicenseManagerMessageTypes;
|
|
286
|
+
declare const START_DESIGNBASE_AUTH_MESSAGE = "start-designbase-auth";
|
|
287
|
+
|
|
288
|
+
interface UseFigmaLicenseBridgeOptions {
|
|
289
|
+
messageTypes?: Partial<LicenseManagerMessageTypes>;
|
|
290
|
+
initialState?: Partial<LicensePageState>;
|
|
291
|
+
onStateChange?: (state: LicensePageState) => void;
|
|
292
|
+
onPaymentStatusChange?: (status: PaymentStatus) => void;
|
|
293
|
+
onUsageCountChange?: (count: number) => void;
|
|
294
|
+
}
|
|
295
|
+
declare function useFigmaLicenseBridge(options?: UseFigmaLicenseBridgeOptions): {
|
|
296
|
+
state: LicensePageState;
|
|
297
|
+
isVerifying: boolean;
|
|
298
|
+
isDeactivating: boolean;
|
|
299
|
+
isStartingAuth: boolean;
|
|
300
|
+
verifyLicense: (licenseKey: string) => void;
|
|
301
|
+
deactivateLicense: () => void;
|
|
302
|
+
startDesignbaseAuth: () => void;
|
|
303
|
+
setLicenseKeyInput: (licenseKey: string) => void;
|
|
304
|
+
};
|
|
305
|
+
|
|
242
306
|
interface PageLicenseProps {
|
|
243
|
-
status:
|
|
307
|
+
status: PaymentStatus;
|
|
244
308
|
onClose: () => void;
|
|
245
|
-
usageCount?: number;
|
|
246
|
-
onLicenseSubmit: (licenseKey: string) => Promise<void> | void;
|
|
247
309
|
licenseKey?: string;
|
|
248
|
-
|
|
249
|
-
setUsageCount: (count: number) => void;
|
|
250
|
-
setShowLicensePage: (show: boolean) => void;
|
|
310
|
+
wordpressLinks?: WordPressLinks;
|
|
251
311
|
paymentPageUrl?: string;
|
|
312
|
+
enableAccountAuth?: boolean;
|
|
313
|
+
showLicenseKeyInput?: boolean;
|
|
252
314
|
pricingFeatures?: PricingFeature[];
|
|
253
315
|
pricing?: PlanPricing;
|
|
254
316
|
paymentType?: 'subscription' | 'lifetime';
|
|
317
|
+
messageTypes?: Partial<LicenseManagerMessageTypes>;
|
|
318
|
+
onStateChange?: (state: LicensePageState) => void;
|
|
319
|
+
setPaymentStatus?: (status: PaymentStatus) => void;
|
|
320
|
+
setUsageCount?: (count: number) => void;
|
|
321
|
+
setShowLicensePage?: (show: boolean) => void;
|
|
322
|
+
onLicenseSubmit?: (licenseKey: string) => Promise<void> | void;
|
|
323
|
+
usageCount?: number;
|
|
255
324
|
t?: TFunctionLite;
|
|
256
325
|
className?: string;
|
|
257
326
|
}
|
|
@@ -373,5 +442,5 @@ interface UpgradeBannerProps {
|
|
|
373
442
|
}
|
|
374
443
|
declare const UpgradeBanner: React.FC<UpgradeBannerProps>;
|
|
375
444
|
|
|
376
|
-
export { DonationBadge, FigmaContainer, FigmaFooter, FigmaHeader, FigmaPageHead, FigmaSection, FigmaSidebar, FigmaToast, FigmaToastProvider, FormWithSubmit, InteractionFeedback, LanguageSelector, LogoDropdown, PageLicense, PaymentBadge, PaymentStatusSection, PricingComparison, ProgressModal, ResizablePlugin, SettingsModal, TitleDescription, UpgradeBanner, getActiveSection, resolveText, scrollToSection, useFigmaToast, useToast };
|
|
377
|
-
export type { DonationBadgeProps, FeedbackStatus, FigmaContainerProps, FigmaContainerSize, FigmaFooterProps, FigmaHeaderProps, FigmaPageHeadAction, FigmaPageHeadProps, FigmaSectionProps, FigmaSidebarProps, FormWithSubmitProps, I18nText, InteractionFeedbackProps, Language, LanguageSelectorProps, LogoDropdownLink, LogoDropdownProps, PageLicenseProps, PaymentBadgeProps, PaymentStatusSectionProps, PlanPricing, PricingComparisonProps, PricingFeature, ProgressModalProgress, ProgressModalProps, ResizablePluginProps, SettingsCategory, SettingsCategoryGroup, SettingsModalProps, TFunctionLite, TitleDescriptionProps, UpgradeBannerProps };
|
|
445
|
+
export { DEFAULT_LICENSE_MESSAGE_TYPES, DonationBadge, FigmaContainer, FigmaFooter, FigmaHeader, FigmaPageHead, FigmaSection, FigmaSidebar, FigmaToast, FigmaToastProvider, FormWithSubmit, InteractionFeedback, LanguageSelector, LogoDropdown, PageLicense, PaymentBadge, PaymentStatusSection, PricingComparison, ProgressModal, ResizablePlugin, START_DESIGNBASE_AUTH_MESSAGE, SettingsModal, TitleDescription, UpgradeBanner, getActiveSection, resolveText, scrollToSection, useFigmaLicenseBridge, useFigmaToast, useToast };
|
|
446
|
+
export type { DonationBadgeProps, FeedbackStatus, FigmaContainerProps, FigmaContainerSize, FigmaFooterProps, FigmaHeaderAction, FigmaHeaderProps, FigmaPageHeadAction, FigmaPageHeadProps, FigmaSectionProps, FigmaSidebarProps, FormWithSubmitProps, I18nText, InteractionFeedbackProps, Language, LanguageSelectorProps, LicensePageState, LogoDropdownLink, LogoDropdownProps, PageLicenseProps, PaymentBadgeProps, PaymentStatusSectionProps, PlanPricing, PricingComparisonProps, PricingFeature, ProgressModalProgress, ProgressModalProps, ResizablePluginProps, SettingsCategory, SettingsCategoryGroup, SettingsModalProps, TFunctionLite, TitleDescriptionProps, UpgradeBannerProps, WordPressLinks };
|