pixelize-design-library 1.1.54 → 1.1.56

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.
@@ -29,4 +29,5 @@ export type ButtonGroupIconProps = {
29
29
  menulistStyle?: React.CSSProperties;
30
30
  menuItemStyle?: React.CSSProperties;
31
31
  isLoading?: boolean;
32
+ divider?: boolean;
32
33
  };
@@ -2,4 +2,4 @@ import React from "react";
2
2
  import { ButtonGroupIconProps } from "./ButtonGoupIconProps";
3
3
  export default function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
4
4
  onDropdownOptionClick, // New prop to handle option clicks
5
- rightIconDropdown, menulistStyle, menuItemStyle, isLoading, }: ButtonGroupIconProps): React.JSX.Element;
5
+ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider, }: ButtonGroupIconProps): React.JSX.Element;
@@ -27,11 +27,12 @@ var react_1 = __importStar(require("react"));
27
27
  var react_2 = require("@chakra-ui/react");
28
28
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
29
29
  function ButtonGroupIcon(_a) {
30
+ var _b, _c;
30
31
  var leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, onLeftIconClick = _a.onLeftIconClick, onRightIconClick = _a.onRightIconClick, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onButtongroupClick = _a.onButtongroupClick, size = _a.size, variant = _a.variant, color = _a.color, buttonGroupStyle = _a.buttonGroupStyle, buttonGroupLeftIconStyle = _a.buttonGroupLeftIconStyle, buttonGroupRightIconStyle = _a.buttonGroupRightIconStyle, buttonStyle = _a.buttonStyle, onBlurLeftIcon = _a.onBlurLeftIcon, onBlurRightIcon = _a.onBlurRightIcon, dropdownOptions = _a.dropdownOptions, // New prop for dropdown options
31
32
  onDropdownOptionClick = _a.onDropdownOptionClick, // New prop to handle option clicks
32
- rightIconDropdown = _a.rightIconDropdown, menulistStyle = _a.menulistStyle, menuItemStyle = _a.menuItemStyle, isLoading = _a.isLoading;
33
+ rightIconDropdown = _a.rightIconDropdown, menulistStyle = _a.menulistStyle, menuItemStyle = _a.menuItemStyle, isLoading = _a.isLoading, _d = _a.divider, divider = _d === void 0 ? true : _d;
33
34
  var theme = (0, useCustomTheme_1.useCustomTheme)();
34
- var _b = (0, react_1.useState)(false), isDropdownOpen = _b[0], setIsDropdownOpen = _b[1];
35
+ var _e = (0, react_1.useState)(false), isDropdownOpen = _e[0], setIsDropdownOpen = _e[1];
35
36
  var handleRightIconClick = function () {
36
37
  setIsDropdownOpen(!isDropdownOpen);
37
38
  if (onRightIconClick) {
@@ -57,7 +58,7 @@ function ButtonGroupIcon(_a) {
57
58
  "&:hover": {
58
59
  backgroundColor: theme.colors.primary[400],
59
60
  },
60
- } }, buttonText),
61
+ }, borderLeft: "1px solid ".concat((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray[300]), borderRight: "1px solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]) }, buttonText),
61
62
  rightIcon && rightIconDropdown ? (react_1.default.createElement(react_2.Menu, { isOpen: isDropdownOpen, onClose: function () { return setIsDropdownOpen(false); } },
62
63
  react_1.default.createElement(react_2.MenuButton, { as: react_2.IconButton, "aria-label": "Right icon button", icon: rightIcon, onClick: handleRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
63
64
  backgroundColor: theme.colors.primary[500],
@@ -66,9 +67,16 @@ function ButtonGroupIcon(_a) {
66
67
  },
67
68
  } }),
68
69
  react_1.default.createElement(react_2.Box, { sx: { zIndex: 99 } },
69
- react_1.default.createElement(react_2.MenuList, { style: menulistStyle }, dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map(function (option, index) { return (react_1.default.createElement(react_2.MenuItem, { key: index, onClick: function (event) { return handleMenuClick(event, option); }, style: menuItemStyle }, option === null || option === void 0 ? void 0 :
70
- option.image,
71
- option.label)); }))))) : (rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
70
+ react_1.default.createElement(react_2.MenuList, { style: menulistStyle }, dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map(function (option, index) {
71
+ var _a;
72
+ return (react_1.default.createElement(react_2.MenuItem, { key: index, onClick: function (event) { return handleMenuClick(event, option); }, style: menuItemStyle, borderBottom: divider ? "1px solid ".concat((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray[300]) : undefined, sx: {
73
+ "&:last-child": {
74
+ borderBottom: "none",
75
+ },
76
+ } }, option === null || option === void 0 ? void 0 :
77
+ option.image,
78
+ option.label));
79
+ }))))) : (rightIcon && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Right icon button", icon: rightIcon, onClick: onRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
72
80
  backgroundColor: theme.colors.primary[500],
73
81
  "&:hover": {
74
82
  backgroundColor: theme.colors.primary[400],
@@ -210,11 +210,11 @@ function NoteTextArea(_a) {
210
210
  var start = nameWithoutExtension.substring(0, maxLength - extension.length - 3);
211
211
  return "".concat(start, "...").concat(extension, " ");
212
212
  };
213
- return (react_1.default.createElement(Container, { style: { width: width }, isActive: isActive, ref: ref },
213
+ return (react_1.default.createElement(Container, { style: { width: width }, isActive: isActive },
214
214
  react_1.default.createElement(PlaceholderText, { isActive: !isActive, onClick: handleTextArea },
215
215
  react_1.default.createElement("span", null, "Add a note...")),
216
216
  react_1.default.createElement(TextAreaContainer, { isActive: isActive },
217
- titleShow && (react_1.default.createElement(InputTitle, { value: titleValue, onChange: handleTitleChange, placeholder: "Add a title..." })),
217
+ titleShow && (react_1.default.createElement(InputTitle, { value: titleValue, onChange: handleTitleChange, placeholder: "Add a title...", ref: ref })),
218
218
  react_1.default.createElement(NotesTextArea, { ref: noteAreaRef, isActive: isActive, noteValue: noteValue, value: noteValue, onChange: handleNoteChange, placeholder: "Add a note..." })),
219
219
  isActive && (react_1.default.createElement(react_1.default.Fragment, null,
220
220
  react_1.default.createElement("hr", { style: { margin: 0 } }),
@@ -12,5 +12,5 @@ export type NoteTextAreaProps = {
12
12
  maxFilesSizeError?: string;
13
13
  maxNoteWordCount?: number;
14
14
  onChange?: (value: string) => void;
15
- ref?: LegacyRef<HTMLDivElement>;
15
+ ref?: LegacyRef<HTMLInputElement>;
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.54",
3
+ "version": "1.1.56",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",