@jobber/components 8.17.0 → 8.18.1

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.
@@ -441,8 +441,8 @@ Use `UNSAFE_style` to apply inline custom styles to the Banner.
441
441
 
442
442
  | Prop | Type | Required | Default | Description |
443
443
  |------|------|----------|---------|-------------|
444
- | `backgroundColor` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 269 more ... | "client--onSurface"` | No | — | Sets the background color of the icon. |
445
- | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 32 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
444
+ | `backgroundColor` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 270 more ... | "client--onSurface"` | No | — | Sets the background color of the icon. |
445
+ | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 33 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
446
446
  | `customColor` | `string` | No | — | Sets a custom color for the icon. Can be a rgb() or hex value. |
447
447
  | `name` | `IconNames` | No | — | The icon to show. |
448
448
  | `size` | `"base" | "large" | "small"` | No | `base` | Changes the size to small or large. |
@@ -206,9 +206,9 @@ defaults to respecting theme/modes.
206
206
  | `alignItems` | `AlignItems` | No | — | This feature is well established and works across many devices and browser versions. It’s been available across brows... |
207
207
  | `alignSelf` | `AlignSelf` | No | — | This feature is well established and works across many devices and browser versions. It’s been available across brows... |
208
208
  | `as` | `"article" | "aside" | "div" | "main" | "section" | "span"` | No | `div` | |
209
- | `background` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 269 more ... | "client--onSurface"` | No | — | |
209
+ | `background` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 270 more ... | "client--onSurface"` | No | — | |
210
210
  | `border` | `"base" | "thick" | "thicker" | "thickest" | BoxBorderWidth` | No | — | |
211
- | `borderColor` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 269 more ... | "client--onSurface"` | No | — | |
211
+ | `borderColor` | `"disabled" | "icon" | "event" | "invoice" | "job" | "quote" | "request" | "task" | "text" | "visit" | "warning" | "success" | "base-grey--100" | "base-grey--200" | "base-grey--300" | ... 270 more ... | "client--onSurface"` | No | — | |
212
212
  | `direction` | `FlexDirection` | No | — | |
213
213
  | `gap` | `"base" | "extravagant" | "large" | "larger" | "largest" | "minuscule" | "slim" | "small" | "smaller" | "smallest"` | No | — | |
214
214
  | `height` | `BoxDimension` | No | `auto` | |
@@ -956,6 +956,6 @@ export const styles = StyleSheet.create({
956
956
  | `numberOfLines` | `number` | No | — | |
957
957
  | `size` | `"base" | "extravagant" | "jumbo" | "large" | "larger" | "largest" | "small" | "smaller"` | No | — | |
958
958
  | `textCase` | `"capitalize" | "lowercase" | "none" | "uppercase"` | No | — | |
959
- | `underline` | `UnderlineStyle | "solid color-indigo" | "solid color-indigo--light" | "solid color-indigo--lighter" | "solid color-indigo--lightest" | "solid color-indigo--dark" | ... 646 more ... | "dashed color-client--onSurface"` | No | — | The style (and optionally a color) of underline the text is decorated with. All semantic color tokens (other than the... |
959
+ | `underline` | `UnderlineStyle | "solid color-indigo" | "solid color-indigo--light" | "solid color-indigo--lighter" | "solid color-indigo--lightest" | "solid color-indigo--dark" | ... 650 more ... | "dashed color-client--onSurface"` | No | — | The style (and optionally a color) of underline the text is decorated with. All semantic color tokens (other than the... |
960
960
  | `UNSAFE_className` | `{ textStyle?: string; }` | No | — | **Use at your own risk:** Custom classNames for specific elements. This should only be used as a **last resort**. Usi... |
961
961
  | `UNSAFE_style` | `{ textStyle?: CSSProperties; }` | No | — | **Use at your own risk:** Custom style for specific elements. This should only be used as a **last resort**. Using th... |
@@ -29,11 +29,6 @@ Consider the context of the countdown and whether the user will have enough
29
29
  context to interpret appropriately without labeled units when making the
30
30
  decision on whether to show or hide the units.
31
31
 
32
- ## Related components
33
-
34
- * To display a unit of time that has already passed, use
35
- [FormatRelativeDateTime](../FormatRelativeDateTime/FormatRelativeDateTime.md)
36
-
37
32
 
38
33
  ## Props
39
34
 
@@ -54,5 +54,3 @@ If using a custom activator, ensure that the activator is keyboard-operable.
54
54
  * If you are looking to use the `DatePicker` in a `Form`, consider the
55
55
  [InputDate](../InputDate/InputDate.md) component.
56
56
  * For a time input, use [InputTime](../InputTime/InputTime.md)
57
- * To represent past or future dates and times, use
58
- [FormatRelativeDateTime](../FormatRelativeDateTime/FormatRelativeDateTime.md)
@@ -583,7 +583,7 @@ necessary.
583
583
  | Prop | Type | Required | Default | Description |
584
584
  |------|------|----------|---------|-------------|
585
585
  | `name` | `IconNames` | Yes | — | The icon to show. |
586
- | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 32 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
586
+ | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 33 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
587
587
  | `customColor` | `string` | No | — | Sets a custom color for the icon. Can be a rgb() or hex value. |
588
588
  | `size` | `"base" | "large" | "small"` | No | `base` | Changes the size to small or large. |
589
589
  | `testID` | `string` | No | — | Used to locate this view in end-to-end tests |
@@ -502,7 +502,7 @@ and should not be used for new implementations.
502
502
  | Prop | Type | Required | Default | Description |
503
503
  |------|------|----------|---------|-------------|
504
504
  | `name` | `IconNames` | Yes | — | The icon to show. |
505
- | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 32 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
505
+ | `color` | `"disabled" | "icon" | "task" | "text" | "warning" | "success" | "blue" | "green" | "yellow" | "red" | "grey" | "white" | "greyBlue" | "lightBlue" | "orange" | "navy" | "interactive" | ... 33 more ... | "brandHighlight"` | No | — | Determines the color of the icon. Some icons have a default system colour like quotes, jobs, and invoices. Others tha... |
506
506
  | `customColor` | `string` | No | — | Sets a custom color for the icon. Can be a rgb() or hex value. |
507
507
  | `size` | `"base" | "large" | "small"` | No | `base` | Changes the size to small or large. |
508
508
  | `testID` | `string` | No | — | Used to locate this view in end-to-end tests |
@@ -40,7 +40,6 @@
40
40
  [FilterPicker](./FilterPicker/FilterPicker.md)
41
41
  [Flex](./Flex/Flex.md)
42
42
  [FormatFile](./FormatFile/FormatFile.md)
43
- [FormatRelativeDateTime](./FormatRelativeDateTime/FormatRelativeDateTime.md)
44
43
  [formatting](./formatting/formatting.md)
45
44
  [Frame](./Frame/Frame.md)
46
45
  [Gallery](./Gallery/Gallery.md)
package/dist/index.cjs CHANGED
@@ -43,7 +43,6 @@ var Flex = require('./Flex-cjs.js');
43
43
  var useAtlantisFormFieldName = require('./useAtlantisFormFieldName-cjs.js');
44
44
  var FormFieldWrapper = require('./FormFieldWrapper-cjs.js');
45
45
  var FormatFile = require('./FormatFile-cjs.js');
46
- var FormatRelativeDateTime = require('./FormatRelativeDateTime-cjs.js');
47
46
  var Frame = require('./Frame-cjs.js');
48
47
  var Gallery = require('./Gallery-cjs.js');
49
48
  var Glimmer = require('./Glimmer-cjs.js');
@@ -261,7 +260,6 @@ exports.useFormFieldWrapperStyles = FormFieldWrapper.useFormFieldWrapperStyles;
261
260
  exports.FormatFile = FormatFile.FormatFile;
262
261
  exports.useFormatFile = FormatFile.useFormatFile;
263
262
  exports.useFormatFileStyles = FormatFile.useFormatFileStyles;
264
- exports.FormatRelativeDateTime = FormatRelativeDateTime.FormatRelativeDateTime;
265
263
  exports.Frame = Frame.Frame;
266
264
  exports.Gallery = Gallery.Gallery;
267
265
  exports.GLIMMER_TEST_ID = Glimmer.GLIMMER_TEST_ID;
package/dist/index.d.mts CHANGED
@@ -32,7 +32,6 @@ export * from "./FeatureSwitch";
32
32
  export * from "./Flex";
33
33
  export * from "./FormField";
34
34
  export * from "./FormatFile";
35
- export * from "./FormatRelativeDateTime";
36
35
  export * from "./Frame";
37
36
  export * from "./Gallery";
38
37
  export * from "./Glimmer";
package/dist/index.d.ts CHANGED
@@ -32,7 +32,6 @@ export * from "./FeatureSwitch";
32
32
  export * from "./Flex";
33
33
  export * from "./FormField";
34
34
  export * from "./FormatFile";
35
- export * from "./FormatRelativeDateTime";
36
35
  export * from "./Frame";
37
36
  export * from "./Gallery";
38
37
  export * from "./Glimmer";
package/dist/index.mjs CHANGED
@@ -41,7 +41,6 @@ export { F as Flex } from './Flex-es.js';
41
41
  export { u as useAtlantisFormFieldName } from './useAtlantisFormFieldName-es.js';
42
42
  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';
43
43
  export { F as FormatFile, u as useFormatFile, a as useFormatFileStyles } from './FormatFile-es.js';
44
- export { F as FormatRelativeDateTime } from './FormatRelativeDateTime-es.js';
45
44
  export { F as Frame } from './Frame-es.js';
46
45
  export { G as Gallery } from './Gallery-es.js';
47
46
  export { a as GLIMMER_TEST_ID, G as Glimmer } from './Glimmer-es.js';
@@ -97,7 +97,6 @@
97
97
  "FormatFile.ProgressContainer",
98
98
  "FormatFile.ThumbnailContainer",
99
99
  "FormatFile.Wrapper",
100
- "FormatRelativeDateTime",
101
100
  "Frame",
102
101
  "Gallery",
103
102
  "Glimmer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.17.0",
3
+ "version": "8.18.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -195,11 +195,6 @@
195
195
  "import": "./dist/FormatFile/index.mjs",
196
196
  "require": "./dist/FormatFile/index.cjs"
197
197
  },
198
- "./FormatRelativeDateTime": {
199
- "types": "./dist/FormatRelativeDateTime/index.d.ts",
200
- "import": "./dist/FormatRelativeDateTime/index.mjs",
201
- "require": "./dist/FormatRelativeDateTime/index.cjs"
202
- },
203
198
  "./Frame": {
204
199
  "types": "./dist/Frame/index.d.ts",
205
200
  "import": "./dist/Frame/index.mjs",
@@ -492,7 +487,7 @@
492
487
  "devDependencies": {
493
488
  "@apollo/client": "^3.7.10",
494
489
  "@csstools/postcss-global-data": "^1.0.3",
495
- "@jobber/design": "0.104.0",
490
+ "@jobber/design": "0.105.0",
496
491
  "@jobber/hooks": "2.21.0",
497
492
  "@rollup/plugin-alias": "^5.1.0",
498
493
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -546,5 +541,5 @@
546
541
  "> 1%",
547
542
  "IE 10"
548
543
  ],
549
- "gitHead": "202afd57218f0140cd2cf489742f99afd22e6b2c"
544
+ "gitHead": "b13d0074cac7624ef3b8efa7e79e26697d9e15a6"
550
545
  }
@@ -1 +0,0 @@
1
- export * from "./dist/FormatRelativeDateTime";
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true,
5
- });
6
-
7
- var FormatRelativeDateTime = require("./dist/FormatRelativeDateTime");
8
-
9
- Object.keys(FormatRelativeDateTime).forEach(function(key) {
10
- if (key === "default" || key === "__esModule") return;
11
- Object.defineProperty(exports, key, {
12
- enumerable: true,
13
- get: function get() {
14
- return FormatRelativeDateTime[key];
15
- },
16
- });
17
- });
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- interface FormatRelativeDateTimeProps {
3
- /**
4
- * Date to be displayed.
5
- *
6
- * A `string` should be an ISO 8601 format date string.
7
- */
8
- readonly date: Date | string;
9
- }
10
- export declare function FormatRelativeDateTime({ date: inputDate, }: FormatRelativeDateTimeProps): React.JSX.Element;
11
- export {};
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var FormatRelativeDateTime = require('../FormatRelativeDateTime-cjs.js');
4
- require('react');
5
-
6
-
7
-
8
- exports.FormatRelativeDateTime = FormatRelativeDateTime.FormatRelativeDateTime;
@@ -1 +0,0 @@
1
- export { FormatRelativeDateTime } from "./FormatRelativeDateTime";
@@ -1,2 +0,0 @@
1
- export { F as FormatRelativeDateTime } from '../FormatRelativeDateTime-es.js';
2
- import 'react';
@@ -1,63 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function FormatRelativeDateTime({ date: inputDate, }) {
6
- let dateObject;
7
- if (inputDate instanceof Date) {
8
- dateObject = inputDate;
9
- }
10
- else {
11
- dateObject = new Date(inputDate);
12
- }
13
- const now = Date.now() / 1000; //seconds
14
- const date = dateObject;
15
- const delta = now - date.getTime() / 1000; //seconds;
16
- switch (relativeTimeRange(delta)) {
17
- case "less than an hour":
18
- return React.createElement(React.Fragment, null, showMinutes(Math.round(delta / 60)));
19
- case "less then a day":
20
- return (React.createElement(React.Fragment, null, date.toLocaleTimeString(undefined, {
21
- hour: "numeric",
22
- minute: "numeric",
23
- })));
24
- case "less than a week":
25
- return React.createElement(React.Fragment, null, strFormatDate(date, { weekday: "short" }));
26
- case "less than a year":
27
- return React.createElement(React.Fragment, null, strFormatDate(date, { month: "short", day: "numeric" }));
28
- default:
29
- return (React.createElement(React.Fragment, null, strFormatDate(date, {
30
- month: "short",
31
- day: "numeric",
32
- year: "numeric",
33
- })));
34
- }
35
- }
36
- function relativeTimeRange(delta) {
37
- delta = delta / 60;
38
- if (delta < 60)
39
- return "less than an hour";
40
- delta = delta / 60;
41
- if (delta < 24)
42
- return "less then a day";
43
- delta = delta / 24;
44
- if (delta < 7)
45
- return "less than a week";
46
- delta = delta / 365;
47
- if (delta < 1)
48
- return "less than a year";
49
- return "a year or more";
50
- }
51
- function strFormatDate(date, options) {
52
- return date.toLocaleDateString(undefined, options);
53
- }
54
- function showMinutes(minutes) {
55
- if (minutes <= 1) {
56
- return "1 minute ago";
57
- }
58
- else {
59
- return minutes + " minutes ago";
60
- }
61
- }
62
-
63
- exports.FormatRelativeDateTime = FormatRelativeDateTime;
@@ -1,61 +0,0 @@
1
- import React__default from 'react';
2
-
3
- function FormatRelativeDateTime({ date: inputDate, }) {
4
- let dateObject;
5
- if (inputDate instanceof Date) {
6
- dateObject = inputDate;
7
- }
8
- else {
9
- dateObject = new Date(inputDate);
10
- }
11
- const now = Date.now() / 1000; //seconds
12
- const date = dateObject;
13
- const delta = now - date.getTime() / 1000; //seconds;
14
- switch (relativeTimeRange(delta)) {
15
- case "less than an hour":
16
- return React__default.createElement(React__default.Fragment, null, showMinutes(Math.round(delta / 60)));
17
- case "less then a day":
18
- return (React__default.createElement(React__default.Fragment, null, date.toLocaleTimeString(undefined, {
19
- hour: "numeric",
20
- minute: "numeric",
21
- })));
22
- case "less than a week":
23
- return React__default.createElement(React__default.Fragment, null, strFormatDate(date, { weekday: "short" }));
24
- case "less than a year":
25
- return React__default.createElement(React__default.Fragment, null, strFormatDate(date, { month: "short", day: "numeric" }));
26
- default:
27
- return (React__default.createElement(React__default.Fragment, null, strFormatDate(date, {
28
- month: "short",
29
- day: "numeric",
30
- year: "numeric",
31
- })));
32
- }
33
- }
34
- function relativeTimeRange(delta) {
35
- delta = delta / 60;
36
- if (delta < 60)
37
- return "less than an hour";
38
- delta = delta / 60;
39
- if (delta < 24)
40
- return "less then a day";
41
- delta = delta / 24;
42
- if (delta < 7)
43
- return "less than a week";
44
- delta = delta / 365;
45
- if (delta < 1)
46
- return "less than a year";
47
- return "a year or more";
48
- }
49
- function strFormatDate(date, options) {
50
- return date.toLocaleDateString(undefined, options);
51
- }
52
- function showMinutes(minutes) {
53
- if (minutes <= 1) {
54
- return "1 minute ago";
55
- }
56
- else {
57
- return minutes + " minutes ago";
58
- }
59
- }
60
-
61
- export { FormatRelativeDateTime as F };
@@ -1,30 +0,0 @@
1
- # FormatRelativeDateTime
2
-
3
- A FormatRelateDateTime displays the date and time using relative wording or
4
- approximate values. This component only represents current date and dates in the
5
- past. No future dating.
6
-
7
- ## Rules
8
-
9
- If the message was received less than an hour ago the format is x minutes ago.
10
-
11
- If the message was received today, but more than an hour ago, the format becomes
12
- the hours and minutes it was received at.
13
-
14
- If the message was received within the last six days, the format is Sun, Mon,
15
- Tue, Wed, Thu, Fri, Sat.
16
-
17
- If the message was received between six days ago and yesterday’s date one year
18
- previous, the format is Month Date.
19
-
20
- If the message was received exactly one year ago or more than one year ago, the
21
- format is Month Day, Year.
22
-
23
-
24
- ## Props
25
-
26
- ### Web
27
-
28
- | Prop | Type | Required | Default | Description |
29
- |------|------|----------|---------|-------------|
30
- | `date` | `Date | string` | Yes | — | Date to be displayed. A `string` should be an ISO 8601 format date string. |