@instructure/ui-date-input 10.4.2-snapshot-6 → 10.4.2-snapshot-8

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
@@ -3,9 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [10.4.2-snapshot-6](https://github.com/instructure/instructure-ui/compare/v10.4.1...v10.4.2-snapshot-6) (2024-10-31)
6
+ ## [10.4.2-snapshot-8](https://github.com/instructure/instructure-ui/compare/v10.4.1...v10.4.2-snapshot-8) (2024-11-05)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-date-input
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui-date-input:** fix DateInput2 to update messages properly ([553a235](https://github.com/instructure/instructure-ui/commit/553a2351fc7f8c6d012d4001ff49c2450d29ee97))
9
12
 
10
13
 
11
14
 
@@ -163,9 +163,8 @@ const DateInput2 = ({
163
163
  setShowPopover = _useState4[1];
164
164
  useEffect(() => {
165
165
  // don't set input messages if there is an internal error set already
166
- if (!inputMessages.length && !invalidDateErrorMessage) {
167
- setInputMessages(messages || []);
168
- }
166
+ if (inputMessages.find(m => m.text === invalidDateErrorMessage)) return;
167
+ setInputMessages(messages || []);
169
168
  }, [messages]);
170
169
  useEffect(() => {
171
170
  const _parseDate = parseDate(value),
@@ -172,9 +172,8 @@ const DateInput2 = ({
172
172
  setShowPopover = _useState4[1];
173
173
  (0, _react.useEffect)(() => {
174
174
  // don't set input messages if there is an internal error set already
175
- if (!inputMessages.length && !invalidDateErrorMessage) {
176
- setInputMessages(messages || []);
177
- }
175
+ if (inputMessages.find(m => m.text === invalidDateErrorMessage)) return;
176
+ setInputMessages(messages || []);
178
177
  }, [messages]);
179
178
  (0, _react.useEffect)(() => {
180
179
  const _parseDate = parseDate(value),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-input",
3
- "version": "10.4.2-snapshot-6",
3
+ "version": "10.4.2-snapshot-8",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.4.2-snapshot-6",
27
- "@instructure/ui-babel-preset": "10.4.2-snapshot-6",
28
- "@instructure/ui-buttons": "10.4.2-snapshot-6",
29
- "@instructure/ui-scripts": "10.4.2-snapshot-6",
30
- "@instructure/ui-test-utils": "10.4.2-snapshot-6",
26
+ "@instructure/ui-axe-check": "10.4.2-snapshot-8",
27
+ "@instructure/ui-babel-preset": "10.4.2-snapshot-8",
28
+ "@instructure/ui-buttons": "10.4.2-snapshot-8",
29
+ "@instructure/ui-scripts": "10.4.2-snapshot-8",
30
+ "@instructure/ui-test-utils": "10.4.2-snapshot-8",
31
31
  "@testing-library/jest-dom": "^6.4.6",
32
32
  "@testing-library/react": "^16.0.1",
33
33
  "@testing-library/user-event": "^14.5.2",
@@ -35,20 +35,20 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.25.6",
38
- "@instructure/emotion": "10.4.2-snapshot-6",
39
- "@instructure/shared-types": "10.4.2-snapshot-6",
40
- "@instructure/ui-calendar": "10.4.2-snapshot-6",
41
- "@instructure/ui-form-field": "10.4.2-snapshot-6",
42
- "@instructure/ui-i18n": "10.4.2-snapshot-6",
43
- "@instructure/ui-icons": "10.4.2-snapshot-6",
44
- "@instructure/ui-popover": "10.4.2-snapshot-6",
45
- "@instructure/ui-position": "10.4.2-snapshot-6",
46
- "@instructure/ui-prop-types": "10.4.2-snapshot-6",
47
- "@instructure/ui-react-utils": "10.4.2-snapshot-6",
48
- "@instructure/ui-selectable": "10.4.2-snapshot-6",
49
- "@instructure/ui-testable": "10.4.2-snapshot-6",
50
- "@instructure/ui-text-input": "10.4.2-snapshot-6",
51
- "@instructure/ui-utils": "10.4.2-snapshot-6",
38
+ "@instructure/emotion": "10.4.2-snapshot-8",
39
+ "@instructure/shared-types": "10.4.2-snapshot-8",
40
+ "@instructure/ui-calendar": "10.4.2-snapshot-8",
41
+ "@instructure/ui-form-field": "10.4.2-snapshot-8",
42
+ "@instructure/ui-i18n": "10.4.2-snapshot-8",
43
+ "@instructure/ui-icons": "10.4.2-snapshot-8",
44
+ "@instructure/ui-popover": "10.4.2-snapshot-8",
45
+ "@instructure/ui-position": "10.4.2-snapshot-8",
46
+ "@instructure/ui-prop-types": "10.4.2-snapshot-8",
47
+ "@instructure/ui-react-utils": "10.4.2-snapshot-8",
48
+ "@instructure/ui-selectable": "10.4.2-snapshot-8",
49
+ "@instructure/ui-testable": "10.4.2-snapshot-8",
50
+ "@instructure/ui-text-input": "10.4.2-snapshot-8",
51
+ "@instructure/ui-utils": "10.4.2-snapshot-8",
52
52
  "moment-timezone": "^0.5.45",
53
53
  "prop-types": "^15.8.1"
54
54
  },
@@ -184,9 +184,9 @@ const DateInput2 = ({
184
184
 
185
185
  useEffect(() => {
186
186
  // don't set input messages if there is an internal error set already
187
- if (!inputMessages.length && !invalidDateErrorMessage) {
188
- setInputMessages(messages || [])
189
- }
187
+ if (inputMessages.find((m) => m.text === invalidDateErrorMessage)) return
188
+
189
+ setInputMessages(messages || [])
190
190
  }, [messages])
191
191
 
192
192
  useEffect(() => {
package/src/index.ts CHANGED
@@ -25,3 +25,4 @@
25
25
  export { DateInput } from './DateInput'
26
26
  export { DateInput2 } from './DateInput2'
27
27
  export type { DateInputProps } from './DateInput/props'
28
+ export type { DateInput2Props } from './DateInput2/props'