@jobber/components 8.29.1 → 9.0.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.
Files changed (52) hide show
  1. package/dist/Autocomplete-cjs.js +1 -1
  2. package/dist/Autocomplete-es.js +1 -1
  3. package/dist/Banner/Banner.messages.d.ts +6 -0
  4. package/dist/Banner/index.cjs +2 -0
  5. package/dist/Banner/index.mjs +2 -0
  6. package/dist/Banner-cjs.js +10 -1
  7. package/dist/Banner-es.js +10 -1
  8. package/dist/ButtonDismiss-cjs.js +1 -1
  9. package/dist/ButtonDismiss-es.js +1 -1
  10. package/dist/Chips/index.cjs +1 -1
  11. package/dist/Chips/index.mjs +1 -1
  12. package/dist/DataListSearch-cjs.js +1 -1
  13. package/dist/DataListSearch-es.js +1 -1
  14. package/dist/Dialog/dialogComposableShared.d.ts +1 -1
  15. package/dist/Drawer/Drawer.messages.d.ts +6 -0
  16. package/dist/Drawer/index.cjs +2 -0
  17. package/dist/Drawer/index.mjs +2 -0
  18. package/dist/DrawerGrid-cjs.js +10 -1
  19. package/dist/DrawerGrid-es.js +10 -1
  20. package/dist/FilterPickerContentSearch-cjs.js +1 -1
  21. package/dist/FilterPickerContentSearch-es.js +1 -1
  22. package/dist/FormFieldWrapper-cjs.js +1 -1
  23. package/dist/FormFieldWrapper-es.js +1 -1
  24. package/dist/Icon/Icon.d.ts +1 -0
  25. package/dist/Icon/index.cjs +9 -1
  26. package/dist/Icon/index.mjs +1 -1
  27. package/dist/Icon-cjs.js +9 -23
  28. package/dist/Icon-es.js +9 -23
  29. package/dist/InternalChipDismissible-cjs.js +1 -1
  30. package/dist/InternalChipDismissible-es.js +1 -1
  31. package/dist/SideDrawer/SideDrawer.messages.d.ts +10 -0
  32. package/dist/SideDrawer/index.cjs +2 -0
  33. package/dist/SideDrawer/index.mjs +2 -0
  34. package/dist/SideDrawer-cjs.js +17 -3
  35. package/dist/SideDrawer-es.js +17 -3
  36. package/dist/dialogReturnFocus-cjs.js +2 -2
  37. package/dist/dialogReturnFocus-es.js +2 -2
  38. package/dist/docs/ActivityIndicator/ActivityIndicator.md +11 -11
  39. package/dist/docs/Dialog/Dialog.md +16 -14
  40. package/dist/docs/Icon/Icon.md +19 -1
  41. package/dist/docs/InputNumberExperimental/InputNumberExperimental.md +1 -1
  42. package/dist/docs/empty-states/empty-states.md +13 -5
  43. package/dist/index.cjs +10 -1
  44. package/dist/index.mjs +2 -1
  45. package/dist/sharedHelpers/i18n/index.cjs +6 -33
  46. package/dist/sharedHelpers/i18n/index.mjs +5 -31
  47. package/dist/showToast-cjs.js +1 -1
  48. package/dist/showToast-es.js +1 -1
  49. package/dist/styles.css +1 -2
  50. package/dist/useAtlantisI18n-cjs.js +35 -0
  51. package/dist/useAtlantisI18n-es.js +32 -0
  52. package/package.json +3 -3
@@ -1253,7 +1253,7 @@ function SelectionChip({ value, active, disabled, getOptionLabel, customRenderVa
1253
1253
  }, unsafeClassName), style: unsafeStyle, "data-testid": "ATL-Autocomplete-chip", onPointerDown: preventDefaultPointerDown },
1254
1254
  customRenderValue ? (customRenderValue({ value, getOptionLabel })) : (React.createElement(Typography.Typography, { size: "small" }, getOptionLabel(value))),
1255
1255
  canDismiss && (React.createElement("button", { type: "button", disabled: disabled, className: styles.chipDismiss, onClick: onDismiss, onPointerDown: preventDefaultPointerDown, "aria-label": `Remove ${getOptionLabel(value)}`, tabIndex: -1 },
1256
- React.createElement(Icon.Icon, { size: "small", name: "remove" })))));
1256
+ React.createElement(Icon.Icon, { size: "small", name: "cross" })))));
1257
1257
  }
1258
1258
  function SelectionChipsList({ selectedValues, isFocused, limitVisibleSelections = 6, limitSelectionText = (count) => `+${count}`, activeChipIndex, disabled, getOptionLabel, customRenderValue, canDismiss, removeSelection, unsafeClassName, unsafeStyle, }) {
1259
1259
  const shouldLimit = !isFocused &&
@@ -1251,7 +1251,7 @@ function SelectionChip({ value, active, disabled, getOptionLabel, customRenderVa
1251
1251
  }, unsafeClassName), style: unsafeStyle, "data-testid": "ATL-Autocomplete-chip", onPointerDown: preventDefaultPointerDown },
1252
1252
  customRenderValue ? (customRenderValue({ value, getOptionLabel })) : (React__default.createElement(Typography, { size: "small" }, getOptionLabel(value))),
1253
1253
  canDismiss && (React__default.createElement("button", { type: "button", disabled: disabled, className: styles.chipDismiss, onClick: onDismiss, onPointerDown: preventDefaultPointerDown, "aria-label": `Remove ${getOptionLabel(value)}`, tabIndex: -1 },
1254
- React__default.createElement(Icon, { size: "small", name: "remove" })))));
1254
+ React__default.createElement(Icon, { size: "small", name: "cross" })))));
1255
1255
  }
1256
1256
  function SelectionChipsList({ selectedValues, isFocused, limitVisibleSelections = 6, limitSelectionText = (count) => `+${count}`, activeChipIndex, disabled, getOptionLabel, customRenderValue, canDismiss, removeSelection, unsafeClassName, unsafeStyle, }) {
1257
1257
  const shouldLimit = !isFocused &&
@@ -0,0 +1,6 @@
1
+ export declare const bannerMessages: {
2
+ dismissLabel: {
3
+ en: string;
4
+ es: string;
5
+ };
6
+ };
@@ -5,6 +5,8 @@ require('../tslib.es6-cjs.js');
5
5
  require('react');
6
6
  require('classnames');
7
7
  require('@jobber/hooks');
8
+ require('../useAtlantisI18n-cjs.js');
9
+ require('../AtlantisContext-cjs.js');
8
10
  require('../Icon-cjs.js');
9
11
  require('@jobber/design');
10
12
  require('../ButtonDismiss-cjs.js');
@@ -3,6 +3,8 @@ import '../tslib.es6-es.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import '@jobber/hooks';
6
+ import '../useAtlantisI18n-es.js';
7
+ import '../AtlantisContext-es.js';
6
8
  import '../Icon-es.js';
7
9
  import '@jobber/design';
8
10
  import '../ButtonDismiss-es.js';
@@ -4,6 +4,7 @@ var tslib_es6 = require('./tslib.es6-cjs.js');
4
4
  var React = require('react');
5
5
  var classnames = require('classnames');
6
6
  var jobberHooks = require('@jobber/hooks');
7
+ var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
7
8
  var Icon = require('./Icon-cjs.js');
8
9
  var ButtonDismiss = require('./ButtonDismiss-cjs.js');
9
10
  var Button = require('./Button-cjs.js');
@@ -23,6 +24,13 @@ function useBanner() {
23
24
  return React.useContext(BannerContext);
24
25
  }
25
26
 
27
+ const bannerMessages = useAtlantisI18n.defineMessages({
28
+ dismissLabel: {
29
+ en: "Dismiss notification",
30
+ es: "Descartar notificación",
31
+ },
32
+ });
33
+
26
34
  function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, controlledVisiblity, }) {
27
35
  if (primaryAction != undefined) {
28
36
  primaryAction = Object.assign({
@@ -97,7 +105,8 @@ Banner.Content = function BannerContent(props) {
97
105
  Banner.DismissButton = function DismissButton(props) {
98
106
  var _a, _b, _c, _d;
99
107
  const { setIsVisible } = useBanner();
100
- const ariaLabel = (_a = props.ariaLabel) !== null && _a !== void 0 ? _a : "Dismiss notification";
108
+ const { t } = useAtlantisI18n.useAtlantisI18n(bannerMessages);
109
+ const ariaLabel = (_a = props.ariaLabel) !== null && _a !== void 0 ? _a : t("dismissLabel");
101
110
  const onClick = (_b = props.onClick) !== null && _b !== void 0 ? _b : (() => {
102
111
  setIsVisible(false);
103
112
  });
package/dist/Banner-es.js CHANGED
@@ -2,6 +2,7 @@ import { _ as __rest } from './tslib.es6-es.js';
2
2
  import React__default, { createContext, useContext, useState } from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { useResizeObserver } from '@jobber/hooks';
5
+ import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
5
6
  import { I as Icon } from './Icon-es.js';
6
7
  import { B as ButtonDismiss } from './ButtonDismiss-es.js';
7
8
  import { B as Button } from './Button-es.js';
@@ -21,6 +22,13 @@ function useBanner() {
21
22
  return useContext(BannerContext);
22
23
  }
23
24
 
25
+ const bannerMessages = defineMessages({
26
+ dismissLabel: {
27
+ en: "Dismiss notification",
28
+ es: "Descartar notificación",
29
+ },
30
+ });
31
+
24
32
  function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, controlledVisiblity, }) {
25
33
  if (primaryAction != undefined) {
26
34
  primaryAction = Object.assign({
@@ -95,7 +103,8 @@ Banner.Content = function BannerContent(props) {
95
103
  Banner.DismissButton = function DismissButton(props) {
96
104
  var _a, _b, _c, _d;
97
105
  const { setIsVisible } = useBanner();
98
- const ariaLabel = (_a = props.ariaLabel) !== null && _a !== void 0 ? _a : "Dismiss notification";
106
+ const { t } = useAtlantisI18n(bannerMessages);
107
+ const ariaLabel = (_a = props.ariaLabel) !== null && _a !== void 0 ? _a : t("dismissLabel");
99
108
  const onClick = (_b = props.onClick) !== null && _b !== void 0 ? _b : (() => {
100
109
  setIsVisible(false);
101
110
  });
@@ -5,7 +5,7 @@ var Button = require('./Button-cjs.js');
5
5
  require('classnames');
6
6
 
7
7
  function ButtonDismiss({ onClick, ariaLabel }) {
8
- return (React.createElement(Button.Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
8
+ return (React.createElement(Button.Button, { ariaLabel: ariaLabel, icon: "cross", onClick: onClick, type: "tertiary", variation: "subtle" }));
9
9
  }
10
10
 
11
11
  exports.ButtonDismiss = ButtonDismiss;
@@ -3,7 +3,7 @@ import { B as Button } from './Button-es.js';
3
3
  import 'classnames';
4
4
 
5
5
  function ButtonDismiss({ onClick, ariaLabel }) {
6
- return (React__default.createElement(Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
6
+ return (React__default.createElement(Button, { ariaLabel: ariaLabel, icon: "cross", onClick: onClick, type: "tertiary", variation: "subtle" }));
7
7
  }
8
8
 
9
9
  export { ButtonDismiss as B };
@@ -45,7 +45,7 @@ require('framer-motion');
45
45
  * @deprecated Use Autocomplete with the "multiple" prop instead of ChipDismissible.
46
46
  */
47
47
  function ChipDismissible({ label, disabled, invalid, prefix, onClick, onRequestRemove, }) {
48
- return (React.createElement(InternalChipDismissible.InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React.createElement(Chip$1.InternalChipButton, { icon: "remove", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
48
+ return (React.createElement(InternalChipDismissible.InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React.createElement(Chip$1.InternalChipButton, { icon: "cross", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
49
49
  }
50
50
 
51
51
  // Only need the component to pass in the data as a react children
@@ -43,7 +43,7 @@ import 'framer-motion';
43
43
  * @deprecated Use Autocomplete with the "multiple" prop instead of ChipDismissible.
44
44
  */
45
45
  function ChipDismissible({ label, disabled, invalid, prefix, onClick, onRequestRemove, }) {
46
- return (React__default.createElement(InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React__default.createElement(InternalChipButton, { icon: "remove", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
46
+ return (React__default.createElement(InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React__default.createElement(InternalChipButton, { icon: "cross", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
47
47
  }
48
48
 
49
49
  // Only need the component to pass in the data as a react children
@@ -62,7 +62,7 @@ function InternalDataListSearch() {
62
62
  : handleUncontrolledChange, prefix: { icon: "search" }, clearable: "always" })),
63
63
  React.createElement("div", { className: styles.searchButton },
64
64
  React.createElement(framerMotion.AnimatePresence, { mode: "wait", initial: false },
65
- React.createElement(framerMotion.motion.div, { ref: applyChildDisplay, key: visible ? "close" : "search", variants: visible ? SLIDE_IN_UP : SLIDE_IN_DOWN, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: SWAP_DURATION } }, visible ? (React.createElement(Button.Button, { variation: "subtle", icon: "remove", ariaLabel: "Close search bar", onClick: toggleSearch })) : (React.createElement(Button.Button, { variation: "subtle", icon: "search", ariaLabel: "Search", onClick: toggleSearch })))))));
65
+ React.createElement(framerMotion.motion.div, { ref: applyChildDisplay, key: visible ? "close" : "search", variants: visible ? SLIDE_IN_UP : SLIDE_IN_DOWN, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: SWAP_DURATION } }, visible ? (React.createElement(Button.Button, { variation: "subtle", icon: "cross", ariaLabel: "Close search bar", onClick: toggleSearch })) : (React.createElement(Button.Button, { variation: "subtle", icon: "search", ariaLabel: "Search", onClick: toggleSearch })))))));
66
66
  function getPlaceholder() {
67
67
  if (placeholder)
68
68
  return placeholder;
@@ -60,7 +60,7 @@ function InternalDataListSearch() {
60
60
  : handleUncontrolledChange, prefix: { icon: "search" }, clearable: "always" })),
61
61
  React__default.createElement("div", { className: styles.searchButton },
62
62
  React__default.createElement(AnimatePresence, { mode: "wait", initial: false },
63
- React__default.createElement(motion.div, { ref: applyChildDisplay, key: visible ? "close" : "search", variants: visible ? SLIDE_IN_UP : SLIDE_IN_DOWN, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: SWAP_DURATION } }, visible ? (React__default.createElement(Button, { variation: "subtle", icon: "remove", ariaLabel: "Close search bar", onClick: toggleSearch })) : (React__default.createElement(Button, { variation: "subtle", icon: "search", ariaLabel: "Search", onClick: toggleSearch })))))));
63
+ React__default.createElement(motion.div, { ref: applyChildDisplay, key: visible ? "close" : "search", variants: visible ? SLIDE_IN_UP : SLIDE_IN_DOWN, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: SWAP_DURATION } }, visible ? (React__default.createElement(Button, { variation: "subtle", icon: "cross", ariaLabel: "Close search bar", onClick: toggleSearch })) : (React__default.createElement(Button, { variation: "subtle", icon: "search", ariaLabel: "Search", onClick: toggleSearch })))))));
64
64
  function getPlaceholder() {
65
65
  if (placeholder)
66
66
  return placeholder;
@@ -15,7 +15,7 @@ export declare function resolveComposableTriggerRender({ children, render, }: {
15
15
  /**
16
16
  * Resolves the dismiss element for `Dialog.Close`, mirroring
17
17
  * `resolveComposableTriggerRender` so a custom render works in both shells.
18
- * Falls back to the subtle "remove" `ButtonDismiss` when neither `render` nor
18
+ * Falls back to the subtle "cross" `ButtonDismiss` when neither `render` nor
19
19
  * `children` are supplied. An Atlantis `<Button>`/`<ButtonDismiss>` passed via
20
20
  * `render` or `children` is adapted; any other valid element is used as-is.
21
21
  */
@@ -0,0 +1,6 @@
1
+ export declare const drawerMessages: {
2
+ "Close {title}": {
3
+ en: string;
4
+ es: string;
5
+ };
6
+ };
@@ -3,6 +3,8 @@
3
3
  var DrawerGrid = require('../DrawerGrid-cjs.js');
4
4
  require('react');
5
5
  require('classnames');
6
+ require('../useAtlantisI18n-cjs.js');
7
+ require('../AtlantisContext-cjs.js');
6
8
  require('../Heading-cjs.js');
7
9
  require('../Typography-cjs.js');
8
10
  require('../ButtonDismiss-cjs.js');
@@ -1,6 +1,8 @@
1
1
  export { D as Drawer, a as DrawerGrid } from '../DrawerGrid-es.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
+ import '../useAtlantisI18n-es.js';
5
+ import '../AtlantisContext-es.js';
4
6
  import '../Heading-es.js';
5
7
  import '../Typography-es.js';
6
8
  import '../ButtonDismiss-es.js';
@@ -2,11 +2,19 @@
2
2
 
3
3
  var React = require('react');
4
4
  var classnames = require('classnames');
5
+ var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
5
6
  var Heading = require('./Heading-cjs.js');
6
7
  var ButtonDismiss = require('./ButtonDismiss-cjs.js');
7
8
 
8
9
  var styles$1 = {"container":"LNIwHwCs8gQ-","drawer":"iDSQR4mxUvM-","open":"y9lAhWPltyg-","header":"s830oNhRdZE-","heading":"MZuJ7od4r-o-","contentScroll":"I4XEGwkvw74-","content":"jZzp04L7Gao-","spinning":"dzsdJUdmmt8-"};
9
10
 
11
+ const drawerMessages = useAtlantisI18n.defineMessages({
12
+ "Close {title}": {
13
+ en: "Close {title}",
14
+ es: "Cerrar {title}",
15
+ },
16
+ });
17
+
10
18
  function Drawer({ title, children, open = true, onRequestClose, id, }) {
11
19
  const drawerClassNames = classnames(styles$1.container, open && styles$1.open);
12
20
  return (React.createElement("aside", { className: drawerClassNames, "data-testid": "drawer-container", "aria-label": title, "aria-hidden": !open, id: id },
@@ -16,10 +24,11 @@ function Drawer({ title, children, open = true, onRequestClose, id, }) {
16
24
  React.createElement("div", { className: styles$1.content }, children)))));
17
25
  }
18
26
  function Header({ title, onRequestClose }) {
27
+ const { t } = useAtlantisI18n.useAtlantisI18n(drawerMessages);
19
28
  return (React.createElement("div", { className: styles$1.header, "data-testid": "drawer-header" },
20
29
  React.createElement("div", { className: styles$1.heading },
21
30
  React.createElement(Heading.Heading, { level: 2 }, title)),
22
- React.createElement(ButtonDismiss.ButtonDismiss, { onClick: onRequestClose, ariaLabel: `Close ${title || "drawer"}` })));
31
+ React.createElement(ButtonDismiss.ButtonDismiss, { onClick: onRequestClose, ariaLabel: t("Close {title}", { title }) })));
23
32
  }
24
33
 
25
34
  var styles = {"drawerGrid":"_50Jq09W07gg-","spinning":"GqOdr2k9PX8-"};
@@ -1,10 +1,18 @@
1
1
  import React__default from 'react';
2
2
  import classnames from 'classnames';
3
+ import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
3
4
  import { H as Heading } from './Heading-es.js';
4
5
  import { B as ButtonDismiss } from './ButtonDismiss-es.js';
5
6
 
6
7
  var styles$1 = {"container":"LNIwHwCs8gQ-","drawer":"iDSQR4mxUvM-","open":"y9lAhWPltyg-","header":"s830oNhRdZE-","heading":"MZuJ7od4r-o-","contentScroll":"I4XEGwkvw74-","content":"jZzp04L7Gao-","spinning":"dzsdJUdmmt8-"};
7
8
 
9
+ const drawerMessages = defineMessages({
10
+ "Close {title}": {
11
+ en: "Close {title}",
12
+ es: "Cerrar {title}",
13
+ },
14
+ });
15
+
8
16
  function Drawer({ title, children, open = true, onRequestClose, id, }) {
9
17
  const drawerClassNames = classnames(styles$1.container, open && styles$1.open);
10
18
  return (React__default.createElement("aside", { className: drawerClassNames, "data-testid": "drawer-container", "aria-label": title, "aria-hidden": !open, id: id },
@@ -14,10 +22,11 @@ function Drawer({ title, children, open = true, onRequestClose, id, }) {
14
22
  React__default.createElement("div", { className: styles$1.content }, children)))));
15
23
  }
16
24
  function Header({ title, onRequestClose }) {
25
+ const { t } = useAtlantisI18n(drawerMessages);
17
26
  return (React__default.createElement("div", { className: styles$1.header, "data-testid": "drawer-header" },
18
27
  React__default.createElement("div", { className: styles$1.heading },
19
28
  React__default.createElement(Heading, { level: 2 }, title)),
20
- React__default.createElement(ButtonDismiss, { onClick: onRequestClose, ariaLabel: `Close ${title || "drawer"}` })));
29
+ React__default.createElement(ButtonDismiss, { onClick: onRequestClose, ariaLabel: t("Close {title}", { title }) })));
21
30
  }
22
31
 
23
32
  var styles = {"drawerGrid":"_50Jq09W07gg-","spinning":"GqOdr2k9PX8-"};
@@ -18,7 +18,7 @@ function FilterPickerContentSearch(props) {
18
18
  return (React.createElement("div", { className: styles.search },
19
19
  React.createElement("input", { type: "search", ref: searchRef, className: styles.searchInput, placeholder: props.placeholder ? `Search ${props.placeholder}` : "Search", onChange: (event) => handleSearch(event), value: props.searchValue }),
20
20
  props.searchValue && (React.createElement("button", { className: styles.clearSearch, onClick: clearSearch, type: "button", "data-testid": "ATL-FilterPicker-Content-Search-Clear", "aria-label": "Clear search" },
21
- React.createElement(Icon.Icon, { name: "remove", size: "small" })))));
21
+ React.createElement(Icon.Icon, { name: "cross", size: "small" })))));
22
22
  function clearSearch() {
23
23
  var _a;
24
24
  props.setSearchValue("");
@@ -16,7 +16,7 @@ function FilterPickerContentSearch(props) {
16
16
  return (React__default.createElement("div", { className: styles.search },
17
17
  React__default.createElement("input", { type: "search", ref: searchRef, className: styles.searchInput, placeholder: props.placeholder ? `Search ${props.placeholder}` : "Search", onChange: (event) => handleSearch(event), value: props.searchValue }),
18
18
  props.searchValue && (React__default.createElement("button", { className: styles.clearSearch, onClick: clearSearch, type: "button", "data-testid": "ATL-FilterPicker-Content-Search-Clear", "aria-label": "Clear search" },
19
- React__default.createElement(Icon, { name: "remove", size: "small" })))));
19
+ React__default.createElement(Icon, { name: "cross", size: "small" })))));
20
20
  function clearSearch() {
21
21
  var _a;
22
22
  props.setSearchValue("");
@@ -57,7 +57,7 @@ function ClearAction({ onClick, visible, }) {
57
57
  if (!visible)
58
58
  return null;
59
59
  return (React.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": "Clear input", "data-testid": "ATL-FormField-clearButton" },
60
- React.createElement(Icon.Icon, { name: "remove", size: "small" })));
60
+ React.createElement(Icon.Icon, { name: "cross", size: "small" })));
61
61
  }
62
62
 
63
63
  function useToolbar(props) {
@@ -55,7 +55,7 @@ function ClearAction({ onClick, visible, }) {
55
55
  if (!visible)
56
56
  return null;
57
57
  return (React__default.createElement("button", { className: styles.clearInput, onClick: onClick, type: "button", "aria-label": "Clear input", "data-testid": "ATL-FormField-clearButton" },
58
- React__default.createElement(Icon, { name: "remove", size: "small" })));
58
+ React__default.createElement(Icon, { name: "cross", size: "small" })));
59
59
  }
60
60
 
61
61
  function useToolbar(props) {
@@ -2,6 +2,7 @@ import type { CSSProperties } from "react";
2
2
  import React from "react";
3
3
  import type { IconColorNames, IconNames, IconSizes } from "@jobber/design";
4
4
  export type { IconColorNames, IconNames } from "@jobber/design";
5
+ export { iconNames, isIconName } from "@jobber/design";
5
6
  export interface IconProps {
6
7
  /** The icon to show. */
7
8
  readonly name: IconNames;
@@ -1,9 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var Icon = require('../Icon-cjs.js');
4
+ var design = require('@jobber/design');
4
5
  require('react');
5
- require('@jobber/design');
6
6
 
7
7
 
8
8
 
9
9
  exports.Icon = Icon.Icon;
10
+ Object.defineProperty(exports, "iconNames", {
11
+ enumerable: true,
12
+ get: function () { return design.iconNames; }
13
+ });
14
+ Object.defineProperty(exports, "isIconName", {
15
+ enumerable: true,
16
+ get: function () { return design.isIconName; }
17
+ });
@@ -1,3 +1,3 @@
1
1
  export { I as Icon } from '../Icon-es.js';
2
+ export { iconNames, isIconName } from '@jobber/design';
2
3
  import 'react';
3
- import '@jobber/design';
package/dist/Icon-cjs.js CHANGED
@@ -4,35 +4,21 @@ var React = require('react');
4
4
  var design = require('@jobber/design');
5
5
 
6
6
  function Icon({ name, color, customColor, size = "base", testID, UNSAFE_className, UNSAFE_style, }) {
7
- let icon;
8
7
  const { svgStyle, pathStyle, paths, viewBox } = design.getIcon({
9
8
  name,
10
- color: getIconColor(name, color),
9
+ color,
10
+ customColor,
11
11
  size,
12
12
  platform: "web",
13
13
  });
14
- if (name === "truck") {
15
- icon = getTruck(pathStyle, customColor);
16
- }
17
- else {
18
- // getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
19
- icon = (paths !== null && paths !== void 0 ? paths : []).map((path) => (React.createElement("path", { key: path, style: Object.assign(Object.assign({}, pathStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path, fill: customColor })));
20
- }
14
+ // Paths with their own fill are static artwork; only unfilled paths take
15
+ // the themed color and customColor.
16
+ // getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
17
+ const icon = (paths !== null && paths !== void 0 ? paths : []).map(path => {
18
+ var _a;
19
+ return (React.createElement("path", { key: path.d, style: Object.assign(Object.assign({}, (path.fill ? {} : pathStyle)), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path.d, fill: (_a = path.fill) !== null && _a !== void 0 ? _a : customColor, fillOpacity: path.fillOpacity, opacity: path.opacity }));
20
+ });
21
21
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, style: Object.assign(Object.assign({}, svgStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.svg), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.svg, "data-testid": testID || name }, icon));
22
22
  }
23
- function getIconColor(name, color) {
24
- if (name === "truck") {
25
- return color || "green";
26
- }
27
- return color;
28
- }
29
- function getTruck(pathStyle, customColor) {
30
- return (React.createElement("g", { transform: "translate(233.000000, 0.000000)", style: Object.assign({}, pathStyle) },
31
- React.createElement("path", { d: "M31.030303,124.121212 C31.030303,106.983796 44.9231903,93.0909091 62.0606061,93.0909091 L93.0909091,93.0909091 L93.0909091,279.272727 L62.0606061,279.272727 C44.9231903,279.272727 31.030303,265.37984 31.030303,248.242424 L31.030303,124.121212 Z M31.030303,744.727273 C31.030303,727.589236 44.9231903,713.69697 62.0606061,713.69697 L93.0909091,713.69697 L93.0909091,899.878788 L62.0606061,899.878788 C44.9231903,899.878788 31.030303,885.986521 31.030303,868.848485 L31.030303,744.727273 Z M62.0606061,961.939394 L496.484848,961.939394 L496.484848,992.969697 C496.484848,1010.10773 482.592582,1024 465.454545,1024 L93.0909091,1024 C75.9534933,1024 62.0606061,1010.10773 62.0606061,992.969697 L62.0606061,961.939394 Z M494.858861,713.715588 L463.834764,714.258618 L467.083636,900.412509 L498.107733,899.869479 C515.242667,899.571588 528.889794,885.437285 528.591903,868.302352 L526.425988,744.199758 C526.128097,727.064824 511.993794,713.417697 494.858861,713.715588 Z M496.484848,93.0909091 L465.454545,93.0909091 L465.454545,279.272727 L496.484848,279.272727 C513.622885,279.272727 527.515152,265.37984 527.515152,248.242424 L527.515152,124.121212 C527.515152,106.983796 513.622885,93.0909091 496.484848,93.0909091 Z", id: "Shape", fill: "#2B2B2B" }),
32
- React.createElement("path", { d: "M124.121212,0 C89.8460703,0 62.0606061,27.7854642 62.0606061,62.0606061 L62.0606061,310.30303 L31.030303,310.30303 C13.8927321,310.30303 0,324.195297 0,341.333333 L62.0606061,341.333333 L62.0606061,992.969697 L496.484848,992.969697 L496.484848,341.333333 L558.545455,341.333333 C558.545455,324.195297 544.653188,310.30303 527.515152,310.30303 L496.484848,310.30303 L496.484848,62.0606061 C496.484848,27.7854642 468.700315,0 434.424242,0 L124.121212,0 Z", id: "Path", fill: customColor }),
33
- React.createElement("path", { d: "M465.454545,589.575758 L93.0909091,589.575758 L93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,961.939394 L465.454545,961.939394 L465.454545,899.878788 L434.424242,899.878788 C417.286206,899.878788 403.393939,885.986521 403.393939,868.848485 L403.393939,744.727273 C403.393939,727.589236 417.286206,713.69697 434.424242,713.69697 L465.454545,713.69697 L465.454545,589.575758 Z", id: "Path", fillOpacity: "0.35", fill: "#000000" }),
34
- React.createElement("path", { d: "M93.0909091,62.0606061 C93.0909091,44.9231903 106.983796,31.030303 124.121212,31.030303 L434.424242,31.030303 C451.562279,31.030303 465.454545,44.9231903 465.454545,62.0606061 L465.454545,589.575758 L93.0909091,589.575758 L93.0909091,62.0606061 Z M93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,713.69697 Z M434.424242,713.69697 C417.286206,713.69697 403.393939,727.589236 403.393939,744.727273 L403.393939,868.848485 C403.393939,885.986521 417.286206,899.878788 434.424242,899.878788 L465.454545,899.878788 L465.454545,713.69697 L434.424242,713.69697 Z", id: "Shape", fill: "#FFFFFF", opacity: "0.5" }),
35
- React.createElement("path", { d: "M93.0909091,279.272727 C113.777881,268.929396 192.387879,248.242424 279.272727,248.242424 C366.157576,248.242424 444.766642,268.929396 465.454545,279.272727 L403.393939,372.363636 C393.051539,362.021236 341.333333,341.333333 279.272727,341.333333 C217.212121,341.333333 165.494846,362.021236 155.151515,372.363636 L93.0909091,279.272727 Z M155.151515,512 L155.151515,403.393939 L93.0909091,310.30303 L93.0909091,512 L155.151515,512 Z M403.393939,512 L403.393939,403.393939 L465.454545,310.30303 L465.454545,512 L403.393939,512 Z", id: "Shape", fill: "#2A2A2A" })));
36
- }
37
23
 
38
24
  exports.Icon = Icon;
package/dist/Icon-es.js CHANGED
@@ -2,35 +2,21 @@ import React__default from 'react';
2
2
  import { getIcon } from '@jobber/design';
3
3
 
4
4
  function Icon({ name, color, customColor, size = "base", testID, UNSAFE_className, UNSAFE_style, }) {
5
- let icon;
6
5
  const { svgStyle, pathStyle, paths, viewBox } = getIcon({
7
6
  name,
8
- color: getIconColor(name, color),
7
+ color,
8
+ customColor,
9
9
  size,
10
10
  platform: "web",
11
11
  });
12
- if (name === "truck") {
13
- icon = getTruck(pathStyle, customColor);
14
- }
15
- else {
16
- // getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
17
- icon = (paths !== null && paths !== void 0 ? paths : []).map((path) => (React__default.createElement("path", { key: path, style: Object.assign(Object.assign({}, pathStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path, fill: customColor })));
18
- }
12
+ // Paths with their own fill are static artwork; only unfilled paths take
13
+ // the themed color and customColor.
14
+ // getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
15
+ const icon = (paths !== null && paths !== void 0 ? paths : []).map(path => {
16
+ var _a;
17
+ return (React__default.createElement("path", { key: path.d, style: Object.assign(Object.assign({}, (path.fill ? {} : pathStyle)), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.path), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.path, d: path.d, fill: (_a = path.fill) !== null && _a !== void 0 ? _a : customColor, fillOpacity: path.fillOpacity, opacity: path.opacity }));
18
+ });
19
19
  return (React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, style: Object.assign(Object.assign({}, svgStyle), UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.svg), className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.svg, "data-testid": testID || name }, icon));
20
20
  }
21
- function getIconColor(name, color) {
22
- if (name === "truck") {
23
- return color || "green";
24
- }
25
- return color;
26
- }
27
- function getTruck(pathStyle, customColor) {
28
- return (React__default.createElement("g", { transform: "translate(233.000000, 0.000000)", style: Object.assign({}, pathStyle) },
29
- React__default.createElement("path", { d: "M31.030303,124.121212 C31.030303,106.983796 44.9231903,93.0909091 62.0606061,93.0909091 L93.0909091,93.0909091 L93.0909091,279.272727 L62.0606061,279.272727 C44.9231903,279.272727 31.030303,265.37984 31.030303,248.242424 L31.030303,124.121212 Z M31.030303,744.727273 C31.030303,727.589236 44.9231903,713.69697 62.0606061,713.69697 L93.0909091,713.69697 L93.0909091,899.878788 L62.0606061,899.878788 C44.9231903,899.878788 31.030303,885.986521 31.030303,868.848485 L31.030303,744.727273 Z M62.0606061,961.939394 L496.484848,961.939394 L496.484848,992.969697 C496.484848,1010.10773 482.592582,1024 465.454545,1024 L93.0909091,1024 C75.9534933,1024 62.0606061,1010.10773 62.0606061,992.969697 L62.0606061,961.939394 Z M494.858861,713.715588 L463.834764,714.258618 L467.083636,900.412509 L498.107733,899.869479 C515.242667,899.571588 528.889794,885.437285 528.591903,868.302352 L526.425988,744.199758 C526.128097,727.064824 511.993794,713.417697 494.858861,713.715588 Z M496.484848,93.0909091 L465.454545,93.0909091 L465.454545,279.272727 L496.484848,279.272727 C513.622885,279.272727 527.515152,265.37984 527.515152,248.242424 L527.515152,124.121212 C527.515152,106.983796 513.622885,93.0909091 496.484848,93.0909091 Z", id: "Shape", fill: "#2B2B2B" }),
30
- React__default.createElement("path", { d: "M124.121212,0 C89.8460703,0 62.0606061,27.7854642 62.0606061,62.0606061 L62.0606061,310.30303 L31.030303,310.30303 C13.8927321,310.30303 0,324.195297 0,341.333333 L62.0606061,341.333333 L62.0606061,992.969697 L496.484848,992.969697 L496.484848,341.333333 L558.545455,341.333333 C558.545455,324.195297 544.653188,310.30303 527.515152,310.30303 L496.484848,310.30303 L496.484848,62.0606061 C496.484848,27.7854642 468.700315,0 434.424242,0 L124.121212,0 Z", id: "Path", fill: customColor }),
31
- React__default.createElement("path", { d: "M465.454545,589.575758 L93.0909091,589.575758 L93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,961.939394 L465.454545,961.939394 L465.454545,899.878788 L434.424242,899.878788 C417.286206,899.878788 403.393939,885.986521 403.393939,868.848485 L403.393939,744.727273 C403.393939,727.589236 417.286206,713.69697 434.424242,713.69697 L465.454545,713.69697 L465.454545,589.575758 Z", id: "Path", fillOpacity: "0.35", fill: "#000000" }),
32
- React__default.createElement("path", { d: "M93.0909091,62.0606061 C93.0909091,44.9231903 106.983796,31.030303 124.121212,31.030303 L434.424242,31.030303 C451.562279,31.030303 465.454545,44.9231903 465.454545,62.0606061 L465.454545,589.575758 L93.0909091,589.575758 L93.0909091,62.0606061 Z M93.0909091,713.69697 L124.121212,713.69697 C141.258628,713.69697 155.151515,727.589236 155.151515,744.727273 L155.151515,868.848485 C155.151515,885.986521 141.258628,899.878788 124.121212,899.878788 L93.0909091,899.878788 L93.0909091,713.69697 Z M434.424242,713.69697 C417.286206,713.69697 403.393939,727.589236 403.393939,744.727273 L403.393939,868.848485 C403.393939,885.986521 417.286206,899.878788 434.424242,899.878788 L465.454545,899.878788 L465.454545,713.69697 L434.424242,713.69697 Z", id: "Shape", fill: "#FFFFFF", opacity: "0.5" }),
33
- React__default.createElement("path", { d: "M93.0909091,279.272727 C113.777881,268.929396 192.387879,248.242424 279.272727,248.242424 C366.157576,248.242424 444.766642,268.929396 465.454545,279.272727 L403.393939,372.363636 C393.051539,362.021236 341.333333,341.333333 279.272727,341.333333 C217.212121,341.333333 165.494846,362.021236 155.151515,372.363636 L93.0909091,279.272727 Z M155.151515,512 L155.151515,403.393939 L93.0909091,310.30303 L93.0909091,512 L155.151515,512 Z M403.393939,512 L403.393939,403.393939 L465.454545,310.30303 L465.454545,512 L403.393939,512 Z", id: "Shape", fill: "#2A2A2A" })));
34
- }
35
21
 
36
22
  export { Icon as I };
@@ -58,7 +58,7 @@ function InternalChipDismissibleInput(props) {
58
58
  function InternalChipDismissible(props) {
59
59
  const { availableChipOptions, ref: wrapperRef, wrapperElement, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useScrollToActive.useInternalChipDismissible(props);
60
60
  return (React.createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
61
- sortedVisibleChipOptions.map(chip => (React.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React.createElement(Chip.InternalChipButton, { icon: "remove", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
61
+ sortedVisibleChipOptions.map(chip => (React.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React.createElement(Chip.InternalChipButton, { icon: "cross", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
62
62
  React.createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperElement, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore, onlyShowMenuOnSearch: props.onlyShowMenuOnSearch, autoSelectOnClickOutside: props.autoSelectOnClickOutside })));
63
63
  }
64
64
 
@@ -56,7 +56,7 @@ function InternalChipDismissibleInput(props) {
56
56
  function InternalChipDismissible(props) {
57
57
  const { availableChipOptions, ref: wrapperRef, wrapperElement, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useInternalChipDismissible(props);
58
58
  return (React__default.createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
59
- sortedVisibleChipOptions.map(chip => (React__default.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React__default.createElement(InternalChipButton, { icon: "remove", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
59
+ sortedVisibleChipOptions.map(chip => (React__default.createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.label}. Press delete or backspace to remove ${chip.label}`, tabIndex: 0, suffix: React__default.createElement(InternalChipButton, { icon: "cross", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
60
60
  React__default.createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperElement, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore, onlyShowMenuOnSearch: props.onlyShowMenuOnSearch, autoSelectOnClickOutside: props.autoSelectOnClickOutside })));
61
61
  }
62
62
 
@@ -0,0 +1,10 @@
1
+ export declare const sideDrawerMessages: {
2
+ Close: {
3
+ en: string;
4
+ es: string;
5
+ };
6
+ Back: {
7
+ en: string;
8
+ es: string;
9
+ };
10
+ };
@@ -9,6 +9,8 @@ require('classnames');
9
9
  require('@jobber/design');
10
10
  require('../Heading-cjs.js');
11
11
  require('../Typography-cjs.js');
12
+ require('../useAtlantisI18n-cjs.js');
13
+ require('../AtlantisContext-cjs.js');
12
14
  require('../Button-cjs.js');
13
15
  require('../tslib.es6-cjs.js');
14
16
  require('react-router-dom');
@@ -7,6 +7,8 @@ import 'classnames';
7
7
  import '@jobber/design';
8
8
  import '../Heading-es.js';
9
9
  import '../Typography-es.js';
10
+ import '../useAtlantisI18n-es.js';
11
+ import '../AtlantisContext-es.js';
10
12
  import '../Button-es.js';
11
13
  import '../tslib.es6-es.js';
12
14
  import 'react-router-dom';
@@ -7,6 +7,7 @@ var jobberHooks = require('@jobber/hooks');
7
7
  var classnames = require('classnames');
8
8
  var design = require('@jobber/design');
9
9
  var Heading = require('./Heading-cjs.js');
10
+ var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
10
11
  var Button = require('./Button-cjs.js');
11
12
  var Flex = require('./Flex-cjs.js');
12
13
 
@@ -48,8 +49,20 @@ function SideDrawerToolbar({ children }) {
48
49
 
49
50
  var styles = {"drawer":"cCwRgRAz4qk-","inline":"ONUfsWMLKdo-","container":"XipkpXgyzyg-","header":"LuqC0RF-R1U-","content":"vArEcEUxGxQ-","footer":"_4HzuRZKD9u8-","subtle":"v5Db-FCF2kU-","heading":"Eti1JL3rghE-","hasShadow":"PtbV1GtWwzY-","headerActions":"YCdqkhcLHfI-","hideWhenEmpty":"ZH2Mp84HhX8-","overlay":"Ro-pE7hx0wY-","reverseScroll":"gSN5nWDwGm4-","headerShadowListener":"tMeBAjf4vEA-","footerShadowListener":"-lPSZVGIIAs-","backButton":"XOqA4Hw6S6g-","backButtonVisible":"b4VHPS-RG34-","spinning":"McL3-VWXVbs-"};
50
51
 
52
+ const sideDrawerMessages = useAtlantisI18n.defineMessages({
53
+ Close: {
54
+ en: "Close",
55
+ es: "Cerrar",
56
+ },
57
+ Back: {
58
+ en: "Back",
59
+ es: "Atrás",
60
+ },
61
+ });
62
+
51
63
  function SideDrawerBackButton({ onClick, }) {
52
64
  const { backPortal, registerComponent, unRegisterComponent } = useSideDrawerContext();
65
+ const { t } = useAtlantisI18n.useAtlantisI18n(sideDrawerMessages);
53
66
  React.useEffect(() => {
54
67
  registerComponent("backButton");
55
68
  return () => {
@@ -58,7 +71,7 @@ function SideDrawerBackButton({ onClick, }) {
58
71
  }, []);
59
72
  if (!backPortal)
60
73
  return null;
61
- return ReactDOM.createPortal(React.createElement(Button.Button, { ariaLabel: "Back", icon: "longArrowLeft", variation: "subtle", type: "tertiary", onClick: onClick }), backPortal);
74
+ return ReactDOM.createPortal(React.createElement(Button.Button, { ariaLabel: t("Back"), icon: "longArrowLeft", variation: "subtle", type: "tertiary", onClick: onClick }), backPortal);
62
75
  }
63
76
 
64
77
  function SideDrawerFooter({ children }) {
@@ -104,6 +117,7 @@ const useSideDrawerState = (open) => {
104
117
  function SideDrawer({ children, onRequestClose, open, variation = "base", scrollDirection, inline = false, UNSAFE_className, UNSAFE_style, }) {
105
118
  var _a;
106
119
  const { ref, setRef, components, setComponents, slots, sideDrawerRef, headerShadowRef, noHeaderShadow, footerShadowRef, noFooterShadow, } = useSideDrawerState(open);
120
+ const { t } = useAtlantisI18n.useAtlantisI18n(sideDrawerMessages);
107
121
  jobberHooks.useRefocusOnActivator(open);
108
122
  const container = ((_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.body) || null;
109
123
  const isMounted = jobberHooks.useIsMounted();
@@ -119,7 +133,7 @@ function SideDrawer({ children, onRequestClose, open, variation = "base", scroll
119
133
  registerComponent: key => setComponents(prev => (Object.assign(Object.assign({}, prev), { [key]: true }))),
120
134
  unRegisterComponent: key => setComponents(prev => (Object.assign(Object.assign({}, prev), { [key]: false }))),
121
135
  } },
122
- open && !inline && (React.createElement("button", { className: styles.overlay, "aria-label": "Close", onClick: onRequestClose, type: "button" })),
136
+ open && !inline && (React.createElement("button", { className: styles.overlay, "aria-label": t("Close"), onClick: onRequestClose, type: "button" })),
123
137
  React.createElement(framerMotion.AnimatePresence, { initial: false }, open && (React.createElement(framerMotion.motion.div, { className: classnames(styles.drawer, {
124
138
  [styles.reverseScroll]: scrollDirection === "reverse",
125
139
  [styles.inline]: inline,
@@ -140,7 +154,7 @@ function SideDrawer({ children, onRequestClose, open, variation = "base", scroll
140
154
  React.createElement("div", Object.assign({ className: classnames(styles.heading) }, slots.title.attr))),
141
155
  React.createElement("div", { className: styles.headerActions },
142
156
  React.createElement("div", Object.assign({ className: styles.hideWhenEmpty }, slots.actions.attr)),
143
- React.createElement(Button.Button, { ariaLabel: "Close", icon: "cross", onClick: onRequestClose, type: "tertiary", variation: "subtle" }))),
157
+ React.createElement(Button.Button, { ariaLabel: t("Close"), icon: "cross", onClick: onRequestClose, type: "tertiary", variation: "subtle" }))),
144
158
  React.createElement("div", Object.assign({ className: styles.hideWhenEmpty }, slots.toolbar.attr))),
145
159
  React.createElement("div", { className: styles.content },
146
160
  React.createElement("div", { className: styles.headerShadowListener, ref: headerShadowRef }),
@@ -5,6 +5,7 @@ import { useRefocusOnActivator, useIsMounted, useFocusTrap, useInView } from '@j
5
5
  import classnames from 'classnames';
6
6
  import { tokens } from '@jobber/design';
7
7
  import { H as Heading } from './Heading-es.js';
8
+ import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
8
9
  import { B as Button } from './Button-es.js';
9
10
  import { F as Flex } from './Flex-es.js';
10
11
 
@@ -46,8 +47,20 @@ function SideDrawerToolbar({ children }) {
46
47
 
47
48
  var styles = {"drawer":"cCwRgRAz4qk-","inline":"ONUfsWMLKdo-","container":"XipkpXgyzyg-","header":"LuqC0RF-R1U-","content":"vArEcEUxGxQ-","footer":"_4HzuRZKD9u8-","subtle":"v5Db-FCF2kU-","heading":"Eti1JL3rghE-","hasShadow":"PtbV1GtWwzY-","headerActions":"YCdqkhcLHfI-","hideWhenEmpty":"ZH2Mp84HhX8-","overlay":"Ro-pE7hx0wY-","reverseScroll":"gSN5nWDwGm4-","headerShadowListener":"tMeBAjf4vEA-","footerShadowListener":"-lPSZVGIIAs-","backButton":"XOqA4Hw6S6g-","backButtonVisible":"b4VHPS-RG34-","spinning":"McL3-VWXVbs-"};
48
49
 
50
+ const sideDrawerMessages = defineMessages({
51
+ Close: {
52
+ en: "Close",
53
+ es: "Cerrar",
54
+ },
55
+ Back: {
56
+ en: "Back",
57
+ es: "Atrás",
58
+ },
59
+ });
60
+
49
61
  function SideDrawerBackButton({ onClick, }) {
50
62
  const { backPortal, registerComponent, unRegisterComponent } = useSideDrawerContext();
63
+ const { t } = useAtlantisI18n(sideDrawerMessages);
51
64
  useEffect(() => {
52
65
  registerComponent("backButton");
53
66
  return () => {
@@ -56,7 +69,7 @@ function SideDrawerBackButton({ onClick, }) {
56
69
  }, []);
57
70
  if (!backPortal)
58
71
  return null;
59
- return createPortal(React__default.createElement(Button, { ariaLabel: "Back", icon: "longArrowLeft", variation: "subtle", type: "tertiary", onClick: onClick }), backPortal);
72
+ return createPortal(React__default.createElement(Button, { ariaLabel: t("Back"), icon: "longArrowLeft", variation: "subtle", type: "tertiary", onClick: onClick }), backPortal);
60
73
  }
61
74
 
62
75
  function SideDrawerFooter({ children }) {
@@ -102,6 +115,7 @@ const useSideDrawerState = (open) => {
102
115
  function SideDrawer({ children, onRequestClose, open, variation = "base", scrollDirection, inline = false, UNSAFE_className, UNSAFE_style, }) {
103
116
  var _a;
104
117
  const { ref, setRef, components, setComponents, slots, sideDrawerRef, headerShadowRef, noHeaderShadow, footerShadowRef, noFooterShadow, } = useSideDrawerState(open);
118
+ const { t } = useAtlantisI18n(sideDrawerMessages);
105
119
  useRefocusOnActivator(open);
106
120
  const container = ((_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.body) || null;
107
121
  const isMounted = useIsMounted();
@@ -117,7 +131,7 @@ function SideDrawer({ children, onRequestClose, open, variation = "base", scroll
117
131
  registerComponent: key => setComponents(prev => (Object.assign(Object.assign({}, prev), { [key]: true }))),
118
132
  unRegisterComponent: key => setComponents(prev => (Object.assign(Object.assign({}, prev), { [key]: false }))),
119
133
  } },
120
- open && !inline && (React__default.createElement("button", { className: styles.overlay, "aria-label": "Close", onClick: onRequestClose, type: "button" })),
134
+ open && !inline && (React__default.createElement("button", { className: styles.overlay, "aria-label": t("Close"), onClick: onRequestClose, type: "button" })),
121
135
  React__default.createElement(AnimatePresence, { initial: false }, open && (React__default.createElement(motion.div, { className: classnames(styles.drawer, {
122
136
  [styles.reverseScroll]: scrollDirection === "reverse",
123
137
  [styles.inline]: inline,
@@ -138,7 +152,7 @@ function SideDrawer({ children, onRequestClose, open, variation = "base", scroll
138
152
  React__default.createElement("div", Object.assign({ className: classnames(styles.heading) }, slots.title.attr))),
139
153
  React__default.createElement("div", { className: styles.headerActions },
140
154
  React__default.createElement("div", Object.assign({ className: styles.hideWhenEmpty }, slots.actions.attr)),
141
- React__default.createElement(Button, { ariaLabel: "Close", icon: "cross", onClick: onRequestClose, type: "tertiary", variation: "subtle" }))),
155
+ React__default.createElement(Button, { ariaLabel: t("Close"), icon: "cross", onClick: onRequestClose, type: "tertiary", variation: "subtle" }))),
142
156
  React__default.createElement("div", Object.assign({ className: styles.hideWhenEmpty }, slots.toolbar.attr))),
143
157
  React__default.createElement("div", { className: styles.content },
144
158
  React__default.createElement("div", { className: styles.headerShadowListener, ref: headerShadowRef }),
@@ -55,7 +55,7 @@ function resolveComposableTriggerRender({ children, render, }) {
55
55
  /**
56
56
  * Resolves the dismiss element for `Dialog.Close`, mirroring
57
57
  * `resolveComposableTriggerRender` so a custom render works in both shells.
58
- * Falls back to the subtle "remove" `ButtonDismiss` when neither `render` nor
58
+ * Falls back to the subtle "cross" `ButtonDismiss` when neither `render` nor
59
59
  * `children` are supplied. An Atlantis `<Button>`/`<ButtonDismiss>` passed via
60
60
  * `render` or `children` is adapted; any other valid element is used as-is.
61
61
  */
@@ -80,7 +80,7 @@ function resolveComposableCloseRender({ children, render, }) {
80
80
  return children;
81
81
  }
82
82
  return buttonRenderAdapter.renderAtlantisButtonTarget(React.createElement(Button.Button, { type: "tertiary", variation: "subtle", ariaLabel: "Close dialog" },
83
- React.createElement(Button.Button.Icon, { name: "remove" })));
83
+ React.createElement(Button.Button.Icon, { name: "cross" })));
84
84
  }
85
85
  /**
86
86
  * Adapts a `Dialog.Content` `render` for the bottom sheet's drawer popup. A
@@ -53,7 +53,7 @@ function resolveComposableTriggerRender({ children, render, }) {
53
53
  /**
54
54
  * Resolves the dismiss element for `Dialog.Close`, mirroring
55
55
  * `resolveComposableTriggerRender` so a custom render works in both shells.
56
- * Falls back to the subtle "remove" `ButtonDismiss` when neither `render` nor
56
+ * Falls back to the subtle "cross" `ButtonDismiss` when neither `render` nor
57
57
  * `children` are supplied. An Atlantis `<Button>`/`<ButtonDismiss>` passed via
58
58
  * `render` or `children` is adapted; any other valid element is used as-is.
59
59
  */
@@ -78,7 +78,7 @@ function resolveComposableCloseRender({ children, render, }) {
78
78
  return children;
79
79
  }
80
80
  return renderAtlantisButtonTarget(React__default.createElement(Button, { type: "tertiary", variation: "subtle", ariaLabel: "Close dialog" },
81
- React__default.createElement(Button.Icon, { name: "remove" })));
81
+ React__default.createElement(Button.Icon, { name: "cross" })));
82
82
  }
83
83
  /**
84
84
  * Adapts a `Dialog.Content` `render` for the bottom sheet's drawer popup. A
@@ -65,19 +65,19 @@ cases. The `small` size (16px) should be used on individual elements of an
65
65
  interface (e.g. inside a `Button` or `Card`) or when sitting next to short
66
66
  inline text.
67
67
 
68
- Layout is the consumer's responsibility — `ActivityIndicator` does not expose
69
- an `inline` prop. Place it inside your own flex / inline-block container, or
70
- pass a `className` / `style`, to control surrounding layout.
68
+ Layout is the consumer's responsibility — `ActivityIndicator` does not expose an
69
+ `inline` prop. Place it inside your own flex / inline-block container, or pass a
70
+ `className` / `style`, to control surrounding layout.
71
71
 
72
72
  ## Accessibility
73
73
 
74
74
  `ActivityIndicator` announces itself politely to assistive technology:
75
75
 
76
- * `role="status"` marks the element as a polite live region, appropriate for
77
- a non-urgent loading state.
78
- * `aria-label` defaults to the literal English string `"Loading"`. Pass a
79
- custom `ariaLabel` to localize or to describe the specific activity
80
- (e.g. `ariaLabel="Uploading file"`).
76
+ * `role="status"` marks the element as a polite live region, appropriate for a
77
+ non-urgent loading state.
78
+ * `aria-label` defaults to the literal English string `"Loading"`. Pass a custom
79
+ `ariaLabel` to localize or to describe the specific activity (e.g.
80
+ `ariaLabel="Uploading file"`).
81
81
 
82
82
  The indicator does not participate in the keyboard tab order.
83
83
 
@@ -85,9 +85,9 @@ The indicator does not participate in the keyboard tab order.
85
85
 
86
86
  When the user's operating system reports
87
87
  [`prefers-reduced-motion: reduce`](https://developer.mozilla.org/docs/Web/CSS/@media/prefers-reduced-motion),
88
- the indicator hides its rocking and rotating layers, repaints a single
89
- static ring in the icon foreground colour, and gently pulses its opacity so
90
- the indicator still reads as "busy" without rotational motion.
88
+ the indicator hides its rocking and rotating layers, repaints a single static
89
+ ring in the icon foreground colour, and gently pulses its opacity so the
90
+ indicator still reads as "busy" without rotational motion.
91
91
 
92
92
  ## Relationship to Spinner
93
93
 
@@ -106,14 +106,14 @@ instead.
106
106
  These build on the general [Voice & tone](../voice-and-tone/voice-and-tone.md) and
107
107
  [Formatting](../formatting/formatting.md) guidelines.
108
108
 
109
- A dialog interrupts the user, so every word should earn its place:
110
- name the task, state the outcome, and give a clear way out.
109
+ A dialog interrupts the user, so every word should earn its place: name the
110
+ task, state the outcome, and give a clear way out.
111
111
 
112
112
  #### Title
113
113
 
114
- The title names the task as opposed to the component. Use verbs when the
115
- dialog is asking the user to actually do something. Be specific. Use a noun
116
- when you're presenting information. Don't phrase confirmation requests as questions.
114
+ The title names the task as opposed to the component. Use verbs when the dialog
115
+ is asking the user to actually do something. Be specific. Use a noun when you're
116
+ presenting information. Don't phrase confirmation requests as questions.
117
117
 
118
118
  | Do | Don't |
119
119
  | ------------------ | -------------------------------------------- |
@@ -125,9 +125,10 @@ when you're presenting information. Don't phrase confirmation requests as questi
125
125
 
126
126
  #### Body
127
127
 
128
- Body copy needs to expand on the title by providing what the title can't. It shouldn't
129
- repeat the title and should provide useful information such as explaining the impact of
130
- any action the user might be taking. For a routine task, one short sentence is often enough.
128
+ Body copy needs to expand on the title by providing what the title can't. It
129
+ shouldn't repeat the title and should provide useful information such as
130
+ explaining the impact of any action the user might be taking. For a routine
131
+ task, one short sentence is often enough.
131
132
 
132
133
  | Do | Don't |
133
134
  | ---------------------------------------------- | -------------------------------------------------------------- |
@@ -135,9 +136,9 @@ any action the user might be taking. For a routine task, one short sentence is o
135
136
 
136
137
  #### Actions
137
138
 
138
- Primary action lables will need to lead with a verb and match the action taking place.
139
- They shouldn't be generic such as "Confirm" or "Yes". The action needs to be clearly
140
- intentional. Also, remember that buttons are title case.
139
+ Primary action lables will need to lead with a verb and match the action taking
140
+ place. They shouldn't be generic such as "Confirm" or "Yes". The action needs to
141
+ be clearly intentional. Also, remember that buttons are title case.
141
142
 
142
143
  | Do | Don't |
143
144
  | ------------------- | ------- |
@@ -147,9 +148,10 @@ intentional. Also, remember that buttons are title case.
147
148
 
148
149
  #### Alert dialogs
149
150
 
150
- As `alertdialog` can't be dismissed by clicking outside, the way out needs to be clear. We should not be reliant on
151
- users pressing ESC. When relevant, cancel actions need to be considered alonsgside confirmation actions and
152
- should be just as easy to find. Ideally via secondary CTAs.
151
+ As `alertdialog` can't be dismissed by clicking outside, the way out needs to be
152
+ clear. We should not be reliant on users pressing ESC. When relevant, cancel
153
+ actions need to be considered alonsgside confirmation actions and should be just
154
+ as easy to find. Ideally via secondary CTAs.
153
155
 
154
156
  ## Do's and Don'ts
155
157
 
@@ -427,7 +427,6 @@ export function IconSizesExample() {
427
427
  | | `import` |
428
428
  | | `merge` |
429
429
  | | `redo` |
430
- | | `remove` |
431
430
  | | `search` |
432
431
  | | `sort` |
433
432
  | | `sync` |
@@ -512,6 +511,25 @@ export function IconSizesExample() {
512
511
  | | `plus2` |
513
512
 
514
513
 
514
+ ## Validating icon names at runtime
515
+
516
+ When icon names arrive as runtime data (API responses, configuration, user
517
+ input), validate them before rendering with the exports from
518
+ `@jobber/components` (also available from `@jobber/design`):
519
+
520
+ * `iconNames`: a readonly array of every valid icon name
521
+ * `isIconName(value)`: a type guard that narrows a value to `IconNames`
522
+
523
+ ```tsx
524
+ import { Icon, isIconName } from "@jobber/components";
525
+
526
+ function StatusIcon({ iconName }: { readonly iconName: string }) {
527
+ if (!isIconName(iconName)) return null;
528
+
529
+ return <Icon name={iconName} />;
530
+ }
531
+ ```
532
+
515
533
  ## Component customization
516
534
 
517
535
  ### UNSAFE\_ props (advanced usage)
@@ -112,7 +112,7 @@ export function InputNumberExperimentalAffixesExample() {
112
112
  <InputNumberExperimental
113
113
  label="Repetitions"
114
114
  suffix={{
115
- icon: "remove",
115
+ icon: "cross",
116
116
  ariaLabel: "Clear value",
117
117
  onClick: () => setReps(null),
118
118
  }}
@@ -21,7 +21,8 @@ for the “emptiness” may include, but are not limited to…
21
21
  * Search results with no match
22
22
  * An error has resulted in the user not being able to access content they
23
23
  otherwise could
24
- * A specific field doesn't have a value (for example, a custom field that the user hasn't populated)
24
+ * A specific field doesn't have a value (for example, a custom field that the
25
+ user hasn't populated)
25
26
 
26
27
  ## Solution
27
28
 
@@ -70,22 +71,29 @@ When a field doesn't have a value, use a dash to indicate the lack of a value.
70
71
  This provides:
71
72
 
72
73
  * confirmation that nothing was entered
73
- * confirmation that something *can* be entered there should the information require an update
74
+ * confirmation that something *can* be entered there should the information
75
+ require an update
74
76
 
75
77
  ```tsx
76
78
  <Card>
77
79
  <Content>
78
80
  <Heading level={4}>Additional details</Heading>
79
81
  <Stack gap="smallest">
80
- <Text size="small" variation="subdued">Preferred service date</Text>
82
+ <Text size="small" variation="subdued">
83
+ Preferred service date
84
+ </Text>
81
85
  <Text>June 25, 2026</Text>
82
86
  </Stack>
83
87
  <Stack gap="smallest">
84
- <Text size="small" variation="subdued">Gate code</Text>
88
+ <Text size="small" variation="subdued">
89
+ Gate code
90
+ </Text>
85
91
  <Text>—</Text>
86
92
  </Stack>
87
93
  <Stack gap="smallest">
88
- <Text size="small" variation="subdued">Additional requests</Text>
94
+ <Text size="small" variation="subdued">
95
+ Additional requests
96
+ </Text>
89
97
  <Text>—</Text>
90
98
  </Stack>
91
99
  </Content>
package/dist/index.cjs CHANGED
@@ -89,8 +89,8 @@ var Tiles = require('./Tiles-cjs.js');
89
89
  var showToast = require('./showToast-cjs.js');
90
90
  var Tooltip = require('./Tooltip-cjs.js');
91
91
  var Typography = require('./Typography-cjs.js');
92
+ var design = require('@jobber/design');
92
93
  require('classnames');
93
- require('@jobber/design');
94
94
  require('./_commonjsHelpers-cjs.js');
95
95
  require('./identity-cjs.js');
96
96
  require('./isTypedArray-cjs.js');
@@ -111,6 +111,7 @@ require('./mergeRefs-cjs.js');
111
111
  require('./filterDataAttributes-cjs.js');
112
112
  require('color');
113
113
  require('./tslib.es6-cjs.js');
114
+ require('./useAtlantisI18n-cjs.js');
114
115
  require('react-router-dom');
115
116
  require('./getMappedAtlantisSpaceToken-cjs.js');
116
117
  require('./useChildComponent-cjs.js');
@@ -359,4 +360,12 @@ exports.Toast = showToast.Toast;
359
360
  exports.showToast = showToast.showToast;
360
361
  exports.Tooltip = Tooltip.Tooltip;
361
362
  exports.Typography = Typography.Typography;
363
+ Object.defineProperty(exports, "iconNames", {
364
+ enumerable: true,
365
+ get: function () { return design.iconNames; }
366
+ });
367
+ Object.defineProperty(exports, "isIconName", {
368
+ enumerable: true,
369
+ get: function () { return design.isIconName; }
370
+ });
362
371
  exports.isNormalClick = isNormalClick;
package/dist/index.mjs CHANGED
@@ -87,8 +87,8 @@ export { T as Tiles } from './Tiles-es.js';
87
87
  export { T as Toast, s as showToast } from './showToast-es.js';
88
88
  export { T as Tooltip } from './Tooltip-es.js';
89
89
  export { T as Typography } from './Typography-es.js';
90
+ export { iconNames, isIconName } from '@jobber/design';
90
91
  import 'classnames';
91
- import '@jobber/design';
92
92
  import './_commonjsHelpers-es.js';
93
93
  import './identity-es.js';
94
94
  import './isTypedArray-es.js';
@@ -109,6 +109,7 @@ import './mergeRefs-es.js';
109
109
  import './filterDataAttributes-es.js';
110
110
  import 'color';
111
111
  import './tslib.es6-es.js';
112
+ import './useAtlantisI18n-es.js';
112
113
  import 'react-router-dom';
113
114
  import './getMappedAtlantisSpaceToken-es.js';
114
115
  import './useChildComponent-es.js';
@@ -1,37 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
4
- var AtlantisContext = require('../../AtlantisContext-cjs.js');
3
+ var useAtlantisI18n = require('../../useAtlantisI18n-cjs.js');
4
+ require('react');
5
+ require('../../AtlantisContext-cjs.js');
5
6
 
6
- function defineMessages(messages) {
7
- return messages;
8
- }
9
- function useAtlantisI18n(messages) {
10
- const { locale } = AtlantisContext.useAtlantisContext();
11
- const normalizedLocale = normalizeLocale(locale);
12
- const t = React.useCallback((messageKey, values) => {
13
- return interpolateMessage(resolveMessage(messages[messageKey], normalizedLocale), values);
14
- }, [normalizedLocale, messages]);
15
- return { locale: normalizedLocale, t };
16
- }
17
- function resolveMessage(message, normalizedLocale) {
18
- var _a, _b;
19
- const baseLocale = normalizedLocale.split("-")[0];
20
- return (_b = (_a = message[normalizedLocale]) !== null && _a !== void 0 ? _a : message[baseLocale]) !== null && _b !== void 0 ? _b : message.en;
21
- }
22
- function normalizeLocale(locale) {
23
- return locale.trim().replace(/_/g, "-").toLowerCase();
24
- }
25
- function interpolateMessage(message, values) {
26
- if (!values)
27
- return message;
28
- return message.replace(/\{(\w+)\}/g, (placeholder, key) => {
29
- const value = values[key];
30
- return value === undefined ? placeholder : String(value);
31
- });
32
- }
33
-
34
- const commonMessages = defineMessages({
7
+ const commonMessages = useAtlantisI18n.defineMessages({
35
8
  Loading: {
36
9
  en: "Loading",
37
10
  es: "Cargando",
@@ -46,6 +19,6 @@ const commonMessages = defineMessages({
46
19
  },
47
20
  });
48
21
 
22
+ exports.defineMessages = useAtlantisI18n.defineMessages;
23
+ exports.useAtlantisI18n = useAtlantisI18n.useAtlantisI18n;
49
24
  exports.commonMessages = commonMessages;
50
- exports.defineMessages = defineMessages;
51
- exports.useAtlantisI18n = useAtlantisI18n;
@@ -1,33 +1,7 @@
1
- import { useCallback } from 'react';
2
- import { u as useAtlantisContext } from '../../AtlantisContext-es.js';
3
-
4
- function defineMessages(messages) {
5
- return messages;
6
- }
7
- function useAtlantisI18n(messages) {
8
- const { locale } = useAtlantisContext();
9
- const normalizedLocale = normalizeLocale(locale);
10
- const t = useCallback((messageKey, values) => {
11
- return interpolateMessage(resolveMessage(messages[messageKey], normalizedLocale), values);
12
- }, [normalizedLocale, messages]);
13
- return { locale: normalizedLocale, t };
14
- }
15
- function resolveMessage(message, normalizedLocale) {
16
- var _a, _b;
17
- const baseLocale = normalizedLocale.split("-")[0];
18
- return (_b = (_a = message[normalizedLocale]) !== null && _a !== void 0 ? _a : message[baseLocale]) !== null && _b !== void 0 ? _b : message.en;
19
- }
20
- function normalizeLocale(locale) {
21
- return locale.trim().replace(/_/g, "-").toLowerCase();
22
- }
23
- function interpolateMessage(message, values) {
24
- if (!values)
25
- return message;
26
- return message.replace(/\{(\w+)\}/g, (placeholder, key) => {
27
- const value = values[key];
28
- return value === undefined ? placeholder : String(value);
29
- });
30
- }
1
+ import { d as defineMessages } from '../../useAtlantisI18n-es.js';
2
+ export { u as useAtlantisI18n } from '../../useAtlantisI18n-es.js';
3
+ import 'react';
4
+ import '../../AtlantisContext-es.js';
31
5
 
32
6
  const commonMessages = defineMessages({
33
7
  Loading: {
@@ -44,4 +18,4 @@ const commonMessages = defineMessages({
44
18
  },
45
19
  });
46
20
 
47
- export { commonMessages, defineMessages, useAtlantisI18n };
21
+ export { commonMessages, defineMessages };
@@ -26,7 +26,7 @@ function Toast({ message, variation = "success", action, actionLabel, }) {
26
26
  React.createElement(Typography.Typography, { element: "span", size: "large" }, message),
27
27
  action && (React.createElement(Button.Button, { label: `${actionLabel}`, onClick: action, type: "tertiary" })),
28
28
  React.createElement("div", { className: styles.button },
29
- React.createElement(Button.Button, { icon: "remove", ariaLabel: "Hide Notification", onClick: handleToastClose, type: "tertiary", variation: "subtle" })))))));
29
+ React.createElement(Button.Button, { icon: "cross", ariaLabel: "Hide Notification", onClick: handleToastClose, type: "tertiary", variation: "subtle" })))))));
30
30
  function startTimer() {
31
31
  timer = setTimeout(() => handleToastClose(), getTimeout());
32
32
  }
@@ -24,7 +24,7 @@ function Toast({ message, variation = "success", action, actionLabel, }) {
24
24
  React__default.createElement(Typography, { element: "span", size: "large" }, message),
25
25
  action && (React__default.createElement(Button, { label: `${actionLabel}`, onClick: action, type: "tertiary" })),
26
26
  React__default.createElement("div", { className: styles.button },
27
- React__default.createElement(Button, { icon: "remove", ariaLabel: "Hide Notification", onClick: handleToastClose, type: "tertiary", variation: "subtle" })))))));
27
+ React__default.createElement(Button, { icon: "cross", ariaLabel: "Hide Notification", onClick: handleToastClose, type: "tertiary", variation: "subtle" })))))));
28
28
  function startTimer() {
29
29
  timer = setTimeout(() => handleToastClose(), getTimeout());
30
30
  }
package/dist/styles.css CHANGED
@@ -10759,8 +10759,7 @@ h2.react-datepicker__current-month {
10759
10759
  }
10760
10760
  .ZZ3XuxGv6ow- > *,
10761
10761
  .ZZ3XuxGv6ow- > .BrXAnQBttWE- > *,
10762
- .ZZ3XuxGv6ow- > .nslrozOH-v4- > *
10763
- {
10762
+ .ZZ3XuxGv6ow- > .nslrozOH-v4- > * {
10764
10763
  -ms-flex: 1 1 0px;
10765
10764
  flex: 1 1 0;
10766
10765
  }
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var AtlantisContext = require('./AtlantisContext-cjs.js');
5
+
6
+ function defineMessages(messages) {
7
+ return messages;
8
+ }
9
+ function useAtlantisI18n(messages) {
10
+ const { locale } = AtlantisContext.useAtlantisContext();
11
+ const normalizedLocale = normalizeLocale(locale);
12
+ const t = React.useCallback((messageKey, values) => {
13
+ return interpolateMessage(resolveMessage(messages[messageKey], normalizedLocale), values);
14
+ }, [normalizedLocale, messages]);
15
+ return { locale: normalizedLocale, t };
16
+ }
17
+ function resolveMessage(message, normalizedLocale) {
18
+ var _a, _b;
19
+ const baseLocale = normalizedLocale.split("-")[0];
20
+ return (_b = (_a = message[normalizedLocale]) !== null && _a !== void 0 ? _a : message[baseLocale]) !== null && _b !== void 0 ? _b : message.en;
21
+ }
22
+ function normalizeLocale(locale) {
23
+ return locale.trim().replace(/_/g, "-").toLowerCase();
24
+ }
25
+ function interpolateMessage(message, values) {
26
+ if (!values)
27
+ return message;
28
+ return message.replace(/\{(\w+)\}/g, (placeholder, key) => {
29
+ const value = values[key];
30
+ return value === undefined ? placeholder : String(value);
31
+ });
32
+ }
33
+
34
+ exports.defineMessages = defineMessages;
35
+ exports.useAtlantisI18n = useAtlantisI18n;
@@ -0,0 +1,32 @@
1
+ import { useCallback } from 'react';
2
+ import { u as useAtlantisContext } from './AtlantisContext-es.js';
3
+
4
+ function defineMessages(messages) {
5
+ return messages;
6
+ }
7
+ function useAtlantisI18n(messages) {
8
+ const { locale } = useAtlantisContext();
9
+ const normalizedLocale = normalizeLocale(locale);
10
+ const t = useCallback((messageKey, values) => {
11
+ return interpolateMessage(resolveMessage(messages[messageKey], normalizedLocale), values);
12
+ }, [normalizedLocale, messages]);
13
+ return { locale: normalizedLocale, t };
14
+ }
15
+ function resolveMessage(message, normalizedLocale) {
16
+ var _a, _b;
17
+ const baseLocale = normalizedLocale.split("-")[0];
18
+ return (_b = (_a = message[normalizedLocale]) !== null && _a !== void 0 ? _a : message[baseLocale]) !== null && _b !== void 0 ? _b : message.en;
19
+ }
20
+ function normalizeLocale(locale) {
21
+ return locale.trim().replace(/_/g, "-").toLowerCase();
22
+ }
23
+ function interpolateMessage(message, values) {
24
+ if (!values)
25
+ return message;
26
+ return message.replace(/\{(\w+)\}/g, (placeholder, key) => {
27
+ const value = values[key];
28
+ return value === undefined ? placeholder : String(value);
29
+ });
30
+ }
31
+
32
+ export { defineMessages as d, useAtlantisI18n as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.29.1",
3
+ "version": "9.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -491,7 +491,7 @@
491
491
  "devDependencies": {
492
492
  "@apollo/client": "^3.7.10",
493
493
  "@csstools/postcss-global-data": "^1.0.3",
494
- "@jobber/design": "0.110.0",
494
+ "@jobber/design": "0.111.0",
495
495
  "@jobber/hooks": "2.21.0",
496
496
  "@rollup/plugin-alias": "^5.1.0",
497
497
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -545,5 +545,5 @@
545
545
  "> 1%",
546
546
  "IE 10"
547
547
  ],
548
- "gitHead": "a9b32a282f2f70d07b99600c8ce8dfdd2d6e3db9"
548
+ "gitHead": "71ed27026cd539889c5ce6c627bd74a8d283112e"
549
549
  }