pixelize-design-library 1.1.42 → 1.1.44

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.
@@ -41,9 +41,9 @@ var framer_motion_1 = require("framer-motion");
41
41
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
42
42
  var MotionBox = (0, framer_motion_1.motion)((0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(react_2.Box, __assign({ ref: ref }, props))); }));
43
43
  var Dropdown = (0, react_1.forwardRef)(function (_a, ref) {
44
- var dropDownButtonStyle = _a.dropDownButtonStyle, ButtonText = _a.ButtonText, options = _a.options, handleOptionSelect = _a.handleOptionSelect, _b = _a.dropdownType, dropdownType = _b === void 0 ? "button" : _b, text = _a.text, DropdownIcon = _a.DropdownIcon, _c = _a.isVisibleIconShow, isVisibleIconShow = _c === void 0 ? true : _c, buttonProps = _a.buttonProps, headStyle = _a.headStyle, ListStyle = _a.ListStyle, ItemStyle = _a.ItemStyle, LabelStyle = _a.LabelStyle, ImageStyle = _a.ImageStyle;
44
+ var dropDownButtonStyle = _a.dropDownButtonStyle, ButtonText = _a.ButtonText, options = _a.options, handleOptionSelect = _a.handleOptionSelect, _b = _a.dropdownType, dropdownType = _b === void 0 ? "button" : _b, text = _a.text, DropdownIcon = _a.DropdownIcon, _c = _a.isVisibleIconShow, isVisibleIconShow = _c === void 0 ? true : _c, buttonProps = _a.buttonProps, headStyle = _a.headStyle, ListStyle = _a.ListStyle, ItemStyle = _a.ItemStyle, LabelStyle = _a.LabelStyle, ImageStyle = _a.ImageStyle, _d = _a.optionsSize, optionsSize = _d === void 0 ? "lg" : _d, _e = _a.divider, divider = _e === void 0 ? false : _e;
45
45
  var theme = (0, useCustomTheme_1.useCustomTheme)();
46
- var _d = (0, react_2.useDisclosure)(), isOpen = _d.isOpen, onToggle = _d.onToggle, onClose = _d.onClose;
46
+ var _f = (0, react_2.useDisclosure)(), isOpen = _f.isOpen, onToggle = _f.onToggle, onClose = _f.onClose;
47
47
  var dropdownRef = (0, react_1.useRef)(null);
48
48
  var handleListItemClick = function (optionId, optionLabel) {
49
49
  onClose();
@@ -74,9 +74,20 @@ var Dropdown = (0, react_1.forwardRef)(function (_a, ref) {
74
74
  return dropdownType === "button" ? ButtonToggle : TextToggle;
75
75
  };
76
76
  var DropdownContentRender = function () {
77
- return (react_1.default.createElement(react_2.List, { bg: "white", border: "1px solid", borderColor: "blue.500", shadow: "md", p: 2, mt: 2, minWidth: "200px", style: ListStyle }, options.map(function (option) { return (react_1.default.createElement(react_2.ListItem, { key: option.id, onClick: function () { return handleListItemClick(option.id, option.label); }, p: 2, _hover: { bg: "gray.100", color: "blue.500" }, display: "flex", alignItems: "center", cursor: "pointer", style: ItemStyle },
78
- (option === null || option === void 0 ? void 0 : option.image) && (react_1.default.createElement(react_2.Icon, { as: option.image, boxSize: "1.5rem", mr: 2, style: ImageStyle })),
79
- react_1.default.createElement(react_2.Box, { as: "span", isTruncated: true, style: LabelStyle }, option.label))); })));
77
+ var _a, _b, _c;
78
+ return (react_1.default.createElement(react_2.List, { bg: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.light, border: "1px solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]), borderRadius: theme.radii.md, shadow: theme.shadows.lg, py: 2, mt: "0.2rem", minWidth: "200px", style: ListStyle }, options.map(function (option) {
79
+ var _a;
80
+ return (react_1.default.createElement(react_2.ListItem, { key: option.id, onClick: function () { return handleListItemClick(option.id, option.label); }, p: optionsSize === "sm" ? 1 : 2, px: 2, _hover: {
81
+ bg: theme.colors.gray[100],
82
+ color: theme.colors.blue[500],
83
+ }, display: "flex", alignItems: "center", cursor: "pointer", style: ItemStyle, borderBottom: divider ? "1px solid ".concat((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray[300]) : undefined, sx: {
84
+ "&:last-child": {
85
+ borderBottom: "none",
86
+ },
87
+ } },
88
+ (option === null || option === void 0 ? void 0 : option.image) && (react_1.default.createElement(react_2.Icon, { as: option.image, boxSize: optionsSize === "sm" ? "1.1rem" : "1.5rem", mr: 2, style: ImageStyle })),
89
+ react_1.default.createElement(react_2.Box, { as: "span", fontSize: optionsSize === "sm" ? "14px" : "16px", isTruncated: true, style: LabelStyle }, option.label)));
90
+ })));
80
91
  };
81
92
  return (react_1.default.createElement(react_2.Box, { ref: dropdownRef, position: "relative", display: "inline-block" },
82
93
  dropDownToggleOption(),
@@ -15,6 +15,8 @@ export type DropdownProps = {
15
15
  ItemStyle?: React.CSSProperties;
16
16
  LabelStyle?: React.CSSProperties;
17
17
  ImageStyle?: React.CSSProperties;
18
+ optionsSize?: "sm" | "md";
19
+ divider?: boolean;
18
20
  };
19
21
  type Option = {
20
22
  id: string | number;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { NavbarProps } from "./NavigationBarProps";
3
- export default function NavBar({ userAvathar, userName, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText }: NavbarProps): React.JSX.Element;
3
+ export default function NavBar({ userAvathar, userName, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText, }: NavbarProps): React.JSX.Element;
@@ -12,10 +12,10 @@ function NavBar(_a) {
12
12
  return (react_1.default.createElement(react_2.Box, { bg: theme.colors.backgroundColor.light, px: 4, boxShadow: theme.shadows.sm },
13
13
  react_1.default.createElement(react_2.Flex, { h: 16, alignItems: "center", justifyContent: "space-between" },
14
14
  react_1.default.createElement(react_2.Box, null, navigationBarText),
15
- react_1.default.createElement(react_2.Flex, { alignItems: "center" },
16
- react_1.default.createElement(react_2.Stack, { direction: "row", spacing: 7 },
15
+ react_1.default.createElement(react_2.Flex, null,
16
+ react_1.default.createElement(react_2.Stack, { direction: "row", alignItems: "center", spacing: 7 },
17
17
  react_1.default.createElement(react_2.Menu, null,
18
- react_1.default.createElement(react_2.Box, { mt: "0.4rem", cursor: "pointer" }, moreIcon),
18
+ react_1.default.createElement(react_2.Box, { cursor: "pointer" }, moreIcon),
19
19
  react_1.default.createElement(react_2.MenuButton, { as: react_2.Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0 },
20
20
  react_1.default.createElement(react_2.Avatar, { size: "sm", name: userName, src: userAvathar })),
21
21
  react_1.default.createElement(react_2.MenuList, { alignItems: "center", zIndex: 5 },
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  declare const DropdownPage: () => React.JSX.Element;
3
3
  export default DropdownPage;
@@ -15,10 +15,10 @@ var DropdownPage = function () {
15
15
  { id: 5, label: "Link(URL)", image: fi_1.FiChevronUp },
16
16
  ];
17
17
  return (react_1.default.createElement("div", null,
18
- react_1.default.createElement(DropDown_1.default, { ButtonText: "hello", options: exportOptionss,
18
+ react_1.default.createElement(DropDown_1.default, { ButtonText: "hello", optionsSize: "sm", options: exportOptionss,
19
19
  // dropDownButtonStyle={{ color: "red" }}
20
20
  DropdownIcon: react_1.default.createElement(fi_1.FiMoreHorizontal, { color: "gray.500" }), dropdownType: "button", handleOptionSelect: function (id, label) {
21
21
  console.log("optionid", id, label);
22
- }, buttonProps: { variant: "solid", colorScheme: "red" }, isVisibleIconShow: true })));
22
+ }, buttonProps: { variant: "solid", colorScheme: "red" }, isVisibleIconShow: true, divider: true })));
23
23
  };
24
24
  exports.default = DropdownPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.42",
3
+ "version": "1.1.44",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",