@jobber/components 6.10.0 → 6.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ export declare const DATA_LIST_FILTERING_SPINNER_TEST_ID = "ATL-DataList-filteri
16
16
  export declare const DATA_LIST_LOADING_MORE_SPINNER_TEST_ID = "ATL-DataList-loadingMoreSpinner";
17
17
  export declare const DATA_LOAD_MORE_TEST_ID = "ATL-DataList-LoadMore-trigger";
18
18
  export declare const DATA_LIST_STICKY_HEADER_TEST_ID = "ATL-DataList-stickyHeader";
19
+ export declare const DATA_LIST_TITLE_CONTAINER_TEST_ID = "ATL-DataList-titleContainer";
19
20
  export declare const TRANSITION_DURATION_IN_SECONDS: number;
20
21
  export declare const TRANSITION_DELAY_IN_SECONDS: number;
21
22
  export {};
@@ -57,10 +57,11 @@ function InternalDataList({ shouldRenderStickyHeader, }) {
57
57
  const initialLoading = loadingState === "initial";
58
58
  const showEmptyState = !initialLoading && data.length === 0;
59
59
  const shouldRenderLoadMoreTrigger = !initialLoading && !showEmptyState;
60
+ const shouldRenderTitleContainer = initialLoading || title !== undefined || totalCount !== undefined;
60
61
  return (React.createElement("div", { className: DataList_module.styles.wrapper },
61
- React.createElement("div", { className: DataList_module.styles.titleContainer },
62
+ shouldRenderTitleContainer && (React.createElement("div", { className: DataList_module.styles.titleContainer, "data-testid": DataList_const.DATA_LIST_TITLE_CONTAINER_TEST_ID },
62
63
  title && React.createElement(Heading.Heading, { level: 3 }, title),
63
- React.createElement(DataListTotalCount.DataListTotalCount, { totalCount: totalCount, loading: initialLoading })),
64
+ totalCount !== undefined && (React.createElement(DataListTotalCount.DataListTotalCount, { totalCount: totalCount, loading: initialLoading })))),
64
65
  React.createElement("div", { ref: backToTopRef }),
65
66
  shouldRenderStickyHeader && (React.createElement(DataListStickyHeader.DataListStickyHeader, null,
66
67
  React.createElement("div", { className: DataList_module.styles.headerFilters },
@@ -15,7 +15,7 @@ import { D as DataListAction } from './DataListAction-es.js';
15
15
  import { D as DataListLayoutActions } from './DataListLayoutActions-es.js';
16
16
  import { D as DataListContext, u as useDataListContext } from './DataListContext-es.js';
17
17
  import { s as sortBreakpoints, g as getCompoundComponent, a as getCompoundComponents } from './DataList.utils-es.js';
18
- import { D as DATA_LIST_FILTERING_SPINNER_TEST_ID } from './DataList.const-es.js';
18
+ import { D as DATA_LIST_TITLE_CONTAINER_TEST_ID, a as DATA_LIST_FILTERING_SPINNER_TEST_ID } from './DataList.const-es.js';
19
19
  import { D as DataListBulkActions } from './DataListBulkActions-es.js';
20
20
  import { I as InternalDataListStatusBar, D as DataListStatusBar } from './DataListStatusBar-es.js';
21
21
  import { H as Heading } from './Heading-es.js';
@@ -55,10 +55,11 @@ function InternalDataList({ shouldRenderStickyHeader, }) {
55
55
  const initialLoading = loadingState === "initial";
56
56
  const showEmptyState = !initialLoading && data.length === 0;
57
57
  const shouldRenderLoadMoreTrigger = !initialLoading && !showEmptyState;
58
+ const shouldRenderTitleContainer = initialLoading || title !== undefined || totalCount !== undefined;
58
59
  return (React.createElement("div", { className: styles.wrapper },
59
- React.createElement("div", { className: styles.titleContainer },
60
+ shouldRenderTitleContainer && (React.createElement("div", { className: styles.titleContainer, "data-testid": DATA_LIST_TITLE_CONTAINER_TEST_ID },
60
61
  title && React.createElement(Heading, { level: 3 }, title),
61
- React.createElement(DataListTotalCount, { totalCount: totalCount, loading: initialLoading })),
62
+ totalCount !== undefined && (React.createElement(DataListTotalCount, { totalCount: totalCount, loading: initialLoading })))),
62
63
  React.createElement("div", { ref: backToTopRef }),
63
64
  shouldRenderStickyHeader && (React.createElement(DataListStickyHeader, null,
64
65
  React.createElement("div", { className: styles.headerFilters },
@@ -21,6 +21,7 @@ const DATA_LIST_FILTERING_SPINNER_TEST_ID = "ATL-DataList-filteringSpinner";
21
21
  const DATA_LIST_LOADING_MORE_SPINNER_TEST_ID = "ATL-DataList-loadingMoreSpinner";
22
22
  const DATA_LOAD_MORE_TEST_ID = "ATL-DataList-LoadMore-trigger";
23
23
  const DATA_LIST_STICKY_HEADER_TEST_ID = "ATL-DataList-stickyHeader";
24
+ const DATA_LIST_TITLE_CONTAINER_TEST_ID = "ATL-DataList-titleContainer";
24
25
  const TRANSITION_DURATION_IN_SECONDS = design.tokens["timing-base"] / 1000;
25
26
  const TRANSITION_DELAY_IN_SECONDS = design.tokens["timing-quick"] / 1000;
26
27
 
@@ -29,6 +30,7 @@ exports.BREAKPOINT_SIZES = BREAKPOINT_SIZES;
29
30
  exports.DATA_LIST_FILTERING_SPINNER_TEST_ID = DATA_LIST_FILTERING_SPINNER_TEST_ID;
30
31
  exports.DATA_LIST_LOADING_MORE_SPINNER_TEST_ID = DATA_LIST_LOADING_MORE_SPINNER_TEST_ID;
31
32
  exports.DATA_LIST_STICKY_HEADER_TEST_ID = DATA_LIST_STICKY_HEADER_TEST_ID;
33
+ exports.DATA_LIST_TITLE_CONTAINER_TEST_ID = DATA_LIST_TITLE_CONTAINER_TEST_ID;
32
34
  exports.DATA_LOAD_MORE_TEST_ID = DATA_LOAD_MORE_TEST_ID;
33
35
  exports.EMPTY_FILTER_RESULTS_MESSAGE = EMPTY_FILTER_RESULTS_MESSAGE;
34
36
  exports.EMPTY_RESULTS_MESSAGE = EMPTY_RESULTS_MESSAGE;
@@ -19,7 +19,8 @@ const DATA_LIST_FILTERING_SPINNER_TEST_ID = "ATL-DataList-filteringSpinner";
19
19
  const DATA_LIST_LOADING_MORE_SPINNER_TEST_ID = "ATL-DataList-loadingMoreSpinner";
20
20
  const DATA_LOAD_MORE_TEST_ID = "ATL-DataList-LoadMore-trigger";
21
21
  const DATA_LIST_STICKY_HEADER_TEST_ID = "ATL-DataList-stickyHeader";
22
+ const DATA_LIST_TITLE_CONTAINER_TEST_ID = "ATL-DataList-titleContainer";
22
23
  const TRANSITION_DURATION_IN_SECONDS = tokens["timing-base"] / 1000;
23
24
  const TRANSITION_DELAY_IN_SECONDS = tokens["timing-quick"] / 1000;
24
25
 
25
- export { BREAKPOINTS as B, DATA_LIST_FILTERING_SPINNER_TEST_ID as D, EMPTY_FILTER_RESULTS_MESSAGE as E, SEARCH_DEBOUNCE_DELAY as S, TRANSITION_DURATION_IN_SECONDS as T, DATA_LIST_STICKY_HEADER_TEST_ID as a, EMPTY_RESULTS_MESSAGE as b, EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR as c, TRANSITION_DELAY_IN_SECONDS as d, BREAKPOINT_SIZES as e, DATA_LOAD_MORE_TEST_ID as f, DATA_LIST_LOADING_MORE_SPINNER_TEST_ID as g };
26
+ export { BREAKPOINTS as B, DATA_LIST_TITLE_CONTAINER_TEST_ID as D, EMPTY_FILTER_RESULTS_MESSAGE as E, SEARCH_DEBOUNCE_DELAY as S, TRANSITION_DURATION_IN_SECONDS as T, DATA_LIST_FILTERING_SPINNER_TEST_ID as a, DATA_LIST_STICKY_HEADER_TEST_ID as b, EMPTY_RESULTS_MESSAGE as c, EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR as d, TRANSITION_DELAY_IN_SECONDS as e, BREAKPOINT_SIZES as f, DATA_LOAD_MORE_TEST_ID as g, DATA_LIST_LOADING_MORE_SPINNER_TEST_ID as h };
@@ -6,7 +6,7 @@ import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
6
6
  import { createPortal } from 'react-dom';
7
7
  import { tokens } from '@jobber/design';
8
8
  import { u as useIsMounted_2 } from './useIsMounted-es.js';
9
- import { d as TRANSITION_DELAY_IN_SECONDS } from './DataList.const-es.js';
9
+ import { e as TRANSITION_DELAY_IN_SECONDS } from './DataList.const-es.js';
10
10
 
11
11
  var styles = {"menu":"e1ztw2-YxtM-","overlay":"uMoOb93Pf1Q-","spinning":"_0wS9DWCNuj4-"};
12
12
 
@@ -3,7 +3,7 @@ import React, { useContext, cloneElement } from 'react';
3
3
  import { D as DataListContext } from './DataListContext-es.js';
4
4
  import { T as Text } from './Text-es.js';
5
5
  import { B as Button } from './Button-es.js';
6
- import { E as EMPTY_FILTER_RESULTS_MESSAGE, b as EMPTY_RESULTS_MESSAGE, c as EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR } from './DataList.const-es.js';
6
+ import { E as EMPTY_FILTER_RESULTS_MESSAGE, c as EMPTY_RESULTS_MESSAGE, d as EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR } from './DataList.const-es.js';
7
7
 
8
8
  var styles = {"emptyStateWrapper":"R0MWvfTO9vg-","spinning":"hVJ2XoR6bR0-"};
9
9
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { motion } from 'framer-motion';
3
- import { T as TRANSITION_DURATION_IN_SECONDS, d as TRANSITION_DELAY_IN_SECONDS } from './DataList.const-es.js';
3
+ import { T as TRANSITION_DURATION_IN_SECONDS, e as TRANSITION_DELAY_IN_SECONDS } from './DataList.const-es.js';
4
4
  import { D as DataListActions } from './DataListActions-es.js';
5
5
 
6
6
  var styles = {"menu":"SSm2j6d2kYo-","spinning":"Mpmu6IiBTSI-"};
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { u as useInView_2 } from './useInView-es.js';
3
3
  import { u as useDataListContext } from './DataListContext-es.js';
4
- import { f as DATA_LOAD_MORE_TEST_ID, g as DATA_LIST_LOADING_MORE_SPINNER_TEST_ID } from './DataList.const-es.js';
4
+ import { g as DATA_LOAD_MORE_TEST_ID, h as DATA_LIST_LOADING_MORE_SPINNER_TEST_ID } from './DataList.const-es.js';
5
5
  import { S as Spinner } from './Spinner-es.js';
6
6
  import { B as Button } from './Button-es.js';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import classnames from 'classnames';
2
2
  import React, { useState, useRef, useCallback, useEffect } from 'react';
3
- import { a as DATA_LIST_STICKY_HEADER_TEST_ID } from './DataList.const-es.js';
3
+ import { b as DATA_LIST_STICKY_HEADER_TEST_ID } from './DataList.const-es.js';
4
4
 
5
5
  var styles = {"header":"u5YTRL-PlTI-","stuck":"rylbmDbzCts-","spinning":"_2VUVOWcGjbc-"};
6
6
 
@@ -7,20 +7,22 @@ var Glimmer = require('./Glimmer-cjs.js');
7
7
  var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};
8
8
 
9
9
  const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
10
+ function DataListTotalCountContainer({ children }) {
11
+ return (React.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
12
+ }
10
13
  function DataListTotalCount({ totalCount, loading, }) {
11
- if (totalCount === undefined)
12
- return null;
13
- let output = null;
14
14
  if (totalCount === null && loading) {
15
- output = React.createElement(Glimmer.Glimmer, { size: "auto", shape: "rectangle" });
15
+ return (React.createElement(DataListTotalCountContainer, null,
16
+ React.createElement(Glimmer.Glimmer, { size: "auto", shape: "rectangle" })));
16
17
  }
17
18
  if (typeof totalCount === "number") {
18
- output = (React.createElement(Text.Text, { variation: "subdued" },
19
- "(",
20
- totalCount.toLocaleString(),
21
- " results)"));
19
+ return (React.createElement(DataListTotalCountContainer, null,
20
+ React.createElement(Text.Text, { variation: "subdued" },
21
+ "(",
22
+ totalCount.toLocaleString(),
23
+ " results)")));
22
24
  }
23
- return (React.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, output));
25
+ return null;
24
26
  }
25
27
 
26
28
  exports.DATALIST_TOTALCOUNT_TEST_ID = DATALIST_TOTALCOUNT_TEST_ID;
@@ -5,20 +5,22 @@ import { G as Glimmer } from './Glimmer-es.js';
5
5
  var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};
6
6
 
7
7
  const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
8
+ function DataListTotalCountContainer({ children }) {
9
+ return (React.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
10
+ }
8
11
  function DataListTotalCount({ totalCount, loading, }) {
9
- if (totalCount === undefined)
10
- return null;
11
- let output = null;
12
12
  if (totalCount === null && loading) {
13
- output = React.createElement(Glimmer, { size: "auto", shape: "rectangle" });
13
+ return (React.createElement(DataListTotalCountContainer, null,
14
+ React.createElement(Glimmer, { size: "auto", shape: "rectangle" })));
14
15
  }
15
16
  if (typeof totalCount === "number") {
16
- output = (React.createElement(Text, { variation: "subdued" },
17
- "(",
18
- totalCount.toLocaleString(),
19
- " results)"));
17
+ return (React.createElement(DataListTotalCountContainer, null,
18
+ React.createElement(Text, { variation: "subdued" },
19
+ "(",
20
+ totalCount.toLocaleString(),
21
+ " results)")));
20
22
  }
21
- return (React.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, output));
23
+ return null;
22
24
  }
23
25
 
24
26
  export { DATALIST_TOTALCOUNT_TEST_ID as D, DataListTotalCount as a };
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useSyncExternalStore } from 'react';
2
- import { e as BREAKPOINT_SIZES } from './DataList.const-es.js';
2
+ import { f as BREAKPOINT_SIZES } from './DataList.const-es.js';
3
3
 
4
4
  const mediaQueryStore = {
5
5
  subscribe(onChange, query) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.10.0",
3
+ "version": "6.10.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -487,5 +487,5 @@
487
487
  "> 1%",
488
488
  "IE 10"
489
489
  ],
490
- "gitHead": "e6c03b6cbad92cccd8eebd63c3f86f0e39232dbf"
490
+ "gitHead": "66c7c1bed940d34bb5b55b39316b93f734dbca82"
491
491
  }