@beydesign/storybook 0.0.86 → 0.0.88

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.
@@ -24,6 +24,10 @@ const StyledButton = styled.button `
24
24
  if (props.$state === ButtonState.Disabled || props.$disabled)
25
25
  return 'var(--colors-light-background-bg-button-disabled)';
26
26
  return 'var(--colors-light-background-bg-brand)';
27
+ case ButtonHierarchy.PrimaryLemon:
28
+ if (props.$state === ButtonState.Disabled || props.$disabled)
29
+ return 'var(--colors-light-background-bg-element)';
30
+ return 'var(--primitives-desktop-primary-brand-lemon-400)';
27
31
  case ButtonHierarchy.Secondary:
28
32
  if (props.$state === ButtonState.Disabled || props.$disabled)
29
33
  return 'var(--colors-light-background-bg-component-disabled)';
@@ -59,6 +63,10 @@ const StyledButton = styled.button `
59
63
  if (props.$state === ButtonState.Disabled || props.$disabled)
60
64
  return 'var(--colors-light-text-text-white)';
61
65
  return 'var(--colors-light-text-text-white)';
66
+ case ButtonHierarchy.PrimaryLemon:
67
+ if (props.$state === ButtonState.Disabled || props.$disabled)
68
+ return 'var(--colors-light-text-text-subtle)';
69
+ return 'var(--colors-light-text-text-title)';
62
70
  case ButtonHierarchy.Secondary:
63
71
  if (props.$state === ButtonState.Disabled || props.$disabled)
64
72
  return 'var(--colors-light-text-text-disabled)';
@@ -95,6 +103,10 @@ const StyledButton = styled.button `
95
103
  if (props.$state === ButtonState.Disabled || props.$disabled)
96
104
  return 'var(--colors-light-border-border-component)';
97
105
  return 'var(--colors-light-background-bg-brand)';
106
+ case ButtonHierarchy.PrimaryLemon:
107
+ if (props.$state === ButtonState.Disabled || props.$disabled)
108
+ return 'var(--colors-light-border-border-component)';
109
+ return 'var(--primitives-desktop-primary-brand-lemon-400)';
98
110
  case ButtonHierarchy.Secondary:
99
111
  if (props.$state === ButtonState.Disabled || props.$disabled)
100
112
  return 'var(--colors-light-border-border-component)';
@@ -141,6 +153,8 @@ const StyledButton = styled.button `
141
153
  switch (props.$hierarchy) {
142
154
  case ButtonHierarchy.Primary:
143
155
  return 'var(--colors-light-background-bg-brand-hover)';
156
+ case ButtonHierarchy.PrimaryLemon:
157
+ return 'var(--primitives-desktop-primary-brand-lemon-500)';
144
158
  case ButtonHierarchy.Secondary:
145
159
  return 'var(--colors-light-background-bg-card-highlight-hover)';
146
160
  case ButtonHierarchy.SecondaryColor:
@@ -162,6 +176,8 @@ const StyledButton = styled.button `
162
176
  switch (props.$hierarchy) {
163
177
  case ButtonHierarchy.Primary:
164
178
  return 'var(--colors-light-background-bg-brand-hover)';
179
+ case ButtonHierarchy.PrimaryLemon:
180
+ return 'var(--primitives-desktop-primary-brand-lemon-500)';
165
181
  case ButtonHierarchy.Secondary:
166
182
  return 'var(--colors-light-background-bg-card-highlight-hover)';
167
183
  case ButtonHierarchy.SecondaryColor:
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof MainButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof MainButton>;
6
6
  export declare const Primary: Story;
7
+ export declare const PrimaryLemon: Story;
7
8
  export declare const Secondary: Story;
8
9
  export declare const SecondaryColor: Story;
9
10
  export declare const SecondaryTransparent: Story;
@@ -32,6 +32,7 @@ const meta = {
32
32
  control: 'select',
33
33
  options: [
34
34
  'Primary',
35
+ 'Primary-lemon',
35
36
  'Secondary',
36
37
  'Secondary-color',
37
38
  'Secondary-transparent',
@@ -144,6 +145,12 @@ export const Primary = {
144
145
  trailingIcon: 'Circle',
145
146
  },
146
147
  };
148
+ export const PrimaryLemon = {
149
+ args: {
150
+ ...Primary.args,
151
+ hierarchy: ButtonHierarchy.PrimaryLemon,
152
+ },
153
+ };
147
154
  export const Secondary = {
148
155
  args: {
149
156
  ...Primary.args,
@@ -18,6 +18,7 @@ export declare enum ButtonSize {
18
18
  */
19
19
  export declare enum ButtonHierarchy {
20
20
  Primary = "Primary",
21
+ PrimaryLemon = "Primary-lemon",
21
22
  Secondary = "Secondary",
22
23
  SecondaryColor = "Secondary-color",
23
24
  SecondaryTransparent = "Secondary-transparent",
@@ -16,6 +16,7 @@ export var ButtonSize;
16
16
  export var ButtonHierarchy;
17
17
  (function (ButtonHierarchy) {
18
18
  ButtonHierarchy["Primary"] = "Primary";
19
+ ButtonHierarchy["PrimaryLemon"] = "Primary-lemon";
19
20
  ButtonHierarchy["Secondary"] = "Secondary";
20
21
  ButtonHierarchy["SecondaryColor"] = "Secondary-color";
21
22
  ButtonHierarchy["SecondaryTransparent"] = "Secondary-transparent";
@@ -52,7 +52,7 @@ export const CreditsCard = ({ size = CreditsCardSize.Expanded, className, maxCre
52
52
  if (onUpgradeClick) {
53
53
  onUpgradeClick();
54
54
  }
55
- } })] }), case1 && (_jsx(CreditRow, { children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `Overused: ${overUsedCredits}` }) }) }) })), _jsx(CreditRow, { style: { justifyContent: 'end' }, children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--colors-light-text-text-subtle)", children: creditInfoText }) }) }) })] })), isCollapsed && maxCredits !== undefined && usedCredits !== undefined && (_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", alignItems: "center", justifyContent: "center", children: [case2 && (_jsx(CreditRow, { "$collapsed": true, children: _jsxs(Box, { display: "flex", flexDirection: "row", gap: "2px", children: [_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${usedCredits}/` }) }), _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-paragraph)", children: `${maxCredits}` }) })] }) })), case3 && (_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", textStyle: { textOverflow: 'ellipsis' }, title: "Credits Limit Reached", children: "Credits..." }) })), case1 && (_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${overUsedCredits}` }) })), _jsx(Box, { onClick: (e) => e.stopPropagation(), children: _jsx(MainButton, { text: "Upgrade", hierarchy: ButtonHierarchy.TetriaryColor, size: ButtonSize.md, style: { padding: '0' }, onClick: () => {
55
+ } })] }), case1 && (_jsx(CreditRow, { children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `Overused: ${overUsedCredits}` }) }) }) })), _jsx(CreditRow, { style: { justifyContent: 'end' }, children: _jsx(Box, { display: "flex", flexDirection: "row", children: _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextXS, weight: TypographyWeight.Regular, color: "var(--colors-light-text-text-subtle)", children: creditInfoText }) }) }) })] })), isCollapsed && maxCredits !== undefined && usedCredits !== undefined && (_jsxs(Box, { display: "flex", flexDirection: "column", gap: "var(--spacing-tokens-size-in-px-spacing-spacing-md)", alignItems: "center", justifyContent: "center", children: [case2 && (_jsx(CreditRow, { "$collapsed": true, children: _jsxs(Box, { display: "flex", flexDirection: "row", gap: "2px", children: [_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${usedCredits}/` }) }), _jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-paragraph)", children: `${maxCredits}` }) })] }) })), case3 && (_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextM, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", textStyle: { textOverflow: 'ellipsis' }, title: "Credits Limit Reached", children: "Cred..." }) })), case1 && (_jsx(TextWrapper, { children: _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "var(--colors-light-text-text-title)", children: `${overUsedCredits}` }) })), _jsx(Box, { onClick: (e) => e.stopPropagation(), children: _jsx(MainButton, { text: "Upgrade", hierarchy: ButtonHierarchy.TetriaryColor, size: ButtonSize.md, style: { padding: '0' }, onClick: () => {
56
56
  if (onUpgradeClick) {
57
57
  onUpgradeClick();
58
58
  }
@@ -90,9 +90,7 @@ const NavItemWrapper = ({ item, isCollapsed, }) => {
90
90
  };
91
91
  return (_jsx(NavItem, { text: item.text, icon: item.icon, state: item.state || NavItemState.Default, size: isCollapsed ? NavItemSize.Collapsed : NavItemSize.Expanded, showBadge: isCollapsed ? false : item.showBadge, onClick: handleClick }));
92
92
  };
93
- export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSections, bottomNavItems = [], credits, onToggle, logoProps = {
94
- color: 'var(--primitives-desktop-primary-brand-violet-950)',
95
- }, }) => {
93
+ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSections, bottomNavItems = [], credits, onToggle, logoProps = { color: 'var(--primitives-desktop-primary-brand-violet-950)' }, }) => {
96
94
  const [sidebarSize, setSidebarSize] = useState(size);
97
95
  const handleToggle = () => {
98
96
  const newSize = sidebarSize === SidebarSize.Expanded
@@ -113,7 +111,7 @@ export const Sidebar = ({ size = SidebarSize.Expanded, className = '', navSectio
113
111
  padding: isCollapsed ? '8px' : '0px 12px',
114
112
  }, children: _jsx(CreditsCard, { size: isCollapsed
115
113
  ? CreditsCardSize.Collapsed
116
- : 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: {
114
+ : CreditsCardSize.Expanded, maxCredits: credits.maxCredits, usedCredits: credits.usedCredits, creditInfoText: credits.creditInfoText, onUpgradeClick: credits.onUpgradeClick, overUsageEnabled: credits.overUsageEnabled, overUsedCredits: credits.overUsedCredits }) })), 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: {
117
115
  boxShadow: '2px 4px 8px 0px #1D142814',
118
116
  } })) : (_jsx(MainButton, { size: ButtonSize.xxs, text: "Collapse", hierarchy: ButtonHierarchy.Tetriary, displayIconMode: ButtonDisplayMode.Only, displayIcon: "CaretLeft", onClick: handleToggle, style: {
119
117
  boxShadow: '2px 4px 8px 0px #1D142814',
@@ -120,8 +120,10 @@ export const InBoxContainer = {
120
120
  maxWidth: '280px',
121
121
  }, children: _jsx(Sidebar, { ...args, size: SidebarSize.Expanded, navSections: defaultNavSections.slice(0, 3), bottomNavItems: defaultBottomNavItems, credits: {
122
122
  maxCredits: 50,
123
- usedCredits: 10,
123
+ usedCredits: 130,
124
124
  creditInfoText: '1 Credit = 1 min video',
125
+ overUsageEnabled: true,
126
+ overUsedCredits: 20,
125
127
  } }) }), _jsx(Box, { sx: { height: '100dvh', width: 'calc(100dvw)', overflow: 'hidden' }, children: _jsx(Typography, { children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quos." }) })] })),
126
128
  };
127
129
  export const Expanded = {
@@ -143,8 +145,10 @@ export const Collapsed = {
143
145
  bottomNavItems: defaultBottomNavItems,
144
146
  credits: {
145
147
  maxCredits: 50,
146
- usedCredits: 10,
148
+ usedCredits: 102,
147
149
  creditInfoText: '1 Credit = 1 min video',
150
+ overUsageEnabled: true,
151
+ overUsedCredits: 20,
148
152
  },
149
153
  },
150
154
  };
@@ -153,6 +153,8 @@ export interface SidebarProps {
153
153
  usedCredits: number;
154
154
  creditInfoText?: string;
155
155
  onUpgradeClick?: () => void;
156
+ overUsageEnabled?: boolean;
157
+ overUsedCredits?: number;
156
158
  };
157
159
  /**
158
160
  * Optional callback when sidebar is toggled
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.0.86",
4
+ "version": "0.0.88",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",