sy-ui-lib 1.0.8 → 1.0.10

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.
@@ -7,15 +7,31 @@ import { MenuProps } from './Menu.types';
7
7
  *
8
8
  * @param {MenuItemProps[]} items - Array of menu items to render.
9
9
  * @param {LastItemsProps} [lastItem] - Optional last item with text, icon, and click handler.
10
+ * @param {"default" | "action"} [variant="default"] - Controls menu width and item layout.
10
11
  *
11
- * Example usage:
12
+ * @example:
12
13
  * <Menu
14
+ * variant="default"
13
15
  * items={[
14
16
  * { text: "Profile", onClick: () => {} },
15
17
  * { text: "Settings", onClick: () => {} },
16
18
  * ]}
17
19
  * lastItem={{ text: "Logout", iconName: "logout", onClick: () => console.log("Logout clicked") }}
18
20
  * />
21
+ *
22
+ * @example:
23
+ * <Menu
24
+ * variant="action"
25
+ * items={[
26
+ * { text: "Profile", onClick: () => {}, iconName="delete" },
27
+ * { text: "Settings", onClick: () => {}, iconName="delete" },
28
+ * ]}
29
+ * lastItem={{
30
+ * text: "Logout",
31
+ * iconName: "logout",
32
+ * onClick: () => console.log("Logout clicked")
33
+ * }}
34
+ * />
19
35
  */
20
36
  declare const Menu: React.FC<MenuProps>;
21
37
  export default Menu;
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof Menu>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithoutLastItem: Story;
8
+ export declare const Action: Story;
@@ -1,10 +1,16 @@
1
1
  import { IconName } from '../Icon';
2
+ /** Supported variants for the Menu component */
3
+ export type MenuVariant = "default" | "action";
2
4
  /** Props for each individual menu item*/
3
5
  export interface MenuItemProps {
4
6
  /** Text label to display in the menu item*/
5
7
  text: string;
6
8
  /** Function called when this menu item is clicked*/
7
9
  onClick: () => void;
10
+ /** Optional icon displayed on the menu. */
11
+ iconName?: IconName;
12
+ /** Controls the layout and behavior of the menuItem */
13
+ variant?: MenuVariant;
8
14
  }
9
15
  /** Props for the "last item" in the menu (like a logout button)*/
10
16
  export interface LastItemsProps {
@@ -21,4 +27,6 @@ export interface MenuProps {
21
27
  items: MenuItemProps[];
22
28
  /** Optional last item (e.g., logout) at the bottom of the menu*/
23
29
  lastItem?: LastItemsProps;
30
+ /** Controls the layout and behavior of the menu */
31
+ variant?: MenuVariant;
24
32
  }