@cere/cere-design-system 0.0.13 → 0.0.15

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 CHANGED
@@ -335,25 +335,6 @@ When AI agents work on your application specs:
335
335
  3. They get TypeScript types and usage examples from the reference
336
336
 
337
337
  See `.specify/memory/package-usage-guide.md` (included in the npm package) for detailed integration instructions.
338
-
339
- ## Documentation
340
-
341
- - [Full Components Reference](./COMPONENTS.md) - Complete API documentation
342
- - [Integration Guide](./INTEGRATION.md) - Step-by-step integration instructions
343
- - **[AI Agent Context](./.agent/README.md)** - Component reference optimized for AI agents (Claude, GPT-4, Cursor, etc.)
344
-
345
- ## AI-Assisted Development
346
-
347
- This design system includes comprehensive AI agent context to accelerate development with AI coding assistants.
348
-
349
- ### For AI Agents (Cursor, Claude, GPT-4, etc.)
350
-
351
- The package includes a complete component reference optimized for AI agents at `.agent/rules/COMPONENTS.md`.
352
-
353
- **Quick Start:**
354
- ```bash
355
- # After installing the package
356
- cat node_modules/@cere/cere-design-system/.agent/rules/COMPONENTS.md
357
338
  ```
358
339
 
359
340
  Paste the output into your AI conversation to give the agent complete knowledge of:
package/dist/index.d.mts CHANGED
@@ -12,6 +12,7 @@ import { TextFieldProps as TextFieldProps$1 } from '@mui/material/TextField';
12
12
  import { SwitchProps as SwitchProps$1 } from '@mui/material/Switch';
13
13
  import { CheckboxProps as CheckboxProps$1 } from '@mui/material/Checkbox';
14
14
  import { RadioProps as RadioProps$1 } from '@mui/material/Radio';
15
+ import { ListItemButtonProps } from '@mui/material/ListItemButton';
15
16
  import { BadgeProps as BadgeProps$1 } from '@mui/material/Badge';
16
17
  import { ChipProps as ChipProps$1 } from '@mui/material/Chip';
17
18
  import { TooltipProps as TooltipProps$1 } from '@mui/material/Tooltip';
@@ -433,6 +434,446 @@ type StepButtonProps = StepButtonProps$1;
433
434
  */
434
435
  declare const StepButton: React__default.FC<StepButtonProps>;
435
436
 
437
+ /**
438
+ * Type definitions for SideNav components
439
+ * Side Navigation Bar Component - V1 (Expanded State) & V2 (Collapsed State)
440
+ */
441
+
442
+ /**
443
+ * Navigation Item Properties
444
+ * Individual navigation menu item with icon, label, and interactive states
445
+ */
446
+ interface NavigationItemProps extends Omit<ListItemButtonProps, 'selected' | 'onClick'> {
447
+ /**
448
+ * Unique identifier for the navigation item
449
+ * Used for selection tracking and key prop
450
+ */
451
+ id: string;
452
+ /**
453
+ * Display text for the navigation item
454
+ */
455
+ label: string;
456
+ /**
457
+ * Icon element to display (typically a Material UI icon component)
458
+ */
459
+ icon?: ReactNode;
460
+ /**
461
+ * Position of the icon relative to the label
462
+ * @default 'left'
463
+ */
464
+ iconPosition?: 'left' | 'right';
465
+ /**
466
+ * Whether this item is currently selected/active
467
+ * @default false
468
+ */
469
+ selected?: boolean;
470
+ /**
471
+ * Whether this item is disabled
472
+ * @default false
473
+ */
474
+ disabled?: boolean;
475
+ /**
476
+ * Click handler for the navigation item
477
+ * @param id - The id of the clicked item
478
+ */
479
+ onClick?: (id: string) => void;
480
+ /**
481
+ * Additional content to display on the right side
482
+ * Can be a button, dropdown, badge, etc.
483
+ */
484
+ endContent?: ReactNode;
485
+ /**
486
+ * Optional URL for link-based navigation
487
+ * If provided, component renders as a link
488
+ */
489
+ href?: string;
490
+ /**
491
+ * Accessibility label for screen readers
492
+ * @default Uses 'label' prop value
493
+ */
494
+ ariaLabel?: string;
495
+ /**
496
+ * Size variant for the navigation item
497
+ * @default 'medium'
498
+ */
499
+ size?: 'small' | 'medium' | 'large';
500
+ /**
501
+ * Whether sidebar is collapsed (icon-only mode) - V2
502
+ * When true:
503
+ * - Label is hidden
504
+ * - Tooltip shows on hover/focus
505
+ * - EndContent is hidden
506
+ * - Icon is centered
507
+ * @default false
508
+ */
509
+ collapsed?: boolean;
510
+ /**
511
+ * Whether to show tooltip in collapsed mode - V2
512
+ * @default true
513
+ */
514
+ showTooltip?: boolean;
515
+ /**
516
+ * Tooltip placement - V2
517
+ * @default 'right'
518
+ */
519
+ tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';
520
+ }
521
+ /**
522
+ * Navigation List Properties
523
+ * Container for multiple navigation items with scroll support
524
+ */
525
+ interface NavigationListProps {
526
+ /**
527
+ * Array of navigation items to display
528
+ */
529
+ items: NavigationItemProps[];
530
+ /**
531
+ * ID of currently selected item (controlled mode)
532
+ */
533
+ selectedId?: string;
534
+ /**
535
+ * Callback when selection changes
536
+ * @param id - The id of the newly selected item
537
+ */
538
+ onSelectionChange?: (id: string) => void;
539
+ /**
540
+ * Maximum height before scrolling kicks in
541
+ * @default 'auto'
542
+ */
543
+ maxHeight?: string | number;
544
+ /**
545
+ * Accessibility label for the list
546
+ * @default 'Navigation menu'
547
+ */
548
+ ariaLabel?: string;
549
+ /**
550
+ * Whether sidebar is collapsed - V2
551
+ * Passed down to all NavigationItem children
552
+ * @default false
553
+ */
554
+ collapsed?: boolean;
555
+ /**
556
+ * Whether to show tooltips on items when collapsed - V2
557
+ * Passed down to each NavigationItem's showTooltip prop
558
+ * @default true
559
+ */
560
+ showTooltips?: boolean;
561
+ }
562
+ /**
563
+ * User Information
564
+ * Used in AccountSection component
565
+ */
566
+ interface UserInfo {
567
+ /**
568
+ * User's display name
569
+ */
570
+ name: string;
571
+ /**
572
+ * User's email address (optional)
573
+ */
574
+ email?: string;
575
+ /**
576
+ * User's initials for avatar fallback
577
+ * If not provided, will be derived from name
578
+ */
579
+ initials?: string;
580
+ /**
581
+ * URL for user avatar image
582
+ */
583
+ avatarUrl?: string;
584
+ }
585
+ /**
586
+ * Connection Status Properties
587
+ * Displays connection status with pill-style indicator
588
+ */
589
+ interface ConnectionStatusProps {
590
+ /**
591
+ * Status text to display (e.g., "Connected to Dragon 1")
592
+ */
593
+ status: string;
594
+ /**
595
+ * Visual variant of the status
596
+ * @default 'info'
597
+ */
598
+ variant?: 'success' | 'warning' | 'error' | 'info';
599
+ /**
600
+ * Optional custom icon to replace the default power icon
601
+ */
602
+ icon?: ReactNode;
603
+ /**
604
+ * Optional click handler (makes status interactive)
605
+ */
606
+ onClick?: () => void;
607
+ /**
608
+ * Compact mode for collapsed sidebar - V2
609
+ * When true:
610
+ * - Shows pill with icon + compactText (or falls back to icon-only)
611
+ * - Tooltip shows full status text on hover/focus
612
+ * @default false
613
+ */
614
+ compact?: boolean;
615
+ /**
616
+ * Short label to display in compact mode (e.g. "D1") - V2
617
+ * If not provided, compact mode shows icon-only
618
+ */
619
+ compactText?: string;
620
+ }
621
+ /**
622
+ * Account Section Properties
623
+ * Displays user account information with avatar, name, and logout
624
+ */
625
+ interface AccountSectionProps {
626
+ /**
627
+ * User information object
628
+ */
629
+ user: UserInfo;
630
+ /**
631
+ * Logout button click handler
632
+ */
633
+ onLogout: () => void;
634
+ /**
635
+ * Whether to show email below name
636
+ * @default false
637
+ */
638
+ showEmail?: boolean;
639
+ /**
640
+ * Layout variant
641
+ * @default 'horizontal'
642
+ */
643
+ layout?: 'horizontal' | 'vertical';
644
+ /**
645
+ * Compact mode (avatar-only for collapsed sidebar) - V2
646
+ * When true:
647
+ * - Name and email are hidden
648
+ * - Only avatar is shown (40px)
649
+ * - Tooltip shows name + email on hover/focus
650
+ * - Logout button becomes icon-only
651
+ * @default false
652
+ */
653
+ compact?: boolean;
654
+ }
655
+ /**
656
+ * SideNav Properties
657
+ * Main container component that composes all navigation sections
658
+ */
659
+ interface SideNavProps {
660
+ /**
661
+ * Width of the sidebar when expanded (pixels) - V1
662
+ * @default 280
663
+ */
664
+ width?: number;
665
+ /**
666
+ * Width of the sidebar when collapsed (pixels) - V2
667
+ * @default 68
668
+ */
669
+ collapsedWidth?: number;
670
+ /**
671
+ * Whether the sidebar is collapsed (controlled mode) - V2
672
+ * When provided: Component is controlled (parent manages state)
673
+ * When undefined: Component is uncontrolled (internal state)
674
+ * @default undefined
675
+ */
676
+ collapsed?: boolean;
677
+ /**
678
+ * Default collapsed state (uncontrolled mode only) - V2
679
+ * Ignored if `collapsed` prop is provided
680
+ * @default false
681
+ */
682
+ defaultCollapsed?: boolean;
683
+ /**
684
+ * Callback fired when collapsed state changes - V2
685
+ * Called after toggle button click or programmatic state change
686
+ * @param collapsed - New collapsed state value
687
+ */
688
+ onCollapseChange?: (collapsed: boolean) => void;
689
+ /**
690
+ * Duration of the collapse/expand width transition in ms - V2
691
+ * @default 300
692
+ */
693
+ transitionDuration?: number;
694
+ /**
695
+ * Whether to show tooltips on child items when collapsed - V2
696
+ * Passed down via context to NavigationList and NavigationItem
697
+ * @default true
698
+ */
699
+ showTooltips?: boolean;
700
+ /**
701
+ * Position of the sidebar
702
+ * @default 'left'
703
+ */
704
+ position?: 'left' | 'right';
705
+ /**
706
+ * Whether to show border on the edge
707
+ * @default true
708
+ */
709
+ showBorder?: boolean;
710
+ /**
711
+ * Custom background color
712
+ * @default theme.palette.background.paper
713
+ */
714
+ backgroundColor?: string;
715
+ /**
716
+ * Child components (NavigationList, ConnectionStatus, AccountSection)
717
+ */
718
+ children: ReactNode;
719
+ /**
720
+ * Additional CSS class name
721
+ */
722
+ className?: string;
723
+ /**
724
+ * Accessibility label for the navigation
725
+ * @default 'Main navigation'
726
+ */
727
+ ariaLabel?: string;
728
+ }
729
+ /**
730
+ * SideNav Header Properties
731
+ * Displays app branding (logo + title) and an optional collapse toggle button
732
+ */
733
+ interface SideNavHeaderProps {
734
+ /**
735
+ * App logo or icon element (e.g. an <img>, SVG, or MUI Icon)
736
+ */
737
+ logo?: ReactNode;
738
+ /**
739
+ * App or brand title text displayed next to the logo
740
+ */
741
+ title: string;
742
+ /**
743
+ * Whether to show the collapse toggle button
744
+ * @default true
745
+ */
746
+ showCollapseButton?: boolean;
747
+ /**
748
+ * Callback fired when the collapse button is clicked.
749
+ * Wire this up to toggle sidebar expanded/collapsed state (V2).
750
+ */
751
+ onCollapse?: () => void;
752
+ /**
753
+ * Accessibility label for the header region
754
+ * @default '{title} navigation header'
755
+ */
756
+ ariaLabel?: string;
757
+ /**
758
+ * Whether sidebar is collapsed - V2
759
+ * When true:
760
+ * - Title text is hidden
761
+ * - Logo remains visible (compact)
762
+ * - Toggle button shows expand icon (→)
763
+ * @default false
764
+ */
765
+ collapsed?: boolean;
766
+ }
767
+ /**
768
+ * Compound component slots for SideNav
769
+ */
770
+ interface SideNavHeaderSlotProps {
771
+ children: ReactNode;
772
+ className?: string;
773
+ }
774
+ interface SideNavNavigationProps {
775
+ children: ReactNode;
776
+ className?: string;
777
+ }
778
+ interface SideNavFooterProps {
779
+ children: ReactNode;
780
+ className?: string;
781
+ }
782
+
783
+ /**
784
+ * SideNav Component
785
+ * Main container for side navigation with compound components
786
+ * V2: Added collapsed state support with animated transitions
787
+ */
788
+
789
+ /**
790
+ * SideNav.Header compound component
791
+ * Passes collapsed state and toggle handler to children
792
+ */
793
+ declare const Header: React__default.NamedExoticComponent<SideNavHeaderSlotProps>;
794
+ /**
795
+ * SideNav.Navigation compound component
796
+ * Passes collapsed state to children
797
+ */
798
+ declare const Navigation: React__default.NamedExoticComponent<SideNavNavigationProps>;
799
+ /**
800
+ * SideNav.Footer compound component
801
+ * Passes collapsed state to children
802
+ */
803
+ declare const Footer: React__default.NamedExoticComponent<SideNavFooterProps>;
804
+ /**
805
+ * Main SideNav component with compound components
806
+ * V2: Supports controlled/uncontrolled collapsed state
807
+ */
808
+ interface SideNavComponent extends React__default.FC<SideNavProps> {
809
+ Header: typeof Header;
810
+ Navigation: typeof Navigation;
811
+ Footer: typeof Footer;
812
+ }
813
+ declare const SideNav: SideNavComponent;
814
+
815
+ /**
816
+ * SideNavHeader Component
817
+ * Displays app branding (logo + title) and an optional collapse toggle button
818
+ * V2: Supports collapsed state with compact logo-only view
819
+ */
820
+
821
+ /**
822
+ * SideNavHeader Component
823
+ *
824
+ * Renders the app branding area at the top of the side navigation.
825
+ * Includes an optional logo, a title, and an optional collapse toggle button.
826
+ * V2: In collapsed state, shows logo stacked vertically above toggle button
827
+ */
828
+ declare const SideNavHeader: React__default.NamedExoticComponent<SideNavHeaderProps>;
829
+
830
+ /**
831
+ * NavigationList Component
832
+ * Container for multiple navigation items with scroll support
833
+ * V2: Passes collapsed state to navigation items
834
+ */
835
+
836
+ /**
837
+ * NavigationList Component
838
+ */
839
+ declare const NavigationList: React__default.NamedExoticComponent<NavigationListProps>;
840
+
841
+ /**
842
+ * NavigationItem Component
843
+ * Individual navigation menu item with icon, label, and interactive states
844
+ * V2: Added collapsed state support with tooltips
845
+ */
846
+
847
+ /**
848
+ * NavigationItem Component
849
+ * V2: Supports collapsed state with tooltip
850
+ */
851
+ declare const NavigationItem: React__default.NamedExoticComponent<NavigationItemProps>;
852
+
853
+ /**
854
+ * ConnectionStatus Component
855
+ * Displays connection status with pill-style indicator
856
+ * V2: Supports compact mode for collapsed sidebar
857
+ */
858
+
859
+ /**
860
+ * ConnectionStatus Component
861
+ * V2: Supports compact mode
862
+ */
863
+ declare const ConnectionStatus: React__default.NamedExoticComponent<ConnectionStatusProps>;
864
+
865
+ /**
866
+ * AccountSection Component
867
+ * Displays user account information with avatar, name, and logout
868
+ * V2: Supports compact mode for collapsed sidebar
869
+ */
870
+
871
+ /**
872
+ * AccountSection Component
873
+ * V2: Supports compact mode
874
+ */
875
+ declare const AccountSection: React__default.NamedExoticComponent<AccountSectionProps>;
876
+
436
877
  type BadgeVariant = 'default' | 'primary' | 'success' | 'error';
437
878
  interface BadgeProps extends Omit<BadgeProps$1, 'color' | 'variant'> {
438
879
  variant?: BadgeVariant;
@@ -1107,4 +1548,4 @@ interface CodeEditorProps {
1107
1548
  */
1108
1549
  declare const CodeEditor: React__default.FC<CodeEditorProps>;
1109
1550
 
1110
- export { Accordion, type AccordionProps, ActivityAppIcon, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, AppLoading, type AppLoadingProps, Avatar, AvatarIcon, type AvatarProps, Badge, type BadgeProps, BarTrackingIcon, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, BytesSize, type BytesSizeProps, Card, CardActions, CardContent, CardHeader, type CardProps, CereIcon, ChartWidget, type ChartWidgetProps, CheckMarkAnimation, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, type CircularProgressProps, ClockIcon, CloudFlashIcon, CodeEditor, type CodeEditorLanguage, type CodeEditorProps, Collapse, type CollapseProps, DecentralizedServerIcon, Dialog, type DialogProps, DiscordIcon, Divider, type DividerProps, DownloadIcon, Drawer, type DrawerProps, Dropdown, DropdownAnchor, type DropdownAnchorProps, type DropdownProps, EmptyState, type EmptyStateProps, FilledFolderIcon, FlowEditor, type FlowEditorProps, FolderIcon, GithubLogoIcon, IconButton, type IconButtonProps, LeftArrowIcon, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Loading, LoadingAnimation, type LoadingAnimationProps, LoadingButton, type LoadingButtonProps, type LoadingProps, Logo, type LogoProps, Markdown, type MarkdownProps, Menu, MenuItem, type MenuItemProps, type MenuProps, type MessageOptions, MessagesProvider, MetricsChart, type MetricsChartProps, type MetricsPeriod, OnboardingProvider, Pagination, type PaginationProps, Paper, type PaperProps, PeriodSelect, Progress, type ProgressProps, QRCode, type QRCodeProps, Radio, type RadioProps, RightArrowIcon, SearchField, type SearchFieldProps, Selector, type SelectorOption, type SelectorProps, type Service, ServiceSelectorButton, type ServiceSelectorButtonProps, ShareIcon, Sidebar, SidebarItem, type SidebarItemProps, type SidebarProps, Snackbar, type SnackbarProps, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, StorageAppIcon, Switch, type SwitchProps, Tab, type TabProps, Table, TableHeader, type TableHeaderProps, type TableProps, TextField, type TextFieldProps, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, Truncate, type TruncateProps, UploadFileIcon, UploadFolderIcon, type Workspace, WorkspaceSelectorButton, type WorkspaceSelectorButtonProps, colors, theme, useIsDesktop, useIsMobile, useIsTablet, useMessages, useOnboarding };
1551
+ export { Accordion, type AccordionProps, AccountSection, type AccountSectionProps, ActivityAppIcon, Alert, type AlertProps, type AlertSeverity, AppBar, type AppBarProps, AppLoading, type AppLoadingProps, Avatar, AvatarIcon, type AvatarProps, Badge, type BadgeProps, BarTrackingIcon, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, BytesSize, type BytesSizeProps, Card, CardActions, CardContent, CardHeader, type CardProps, CereIcon, ChartWidget, type ChartWidgetProps, CheckMarkAnimation, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, type CircularProgressProps, ClockIcon, CloudFlashIcon, CodeEditor, type CodeEditorLanguage, type CodeEditorProps, Collapse, type CollapseProps, ConnectionStatus, type ConnectionStatusProps, DecentralizedServerIcon, Dialog, type DialogProps, DiscordIcon, Divider, type DividerProps, DownloadIcon, Drawer, type DrawerProps, Dropdown, DropdownAnchor, type DropdownAnchorProps, type DropdownProps, EmptyState, type EmptyStateProps, FilledFolderIcon, FlowEditor, type FlowEditorProps, FolderIcon, GithubLogoIcon, IconButton, type IconButtonProps, LeftArrowIcon, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Loading, LoadingAnimation, type LoadingAnimationProps, LoadingButton, type LoadingButtonProps, type LoadingProps, Logo, type LogoProps, Markdown, type MarkdownProps, Menu, MenuItem, type MenuItemProps, type MenuProps, type MessageOptions, MessagesProvider, MetricsChart, type MetricsChartProps, type MetricsPeriod, NavigationItem, type NavigationItemProps, NavigationList, type NavigationListProps, OnboardingProvider, Pagination, type PaginationProps, Paper, type PaperProps, PeriodSelect, Progress, type ProgressProps, QRCode, type QRCodeProps, Radio, type RadioProps, RightArrowIcon, SearchField, type SearchFieldProps, Selector, type SelectorOption, type SelectorProps, type Service, ServiceSelectorButton, type ServiceSelectorButtonProps, ShareIcon, SideNav, SideNavHeader, type SideNavHeaderProps, type SideNavProps, Sidebar, SidebarItem, type SidebarItemProps, type SidebarProps, Snackbar, type SnackbarProps, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, StorageAppIcon, Switch, type SwitchProps, Tab, type TabProps, Table, TableHeader, type TableHeaderProps, type TableProps, TextField, type TextFieldProps, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, Truncate, type TruncateProps, UploadFileIcon, UploadFolderIcon, type UserInfo, type Workspace, WorkspaceSelectorButton, type WorkspaceSelectorButtonProps, colors, theme, useIsDesktop, useIsMobile, useIsTablet, useMessages, useOnboarding };