@beydesign/storybook 0.0.23 → 0.0.24

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.
@@ -27,20 +27,26 @@ const StyledSidebar = styled.div `
27
27
  position: relative;
28
28
  padding: 24px 0;
29
29
  `;
30
+ const SidebarContainer = styled.div `
31
+ position: relative;
32
+ height: 100%;
33
+ `;
30
34
  const LogoContainer = styled.div `
31
35
  display: flex;
32
36
  justify-content: ${({ $size }) => $size === SidebarSize.Expanded ? 'flex-start' : 'center'};
33
37
  padding: ${({ $size }) => ($size === SidebarSize.Expanded ? '0 24px' : '0')};
34
38
  margin-bottom: 32px;
35
39
  height: 38px;
36
- position: relative;
37
40
  `;
38
41
  const ToggleButtonWrapper = styled.div `
39
42
  position: absolute;
40
- top: 0.2rem;
41
- right: -1rem;
42
- z-index: 10;
43
- transform: translateZ(0);
43
+ top: 62px;
44
+ right: -12px;
45
+ z-index: 1000;
46
+ pointer-events: auto;
47
+ visibility: visible;
48
+ filter: drop-shadow(0px 2px 4px rgba(29, 20, 40, 0.08));
49
+ contain: layout;
44
50
  `;
45
51
  const NavItemsContainer = styled.div `
46
52
  display: flex;
@@ -95,11 +101,12 @@ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSectio
95
101
  }
96
102
  };
97
103
  const isCollapsed = sidebarSize === SidebarSize.Collapsed;
98
- return (_jsxs(StyledSidebar, { "$size": sidebarSize, className: className, children: [_jsxs(LogoContainer, { "$size": sidebarSize, children: [_jsx(Logo, { variant: isCollapsed ? LogoVariant.Icon : LogoVariant.Horizontal, color: logoProps.color, gradient: logoProps.gradient }), _jsx(ToggleButtonWrapper, { children: isCollapsed ? (_jsx(MainButton, { text: "Expand", size: ButtonSize.xxs, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretRight", onClick: handleToggle, shape: ButtonShape.Circle, hierarchy: ButtonHierarchy.Tetriary, style: {
99
- boxShadow: '2px 4px 8px 0px #1D142814',
100
- } })) : (_jsx(MainButton, { size: ButtonSize.xxs, text: "Collapse", hierarchy: ButtonHierarchy.Tetriary, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretLeft", onClick: handleToggle, style: {
101
- boxShadow: '2px 4px 8px 0px #1D142814',
102
- }, shape: ButtonShape.Circle })) })] }), _jsx(NavItemsContainer, { children: navSections.map((section, sectionIndex) => (_jsxs(React.Fragment, { children: [_jsxs(NavSection, { children: [section.title && (_jsx(SectionTitle, { "$size": sidebarSize, children: _jsx(Typography, { text: section.title, size: TypographySize.TextS, weight: TypographyWeight.Regular, color: "var(--primitives-desktop-primary-gray-700)" }) })), section.items.map((item, itemIndex) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `${item.text}-${itemIndex}`)))] }), section.showSeparator && sectionIndex < navSections.length - 1 && (_jsx(Separator, {}))] }, `section-${sectionIndex}`))) }), _jsx(BottomContainer, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "16px", children: [credits && (_jsx(CreditsCard, { size: isCollapsed
103
- ? CreditsCardSize.Collapsed
104
- : CreditsCardSize.Expanded, maxCredits: credits.maxCredits, usedCredits: credits.usedCredits, creditInfoText: credits.creditInfoText, onUpgradeClick: credits.onUpgradeClick })), bottomNavItems.map((item, index) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `bottom-${item.text}-${index}`)))] }) })] }));
104
+ return (_jsxs(SidebarContainer, { className: className, children: [_jsxs(StyledSidebar, { "$size": sidebarSize, children: [_jsx(LogoContainer, { "$size": sidebarSize, children: _jsx(Logo, { variant: isCollapsed ? LogoVariant.Icon : LogoVariant.Horizontal, color: logoProps.color, gradient: logoProps.gradient }) }), _jsx(NavItemsContainer, { children: navSections.map((section, sectionIndex) => (_jsxs(React.Fragment, { children: [_jsxs(NavSection, { children: [section.title && (_jsx(SectionTitle, { "$size": sidebarSize, children: _jsx(Typography, { text: section.title, size: TypographySize.TextS, weight: TypographyWeight.Regular, color: "var(--primitives-desktop-primary-gray-700)" }) })), section.items.map((item, itemIndex) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `${item.text}-${itemIndex}`)))] }), sectionIndex < navSections.length - 1 &&
105
+ section.showSeparator && _jsx(Separator, {})] }, `section-${sectionIndex}`))) }), _jsx(BottomContainer, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "16px", children: [credits && (_jsx(CreditsCard, { size: isCollapsed
106
+ ? CreditsCardSize.Collapsed
107
+ : CreditsCardSize.Expanded, maxCredits: credits.maxCredits, usedCredits: credits.usedCredits, creditInfoText: credits.creditInfoText, onUpgradeClick: credits.onUpgradeClick })), bottomNavItems.map((item, index) => (_jsx(NavItemWrapper, { item: item, isCollapsed: isCollapsed }, `bottom-${item.text}-${index}`)))] }) })] }), _jsx(ToggleButtonWrapper, { children: isCollapsed ? (_jsx(MainButton, { text: "Expand", size: ButtonSize.xxs, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretRight", onClick: handleToggle, shape: ButtonShape.Circle, hierarchy: ButtonHierarchy.Tetriary, style: {
108
+ boxShadow: '2px 4px 8px 0px #1D142814',
109
+ } })) : (_jsx(MainButton, { size: ButtonSize.xxs, text: "Collapse", hierarchy: ButtonHierarchy.Tetriary, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretLeft", onClick: handleToggle, style: {
110
+ boxShadow: '2px 4px 8px 0px #1D142814',
111
+ }, shape: ButtonShape.Circle })) })] }));
105
112
  };
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof Sidebar>;
6
6
  export declare const Expanded: Story;
7
7
  export declare const Collapsed: Story;
8
8
  export declare const WithoutCredits: Story;
9
+ export declare const InBoxContainer: Story;
9
10
  export declare const CustomSections: Story;
@@ -1,6 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Sidebar } from './Sidebar';
2
3
  import { SidebarSize } from './types/sidebar';
3
4
  import { NavItemState } from './types/nav-item';
5
+ import { Box } from '@mui/material';
4
6
  const meta = {
5
7
  title: 'Design System/Components/Sidebar',
6
8
  component: Sidebar,
@@ -142,6 +144,18 @@ export const WithoutCredits = {
142
144
  bottomNavItems: defaultBottomNavItems,
143
145
  },
144
146
  };
147
+ export const InBoxContainer = {
148
+ render: (args) => (_jsx(Box, { height: '100%', display: 'flex', flexDirection: 'column', justifyContent: 'space-between', sx: {
149
+ border: '1px solid var(--colors-light-border-border-default)',
150
+ borderRadius: '8px',
151
+ boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
152
+ maxWidth: '280px',
153
+ }, children: _jsx(Sidebar, { ...args, size: SidebarSize.Expanded, navSections: defaultNavSections.slice(0, 3), bottomNavItems: defaultBottomNavItems, credits: {
154
+ maxCredits: 50,
155
+ usedCredits: 10,
156
+ creditInfoText: '1 Credit = 1 min video',
157
+ } }) })),
158
+ };
145
159
  export const CustomSections = {
146
160
  args: {
147
161
  size: SidebarSize.Expanded,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.0.23",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",