@jobber/components 4.2.1 → 4.2.2-pre.2

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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CivilDate } from "@std-proposal/temporal";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
3
  /**
4
4
  * Options for deciding how much information is shown to the user
5
5
  * days, hours, minutes, seconds
@@ -11,7 +11,7 @@ interface CountdownProps {
11
11
  * Civil Time of time is to be displayed.
12
12
  * In the case of `date` a `string` should be in ISO 8601 format
13
13
  */
14
- readonly date: CivilDate | Date | number | string;
14
+ readonly date: Temporal.PlainDateTime | Date | number | string;
15
15
  /**
16
16
  * Whether or not to present the unit of time to the user, or just the raw numbers.
17
17
  */
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var temporal = require('@std-proposal/temporal');
7
6
  var ReactCountdown = require('react-countdown');
7
+ var polyfill = require('@js-temporal/polyfill');
8
8
 
9
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
10
 
@@ -18,7 +18,7 @@ function computeTimeUnit(remainder, unit) {
18
18
  function Countdown({ date: inputDate, onComplete, showUnits, granularity = "dhms", }) {
19
19
  const date = React.useMemo(() => {
20
20
  let initDate;
21
- if (inputDate instanceof temporal.CivilDate) {
21
+ if (inputDate instanceof polyfill.Temporal.PlainDateTime) {
22
22
  initDate = new Date(inputDate.year, inputDate.month - 1, inputDate.day);
23
23
  }
24
24
  else {
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CivilDate } from "@std-proposal/temporal";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
3
  interface FormatDateProps {
4
4
  /**
5
5
  * Date to be formatted.
6
6
  *
7
7
  * A `string` should be an ISO 8601 format date string.
8
8
  */
9
- readonly date: CivilDate | Date | string;
9
+ readonly date: Temporal.PlainDateTime | Date | string;
10
10
  }
11
11
  export declare function FormatDate({ date: inputDate }: FormatDateProps): JSX.Element;
12
12
  export declare function strFormatDate(date: Date): string;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CivilDateTime } from "@std-proposal/temporal";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
3
  interface FormatRelativeDateTimeProps {
4
4
  /**
5
5
  * Date to be displayed.
6
6
  *
7
7
  * A `string` should be an ISO 8601 format date string.
8
8
  */
9
- readonly date: CivilDateTime | Date | string;
9
+ readonly date: Temporal.PlainDateTime | Date | string;
10
10
  }
11
11
  export declare function FormatRelativeDateTime({ date: inputDate, }: FormatRelativeDateTimeProps): JSX.Element;
12
12
  export {};
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CivilTime } from "@std-proposal/temporal";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
3
  interface FormatTimeProps {
4
4
  /**
5
5
  * Civil Time of time to be displayed.
6
6
  *
7
7
  * A `string` should be an ISO 8601 format date string.
8
8
  */
9
- readonly time: CivilTime | Date | string;
9
+ readonly time: Temporal.PlainTime | Date | string;
10
10
  /**
11
11
  * Optionally specify clock format. If `undefined` system format will be respected.
12
12
  */
@@ -1,4 +1,4 @@
1
- import { CivilTime } from "@std-proposal/temporal";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
2
  import { CommonFormFieldProps, FormFieldProps } from "../FormField";
3
3
  export interface InputTimeProps extends Pick<CommonFormFieldProps, "align" | "description" | "disabled" | "invalid" | "inline" | "loading" | "name" | "onValidation" | "placeholder" | "size">, Pick<FormFieldProps, "maxLength" | "readonly" | "autocomplete" | "max" | "min" | "onEnter" | "onFocus" | "onBlur" | "inputRef" | "validations"> {
4
4
  /**
@@ -6,13 +6,13 @@ export interface InputTimeProps extends Pick<CommonFormFieldProps, "align" | "de
6
6
  * field with a data that is not controlled by the components state. If a
7
7
  * state is controlling the value, use the `value` prop instead.
8
8
  */
9
- readonly defaultValue?: CivilTime;
9
+ readonly defaultValue?: Temporal.PlainTime;
10
10
  /**
11
11
  * Set the component to the given value.
12
12
  */
13
- readonly value?: CivilTime;
13
+ readonly value?: Temporal.PlainTime;
14
14
  /**
15
15
  * Function called when user changes input value.
16
16
  */
17
- onChange?(newValue?: CivilTime): void;
17
+ onChange?(newValue?: Temporal.PlainTime): void;
18
18
  }
@@ -1,3 +1,3 @@
1
- import { CivilTime } from "@std-proposal/temporal";
2
- export declare function civilTimeToHTMLTime(civilTime?: CivilTime): string;
3
- export declare function htmlTimeToCivilTime(timeString: string): CivilTime | undefined;
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ export declare function civilTimeToHTMLTime(civilTime?: Temporal.PlainTime): string;
3
+ export declare function htmlTimeToCivilTime(timeString: string): Temporal.PlainTime | undefined;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib_es6 = require('../tslib.es6-5b8768b7.js');
6
6
  var React = require('react');
7
7
  var debounce = require('lodash/debounce');
8
- var temporal = require('@std-proposal/temporal');
8
+ var polyfill = require('@js-temporal/polyfill');
9
9
  var FormField = require('../FormField-e1c3af82.js');
10
10
  require('uuid');
11
11
  require('react-hook-form');
@@ -729,7 +729,7 @@ function civilTimeToHTMLTime(civilTime) {
729
729
  }
730
730
  function htmlTimeToCivilTime(timeString) {
731
731
  try {
732
- return temporal.CivilTime.fromString(timeString + ":00.000000000");
732
+ return polyfill.Temporal.PlainTime.from(timeString + ":00.000000000");
733
733
  }
734
734
  catch (_a) {
735
735
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "4.2.1",
3
+ "version": "4.2.2-pre.2+6b4bea28",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,11 +17,11 @@
17
17
  "dist/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@jobber/design": "*",
21
- "@jobber/formatters": "*",
22
- "@jobber/hooks": "*",
20
+ "@jobber/design": "^0.30.0",
21
+ "@jobber/formatters": "^0.2.2",
22
+ "@jobber/hooks": "^2.0.2",
23
+ "@js-temporal/polyfill": "^0.4.3",
23
24
  "@popperjs/core": "^2.0.6",
24
- "@std-proposal/temporal": "0.0.1",
25
25
  "@tanstack/react-table": "8.5.13",
26
26
  "@types/color": "^3.0.1",
27
27
  "@types/lodash": "^4.14.136",
@@ -82,5 +82,5 @@
82
82
  "> 1%",
83
83
  "IE 10"
84
84
  ],
85
- "gitHead": "89d4908fb1b114be65206f395a06e72f4a277d77"
85
+ "gitHead": "6b4bea281443f512231acb0241f723daa79cba29"
86
86
  }
package/rollup.config.js CHANGED
@@ -60,7 +60,7 @@ export default {
60
60
  "lodash",
61
61
  "uuid",
62
62
  "lodash/debounce",
63
- "@std-proposal/temporal",
63
+ "@js-temporal/polyfill",
64
64
  "@use-it/event-listener",
65
65
  "@jobber/design",
66
66
  "@jobber/formatters",