@veritone-ce/design-system 2.3.11 → 2.3.12

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.
@@ -31,11 +31,15 @@ function DatePicker({
31
31
  const formatProps = {
32
32
  label: "Date Picker",
33
33
  // TODO: perhaps get from context?
34
- value: props.value ? date.parseDate(props.value) : void 0,
34
+ value: props.value && props.value.length === 10 ? date.parseDate(props.value) : null,
35
35
  shouldForceLeadingZeros: props.shouldForceLeadingZeros,
36
- defaultValue: props.defaultValue ? date.parseDate(props.defaultValue) : void 0,
36
+ defaultValue: props.defaultValue ? date.parseDate(props.defaultValue) : null,
37
37
  onChange: (newValue) => {
38
- props.onChange?.(newValue?.toString());
38
+ if (newValue === null) {
39
+ return props.onChange?.("");
40
+ } else {
41
+ return props.onChange?.(newValue.toString());
42
+ }
39
43
  },
40
44
  onKeyDown: props.onKeyDown
41
45
  };
@@ -54,7 +58,8 @@ function DatePicker({
54
58
  onOpenChange: (open) => {
55
59
  open ? state.setOpen(open) : state.close();
56
60
  },
57
- placement
61
+ placement,
62
+ middleware: [react.shift(), react.flip()]
58
63
  });
59
64
  const role = react.useRole(context$1);
60
65
  const dismiss = react.useDismiss(context$1);
@@ -2,7 +2,7 @@
2
2
  'use client';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { useRef } from 'react';
5
- import { useFloating, useRole, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
5
+ import { useFloating, shift, flip, useRole, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
6
6
  import { useDatePicker } from 'react-aria';
7
7
  import { useDatePickerState } from 'react-stately';
8
8
  import { parseDate } from '@internationalized/date';
@@ -27,11 +27,15 @@ function DatePicker({
27
27
  const formatProps = {
28
28
  label: "Date Picker",
29
29
  // TODO: perhaps get from context?
30
- value: props.value ? parseDate(props.value) : void 0,
30
+ value: props.value && props.value.length === 10 ? parseDate(props.value) : null,
31
31
  shouldForceLeadingZeros: props.shouldForceLeadingZeros,
32
- defaultValue: props.defaultValue ? parseDate(props.defaultValue) : void 0,
32
+ defaultValue: props.defaultValue ? parseDate(props.defaultValue) : null,
33
33
  onChange: (newValue) => {
34
- props.onChange?.(newValue?.toString());
34
+ if (newValue === null) {
35
+ return props.onChange?.("");
36
+ } else {
37
+ return props.onChange?.(newValue.toString());
38
+ }
35
39
  },
36
40
  onKeyDown: props.onKeyDown
37
41
  };
@@ -50,7 +54,8 @@ function DatePicker({
50
54
  onOpenChange: (open) => {
51
55
  open ? state.setOpen(open) : state.close();
52
56
  },
53
- placement
57
+ placement,
58
+ middleware: [shift(), flip()]
54
59
  });
55
60
  const role = useRole(context);
56
61
  const dismiss = useDismiss(context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "2.3.11",
3
+ "version": "2.3.12",
4
4
  "private": false,
5
5
  "description": "Design System for Veritone CE",
6
6
  "keywords": [