@pedidopago/ui 1.3.7 → 1.3.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.
Files changed (84) hide show
  1. package/dist/components/DateInput/components/ModalWrapper/index.d.ts.map +1 -1
  2. package/dist/components/DateInput/components/ModalWrapper/index.js +0 -5
  3. package/dist/components/DateInput/components/ModalWrapper/styles.d.ts.map +1 -1
  4. package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -1
  5. package/dist/components/DateInput/components/ModalWrapper/types.d.ts +0 -2
  6. package/dist/components/DateInput/components/ModalWrapper/types.d.ts.map +1 -1
  7. package/dist/components/DateInput/dateInput.test.js +11 -0
  8. package/dist/components/DateInput/index.d.ts +1 -1
  9. package/dist/components/DateInput/index.d.ts.map +1 -1
  10. package/dist/components/DateInput/index.js +16 -16
  11. package/dist/components/DateInput/types.d.ts +2 -0
  12. package/dist/components/DateInput/types.d.ts.map +1 -1
  13. package/dist/components/DatePicker/components/DatePickerContent.d.ts.map +1 -1
  14. package/dist/components/DatePicker/components/DatePickerContent.js +17 -7
  15. package/dist/components/DatePicker/index.d.ts.map +1 -1
  16. package/dist/components/DatePicker/index.js +5 -4
  17. package/dist/components/DatePicker/styles.d.ts.map +1 -1
  18. package/dist/components/DatePicker/styles.js +1 -1
  19. package/dist/components/Icon/data/dash.d.ts.map +1 -1
  20. package/dist/components/Icon/data/dash.js +1 -1
  21. package/dist/components/Icon/data/payment.d.ts.map +1 -1
  22. package/dist/components/Icon/data/payment.js +7 -0
  23. package/dist/components/Icon/types.d.ts +1 -1
  24. package/dist/components/Icon/types.d.ts.map +1 -1
  25. package/dist/components/Illustration/BoletoSvg/index.d.ts +5 -0
  26. package/dist/components/Illustration/BoletoSvg/index.d.ts.map +1 -0
  27. package/dist/components/Illustration/BoletoSvg/index.js +168 -0
  28. package/dist/components/Illustration/BoxClosedSvg/index.d.ts +5 -0
  29. package/dist/components/Illustration/BoxClosedSvg/index.d.ts.map +1 -0
  30. package/dist/components/Illustration/BoxClosedSvg/index.js +99 -0
  31. package/dist/components/Illustration/BoxDeliverySvg/index.d.ts +5 -0
  32. package/dist/components/Illustration/BoxDeliverySvg/index.d.ts.map +1 -0
  33. package/dist/components/Illustration/BoxDeliverySvg/index.js +111 -0
  34. package/dist/components/Illustration/BoxOpenSvg/index.d.ts +5 -0
  35. package/dist/components/Illustration/BoxOpenSvg/index.d.ts.map +1 -0
  36. package/dist/components/Illustration/BoxOpenSvg/index.js +108 -0
  37. package/dist/components/Illustration/CalendarSvg/index.d.ts +5 -0
  38. package/dist/components/Illustration/CalendarSvg/index.d.ts.map +1 -0
  39. package/dist/components/Illustration/CalendarSvg/index.js +109 -0
  40. package/dist/components/Illustration/CardSvg/index.d.ts +5 -0
  41. package/dist/components/Illustration/CardSvg/index.d.ts.map +1 -0
  42. package/dist/components/Illustration/CardSvg/index.js +110 -0
  43. package/dist/components/Illustration/InquirySvg/index.d.ts +5 -0
  44. package/dist/components/Illustration/InquirySvg/index.d.ts.map +1 -0
  45. package/dist/components/Illustration/InquirySvg/index.js +219 -0
  46. package/dist/components/Illustration/OrderSvg/index.d.ts +5 -0
  47. package/dist/components/Illustration/OrderSvg/index.d.ts.map +1 -0
  48. package/dist/components/Illustration/OrderSvg/index.js +135 -0
  49. package/dist/components/Illustration/PixSvg/index.d.ts +5 -0
  50. package/dist/components/Illustration/PixSvg/index.d.ts.map +1 -0
  51. package/dist/components/Illustration/PixSvg/index.js +93 -0
  52. package/dist/components/Illustration/PrescriptionSvg/index.d.ts +5 -0
  53. package/dist/components/Illustration/PrescriptionSvg/index.d.ts.map +1 -0
  54. package/dist/components/Illustration/PrescriptionSvg/index.js +81 -0
  55. package/dist/components/Illustration/TransportSvg/index.d.ts +5 -0
  56. package/dist/components/Illustration/TransportSvg/index.d.ts.map +1 -0
  57. package/dist/components/Illustration/TransportSvg/index.js +102 -0
  58. package/dist/components/Illustration/illustration.test.d.ts +2 -0
  59. package/dist/components/Illustration/illustration.test.d.ts.map +1 -0
  60. package/dist/components/Illustration/illustration.test.js +61 -0
  61. package/dist/components/Illustration/index.d.ts +5 -0
  62. package/dist/components/Illustration/index.d.ts.map +1 -0
  63. package/dist/components/Illustration/index.js +134 -0
  64. package/dist/components/Illustration/styles.d.ts +11 -0
  65. package/dist/components/Illustration/styles.d.ts.map +1 -0
  66. package/dist/components/Illustration/styles.js +38 -0
  67. package/dist/components/Illustration/types.d.ts +7 -0
  68. package/dist/components/Illustration/types.d.ts.map +1 -0
  69. package/dist/components/Illustration/types.js +1 -0
  70. package/dist/components/Steps/components/StepIcon/index.d.ts +2 -2
  71. package/dist/components/Steps/components/StepIcon/index.d.ts.map +1 -1
  72. package/dist/components/Steps/components/StepIconMobile/index.d.ts +2 -2
  73. package/dist/components/Steps/components/StepIconMobile/index.d.ts.map +1 -1
  74. package/dist/components/Steps/index.d.ts +2 -2
  75. package/dist/components/Steps/index.d.ts.map +1 -1
  76. package/dist/components/Steps/index.js +22 -9
  77. package/dist/components/Steps/styles.d.ts.map +1 -1
  78. package/dist/components/Steps/styles.js +30 -19
  79. package/dist/components/Steps/types.d.ts +10 -5
  80. package/dist/components/Steps/types.d.ts.map +1 -1
  81. package/dist/index.d.ts +1 -0
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +9 -0
  84. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,YAAY,8GA+BxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,YAAY,8GAkBxB,CAAC"}
@@ -7,8 +7,6 @@ exports.ModalWrapper = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
- var _useDisableBodyScroll = require("../../../../shared/hooks/useDisableBodyScroll");
11
-
12
10
  var _styles = require("./styles");
13
11
 
14
12
  var _jsxRuntime = require("react/jsx-runtime");
@@ -21,15 +19,12 @@ var ModalWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
21
19
  top = _ref$top === void 0 ? '' : _ref$top,
22
20
  _ref$offsetX = _ref.offsetX,
23
21
  offsetX = _ref$offsetX === void 0 ? '0px' : _ref$offsetX,
24
- _ref$disableScrollOnO = _ref.disableScrollOnOpen,
25
- disableScrollOnOpen = _ref$disableScrollOnO === void 0 ? true : _ref$disableScrollOnO,
26
22
  maxWidth = _ref.maxWidth,
27
23
  children = _ref.children;
28
24
  var optionsContainerRef = (0, _react.useRef)(null);
29
25
  (0, _react.useImperativeHandle)(ref, function () {
30
26
  return optionsContainerRef.current;
31
27
  });
32
- (0, _useDisableBodyScroll.useDisableBodyScroll)(open && disableScrollOnOpen);
33
28
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ModalWrapperContainer, {
34
29
  ref: optionsContainerRef,
35
30
  open: open,
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/styles.ts"],"names":[],"mappings":";AAIA,UAAU,0BAA0B;IAClC,IAAI,EAAE,OAAO,CAAC;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAyBjC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/styles.ts"],"names":[],"mappings":";AAIA,UAAU,0BAA0B;IAClC,IAAI,EAAE,OAAO,CAAC;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAsBjC,CAAC"}
@@ -27,6 +27,6 @@ var ModalWrapperContainer = (0, _styled.default)(_framerMotion.motion.div)(funct
27
27
  var theme = _ref.theme,
28
28
  props = _objectWithoutProperties(_ref, _excluded);
29
29
 
30
- return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: auto;\n position: fixed;\n left: ", ";\n top: ", ";\n z-index: ", ";\n opacity: ", ";\n pointer-events: ", ";\n transition: opacity ease ", ";\n overflow-y: hidden;\n overflow-x: hidden;\n background: ", ";\n /* border: 2px solid ", "; */\n border-radius: ", ";\n box-shadow: ", ";\n\n li {\n list-style: none;\n }\n "])), props.left, props.top, theme.zIndex.level24, props.open ? 1 : 0, props.open ? 'auto' : 'none', theme.transition.speed, theme.colors.background.light, theme.colors.neutral.neutral1, theme.borderRadius.default, theme.shadow.level3);
30
+ return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: auto;\n position: fixed;\n left: ", ";\n top: ", ";\n z-index: ", ";\n opacity: ", ";\n pointer-events: ", ";\n transition: opacity ease ", ";\n background: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n\n li {\n list-style: none;\n }\n "])), props.left, props.top, theme.zIndex.level24, props.open ? 1 : 0, props.open ? 'auto' : 'none', theme.transition.speed, theme.colors.background.light, theme.borderRadius.default, theme.shadow.level3);
31
31
  });
32
32
  exports.ModalWrapperContainer = ModalWrapperContainer;
@@ -10,7 +10,5 @@ export interface ModalWrapperProps extends HTMLAttributes<HTMLDivElement> {
10
10
  offsetX?: string;
11
11
  /** The max width of the Modal. */
12
12
  maxWidth?: string | number;
13
- /** Optional. Will disable the scroll body scroll. */
14
- disableScrollOnOpen?: boolean;
15
13
  }
16
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mCAAmC;IACnC,IAAI,EAAE,OAAO,CAAC;IAEd,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/DateInput/components/ModalWrapper/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mCAAmC;IACnC,IAAI,EAAE,OAAO,CAAC;IAEd,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B"}
@@ -38,4 +38,15 @@ describe('DateInput', function () {
38
38
 
39
39
  expect(container).toBeInTheDocument();
40
40
  });
41
+ it('should render the datepicker with minimum and maximum dates', function () {
42
+ var _setup3 = setup({
43
+ value: new Date(),
44
+ onChange: jest.fn(),
45
+ minDate: new Date(),
46
+ maxDate: new Date()
47
+ }),
48
+ container = _setup3.container;
49
+
50
+ expect(container).toBeInTheDocument();
51
+ });
41
52
  });
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { DateInputProps } from './types';
3
- export declare function DateInput({ label, placeholder, alert, helperText, value, locales, localeOptions, onChange, disabled, ...rest }: DateInputProps): JSX.Element;
3
+ export declare function DateInput({ label, placeholder, alert, helperText, value, locales, localeOptions, minDate, maxDate, onChange, disabled, ...rest }: DateInputProps): JSX.Element;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAgB,EAChB,GAAG,IAAI,EACR,EAAE,cAAc,eAyFhB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,aAAa,EACb,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAgB,EAChB,GAAG,IAAI,EACR,EAAE,cAAc,eA2FhB"}
@@ -19,9 +19,11 @@ var _DatePicker = _interopRequireDefault(require("../DatePicker"));
19
19
 
20
20
  var _ModalWrapper = require("./components/ModalWrapper");
21
21
 
22
+ var _useDisableBodyScroll = require("../../shared/hooks/useDisableBodyScroll");
23
+
22
24
  var _jsxRuntime = require("react/jsx-runtime");
23
25
 
24
- var _excluded = ["label", "placeholder", "alert", "helperText", "value", "locales", "localeOptions", "onChange", "disabled"];
26
+ var _excluded = ["label", "placeholder", "alert", "helperText", "value", "locales", "localeOptions", "minDate", "maxDate", "onChange", "disabled"];
25
27
 
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
29
 
@@ -47,9 +49,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
47
49
 
48
50
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
49
51
 
50
- // TODO: Mudar a posição do datepicker dependendo da posição dele aberto.
51
52
  function DateInput(_ref) {
52
- var _containerRef$current, _optionsModalRef$curr, _containerRef$current3, _containerRef$current4, _containerRef$current5;
53
+ var _containerRef$current, _containerRef$current3, _containerRef$current4, _containerRef$current5;
53
54
 
54
55
  var label = _ref.label,
55
56
  placeholder = _ref.placeholder,
@@ -58,6 +59,8 @@ function DateInput(_ref) {
58
59
  value = _ref.value,
59
60
  locales = _ref.locales,
60
61
  localeOptions = _ref.localeOptions,
62
+ minDate = _ref.minDate,
63
+ maxDate = _ref.maxDate,
61
64
  onChange = _ref.onChange,
62
65
  _ref$disabled = _ref.disabled,
63
66
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
@@ -81,11 +84,6 @@ function DateInput(_ref) {
81
84
  datePickerOpen = _useState6[0],
82
85
  setDatePickerOpen = _useState6[1];
83
86
 
84
- var _useState7 = (0, _react.useState)((_optionsModalRef$curr = optionsModalRef.current) === null || _optionsModalRef$curr === void 0 ? void 0 : _optionsModalRef$curr.getBoundingClientRect().height),
85
- _useState8 = _slicedToArray(_useState7, 2),
86
- heightModal = _useState8[0],
87
- setHeightModal = _useState8[1];
88
-
89
87
  function selectDate(value) {
90
88
  setCurrentValue(value);
91
89
  setDatePickerOpen(false);
@@ -93,14 +91,14 @@ function DateInput(_ref) {
93
91
  }
94
92
 
95
93
  (0, _react.useEffect)(function () {
96
- setCurrentValue(value);
94
+ setCurrentValue(value === undefined ? new Date() : value);
97
95
  }, [value]);
96
+ (0, _useDisableBodyScroll.useDisableBodyScroll)(datePickerOpen);
98
97
 
99
98
  function handleRepositionModal() {
100
- var _containerRef$current2, _optionsModalRef$curr2;
99
+ var _containerRef$current2;
101
100
 
102
- setPositionContainer((_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.getBoundingClientRect().top);
103
- setHeightModal((_optionsModalRef$curr2 = optionsModalRef.current) === null || _optionsModalRef$curr2 === void 0 ? void 0 : _optionsModalRef$curr2.getBoundingClientRect().height);
101
+ setPositionContainer((_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.getBoundingClientRect().top); // setHeightModal(optionsModalRef.current?.getBoundingClientRect().height);
104
102
  }
105
103
 
106
104
  var toggleOptionsAreaView = (0, _react.useCallback)(function (event) {
@@ -120,7 +118,7 @@ function DateInput(_ref) {
120
118
  }),
121
119
  disabled: disabled,
122
120
  tabIndex: disabled ? -1 : 0,
123
- value: currentValue ? Array.isArray(currentValue) ? "".concat(currentValue[0].toLocaleDateString(locales, localeOptions), " - ").concat(currentValue[1].toLocaleDateString(locales, localeOptions)) : currentValue.toLocaleDateString(locales) : '',
121
+ value: currentValue ? Array.isArray(currentValue) ? "".concat(currentValue[0].toLocaleDateString(locales, localeOptions), " - ").concat(currentValue[1].toLocaleDateString(locales, localeOptions)) : new Date(currentValue).toLocaleDateString() : '',
124
122
  onClick: toggleOptionsAreaView,
125
123
  onMouseOver: handleRepositionModal
126
124
  }), datePickerOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -131,14 +129,16 @@ function DateInput(_ref) {
131
129
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactPortal.ReactPortal, {
132
130
  wrapperId: "portal-root",
133
131
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalWrapper.ModalWrapper, {
134
- open: true,
132
+ open: datePickerOpen,
135
133
  left: "".concat((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.getBoundingClientRect().left, "px"),
136
- top: Number(positionContainer) < 470 ? "calc(".concat(((_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.getBoundingClientRect().bottom) || 0, "px + 10px)") : "calc(".concat(((_containerRef$current5 = containerRef.current) === null || _containerRef$current5 === void 0 ? void 0 : _containerRef$current5.getBoundingClientRect().top) || 0, "px - ").concat(heightModal && heightModal + 10, "px)"),
134
+ top: Number(positionContainer) < 540 ? "calc(".concat(((_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.getBoundingClientRect().bottom) || 0, "px + 10px)") : "calc(".concat(((_containerRef$current5 = containerRef.current) === null || _containerRef$current5 === void 0 ? void 0 : _containerRef$current5.getBoundingClientRect().top) || 0, "px - ", 360, "px)"),
137
135
  ref: optionsModalRef,
138
136
  maxWidth: "auto",
139
137
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DatePicker.default, _objectSpread({
140
138
  value: currentValue,
141
- onChange: selectDate
139
+ onChange: selectDate,
140
+ minDate: minDate,
141
+ maxDate: maxDate
142
142
  }, rest))
143
143
  })
144
144
  })]
@@ -11,5 +11,7 @@ export interface DateInputProps extends DatePickerProps {
11
11
  disabled?: boolean;
12
12
  locales?: string | string[];
13
13
  localeOptions?: Intl.DateTimeFormatOptions;
14
+ minDate?: Date;
15
+ maxDate?: Date;
14
16
  }
15
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,oBAAY,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CAC5C"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,oBAAY,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC3C,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/components/DatePickerContent.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,iBAAiB,4KAc3B,sBAAsB,gBAyNxB,CAAC"}
1
+ {"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/components/DatePickerContent.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,iBAAiB,4KAc3B,sBAAsB,gBAmOxB,CAAC"}
@@ -56,11 +56,6 @@ var DatePickerContent = function DatePickerContent(_ref) {
56
56
  if (maxDate || minDate) {
57
57
  var newDate = new Date(date);
58
58
  newDate.setMonth(newDate.getMonth() + (to === 'up' ? 1 : -1));
59
-
60
- if (maxDate && newDate > maxDate || minDate && newDate < minDate) {
61
- return;
62
- }
63
-
64
59
  handleChangeDate(newDate);
65
60
  }
66
61
 
@@ -109,6 +104,20 @@ var DatePickerContent = function DatePickerContent(_ref) {
109
104
  return groupedDaysWithWeekDays;
110
105
  };
111
106
 
107
+ var checkIfSelectedDateIsInvalid = function checkIfSelectedDateIsInvalid(cellDate) {
108
+ var isDateInvalid = false;
109
+
110
+ if (minDate && cellDate < minDate) {
111
+ isDateInvalid = true;
112
+ }
113
+
114
+ if (maxDate && cellDate > maxDate) {
115
+ isDateInvalid = true;
116
+ }
117
+
118
+ return isDateInvalid;
119
+ };
120
+
112
121
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.motion.div, {
113
122
  initial: {
114
123
  opacity: 0
@@ -194,12 +203,13 @@ var DatePickerContent = function DatePickerContent(_ref) {
194
203
  var removeZeros = days.filter(function (day) {
195
204
  return day !== 0;
196
205
  });
206
+ var isDateBeyondMinAndMaxLimits = checkIfSelectedDateIsInvalid(cellDate);
197
207
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.DatePickerTableCell, {
198
208
  role: "gridcell",
199
209
  title: cellTitle,
200
210
  "data-date": cellDate,
201
211
  tabIndex: -1,
202
- disabled: isDisabled,
212
+ disabled: isDisabled || isDateBeyondMinAndMaxLimits,
203
213
  "aria-label": cellDate.toLocaleDateString('pt-BR', {
204
214
  weekday: 'short',
205
215
  year: '2-digit',
@@ -213,7 +223,7 @@ var DatePickerContent = function DatePickerContent(_ref) {
213
223
  isEndDateOfRange: type === 'range' && isEndDateOfRange,
214
224
  isToday: isToday,
215
225
  isSelected: isStartDateOfRange,
216
- isPrevNextMonth: isPreviousMonth || isNextMonth,
226
+ isPrevNextMonth: isPreviousMonth || isNextMonth || isDateBeyondMinAndMaxLimits,
217
227
  isFirstDayOfMonth: isExtended && rowIndex === 0 && day === 1,
218
228
  isLastDayOfMonth: isExtended && rowIndex === monthDaysLength - 1 && day === removeZeros[removeZeros.length - 1],
219
229
  onMouseOver: function onMouseOver() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,UAAU,iEAQb,eAAe,gBAuJjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,UAAU,iEAQb,eAAe,gBAoJjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -134,8 +134,8 @@ var DatePicker = function DatePicker(_ref) {
134
134
  isInTheRange: isInTheRange,
135
135
  handleMouseOver: handleMouseOver,
136
136
  handleChange: handleChange,
137
- minDate: minDate && new Date(minDate),
138
- maxDate: maxDate && new Date(maxDate)
137
+ minDate: minDate,
138
+ maxDate: maxDate
139
139
  };
140
140
 
141
141
  var handleToggleYearPicker = function handleToggleYearPicker() {
@@ -156,7 +156,7 @@ var DatePicker = function DatePicker(_ref) {
156
156
  enableYearPicker: !maxDate && !minDate
157
157
  }), {}, {
158
158
  date: firstCalendarDate,
159
- maxDate: variant === 'extended' ? new Date(secondCalendarDate.getFullYear(), secondCalendarDate.getMonth() - 1, 1) : DatePickerContentProps.maxDate,
159
+ maxDate: variant === 'extended' ? new Date(secondCalendarDate.getFullYear(), secondCalendarDate.getMonth(), 1) : maxDate,
160
160
  handleChangeDate: function handleChangeDate(newDate) {
161
161
  return setFirstCalendarDate(newDate);
162
162
  }
@@ -165,7 +165,8 @@ var DatePicker = function DatePicker(_ref) {
165
165
  minDate: new Date(firstCalendarDate.getFullYear(), firstCalendarDate.getMonth() + 1, 1),
166
166
  handleChangeDate: function handleChangeDate(newDate) {
167
167
  return setSecondCalendarDate(newDate);
168
- }
168
+ },
169
+ maxDate: maxDate
169
170
  }))]
170
171
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateYearPicker.DateYearPicker, {
171
172
  date: firstCalendarDate,
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/styles.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,0BAA0B;;;;gBACzB,OAAO;yGAsBpB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;yGAG/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAM5B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;yGAwBjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;qHAwBlC,CAAC;AAEF,eAAO,MAAM,cAAc;;;yGAE1B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;uIAiB/B,CAAC;AACF,eAAO,MAAM,kBAAkB;;;;;mHAkB9B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;+HA0J/B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;gIAGnC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;yGAGnC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGAG9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;yGAoC9B,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/styles.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,0BAA0B;;;;gBACzB,OAAO;yGAsBpB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;yGAG/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAM5B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;yGAwBjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;qHAwBlC,CAAC;AAEF,eAAO,MAAM,cAAc;;;yGAE1B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;uIAiB/B,CAAC;AACF,eAAO,MAAM,kBAAkB;;;;;mHAkB9B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;+HAyJ/B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;gIAGnC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;yGAGnC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGAG9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;yGAoC9B,CAAC"}
@@ -74,7 +74,7 @@ var DatePickerTableCell = _styled.default.td(_templateObject9 || (_templateObjec
74
74
  }, function (props) {
75
75
  return props.isPrevNextMonth && !props.isSelected && !props.isEndDateOfRange && !props['aria-selected'] ? (0, _colorCheck.parseHslColorToString)(props.theme.colorMode === 'dark' ? (0, _colorToGray.convertColor)((0, _getColorValue.getColorValue)(props.theme.colorSelected, props.theme)).neutral3 : (0, _colorToGray.convertColor)((0, _getColorValue.getColorValue)(props.theme.colorSelected, props.theme)).neutral1) : props.isSelected || props.isEndDateOfRange ? props.theme.colors.body.light : props['aria-selected'] ? (0, _getColorValue.getColorValue)(props.theme.colorSelected, props.theme) : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black;
76
76
  }, function (props) {
77
- return props.disabled && "\n cursor: default; \n pointer-events: none;\n visibility: hidden;\n ";
77
+ return props.disabled && "\n cursor: default; \n pointer-events: none;\n ";
78
78
  }, function (props) {
79
79
  return props.isToday && !props.isSelected && !props.isEndDateOfRange && "\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: solid 1px ".concat(props.theme.colorMode === 'dark' ? props.theme.colors.neutral.neutral3 : props.theme.colors.neutral.neutral2, ";\n transform: translate(-50%, -50%);\n }\n ");
80
80
  }, function (props) {
@@ -1 +1 @@
1
- {"version":3,"file":"dash.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/dash.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;GAi2ErB,CAAC"}
1
+ {"version":3,"file":"dash.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/dash.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;GAyiFrB,CAAC"}