@dmitriikapustin/ui 0.1.0 → 0.2.1

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.d.cts CHANGED
@@ -46,7 +46,7 @@ interface ToggleProps {
46
46
  disabled?: boolean;
47
47
  className?: string;
48
48
  }
49
- declare function Toggle({ checked, onChange, label, disabled, className }: ToggleProps): react_jsx_runtime.JSX.Element;
49
+ declare function Toggle({ checked, onChange, label, disabled, className, }: ToggleProps): react_jsx_runtime.JSX.Element;
50
50
 
51
51
  type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
52
52
  interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'size'> {
@@ -76,8 +76,10 @@ interface MenuItemProps {
76
76
  active?: boolean;
77
77
  onClick?: () => void;
78
78
  className?: string;
79
+ /** Optional icon rendered before the text label */
80
+ icon?: React.ReactNode;
79
81
  }
80
- declare function MenuItem({ text, active, onClick, className }: MenuItemProps): react_jsx_runtime.JSX.Element;
82
+ declare function MenuItem({ text, active, onClick, className, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
81
83
 
82
84
  type IconButtonVariant = 'primary' | 'secondary' | 'clear' | 'disabled' | 'contrast';
83
85
  interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
@@ -464,13 +466,33 @@ interface FeatureGridProps {
464
466
  declare function FeatureGrid({ features, columns, className }: FeatureGridProps): react_jsx_runtime.JSX.Element;
465
467
 
466
468
  type SidebarType = 'menu' | 'courseSubmenu';
469
+ /** Rich menu item with string ID, label, and optional icon. */
470
+ interface SidebarItem {
471
+ id: string;
472
+ label: string;
473
+ icon?: ReactNode;
474
+ }
467
475
  interface SidebarProps {
468
476
  type?: SidebarType;
469
- menuItems?: string[];
470
- footer?: React.ReactNode;
477
+ /** Plain strings (backward-compat) or rich SidebarItem objects. */
478
+ menuItems?: string[] | SidebarItem[];
479
+ footer?: ReactNode;
471
480
  className?: string;
472
- }
473
- declare function Sidebar({ type, menuItems, footer, className }: SidebarProps): react_jsx_runtime.JSX.Element;
481
+ /** Externally-controlled active item id. When provided, bypasses internal useState. */
482
+ activeId?: string;
483
+ /** Callback when a menu item is clicked. Receives the item id (or index-string for plain strings). */
484
+ onItemClick?: (id: string) => void;
485
+ /** Custom logo rendered above the nav area. */
486
+ logo?: ReactNode;
487
+ /**
488
+ * Legal text at the bottom.
489
+ * - `undefined` → shows default Russian legal text
490
+ * - `null` → hides legal text entirely
491
+ * - `string` → shows the provided text
492
+ */
493
+ legalText?: string | null;
494
+ }
495
+ declare function Sidebar({ type, menuItems, footer, className, activeId, onItemClick, logo, legalText, }: SidebarProps): react_jsx_runtime.JSX.Element;
474
496
 
475
497
  type AppCardVariant = 'default' | 'stamp' | 'stamp-padded';
476
498
  interface AppCardProps {
@@ -938,4 +960,4 @@ interface LandingLayoutProps {
938
960
  }
939
961
  declare function LandingLayout({ mode, nav, children, className, }: LandingLayoutProps): react_jsx_runtime.JSX.Element;
940
962
 
941
- export { Alert, AppCard, AppTopLine, ArticleBarChart, type ArticleBarChartProps, ArticleBody, type ArticleBodyProps, ArticleChatBlock, type ArticleChatBlockProps, ArticleFigure, type ArticleFigureProps, ArticleFooter, type ArticleFooterProps, ArticleHeading, type ArticleHeadingProps, ArticleHero, type ArticleHeroProps, ArticleLayout, type ArticleLayoutProps, ArticleLineChart, type ArticleLineChartProps, ArticleLinkButton, type ArticleLinkButtonProps, ArticleList, type ArticleListProps, ArticleNarrow, ArticleNote, type ArticleNoteProps, ArticleScatterChart, type ArticleScatterChartProps, ArticleTable, type ArticleTableColumn, type ArticleTableProps, type ArticleTableRow, ArticleWide, Avatar, Badge, BentoGrid, Breadcrumbs, Button, CTASection, Card, type ChartSeries, ChatInput, ChatMessage, Checkbox, CodeInput, ComparisonTable, Divider, DropdownMenu, EmptyState, FAQSection, FeatureGrid, Footer, FormField, Header, HeroSection, IconButton, IconWithText, IconlyActivity, IconlyAttach, IconlyBook, IconlyCheck, IconlyChevronDown, IconlyChevronLeft, IconlyChevronRight, IconlyClose, IconlyError, IconlyEye, IconlyEyeOff, IconlyHeart, IconlyInfo, IconlyInfoCircle, IconlyLink, IconlyLock, IconlyMail, IconlyMenu, IconlyMoon, IconlyQuote, IconlyRoadmap, IconlySandbox, IconlySearch, IconlySend, IconlySmile, IconlyStar, IconlySuccess, IconlySun, IconlyWarning, Input, LandingLayout, Logo, LogoCloud, MenuItem, Modal, Pagination, PasswordInput, PricingCard, ProfileNav, PromoActionCards, PromoBento, PromoDevicesCTA, PromoHero, PromoPricing, PromoShowcase, PromoSplit, PromoTestimonials, PromoTrustGrid, Radio, type ScatterPoint, SearchBar, Select, Sidebar, Skeleton, Spinner, StampCard, Stat, StatBadge, StatsBar, Link as StyledLink, Tabs, Tag, TestimonialCard, Textarea, TicketButton, Toast, Toggle, Tooltip, TopPromo };
963
+ export { Alert, AppCard, AppTopLine, ArticleBarChart, type ArticleBarChartProps, ArticleBody, type ArticleBodyProps, ArticleChatBlock, type ArticleChatBlockProps, ArticleFigure, type ArticleFigureProps, ArticleFooter, type ArticleFooterProps, ArticleHeading, type ArticleHeadingProps, ArticleHero, type ArticleHeroProps, ArticleLayout, type ArticleLayoutProps, ArticleLineChart, type ArticleLineChartProps, ArticleLinkButton, type ArticleLinkButtonProps, ArticleList, type ArticleListProps, ArticleNarrow, ArticleNote, type ArticleNoteProps, ArticleScatterChart, type ArticleScatterChartProps, ArticleTable, type ArticleTableColumn, type ArticleTableProps, type ArticleTableRow, ArticleWide, Avatar, Badge, BentoGrid, Breadcrumbs, Button, CTASection, Card, type ChartSeries, ChatInput, ChatMessage, Checkbox, CodeInput, ComparisonTable, Divider, DropdownMenu, EmptyState, FAQSection, FeatureGrid, Footer, FormField, Header, HeroSection, IconButton, IconWithText, IconlyActivity, IconlyAttach, IconlyBook, IconlyCheck, IconlyChevronDown, IconlyChevronLeft, IconlyChevronRight, IconlyClose, IconlyError, IconlyEye, IconlyEyeOff, IconlyHeart, IconlyInfo, IconlyInfoCircle, IconlyLink, IconlyLock, IconlyMail, IconlyMenu, IconlyMoon, IconlyQuote, IconlyRoadmap, IconlySandbox, IconlySearch, IconlySend, IconlySmile, IconlyStar, IconlySuccess, IconlySun, IconlyWarning, Input, LandingLayout, Logo, LogoCloud, MenuItem, Modal, Pagination, PasswordInput, PricingCard, ProfileNav, PromoActionCards, PromoBento, PromoDevicesCTA, PromoHero, PromoPricing, PromoShowcase, PromoSplit, PromoTestimonials, PromoTrustGrid, Radio, type ScatterPoint, SearchBar, Select, Sidebar, type SidebarItem, Skeleton, Spinner, StampCard, Stat, StatBadge, StatsBar, Link as StyledLink, Tabs, Tag, TestimonialCard, Textarea, TicketButton, Toast, Toggle, Tooltip, TopPromo };
package/dist/index.d.ts CHANGED
@@ -46,7 +46,7 @@ interface ToggleProps {
46
46
  disabled?: boolean;
47
47
  className?: string;
48
48
  }
49
- declare function Toggle({ checked, onChange, label, disabled, className }: ToggleProps): react_jsx_runtime.JSX.Element;
49
+ declare function Toggle({ checked, onChange, label, disabled, className, }: ToggleProps): react_jsx_runtime.JSX.Element;
50
50
 
51
51
  type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
52
52
  interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'size'> {
@@ -76,8 +76,10 @@ interface MenuItemProps {
76
76
  active?: boolean;
77
77
  onClick?: () => void;
78
78
  className?: string;
79
+ /** Optional icon rendered before the text label */
80
+ icon?: React.ReactNode;
79
81
  }
80
- declare function MenuItem({ text, active, onClick, className }: MenuItemProps): react_jsx_runtime.JSX.Element;
82
+ declare function MenuItem({ text, active, onClick, className, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
81
83
 
82
84
  type IconButtonVariant = 'primary' | 'secondary' | 'clear' | 'disabled' | 'contrast';
83
85
  interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
@@ -464,13 +466,33 @@ interface FeatureGridProps {
464
466
  declare function FeatureGrid({ features, columns, className }: FeatureGridProps): react_jsx_runtime.JSX.Element;
465
467
 
466
468
  type SidebarType = 'menu' | 'courseSubmenu';
469
+ /** Rich menu item with string ID, label, and optional icon. */
470
+ interface SidebarItem {
471
+ id: string;
472
+ label: string;
473
+ icon?: ReactNode;
474
+ }
467
475
  interface SidebarProps {
468
476
  type?: SidebarType;
469
- menuItems?: string[];
470
- footer?: React.ReactNode;
477
+ /** Plain strings (backward-compat) or rich SidebarItem objects. */
478
+ menuItems?: string[] | SidebarItem[];
479
+ footer?: ReactNode;
471
480
  className?: string;
472
- }
473
- declare function Sidebar({ type, menuItems, footer, className }: SidebarProps): react_jsx_runtime.JSX.Element;
481
+ /** Externally-controlled active item id. When provided, bypasses internal useState. */
482
+ activeId?: string;
483
+ /** Callback when a menu item is clicked. Receives the item id (or index-string for plain strings). */
484
+ onItemClick?: (id: string) => void;
485
+ /** Custom logo rendered above the nav area. */
486
+ logo?: ReactNode;
487
+ /**
488
+ * Legal text at the bottom.
489
+ * - `undefined` → shows default Russian legal text
490
+ * - `null` → hides legal text entirely
491
+ * - `string` → shows the provided text
492
+ */
493
+ legalText?: string | null;
494
+ }
495
+ declare function Sidebar({ type, menuItems, footer, className, activeId, onItemClick, logo, legalText, }: SidebarProps): react_jsx_runtime.JSX.Element;
474
496
 
475
497
  type AppCardVariant = 'default' | 'stamp' | 'stamp-padded';
476
498
  interface AppCardProps {
@@ -938,4 +960,4 @@ interface LandingLayoutProps {
938
960
  }
939
961
  declare function LandingLayout({ mode, nav, children, className, }: LandingLayoutProps): react_jsx_runtime.JSX.Element;
940
962
 
941
- export { Alert, AppCard, AppTopLine, ArticleBarChart, type ArticleBarChartProps, ArticleBody, type ArticleBodyProps, ArticleChatBlock, type ArticleChatBlockProps, ArticleFigure, type ArticleFigureProps, ArticleFooter, type ArticleFooterProps, ArticleHeading, type ArticleHeadingProps, ArticleHero, type ArticleHeroProps, ArticleLayout, type ArticleLayoutProps, ArticleLineChart, type ArticleLineChartProps, ArticleLinkButton, type ArticleLinkButtonProps, ArticleList, type ArticleListProps, ArticleNarrow, ArticleNote, type ArticleNoteProps, ArticleScatterChart, type ArticleScatterChartProps, ArticleTable, type ArticleTableColumn, type ArticleTableProps, type ArticleTableRow, ArticleWide, Avatar, Badge, BentoGrid, Breadcrumbs, Button, CTASection, Card, type ChartSeries, ChatInput, ChatMessage, Checkbox, CodeInput, ComparisonTable, Divider, DropdownMenu, EmptyState, FAQSection, FeatureGrid, Footer, FormField, Header, HeroSection, IconButton, IconWithText, IconlyActivity, IconlyAttach, IconlyBook, IconlyCheck, IconlyChevronDown, IconlyChevronLeft, IconlyChevronRight, IconlyClose, IconlyError, IconlyEye, IconlyEyeOff, IconlyHeart, IconlyInfo, IconlyInfoCircle, IconlyLink, IconlyLock, IconlyMail, IconlyMenu, IconlyMoon, IconlyQuote, IconlyRoadmap, IconlySandbox, IconlySearch, IconlySend, IconlySmile, IconlyStar, IconlySuccess, IconlySun, IconlyWarning, Input, LandingLayout, Logo, LogoCloud, MenuItem, Modal, Pagination, PasswordInput, PricingCard, ProfileNav, PromoActionCards, PromoBento, PromoDevicesCTA, PromoHero, PromoPricing, PromoShowcase, PromoSplit, PromoTestimonials, PromoTrustGrid, Radio, type ScatterPoint, SearchBar, Select, Sidebar, Skeleton, Spinner, StampCard, Stat, StatBadge, StatsBar, Link as StyledLink, Tabs, Tag, TestimonialCard, Textarea, TicketButton, Toast, Toggle, Tooltip, TopPromo };
963
+ export { Alert, AppCard, AppTopLine, ArticleBarChart, type ArticleBarChartProps, ArticleBody, type ArticleBodyProps, ArticleChatBlock, type ArticleChatBlockProps, ArticleFigure, type ArticleFigureProps, ArticleFooter, type ArticleFooterProps, ArticleHeading, type ArticleHeadingProps, ArticleHero, type ArticleHeroProps, ArticleLayout, type ArticleLayoutProps, ArticleLineChart, type ArticleLineChartProps, ArticleLinkButton, type ArticleLinkButtonProps, ArticleList, type ArticleListProps, ArticleNarrow, ArticleNote, type ArticleNoteProps, ArticleScatterChart, type ArticleScatterChartProps, ArticleTable, type ArticleTableColumn, type ArticleTableProps, type ArticleTableRow, ArticleWide, Avatar, Badge, BentoGrid, Breadcrumbs, Button, CTASection, Card, type ChartSeries, ChatInput, ChatMessage, Checkbox, CodeInput, ComparisonTable, Divider, DropdownMenu, EmptyState, FAQSection, FeatureGrid, Footer, FormField, Header, HeroSection, IconButton, IconWithText, IconlyActivity, IconlyAttach, IconlyBook, IconlyCheck, IconlyChevronDown, IconlyChevronLeft, IconlyChevronRight, IconlyClose, IconlyError, IconlyEye, IconlyEyeOff, IconlyHeart, IconlyInfo, IconlyInfoCircle, IconlyLink, IconlyLock, IconlyMail, IconlyMenu, IconlyMoon, IconlyQuote, IconlyRoadmap, IconlySandbox, IconlySearch, IconlySend, IconlySmile, IconlyStar, IconlySuccess, IconlySun, IconlyWarning, Input, LandingLayout, Logo, LogoCloud, MenuItem, Modal, Pagination, PasswordInput, PricingCard, ProfileNav, PromoActionCards, PromoBento, PromoDevicesCTA, PromoHero, PromoPricing, PromoShowcase, PromoSplit, PromoTestimonials, PromoTrustGrid, Radio, type ScatterPoint, SearchBar, Select, Sidebar, type SidebarItem, Skeleton, Spinner, StampCard, Stat, StatBadge, StatsBar, Link as StyledLink, Tabs, Tag, TestimonialCard, Textarea, TicketButton, Toast, Toggle, Tooltip, TopPromo };