@streamoid/ui 0.3.1 → 0.3.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.css CHANGED
@@ -3447,10 +3447,20 @@
3447
3447
  line-height: var(--text-text-sm-regular-line-height, 1.25rem);
3448
3448
  font-weight: var(--text-text-sm-regular-font-weight, 400);
3449
3449
  position: relative;
3450
- width: 9.9375rem;
3450
+ flex: 1 0 0;
3451
+ min-width: 0;
3451
3452
  height: 1.25rem;
3452
3453
  text-overflow: ellipsis;
3453
3454
  overflow: hidden;
3455
+ white-space: nowrap;
3456
+ }
3457
+ .ScSidebarMenu_moreIconWrapper {
3458
+ display: none;
3459
+ align-items: center;
3460
+ padding: 0.125rem;
3461
+ border-radius: var(--radius-md, 0.5rem);
3462
+ flex-shrink: 0;
3463
+ cursor: pointer;
3454
3464
  }
3455
3465
  .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_state-active {
3456
3466
  background: var(--alias-fill-neutral-neutralselected, #242424);
@@ -3458,10 +3468,17 @@
3458
3468
  .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_state-active .ScSidebarMenu_content {
3459
3469
  color: var(--alias-text-and-icons-primary, #f5f5f5);
3460
3470
  }
3471
+ .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_state-default-highlight .ScSidebarMenu_content {
3472
+ color: var(--alias-text-and-icons-primary, #f5f5f5);
3473
+ }
3461
3474
  .ScSidebarMenu_scSidebarMenu:hover,
3462
3475
  .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_state-hover {
3463
3476
  background: var(--alias-fill-neutral-neutral, #1a1a1a);
3464
3477
  }
3478
+ .ScSidebarMenu_scSidebarMenu:hover .ScSidebarMenu_moreIconWrapper,
3479
+ .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_state-hover .ScSidebarMenu_moreIconWrapper {
3480
+ display: flex;
3481
+ }
3465
3482
  .ScSidebarMenu_scSidebarMenu.ScSidebarMenu_variant-collapsed {
3466
3483
  padding: var(--spacing-md, 0.5rem);
3467
3484
  align-self: unset;
package/dist/index.d.mts CHANGED
@@ -290,7 +290,10 @@ interface StreamoidSidebarProps {
290
290
  config: SidebarConfig;
291
291
  iconMap: SidebarIconMap;
292
292
  activeItemId?: string;
293
+ highlightedItemIds?: Set<string>;
293
294
  onItemSelect?: (item: SidebarMenuItemConfig, sectionId?: string) => void;
295
+ moreIcon?: ReactNode;
296
+ onMoreClick?: (item: SidebarMenuItemConfig, sectionId?: string) => void;
294
297
  expandedLogo?: ReactNode;
295
298
  collapsedLogo?: ReactNode;
296
299
  profile?: SidebarProfileConfig;
@@ -298,19 +301,24 @@ interface StreamoidSidebarProps {
298
301
  toggleIcon?: ReactNode | ((expanded: boolean) => ReactNode);
299
302
  hideFooter?: boolean;
300
303
  preFooterContent?: ReactNode;
304
+ bodyContent?: ReactNode;
305
+ showBody?: boolean;
306
+ isMobile?: boolean;
301
307
  className?: string;
302
308
  style?: CSSProperties;
303
309
  }
304
- declare function StreamoidSidebar({ expanded, onToggle, config, iconMap, activeItemId, onItemSelect, expandedLogo, collapsedLogo, profile, versionText, toggleIcon, hideFooter, preFooterContent, className, style, }: StreamoidSidebarProps): react_jsx_runtime.JSX.Element;
310
+ declare function StreamoidSidebar({ expanded, onToggle, config, iconMap, activeItemId, highlightedItemIds, onItemSelect, moreIcon, onMoreClick, expandedLogo, collapsedLogo, profile, versionText, toggleIcon, hideFooter, preFooterContent, bodyContent, showBody, isMobile, className, style, }: StreamoidSidebarProps): react_jsx_runtime.JSX.Element;
305
311
 
306
312
  interface IScSidebarMenuProps extends React.HTMLAttributes<HTMLDivElement> {
307
313
  icon?: JSX.Element;
308
- state?: "default" | "active";
314
+ state?: "default" | "active" | "hover" | "default-highlight";
309
315
  variant?: "expanded" | "collapsed";
310
316
  className?: string;
311
317
  text?: string;
318
+ moreIcon?: ReactNode;
319
+ onMoreClick?: (e: React.MouseEvent) => void;
312
320
  }
313
- declare const ScSidebarMenu: ({ icon, state, variant, className, text, ...props }: IScSidebarMenuProps) => JSX.Element;
321
+ declare const ScSidebarMenu: ({ icon, state, variant, className, text, moreIcon, onMoreClick, ...props }: IScSidebarMenuProps) => JSX.Element;
314
322
 
315
323
  interface IScSidebarProfileProps extends React.HTMLAttributes<HTMLDivElement> {
316
324
  state?: "default" | "hover";
package/dist/index.d.ts CHANGED
@@ -290,7 +290,10 @@ interface StreamoidSidebarProps {
290
290
  config: SidebarConfig;
291
291
  iconMap: SidebarIconMap;
292
292
  activeItemId?: string;
293
+ highlightedItemIds?: Set<string>;
293
294
  onItemSelect?: (item: SidebarMenuItemConfig, sectionId?: string) => void;
295
+ moreIcon?: ReactNode;
296
+ onMoreClick?: (item: SidebarMenuItemConfig, sectionId?: string) => void;
294
297
  expandedLogo?: ReactNode;
295
298
  collapsedLogo?: ReactNode;
296
299
  profile?: SidebarProfileConfig;
@@ -298,19 +301,24 @@ interface StreamoidSidebarProps {
298
301
  toggleIcon?: ReactNode | ((expanded: boolean) => ReactNode);
299
302
  hideFooter?: boolean;
300
303
  preFooterContent?: ReactNode;
304
+ bodyContent?: ReactNode;
305
+ showBody?: boolean;
306
+ isMobile?: boolean;
301
307
  className?: string;
302
308
  style?: CSSProperties;
303
309
  }
304
- declare function StreamoidSidebar({ expanded, onToggle, config, iconMap, activeItemId, onItemSelect, expandedLogo, collapsedLogo, profile, versionText, toggleIcon, hideFooter, preFooterContent, className, style, }: StreamoidSidebarProps): react_jsx_runtime.JSX.Element;
310
+ declare function StreamoidSidebar({ expanded, onToggle, config, iconMap, activeItemId, highlightedItemIds, onItemSelect, moreIcon, onMoreClick, expandedLogo, collapsedLogo, profile, versionText, toggleIcon, hideFooter, preFooterContent, bodyContent, showBody, isMobile, className, style, }: StreamoidSidebarProps): react_jsx_runtime.JSX.Element;
305
311
 
306
312
  interface IScSidebarMenuProps extends React.HTMLAttributes<HTMLDivElement> {
307
313
  icon?: JSX.Element;
308
- state?: "default" | "active";
314
+ state?: "default" | "active" | "hover" | "default-highlight";
309
315
  variant?: "expanded" | "collapsed";
310
316
  className?: string;
311
317
  text?: string;
318
+ moreIcon?: ReactNode;
319
+ onMoreClick?: (e: React.MouseEvent) => void;
312
320
  }
313
- declare const ScSidebarMenu: ({ icon, state, variant, className, text, ...props }: IScSidebarMenuProps) => JSX.Element;
321
+ declare const ScSidebarMenu: ({ icon, state, variant, className, text, moreIcon, onMoreClick, ...props }: IScSidebarMenuProps) => JSX.Element;
314
322
 
315
323
  interface IScSidebarProfileProps extends React.HTMLAttributes<HTMLDivElement> {
316
324
  state?: "default" | "hover";
package/dist/index.js CHANGED
@@ -2236,7 +2236,9 @@ var import_icons28 = require("@streamoid/icons");
2236
2236
  var ScSidebarMenu_default = {
2237
2237
  scSidebarMenu: "ScSidebarMenu_scSidebarMenu",
2238
2238
  content: "ScSidebarMenu_content",
2239
+ moreIconWrapper: "ScSidebarMenu_moreIconWrapper",
2239
2240
  "state-active": "ScSidebarMenu_state-active",
2241
+ "state-default-highlight": "ScSidebarMenu_state-default-highlight",
2240
2242
  "state-hover": "ScSidebarMenu_state-hover",
2241
2243
  "variant-collapsed": "ScSidebarMenu_variant-collapsed"
2242
2244
  };
@@ -2250,6 +2252,8 @@ var ScSidebarMenu = ({
2250
2252
  variant = "expanded",
2251
2253
  className,
2252
2254
  text = "Menu Item",
2255
+ moreIcon,
2256
+ onMoreClick,
2253
2257
  ...props
2254
2258
  }) => {
2255
2259
  const variantsClassName = ScSidebarMenu_default["state-" + state] + " " + ScSidebarMenu_default["variant-" + variant];
@@ -2260,10 +2264,20 @@ var ScSidebarMenu = ({
2260
2264
  ...props,
2261
2265
  children: [
2262
2266
  icon,
2263
- variant === "expanded" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: ScSidebarMenu_default.content, children: [
2264
- text,
2265
- " "
2266
- ] }) })
2267
+ variant === "expanded" && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2268
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: ScSidebarMenu_default.content, children: text }),
2269
+ moreIcon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2270
+ "div",
2271
+ {
2272
+ className: ScSidebarMenu_default.moreIconWrapper,
2273
+ onClick: (e) => {
2274
+ e.stopPropagation();
2275
+ onMoreClick?.(e);
2276
+ },
2277
+ children: moreIcon
2278
+ }
2279
+ )
2280
+ ] })
2267
2281
  ]
2268
2282
  }
2269
2283
  );
@@ -2719,18 +2733,25 @@ function renderMenuItem({
2719
2733
  sectionId,
2720
2734
  expanded,
2721
2735
  activeItemId,
2736
+ highlightedItemIds,
2722
2737
  iconMap,
2723
- onItemSelect
2738
+ onItemSelect,
2739
+ moreIcon,
2740
+ onMoreClick
2724
2741
  }) {
2725
2742
  const active = item.id === activeItemId;
2743
+ const highlighted = highlightedItemIds?.has(item.id) ?? false;
2744
+ const state = active ? "active" : highlighted ? "default-highlight" : "default";
2726
2745
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2727
2746
  ScSidebarMenu,
2728
2747
  {
2729
- icon: resolveIcon(iconMap, item, active, expanded),
2748
+ icon: resolveIcon(iconMap, item, active || highlighted, expanded),
2730
2749
  text: expanded ? item.label : void 0,
2731
- state: active ? "active" : "default",
2750
+ state,
2732
2751
  variant: expanded ? "expanded" : "collapsed",
2733
- onClick: () => onItemSelect?.(item, sectionId)
2752
+ onClick: () => onItemSelect?.(item, sectionId),
2753
+ moreIcon,
2754
+ onMoreClick: onMoreClick ? () => onMoreClick(item, sectionId) : void 0
2734
2755
  },
2735
2756
  item.id
2736
2757
  );
@@ -2741,7 +2762,10 @@ function StreamoidSidebar({
2741
2762
  config,
2742
2763
  iconMap,
2743
2764
  activeItemId,
2765
+ highlightedItemIds,
2744
2766
  onItemSelect,
2767
+ moreIcon,
2768
+ onMoreClick,
2745
2769
  expandedLogo,
2746
2770
  collapsedLogo,
2747
2771
  profile,
@@ -2749,9 +2773,13 @@ function StreamoidSidebar({
2749
2773
  toggleIcon,
2750
2774
  hideFooter = false,
2751
2775
  preFooterContent,
2776
+ bodyContent,
2777
+ showBody = false,
2778
+ isMobile = false,
2752
2779
  className,
2753
2780
  style
2754
2781
  }) {
2782
+ const effectiveHideFooter = hideFooter || isMobile;
2755
2783
  if (expanded) {
2756
2784
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2757
2785
  "div",
@@ -2766,7 +2794,7 @@ function StreamoidSidebar({
2766
2794
  backgroundColor: "var(--alias-surface-base)",
2767
2795
  borderRadius: "var(--radius-3xl)",
2768
2796
  padding: "var(--spacing-md)",
2769
- paddingBottom: hideFooter ? "var(--spacing-md)" : void 0,
2797
+ paddingBottom: effectiveHideFooter ? "var(--spacing-md)" : void 0,
2770
2798
  width: 256,
2771
2799
  gap: "var(--spacing-xxs)"
2772
2800
  },
@@ -2788,23 +2816,44 @@ function StreamoidSidebar({
2788
2816
  className: "flex flex-col flex-1 items-start min-h-0 w-full overflow-y-auto sidebar-scroll",
2789
2817
  style: { gap: "var(--spacing-xxs)" },
2790
2818
  children: [
2791
- expandedLogo,
2792
- config.topItem && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2793
- "div",
2794
- {
2795
- className: "flex flex-col items-start shrink-0 w-full",
2796
- style: { padding: "var(--spacing-md) 0" },
2797
- children: renderMenuItem({
2798
- item: config.topItem,
2799
- sectionId: "top",
2800
- expanded: true,
2801
- activeItemId,
2802
- iconMap,
2803
- onItemSelect
2804
- })
2805
- }
2806
- ),
2807
- config.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2819
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between w-full shrink-0", children: [
2820
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "min-w-0 flex-1", children: expandedLogo }),
2821
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2822
+ "div",
2823
+ {
2824
+ className: "flex items-center cursor-pointer shrink-0",
2825
+ style: {
2826
+ padding: "var(--spacing-md)",
2827
+ borderRadius: "var(--radius-3xl)"
2828
+ },
2829
+ onClick: onToggle,
2830
+ children: resolveToggleIcon(toggleIcon, true)
2831
+ }
2832
+ ) : null
2833
+ ] }),
2834
+ config.topItem && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
2835
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {}),
2836
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2837
+ "div",
2838
+ {
2839
+ className: "flex flex-col items-start shrink-0 w-full",
2840
+ style: { padding: "var(--spacing-md) 0" },
2841
+ children: renderMenuItem({
2842
+ item: config.topItem,
2843
+ sectionId: "top",
2844
+ expanded: true,
2845
+ activeItemId,
2846
+ highlightedItemIds,
2847
+ iconMap,
2848
+ onItemSelect,
2849
+ moreIcon,
2850
+ onMoreClick
2851
+ })
2852
+ }
2853
+ ),
2854
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {})
2855
+ ] }),
2856
+ showBody && bodyContent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col flex-1 min-h-0 w-full overflow-hidden", children: bodyContent }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: config.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2808
2857
  "div",
2809
2858
  {
2810
2859
  className: "flex flex-col items-start shrink-0 w-full",
@@ -2827,10 +2876,11 @@ function StreamoidSidebar({
2827
2876
  ]
2828
2877
  },
2829
2878
  section.id
2830
- ))
2879
+ )) })
2831
2880
  ]
2832
2881
  }
2833
2882
  ),
2883
+ preFooterContent,
2834
2884
  config.bottomItems?.length ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2835
2885
  "div",
2836
2886
  {
@@ -2848,7 +2898,6 @@ function StreamoidSidebar({
2848
2898
  )
2849
2899
  }
2850
2900
  ) : null,
2851
- preFooterContent,
2852
2901
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {}),
2853
2902
  profile ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
2854
2903
  /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
@@ -2856,8 +2905,7 @@ function StreamoidSidebar({
2856
2905
  {
2857
2906
  className: "flex items-center shrink-0 w-full cursor-pointer",
2858
2907
  style: {
2859
- padding: "var(--spacing-md)",
2860
- marginTop: "var(--spacing-md)",
2908
+ padding: "var(--spacing-md) var(--spacing-xl)",
2861
2909
  gap: "var(--spacing-md)",
2862
2910
  borderRadius: "var(--radius-xl)"
2863
2911
  },
@@ -2891,18 +2939,15 @@ function StreamoidSidebar({
2891
2939
  ]
2892
2940
  }
2893
2941
  ),
2894
- !hideFooter && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
2895
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { style: { marginTop: "var(--spacing-md)" } }),
2896
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {})
2897
- ] })
2942
+ !effectiveHideFooter && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {}) })
2898
2943
  ] }) : null,
2899
- !hideFooter && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "shrink-0 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2944
+ !effectiveHideFooter && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "shrink-0 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2900
2945
  "div",
2901
2946
  {
2902
2947
  className: "flex items-center w-full",
2903
2948
  style: {
2904
2949
  gap: "var(--spacing-xs)",
2905
- padding: "var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-3xl)"
2950
+ padding: "var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-xl)"
2906
2951
  },
2907
2952
  children: [
2908
2953
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
@@ -2977,14 +3022,17 @@ function StreamoidSidebar({
2977
3022
  sectionId: "top",
2978
3023
  expanded: false,
2979
3024
  activeItemId,
3025
+ highlightedItemIds,
2980
3026
  iconMap,
2981
- onItemSelect
3027
+ onItemSelect,
3028
+ moreIcon,
3029
+ onMoreClick
2982
3030
  })
2983
3031
  }
2984
3032
  ),
2985
3033
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HDivider, {})
2986
3034
  ] }) : null,
2987
- config.sections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col items-center w-full", children: [
3035
+ showBody && bodyContent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col items-center w-full", children: bodyContent }) : config.sections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col items-center w-full", children: [
2988
3036
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2989
3037
  "div",
2990
3038
  {
@@ -2999,8 +3047,11 @@ function StreamoidSidebar({
2999
3047
  sectionId: section.id,
3000
3048
  expanded: false,
3001
3049
  activeItemId,
3050
+ highlightedItemIds,
3002
3051
  iconMap,
3003
- onItemSelect
3052
+ onItemSelect,
3053
+ moreIcon,
3054
+ onMoreClick
3004
3055
  })
3005
3056
  )
3006
3057
  }
@@ -3010,6 +3061,7 @@ function StreamoidSidebar({
3010
3061
  ]
3011
3062
  }
3012
3063
  ),
3064
+ preFooterContent,
3013
3065
  config.bottomItems?.length ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3014
3066
  "div",
3015
3067
  {
@@ -3021,8 +3073,11 @@ function StreamoidSidebar({
3021
3073
  sectionId: "bottom",
3022
3074
  expanded: false,
3023
3075
  activeItemId,
3076
+ highlightedItemIds,
3024
3077
  iconMap,
3025
- onItemSelect
3078
+ onItemSelect,
3079
+ moreIcon,
3080
+ onMoreClick
3026
3081
  })
3027
3082
  )
3028
3083
  }
package/dist/index.mjs CHANGED
@@ -2131,7 +2131,9 @@ import { SiconPlus } from "@streamoid/icons";
2131
2131
  var ScSidebarMenu_default = {
2132
2132
  scSidebarMenu: "ScSidebarMenu_scSidebarMenu",
2133
2133
  content: "ScSidebarMenu_content",
2134
+ moreIconWrapper: "ScSidebarMenu_moreIconWrapper",
2134
2135
  "state-active": "ScSidebarMenu_state-active",
2136
+ "state-default-highlight": "ScSidebarMenu_state-default-highlight",
2135
2137
  "state-hover": "ScSidebarMenu_state-hover",
2136
2138
  "variant-collapsed": "ScSidebarMenu_variant-collapsed"
2137
2139
  };
@@ -2145,6 +2147,8 @@ var ScSidebarMenu = ({
2145
2147
  variant = "expanded",
2146
2148
  className,
2147
2149
  text = "Menu Item",
2150
+ moreIcon,
2151
+ onMoreClick,
2148
2152
  ...props
2149
2153
  }) => {
2150
2154
  const variantsClassName = ScSidebarMenu_default["state-" + state] + " " + ScSidebarMenu_default["variant-" + variant];
@@ -2155,10 +2159,20 @@ var ScSidebarMenu = ({
2155
2159
  ...props,
2156
2160
  children: [
2157
2161
  icon,
2158
- variant === "expanded" && /* @__PURE__ */ jsx34(Fragment11, { children: /* @__PURE__ */ jsxs28("div", { className: ScSidebarMenu_default.content, children: [
2159
- text,
2160
- " "
2161
- ] }) })
2162
+ variant === "expanded" && /* @__PURE__ */ jsxs28(Fragment11, { children: [
2163
+ /* @__PURE__ */ jsx34("div", { className: ScSidebarMenu_default.content, children: text }),
2164
+ moreIcon && /* @__PURE__ */ jsx34(
2165
+ "div",
2166
+ {
2167
+ className: ScSidebarMenu_default.moreIconWrapper,
2168
+ onClick: (e) => {
2169
+ e.stopPropagation();
2170
+ onMoreClick?.(e);
2171
+ },
2172
+ children: moreIcon
2173
+ }
2174
+ )
2175
+ ] })
2162
2176
  ]
2163
2177
  }
2164
2178
  );
@@ -2614,18 +2628,25 @@ function renderMenuItem({
2614
2628
  sectionId,
2615
2629
  expanded,
2616
2630
  activeItemId,
2631
+ highlightedItemIds,
2617
2632
  iconMap,
2618
- onItemSelect
2633
+ onItemSelect,
2634
+ moreIcon,
2635
+ onMoreClick
2619
2636
  }) {
2620
2637
  const active = item.id === activeItemId;
2638
+ const highlighted = highlightedItemIds?.has(item.id) ?? false;
2639
+ const state = active ? "active" : highlighted ? "default-highlight" : "default";
2621
2640
  return /* @__PURE__ */ jsx39(
2622
2641
  ScSidebarMenu,
2623
2642
  {
2624
- icon: resolveIcon(iconMap, item, active, expanded),
2643
+ icon: resolveIcon(iconMap, item, active || highlighted, expanded),
2625
2644
  text: expanded ? item.label : void 0,
2626
- state: active ? "active" : "default",
2645
+ state,
2627
2646
  variant: expanded ? "expanded" : "collapsed",
2628
- onClick: () => onItemSelect?.(item, sectionId)
2647
+ onClick: () => onItemSelect?.(item, sectionId),
2648
+ moreIcon,
2649
+ onMoreClick: onMoreClick ? () => onMoreClick(item, sectionId) : void 0
2629
2650
  },
2630
2651
  item.id
2631
2652
  );
@@ -2636,7 +2657,10 @@ function StreamoidSidebar({
2636
2657
  config,
2637
2658
  iconMap,
2638
2659
  activeItemId,
2660
+ highlightedItemIds,
2639
2661
  onItemSelect,
2662
+ moreIcon,
2663
+ onMoreClick,
2640
2664
  expandedLogo,
2641
2665
  collapsedLogo,
2642
2666
  profile,
@@ -2644,9 +2668,13 @@ function StreamoidSidebar({
2644
2668
  toggleIcon,
2645
2669
  hideFooter = false,
2646
2670
  preFooterContent,
2671
+ bodyContent,
2672
+ showBody = false,
2673
+ isMobile = false,
2647
2674
  className,
2648
2675
  style
2649
2676
  }) {
2677
+ const effectiveHideFooter = hideFooter || isMobile;
2650
2678
  if (expanded) {
2651
2679
  return /* @__PURE__ */ jsx39(
2652
2680
  "div",
@@ -2661,7 +2689,7 @@ function StreamoidSidebar({
2661
2689
  backgroundColor: "var(--alias-surface-base)",
2662
2690
  borderRadius: "var(--radius-3xl)",
2663
2691
  padding: "var(--spacing-md)",
2664
- paddingBottom: hideFooter ? "var(--spacing-md)" : void 0,
2692
+ paddingBottom: effectiveHideFooter ? "var(--spacing-md)" : void 0,
2665
2693
  width: 256,
2666
2694
  gap: "var(--spacing-xxs)"
2667
2695
  },
@@ -2683,23 +2711,44 @@ function StreamoidSidebar({
2683
2711
  className: "flex flex-col flex-1 items-start min-h-0 w-full overflow-y-auto sidebar-scroll",
2684
2712
  style: { gap: "var(--spacing-xxs)" },
2685
2713
  children: [
2686
- expandedLogo,
2687
- config.topItem && /* @__PURE__ */ jsx39(
2688
- "div",
2689
- {
2690
- className: "flex flex-col items-start shrink-0 w-full",
2691
- style: { padding: "var(--spacing-md) 0" },
2692
- children: renderMenuItem({
2693
- item: config.topItem,
2694
- sectionId: "top",
2695
- expanded: true,
2696
- activeItemId,
2697
- iconMap,
2698
- onItemSelect
2699
- })
2700
- }
2701
- ),
2702
- config.sections.map((section) => /* @__PURE__ */ jsxs31(
2714
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between w-full shrink-0", children: [
2715
+ /* @__PURE__ */ jsx39("div", { className: "min-w-0 flex-1", children: expandedLogo }),
2716
+ isMobile ? /* @__PURE__ */ jsx39(
2717
+ "div",
2718
+ {
2719
+ className: "flex items-center cursor-pointer shrink-0",
2720
+ style: {
2721
+ padding: "var(--spacing-md)",
2722
+ borderRadius: "var(--radius-3xl)"
2723
+ },
2724
+ onClick: onToggle,
2725
+ children: resolveToggleIcon(toggleIcon, true)
2726
+ }
2727
+ ) : null
2728
+ ] }),
2729
+ config.topItem && /* @__PURE__ */ jsxs31(Fragment14, { children: [
2730
+ /* @__PURE__ */ jsx39(HDivider, {}),
2731
+ /* @__PURE__ */ jsx39(
2732
+ "div",
2733
+ {
2734
+ className: "flex flex-col items-start shrink-0 w-full",
2735
+ style: { padding: "var(--spacing-md) 0" },
2736
+ children: renderMenuItem({
2737
+ item: config.topItem,
2738
+ sectionId: "top",
2739
+ expanded: true,
2740
+ activeItemId,
2741
+ highlightedItemIds,
2742
+ iconMap,
2743
+ onItemSelect,
2744
+ moreIcon,
2745
+ onMoreClick
2746
+ })
2747
+ }
2748
+ ),
2749
+ /* @__PURE__ */ jsx39(HDivider, {})
2750
+ ] }),
2751
+ showBody && bodyContent ? /* @__PURE__ */ jsx39("div", { className: "flex flex-col flex-1 min-h-0 w-full overflow-hidden", children: bodyContent }) : /* @__PURE__ */ jsx39(Fragment14, { children: config.sections.map((section) => /* @__PURE__ */ jsxs31(
2703
2752
  "div",
2704
2753
  {
2705
2754
  className: "flex flex-col items-start shrink-0 w-full",
@@ -2722,10 +2771,11 @@ function StreamoidSidebar({
2722
2771
  ]
2723
2772
  },
2724
2773
  section.id
2725
- ))
2774
+ )) })
2726
2775
  ]
2727
2776
  }
2728
2777
  ),
2778
+ preFooterContent,
2729
2779
  config.bottomItems?.length ? /* @__PURE__ */ jsx39(
2730
2780
  "div",
2731
2781
  {
@@ -2743,7 +2793,6 @@ function StreamoidSidebar({
2743
2793
  )
2744
2794
  }
2745
2795
  ) : null,
2746
- preFooterContent,
2747
2796
  /* @__PURE__ */ jsx39(HDivider, {}),
2748
2797
  profile ? /* @__PURE__ */ jsxs31(Fragment14, { children: [
2749
2798
  /* @__PURE__ */ jsxs31(
@@ -2751,8 +2800,7 @@ function StreamoidSidebar({
2751
2800
  {
2752
2801
  className: "flex items-center shrink-0 w-full cursor-pointer",
2753
2802
  style: {
2754
- padding: "var(--spacing-md)",
2755
- marginTop: "var(--spacing-md)",
2803
+ padding: "var(--spacing-md) var(--spacing-xl)",
2756
2804
  gap: "var(--spacing-md)",
2757
2805
  borderRadius: "var(--radius-xl)"
2758
2806
  },
@@ -2786,18 +2834,15 @@ function StreamoidSidebar({
2786
2834
  ]
2787
2835
  }
2788
2836
  ),
2789
- !hideFooter && /* @__PURE__ */ jsxs31(Fragment14, { children: [
2790
- /* @__PURE__ */ jsx39("div", { style: { marginTop: "var(--spacing-md)" } }),
2791
- /* @__PURE__ */ jsx39(HDivider, {})
2792
- ] })
2837
+ !effectiveHideFooter && /* @__PURE__ */ jsx39(Fragment14, { children: /* @__PURE__ */ jsx39(HDivider, {}) })
2793
2838
  ] }) : null,
2794
- !hideFooter && /* @__PURE__ */ jsx39("div", { className: "shrink-0 w-full", children: /* @__PURE__ */ jsx39("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsxs31(
2839
+ !effectiveHideFooter && /* @__PURE__ */ jsx39("div", { className: "shrink-0 w-full", children: /* @__PURE__ */ jsx39("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsxs31(
2795
2840
  "div",
2796
2841
  {
2797
2842
  className: "flex items-center w-full",
2798
2843
  style: {
2799
2844
  gap: "var(--spacing-xs)",
2800
- padding: "var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-3xl)"
2845
+ padding: "var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-xl)"
2801
2846
  },
2802
2847
  children: [
2803
2848
  /* @__PURE__ */ jsx39(
@@ -2872,14 +2917,17 @@ function StreamoidSidebar({
2872
2917
  sectionId: "top",
2873
2918
  expanded: false,
2874
2919
  activeItemId,
2920
+ highlightedItemIds,
2875
2921
  iconMap,
2876
- onItemSelect
2922
+ onItemSelect,
2923
+ moreIcon,
2924
+ onMoreClick
2877
2925
  })
2878
2926
  }
2879
2927
  ),
2880
2928
  /* @__PURE__ */ jsx39(HDivider, {})
2881
2929
  ] }) : null,
2882
- config.sections.map((section, sectionIndex) => /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center w-full", children: [
2930
+ showBody && bodyContent ? /* @__PURE__ */ jsx39("div", { className: "flex flex-col items-center w-full", children: bodyContent }) : config.sections.map((section, sectionIndex) => /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center w-full", children: [
2883
2931
  /* @__PURE__ */ jsx39(
2884
2932
  "div",
2885
2933
  {
@@ -2894,8 +2942,11 @@ function StreamoidSidebar({
2894
2942
  sectionId: section.id,
2895
2943
  expanded: false,
2896
2944
  activeItemId,
2945
+ highlightedItemIds,
2897
2946
  iconMap,
2898
- onItemSelect
2947
+ onItemSelect,
2948
+ moreIcon,
2949
+ onMoreClick
2899
2950
  })
2900
2951
  )
2901
2952
  }
@@ -2905,6 +2956,7 @@ function StreamoidSidebar({
2905
2956
  ]
2906
2957
  }
2907
2958
  ),
2959
+ preFooterContent,
2908
2960
  config.bottomItems?.length ? /* @__PURE__ */ jsx39(
2909
2961
  "div",
2910
2962
  {
@@ -2916,8 +2968,11 @@ function StreamoidSidebar({
2916
2968
  sectionId: "bottom",
2917
2969
  expanded: false,
2918
2970
  activeItemId,
2971
+ highlightedItemIds,
2919
2972
  iconMap,
2920
- onItemSelect
2973
+ onItemSelect,
2974
+ moreIcon,
2975
+ onMoreClick
2921
2976
  })
2922
2977
  )
2923
2978
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/ui",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",