@jobber/components 9.6.3-JOB-142550-a7d2ff6.7 → 9.7.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 (36) hide show
  1. package/dist/Combobox/Combobox.d.ts +2 -0
  2. package/dist/Combobox/Combobox.responsive.d.ts +1 -1
  3. package/dist/Combobox/index.cjs +0 -2
  4. package/dist/Combobox/index.mjs +0 -2
  5. package/dist/Combobox-cjs.js +60 -9
  6. package/dist/Combobox-es.js +62 -11
  7. package/dist/ComboboxPrimitive-cjs.js +5 -2
  8. package/dist/ComboboxPrimitive-es.js +5 -3
  9. package/dist/ContentBlock/index.cjs +0 -1
  10. package/dist/ContentBlock/index.mjs +0 -1
  11. package/dist/ContentBlock-cjs.js +18 -2
  12. package/dist/ContentBlock-es.js +17 -1
  13. package/dist/DataList/components/DataListTotalCount/DataListTotalCount.messages.d.ts +10 -0
  14. package/dist/DataList/components/DataListTotalCount/index.cjs +2 -0
  15. package/dist/DataList/components/DataListTotalCount/index.mjs +2 -0
  16. package/dist/DataList/index.cjs +2 -2
  17. package/dist/DataList/index.mjs +2 -2
  18. package/dist/DataListTotalCount-cjs.js +15 -1
  19. package/dist/DataListTotalCount-es.js +15 -1
  20. package/dist/Page/index.cjs +1 -1
  21. package/dist/Page/index.mjs +1 -1
  22. package/dist/Page-cjs.js +31 -20
  23. package/dist/Page-es.js +31 -20
  24. package/dist/docs/Combobox/Combobox.md +563 -0
  25. package/dist/docs/FilterPicker/FilterPicker.md +9 -11
  26. package/dist/docs/index.md +1 -0
  27. package/dist/index.cjs +0 -1
  28. package/dist/index.mjs +0 -1
  29. package/dist/primitives/ComboboxPrimitive/ComboboxPrimitive.d.ts +1 -1
  30. package/dist/sharedHelpers/i18n/releasedLanguages.d.ts +1 -1
  31. package/dist/styles.css +47 -76
  32. package/dist/useAtlantisI18n-cjs.js +2 -2
  33. package/dist/useAtlantisI18n-es.js +2 -2
  34. package/package.json +2 -2
  35. package/dist/getMappedBreakpointWidth-cjs.js +0 -21
  36. package/dist/getMappedBreakpointWidth-es.js +0 -18
@@ -5,6 +5,7 @@ import { ComboboxClearSelection, ComboboxSelectAll, ComboboxSelectedCount } from
5
5
  import { ComboboxAction, ComboboxCollection, ComboboxGroup, ComboboxGroupLabel, ComboboxItem, ComboboxList, ComboboxRow, ComboboxSeparator } from "./Combobox.items";
6
6
  import { ComboboxPrimitive } from "../primitives/ComboboxPrimitive";
7
7
  declare function useFilter(options?: ComboboxFilterOptions): import("@base-ui/react").AutocompleteFilter;
8
+ declare function useFilteredItems<Value = unknown>(): Value[];
8
9
  declare function ComboboxRoot<Value, Multiple extends boolean | undefined = false>({ children, className, description, disabled, error, invalid, label, modal, style, multiple, readOnly, size, ...rootProps }: ComboboxRootProps<Value, Multiple>): React.JSX.Element;
9
10
  declare function ComboboxLabel({ className, ...labelProps }: ComboboxLabelProps): React.JSX.Element;
10
11
  declare function ComboboxLabelNote({ className, ...labelNoteProps }: ComboboxLabelNoteProps): React.JSX.Element;
@@ -63,6 +64,7 @@ declare const Combobox: typeof ComboboxRoot & {
63
64
  ClearSelection: typeof ComboboxClearSelection;
64
65
  SelectAll: typeof ComboboxSelectAll;
65
66
  useFilter: typeof useFilter;
67
+ useFilteredItems: typeof useFilteredItems;
66
68
  getSelectAllState: typeof getSelectAllState;
67
69
  getNextSelectAllValues: typeof getNextSelectAllValues;
68
70
  };
@@ -19,7 +19,7 @@ export declare const DEFAULT_COMBOBOX_RESPONSIVE_CONFIG: {
19
19
  positionerProps: {};
20
20
  showChipRemove: true;
21
21
  };
22
- export declare function getComboboxResponsiveConfig(width: number | undefined): {
22
+ export declare function getComboboxResponsiveConfig(isSmallScreen: boolean): {
23
23
  defaultModal: false;
24
24
  footerActionButtonRecipe: {
25
25
  size: "small";
@@ -3,9 +3,7 @@
3
3
  var Combobox = require('../Combobox-cjs.js');
4
4
  require('../tslib.es6-cjs.js');
5
5
  require('react');
6
- require('@jobber/hooks');
7
6
  require('classnames');
8
- require('../getMappedBreakpointWidth-cjs.js');
9
7
  require('../Button-cjs.js');
10
8
  require('react-router-dom');
11
9
  require('../Icon-cjs.js');
@@ -1,9 +1,7 @@
1
1
  export { C as Combobox } from '../Combobox-es.js';
2
2
  import '../tslib.es6-es.js';
3
3
  import 'react';
4
- import '@jobber/hooks';
5
4
  import 'classnames';
6
- import '../getMappedBreakpointWidth-es.js';
7
5
  import '../Button-es.js';
8
6
  import 'react-router-dom';
9
7
  import '../Icon-es.js';
@@ -2,9 +2,7 @@
2
2
 
3
3
  var tslib_es6 = require('./tslib.es6-cjs.js');
4
4
  var React = require('react');
5
- var jobberHooks = require('@jobber/hooks');
6
5
  var classnames = require('classnames');
7
- var getMappedBreakpointWidth = require('./getMappedBreakpointWidth-cjs.js');
8
6
  var Button = require('./Button-cjs.js');
9
7
  var buttonRenderAdapter = require('./buttonRenderAdapter-cjs.js');
10
8
  var ComboboxPrimitive = require('./ComboboxPrimitive-cjs.js');
@@ -16,6 +14,56 @@ var Glimmer = require('./Glimmer-cjs.js');
16
14
  var HelperText = require('./HelperText-cjs.js');
17
15
  var FieldDescription = require('./FieldDescription-cjs.js');
18
16
 
17
+ function getWindowDimensions() {
18
+ if (!(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)) {
19
+ return {
20
+ width: undefined,
21
+ height: undefined,
22
+ };
23
+ }
24
+ const { innerWidth: width, innerHeight: height } = window;
25
+ return {
26
+ width,
27
+ height,
28
+ };
29
+ }
30
+ function useWindowDimensions() {
31
+ const [windowDimensions, setWindowDimensions] = React.useState(getWindowDimensions());
32
+ React.useEffect(() => {
33
+ function handleResize() {
34
+ setWindowDimensions(getWindowDimensions());
35
+ }
36
+ window === null || window === void 0 ? void 0 : window.addEventListener("resize", handleResize);
37
+ return () => window === null || window === void 0 ? void 0 : window.removeEventListener("resize", handleResize);
38
+ }, []);
39
+ return windowDimensions;
40
+ }
41
+
42
+ const BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
43
+
44
+ /**
45
+ * SSR-safe check for whether the viewport is a small ("mobile") web screen,
46
+ * i.e. at or below the `sm` breakpoint.
47
+ *
48
+ * Returns `false` on the server and on the client's first (hydration) render —
49
+ * regardless of the real viewport — so the two renders agree and React can
50
+ * hydrate without a mismatch. After mount an effect re-renders with the value
51
+ * derived from the real viewport width, and it stays in sync on resize via
52
+ * `useWindowDimensions`.
53
+ *
54
+ * Prefer this over reading `useWindowDimensions` directly whenever the viewport
55
+ * size decides which DOM is rendered (e.g. an anchored dropdown vs. a
56
+ * `BottomSheet`). Reading the width directly re-introduces the hydration
57
+ * mismatch, because the client's first render sees the real width while the
58
+ * server saw `undefined`.
59
+ */
60
+ function useIsSmallScreen() {
61
+ const [hasMounted, setHasMounted] = React.useState(false);
62
+ const { width } = useWindowDimensions();
63
+ React.useEffect(() => setHasMounted(true), []);
64
+ return hasMounted && width !== undefined && width <= BREAKPOINT_SIZES.sm;
65
+ }
66
+
19
67
  function defaultIsItemEqual(candidateValue, selectedValue) {
20
68
  return Object.is(candidateValue, selectedValue);
21
69
  }
@@ -75,11 +123,10 @@ const MOBILE_COMBOBOX_RESPONSIVE_CONFIG = {
75
123
  },
76
124
  showChipRemove: false,
77
125
  };
78
- function getComboboxResponsiveConfig(width) {
79
- if (width !== undefined && width <= getMappedBreakpointWidth.AtlantisBreakpoints.sm) {
80
- return MOBILE_COMBOBOX_RESPONSIVE_CONFIG;
81
- }
82
- return DEFAULT_COMBOBOX_RESPONSIVE_CONFIG;
126
+ function getComboboxResponsiveConfig(isSmallScreen) {
127
+ return isSmallScreen
128
+ ? MOBILE_COMBOBOX_RESPONSIVE_CONFIG
129
+ : DEFAULT_COMBOBOX_RESPONSIVE_CONFIG;
83
130
  }
84
131
 
85
132
  const ComboboxContext = React.createContext(null);
@@ -370,6 +417,9 @@ function useFilter(options) {
370
417
  const { locale } = AtlantisContext.useAtlantisContext();
371
418
  return ComboboxPrimitive.useFilter(Object.assign({ locale }, options));
372
419
  }
420
+ function useFilteredItems() {
421
+ return ComboboxPrimitive.useFilteredItems();
422
+ }
373
423
  function getIconSize(size) {
374
424
  if (size === "small")
375
425
  return "small";
@@ -426,8 +476,8 @@ function getDefaultEmptyChildren({ empty, hasLoading }, emptyContent) {
426
476
  }
427
477
  function ComboboxRoot(_a) {
428
478
  var { children, className, description, disabled, error, invalid, label, modal, style, multiple, readOnly, size = DEFAULT_SIZE } = _a, rootProps = tslib_es6.__rest(_a, ["children", "className", "description", "disabled", "error", "invalid", "label", "modal", "style", "multiple", "readOnly", "size"]);
429
- const { width } = jobberHooks.useWindowDimensions();
430
- const responsive = getComboboxResponsiveConfig(width);
479
+ const isSmallScreen = useIsSmallScreen();
480
+ const responsive = getComboboxResponsiveConfig(isSmallScreen);
431
481
  const [positionerAnchor, setPositionerAnchor] = React.useState(null);
432
482
  const contextValue = React.useMemo(() => ({
433
483
  disabled: Boolean(disabled),
@@ -668,6 +718,7 @@ const Combobox = Object.assign(ComboboxRoot, {
668
718
  ClearSelection: ComboboxClearSelection,
669
719
  SelectAll: ComboboxSelectAll,
670
720
  useFilter,
721
+ useFilteredItems,
671
722
  getSelectAllState,
672
723
  getNextSelectAllValues,
673
724
  });
@@ -1,11 +1,9 @@
1
1
  import { _ as __rest } from './tslib.es6-es.js';
2
- import React__default from 'react';
3
- import { useWindowDimensions } from '@jobber/hooks';
2
+ import React__default, { useState, useEffect } from 'react';
4
3
  import classnames from 'classnames';
5
- import { A as AtlantisBreakpoints } from './getMappedBreakpointWidth-es.js';
6
4
  import { B as Button } from './Button-es.js';
7
5
  import { n as normalizeBaseUiButtonProps } from './buttonRenderAdapter-es.js';
8
- import { a as ComboboxValue, b as ComboboxClear$1, c as ComboboxList$1, d as ComboboxItem$1, e as ComboboxItemIndicator$1, f as ComboboxRow$1, g as ComboboxCollection$1, h as ComboboxGroup$1, i as ComboboxGroupLabel$1, j as ComboboxSeparator$1, k as ComboboxIcon, l as ComboboxChip, m as ComboboxChipRemove, n as ComboboxStatus, u as useFilter$1, o as ComboboxRoot$1, p as ComboboxInputGroup$1, q as ComboboxInput$1, r as ComboboxTrigger$1, s as ComboboxPortal, t as ComboboxBackdrop, v as ComboboxPositioner, w as ComboboxPopup, x as ComboboxChips$1, y as ComboboxEmpty$1 } from './ComboboxPrimitive-es.js';
6
+ import { a as ComboboxValue, b as ComboboxClear$1, c as ComboboxList$1, d as ComboboxItem$1, e as ComboboxItemIndicator$1, f as ComboboxRow$1, g as ComboboxCollection$1, h as ComboboxGroup$1, i as ComboboxGroupLabel$1, j as ComboboxSeparator$1, k as ComboboxIcon, l as ComboboxChip, m as ComboboxChipRemove, n as ComboboxStatus, u as useFilter$1, o as useFilteredItems$1, p as ComboboxRoot$1, q as ComboboxInputGroup$1, r as ComboboxInput$1, s as ComboboxTrigger$1, t as ComboboxPortal, v as ComboboxBackdrop, w as ComboboxPositioner, x as ComboboxPopup, y as ComboboxChips$1, z as ComboboxEmpty$1 } from './ComboboxPrimitive-es.js';
9
7
  import { m as mergeProps } from './useRenderElement-es.js';
10
8
  import { I as Icon } from './Icon-es.js';
11
9
  import { m as mergeClassName } from './mergeClassName-es.js';
@@ -14,6 +12,56 @@ import { G as Glimmer } from './Glimmer-es.js';
14
12
  import { H as HelperText } from './HelperText-es.js';
15
13
  import { F as FieldRoot, a as FieldLabel, b as FieldDescription, c as FieldError } from './FieldDescription-es.js';
16
14
 
15
+ function getWindowDimensions() {
16
+ if (!(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)) {
17
+ return {
18
+ width: undefined,
19
+ height: undefined,
20
+ };
21
+ }
22
+ const { innerWidth: width, innerHeight: height } = window;
23
+ return {
24
+ width,
25
+ height,
26
+ };
27
+ }
28
+ function useWindowDimensions() {
29
+ const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
30
+ useEffect(() => {
31
+ function handleResize() {
32
+ setWindowDimensions(getWindowDimensions());
33
+ }
34
+ window === null || window === void 0 ? void 0 : window.addEventListener("resize", handleResize);
35
+ return () => window === null || window === void 0 ? void 0 : window.removeEventListener("resize", handleResize);
36
+ }, []);
37
+ return windowDimensions;
38
+ }
39
+
40
+ const BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
41
+
42
+ /**
43
+ * SSR-safe check for whether the viewport is a small ("mobile") web screen,
44
+ * i.e. at or below the `sm` breakpoint.
45
+ *
46
+ * Returns `false` on the server and on the client's first (hydration) render —
47
+ * regardless of the real viewport — so the two renders agree and React can
48
+ * hydrate without a mismatch. After mount an effect re-renders with the value
49
+ * derived from the real viewport width, and it stays in sync on resize via
50
+ * `useWindowDimensions`.
51
+ *
52
+ * Prefer this over reading `useWindowDimensions` directly whenever the viewport
53
+ * size decides which DOM is rendered (e.g. an anchored dropdown vs. a
54
+ * `BottomSheet`). Reading the width directly re-introduces the hydration
55
+ * mismatch, because the client's first render sees the real width while the
56
+ * server saw `undefined`.
57
+ */
58
+ function useIsSmallScreen() {
59
+ const [hasMounted, setHasMounted] = useState(false);
60
+ const { width } = useWindowDimensions();
61
+ useEffect(() => setHasMounted(true), []);
62
+ return hasMounted && width !== undefined && width <= BREAKPOINT_SIZES.sm;
63
+ }
64
+
17
65
  function defaultIsItemEqual(candidateValue, selectedValue) {
18
66
  return Object.is(candidateValue, selectedValue);
19
67
  }
@@ -73,11 +121,10 @@ const MOBILE_COMBOBOX_RESPONSIVE_CONFIG = {
73
121
  },
74
122
  showChipRemove: false,
75
123
  };
76
- function getComboboxResponsiveConfig(width) {
77
- if (width !== undefined && width <= AtlantisBreakpoints.sm) {
78
- return MOBILE_COMBOBOX_RESPONSIVE_CONFIG;
79
- }
80
- return DEFAULT_COMBOBOX_RESPONSIVE_CONFIG;
124
+ function getComboboxResponsiveConfig(isSmallScreen) {
125
+ return isSmallScreen
126
+ ? MOBILE_COMBOBOX_RESPONSIVE_CONFIG
127
+ : DEFAULT_COMBOBOX_RESPONSIVE_CONFIG;
81
128
  }
82
129
 
83
130
  const ComboboxContext = React__default.createContext(null);
@@ -368,6 +415,9 @@ function useFilter(options) {
368
415
  const { locale } = useAtlantisContext();
369
416
  return useFilter$1(Object.assign({ locale }, options));
370
417
  }
418
+ function useFilteredItems() {
419
+ return useFilteredItems$1();
420
+ }
371
421
  function getIconSize(size) {
372
422
  if (size === "small")
373
423
  return "small";
@@ -424,8 +474,8 @@ function getDefaultEmptyChildren({ empty, hasLoading }, emptyContent) {
424
474
  }
425
475
  function ComboboxRoot(_a) {
426
476
  var { children, className, description, disabled, error, invalid, label, modal, style, multiple, readOnly, size = DEFAULT_SIZE } = _a, rootProps = __rest(_a, ["children", "className", "description", "disabled", "error", "invalid", "label", "modal", "style", "multiple", "readOnly", "size"]);
427
- const { width } = useWindowDimensions();
428
- const responsive = getComboboxResponsiveConfig(width);
477
+ const isSmallScreen = useIsSmallScreen();
478
+ const responsive = getComboboxResponsiveConfig(isSmallScreen);
429
479
  const [positionerAnchor, setPositionerAnchor] = React__default.useState(null);
430
480
  const contextValue = React__default.useMemo(() => ({
431
481
  disabled: Boolean(disabled),
@@ -666,6 +716,7 @@ const Combobox = Object.assign(ComboboxRoot, {
666
716
  ClearSelection: ComboboxClearSelection,
667
717
  SelectAll: ComboboxSelectAll,
668
718
  useFilter,
719
+ useFilteredItems,
669
720
  getSelectAllState,
670
721
  getNextSelectAllValues,
671
722
  });
@@ -92,7 +92,7 @@ function ComboboxPositioner(_a) {
92
92
  }
93
93
  function ComboboxPopup(_a) {
94
94
  var { className } = _a, popupProps = tslib_es6.__rest(_a, ["className"]);
95
- return (React.createElement(ComboboxChipRemove$1.ComboboxPopup, Object.assign({}, popupProps, { className: mergeClassName.mergeClassName(styles.popup, className) })));
95
+ return (React.createElement(ComboboxChipRemove$1.ComboboxPopup, Object.assign({}, popupProps, { className: mergeClassName.mergeClassName(styles.popup, className), "data-elevation": "elevated" })));
96
96
  }
97
97
  function ComboboxArrow(_a) {
98
98
  var { className } = _a, arrowProps = tslib_es6.__rest(_a, ["className"]);
@@ -150,7 +150,9 @@ function ComboboxSeparator(_a) {
150
150
  return (React.createElement(Separator.Separator, Object.assign({}, separatorProps, { className: mergeClassName.mergeClassName(styles.separator, className) })));
151
151
  }
152
152
  const useFilter = ComboboxChipRemove$1.useComboboxFilter;
153
- const useFilteredItems = ComboboxChipRemove$1.useFilteredItems;
153
+ function useFilteredItems() {
154
+ return ComboboxChipRemove$1.useFilteredItems();
155
+ }
154
156
 
155
157
  var ComboboxPrimitive = /*#__PURE__*/Object.freeze({
156
158
  __proto__: null,
@@ -210,3 +212,4 @@ exports.ComboboxStatus = ComboboxStatus;
210
212
  exports.ComboboxTrigger = ComboboxTrigger;
211
213
  exports.ComboboxValue = ComboboxValue;
212
214
  exports.useFilter = useFilter;
215
+ exports.useFilteredItems = useFilteredItems;
@@ -90,7 +90,7 @@ function ComboboxPositioner(_a) {
90
90
  }
91
91
  function ComboboxPopup(_a) {
92
92
  var { className } = _a, popupProps = __rest(_a, ["className"]);
93
- return (React__default.createElement(ComboboxPopup$1, Object.assign({}, popupProps, { className: mergeClassName(styles.popup, className) })));
93
+ return (React__default.createElement(ComboboxPopup$1, Object.assign({}, popupProps, { className: mergeClassName(styles.popup, className), "data-elevation": "elevated" })));
94
94
  }
95
95
  function ComboboxArrow(_a) {
96
96
  var { className } = _a, arrowProps = __rest(_a, ["className"]);
@@ -148,7 +148,9 @@ function ComboboxSeparator(_a) {
148
148
  return (React__default.createElement(Separator, Object.assign({}, separatorProps, { className: mergeClassName(styles.separator, className) })));
149
149
  }
150
150
  const useFilter = useComboboxFilter;
151
- const useFilteredItems = useFilteredItems$1;
151
+ function useFilteredItems() {
152
+ return useFilteredItems$1();
153
+ }
152
154
 
153
155
  var ComboboxPrimitive = /*#__PURE__*/Object.freeze({
154
156
  __proto__: null,
@@ -182,4 +184,4 @@ var ComboboxPrimitive = /*#__PURE__*/Object.freeze({
182
184
  useFilteredItems: useFilteredItems
183
185
  });
184
186
 
185
- export { ComboboxPrimitive as C, ComboboxValue as a, ComboboxClear as b, ComboboxList as c, ComboboxItem as d, ComboboxItemIndicator as e, ComboboxRow as f, ComboboxCollection as g, ComboboxGroup as h, ComboboxGroupLabel as i, ComboboxSeparator as j, ComboboxIcon as k, ComboboxChip as l, ComboboxChipRemove as m, ComboboxStatus as n, ComboboxRoot as o, ComboboxInputGroup as p, ComboboxInput as q, ComboboxTrigger as r, ComboboxPortal as s, ComboboxBackdrop as t, useFilter as u, ComboboxPositioner as v, ComboboxPopup as w, ComboboxChips as x, ComboboxEmpty as y };
187
+ export { ComboboxPrimitive as C, ComboboxValue as a, ComboboxClear as b, ComboboxList as c, ComboboxItem as d, ComboboxItemIndicator as e, ComboboxRow as f, ComboboxCollection as g, ComboboxGroup as h, ComboboxGroupLabel as i, ComboboxSeparator as j, ComboboxIcon as k, ComboboxChip as l, ComboboxChipRemove as m, ComboboxStatus as n, useFilteredItems as o, ComboboxRoot as p, ComboboxInputGroup as q, ComboboxInput as r, ComboboxTrigger as s, ComboboxPortal as t, useFilter as u, ComboboxBackdrop as v, ComboboxPositioner as w, ComboboxPopup as x, ComboboxChips as y, ComboboxEmpty as z };
@@ -5,7 +5,6 @@ require('react');
5
5
  require('classnames');
6
6
  require('@jobber/hooks');
7
7
  require('../getMappedAtlantisSpaceToken-cjs.js');
8
- require('../getMappedBreakpointWidth-cjs.js');
9
8
 
10
9
 
11
10
 
@@ -3,4 +3,3 @@ import 'react';
3
3
  import 'classnames';
4
4
  import '@jobber/hooks';
5
5
  import '../getMappedAtlantisSpaceToken-es.js';
6
- import '../getMappedBreakpointWidth-es.js';
@@ -4,12 +4,28 @@ var React = require('react');
4
4
  var classnames = require('classnames');
5
5
  var jobberHooks = require('@jobber/hooks');
6
6
  var getMappedAtlantisSpaceToken = require('./getMappedAtlantisSpaceToken-cjs.js');
7
- var getMappedBreakpointWidth = require('./getMappedBreakpointWidth-cjs.js');
8
7
 
9
8
  var styles = {"contentBlock":"rJamQZ6fRes-","left":"bqjXV8MRO-4-","right":"sCMxIxKkFe0-","center":"_2pIQVKvVL1I-","andText":"_6dF2no3aTxw-","gutters":"_8k8YLsatGag-","spinning":"sjMwRWFdKeo-"};
10
9
 
10
+ const AtlantisBreakpoints = {
11
+ xs: 0,
12
+ sm: 490,
13
+ md: 768,
14
+ lg: 1080,
15
+ xl: 1440,
16
+ };
17
+ const getMappedBreakpointWidth = (maxWidth) => {
18
+ if (typeof maxWidth === "number") {
19
+ return `${maxWidth}px`;
20
+ }
21
+ if (AtlantisBreakpoints[maxWidth]) {
22
+ return (AtlantisBreakpoints[maxWidth] + "px");
23
+ }
24
+ return maxWidth;
25
+ };
26
+
11
27
  function ContentBlock({ children, maxWidth = jobberHooks.Breakpoints.smaller, andText, gutters, justify = "left", as: Tag = "div", dataAttributes, ariaAttributes, role, id, UNSAFE_className, UNSAFE_style, }) {
12
- return (React.createElement(Tag, Object.assign({ role: role, id: id }, dataAttributes, ariaAttributes, { style: Object.assign({ "--content-block-max-width": getMappedBreakpointWidth.getMappedBreakpointWidth(maxWidth), "--content-block-gutters": getMappedAtlantisSpaceToken.getMappedAtlantisSpaceToken(gutters) }, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container), className: classnames(styles.contentBlock, andText && styles.andText, gutters && styles.gutters, justify === "left" && styles.left, justify === "right" && styles.right, justify === "center" && styles.center, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container) }), children));
28
+ return (React.createElement(Tag, Object.assign({ role: role, id: id }, dataAttributes, ariaAttributes, { style: Object.assign({ "--content-block-max-width": getMappedBreakpointWidth(maxWidth), "--content-block-gutters": getMappedAtlantisSpaceToken.getMappedAtlantisSpaceToken(gutters) }, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container), className: classnames(styles.contentBlock, andText && styles.andText, gutters && styles.gutters, justify === "left" && styles.left, justify === "right" && styles.right, justify === "center" && styles.center, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container) }), children));
13
29
  }
14
30
 
15
31
  exports.ContentBlock = ContentBlock;
@@ -2,10 +2,26 @@ import React__default from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { Breakpoints } from '@jobber/hooks';
4
4
  import { g as getMappedAtlantisSpaceToken } from './getMappedAtlantisSpaceToken-es.js';
5
- import { g as getMappedBreakpointWidth } from './getMappedBreakpointWidth-es.js';
6
5
 
7
6
  var styles = {"contentBlock":"rJamQZ6fRes-","left":"bqjXV8MRO-4-","right":"sCMxIxKkFe0-","center":"_2pIQVKvVL1I-","andText":"_6dF2no3aTxw-","gutters":"_8k8YLsatGag-","spinning":"sjMwRWFdKeo-"};
8
7
 
8
+ const AtlantisBreakpoints = {
9
+ xs: 0,
10
+ sm: 490,
11
+ md: 768,
12
+ lg: 1080,
13
+ xl: 1440,
14
+ };
15
+ const getMappedBreakpointWidth = (maxWidth) => {
16
+ if (typeof maxWidth === "number") {
17
+ return `${maxWidth}px`;
18
+ }
19
+ if (AtlantisBreakpoints[maxWidth]) {
20
+ return (AtlantisBreakpoints[maxWidth] + "px");
21
+ }
22
+ return maxWidth;
23
+ };
24
+
9
25
  function ContentBlock({ children, maxWidth = Breakpoints.smaller, andText, gutters, justify = "left", as: Tag = "div", dataAttributes, ariaAttributes, role, id, UNSAFE_className, UNSAFE_style, }) {
10
26
  return (React__default.createElement(Tag, Object.assign({ role: role, id: id }, dataAttributes, ariaAttributes, { style: Object.assign({ "--content-block-max-width": getMappedBreakpointWidth(maxWidth), "--content-block-gutters": getMappedAtlantisSpaceToken(gutters) }, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container), className: classnames(styles.contentBlock, andText && styles.andText, gutters && styles.gutters, justify === "left" && styles.left, justify === "right" && styles.right, justify === "center" && styles.center, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container) }), children));
11
27
  }
@@ -0,0 +1,10 @@
1
+ export declare const dataListTotalCountMessages: {
2
+ result: {
3
+ en: string;
4
+ es: string;
5
+ };
6
+ results: {
7
+ en: string;
8
+ es: string;
9
+ };
10
+ };
@@ -2,6 +2,8 @@
2
2
 
3
3
  var DataListTotalCount = require('../../../DataListTotalCount-cjs.js');
4
4
  require('react');
5
+ require('../../../useAtlantisI18n-cjs.js');
6
+ require('../../../AtlantisContext-cjs.js');
5
7
  require('../../../Text-cjs.js');
6
8
  require('../../../Typography-cjs.js');
7
9
  require('classnames');
@@ -1,5 +1,7 @@
1
1
  export { D as DATALIST_TOTALCOUNT_TEST_ID, a as DataListTotalCount } from '../../../DataListTotalCount-es.js';
2
2
  import 'react';
3
+ import '../../../useAtlantisI18n-es.js';
4
+ import '../../../AtlantisContext-es.js';
3
5
  import '../../../Text-es.js';
4
6
  import '../../../Typography-es.js';
5
7
  import 'classnames';
@@ -5,6 +5,8 @@ require('../tslib.es6-cjs.js');
5
5
  require('react');
6
6
  require('../DataList.module-cjs.js');
7
7
  require('../DataListTotalCount-cjs.js');
8
+ require('../useAtlantisI18n-cjs.js');
9
+ require('../AtlantisContext-cjs.js');
8
10
  require('../Text-cjs.js');
9
11
  require('../Typography-cjs.js');
10
12
  require('classnames');
@@ -61,8 +63,6 @@ require('../FilterPickerContentSearch-cjs.js');
61
63
  require('../FilterPickerContentList-cjs.js');
62
64
  require('../Spinner-cjs.js');
63
65
  require('../common.messages-cjs.js');
64
- require('../useAtlantisI18n-cjs.js');
65
- require('../AtlantisContext-cjs.js');
66
66
  require('../AtlantisThemeContext-cjs.js');
67
67
  require('../identity-cjs.js');
68
68
  require('../_baseAssignValue-cjs.js');
@@ -3,6 +3,8 @@ import '../tslib.es6-es.js';
3
3
  import 'react';
4
4
  import '../DataList.module-es.js';
5
5
  import '../DataListTotalCount-es.js';
6
+ import '../useAtlantisI18n-es.js';
7
+ import '../AtlantisContext-es.js';
6
8
  import '../Text-es.js';
7
9
  import '../Typography-es.js';
8
10
  import 'classnames';
@@ -59,8 +61,6 @@ import '../FilterPickerContentSearch-es.js';
59
61
  import '../FilterPickerContentList-es.js';
60
62
  import '../Spinner-es.js';
61
63
  import '../common.messages-es.js';
62
- import '../useAtlantisI18n-es.js';
63
- import '../AtlantisContext-es.js';
64
64
  import '../AtlantisThemeContext-es.js';
65
65
  import '../identity-es.js';
66
66
  import '../_baseAssignValue-es.js';
@@ -1,16 +1,30 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
5
+ require('./AtlantisContext-cjs.js');
4
6
  var Text = require('./Text-cjs.js');
5
7
  var Glimmer = require('./Glimmer-cjs.js');
6
8
 
7
9
  var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};
8
10
 
11
+ const dataListTotalCountMessages = useAtlantisI18n.defineMessages({
12
+ result: {
13
+ en: "result",
14
+ es: "resultado",
15
+ },
16
+ results: {
17
+ en: "results",
18
+ es: "resultados",
19
+ },
20
+ });
21
+
9
22
  const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
10
23
  function DataListTotalCountContainer({ children }) {
11
24
  return (React.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
12
25
  }
13
26
  function DataListTotalCount({ totalCount, loading, }) {
27
+ const { t } = useAtlantisI18n.useAtlantisI18n(dataListTotalCountMessages);
14
28
  if (totalCount === null && loading) {
15
29
  return (React.createElement(DataListTotalCountContainer, null,
16
30
  React.createElement(Glimmer.Glimmer, { size: "auto", shape: "rectangle" })));
@@ -21,7 +35,7 @@ function DataListTotalCount({ totalCount, loading, }) {
21
35
  "(",
22
36
  totalCount.toLocaleString(),
23
37
  " ",
24
- totalCount == 1 ? "result" : "results",
38
+ totalCount == 1 ? t("result") : t("results"),
25
39
  ")")));
26
40
  }
27
41
  return null;
@@ -1,14 +1,28 @@
1
1
  import React__default from 'react';
2
+ import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
3
+ import './AtlantisContext-es.js';
2
4
  import { T as Text } from './Text-es.js';
3
5
  import { G as Glimmer } from './Glimmer-es.js';
4
6
 
5
7
  var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};
6
8
 
9
+ const dataListTotalCountMessages = defineMessages({
10
+ result: {
11
+ en: "result",
12
+ es: "resultado",
13
+ },
14
+ results: {
15
+ en: "results",
16
+ es: "resultados",
17
+ },
18
+ });
19
+
7
20
  const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
8
21
  function DataListTotalCountContainer({ children }) {
9
22
  return (React__default.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
10
23
  }
11
24
  function DataListTotalCount({ totalCount, loading, }) {
25
+ const { t } = useAtlantisI18n(dataListTotalCountMessages);
12
26
  if (totalCount === null && loading) {
13
27
  return (React__default.createElement(DataListTotalCountContainer, null,
14
28
  React__default.createElement(Glimmer, { size: "auto", shape: "rectangle" })));
@@ -19,7 +33,7 @@ function DataListTotalCount({ totalCount, loading, }) {
19
33
  "(",
20
34
  totalCount.toLocaleString(),
21
35
  " ",
22
- totalCount == 1 ? "result" : "results",
36
+ totalCount == 1 ? t("result") : t("results"),
23
37
  ")")));
24
38
  }
25
39
  return null;
@@ -4,8 +4,8 @@ var Page = require('../Page-cjs.js');
4
4
  require('../tslib.es6-cjs.js');
5
5
  require('react');
6
6
  require('classnames');
7
- require('../Menu-cjs.js');
8
7
  require('@jobber/hooks');
8
+ require('../Menu-cjs.js');
9
9
  require('framer-motion');
10
10
  require('../floating-ui.react-cjs.js');
11
11
  require('../floating-ui.utils-cjs.js');
@@ -2,8 +2,8 @@ export { P as Page } from '../Page-es.js';
2
2
  import '../tslib.es6-es.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
- import '../Menu-es.js';
6
5
  import '@jobber/hooks';
6
+ import '../Menu-es.js';
7
7
  import 'framer-motion';
8
8
  import '../floating-ui.react-es.js';
9
9
  import '../floating-ui.utils-es.js';