@jobber/components 9.0.0 → 9.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.
- package/dist/Autocomplete/Autocomplete.messages.d.ts +10 -0
- package/dist/Autocomplete/index.cjs +2 -0
- package/dist/Autocomplete/index.mjs +2 -0
- package/dist/Autocomplete-cjs.js +16 -3
- package/dist/Autocomplete-es.js +16 -3
- package/dist/Card/index.cjs +2 -0
- package/dist/Card/index.mjs +2 -0
- package/dist/Chip/index.cjs +2 -0
- package/dist/Chip/index.mjs +2 -0
- package/dist/Chip-cjs.js +19 -1
- package/dist/Chip-es.js +19 -2
- package/dist/Chips/Chips.messages.d.ts +14 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -0
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -0
- package/dist/Chips/index.cjs +2 -0
- package/dist/Chips/index.mjs +2 -0
- package/dist/ConfirmationModal/index.cjs +3 -0
- package/dist/ConfirmationModal/index.mjs +3 -0
- package/dist/ConfirmationModal-cjs.js +21 -10
- package/dist/ConfirmationModal-es.js +21 -10
- package/dist/DataDump/index.cjs +2 -0
- package/dist/DataDump/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/index.mjs +2 -0
- package/dist/DataList/components/DataListSearch/index.cjs +2 -0
- package/dist/DataList/components/DataListSearch/index.mjs +2 -0
- package/dist/DataList/index.cjs +2 -0
- package/dist/DataList/index.mjs +2 -0
- package/dist/DataTable/index.cjs +2 -0
- package/dist/DataTable/index.mjs +2 -0
- package/dist/DatePicker/DatePicker.messages.d.ts +14 -0
- package/dist/DatePicker/index.cjs +2 -1
- package/dist/DatePicker/index.mjs +2 -1
- package/dist/DatePicker-cjs.js +24 -5
- package/dist/DatePicker-es.js +24 -5
- package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +2 -0
- package/dist/FilterPicker/index.cjs +2 -0
- package/dist/FilterPicker/index.mjs +2 -0
- package/dist/FormField/components/FormField.messages.d.ts +6 -0
- package/dist/FormField/index.cjs +2 -0
- package/dist/FormField/index.mjs +2 -0
- package/dist/FormFieldWrapper-cjs.js +10 -1
- package/dist/FormFieldWrapper-es.js +10 -1
- package/dist/FormatFile/index.cjs +3 -0
- package/dist/FormatFile/index.mjs +3 -0
- package/dist/Gallery/index.cjs +3 -0
- package/dist/Gallery/index.mjs +3 -0
- package/dist/InputAvatar/InputAvatar.messages.d.ts +10 -0
- package/dist/InputAvatar/index.cjs +2 -0
- package/dist/InputAvatar/index.mjs +2 -0
- package/dist/InputAvatar-cjs.js +15 -2
- package/dist/InputAvatar-es.js +15 -2
- package/dist/InputDate/InputDate.messages.d.ts +6 -0
- package/dist/InputDate/index.cjs +2 -1
- package/dist/InputDate/index.mjs +2 -1
- package/dist/InputDate-cjs.js +10 -1
- package/dist/InputDate-es.js +10 -1
- package/dist/InputEmail/index.cjs +2 -0
- package/dist/InputEmail/index.mjs +2 -0
- package/dist/InputPhoneNumber/index.cjs +2 -0
- package/dist/InputPhoneNumber/index.mjs +2 -0
- package/dist/InputText/index.cjs +2 -0
- package/dist/InputText/index.mjs +2 -0
- package/dist/InputTime/index.cjs +2 -0
- package/dist/InputTime/index.mjs +2 -0
- package/dist/InternalChipDismissible-cjs.js +9 -5
- package/dist/InternalChipDismissible-es.js +10 -6
- package/dist/LegacySelect/index.cjs +2 -0
- package/dist/LegacySelect/index.mjs +2 -0
- package/dist/LightBox/LightBox.messages.d.ts +22 -0
- package/dist/LightBox/index.cjs +2 -0
- package/dist/LightBox/index.mjs +2 -0
- package/dist/LightBox-cjs.js +37 -7
- package/dist/LightBox-es.js +37 -7
- package/dist/Menu/Menu.messages.d.ts +14 -0
- package/dist/Menu/index.cjs +2 -0
- package/dist/Menu/index.mjs +2 -0
- package/dist/Menu-cjs.js +20 -2
- package/dist/Menu-es.js +20 -2
- package/dist/Modal/Modal.messages.d.ts +6 -0
- package/dist/Modal/index.cjs +13 -2
- package/dist/Modal/index.mjs +13 -2
- package/dist/Page/index.cjs +2 -0
- package/dist/Page/index.mjs +2 -0
- package/dist/Popover/Popover.messages.d.ts +6 -0
- package/dist/Popover/index.cjs +2 -0
- package/dist/Popover/index.mjs +2 -0
- package/dist/Popover-cjs.js +10 -1
- package/dist/Popover-es.js +10 -1
- package/dist/common.messages-cjs.js +20 -0
- package/dist/common.messages-es.js +18 -0
- package/dist/docs/ConfirmationModal/ConfirmationModal.md +2 -2
- package/dist/docs/LightBox/LightBox.md +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +2 -1
- package/dist/sharedHelpers/i18n/index.cjs +3 -15
- package/dist/sharedHelpers/i18n/index.mjs +2 -19
- package/package.json +2 -2
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
package/dist/InputText/index.cjs
CHANGED
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
package/dist/InputText/index.mjs
CHANGED
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
package/dist/InputTime/index.cjs
CHANGED
|
@@ -17,6 +17,8 @@ require('react-router-dom');
|
|
|
17
17
|
require('../Icon-cjs.js');
|
|
18
18
|
require('../Typography-cjs.js');
|
|
19
19
|
require('../Text-cjs.js');
|
|
20
|
+
require('../useAtlantisI18n-cjs.js');
|
|
21
|
+
require('../AtlantisContext-cjs.js');
|
|
20
22
|
require('../useFormFieldFocus-cjs.js');
|
|
21
23
|
require('../InputValidation-cjs.js');
|
|
22
24
|
require('../mergeRefs-cjs.js');
|
package/dist/InputTime/index.mjs
CHANGED
|
@@ -15,6 +15,8 @@ import 'react-router-dom';
|
|
|
15
15
|
import '../Icon-es.js';
|
|
16
16
|
import '../Typography-es.js';
|
|
17
17
|
import '../Text-es.js';
|
|
18
|
+
import '../useAtlantisI18n-es.js';
|
|
19
|
+
import '../AtlantisContext-es.js';
|
|
18
20
|
import '../useFormFieldFocus-es.js';
|
|
19
21
|
import '../InputValidation-es.js';
|
|
20
22
|
import '../mergeRefs-es.js';
|
|
@@ -10,6 +10,7 @@ var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
|
10
10
|
var Text = require('./Text-cjs.js');
|
|
11
11
|
var Button = require('./Button-cjs.js');
|
|
12
12
|
var Spinner = require('./Spinner-cjs.js');
|
|
13
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
13
14
|
var Chip = require('./Chip-cjs.js');
|
|
14
15
|
require('./tslib.es6-cjs.js');
|
|
15
16
|
|
|
@@ -21,8 +22,12 @@ function InternalChip({ label, active = false, disabled = false, invalid = false
|
|
|
21
22
|
|
|
22
23
|
var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
|
|
23
24
|
|
|
25
|
+
function DefaultAddActivator({ ariaLabel, onClick, }) {
|
|
26
|
+
return (React.createElement(Button.Button, { icon: "add", type: "secondary", ariaLabel: ariaLabel, onClick: onClick }));
|
|
27
|
+
}
|
|
24
28
|
function InternalChipDismissibleInput(props) {
|
|
25
|
-
const {
|
|
29
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(Chip.chipsMessages);
|
|
30
|
+
const { activator, attachTo, isLoadingMore = false, onLoadMore, options, } = props;
|
|
26
31
|
const { activeIndex, allOptions, hasAvailableOptions, inputRef, menuId, menuOpen, searchValue, showInput, generateDescendantId, handleBlur, handleFocus, handleSearchChange, handleCancelBlur, handleEnableBlur, handleSetActiveOnMouseOver, handleKeyDown, handleSelectOption, handleShowInput, handleDebouncedSearch, } = useScrollToActive.useInternalChipDismissibleInput(props);
|
|
27
32
|
const scrollableRef = useScrollToActive.useScrollToActive(activeIndex);
|
|
28
33
|
const { ref: visibleChildRef, isInView } = useScrollToActive.useInView();
|
|
@@ -35,9 +40,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
35
40
|
isInView && onLoadMore && onLoadMore(searchValue);
|
|
36
41
|
}, [isInView]);
|
|
37
42
|
if (!showInput) {
|
|
38
|
-
return React.cloneElement(activator, { onClick: handleShowInput });
|
|
43
|
+
return React.cloneElement(activator !== null && activator !== void 0 ? activator : React.createElement(DefaultAddActivator, { ariaLabel: t("add") }), { onClick: handleShowInput });
|
|
39
44
|
}
|
|
40
|
-
const shouldShowMenu = menuOpen && (hasAvailableOptions || isLoadingMore);
|
|
41
45
|
const menuContent = (React.createElement("div", { ref: node => {
|
|
42
46
|
setFloatingRef(node);
|
|
43
47
|
scrollableRef.current = node;
|
|
@@ -51,8 +55,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
51
55
|
isLoadingMore && (React.createElement("div", { className: styles.loadingIndicator },
|
|
52
56
|
React.createElement(Spinner.Spinner, { size: "small", inline: true })))));
|
|
53
57
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "
|
|
55
|
-
|
|
58
|
+
React.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": t("cycleOptions"), "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": menuOpen && (hasAvailableOptions || isLoadingMore), "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: () => setTimeout(handleBlur, 200), onFocus: handleFocus, autoFocus: true }),
|
|
59
|
+
menuOpen && (hasAvailableOptions || isLoadingMore) && (React.createElement(floatingUi_react.FloatingPortal, null, menuContent))));
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
function InternalChipDismissible(props) {
|
|
@@ -8,7 +8,8 @@ import { F as FloatingPortal } from './floating-ui.react-es.js';
|
|
|
8
8
|
import { T as Text } from './Text-es.js';
|
|
9
9
|
import { B as Button } from './Button-es.js';
|
|
10
10
|
import { S as Spinner } from './Spinner-es.js';
|
|
11
|
-
import {
|
|
11
|
+
import { u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
12
|
+
import { C as Chip, c as chipsMessages, I as InternalChipButton } from './Chip-es.js';
|
|
12
13
|
import './tslib.es6-es.js';
|
|
13
14
|
|
|
14
15
|
function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
|
|
@@ -19,8 +20,12 @@ function InternalChip({ label, active = false, disabled = false, invalid = false
|
|
|
19
20
|
|
|
20
21
|
var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
|
|
21
22
|
|
|
23
|
+
function DefaultAddActivator({ ariaLabel, onClick, }) {
|
|
24
|
+
return (React__default.createElement(Button, { icon: "add", type: "secondary", ariaLabel: ariaLabel, onClick: onClick }));
|
|
25
|
+
}
|
|
22
26
|
function InternalChipDismissibleInput(props) {
|
|
23
|
-
const {
|
|
27
|
+
const { t } = useAtlantisI18n(chipsMessages);
|
|
28
|
+
const { activator, attachTo, isLoadingMore = false, onLoadMore, options, } = props;
|
|
24
29
|
const { activeIndex, allOptions, hasAvailableOptions, inputRef, menuId, menuOpen, searchValue, showInput, generateDescendantId, handleBlur, handleFocus, handleSearchChange, handleCancelBlur, handleEnableBlur, handleSetActiveOnMouseOver, handleKeyDown, handleSelectOption, handleShowInput, handleDebouncedSearch, } = useInternalChipDismissibleInput(props);
|
|
25
30
|
const scrollableRef = useScrollToActive(activeIndex);
|
|
26
31
|
const { ref: visibleChildRef, isInView } = useInView();
|
|
@@ -33,9 +38,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
33
38
|
isInView && onLoadMore && onLoadMore(searchValue);
|
|
34
39
|
}, [isInView]);
|
|
35
40
|
if (!showInput) {
|
|
36
|
-
return React__default.cloneElement(activator, { onClick: handleShowInput });
|
|
41
|
+
return React__default.cloneElement(activator !== null && activator !== void 0 ? activator : React__default.createElement(DefaultAddActivator, { ariaLabel: t("add") }), { onClick: handleShowInput });
|
|
37
42
|
}
|
|
38
|
-
const shouldShowMenu = menuOpen && (hasAvailableOptions || isLoadingMore);
|
|
39
43
|
const menuContent = (React__default.createElement("div", { ref: node => {
|
|
40
44
|
setFloatingRef(node);
|
|
41
45
|
scrollableRef.current = node;
|
|
@@ -49,8 +53,8 @@ function InternalChipDismissibleInput(props) {
|
|
|
49
53
|
isLoadingMore && (React__default.createElement("div", { className: styles.loadingIndicator },
|
|
50
54
|
React__default.createElement(Spinner, { size: "small", inline: true })))));
|
|
51
55
|
return (React__default.createElement(React__default.Fragment, null,
|
|
52
|
-
React__default.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "
|
|
53
|
-
|
|
56
|
+
React__default.createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": t("cycleOptions"), "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": menuOpen && (hasAvailableOptions || isLoadingMore), "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: () => setTimeout(handleBlur, 200), onFocus: handleFocus, autoFocus: true }),
|
|
57
|
+
menuOpen && (hasAvailableOptions || isLoadingMore) && (React__default.createElement(FloatingPortal, null, menuContent))));
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
function InternalChipDismissible(props) {
|
|
@@ -14,6 +14,8 @@ require('react-router-dom');
|
|
|
14
14
|
require('../Icon-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
16
16
|
require('../Text-cjs.js');
|
|
17
|
+
require('../useAtlantisI18n-cjs.js');
|
|
18
|
+
require('../AtlantisContext-cjs.js');
|
|
17
19
|
require('../useFormFieldFocus-cjs.js');
|
|
18
20
|
require('../InputValidation-cjs.js');
|
|
19
21
|
require('../FormFieldPostFix-cjs.js');
|
|
@@ -12,6 +12,8 @@ import 'react-router-dom';
|
|
|
12
12
|
import '../Icon-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
14
14
|
import '../Text-es.js';
|
|
15
|
+
import '../useAtlantisI18n-es.js';
|
|
16
|
+
import '../AtlantisContext-es.js';
|
|
15
17
|
import '../useFormFieldFocus-es.js';
|
|
16
18
|
import '../InputValidation-es.js';
|
|
17
19
|
import '../FormFieldPostFix-es.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const lightBoxMessages: {
|
|
2
|
+
close: {
|
|
3
|
+
en: string;
|
|
4
|
+
es: string;
|
|
5
|
+
};
|
|
6
|
+
lightbox: {
|
|
7
|
+
en: string;
|
|
8
|
+
es: string;
|
|
9
|
+
};
|
|
10
|
+
previousImage: {
|
|
11
|
+
en: string;
|
|
12
|
+
es: string;
|
|
13
|
+
};
|
|
14
|
+
nextImage: {
|
|
15
|
+
en: string;
|
|
16
|
+
es: string;
|
|
17
|
+
};
|
|
18
|
+
openInNewTab: {
|
|
19
|
+
en: string;
|
|
20
|
+
es: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
package/dist/LightBox/index.cjs
CHANGED
|
@@ -8,6 +8,8 @@ require('@jobber/hooks');
|
|
|
8
8
|
require('classnames');
|
|
9
9
|
require('../noop-cjs.js');
|
|
10
10
|
require('../_commonjsHelpers-cjs.js');
|
|
11
|
+
require('../useAtlantisI18n-cjs.js');
|
|
12
|
+
require('../AtlantisContext-cjs.js');
|
|
11
13
|
require('../ButtonDismiss-cjs.js');
|
|
12
14
|
require('../Button-cjs.js');
|
|
13
15
|
require('../tslib.es6-cjs.js');
|
package/dist/LightBox/index.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import '@jobber/hooks';
|
|
|
6
6
|
import 'classnames';
|
|
7
7
|
import '../noop-es.js';
|
|
8
8
|
import '../_commonjsHelpers-es.js';
|
|
9
|
+
import '../useAtlantisI18n-es.js';
|
|
10
|
+
import '../AtlantisContext-es.js';
|
|
9
11
|
import '../ButtonDismiss-es.js';
|
|
10
12
|
import '../Button-es.js';
|
|
11
13
|
import '../tslib.es6-es.js';
|
package/dist/LightBox-cjs.js
CHANGED
|
@@ -6,6 +6,7 @@ var ReactDOM = require('react-dom');
|
|
|
6
6
|
var jobberHooks = require('@jobber/hooks');
|
|
7
7
|
var classnames = require('classnames');
|
|
8
8
|
var noop = require('./noop-cjs.js');
|
|
9
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
9
10
|
var ButtonDismiss = require('./ButtonDismiss-cjs.js');
|
|
10
11
|
var Text = require('./Text-cjs.js');
|
|
11
12
|
var Button = require('./Button-cjs.js');
|
|
@@ -169,10 +170,34 @@ function togglePrintStyles(open) {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
|
|
173
|
+
const lightBoxMessages = useAtlantisI18n.defineMessages({
|
|
174
|
+
close: {
|
|
175
|
+
en: "Close",
|
|
176
|
+
es: "Cerrar",
|
|
177
|
+
},
|
|
178
|
+
lightbox: {
|
|
179
|
+
en: "Lightbox",
|
|
180
|
+
es: "Lightbox",
|
|
181
|
+
},
|
|
182
|
+
previousImage: {
|
|
183
|
+
en: "Previous image",
|
|
184
|
+
es: "Imagen anterior",
|
|
185
|
+
},
|
|
186
|
+
nextImage: {
|
|
187
|
+
en: "Next image",
|
|
188
|
+
es: "Imagen siguiente",
|
|
189
|
+
},
|
|
190
|
+
openInNewTab: {
|
|
191
|
+
en: "Open image in new tab",
|
|
192
|
+
es: "Abrir imagen en nueva pestaña",
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
|
|
172
196
|
function LightBoxContent() {
|
|
173
197
|
const { open, lightboxRef, handleMouseMove } = useLightBoxContext();
|
|
198
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(lightBoxMessages);
|
|
174
199
|
const mounted = jobberHooks.useIsMounted();
|
|
175
|
-
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "
|
|
200
|
+
const template = (React.createElement(React.Fragment, null, open && (React.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": t("lightbox"), key: "Lightbox", ref: lightboxRef, onMouseMove: handleMouseMove },
|
|
176
201
|
React.createElement(LightBoxBackground, null),
|
|
177
202
|
React.createElement(LightBoxOverlay, null),
|
|
178
203
|
React.createElement(LightBoxToolbar, null),
|
|
@@ -186,13 +211,15 @@ function LightBoxContent() {
|
|
|
186
211
|
}
|
|
187
212
|
function PreviousButton({ onClick, hideButton, className }) {
|
|
188
213
|
const { mediumAndUp } = jobberHooks.useBreakpoints();
|
|
214
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(lightBoxMessages);
|
|
189
215
|
return (React.createElement("div", { className: `${className} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
190
|
-
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "
|
|
216
|
+
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: t("previousImage"), onClick: onClick })));
|
|
191
217
|
}
|
|
192
218
|
function NextButton({ onClick, hideButton, className }) {
|
|
193
219
|
const { mediumAndUp } = jobberHooks.useBreakpoints();
|
|
220
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(lightBoxMessages);
|
|
194
221
|
return (React.createElement("div", { className: `${className} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
195
|
-
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "
|
|
222
|
+
React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: t("nextImage"), onClick: onClick })));
|
|
196
223
|
}
|
|
197
224
|
/**
|
|
198
225
|
* Blurred, desaturated copy of the current image rendered as a full-bleed
|
|
@@ -218,26 +245,29 @@ function LightBoxOverlay({ className }) {
|
|
|
218
245
|
*/
|
|
219
246
|
function LightBoxToolbar() {
|
|
220
247
|
const { images, currentImageIndex, handleRequestClose } = useLightBoxContext();
|
|
248
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(lightBoxMessages);
|
|
221
249
|
return (React.createElement(AtlantisThemeContext.AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
222
250
|
React.createElement("div", { className: styles.toolbar },
|
|
223
251
|
React.createElement(LightBoxOpenInNewTabAction, null),
|
|
224
252
|
React.createElement("div", { className: styles.slideNumber },
|
|
225
253
|
React.createElement(Text.Text, null, `${currentImageIndex + 1}/${images.length}`)),
|
|
226
254
|
React.createElement("div", { className: styles.closeButton },
|
|
227
|
-
React.createElement(ButtonDismiss.ButtonDismiss, { ariaLabel: "
|
|
255
|
+
React.createElement(ButtonDismiss.ButtonDismiss, { ariaLabel: t("close"), onClick: handleRequestClose })))));
|
|
228
256
|
}
|
|
229
257
|
/**
|
|
230
258
|
* Opens the current image in a new browser tab. Included in the default
|
|
231
259
|
* `LightBox.Toolbar`. Returns `null` if the current image has no `url`.
|
|
232
260
|
*/
|
|
233
|
-
function LightBoxOpenInNewTabAction({ ariaLabel
|
|
261
|
+
function LightBoxOpenInNewTabAction({ ariaLabel, }) {
|
|
234
262
|
const { images, currentImageIndex } = useLightBoxContext();
|
|
263
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(lightBoxMessages);
|
|
264
|
+
const effectiveAriaLabel = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : t("openInNewTab");
|
|
235
265
|
const currentImage = images[currentImageIndex];
|
|
236
266
|
if (!(currentImage === null || currentImage === void 0 ? void 0 : currentImage.url))
|
|
237
267
|
return null;
|
|
238
268
|
return (React.createElement("div", { className: styles.leftAction },
|
|
239
|
-
React.createElement(Tooltip.Tooltip, { message:
|
|
240
|
-
React.createElement(Button.Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel:
|
|
269
|
+
React.createElement(Tooltip.Tooltip, { message: effectiveAriaLabel },
|
|
270
|
+
React.createElement(Button.Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel: effectiveAriaLabel, url: currentImage.url, external: true }))));
|
|
241
271
|
}
|
|
242
272
|
/**
|
|
243
273
|
* The animated hero image with swipe-to-navigate and slide animation.
|
package/dist/LightBox-es.js
CHANGED
|
@@ -4,6 +4,7 @@ import ReactDOM__default from 'react-dom';
|
|
|
4
4
|
import { useFocusTrap, useDebounce, useIsMounted, useRefocusOnActivator, useOnKeyDown, useBreakpoints } from '@jobber/hooks';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { n as noop } from './noop-es.js';
|
|
7
|
+
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
7
8
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
8
9
|
import { T as Text } from './Text-es.js';
|
|
9
10
|
import { B as Button } from './Button-es.js';
|
|
@@ -167,10 +168,34 @@ function togglePrintStyles(open) {
|
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
const lightBoxMessages = defineMessages({
|
|
172
|
+
close: {
|
|
173
|
+
en: "Close",
|
|
174
|
+
es: "Cerrar",
|
|
175
|
+
},
|
|
176
|
+
lightbox: {
|
|
177
|
+
en: "Lightbox",
|
|
178
|
+
es: "Lightbox",
|
|
179
|
+
},
|
|
180
|
+
previousImage: {
|
|
181
|
+
en: "Previous image",
|
|
182
|
+
es: "Imagen anterior",
|
|
183
|
+
},
|
|
184
|
+
nextImage: {
|
|
185
|
+
en: "Next image",
|
|
186
|
+
es: "Imagen siguiente",
|
|
187
|
+
},
|
|
188
|
+
openInNewTab: {
|
|
189
|
+
en: "Open image in new tab",
|
|
190
|
+
es: "Abrir imagen en nueva pestaña",
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
|
|
170
194
|
function LightBoxContent() {
|
|
171
195
|
const { open, lightboxRef, handleMouseMove } = useLightBoxContext();
|
|
196
|
+
const { t } = useAtlantisI18n(lightBoxMessages);
|
|
172
197
|
const mounted = useIsMounted();
|
|
173
|
-
const template = (React__default.createElement(React__default.Fragment, null, open && (React__default.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": "
|
|
198
|
+
const template = (React__default.createElement(React__default.Fragment, null, open && (React__default.createElement("div", { className: styles.lightboxWrapper, tabIndex: 0, "aria-label": t("lightbox"), key: "Lightbox", ref: lightboxRef, onMouseMove: handleMouseMove },
|
|
174
199
|
React__default.createElement(LightBoxBackground, null),
|
|
175
200
|
React__default.createElement(LightBoxOverlay, null),
|
|
176
201
|
React__default.createElement(LightBoxToolbar, null),
|
|
@@ -184,13 +209,15 @@ function LightBoxContent() {
|
|
|
184
209
|
}
|
|
185
210
|
function PreviousButton({ onClick, hideButton, className }) {
|
|
186
211
|
const { mediumAndUp } = useBreakpoints();
|
|
212
|
+
const { t } = useAtlantisI18n(lightBoxMessages);
|
|
187
213
|
return (React__default.createElement("div", { className: `${className} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
188
|
-
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "
|
|
214
|
+
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: t("previousImage"), onClick: onClick })));
|
|
189
215
|
}
|
|
190
216
|
function NextButton({ onClick, hideButton, className }) {
|
|
191
217
|
const { mediumAndUp } = useBreakpoints();
|
|
218
|
+
const { t } = useAtlantisI18n(lightBoxMessages);
|
|
192
219
|
return (React__default.createElement("div", { className: `${className} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
|
|
193
|
-
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "
|
|
220
|
+
React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: t("nextImage"), onClick: onClick })));
|
|
194
221
|
}
|
|
195
222
|
/**
|
|
196
223
|
* Blurred, desaturated copy of the current image rendered as a full-bleed
|
|
@@ -216,26 +243,29 @@ function LightBoxOverlay({ className }) {
|
|
|
216
243
|
*/
|
|
217
244
|
function LightBoxToolbar() {
|
|
218
245
|
const { images, currentImageIndex, handleRequestClose } = useLightBoxContext();
|
|
246
|
+
const { t } = useAtlantisI18n(lightBoxMessages);
|
|
219
247
|
return (React__default.createElement(AtlantisThemeContextProvider, { dangerouslyOverrideTheme: "dark" },
|
|
220
248
|
React__default.createElement("div", { className: styles.toolbar },
|
|
221
249
|
React__default.createElement(LightBoxOpenInNewTabAction, null),
|
|
222
250
|
React__default.createElement("div", { className: styles.slideNumber },
|
|
223
251
|
React__default.createElement(Text, null, `${currentImageIndex + 1}/${images.length}`)),
|
|
224
252
|
React__default.createElement("div", { className: styles.closeButton },
|
|
225
|
-
React__default.createElement(ButtonDismiss, { ariaLabel: "
|
|
253
|
+
React__default.createElement(ButtonDismiss, { ariaLabel: t("close"), onClick: handleRequestClose })))));
|
|
226
254
|
}
|
|
227
255
|
/**
|
|
228
256
|
* Opens the current image in a new browser tab. Included in the default
|
|
229
257
|
* `LightBox.Toolbar`. Returns `null` if the current image has no `url`.
|
|
230
258
|
*/
|
|
231
|
-
function LightBoxOpenInNewTabAction({ ariaLabel
|
|
259
|
+
function LightBoxOpenInNewTabAction({ ariaLabel, }) {
|
|
232
260
|
const { images, currentImageIndex } = useLightBoxContext();
|
|
261
|
+
const { t } = useAtlantisI18n(lightBoxMessages);
|
|
262
|
+
const effectiveAriaLabel = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : t("openInNewTab");
|
|
233
263
|
const currentImage = images[currentImageIndex];
|
|
234
264
|
if (!(currentImage === null || currentImage === void 0 ? void 0 : currentImage.url))
|
|
235
265
|
return null;
|
|
236
266
|
return (React__default.createElement("div", { className: styles.leftAction },
|
|
237
|
-
React__default.createElement(Tooltip, { message:
|
|
238
|
-
React__default.createElement(Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel:
|
|
267
|
+
React__default.createElement(Tooltip, { message: effectiveAriaLabel },
|
|
268
|
+
React__default.createElement(Button, { size: "small", variation: "subtle", type: "secondary", icon: "export", ariaLabel: effectiveAriaLabel, url: currentImage.url, external: true }))));
|
|
239
269
|
}
|
|
240
270
|
/**
|
|
241
271
|
* The animated hero image with swipe-to-navigate and slide animation.
|
package/dist/Menu/index.cjs
CHANGED
|
@@ -11,6 +11,8 @@ require('../floating-ui.utils-cjs.js');
|
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('react-dom');
|
|
13
13
|
require('../floating-ui.react-dom-cjs.js');
|
|
14
|
+
require('../useAtlantisI18n-cjs.js');
|
|
15
|
+
require('../AtlantisContext-cjs.js');
|
|
14
16
|
require('../Button-cjs.js');
|
|
15
17
|
require('../tslib.es6-cjs.js');
|
|
16
18
|
require('react-router-dom');
|
package/dist/Menu/index.mjs
CHANGED
|
@@ -9,6 +9,8 @@ import '../floating-ui.utils-es.js';
|
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import 'react-dom';
|
|
11
11
|
import '../floating-ui.react-dom-es.js';
|
|
12
|
+
import '../useAtlantisI18n-es.js';
|
|
13
|
+
import '../AtlantisContext-es.js';
|
|
12
14
|
import '../Button-es.js';
|
|
13
15
|
import '../tslib.es6-es.js';
|
|
14
16
|
import 'react-router-dom';
|
package/dist/Menu-cjs.js
CHANGED
|
@@ -5,6 +5,7 @@ var jobberHooks = require('@jobber/hooks');
|
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var framerMotion = require('framer-motion');
|
|
7
7
|
var floatingUi_react = require('./floating-ui.react-cjs.js');
|
|
8
|
+
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
8
9
|
var Button = require('./Button-cjs.js');
|
|
9
10
|
var Typography = require('./Typography-cjs.js');
|
|
10
11
|
var Icon = require('./Icon-cjs.js');
|
|
@@ -37,6 +38,21 @@ const OVERLAY_ANIMATION_CONFIG = {
|
|
|
37
38
|
type: "tween",
|
|
38
39
|
};
|
|
39
40
|
|
|
41
|
+
const menuMessages = useAtlantisI18n.defineMessages({
|
|
42
|
+
moreActions: {
|
|
43
|
+
en: "More Actions",
|
|
44
|
+
es: "Más acciones",
|
|
45
|
+
},
|
|
46
|
+
back: {
|
|
47
|
+
en: "Back",
|
|
48
|
+
es: "Atrás",
|
|
49
|
+
},
|
|
50
|
+
"Back to {title}": {
|
|
51
|
+
en: "Back to {title}",
|
|
52
|
+
es: "Volver a {title}",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
40
56
|
function isMobileDevice() {
|
|
41
57
|
if (typeof window === "undefined") {
|
|
42
58
|
return false;
|
|
@@ -58,6 +74,7 @@ const animationVariation = {
|
|
|
58
74
|
// eslint-disable-next-line max-statements
|
|
59
75
|
function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
60
76
|
var _a;
|
|
77
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(menuMessages);
|
|
61
78
|
const [visible, setVisible] = React.useState(false);
|
|
62
79
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
63
80
|
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
@@ -122,7 +139,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
|
122
139
|
}
|
|
123
140
|
: {};
|
|
124
141
|
if (!activator) {
|
|
125
|
-
activator = (React.createElement(Button.Button, { fullWidth: true, label: "
|
|
142
|
+
activator = (React.createElement(Button.Button, { fullWidth: true, label: t("moreActions"), icon: "more", type: "secondary" }));
|
|
126
143
|
}
|
|
127
144
|
let itemIndexCounter = 0;
|
|
128
145
|
const renderedSections = items === null || items === void 0 ? void 0 : items.map((item, key) => (React.createElement("div", { key: key, className: styles$2.legacySection },
|
|
@@ -640,6 +657,7 @@ const BottomSheetSubmenuTrigger = React.forwardRef(function BottomSheetSubmenuTr
|
|
|
640
657
|
React.createElement(Icon.Icon, { color: "icon", name: "arrowRight" }))) : null));
|
|
641
658
|
});
|
|
642
659
|
function BottomSheetSubmenuContent({ children, className, style, UNSAFE_style, UNSAFE_className, }) {
|
|
660
|
+
const { t } = useAtlantisI18n.useAtlantisI18n(menuMessages);
|
|
643
661
|
const { titleRef } = useBottomSheetSubmenuContext();
|
|
644
662
|
const title = titleRef.current;
|
|
645
663
|
const { focusModalityRef } = useBottomSheetContext();
|
|
@@ -655,7 +673,7 @@ function BottomSheetSubmenuContent({ children, className, style, UNSAFE_style, U
|
|
|
655
673
|
React.createElement(BottomSheet.BottomSheet.Content, { style: bottomSheetStyle },
|
|
656
674
|
title ? (React.createElement(DrawerTitle.DrawerTitle, { className: styles.screenReaderOnly }, title)) : null,
|
|
657
675
|
React.createElement("div", { className: styles$1.submenuHeader },
|
|
658
|
-
React.createElement(DrawerTitle.DrawerClose, { "aria-label": title ?
|
|
676
|
+
React.createElement(DrawerTitle.DrawerClose, { "aria-label": title ? t("Back to {title}", { title }) : t("back"), render: React.createElement(Button.Button, { ariaLabel: title ? t("Back to {title}", { title }) : t("back"), icon: "arrowLeft", type: "tertiary", variation: "subtle" }) }),
|
|
659
677
|
title ? (React.createElement("div", { className: styles$1.submenuTitle },
|
|
660
678
|
React.createElement(Typography.Typography, { element: "span", size: "base", fontWeight: "semiBold", textColor: "text" }, title))) : null),
|
|
661
679
|
React.createElement(BottomSheetMenuSurface, { menuRef: menuRef, className: classnames(styles.bottomSheetSubmenuBody, styles.composableSection, resolvedBaseProps.className) }, children))));
|
package/dist/Menu-es.js
CHANGED
|
@@ -3,6 +3,7 @@ import { useWindowDimensions, useRefocusOnActivator } from '@jobber/hooks';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
5
5
|
import { u as useFloating, c as useDismiss, g as useListNavigation, d as useInteractions, F as FloatingPortal } from './floating-ui.react-es.js';
|
|
6
|
+
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
6
7
|
import { B as Button } from './Button-es.js';
|
|
7
8
|
import { T as Typography } from './Typography-es.js';
|
|
8
9
|
import { I as Icon } from './Icon-es.js';
|
|
@@ -35,6 +36,21 @@ const OVERLAY_ANIMATION_CONFIG = {
|
|
|
35
36
|
type: "tween",
|
|
36
37
|
};
|
|
37
38
|
|
|
39
|
+
const menuMessages = defineMessages({
|
|
40
|
+
moreActions: {
|
|
41
|
+
en: "More Actions",
|
|
42
|
+
es: "Más acciones",
|
|
43
|
+
},
|
|
44
|
+
back: {
|
|
45
|
+
en: "Back",
|
|
46
|
+
es: "Atrás",
|
|
47
|
+
},
|
|
48
|
+
"Back to {title}": {
|
|
49
|
+
en: "Back to {title}",
|
|
50
|
+
es: "Volver a {title}",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
38
54
|
function isMobileDevice() {
|
|
39
55
|
if (typeof window === "undefined") {
|
|
40
56
|
return false;
|
|
@@ -56,6 +72,7 @@ const animationVariation = {
|
|
|
56
72
|
// eslint-disable-next-line max-statements
|
|
57
73
|
function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
58
74
|
var _a;
|
|
75
|
+
const { t } = useAtlantisI18n(menuMessages);
|
|
59
76
|
const [visible, setVisible] = useState(false);
|
|
60
77
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
61
78
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
@@ -120,7 +137,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
|
120
137
|
}
|
|
121
138
|
: {};
|
|
122
139
|
if (!activator) {
|
|
123
|
-
activator = (React__default.createElement(Button, { fullWidth: true, label: "
|
|
140
|
+
activator = (React__default.createElement(Button, { fullWidth: true, label: t("moreActions"), icon: "more", type: "secondary" }));
|
|
124
141
|
}
|
|
125
142
|
let itemIndexCounter = 0;
|
|
126
143
|
const renderedSections = items === null || items === void 0 ? void 0 : items.map((item, key) => (React__default.createElement("div", { key: key, className: styles$2.legacySection },
|
|
@@ -638,6 +655,7 @@ const BottomSheetSubmenuTrigger = React__default.forwardRef(function BottomSheet
|
|
|
638
655
|
React__default.createElement(Icon, { color: "icon", name: "arrowRight" }))) : null));
|
|
639
656
|
});
|
|
640
657
|
function BottomSheetSubmenuContent({ children, className, style, UNSAFE_style, UNSAFE_className, }) {
|
|
658
|
+
const { t } = useAtlantisI18n(menuMessages);
|
|
641
659
|
const { titleRef } = useBottomSheetSubmenuContext();
|
|
642
660
|
const title = titleRef.current;
|
|
643
661
|
const { focusModalityRef } = useBottomSheetContext();
|
|
@@ -653,7 +671,7 @@ function BottomSheetSubmenuContent({ children, className, style, UNSAFE_style, U
|
|
|
653
671
|
React__default.createElement(BottomSheet.Content, { style: bottomSheetStyle },
|
|
654
672
|
title ? (React__default.createElement(DrawerTitle, { className: styles.screenReaderOnly }, title)) : null,
|
|
655
673
|
React__default.createElement("div", { className: styles$1.submenuHeader },
|
|
656
|
-
React__default.createElement(DrawerClose, { "aria-label": title ?
|
|
674
|
+
React__default.createElement(DrawerClose, { "aria-label": title ? t("Back to {title}", { title }) : t("back"), render: React__default.createElement(Button, { ariaLabel: title ? t("Back to {title}", { title }) : t("back"), icon: "arrowLeft", type: "tertiary", variation: "subtle" }) }),
|
|
657
675
|
title ? (React__default.createElement("div", { className: styles$1.submenuTitle },
|
|
658
676
|
React__default.createElement(Typography, { element: "span", size: "base", fontWeight: "semiBold", textColor: "text" }, title))) : null),
|
|
659
677
|
React__default.createElement(BottomSheetMenuSurface, { menuRef: menuRef, className: classnames(styles.bottomSheetSubmenuBody, styles.composableSection, resolvedBaseProps.className) }, children))));
|