@beydesign/storybook 0.0.24 → 0.0.26

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.
@@ -33,6 +33,7 @@ const SidebarContainer = styled.div `
33
33
  `;
34
34
  const LogoContainer = styled.div `
35
35
  display: flex;
36
+ align-items: center;
36
37
  justify-content: ${({ $size }) => $size === SidebarSize.Expanded ? 'flex-start' : 'center'};
37
38
  padding: ${({ $size }) => ($size === SidebarSize.Expanded ? '0 24px' : '0')};
38
39
  margin-bottom: 32px;
@@ -40,9 +41,9 @@ const LogoContainer = styled.div `
40
41
  `;
41
42
  const ToggleButtonWrapper = styled.div `
42
43
  position: absolute;
43
- top: 62px;
44
- right: -12px;
45
- z-index: 1000;
44
+ top: 1.5rem;
45
+ right: -1rem;
46
+ z-index: 1;
46
47
  pointer-events: auto;
47
48
  visibility: visible;
48
49
  filter: drop-shadow(0px 2px 4px rgba(29, 20, 40, 0.08));
@@ -64,7 +65,8 @@ const SectionTitle = styled.div `
64
65
  color: var(--colors-light-text-text-subtle);
65
66
  opacity: 0.5;
66
67
  padding: ${({ $size }) => $size === SidebarSize.Expanded ? '8px 12px' : '8px 0'};
67
- display: ${({ $size }) => $size === SidebarSize.Collapsed ? 'none' : 'block'};
68
+ display: ${({ $size }) => $size === SidebarSize.Collapsed ? 'flex' : 'block'};
69
+ justify-content: ${({ $size }) => $size === SidebarSize.Collapsed ? 'center' : 'flex-start'};
68
70
  `;
69
71
  const Separator = styled.div `
70
72
  height: 0.31px;
@@ -101,7 +103,9 @@ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSectio
101
103
  }
102
104
  };
103
105
  const isCollapsed = sidebarSize === SidebarSize.Collapsed;
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 &&
106
+ 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: isCollapsed && section.title
107
+ ? section.title.split(' ').slice(-1)[0]
108
+ : 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
109
  section.showSeparator && _jsx(Separator, {})] }, `section-${sectionIndex}`))) }), _jsx(BottomContainer, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: "16px", children: [credits && (_jsx(CreditsCard, { size: isCollapsed
106
110
  ? CreditsCardSize.Collapsed
107
111
  : 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: {
@@ -7,4 +7,3 @@ export declare const Expanded: Story;
7
7
  export declare const Collapsed: Story;
8
8
  export declare const WithoutCredits: Story;
9
9
  export declare const InBoxContainer: Story;
10
- export declare const CustomSections: Story;
@@ -156,93 +156,3 @@ export const InBoxContainer = {
156
156
  creditInfoText: '1 Credit = 1 min video',
157
157
  } }) })),
158
158
  };
159
- export const CustomSections = {
160
- args: {
161
- size: SidebarSize.Expanded,
162
- navSections: [
163
- {
164
- title: 'Main Navigation',
165
- items: [
166
- {
167
- text: 'Dashboard',
168
- icon: 'ChartPie',
169
- state: NavItemState.Default,
170
- link: '#/dashboard',
171
- },
172
- {
173
- text: 'Projects',
174
- icon: 'FolderOpen',
175
- state: NavItemState.Active,
176
- link: '#/projects',
177
- },
178
- {
179
- text: 'Calendar',
180
- icon: 'Calendar',
181
- state: NavItemState.Default,
182
- link: '#/calendar',
183
- },
184
- ],
185
- showSeparator: true,
186
- },
187
- {
188
- title: 'Content',
189
- items: [
190
- {
191
- text: 'Media Library',
192
- icon: 'Image',
193
- state: NavItemState.Default,
194
- link: '#/media',
195
- },
196
- {
197
- text: 'Documents',
198
- icon: 'File',
199
- state: NavItemState.Default,
200
- link: '#/documents',
201
- },
202
- ],
203
- showSeparator: true,
204
- },
205
- {
206
- title: 'Settings',
207
- items: [
208
- {
209
- text: 'Account Settings',
210
- icon: 'Gear',
211
- state: NavItemState.Default,
212
- link: '#/settings/account',
213
- },
214
- {
215
- text: 'Team Members',
216
- icon: 'Users',
217
- state: NavItemState.Default,
218
- link: '#/settings/team',
219
- },
220
- {
221
- text: 'Notifications',
222
- icon: 'Bell',
223
- state: NavItemState.Default,
224
- showBadge: true,
225
- link: '#/settings/notifications',
226
- },
227
- ],
228
- },
229
- ],
230
- bottomNavItems: [
231
- {
232
- text: 'Help Center',
233
- icon: 'Question',
234
- link: '#/help',
235
- },
236
- {
237
- text: 'Log Out',
238
- icon: 'SignOut',
239
- onClick: () => alert('Logging out...'),
240
- },
241
- ],
242
- credits: {
243
- maxCredits: 100,
244
- usedCredits: 45,
245
- creditInfoText: '1 Credit = 1 resource',
246
- },
247
- },
248
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.0.24",
4
+ "version": "0.0.26",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",