sy-ui-lib 1.0.9 → 1.0.11
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/components/Chip/Chip.stories.d.ts +6 -0
- package/dist/components/Chip/Chip.types.d.ts +3 -0
- package/dist/components/Menu/Menu.component.d.ts +17 -1
- package/dist/components/Menu/Menu.stories.d.ts +1 -0
- package/dist/components/Menu/Menu.types.d.ts +8 -0
- package/dist/components/Toggle/Toggle.types.d.ts +1 -0
- package/dist/index.cjs +11 -10
- package/dist/index.css +1 -1
- package/dist/index.js +891 -828
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export type ChipType = "active" | "suspended" | "locked" | "pending" | "info";
|
|
|
5
5
|
export type ChipVariant = "filled" | "outlined";
|
|
6
6
|
/** Defines the available icon colors */
|
|
7
7
|
export type ChipIconColor = "white" | "success" | "error" | "slategray" | "goldenYellow" | "techBlue";
|
|
8
|
+
export type ChipSize = "xs" | "sm" | "md";
|
|
8
9
|
/** Props for the Chip component */
|
|
9
10
|
export interface ChipProps {
|
|
10
11
|
/** Text content to be displayed inside the chip */
|
|
@@ -19,4 +20,6 @@ export interface ChipProps {
|
|
|
19
20
|
onClick?: () => void;
|
|
20
21
|
/** Optional icon to be displayed in future use */
|
|
21
22
|
iconName?: IconName;
|
|
23
|
+
/** Size of the chip, affecting padding and minimum dimensions */
|
|
24
|
+
size?: ChipSize;
|
|
22
25
|
}
|
|
@@ -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
|
-
*
|
|
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;
|
|
@@ -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
|
}
|