@trackunit/react-components 0.0.151 → 0.0.153

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.
@@ -3,21 +3,21 @@ import { BaseInputProps } from "../BaseInput";
3
3
  declare type BaseInputExposedProps = Omit<BaseInputProps, "defaultValue" | "min" | "max" | "value">;
4
4
  export interface DateInputProps extends BaseInputExposedProps {
5
5
  /**
6
- * A min value in type Date
6
+ * A min value with type Date added
7
7
  */
8
- min?: Date;
8
+ min?: Date | string | number;
9
9
  /**
10
- * A max date value in type Date
10
+ * A max value with type Date added
11
11
  */
12
- max?: Date;
12
+ max?: Date | string | number;
13
13
  /**
14
- * A default value in type Date
14
+ * A default value with type Date added
15
15
  */
16
- defaultValue?: Date;
16
+ defaultValue?: Date | string | number;
17
17
  /**
18
- * A value in type Date
18
+ * A value with type Date added
19
19
  */
20
- value?: Date;
20
+ value?: Date | string | number;
21
21
  }
22
22
  /**
23
23
  * A wrapper around BaseInput with a pop-up day picker.
@@ -20,7 +20,6 @@ export interface PopoverListItemProps extends CommonProps {
20
20
  * The child nodes.
21
21
  */
22
22
  children: React.ReactNode;
23
- renderAs?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
24
23
  }
25
24
  /**
26
25
  * The PopoverListItem component.
@@ -28,4 +27,4 @@ export interface PopoverListItemProps extends CommonProps {
28
27
  * @param {PopoverListItemProps} props - The props for the PopoverListItem component
29
28
  * @returns {JSX.Element} PopoverListItem component
30
29
  */
31
- export declare const PopoverListItem: ({ selected, children, disabled, ariaLabel, url, onClick, prefix, suffix, renderAs, dataTestId, }: PopoverListItemProps) => JSX.Element;
30
+ export declare const PopoverListItem: ({ selected, children, disabled, ariaLabel, url, onClick, prefix, suffix, dataTestId, }: PopoverListItemProps) => JSX.Element;
package/index.js CHANGED
@@ -10,10 +10,10 @@ import { format, formatDistance } from 'date-fns';
10
10
  import { useSpring, animated } from '@react-spring/web';
11
11
  import usePortal from 'react-useportal';
12
12
  import { createPopper } from '@popperjs/core';
13
+ import { Link, UNSAFE_NavigationContext } from 'react-router-dom';
13
14
  import { DayPicker as DayPicker$1 } from 'react-day-picker';
14
15
  import { enGB, enUS, da, de, cs, nl, fr, fi, hu, it, nb, pl, pt, ru, ro, es, sv, ja, th } from 'date-fns/locale';
15
16
  import { Helmet } from 'react-helmet';
16
- import { UNSAFE_NavigationContext } from 'react-router-dom';
17
17
  import ReactSelect, { components } from 'react-select';
18
18
  export { default as ValueType } from 'react-select';
19
19
  import ReactAsyncCreatableSelect from 'react-select/async-creatable';
@@ -1857,7 +1857,7 @@ const DateInput = forwardRef((_a, ref) => {
1857
1857
  } = _a,
1858
1858
  rest = __rest(_a, ["min", "max", "defaultValue", "value"]);
1859
1859
 
1860
- const formatDateToInputString = date => date ? format(date, "yyyy-MM-dd") : date; // @ts-ignore
1860
+ const formatDateToInputString = date => date instanceof Date ? format(date, "yyyy-MM-dd") : date; // @ts-ignore
1861
1861
  // Chrome needs it's default icon to have datepicker functionality.
1862
1862
  // window.chrome doesn't exist in TS but is available on chrome browsers.
1863
1863
  // If it fails it will just show our icon.
@@ -2102,7 +2102,6 @@ const PopoverListItem = ({
2102
2102
  onClick,
2103
2103
  prefix,
2104
2104
  suffix,
2105
- renderAs,
2106
2105
  dataTestId
2107
2106
  }) => {
2108
2107
  const content = jsxs("div", Object.assign({
@@ -2127,9 +2126,8 @@ const PopoverListItem = ({
2127
2126
  "aria-label": ariaLabel,
2128
2127
  "data-testid": dataTestId
2129
2128
  }, {
2130
- children: url ? jsx(UnstyledAnchor, Object.assign({
2131
- "$as": renderAs,
2132
- href: url
2129
+ children: url ? jsx(PopoverLink, Object.assign({
2130
+ to: url
2133
2131
  }, {
2134
2132
  children: content
2135
2133
  })) : content
@@ -2144,7 +2142,7 @@ const ListItem = tw.li`
2144
2142
  tu-popover-list-item
2145
2143
  ${p => p.disabled && tws`tu-popover-list-item--disabled`}
2146
2144
  `;
2147
- const UnstyledAnchor = tw.a`
2145
+ const PopoverLink = twx(Link)`
2148
2146
  tu-popover-list-item__anchor
2149
2147
  `;
2150
2148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.151",
3
+ "version": "0.0.153",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -18,8 +18,8 @@
18
18
  "react-useportal": "1.0.16",
19
19
  "react-helmet": "^6.1.0",
20
20
  "@react-spring/web": "9.5.2",
21
- "@popperjs/core": "^2.11.6",
22
21
  "react-router-dom": "6.4.1",
22
+ "@popperjs/core": "^2.11.6",
23
23
  "react-select": "^5.4.0",
24
24
  "jest-canvas-mock": "^2.4.0"
25
25
  },