pixelize-design-library 1.1.81 → 1.1.83

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.
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import "react-datepicker/dist/react-datepicker.css";
3
3
  import { DatePickerProps } from "./DatePickerProps";
4
- export default function DatePicker({ selectedDate, onChange, placeholderText, dateFormat, showTimeSelect, timeFormat, timeIntervals, timeCaption, dateTimeFormat, id, name, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, }: DatePickerProps): React.JSX.Element;
4
+ export default function DatePicker({ selectedDate, onChange, placeholderText, dateFormat, showTimeSelect, timeFormat, timeIntervals, timeCaption, dateTimeFormat, id, name, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, minDate, maxDate, }: DatePickerProps): React.JSX.Element;
@@ -23,12 +23,12 @@ var DatePickerContainer = styled_1.default.div(templateObject_1 || (templateObje
23
23
  // font-weight: bold;
24
24
  // `;
25
25
  function DatePicker(_a) {
26
- var selectedDate = _a.selectedDate, onChange = _a.onChange, _b = _a.placeholderText, placeholderText = _b === void 0 ? "Select a date" : _b, _c = _a.dateFormat, dateFormat = _c === void 0 ? "MM/dd/yyyy" : _c, _d = _a.showTimeSelect, showTimeSelect = _d === void 0 ? false : _d, _e = _a.timeFormat, timeFormat = _e === void 0 ? "HH:mm aa" : _e, _f = _a.timeIntervals, timeIntervals = _f === void 0 ? 30 : _f, _g = _a.timeCaption, timeCaption = _g === void 0 ? "Time" : _g, dateTimeFormat = _a.dateTimeFormat, id = _a.id, name = _a.name, label = _a.label, _h = _a.isRequired, isRequired = _h === void 0 ? false : _h, _j = _a.isInformation, isInformation = _j === void 0 ? false : _j, _k = _a.informationMessage, informationMessage = _k === void 0 ? "" : _k, _l = _a.error, error = _l === void 0 ? false : _l, _m = _a.errorMessage, errorMessage = _m === void 0 ? "" : _m, _o = _a.helperText, helperText = _o === void 0 ? "" : _o;
26
+ var selectedDate = _a.selectedDate, onChange = _a.onChange, _b = _a.placeholderText, placeholderText = _b === void 0 ? "Select a date" : _b, _c = _a.dateFormat, dateFormat = _c === void 0 ? "MM/dd/yyyy" : _c, _d = _a.showTimeSelect, showTimeSelect = _d === void 0 ? false : _d, _e = _a.timeFormat, timeFormat = _e === void 0 ? "HH:mm aa" : _e, _f = _a.timeIntervals, timeIntervals = _f === void 0 ? 30 : _f, _g = _a.timeCaption, timeCaption = _g === void 0 ? "Time" : _g, dateTimeFormat = _a.dateTimeFormat, id = _a.id, name = _a.name, label = _a.label, _h = _a.isRequired, isRequired = _h === void 0 ? false : _h, _j = _a.isInformation, isInformation = _j === void 0 ? false : _j, _k = _a.informationMessage, informationMessage = _k === void 0 ? "" : _k, _l = _a.error, error = _l === void 0 ? false : _l, _m = _a.errorMessage, errorMessage = _m === void 0 ? "" : _m, _o = _a.helperText, helperText = _o === void 0 ? "" : _o, minDate = _a.minDate, maxDate = _a.maxDate;
27
27
  var theme = (0, useCustomTheme_1.useCustomTheme)();
28
28
  return (react_1.default.createElement(react_2.FormControl, { isInvalid: error },
29
29
  label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })),
30
30
  react_1.default.createElement(DatePickerContainer, null,
31
- react_1.default.createElement(react_datepicker_1.default, { selected: selectedDate, onChange: onChange, placeholderText: placeholderText, dateFormat: showTimeSelect
31
+ react_1.default.createElement(react_datepicker_1.default, { minDate: minDate, maxDate: maxDate, selected: selectedDate, onChange: onChange, placeholderText: placeholderText, dateFormat: showTimeSelect
32
32
  ? dateTimeFormat
33
33
  ? dateTimeFormat
34
34
  : "MM/dd/yyyy h:mm aa"
@@ -20,5 +20,7 @@ export type DatePickerProps = {
20
20
  error?: boolean;
21
21
  errorMessage?: string;
22
22
  helperText?: string;
23
+ minDate?: Date;
24
+ maxDate?: Date;
23
25
  } & Partial<ReactDatePickerProps>;
24
26
  export {};
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { SelectSearchProps } from "./SelectSearchProps";
3
- export default function SelectSearch({ options, initialSelectedOption, onOptionSelect, inputOnchange, id, name, label, dropdownStyle, inputStyle, isOptionLoading, loadingText, boxStyle, placeholder, searchQuery, isInformation, informationMessage, rightIcon, rightElementStyle, isMultipleSelect, isRequired, onOptionMultiSelect, error, isProfile, isBottomIcon, errorMessage, BottomIcon, BottomText, handleBottomClick, BottomTextColor, }: Readonly<SelectSearchProps>): React.JSX.Element;
3
+ export default function SelectSearch({ options, initialSelectedOption, onOptionSelect, inputOnchange, id, name, label, dropdownStyle, inputStyle, isOptionLoading, loadingText, boxStyle, placeholder, searchQuery, isInformation, informationMessage, rightIcon, rightElementStyle, isMultipleSelect, isRequired, onOptionMultiSelect, error, isProfile, isBottomIcon, errorMessage, BottomIcon, BottomText, handleBottomClick, BottomTextColor, isColorOptions, }: Readonly<SelectSearchProps>): React.JSX.Element;
@@ -53,7 +53,7 @@ var useCustomTheme_1 = require("../../Theme/useCustomTheme");
53
53
  var lucide_react_1 = require("lucide-react");
54
54
  var ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
55
55
  var RenderOptions = function (_a) {
56
- var isOptionLoading = _a.isOptionLoading, filteredOptions = _a.filteredOptions, loadingText = _a.loadingText, handleOptionClick = _a.handleOptionClick, isProfile = _a.isProfile;
56
+ var isOptionLoading = _a.isOptionLoading, filteredOptions = _a.filteredOptions, loadingText = _a.loadingText, handleOptionClick = _a.handleOptionClick, isProfile = _a.isProfile, isColorOptions = _a.isColorOptions;
57
57
  if (isOptionLoading) {
58
58
  return (react_1.default.createElement(react_2.VStack, { py: 2 },
59
59
  react_1.default.createElement(react_2.Spinner, { size: "sm", color: "blue.500" }),
@@ -63,6 +63,7 @@ var RenderOptions = function (_a) {
63
63
  return (react_1.default.createElement(react_1.default.Fragment, null, filteredOptions.map(function (option) { return (react_1.default.createElement(react_2.Box, { key: option.id, px: 4, py: 2, cursor: "pointer", _hover: { backgroundColor: "blue.50" }, onClick: function () { return handleOptionClick(option); }, display: "flex", alignItems: "center", gap: "0.5rem" },
64
64
  isProfile && (react_1.default.createElement(react_2.Box, null,
65
65
  react_1.default.createElement(react_2.Avatar, { size: "sm", name: option.label.toLocaleUpperCase(), src: option.profileUrl ? option.profileUrl : undefined }))),
66
+ isColorOptions && (react_1.default.createElement(react_2.Box, { width: "0.8rem", height: "0.8rem", content: "", backgroundColor: option === null || option === void 0 ? void 0 : option.color, borderRadius: "50%" })),
66
67
  react_1.default.createElement(react_2.Box, null,
67
68
  react_1.default.createElement(react_2.Box, null, option.label),
68
69
  option.email && (react_1.default.createElement(react_2.Box, { fontSize: 12, color: "gray.400" }, option.email))))); })));
@@ -74,7 +75,7 @@ function SelectSearch(_a) {
74
75
  // BottomIconStyle,
75
76
  _l = _a.BottomIcon,
76
77
  // BottomIconStyle,
77
- BottomIcon = _l === void 0 ? false : _l, BottomText = _a.BottomText, handleBottomClick = _a.handleBottomClick, BottomTextColor = _a.BottomTextColor;
78
+ BottomIcon = _l === void 0 ? false : _l, BottomText = _a.BottomText, handleBottomClick = _a.handleBottomClick, BottomTextColor = _a.BottomTextColor, isColorOptions = _a.isColorOptions;
78
79
  var theme = (0, useCustomTheme_1.useCustomTheme)();
79
80
  var _m = (0, react_1.useState)(initialSelectedOption ? [initialSelectedOption] : []), selectedOptions = _m[0], setSelectedOptions = _m[1];
80
81
  var _o = (0, react_1.useState)(searchQuery), inputValue = _o[0], setInputValue = _o[1];
@@ -226,7 +227,7 @@ function SelectSearch(_a) {
226
227
  react_1.default.createElement(react_2.Input, { ref: inputRef, border: error ? "2px solid #DC143C" : "2px solid #e2e8f0", variant: "flushed", value: inputValue ? inputValue : "", onClick: function () { return setIsOpen(true); }, onFocus: function () { return setIsOpen(true); }, onChange: function (e) { return handleInputChange(e.target.value); }, placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, cursor: "pointer", borderColor: "gray.300", _hover: { borderColor: "blue.500" }, _focus: { borderColor: error ? "none" : "blue.500" }, style: __assign(__assign({}, inputStyle), { backgroundColor: theme.colors.backgroundColor.main, fontWeight: 600, color: theme.colors.gray[700], padding: "0 0.5rem", fontSize: 15, letterSpacing: 0.7, border: error ? "2px solid #DC143C" : "1px solid #e2e8f0" }) }),
227
228
  rightIcon && (react_1.default.createElement(react_2.InputRightElement, { pointerEvents: "none", children: rightIcon, style: __assign({}, rightElementStyle) }))),
228
229
  isOpen && (react_1.default.createElement(react_2.Box, { ref: dropdownRef, marginTop: "5px", position: "absolute", top: position === "below" ? "100%" : "auto", bottom: position === "above" ? "100%" : "auto", left: 0, right: 0, border: "1px solid", borderColor: "gray.300", borderRadius: "md", bg: "white", maxHeight: "150px", overflowY: "auto", zIndex: 10 },
229
- react_1.default.createElement(RenderOptions, { isOptionLoading: isOptionLoading, filteredOptions: filteredOptions, loadingText: loadingText, handleOptionClick: handleOptionClick, isProfile: isProfile }),
230
+ react_1.default.createElement(RenderOptions, { isOptionLoading: isOptionLoading, filteredOptions: filteredOptions, loadingText: loadingText, handleOptionClick: handleOptionClick, isProfile: isProfile, isColorOptions: isColorOptions }),
230
231
  react_1.default.createElement("hr", null),
231
232
  isBottomIcon && (react_1.default.createElement(react_2.Box, { position: "sticky", bottom: 0, background: "white", display: "flex", alignItems: "center", pl: "1rem", cursor: "pointer", onClick: handleBottomClick, borderColor: "gray.300", zIndex: 1, borderTop: "1px solid lightgray" },
232
233
  react_1.default.createElement(react_2.Box, null, BottomIcon ? BottomIcon : react_1.default.createElement(lucide_react_1.PlusIcon, { size: "1rem" })),
@@ -24,6 +24,7 @@ export type SelectSearchProps = {
24
24
  isRequired?: boolean | undefined;
25
25
  error?: boolean | undefined;
26
26
  isProfile?: boolean | undefined;
27
+ isColorOptions?: boolean | undefined;
27
28
  errorMessage?: string | undefined;
28
29
  isBottomIcon?: boolean | undefined;
29
30
  BottomIcon?: boolean | undefined | JSX.Element;
@@ -37,4 +38,5 @@ export type selectOptions = {
37
38
  label: string;
38
39
  email?: string;
39
40
  profileUrl?: string;
41
+ color?: string;
40
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.81",
3
+ "version": "1.1.83",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",