@designbasekorea/figma-ui 0.1.44 → 0.1.47

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
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useEffect, useState } from 'react';
2
- import { HeartFilledIcon, CoffeeFilledIcon, StarIcon, KeyIcon, MoreHorizontalIcon, ExternalLinkIcon, CloseIcon, CircleCheckFilledIcon, ExpandIcon, GripVerticalIcon } from '@designbasekorea/icons';
3
- import { SplitView, Button, Toggle, Spinner, Badge, Input, SegmentControl, Modal, Progressbar } from '@designbasekorea/ui';
2
+ import { HeartFilledIcon, CoffeeFilledIcon, AppWindowIcon, YoutubeIcon, InstagramIcon, FigmaIcon, MailIcon, ExternalLinkIcon, StarIcon, KeyIcon, MoreHorizontalIcon, CloseIcon, CircleCheckFilledIcon, ExpandIcon, GripVerticalIcon } from '@designbasekorea/icons';
3
+ import { SplitView, Button, Toggle, Spinner, Badge, Input, Logo, SegmentControl, Modal, Progressbar } from '@designbasekorea/ui';
4
4
  export * from '@designbasekorea/ui';
5
5
 
6
6
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
@@ -326,14 +326,14 @@ const LanguageSelector = ({ currentLanguage = 'ko', languages = DEFAULT_LANGUAGE
326
326
  };
327
327
  LanguageSelector.displayName = 'LanguageSelector';
328
328
 
329
- const defaultTranslations = {
329
+ const defaultTranslations$1 = {
330
330
  unlimitedUsage: '무제한 사용',
331
331
  perDay: '일',
332
332
  resetsDaily: '매일 리셋',
333
333
  donationPrompt: '이 플러그인이 유용했나요?',
334
334
  };
335
- const defaultT = (key) => defaultTranslations[key] || key;
336
- const FigmaFooter = ({ onLicensePageClick, paymentStatus = 'FREE', usageCount = 0, isLoading = false, showPaymentStatus = true, maxDailyUsage = 20, showDonation = true, donationUrl = 'https://buymeacoffee.com/designbase', donationText = 'Buy me a coffee', showDonationText = true, donationPromptText, showLanguageSelector = false, currentLanguage = 'ko', languages, onLanguageChange, className, t = defaultT, children, }) => {
335
+ const defaultT$1 = (key) => defaultTranslations$1[key] || key;
336
+ const FigmaFooter = ({ onLicensePageClick, paymentStatus = 'FREE', usageCount = 0, isLoading = false, showPaymentStatus = true, maxDailyUsage = 20, showDonation = true, donationUrl = 'https://buymeacoffee.com/designbase', donationText = 'Buy me a coffee', showDonationText = true, donationPromptText, showLanguageSelector = false, currentLanguage = 'ko', languages, onLanguageChange, className, t = defaultT$1, children, }) => {
337
337
  const isActive = paymentStatus === 'PAID';
338
338
  const hasChildren = React.Children.count(children) > 0;
339
339
  const classes = clsx('designbase-figma-footer', {
@@ -368,10 +368,9 @@ const FormWithSubmit = ({ onLicenseSubmit, disabled = false, isSubmitting = fals
368
368
  e.preventDefault();
369
369
  await onLicenseSubmit(inputValue);
370
370
  };
371
- const handleChange = (e) => {
372
- const newValue = e.target.value;
373
- setInputValue(newValue);
374
- onValueChange?.(newValue);
371
+ const handleChange = (value) => {
372
+ setInputValue(value);
373
+ onValueChange?.(value);
375
374
  };
376
375
  const displayLabel = resolveText(t, label, 'License Key');
377
376
  const displayPlaceholder = resolveText(t, placeholder, 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
@@ -400,6 +399,70 @@ const InteractionFeedback = ({ status = 'default', message, statusMessage, leftC
400
399
  };
401
400
  InteractionFeedback.displayName = 'InteractionFeedback';
402
401
 
402
+ const defaultLinks = [
403
+ {
404
+ name: 'officialWebsite',
405
+ url: 'https://designbase.co.kr',
406
+ icon: React.createElement(AppWindowIcon, { size: 20 }),
407
+ },
408
+ {
409
+ name: 'youtube',
410
+ url: 'https://youtube.com/designbase',
411
+ icon: React.createElement(YoutubeIcon, { size: 20 }),
412
+ },
413
+ {
414
+ name: 'instagram',
415
+ url: 'https://instagram.com/designbase',
416
+ icon: React.createElement(InstagramIcon, { size: 20 }),
417
+ },
418
+ {
419
+ name: 'figmaCommunity',
420
+ url: 'https://www.figma.com/@designbasekorea',
421
+ icon: React.createElement(FigmaIcon, { size: 20 }),
422
+ },
423
+ {
424
+ name: 'contact',
425
+ url: 'mailto:designbasekorea@gmail.com',
426
+ icon: React.createElement(MailIcon, { size: 20 }),
427
+ },
428
+ ];
429
+ const defaultTranslations = {
430
+ officialWebsite: '공식 웹사이트',
431
+ youtube: '유튜브',
432
+ instagram: '인스타그램',
433
+ figmaCommunity: '피그마 커뮤니티',
434
+ contact: '문의하기',
435
+ };
436
+ const defaultT = (key) => defaultTranslations[key] || key;
437
+ const LogoDropdown = ({ logoSrc, logoAlt = 'DesignBase', logoType = 'designbase', logoSize = 'xs', links = defaultLinks, position = 'top-left', className, t = defaultT, }) => {
438
+ const [isOpen, setIsOpen] = useState(false);
439
+ const toggleDropdown = () => setIsOpen(!isOpen);
440
+ const handleLinkClick = (url) => {
441
+ if (url.startsWith('mailto:')) {
442
+ return;
443
+ }
444
+ window.open(url, '_blank', 'noopener,noreferrer');
445
+ };
446
+ const classes = clsx('designbase-figma-logo-dropdown', `designbase-figma-logo-dropdown--${position}`, {
447
+ 'designbase-figma-logo-dropdown--open': isOpen,
448
+ }, className);
449
+ const renderLogo = () => {
450
+ if (logoSrc) {
451
+ return (React.createElement("img", { className: "designbase-figma-logo-dropdown__logo", src: logoSrc, alt: logoAlt, onClick: toggleDropdown }));
452
+ }
453
+ return (React.createElement("div", { className: "designbase-figma-logo-dropdown__logo", onClick: toggleDropdown },
454
+ React.createElement(Logo, { type: logoType, size: logoSize, variant: "default" })));
455
+ };
456
+ return (React.createElement("div", { className: classes },
457
+ renderLogo(),
458
+ isOpen && (React.createElement("ul", { className: "designbase-figma-logo-dropdown__menu" }, links.map((link, index) => (React.createElement("li", { key: index, className: "designbase-figma-logo-dropdown__item" },
459
+ React.createElement("button", { type: "button", className: "designbase-figma-logo-dropdown__link", onClick: () => handleLinkClick(link.url) },
460
+ link.icon && (React.createElement("span", { className: "designbase-figma-logo-dropdown__icon" }, link.icon)),
461
+ React.createElement("span", { className: "designbase-figma-logo-dropdown__text" }, t(link.name)),
462
+ React.createElement(ExternalLinkIcon, { size: 16, className: "designbase-figma-logo-dropdown__arrow" })))))))));
463
+ };
464
+ LogoDropdown.displayName = 'LogoDropdown';
465
+
403
466
  const defaultFeatures = [
404
467
  { name: '사용 제한', free: '일일 제한', pro: '무제한' },
405
468
  { name: '모든 주제 사용', free: false, pro: true },
@@ -845,5 +908,5 @@ const UpgradeBanner = ({ onClick, isLoading = false, title = { key: 'banner.upgr
845
908
  };
846
909
  UpgradeBanner.displayName = 'UpgradeBanner';
847
910
 
848
- export { DonationBadge, FigmaContainer, FigmaFooter, FigmaHeader, FigmaSection, FigmaSidebar, FormWithSubmit, InteractionFeedback, LanguageSelector, PageLicense, PaymentBadge, PaymentStatusSection, PricingComparison, ProgressModal, ResizablePlugin, SettingsModal, TitleDescription, UpgradeBanner, getActiveSection, resolveText, scrollToSection };
911
+ export { DonationBadge, FigmaContainer, FigmaFooter, FigmaHeader, FigmaSection, FigmaSidebar, FormWithSubmit, InteractionFeedback, LanguageSelector, LogoDropdown, PageLicense, PaymentBadge, PaymentStatusSection, PricingComparison, ProgressModal, ResizablePlugin, SettingsModal, TitleDescription, UpgradeBanner, getActiveSection, resolveText, scrollToSection };
849
912
  //# sourceMappingURL=index.esm.js.map