@jobber/components 4.2.2-pree.4 → 4.2.2-pree.5

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,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
+ import { CivilDate } from "@std-proposal/temporal";
3
4
  /**
4
5
  * Options for deciding how much information is shown to the user
5
6
  * days, hours, minutes, seconds
@@ -11,7 +12,7 @@ interface CountdownProps {
11
12
  * Civil Time of time is to be displayed.
12
13
  * In the case of `date` a `string` should be in ISO 8601 format
13
14
  */
14
- readonly date: Temporal.PlainDateTime | Date | number | string;
15
+ readonly date: Temporal.PlainDateTime | CivilDate | Date | number | string;
15
16
  /**
16
17
  * Whether or not to present the unit of time to the user, or just the raw numbers.
17
18
  */
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var ReactCountdown = require('react-countdown');
7
7
  var polyfill = require('@js-temporal/polyfill');
8
+ var temporal = require('@std-proposal/temporal');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
11
 
@@ -18,7 +19,8 @@ function computeTimeUnit(remainder, unit) {
18
19
  function Countdown({ date: inputDate, onComplete, showUnits, granularity = "dhms", }) {
19
20
  const date = React.useMemo(() => {
20
21
  let initDate;
21
- if (inputDate instanceof polyfill.Temporal.PlainDateTime) {
22
+ if (inputDate instanceof polyfill.Temporal.PlainDateTime ||
23
+ inputDate instanceof temporal.CivilDate) {
22
24
  initDate = new Date(inputDate.year, inputDate.month - 1, inputDate.day);
23
25
  }
24
26
  else {
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
+ import { CivilDate } from "@std-proposal/temporal";
3
4
  interface FormatDateProps {
4
5
  /**
5
6
  * Date to be formatted.
6
7
  *
7
8
  * A `string` should be an ISO 8601 format date string.
8
9
  */
9
- readonly date: Temporal.PlainDateTime | Date | string;
10
+ readonly date: Temporal.PlainDateTime | CivilDate | Date | string;
10
11
  }
11
12
  export declare function FormatDate({ date: inputDate }: FormatDateProps): JSX.Element;
12
13
  export declare function strFormatDate(date: Date): string;
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
+ import { CivilTime } from "@std-proposal/temporal";
3
4
  interface FormatTimeProps {
4
5
  /**
5
6
  * Civil Time of time to be displayed.
6
7
  *
7
8
  * A `string` should be an ISO 8601 format date string.
8
9
  */
9
- readonly time: Temporal.PlainTime | Date | string;
10
+ readonly time: Temporal.PlainTime | CivilTime | Date | string;
10
11
  /**
11
12
  * Optionally specify clock format. If `undefined` system format will be respected.
12
13
  */
@@ -1,4 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
+ import { CivilTime } from "@std-proposal/temporal";
2
3
  import { CommonFormFieldProps, FormFieldProps } from "../FormField";
3
4
  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
5
  /**
@@ -6,13 +7,13 @@ export interface InputTimeProps extends Pick<CommonFormFieldProps, "align" | "de
6
7
  * field with a data that is not controlled by the components state. If a
7
8
  * state is controlling the value, use the `value` prop instead.
8
9
  */
9
- readonly defaultValue?: Temporal.PlainTime;
10
+ readonly defaultValue?: Temporal.PlainTime | CivilTime;
10
11
  /**
11
12
  * Set the component to the given value.
12
13
  */
13
- readonly value?: Temporal.PlainTime;
14
+ readonly value?: Temporal.PlainTime | CivilTime;
14
15
  /**
15
16
  * Function called when user changes input value.
16
17
  */
17
- onChange?(newValue?: Temporal.PlainTime): void;
18
+ onChange?(newValue?: Temporal.PlainTime | CivilTime): void;
18
19
  }
@@ -1,3 +1,4 @@
1
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;
2
+ import { CivilTime } from "@std-proposal/temporal";
3
+ export declare function civilTimeToHTMLTime(civilTime?: Temporal.PlainTime | CivilTime): string;
4
+ export declare function htmlTimeToCivilTime(timeString: string): Temporal.PlainTime | CivilTime | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "4.2.2-pree.4+d7f53e1f",
3
+ "version": "4.2.2-pree.5+146d76cc",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -83,5 +83,5 @@
83
83
  "> 1%",
84
84
  "IE 10"
85
85
  ],
86
- "gitHead": "d7f53e1f31c29da62381450dccf2302d17eac991"
86
+ "gitHead": "146d76cc111487efd0143005bc9385e57e574678"
87
87
  }