sangam-ui 1.0.1 → 1.0.2

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.ts CHANGED
@@ -1586,8 +1586,8 @@ declare const PageFooter: React.ForwardRefExoticComponent<PageFooterProps & Reac
1586
1586
  * Logo 36×28. Text: 12px, weight 500, line-height 16px.
1587
1587
  */
1588
1588
  /**
1589
- * Data for one row in {@link SideMenu} `topItems` / `bottomItems`.
1590
- * Each entry is rendered exclusively with {@link SideMenuItem} (Dashboard, Orders, Projects, Search, Settings, Profile, etc.).
1589
+ * Data for one row in a {@link SideMenuGroup}.
1590
+ * Each entry is rendered exclusively with {@link SideMenuItem}.
1591
1591
  */
1592
1592
  interface SideMenuNavItem {
1593
1593
  id: string;
@@ -1599,13 +1599,26 @@ interface SideMenuNavItem {
1599
1599
  /** When the menu is expanded, show a trailing chevron (submenu affordance). */
1600
1600
  hasSubmenu?: boolean;
1601
1601
  }
1602
+ /**
1603
+ * Group wrapper config for SideMenu rows.
1604
+ * Label behavior:
1605
+ * - Expanded: shows `groupName`
1606
+ * - Collapsed: shows `--`
1607
+ * - `showGroup: false`: hides label, still renders items
1608
+ */
1609
+ interface SideMenuItemGroup {
1610
+ id: string;
1611
+ groupName: string;
1612
+ items: SideMenuNavItem[];
1613
+ showGroup?: boolean;
1614
+ }
1602
1615
  interface SideMenuProps extends Omit<React.HTMLAttributes<HTMLElement>, "children">, VariantProps<typeof sideMenuVariants> {
1603
1616
  /** Logo element (e.g. img 36×28) */
1604
1617
  logo: React.ReactNode;
1605
- /** Top nav items: Dashboard, Orders, Projects */
1606
- topItems: SideMenuNavItem[];
1607
- /** Bottom nav items: Search, Settings, Profile */
1608
- bottomItems: SideMenuNavItem[];
1618
+ /** Top groups of nav rows (e.g., AI Services, Compute, Storage). */
1619
+ topGroups: SideMenuItemGroup[];
1620
+ /** Bottom groups of nav rows (e.g., utilities/profile section). */
1621
+ bottomGroups: SideMenuItemGroup[];
1609
1622
  /** ID of currently selected item (controlled). Omit for uncontrolled; use defaultSelectedId for initial. */
1610
1623
  selectedId?: string;
1611
1624
  /** Initial selected ID when uncontrolled. Ignored if selectedId is provided. */
@@ -1633,7 +1646,7 @@ declare const SideMenu: React.ForwardRefExoticComponent<SideMenuProps & React.Re
1633
1646
 
1634
1647
  /**
1635
1648
  * Single row for {@link SideMenu}: leading icon, optional label, optional submenu chevron.
1636
- * Use inside `SideMenu` via `topItems` / `bottomItems`, or alone for layout/testing.
1649
+ * Use inside `SideMenu` via grouped sections, or alone for layout/testing.
1637
1650
  */
1638
1651
  interface SideMenuItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
1639
1652
  /** Visible label (hidden when `iconOnly` is true). */
@@ -1726,4 +1739,4 @@ type Size = "sm" | "md" | "lg";
1726
1739
  type Variant = "primary" | "secondary" | "outline" | "ghost";
1727
1740
  type ColorScheme = "primary" | "secondary" | "success" | "error" | "warning" | "info";
1728
1741
 
1729
- export { Avatar, Badge, type BaseComponentProps, Button, Card, Checkbox, Chip, type ColorScheme, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderTop, DrawerSurface, DrawerTitle, DrawerTrigger, Dropdown, DropdownMulti, type DropdownMultiProps, type DropdownOption, type DropdownProps, Input, Label, Loader, Menu, MenuContent, MenuItem, MenuMenu, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, PageFooter, type PageFooterAction, type PageFooterProps, PageHeader, type PageHeaderAction, type PageHeaderProps, type PageHeaderTab, Pagination, Popup, PopupContent, PopupTrigger, ProgressBar, Radio, RadioGroup, SearchField, SideMenu, SideMenuItem, type SideMenuItemProps, type SideMenuNavItem, type SideMenuProps, type Size, Skeleton, Stepper, type StepperProps, type StepperStep, type StepperStepVariant, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, type TabsTriggerOption, type TabsTriggerProps, Textarea, Toast, type ToastEntryOptions, ToastProvider, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Upload, UploadFileItem, type UploadFileItemProps, type UploadFileItemStatus, type UploadProps, type Variant, avatarVariants, badgeVariants, buttonVariants, cardVariants, checkboxRootVariants as checkboxVariants, chipVariants, dropdownContentVariants, dropdownItemVariants, dropdownTriggerVariants, inputVariants, loaderVariants, pageHeaderVariants, radioVariants, searchFieldVariants, sideMenuVariants, skeletonVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, toggleVariants, tooltipContentVariants, uploadBoxVariants, uploadFileItemBoxVariants, useToast };
1742
+ export { Avatar, Badge, type BaseComponentProps, Button, Card, Checkbox, Chip, type ColorScheme, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderTop, DrawerSurface, DrawerTitle, DrawerTrigger, Dropdown, DropdownMulti, type DropdownMultiProps, type DropdownOption, type DropdownProps, Input, Label, Loader, Menu, MenuContent, MenuItem, MenuMenu, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, PageFooter, type PageFooterAction, type PageFooterProps, PageHeader, type PageHeaderAction, type PageHeaderProps, type PageHeaderTab, Pagination, Popup, PopupContent, PopupTrigger, ProgressBar, Radio, RadioGroup, SearchField, SideMenu, SideMenuItem, type SideMenuItemGroup, type SideMenuItemProps, type SideMenuNavItem, type SideMenuProps, type Size, Skeleton, Stepper, type StepperProps, type StepperStep, type StepperStepVariant, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, type TabsTriggerOption, type TabsTriggerProps, Textarea, Toast, type ToastEntryOptions, ToastProvider, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Upload, UploadFileItem, type UploadFileItemProps, type UploadFileItemStatus, type UploadProps, type Variant, avatarVariants, badgeVariants, buttonVariants, cardVariants, checkboxRootVariants as checkboxVariants, chipVariants, dropdownContentVariants, dropdownItemVariants, dropdownTriggerVariants, inputVariants, loaderVariants, pageHeaderVariants, radioVariants, searchFieldVariants, sideMenuVariants, skeletonVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, toggleVariants, tooltipContentVariants, uploadBoxVariants, uploadFileItemBoxVariants, useToast };
package/dist/index.js CHANGED
@@ -3581,6 +3581,37 @@ function SideMenuNavRow({
3581
3581
  }
3582
3582
  );
3583
3583
  }
3584
+ function SideMenuGroup({
3585
+ group,
3586
+ isCollapsed,
3587
+ selectedId,
3588
+ onItemClick,
3589
+ className
3590
+ }) {
3591
+ const showGroup = group.showGroup ?? true;
3592
+ return /* @__PURE__ */ jsxs22("div", { className: cn28("flex flex-col gap-2", className), children: [
3593
+ showGroup ? /* @__PURE__ */ jsx28(
3594
+ "div",
3595
+ {
3596
+ className: cn28(
3597
+ "text-xs font-medium leading-4 text-semantic-text-neutral-tertiary",
3598
+ isCollapsed ? "px-0 text-center" : "px-2 text-left"
3599
+ ),
3600
+ children: isCollapsed ? "--" : group.groupName
3601
+ }
3602
+ ) : null,
3603
+ group.items.map((item) => /* @__PURE__ */ jsx28(
3604
+ SideMenuNavRow,
3605
+ {
3606
+ item,
3607
+ isCollapsed,
3608
+ isSelected: selectedId === item.id,
3609
+ onClick: () => onItemClick(item.id)
3610
+ },
3611
+ item.id
3612
+ ))
3613
+ ] });
3614
+ }
3584
3615
  var sideMenuVariants = cva19(
3585
3616
  "flex flex-col self-start transition-[width] duration-200 ease-out",
3586
3617
  {
@@ -3602,8 +3633,8 @@ var SideMenu = React28.forwardRef(
3602
3633
  className,
3603
3634
  variant = "default",
3604
3635
  logo,
3605
- topItems,
3606
- bottomItems,
3636
+ topGroups,
3637
+ bottomGroups,
3607
3638
  selectedId: selectedIdProp,
3608
3639
  defaultSelectedId,
3609
3640
  expanded: expandedProp,
@@ -3725,25 +3756,25 @@ var SideMenu = React28.forwardRef(
3725
3756
  ] })
3726
3757
  }
3727
3758
  ) }),
3728
- /* @__PURE__ */ jsx28("div", { className: "flex flex-1 flex-col gap-2", children: topItems.map((item) => /* @__PURE__ */ jsx28(
3729
- SideMenuNavRow,
3759
+ /* @__PURE__ */ jsx28("div", { className: "flex flex-1 flex-col gap-4", children: topGroups.map((group) => /* @__PURE__ */ jsx28(
3760
+ SideMenuGroup,
3730
3761
  {
3731
- item,
3762
+ group,
3732
3763
  isCollapsed,
3733
- isSelected: selectedId === item.id,
3734
- onClick: () => handleItemClick(item.id)
3764
+ selectedId,
3765
+ onItemClick: handleItemClick
3735
3766
  },
3736
- item.id
3767
+ group.id
3737
3768
  )) }),
3738
- /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-2 pt-4", children: bottomItems.map((item) => /* @__PURE__ */ jsx28(
3739
- SideMenuNavRow,
3769
+ /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-4 pt-4", children: bottomGroups.map((group) => /* @__PURE__ */ jsx28(
3770
+ SideMenuGroup,
3740
3771
  {
3741
- item,
3772
+ group,
3742
3773
  isCollapsed,
3743
- isSelected: selectedId === item.id,
3744
- onClick: () => handleItemClick(item.id)
3774
+ selectedId,
3775
+ onItemClick: handleItemClick
3745
3776
  },
3746
- item.id
3777
+ group.id
3747
3778
  )) })
3748
3779
  ]
3749
3780
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sangam-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",