@simplybusiness/mobius-datepicker 7.3.4 → 7.3.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 56c673f: Migrate CSS from SASS-style nesting to native CSS nesting syntax
8
+ - Update 62 CSS source files to use native CSS nesting with `&` prefix
9
+ - Switch PostCSS plugin from `postcss-nested` to `postcss-nesting`
10
+ - No functional changes to compiled CSS output (still Safari 14 compatible)
11
+
12
+ - Updated dependencies [56c673f]
13
+ - Updated dependencies [c54e331]
14
+ - @simplybusiness/mobius@6.9.5
15
+ - @simplybusiness/icons@4.37.0
16
+
17
+ ## 7.3.5
18
+
19
+ ### Patch Changes
20
+
21
+ - 5896263: Fix linting warnings across multiple packages
22
+
3
23
  ## 7.3.4
4
24
 
5
25
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -436,13 +436,13 @@ var DatePicker = (props) => {
436
436
  "mobius-date-picker__field-button",
437
437
  validationClasses
438
438
  );
439
- const validate = () => {
439
+ const validate = (0, import_react3.useCallback)(() => {
440
440
  if (isOpen) return;
441
441
  const isValidInput = inputRef.current?.checkValidity();
442
442
  if (!isValidInput) {
443
443
  setIsValid(false);
444
444
  }
445
- };
445
+ }, [isOpen]);
446
446
  (0, import_react3.useEffect)(() => {
447
447
  if (!inputRef.current) return;
448
448
  const validatedValue = validateDateFormat(defaultValue);
@@ -450,7 +450,7 @@ var DatePicker = (props) => {
450
450
  inputRef.current.value = validatedValue;
451
451
  setIsValid(true);
452
452
  validate();
453
- }, [defaultValue]);
453
+ }, [defaultValue, validate]);
454
454
  const togglePopoverVisibility = () => {
455
455
  setIsValid(true);
456
456
  setIsOpen(!isOpen);
@@ -489,7 +489,7 @@ var DatePicker = (props) => {
489
489
  return;
490
490
  }
491
491
  validate();
492
- }, [isOpen]);
492
+ }, [isOpen, validate]);
493
493
  if (touchDevice) {
494
494
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: containerClasses, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
495
495
  import_mobius3.TextField,
package/dist/esm/index.js CHANGED
@@ -11,6 +11,7 @@ import classNames from "classnames/dedupe";
11
11
  import {
12
12
  Suspense,
13
13
  lazy,
14
+ useCallback,
14
15
  useEffect,
15
16
  useRef,
16
17
  useState
@@ -110,13 +111,13 @@ var DatePicker = (props) => {
110
111
  "mobius-date-picker__field-button",
111
112
  validationClasses
112
113
  );
113
- const validate = () => {
114
+ const validate = useCallback(() => {
114
115
  if (isOpen) return;
115
116
  const isValidInput = inputRef.current?.checkValidity();
116
117
  if (!isValidInput) {
117
118
  setIsValid(false);
118
119
  }
119
- };
120
+ }, [isOpen]);
120
121
  useEffect(() => {
121
122
  if (!inputRef.current) return;
122
123
  const validatedValue = validateDateFormat(defaultValue);
@@ -124,7 +125,7 @@ var DatePicker = (props) => {
124
125
  inputRef.current.value = validatedValue;
125
126
  setIsValid(true);
126
127
  validate();
127
- }, [defaultValue]);
128
+ }, [defaultValue, validate]);
128
129
  const togglePopoverVisibility = () => {
129
130
  setIsValid(true);
130
131
  setIsOpen(!isOpen);
@@ -163,7 +164,7 @@ var DatePicker = (props) => {
163
164
  return;
164
165
  }
165
166
  validate();
166
- }, [isOpen]);
167
+ }, [isOpen, validate]);
167
168
  if (touchDevice) {
168
169
  return /* @__PURE__ */ jsx("div", { className: containerClasses, children: /* @__PURE__ */ jsx(
169
170
  TextField,