@jobber/components 8.1.1 → 8.2.0

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.
@@ -33,7 +33,6 @@ decision on whether to show or hide the units.
33
33
 
34
34
  * To display a unit of time that has already passed, use
35
35
  [FormatRelativeDateTime](../FormatRelativeDateTime/FormatRelativeDateTime.md)
36
- * To display time as a static unit, use [FormatTime](../FormatTime/FormatTime.md)
37
36
 
38
37
 
39
38
  ## Props
@@ -44,7 +44,6 @@
44
44
  [Form](./Form/Form.md)
45
45
  [FormatFile](./FormatFile/FormatFile.md)
46
46
  [FormatRelativeDateTime](./FormatRelativeDateTime/FormatRelativeDateTime.md)
47
- [FormatTime](./FormatTime/FormatTime.md)
48
47
  [FormField](./FormField/FormField.md)
49
48
  [Frame](./Frame/Frame.md)
50
49
  [Gallery](./Gallery/Gallery.md)
package/dist/index.cjs CHANGED
@@ -47,7 +47,6 @@ var useAtlantisFormFieldName = require('./useAtlantisFormFieldName-cjs.js');
47
47
  var FormFieldWrapper = require('./FormFieldWrapper-cjs.js');
48
48
  var FormatFile = require('./FormatFile-cjs.js');
49
49
  var FormatRelativeDateTime = require('./FormatRelativeDateTime-cjs.js');
50
- var FormatTime = require('./FormatTime-cjs.js');
51
50
  var Frame = require('./Frame-cjs.js');
52
51
  var Gallery = require('./Gallery-cjs.js');
53
52
  var Glimmer = require('./Glimmer-cjs.js');
@@ -275,7 +274,6 @@ exports.FormatFile = FormatFile.FormatFile;
275
274
  exports.useFormatFile = FormatFile.useFormatFile;
276
275
  exports.useFormatFileStyles = FormatFile.useFormatFileStyles;
277
276
  exports.FormatRelativeDateTime = FormatRelativeDateTime.FormatRelativeDateTime;
278
- exports.FormatTime = FormatTime.FormatTime;
279
277
  exports.Frame = Frame.Frame;
280
278
  exports.Gallery = Gallery.Gallery;
281
279
  exports.GLIMMER_TEST_ID = Glimmer.GLIMMER_TEST_ID;
package/dist/index.d.mts CHANGED
@@ -35,7 +35,6 @@ export * from "./Form";
35
35
  export * from "./FormField";
36
36
  export * from "./FormatFile";
37
37
  export * from "./FormatRelativeDateTime";
38
- export * from "./FormatTime";
39
38
  export * from "./Frame";
40
39
  export * from "./Gallery";
41
40
  export * from "./Glimmer";
package/dist/index.d.ts CHANGED
@@ -35,7 +35,6 @@ export * from "./Form";
35
35
  export * from "./FormField";
36
36
  export * from "./FormatFile";
37
37
  export * from "./FormatRelativeDateTime";
38
- export * from "./FormatTime";
39
38
  export * from "./Frame";
40
39
  export * from "./Gallery";
41
40
  export * from "./Glimmer";
package/dist/index.mjs CHANGED
@@ -45,7 +45,6 @@ export { u as useAtlantisFormFieldName } from './useAtlantisFormFieldName-es.js'
45
45
  export { A as AffixIcon, f as AffixLabel, F as FormFieldInputHorizontalWrapper, a as FormFieldInputWrapperStyles, b as FormFieldLabel, c as FormFieldWrapper, d as FormFieldWrapperMain, e as FormFieldWrapperToolbar, u as useFormFieldWrapperStyles } from './FormFieldWrapper-es.js';
46
46
  export { F as FormatFile, u as useFormatFile, a as useFormatFileStyles } from './FormatFile-es.js';
47
47
  export { F as FormatRelativeDateTime } from './FormatRelativeDateTime-es.js';
48
- export { F as FormatTime } from './FormatTime-es.js';
49
48
  export { F as Frame } from './Frame-es.js';
50
49
  export { G as Gallery } from './Gallery-es.js';
51
50
  export { a as GLIMMER_TEST_ID, G as Glimmer } from './Glimmer-es.js';
@@ -102,7 +102,6 @@
102
102
  "FormatFile.ThumbnailContainer",
103
103
  "FormatFile.Wrapper",
104
104
  "FormatRelativeDateTime",
105
- "FormatTime",
106
105
  "Frame",
107
106
  "Gallery",
108
107
  "Glimmer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.1.1",
3
+ "version": "8.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -210,11 +210,6 @@
210
210
  "import": "./dist/FormatRelativeDateTime/index.mjs",
211
211
  "require": "./dist/FormatRelativeDateTime/index.cjs"
212
212
  },
213
- "./FormatTime": {
214
- "types": "./dist/FormatTime/index.d.ts",
215
- "import": "./dist/FormatTime/index.mjs",
216
- "require": "./dist/FormatTime/index.cjs"
217
- },
218
213
  "./Frame": {
219
214
  "types": "./dist/Frame/index.d.ts",
220
215
  "import": "./dist/Frame/index.mjs",
@@ -568,5 +563,5 @@
568
563
  "> 1%",
569
564
  "IE 10"
570
565
  ],
571
- "gitHead": "e1e3f12cc8e95da666fcaff049e0a6930f39315a"
566
+ "gitHead": "95eed3cf18c0348874ee50b17bd3d927f392242d"
572
567
  }
package/FormatTime.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./dist/FormatTime";
package/FormatTime.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true,
5
- });
6
-
7
- var FormatTime = require("./dist/FormatTime");
8
-
9
- Object.keys(FormatTime).forEach(function(key) {
10
- if (key === "default" || key === "__esModule") return;
11
- Object.defineProperty(exports, key, {
12
- enumerable: true,
13
- get: function get() {
14
- return FormatTime[key];
15
- },
16
- });
17
- });
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- interface FormatTimeProps {
3
- /**
4
- * Time (as JS Date) to be displayed.
5
- *
6
- * A `string` should be an ISO 8601 format date string.
7
- */
8
- readonly time: Date | string;
9
- /**
10
- * Optionally specify clock format. If `undefined` system format will be respected.
11
- */
12
- readonly use24HourClock?: boolean;
13
- }
14
- export declare function FormatTime({ time: inputTime, use24HourClock, }: FormatTimeProps): React.JSX.Element;
15
- export {};
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var FormatTime = require('../FormatTime-cjs.js');
4
- require('react');
5
-
6
-
7
-
8
- exports.FormatTime = FormatTime.FormatTime;
@@ -1 +0,0 @@
1
- export { FormatTime } from "./FormatTime";
@@ -1,2 +0,0 @@
1
- export { F as FormatTime } from '../FormatTime-es.js';
2
- import 'react';
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function FormatTime({ time: inputTime, use24HourClock, }) {
6
- let dateObject;
7
- if (inputTime instanceof Date) {
8
- dateObject = inputTime;
9
- }
10
- else {
11
- dateObject = new Date(inputTime);
12
- }
13
- return React.createElement(React.Fragment, null, dateToLocaleTimeString(dateObject, use24HourClock));
14
- }
15
- function dateToLocaleTimeString(date, use24HourClock) {
16
- const language = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) ? navigator.language : "en";
17
- return date.toLocaleTimeString(language, {
18
- hourCycle: use24HourClock ? "h23" : "h12",
19
- minute: "2-digit",
20
- hour: "numeric",
21
- });
22
- }
23
-
24
- exports.FormatTime = FormatTime;
@@ -1,22 +0,0 @@
1
- import React__default from 'react';
2
-
3
- function FormatTime({ time: inputTime, use24HourClock, }) {
4
- let dateObject;
5
- if (inputTime instanceof Date) {
6
- dateObject = inputTime;
7
- }
8
- else {
9
- dateObject = new Date(inputTime);
10
- }
11
- return React__default.createElement(React__default.Fragment, null, dateToLocaleTimeString(dateObject, use24HourClock));
12
- }
13
- function dateToLocaleTimeString(date, use24HourClock) {
14
- const language = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) ? navigator.language : "en";
15
- return date.toLocaleTimeString(language, {
16
- hourCycle: use24HourClock ? "h23" : "h12",
17
- minute: "2-digit",
18
- hour: "numeric",
19
- });
20
- }
21
-
22
- export { FormatTime as F };
@@ -1,32 +0,0 @@
1
- # FormatTime
2
-
3
- In Jobber a FormatTime is used to ensure that time is displayed in the expected
4
- format. No text styling is applied, this simply formats the text.
5
-
6
- ## Specify format
7
-
8
- You can select a specific format to use in FormatTime.
9
-
10
- In the following example, we create a new `Date` object and set its time to
11
- 22:35:00 (10:35 PM) using the `setHours` method. The `setHours` method sets the
12
- hours, minutes, seconds, and milliseconds for a specified date.
13
-
14
- ```tsx
15
- const newDate = new Date();
16
- newDate.setHours(22, 35, 0, 0);
17
-
18
- <FormatTime time={newDate} use24HourClock={true} /> // prints 22:35
19
-
20
- <FormatTime time={newDate} use24HourClock={false} /> // prints 10:35 PM
21
-
22
- ```
23
-
24
-
25
- ## Props
26
-
27
- ### Web
28
-
29
- | Prop | Type | Required | Default | Description |
30
- |------|------|----------|---------|-------------|
31
- | `time` | `Date | string` | Yes | — | Time (as JS Date) to be displayed. A `string` should be an ISO 8601 format date string. |
32
- | `use24HourClock` | `boolean` | No | — | Optionally specify clock format. If `undefined` system format will be respected. |