@jobber/components 6.60.4 → 6.61.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.
- package/dist/AtlantisThemeContext-es.js +1 -1
- package/dist/Autocomplete/index.cjs +2 -2
- package/dist/Autocomplete/index.mjs +2 -2
- package/dist/Checkbox/Checkbox.rebuilt.d.ts +6 -2
- package/dist/Checkbox/Checkbox.types.d.ts +4 -0
- package/dist/Checkbox/index.cjs +10 -8
- package/dist/Checkbox/index.d.ts +1 -1
- package/dist/Checkbox/index.mjs +11 -9
- package/dist/ConfirmationModal/index.cjs +2 -2
- package/dist/ConfirmationModal/index.mjs +2 -2
- package/dist/FormatFile/index.cjs +2 -2
- package/dist/FormatFile/index.mjs +2 -2
- package/dist/Modal/Modal.types.d.ts +5 -1
- package/dist/Modal/index.cjs +10 -7
- package/dist/Modal/index.mjs +10 -7
- package/dist/Modal/useModal.d.ts +1 -0
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseGet-es.js +1 -1
- package/dist/identity-cjs.js +4 -0
- package/dist/identity-es.js +4 -1
- package/dist/keysIn-es.js +1 -1
- package/dist/omit-es.js +1 -1
- package/dist/styles.css +21 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tokens, darkTokens } from '@jobber/design';
|
|
2
2
|
import React__default, { createContext, useState, useCallback, useEffect, useContext } from 'react';
|
|
3
3
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
4
|
-
import { e as eq_1,
|
|
4
|
+
import { e as eq_1, c as _Stack } from './identity-es.js';
|
|
5
5
|
import { _ as _baseAssignValue } from './_baseAssignValue-es.js';
|
|
6
6
|
import { _ as _baseFor } from './_baseFor-es.js';
|
|
7
7
|
import { _ as _copyObject, k as keysIn_1, a as _cloneBufferExports, b as _cloneTypedArray, c as _copyArray, d as _initCloneObject, i as isPlainObject_1 } from './keysIn-es.js';
|
|
@@ -20,11 +20,11 @@ require('../ButtonDismiss-cjs.js');
|
|
|
20
20
|
require('../noop-cjs.js');
|
|
21
21
|
require('../_commonjsHelpers-cjs.js');
|
|
22
22
|
require('../floating-ui.react-cjs.js');
|
|
23
|
-
require('../AtlantisPortalContent-cjs.js');
|
|
24
|
-
require('../AtlantisThemeContext-cjs.js');
|
|
25
23
|
require('../identity-cjs.js');
|
|
26
24
|
require('../isTypedArray-cjs.js');
|
|
27
25
|
require('../isObjectLike-cjs.js');
|
|
26
|
+
require('../AtlantisPortalContent-cjs.js');
|
|
27
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
28
28
|
require('../_baseAssignValue-cjs.js');
|
|
29
29
|
require('../_baseFor-cjs.js');
|
|
30
30
|
require('../keysIn-cjs.js');
|
|
@@ -18,11 +18,11 @@ import '../ButtonDismiss-es.js';
|
|
|
18
18
|
import '../noop-es.js';
|
|
19
19
|
import '../_commonjsHelpers-es.js';
|
|
20
20
|
import '../floating-ui.react-es.js';
|
|
21
|
-
import '../AtlantisPortalContent-es.js';
|
|
22
|
-
import '../AtlantisThemeContext-es.js';
|
|
23
21
|
import '../identity-es.js';
|
|
24
22
|
import '../isTypedArray-es.js';
|
|
25
23
|
import '../isObjectLike-es.js';
|
|
24
|
+
import '../AtlantisPortalContent-es.js';
|
|
25
|
+
import '../AtlantisThemeContext-es.js';
|
|
26
26
|
import '../_baseAssignValue-es.js';
|
|
27
27
|
import '../_baseFor-es.js';
|
|
28
28
|
import '../keysIn-es.js';
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare const CheckboxRebuilt: React.ForwardRefExoticComponent<Omit<import("./Checkbox.types").BaseCheckboxProps, "children" | "onChange" | "label" | "description"> & {
|
|
3
|
+
label?: string | React.ReactElement;
|
|
4
|
+
description?: string | React.ReactElement;
|
|
5
|
+
onChange?(newValue: boolean, event: React.ChangeEvent<HTMLInputElement>): void;
|
|
6
|
+
version: 2;
|
|
7
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -49,6 +49,10 @@ export interface BaseCheckboxProps {
|
|
|
49
49
|
* Called when the checkbox loses focus
|
|
50
50
|
*/
|
|
51
51
|
onBlur?(event: React.FocusEvent<HTMLInputElement>): void;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the checkbox is invalid
|
|
54
|
+
*/
|
|
55
|
+
invalid?: boolean;
|
|
52
56
|
}
|
|
53
57
|
interface CheckboxLabelProps extends BaseCheckboxProps {
|
|
54
58
|
/**
|
package/dist/Checkbox/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var Text = require('../Text-cjs.js');
|
|
|
9
9
|
require('@jobber/design');
|
|
10
10
|
require('../Typography-cjs.js');
|
|
11
11
|
|
|
12
|
-
var styles = {"checkBoxParent":"YxKKPXAU10s-","wrapper":"KxWx-msbH9c-","disabled":"TKr3J-6ARFo-","checkHolder":"NO34ZbhNqhI-","input":"XnCmS-EzK2M-","checkBox":"_-8JCQE6SA9s-","indeterminate":"rqHq3ff9In0-","label":"l8z5TxzVvqA-","description":"DcBfVgpiWa4-","spinning":"rFBN9M5-4Ok-"};
|
|
12
|
+
var styles = {"checkBoxParent":"YxKKPXAU10s-","wrapper":"KxWx-msbH9c-","disabled":"TKr3J-6ARFo-","checkHolder":"NO34ZbhNqhI-","input":"XnCmS-EzK2M-","checkBox":"_-8JCQE6SA9s-","indeterminate":"rqHq3ff9In0-","invalid":"Gqnclw4WaeQ-","label":"l8z5TxzVvqA-","description":"DcBfVgpiWa4-","spinning":"rFBN9M5-4Ok-"};
|
|
13
13
|
|
|
14
14
|
function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, children, onBlur, onChange, onFocus, }) {
|
|
15
15
|
const { control, setValue, watch } = reactHookForm.useFormContext() != undefined
|
|
@@ -54,8 +54,8 @@ function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value,
|
|
|
54
54
|
} }));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled);
|
|
57
|
+
const CheckboxRebuilt = React.forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, }, ref) {
|
|
58
|
+
const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
|
|
59
59
|
const inputClassName = classnames(styles.input, {
|
|
60
60
|
[styles.indeterminate]: indeterminate,
|
|
61
61
|
});
|
|
@@ -69,21 +69,23 @@ function CheckboxRebuilt({ checked, defaultChecked, disabled, label, name, value
|
|
|
69
69
|
return (React.createElement("div", { className: styles.checkBoxParent },
|
|
70
70
|
React.createElement("label", { className: wrapperClassName },
|
|
71
71
|
React.createElement("span", { className: styles.checkHolder },
|
|
72
|
-
React.createElement("input", { type: "checkbox", id: id, className: inputClassName, name: name, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
|
|
72
|
+
React.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
|
|
73
73
|
React.createElement("span", { className: styles.checkBox },
|
|
74
74
|
React.createElement(Icon.Icon, { name: iconName, color: "surface" }))),
|
|
75
75
|
labelContent && React.createElement("span", { className: styles.label }, labelContent)),
|
|
76
76
|
description && (React.createElement("div", { className: styles.description }, descriptionContent))));
|
|
77
|
-
}
|
|
77
|
+
});
|
|
78
|
+
CheckboxRebuilt.displayName = "CheckboxRebuilt";
|
|
78
79
|
|
|
79
80
|
function isNewCheckboxProps(props) {
|
|
80
81
|
return props.version === 2;
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
const Checkbox = React.forwardRef(function CheckboxShim(props, ref) {
|
|
83
84
|
if (isNewCheckboxProps(props)) {
|
|
84
|
-
return React.createElement(CheckboxRebuilt, Object.assign({}, props));
|
|
85
|
+
return React.createElement(CheckboxRebuilt, Object.assign({}, props, { ref: ref }));
|
|
85
86
|
}
|
|
86
87
|
return React.createElement(CheckboxLegacy, Object.assign({}, props));
|
|
87
|
-
}
|
|
88
|
+
});
|
|
89
|
+
Checkbox.displayName = "Checkbox";
|
|
88
90
|
|
|
89
91
|
exports.Checkbox = Checkbox;
|
package/dist/Checkbox/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CheckboxLegacyProps, CheckboxRebuiltProps } from "./Checkbox.types";
|
|
3
3
|
type CheckboxShimProps = CheckboxLegacyProps | CheckboxRebuiltProps;
|
|
4
|
-
export declare
|
|
4
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxShimProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
5
|
export type { CheckboxLegacyProps, CheckboxRebuiltProps };
|
package/dist/Checkbox/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { useState, useId, useEffect } from 'react';
|
|
1
|
+
import React__default, { useState, useId, useEffect, forwardRef } from 'react';
|
|
2
2
|
import { _ as __rest } from '../tslib.es6-es.js';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useFormContext, useForm, Controller } from 'react-hook-form';
|
|
@@ -7,7 +7,7 @@ import { T as Text } from '../Text-es.js';
|
|
|
7
7
|
import '@jobber/design';
|
|
8
8
|
import '../Typography-es.js';
|
|
9
9
|
|
|
10
|
-
var styles = {"checkBoxParent":"YxKKPXAU10s-","wrapper":"KxWx-msbH9c-","disabled":"TKr3J-6ARFo-","checkHolder":"NO34ZbhNqhI-","input":"XnCmS-EzK2M-","checkBox":"_-8JCQE6SA9s-","indeterminate":"rqHq3ff9In0-","label":"l8z5TxzVvqA-","description":"DcBfVgpiWa4-","spinning":"rFBN9M5-4Ok-"};
|
|
10
|
+
var styles = {"checkBoxParent":"YxKKPXAU10s-","wrapper":"KxWx-msbH9c-","disabled":"TKr3J-6ARFo-","checkHolder":"NO34ZbhNqhI-","input":"XnCmS-EzK2M-","checkBox":"_-8JCQE6SA9s-","indeterminate":"rqHq3ff9In0-","invalid":"Gqnclw4WaeQ-","label":"l8z5TxzVvqA-","description":"DcBfVgpiWa4-","spinning":"rFBN9M5-4Ok-"};
|
|
11
11
|
|
|
12
12
|
function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, children, onBlur, onChange, onFocus, }) {
|
|
13
13
|
const { control, setValue, watch } = useFormContext() != undefined
|
|
@@ -52,8 +52,8 @@ function CheckboxLegacy({ checked, defaultChecked, disabled, label, name, value,
|
|
|
52
52
|
} }));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled);
|
|
55
|
+
const CheckboxRebuilt = forwardRef(function CheckboxRebuiltInternal({ checked, defaultChecked, disabled, label, name, value, indeterminate = false, description, id, onBlur, onChange, onFocus, invalid, }, ref) {
|
|
56
|
+
const wrapperClassName = classnames(styles.wrapper, disabled && styles.disabled, invalid && styles.invalid);
|
|
57
57
|
const inputClassName = classnames(styles.input, {
|
|
58
58
|
[styles.indeterminate]: indeterminate,
|
|
59
59
|
});
|
|
@@ -67,21 +67,23 @@ function CheckboxRebuilt({ checked, defaultChecked, disabled, label, name, value
|
|
|
67
67
|
return (React__default.createElement("div", { className: styles.checkBoxParent },
|
|
68
68
|
React__default.createElement("label", { className: wrapperClassName },
|
|
69
69
|
React__default.createElement("span", { className: styles.checkHolder },
|
|
70
|
-
React__default.createElement("input", { type: "checkbox", id: id, className: inputClassName, name: name, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
|
|
70
|
+
React__default.createElement("input", { ref: ref, type: "checkbox", id: id, className: inputClassName, name: name, checked: checked, value: value, defaultChecked: defaultChecked, disabled: disabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }),
|
|
71
71
|
React__default.createElement("span", { className: styles.checkBox },
|
|
72
72
|
React__default.createElement(Icon, { name: iconName, color: "surface" }))),
|
|
73
73
|
labelContent && React__default.createElement("span", { className: styles.label }, labelContent)),
|
|
74
74
|
description && (React__default.createElement("div", { className: styles.description }, descriptionContent))));
|
|
75
|
-
}
|
|
75
|
+
});
|
|
76
|
+
CheckboxRebuilt.displayName = "CheckboxRebuilt";
|
|
76
77
|
|
|
77
78
|
function isNewCheckboxProps(props) {
|
|
78
79
|
return props.version === 2;
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
const Checkbox = forwardRef(function CheckboxShim(props, ref) {
|
|
81
82
|
if (isNewCheckboxProps(props)) {
|
|
82
|
-
return React__default.createElement(CheckboxRebuilt, Object.assign({}, props));
|
|
83
|
+
return React__default.createElement(CheckboxRebuilt, Object.assign({}, props, { ref: ref }));
|
|
83
84
|
}
|
|
84
85
|
return React__default.createElement(CheckboxLegacy, Object.assign({}, props));
|
|
85
|
-
}
|
|
86
|
+
});
|
|
87
|
+
Checkbox.displayName = "Checkbox";
|
|
86
88
|
|
|
87
89
|
export { Checkbox };
|
|
@@ -20,11 +20,11 @@ require('../ButtonDismiss-cjs.js');
|
|
|
20
20
|
require('../noop-cjs.js');
|
|
21
21
|
require('../_commonjsHelpers-cjs.js');
|
|
22
22
|
require('../floating-ui.react-cjs.js');
|
|
23
|
-
require('../AtlantisPortalContent-cjs.js');
|
|
24
|
-
require('../AtlantisThemeContext-cjs.js');
|
|
25
23
|
require('../identity-cjs.js');
|
|
26
24
|
require('../isTypedArray-cjs.js');
|
|
27
25
|
require('../isObjectLike-cjs.js');
|
|
26
|
+
require('../AtlantisPortalContent-cjs.js');
|
|
27
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
28
28
|
require('../_baseAssignValue-cjs.js');
|
|
29
29
|
require('../_baseFor-cjs.js');
|
|
30
30
|
require('../keysIn-cjs.js');
|
|
@@ -18,11 +18,11 @@ import '../ButtonDismiss-es.js';
|
|
|
18
18
|
import '../noop-es.js';
|
|
19
19
|
import '../_commonjsHelpers-es.js';
|
|
20
20
|
import '../floating-ui.react-es.js';
|
|
21
|
-
import '../AtlantisPortalContent-es.js';
|
|
22
|
-
import '../AtlantisThemeContext-es.js';
|
|
23
21
|
import '../identity-es.js';
|
|
24
22
|
import '../isTypedArray-es.js';
|
|
25
23
|
import '../isObjectLike-es.js';
|
|
24
|
+
import '../AtlantisPortalContent-es.js';
|
|
25
|
+
import '../AtlantisThemeContext-es.js';
|
|
26
26
|
import '../_baseAssignValue-es.js';
|
|
27
27
|
import '../_baseFor-es.js';
|
|
28
28
|
import '../keysIn-es.js';
|
|
@@ -27,11 +27,11 @@ require('../ButtonDismiss-cjs.js');
|
|
|
27
27
|
require('../noop-cjs.js');
|
|
28
28
|
require('../_commonjsHelpers-cjs.js');
|
|
29
29
|
require('../floating-ui.react-cjs.js');
|
|
30
|
-
require('../AtlantisPortalContent-cjs.js');
|
|
31
|
-
require('../AtlantisThemeContext-cjs.js');
|
|
32
30
|
require('../identity-cjs.js');
|
|
33
31
|
require('../isTypedArray-cjs.js');
|
|
34
32
|
require('../isObjectLike-cjs.js');
|
|
33
|
+
require('../AtlantisPortalContent-cjs.js');
|
|
34
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
35
35
|
require('../_baseAssignValue-cjs.js');
|
|
36
36
|
require('../_baseFor-cjs.js');
|
|
37
37
|
require('../keysIn-cjs.js');
|
|
@@ -25,11 +25,11 @@ import '../ButtonDismiss-es.js';
|
|
|
25
25
|
import '../noop-es.js';
|
|
26
26
|
import '../_commonjsHelpers-es.js';
|
|
27
27
|
import '../floating-ui.react-es.js';
|
|
28
|
-
import '../AtlantisPortalContent-es.js';
|
|
29
|
-
import '../AtlantisThemeContext-es.js';
|
|
30
28
|
import '../identity-es.js';
|
|
31
29
|
import '../isTypedArray-es.js';
|
|
32
30
|
import '../isObjectLike-es.js';
|
|
31
|
+
import '../AtlantisPortalContent-es.js';
|
|
32
|
+
import '../AtlantisThemeContext-es.js';
|
|
33
33
|
import '../_baseAssignValue-es.js';
|
|
34
34
|
import '../_baseFor-es.js';
|
|
35
35
|
import '../keysIn-es.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MutableRefObject, PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
import { ExtendedRefs, FloatingContext, ReferenceType } from "@floating-ui/react";
|
|
2
|
+
import { ExtendedRefs, FloatingContext, ReferenceType, UseInteractionsReturn } from "@floating-ui/react";
|
|
3
3
|
import { XOR } from "ts-xor";
|
|
4
4
|
import sizes from "./ModalSizes.module.css";
|
|
5
5
|
import { ButtonProps } from "../Button";
|
|
@@ -65,6 +65,10 @@ export interface ModalContextType {
|
|
|
65
65
|
* @default "ATL-Modal-Header"
|
|
66
66
|
*/
|
|
67
67
|
readonly modalLabelledBy?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Floating-ui props to position the modal.
|
|
70
|
+
*/
|
|
71
|
+
readonly getFloatingProps: UseInteractionsReturn["getFloatingProps"];
|
|
68
72
|
}
|
|
69
73
|
export interface ModalActionsProps {
|
|
70
74
|
/**
|
package/dist/Modal/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ var Button = require('../Button-cjs.js');
|
|
|
12
12
|
var ButtonDismiss = require('../ButtonDismiss-cjs.js');
|
|
13
13
|
var noop = require('../noop-cjs.js');
|
|
14
14
|
var floatingUi_react = require('../floating-ui.react-cjs.js');
|
|
15
|
+
var identity = require('../identity-cjs.js');
|
|
15
16
|
var AtlantisPortalContent = require('../AtlantisPortalContent-cjs.js');
|
|
16
17
|
require('../Typography-cjs.js');
|
|
17
18
|
require('react-router-dom');
|
|
@@ -19,10 +20,9 @@ require('../tslib.es6-cjs.js');
|
|
|
19
20
|
require('../Icon-cjs.js');
|
|
20
21
|
require('@jobber/design');
|
|
21
22
|
require('../_commonjsHelpers-cjs.js');
|
|
22
|
-
require('../AtlantisThemeContext-cjs.js');
|
|
23
|
-
require('../identity-cjs.js');
|
|
24
23
|
require('../isTypedArray-cjs.js');
|
|
25
24
|
require('../isObjectLike-cjs.js');
|
|
25
|
+
require('../AtlantisThemeContext-cjs.js');
|
|
26
26
|
require('../_baseAssignValue-cjs.js');
|
|
27
27
|
require('../_baseFor-cjs.js');
|
|
28
28
|
require('../keysIn-cjs.js');
|
|
@@ -96,10 +96,10 @@ function useModal({ open, activatorRef: refProp, onRequestClose, }) {
|
|
|
96
96
|
const dismiss = floatingUi_react.useDismiss(floatingContext, {
|
|
97
97
|
outsidePressEvent: "click",
|
|
98
98
|
escapeKey: true,
|
|
99
|
-
bubbles:
|
|
99
|
+
bubbles: false,
|
|
100
100
|
});
|
|
101
101
|
const role = floatingUi_react.useRole(floatingContext);
|
|
102
|
-
floatingUi_react.useInteractions([click, dismiss, role]);
|
|
102
|
+
const { getFloatingProps } = floatingUi_react.useInteractions([click, dismiss, role]);
|
|
103
103
|
const parentId = floatingUi_react.useFloatingParentNodeId();
|
|
104
104
|
return {
|
|
105
105
|
floatingRefs,
|
|
@@ -107,6 +107,7 @@ function useModal({ open, activatorRef: refProp, onRequestClose, }) {
|
|
|
107
107
|
nodeId,
|
|
108
108
|
activatorRef,
|
|
109
109
|
parentId,
|
|
110
|
+
getFloatingProps,
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -119,9 +120,10 @@ const ModalContext = React.createContext({
|
|
|
119
120
|
size: undefined,
|
|
120
121
|
floatingNodeId: undefined,
|
|
121
122
|
dismissible: true,
|
|
123
|
+
getFloatingProps: identity.identity,
|
|
122
124
|
});
|
|
123
125
|
function ModalProvider({ children, open = false, size, onRequestClose = noop.noop, activatorRef: refProp, dismissible = true, modalLabelledBy = "ATL-Modal-Header", }) {
|
|
124
|
-
const { floatingRefs, floatingContext, nodeId, activatorRef, parentId } = useModal({
|
|
126
|
+
const { floatingRefs, floatingContext, nodeId, activatorRef, parentId, getFloatingProps, } = useModal({
|
|
125
127
|
open,
|
|
126
128
|
activatorRef: refProp,
|
|
127
129
|
onRequestClose,
|
|
@@ -136,6 +138,7 @@ function ModalProvider({ children, open = false, size, onRequestClose = noop.noo
|
|
|
136
138
|
floatingNodeId: nodeId,
|
|
137
139
|
dismissible,
|
|
138
140
|
modalLabelledBy,
|
|
141
|
+
getFloatingProps,
|
|
139
142
|
} }, children));
|
|
140
143
|
if (parentId) {
|
|
141
144
|
return content;
|
|
@@ -195,14 +198,14 @@ function ModalOverlay() {
|
|
|
195
198
|
return (React.createElement(framerMotion.motion.div, { onClick: onRequestClose, className: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }));
|
|
196
199
|
}
|
|
197
200
|
function ModalContent({ children }) {
|
|
198
|
-
const { open, floatingContext, activatorRef, floatingRefs, size, floatingNodeId, modalLabelledBy, } = useModalContext();
|
|
201
|
+
const { open, floatingContext, activatorRef, floatingRefs, size, floatingNodeId, modalLabelledBy, getFloatingProps, } = useModalContext();
|
|
199
202
|
const { modal, overlay } = useModalStyles(size);
|
|
200
203
|
return (React.createElement(framerMotion.AnimatePresence, null, open && (React.createElement(floatingUi_react.FloatingNode, { id: floatingNodeId },
|
|
201
204
|
React.createElement(floatingUi_react.FloatingPortal, null,
|
|
202
205
|
React.createElement(AtlantisPortalContent.AtlantisPortalContent, null,
|
|
203
206
|
React.createElement(floatingUi_react.FloatingOverlay, { className: overlay },
|
|
204
207
|
React.createElement(floatingUi_react.FloatingFocusManager, { context: floatingContext, returnFocus: (activatorRef === null || activatorRef === void 0 ? void 0 : activatorRef.current) ? activatorRef : true, initialFocus: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.floating },
|
|
205
|
-
React.createElement("div", { ref: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.setFloating, role: "dialog", tabIndex: 0, "aria-labelledby": modalLabelledBy },
|
|
208
|
+
React.createElement("div", Object.assign({ ref: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.setFloating, role: "dialog", tabIndex: 0, "aria-labelledby": modalLabelledBy }, getFloatingProps()),
|
|
206
209
|
React.createElement(ModalOverlay, null),
|
|
207
210
|
React.createElement(framerMotion.motion.div, { "data-floating-ui-focusable": true, className: modal, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
|
|
208
211
|
duration: 0.2,
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { B as Button } from '../Button-es.js';
|
|
|
10
10
|
import { B as ButtonDismiss } from '../ButtonDismiss-es.js';
|
|
11
11
|
import { n as noop } from '../noop-es.js';
|
|
12
12
|
import { a as useFloatingNodeId, b as useFloating, i as useClick, e as useDismiss, j as useRole, f as useInteractions, u as useFloatingParentNodeId, F as FloatingTree, g as FloatingNode, h as FloatingPortal, k as FloatingOverlay, l as FloatingFocusManager } from '../floating-ui.react-es.js';
|
|
13
|
+
import { b as identity } from '../identity-es.js';
|
|
13
14
|
import { A as AtlantisPortalContent } from '../AtlantisPortalContent-es.js';
|
|
14
15
|
import '../Typography-es.js';
|
|
15
16
|
import 'react-router-dom';
|
|
@@ -17,10 +18,9 @@ import '../tslib.es6-es.js';
|
|
|
17
18
|
import '../Icon-es.js';
|
|
18
19
|
import '@jobber/design';
|
|
19
20
|
import '../_commonjsHelpers-es.js';
|
|
20
|
-
import '../AtlantisThemeContext-es.js';
|
|
21
|
-
import '../identity-es.js';
|
|
22
21
|
import '../isTypedArray-es.js';
|
|
23
22
|
import '../isObjectLike-es.js';
|
|
23
|
+
import '../AtlantisThemeContext-es.js';
|
|
24
24
|
import '../_baseAssignValue-es.js';
|
|
25
25
|
import '../_baseFor-es.js';
|
|
26
26
|
import '../keysIn-es.js';
|
|
@@ -94,10 +94,10 @@ function useModal({ open, activatorRef: refProp, onRequestClose, }) {
|
|
|
94
94
|
const dismiss = useDismiss(floatingContext, {
|
|
95
95
|
outsidePressEvent: "click",
|
|
96
96
|
escapeKey: true,
|
|
97
|
-
bubbles:
|
|
97
|
+
bubbles: false,
|
|
98
98
|
});
|
|
99
99
|
const role = useRole(floatingContext);
|
|
100
|
-
useInteractions([click, dismiss, role]);
|
|
100
|
+
const { getFloatingProps } = useInteractions([click, dismiss, role]);
|
|
101
101
|
const parentId = useFloatingParentNodeId();
|
|
102
102
|
return {
|
|
103
103
|
floatingRefs,
|
|
@@ -105,6 +105,7 @@ function useModal({ open, activatorRef: refProp, onRequestClose, }) {
|
|
|
105
105
|
nodeId,
|
|
106
106
|
activatorRef,
|
|
107
107
|
parentId,
|
|
108
|
+
getFloatingProps,
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
111
|
|
|
@@ -117,9 +118,10 @@ const ModalContext = createContext({
|
|
|
117
118
|
size: undefined,
|
|
118
119
|
floatingNodeId: undefined,
|
|
119
120
|
dismissible: true,
|
|
121
|
+
getFloatingProps: identity,
|
|
120
122
|
});
|
|
121
123
|
function ModalProvider({ children, open = false, size, onRequestClose = noop, activatorRef: refProp, dismissible = true, modalLabelledBy = "ATL-Modal-Header", }) {
|
|
122
|
-
const { floatingRefs, floatingContext, nodeId, activatorRef, parentId } = useModal({
|
|
124
|
+
const { floatingRefs, floatingContext, nodeId, activatorRef, parentId, getFloatingProps, } = useModal({
|
|
123
125
|
open,
|
|
124
126
|
activatorRef: refProp,
|
|
125
127
|
onRequestClose,
|
|
@@ -134,6 +136,7 @@ function ModalProvider({ children, open = false, size, onRequestClose = noop, ac
|
|
|
134
136
|
floatingNodeId: nodeId,
|
|
135
137
|
dismissible,
|
|
136
138
|
modalLabelledBy,
|
|
139
|
+
getFloatingProps,
|
|
137
140
|
} }, children));
|
|
138
141
|
if (parentId) {
|
|
139
142
|
return content;
|
|
@@ -193,14 +196,14 @@ function ModalOverlay() {
|
|
|
193
196
|
return (React__default.createElement(motion.div, { onClick: onRequestClose, className: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }));
|
|
194
197
|
}
|
|
195
198
|
function ModalContent({ children }) {
|
|
196
|
-
const { open, floatingContext, activatorRef, floatingRefs, size, floatingNodeId, modalLabelledBy, } = useModalContext();
|
|
199
|
+
const { open, floatingContext, activatorRef, floatingRefs, size, floatingNodeId, modalLabelledBy, getFloatingProps, } = useModalContext();
|
|
197
200
|
const { modal, overlay } = useModalStyles(size);
|
|
198
201
|
return (React__default.createElement(AnimatePresence, null, open && (React__default.createElement(FloatingNode, { id: floatingNodeId },
|
|
199
202
|
React__default.createElement(FloatingPortal, null,
|
|
200
203
|
React__default.createElement(AtlantisPortalContent, null,
|
|
201
204
|
React__default.createElement(FloatingOverlay, { className: overlay },
|
|
202
205
|
React__default.createElement(FloatingFocusManager, { context: floatingContext, returnFocus: (activatorRef === null || activatorRef === void 0 ? void 0 : activatorRef.current) ? activatorRef : true, initialFocus: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.floating },
|
|
203
|
-
React__default.createElement("div", { ref: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.setFloating, role: "dialog", tabIndex: 0, "aria-labelledby": modalLabelledBy },
|
|
206
|
+
React__default.createElement("div", Object.assign({ ref: floatingRefs === null || floatingRefs === void 0 ? void 0 : floatingRefs.setFloating, role: "dialog", tabIndex: 0, "aria-labelledby": modalLabelledBy }, getFloatingProps()),
|
|
204
207
|
React__default.createElement(ModalOverlay, null),
|
|
205
208
|
React__default.createElement(motion.div, { "data-floating-ui-focusable": true, className: modal, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
|
|
206
209
|
duration: 0.2,
|
package/dist/Modal/useModal.d.ts
CHANGED
|
@@ -31,5 +31,6 @@ export declare function useModal({ open, activatorRef: refProp, onRequestClose,
|
|
|
31
31
|
nodeId: string | undefined;
|
|
32
32
|
activatorRef: import("react").RefObject<HTMLElement | null>;
|
|
33
33
|
parentId: string | null;
|
|
34
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
34
35
|
};
|
|
35
36
|
export {};
|
package/dist/_baseEach-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as _MapCache, d as _Uint8Array, e as eq_1, c as _Stack, a as _isIndex, i as identity_1 } from './identity-es.js';
|
|
2
2
|
import { b as _Symbol, a as isObjectLike_1, i as isObject_1 } from './isObjectLike-es.js';
|
|
3
3
|
import { e as _getAllKeys, k as keys_1, b as _baseGet, f as _castPath, g as _toKey, h as _isKey } from './_baseGet-es.js';
|
|
4
4
|
import { a as _getTag } from './_getTag-es.js';
|
package/dist/_baseGet-es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as isArrayLike_1, a as isArray_1 } from './isTypedArray-es.js';
|
|
2
|
-
import {
|
|
2
|
+
import { f as _arrayLikeKeys, g as _MapCache } from './identity-es.js';
|
|
3
3
|
import { _ as _baseKeys } from './_getTag-es.js';
|
|
4
4
|
import { i as isSymbol_1 } from './isSymbol-es.js';
|
|
5
5
|
import { b as _Symbol } from './isObjectLike-es.js';
|
package/dist/identity-cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var isTypedArray$1 = require('./isTypedArray-cjs.js');
|
|
4
4
|
var isObjectLike = require('./isObjectLike-cjs.js');
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Removes all key-value entries from the list cache.
|
|
@@ -805,6 +806,8 @@ function identity(value) {
|
|
|
805
806
|
|
|
806
807
|
var identity_1 = identity;
|
|
807
808
|
|
|
809
|
+
var identity$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(identity_1);
|
|
810
|
+
|
|
808
811
|
exports._MapCache = _MapCache;
|
|
809
812
|
exports._Stack = _Stack;
|
|
810
813
|
exports._Uint8Array = _Uint8Array;
|
|
@@ -812,4 +815,5 @@ exports._arrayLikeKeys = _arrayLikeKeys;
|
|
|
812
815
|
exports._defineProperty = _defineProperty;
|
|
813
816
|
exports._isIndex = _isIndex;
|
|
814
817
|
exports.eq_1 = eq_1;
|
|
818
|
+
exports.identity = identity$1;
|
|
815
819
|
exports.identity_1 = identity_1;
|
package/dist/identity-es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { f as _getNative, g as _Map, i as isArguments_1, c as isBufferExports, d as isTypedArray_1, a as isArray_1 } from './isTypedArray-es.js';
|
|
2
2
|
import { c as _root } from './isObjectLike-es.js';
|
|
3
|
+
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Removes all key-value entries from the list cache.
|
|
@@ -803,4 +804,6 @@ function identity(value) {
|
|
|
803
804
|
|
|
804
805
|
var identity_1 = identity;
|
|
805
806
|
|
|
806
|
-
|
|
807
|
+
var identity$1 = /*@__PURE__*/getDefaultExportFromCjs(identity_1);
|
|
808
|
+
|
|
809
|
+
export { _defineProperty as _, _isIndex as a, identity$1 as b, _Stack as c, _Uint8Array as d, eq_1 as e, _arrayLikeKeys as f, _MapCache as g, identity_1 as i };
|
package/dist/keysIn-es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as _root, i as isObject_1, _ as _baseGetTag, a as isObjectLike_1 } from './isObjectLike-es.js';
|
|
2
|
-
import {
|
|
2
|
+
import { d as _Uint8Array, e as eq_1, f as _arrayLikeKeys } from './identity-es.js';
|
|
3
3
|
import { e as _overArg, _ as _isPrototype, b as isArrayLike_1 } from './isTypedArray-es.js';
|
|
4
4
|
import { _ as _baseAssignValue } from './_baseAssignValue-es.js';
|
|
5
5
|
|
package/dist/omit-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
2
2
|
import { k as keys_1, c as _getSymbols, _ as _arrayPush, s as stubArray_1, d as _baseGetAllKeys, e as _getAllKeys, b as _baseGet, f as _castPath, g as _toKey, a as _arrayMap } from './_baseGet-es.js';
|
|
3
|
-
import {
|
|
3
|
+
import { c as _Stack } from './identity-es.js';
|
|
4
4
|
import { _ as _copyObject, k as keysIn_1, e as _getPrototype, f as _cloneArrayBuffer, b as _cloneTypedArray, a as _cloneBufferExports, c as _copyArray, d as _initCloneObject, g as _assignValue, i as isPlainObject_1 } from './keysIn-es.js';
|
|
5
5
|
import { a as _getTag } from './_getTag-es.js';
|
|
6
6
|
import { b as _Symbol, a as isObjectLike_1, i as isObject_1 } from './isObjectLike-es.js';
|
package/dist/styles.css
CHANGED
|
@@ -3214,6 +3214,7 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
3214
3214
|
--checkbox--size: 20px;
|
|
3215
3215
|
--checkbox--border--checked: var(--color-interactive);
|
|
3216
3216
|
--checkbox--border--unchecked: var(--color-border--interactive);
|
|
3217
|
+
--checkbox--border--invalid: var(--color-critical);
|
|
3217
3218
|
--checkbox--border--hover: var(--color-interactive);
|
|
3218
3219
|
display: inline-block;
|
|
3219
3220
|
}
|
|
@@ -3308,6 +3309,26 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
3308
3309
|
opacity: 1;
|
|
3309
3310
|
}
|
|
3310
3311
|
|
|
3312
|
+
/* Invalid states set border and fill color when field not disabled
|
|
3313
|
+
- note, some rules are duplicated to ensure selectors follow
|
|
3314
|
+
descending cascade linting rules
|
|
3315
|
+
*/
|
|
3316
|
+
|
|
3317
|
+
.Gqnclw4WaeQ-:not(.TKr3J-6ARFo-) .XnCmS-EzK2M- + ._-8JCQE6SA9s- {
|
|
3318
|
+
border-color: var(--checkbox--border--invalid);
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
.Gqnclw4WaeQ-:not(.TKr3J-6ARFo-) .XnCmS-EzK2M-:checked + ._-8JCQE6SA9s-,
|
|
3322
|
+
.Gqnclw4WaeQ-:not(.TKr3J-6ARFo-) .XnCmS-EzK2M-.rqHq3ff9In0- + ._-8JCQE6SA9s- {
|
|
3323
|
+
background-color: hsl(6, 64%, 51%);
|
|
3324
|
+
background-color: var(--color-critical);
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
.Gqnclw4WaeQ-:not(.TKr3J-6ARFo-):focus-within .XnCmS-EzK2M- + ._-8JCQE6SA9s-,
|
|
3328
|
+
.Gqnclw4WaeQ-:not(.TKr3J-6ARFo-) .XnCmS-EzK2M-.rqHq3ff9In0-:focus-within + ._-8JCQE6SA9s- {
|
|
3329
|
+
border-color: var(--checkbox--border--invalid);
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3311
3332
|
.l8z5TxzVvqA- {
|
|
3312
3333
|
margin: 0 8px;
|
|
3313
3334
|
margin: 0 var(--space-small);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.61.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -542,5 +542,5 @@
|
|
|
542
542
|
"> 1%",
|
|
543
543
|
"IE 10"
|
|
544
544
|
],
|
|
545
|
-
"gitHead": "
|
|
545
|
+
"gitHead": "1aa6f369e1206bf66aef78694ec072ca89bf7793"
|
|
546
546
|
}
|