@jobber/components 6.26.0 → 6.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnimatedPresence-es.js +4 -4
- package/dist/AnimatedSwitcher-es.js +4 -4
- package/dist/AtlantisThemeContext-es.js +6 -6
- package/dist/Autocomplete-es.js +27 -27
- package/dist/Avatar-es.js +4 -4
- package/dist/Banner-es.js +13 -13
- package/dist/BannerIcon-es.js +3 -3
- package/dist/Body-es.js +12 -12
- package/dist/Box-es.js +2 -2
- package/dist/Button-es.js +13 -13
- package/dist/ButtonDismiss-es.js +2 -2
- package/dist/Card-es.js +15 -15
- package/dist/Checkbox/index.mjs +24 -24
- package/dist/Chip-es.js +17 -17
- package/dist/ChipDismissible-es.js +7 -7
- package/dist/Chips/index.mjs +3 -3
- package/dist/Chips-es.js +13 -13
- package/dist/Combobox/components/ComboboxContent/index.cjs +0 -2
- package/dist/Combobox/components/ComboboxContent/index.mjs +0 -2
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +3 -8
- package/dist/Combobox/index.cjs +1 -2
- package/dist/Combobox/index.mjs +1 -2
- package/dist/Combobox-es.js +6 -6
- package/dist/ComboboxAction-es.js +4 -4
- package/dist/ComboboxActivator-es.js +3 -3
- package/dist/ComboboxContent-cjs.js +3745 -39
- package/dist/ComboboxContent-es.js +3715 -27
- package/dist/ComboboxContentHeader-es.js +4 -4
- package/dist/ComboboxContentList-es.js +13 -13
- package/dist/ComboboxContentSearch-es.js +5 -5
- package/dist/ComboboxLoadMore-es.js +2 -2
- package/dist/ComboboxOption-es.js +6 -6
- package/dist/ComboboxProvider-es.js +3 -3
- package/dist/ComboboxTrigger-es.js +4 -4
- package/dist/ConfirmationModal-es.js +4 -4
- package/dist/Countdown-es.js +3 -3
- package/dist/DataDump-es.js +7 -7
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +1 -2
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +1 -2
- package/dist/DataList/components/DataListFilters/index.cjs +2 -2
- package/dist/DataList/components/DataListFilters/index.mjs +2 -2
- package/dist/DataList-es.js +21 -21
- package/dist/DataList.utils-es.js +7 -7
- package/dist/DataListAction-es.js +9 -9
- package/dist/DataListActions-es.js +6 -6
- package/dist/DataListActionsMenu-es.js +4 -4
- package/dist/DataListBulkActions-es.js +3 -3
- package/dist/DataListContext-es.js +6 -6
- package/dist/DataListEmptyState-es.js +3 -3
- package/dist/DataListFilters-es.js +3 -3
- package/dist/DataListHeader-es.js +12 -12
- package/dist/DataListHeaderTile-es.js +9 -9
- package/dist/DataListItem-es.js +10 -10
- package/dist/DataListItemActions-es.js +3 -3
- package/dist/DataListItemActionsOverflow-es.js +5 -5
- package/dist/DataListItemClickable-es.js +8 -8
- package/dist/DataListItems-es.js +3 -3
- package/dist/DataListLayout-es.js +2 -2
- package/dist/DataListLayoutActions-es.js +6 -6
- package/dist/DataListLoadMore-es.js +8 -8
- package/dist/DataListLoadingState-es.js +4 -4
- package/dist/DataListOverflowFade-es.js +6 -6
- package/dist/DataListSearch-es.js +6 -6
- package/dist/DataListSort-es.js +6 -6
- package/dist/DataListSortingOptions-es.js +3 -3
- package/dist/DataListStatusBar-es.js +2 -2
- package/dist/DataListStickyHeader-es.js +2 -2
- package/dist/DataListTags-es.js +7 -7
- package/dist/DataListTotalCount-es.js +6 -6
- package/dist/DataTable-es.js +45 -45
- package/dist/DatePicker-es.js +12 -12
- package/dist/DayOfMonthSelect-es.js +18 -18
- package/dist/DescriptionList-es.js +4 -4
- package/dist/Disclosure-es.js +10 -10
- package/dist/Divider-es.js +2 -2
- package/dist/DrawerGrid-es.js +11 -11
- package/dist/Emphasis-es.js +2 -2
- package/dist/FeatureSwitch-es.js +17 -17
- package/dist/Flex-es.js +2 -2
- package/dist/Form-es.js +3 -3
- package/dist/FormField/FormFieldTypes.d.ts +6 -0
- package/dist/FormField/hooks/useAtlantisFormField.d.ts +2 -2
- package/dist/FormField-cjs.js +12 -4
- package/dist/FormField-es.js +50 -42
- package/dist/FormatDate-es.js +2 -2
- package/dist/FormatEmail-es.js +2 -2
- package/dist/FormatFile-es.js +23 -23
- package/dist/FormatRelativeDateTime-es.js +6 -6
- package/dist/FormatTime-es.js +2 -2
- package/dist/Gallery-es.js +8 -8
- package/dist/Glimmer-es.js +11 -11
- package/dist/Grid-es.js +2 -2
- package/dist/GridCell-es.js +2 -2
- package/dist/Heading-es.js +2 -2
- package/dist/Icon-es.js +9 -9
- package/dist/InlineLabel-es.js +3 -3
- package/dist/InputAvatar-es.js +11 -11
- package/dist/InputDate/index.cjs +1 -1
- package/dist/InputDate/index.mjs +10 -10
- package/dist/InputEmail-cjs.js +1 -1
- package/dist/InputEmail-es.js +3 -3
- package/dist/InputFile-es.js +20 -20
- package/dist/InputGroup-es.js +4 -4
- package/dist/InputNumber-cjs.js +1 -1
- package/dist/InputNumber-es.js +3 -3
- package/dist/InputPassword-cjs.js +1 -1
- package/dist/InputPassword-es.js +3 -3
- package/dist/InputPhoneNumber-cjs.js +2 -2
- package/dist/InputPhoneNumber-es.js +7 -7
- package/dist/InputText/index.cjs +1 -1
- package/dist/InputText/index.mjs +13 -13
- package/dist/InputTime-cjs.js +1 -1
- package/dist/InputTime-es.js +3 -3
- package/dist/InputValidation-es.js +5 -5
- package/dist/InternalChipDismissible-es.js +19 -19
- package/dist/LightBox-es.js +31 -31
- package/dist/Link-es.js +2 -2
- package/dist/List-es.js +29 -29
- package/dist/Markdown-es.js +15 -15
- package/dist/Menu-es.js +21 -21
- package/dist/Modal-es.js +18 -18
- package/dist/MultiSelect-es.js +9 -9
- package/dist/Option-cjs.js +1 -1
- package/dist/Option-es.js +4 -4
- package/dist/Page-es.js +23 -23
- package/dist/Popover-es.js +7 -7
- package/dist/ProgressBar-es.js +5 -5
- package/dist/RadioGroup-es.js +9 -9
- package/dist/RecurringSelect-es.js +19 -19
- package/dist/SegmentedControl-es.js +9 -9
- package/dist/Select/Select.d.ts +1 -1
- package/dist/SideDrawer-es.js +22 -22
- package/dist/Spinner-es.js +2 -2
- package/dist/StatusIndicator-es.js +2 -2
- package/dist/StatusLabel-es.js +5 -5
- package/dist/Switch-es.js +10 -10
- package/dist/Tabs-es.js +14 -14
- package/dist/Text-es.js +2 -2
- package/dist/Tooltip-es.js +9 -9
- package/dist/Typography-es.js +2 -2
- package/dist/showToast-es.js +11 -11
- package/dist/styles.css +5 -2
- package/dist/useChildComponent-es.js +2 -2
- package/dist/useFocusTrap-es.js +2 -2
- package/dist/useInView-es.js +2 -2
- package/dist/useIsMounted-es.js +2 -2
- package/dist/useOnKeyDown-es.js +2 -2
- package/dist/useRefocusOnActivator-es.js +2 -2
- package/dist/useResizeObserver-es.js +3 -3
- package/dist/useSafeLayoutEffect-es.js +2 -2
- package/dist/useScrollToActive-es.js +3 -3
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { D as DataListSort } from './DataListSort-es.js';
|
|
3
3
|
import { D as DataListOverflowFade } from './DataListOverflowFade-es.js';
|
|
4
4
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
@@ -35,9 +35,9 @@ function InternalDataListFilters() {
|
|
|
35
35
|
if (!showSortButton && !component)
|
|
36
36
|
return null;
|
|
37
37
|
const children = component === null || component === void 0 ? void 0 : component.props.children;
|
|
38
|
-
return (
|
|
38
|
+
return (React__default.createElement(DataListOverflowFade, null,
|
|
39
39
|
children && children,
|
|
40
|
-
showSortButton &&
|
|
40
|
+
showSortButton && React__default.createElement(DataListSort, null)));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export { DataListFilters as D, InternalDataListFilters as I };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { c as generateHeaderElements, s as sortBreakpoints } from './DataList.utils-es.js';
|
|
4
4
|
import { u as useResponsiveSizing } from './useResponsiveSizing-es.js';
|
|
@@ -21,19 +21,19 @@ function DataListHeaderCheckbox({ children }) {
|
|
|
21
21
|
return children;
|
|
22
22
|
const deselectText = sm ? "Deselect All" : "Deselect";
|
|
23
23
|
const selectedLabel = selectedCount ? `${selectedCount} selected` : "";
|
|
24
|
-
return (
|
|
25
|
-
|
|
24
|
+
return (React__default.createElement("div", { className: styles.selectable },
|
|
25
|
+
React__default.createElement("div", { className: classnames(styles.selectAllCheckbox, {
|
|
26
26
|
[styles.visible]: canSelectAll,
|
|
27
27
|
}) },
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Boolean(selectedCount) &&
|
|
28
|
+
React__default.createElement(Checkbox, { checked: isAllSelected(), indeterminate: isIndeterminate(), onChange: handleSelectAll },
|
|
29
|
+
React__default.createElement("div", { className: styles.srOnly }, selectedLabel))),
|
|
30
|
+
React__default.createElement(AnimatedSwitcher, { switched: hasAtLeastOneSelected, initialChild: children, switchTo: React__default.createElement("div", { className: styles.batchSelectContainer },
|
|
31
|
+
React__default.createElement("div", { className: styles.headerBatchSelect },
|
|
32
|
+
Boolean(selectedCount) && React__default.createElement(Text, null,
|
|
33
33
|
selectedCount,
|
|
34
34
|
" selected"),
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
React__default.createElement(Button, { label: deselectText, onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect([]), type: "tertiary" })),
|
|
36
|
+
React__default.createElement(InternalDataListBulkActions, null)) })));
|
|
37
37
|
function isIndeterminate() {
|
|
38
38
|
if (isSelectAll)
|
|
39
39
|
return selectedIDs.length > 0;
|
|
@@ -80,8 +80,8 @@ function DataListHeader() {
|
|
|
80
80
|
const headerData = generateHeaderElements(headers);
|
|
81
81
|
if (!headerData)
|
|
82
82
|
return null;
|
|
83
|
-
return (
|
|
84
|
-
|
|
83
|
+
return (React__default.createElement("div", { className: styles.headerTitles },
|
|
84
|
+
React__default.createElement(DataListHeaderCheckbox, null, layout(headerData))));
|
|
85
85
|
function getVisibleSize() {
|
|
86
86
|
const visibilityKeys = Object.keys(headerVisibility);
|
|
87
87
|
const headerBreakpoints = sortBreakpoints(visibilityKeys).reverse();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState, useRef } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
|
|
4
4
|
import { D as DataListSortingOptions } from './DataListSortingOptions-es.js';
|
|
@@ -16,10 +16,10 @@ const SORT_ORDER_MAP = {
|
|
|
16
16
|
none: "none",
|
|
17
17
|
};
|
|
18
18
|
function DataListSortingArrows({ headerKey, order, }) {
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return (React__default.createElement("div", { className: styles.sortIcon, "data-testid": SORTING_ICON_TEST_ID, "aria-label": `${headerKey} sort icon`, "aria-sort": order ? SORT_ORDER_MAP[order] : undefined },
|
|
20
|
+
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21
|
+
React__default.createElement("path", { className: getActiveClassName("asc"), d: "M16.2929 10.6661C15.9024 11.0566 15.2692 11.0566 14.8787 10.6661L12.2891 8.14263L9.70711 10.6661C9.31658 11.0566 8.68342 11.0566 8.29289 10.6661C7.90237 10.2756 7.90237 9.64239 8.29289 9.25186L11.5858 5.95897C11.9763 5.56845 12.6095 5.56845 13 5.95897L16.2929 9.25186C16.6834 9.64239 16.6834 10.2756 16.2929 10.6661Z" }),
|
|
22
|
+
React__default.createElement("path", { className: getActiveClassName("desc"), d: "M8.29292 13.3339C8.68345 12.9434 9.31661 12.9434 9.70714 13.3339L12.2968 15.8573L14.8787 13.3339C15.2692 12.9434 15.9024 12.9434 16.2929 13.3339C16.6834 13.7244 16.6834 14.3576 16.2929 14.7481L13 18.041C12.6095 18.4315 11.9763 18.4315 11.5858 18.041L8.29292 14.7481C7.9024 14.3576 7.9024 13.7244 8.29292 13.3339Z" }))));
|
|
23
23
|
function getActiveClassName(targetOrder) {
|
|
24
24
|
return order === targetOrder ? styles.active : styles.inactive;
|
|
25
25
|
}
|
|
@@ -35,12 +35,12 @@ function DataListHeaderTile({ headers, headerKey, }) {
|
|
|
35
35
|
const isSortable = Boolean(sortableItem);
|
|
36
36
|
const sortingState = sorting === null || sorting === void 0 ? void 0 : sorting.state;
|
|
37
37
|
const Tag = isSortable ? "button" : "div";
|
|
38
|
-
return (
|
|
38
|
+
return (React__default.createElement(Tag, { className: classnames(styles$1.headerLabel, {
|
|
39
39
|
[styles$1.sortable]: isSortable,
|
|
40
40
|
}), onClick: handleOnClick, ref: dataListHeaderTileRef },
|
|
41
|
-
|
|
42
|
-
isSortable && (sortableItem === null || sortableItem === void 0 ? void 0 : sortableItem.options) && isDropDownOpen && (
|
|
43
|
-
isSortable && (
|
|
41
|
+
React__default.createElement(Text, { maxLines: "single" }, headers[headerKey]),
|
|
42
|
+
isSortable && (sortableItem === null || sortableItem === void 0 ? void 0 : sortableItem.options) && isDropDownOpen && (React__default.createElement(DataListSortingOptions, { options: sortableItem.options, selectedOption: (sorting === null || sorting === void 0 ? void 0 : sorting.state) || null, onSelectChange: handleSelectChange, onClose: () => setIsDropDownOpen(false), optionsListRef: optionsListRef, dataListHeaderTileRef: dataListHeaderTileRef })),
|
|
43
|
+
isSortable && (React__default.createElement(DataListSortingArrows, { order: (sortingState === null || sortingState === void 0 ? void 0 : sortingState.key) === headerKey ? sortingState.order : "none", headerKey: headerKey }))));
|
|
44
44
|
function toggleSorting(newSortingKey, newId, newLabel) {
|
|
45
45
|
var _a, _b;
|
|
46
46
|
const isSameKey = newSortingKey === (sortingState === null || sortingState === void 0 ? void 0 : sortingState.key);
|
package/dist/DataListItem-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { Children, useMemo, isValidElement, useState } from 'react';
|
|
2
2
|
import { AnimatePresence } from 'framer-motion';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { u as useDataListLayoutContext } from './DataListLayoutContext-es.js';
|
|
@@ -16,11 +16,11 @@ function DataListItemInternal({ children, item, }) {
|
|
|
16
16
|
const { canSelect, hasAtLeastOneSelected, isSelectAll, selectedIDs, selected, onSelect, } = useBatchSelect();
|
|
17
17
|
if (!canSelect)
|
|
18
18
|
return children;
|
|
19
|
-
return (
|
|
19
|
+
return (React__default.createElement("div", { className: classnames(styles.selectable, {
|
|
20
20
|
[styles.selected]: hasAtLeastOneSelected,
|
|
21
21
|
}) },
|
|
22
22
|
children,
|
|
23
|
-
|
|
23
|
+
React__default.createElement(Checkbox, { checked: getIsChecked(), onChange: handleChange })));
|
|
24
24
|
function getIsChecked() {
|
|
25
25
|
const isItemInSelectedIDs = selectedIDs.includes(item.id);
|
|
26
26
|
// If we're in a "select all" state, the selectedID's becomes a list of
|
|
@@ -83,15 +83,15 @@ function DataListItem({ item, layout, }) {
|
|
|
83
83
|
const isContextMenuVisible = Boolean(contextPosition);
|
|
84
84
|
const shouldShowContextMenu = showMenu && isContextMenuVisible && hasActions;
|
|
85
85
|
const shouldShowHoverMenu = showMenu && hasActions && !hasInLayoutActions && !shouldShowContextMenu;
|
|
86
|
-
return (
|
|
87
|
-
|
|
86
|
+
return (React__default.createElement(DataListLayoutActionsContext.Provider, { value: { activeItem: item } },
|
|
87
|
+
React__default.createElement("div", { onMouseEnter: handleShowMenu, onMouseLeave: handleHideMenu, onFocus: handleShowMenu, onBlur: handleHideMenu, onContextMenu: handleContextMenu, className: classnames(styles.listItem, {
|
|
88
88
|
[styles.active]: showMenu && isContextMenuVisible,
|
|
89
89
|
}), key: item.id },
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
shouldShowHoverMenu && (
|
|
94
|
-
|
|
90
|
+
React__default.createElement(DataListItemInternal, { item: item },
|
|
91
|
+
React__default.createElement(DataListItemClickable, null, layout(generatedItem))),
|
|
92
|
+
React__default.createElement(AnimatePresence, null,
|
|
93
|
+
shouldShowHoverMenu && (React__default.createElement(InternalDataListItemActions, { actions: actions })),
|
|
94
|
+
React__default.createElement(DataListActionsMenu, { key: item.id, visible: shouldShowContextMenu, position: contextPosition || { x: 0, y: 0 }, onRequestClose: () => setContextPosition(undefined) }, actions)))));
|
|
95
95
|
function handleShowMenu() {
|
|
96
96
|
setShowMenu(true);
|
|
97
97
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
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';
|
|
@@ -16,11 +16,11 @@ const variants = {
|
|
|
16
16
|
visible: { opacity: 1, y: 4 },
|
|
17
17
|
};
|
|
18
18
|
function InternalDataListItemActions({ actions, }) {
|
|
19
|
-
return (
|
|
19
|
+
return (React__default.createElement(motion.div, { variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: {
|
|
20
20
|
duration: TRANSITION_DURATION_IN_SECONDS,
|
|
21
21
|
delay: TRANSITION_DELAY_IN_SECONDS,
|
|
22
22
|
}, className: styles.menu, "data-elevation": "elevated", onContextMenu: handleContextMenu },
|
|
23
|
-
|
|
23
|
+
React__default.createElement(DataListActions, null, actions)));
|
|
24
24
|
}
|
|
25
25
|
function handleContextMenu(event) {
|
|
26
26
|
event.stopPropagation();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState } from 'react';
|
|
2
2
|
import { B as Button } from './Button-es.js';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import { T as Tooltip } from './Tooltip-es.js';
|
|
@@ -9,10 +9,10 @@ function DataListItemActionsOverflow({ actions, }) {
|
|
|
9
9
|
const [showMenu, setShowMenu] = useState(false);
|
|
10
10
|
if (actions.length === 0)
|
|
11
11
|
return null;
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
13
|
+
React__default.createElement(Tooltip, { message: "More actions" },
|
|
14
|
+
React__default.createElement(Button, { icon: "more", ariaLabel: "More actions", type: "tertiary", variation: "subtle", onClick: handleMoreClick })),
|
|
15
|
+
React__default.createElement(DataListActionsMenu, { visible: showMenu, position: menuPosition, onRequestClose: handleClose }, actions)));
|
|
16
16
|
function handleMoreClick(event) {
|
|
17
17
|
// Prevent firing the parent's onClick event when it is nested
|
|
18
18
|
// within a clickable list item
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import { s as styles } from './DataList.module-es.js';
|
|
@@ -7,27 +7,27 @@ import { u as useDataListLayoutActionsContext } from './DataListLayoutContext-es
|
|
|
7
7
|
function DataListItemClickableInternal({ onClick, url, to, children, }) {
|
|
8
8
|
const { activeItem } = useDataListLayoutActionsContext();
|
|
9
9
|
if (!activeItem)
|
|
10
|
-
return
|
|
10
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
11
11
|
if (to) {
|
|
12
12
|
const computedTo = typeof to === "string" ? to : to(activeItem);
|
|
13
|
-
return (
|
|
13
|
+
return (React__default.createElement(Link, { className: styles.listItemClickable, to: computedTo, onClick: handleClick }, children));
|
|
14
14
|
}
|
|
15
15
|
if (url) {
|
|
16
16
|
const href = typeof url === "string" ? url : url(activeItem);
|
|
17
|
-
return (
|
|
17
|
+
return (React__default.createElement("a", { className: styles.listItemClickable, href: href, onClick: handleClick }, children));
|
|
18
18
|
}
|
|
19
19
|
if (onClick) {
|
|
20
20
|
return (
|
|
21
21
|
// A button can be nested within the list item. To prevent a button inside
|
|
22
22
|
// button error, we need to manually declare a div to be a button
|
|
23
|
-
|
|
23
|
+
React__default.createElement("div", { role: "button", tabIndex: 0, className: styles.listItemClickable, onClick: handleClick, onKeyDown: e => {
|
|
24
24
|
if (e.key === "Enter" || e.key === " ") {
|
|
25
25
|
e.preventDefault();
|
|
26
26
|
handleClick();
|
|
27
27
|
}
|
|
28
28
|
} }, children));
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
31
31
|
function handleClick() {
|
|
32
32
|
activeItem && (onClick === null || onClick === void 0 ? void 0 : onClick(activeItem));
|
|
33
33
|
}
|
|
@@ -37,9 +37,9 @@ function DataListItemClickable({ children }) {
|
|
|
37
37
|
const { itemActionComponent } = useDataListContext();
|
|
38
38
|
if (itemActionComponent) {
|
|
39
39
|
const props = itemActionComponent.props;
|
|
40
|
-
return (
|
|
40
|
+
return (React__default.createElement(DataListItemClickableInternal, Object.assign({}, props), children));
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export { DataListItemClickable as D };
|
package/dist/DataListItems-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState } from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { D as DataListLayoutContext } from './DataListLayoutContext-es.js';
|
|
4
4
|
import { D as DataListItem } from './DataListItem-es.js';
|
|
@@ -9,11 +9,11 @@ function DataListItems({ size = "xs", }) {
|
|
|
9
9
|
const layout = layouts[size];
|
|
10
10
|
if (!layout)
|
|
11
11
|
return null;
|
|
12
|
-
return (
|
|
12
|
+
return (React__default.createElement(DataListLayoutContext.Provider, { value: {
|
|
13
13
|
isInLayoutProvider: true,
|
|
14
14
|
hasInLayoutActions,
|
|
15
15
|
setHasInLayoutActions,
|
|
16
|
-
} }, data.map((child, i) => (
|
|
16
|
+
} }, data.map((child, i) => (React__default.createElement(DataListItem, { key: data[i].id, index: i, item: child, layout: layout })))));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { DataListItems as D };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useEffect } from 'react';
|
|
2
2
|
import { D as DataListItems } from './DataListItems-es.js';
|
|
3
3
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
4
4
|
import { u as useActiveLayout } from './useActiveLayout-es.js';
|
|
@@ -11,7 +11,7 @@ function DataListLayout({ children, size = "xs", }) {
|
|
|
11
11
|
}, [size, children]);
|
|
12
12
|
const shouldRenderList = size === activeBreakpoint;
|
|
13
13
|
if (loadingState !== "initial" && shouldRenderList) {
|
|
14
|
-
return
|
|
14
|
+
return React__default.createElement(DataListItems, { size: size });
|
|
15
15
|
}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { Children, useEffect } from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { u as useDataListLayoutContext } from './DataListLayoutContext-es.js';
|
|
4
4
|
import { D as DataListItemActionsOverflow } from './DataListItemActionsOverflow-es.js';
|
|
@@ -19,18 +19,18 @@ function DataListLayoutActions() {
|
|
|
19
19
|
};
|
|
20
20
|
}, []);
|
|
21
21
|
if (loadingState === "initial") {
|
|
22
|
-
return
|
|
22
|
+
return React__default.createElement(Glimmer, { shape: "square", size: "large" });
|
|
23
23
|
}
|
|
24
24
|
if (!hasActions)
|
|
25
25
|
return null;
|
|
26
|
-
return (
|
|
27
|
-
|
|
26
|
+
return (React__default.createElement(DataListLayoutActionsWrapper, null,
|
|
27
|
+
React__default.createElement(DataListItemActionsOverflow, { actions: actions })));
|
|
28
28
|
}
|
|
29
29
|
function DataListLayoutActionsWrapper({ children }) {
|
|
30
30
|
const { isInLayoutProvider } = useDataListLayoutContext();
|
|
31
31
|
if (isInLayoutProvider)
|
|
32
|
-
return
|
|
33
|
-
return
|
|
32
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
33
|
+
return React__default.createElement("div", { className: styles.hidden }, children);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export { DataListLayoutActions as D };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { 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
4
|
import { g as DATA_LOAD_MORE_TEST_ID, h as DATA_LIST_LOADING_MORE_SPINNER_TEST_ID } from './DataList.const-es.js';
|
|
@@ -14,19 +14,19 @@ function DataListLoadMoreTrigger() {
|
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
isInView && (onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore());
|
|
16
16
|
}, [isInView]);
|
|
17
|
-
return (
|
|
17
|
+
return (React__default.createElement("div", { ref: inViewRef, className: styles.trigger, "data-testid": DATA_LOAD_MORE_TEST_ID }));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const MAX_DATA_COUNT = 50;
|
|
21
21
|
function DataListLoadMore({ onBackToTop }) {
|
|
22
22
|
const { loadingState, data } = useDataListContext();
|
|
23
23
|
const showBackToTop = data.length > MAX_DATA_COUNT && loadingState !== "loadingMore";
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
loadingState === "loadingMore" && (
|
|
27
|
-
|
|
28
|
-
showBackToTop && (
|
|
29
|
-
|
|
24
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
25
|
+
React__default.createElement(DataListLoadMoreTrigger, { key: data.length }),
|
|
26
|
+
loadingState === "loadingMore" && (React__default.createElement("div", { "data-testid": DATA_LIST_LOADING_MORE_SPINNER_TEST_ID, className: styles.loadingMore },
|
|
27
|
+
React__default.createElement(Spinner, { size: "small" }))),
|
|
28
|
+
showBackToTop && (React__default.createElement("div", { className: styles.backToTop },
|
|
29
|
+
React__default.createElement(Button, { label: "Back to top", onClick: onBackToTop, size: "small", variation: "subtle" })))));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export { DataListLoadMore as D, MAX_DATA_COUNT as M };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { G as Glimmer } from './Glimmer-es.js';
|
|
3
3
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
4
4
|
import { u as useActiveLayout } from './useActiveLayout-es.js';
|
|
@@ -13,10 +13,10 @@ function DataListLoadingState() {
|
|
|
13
13
|
if (!layout)
|
|
14
14
|
return null;
|
|
15
15
|
const glimmerSize = activeBreakpoint === "xs" ? "small" : "large";
|
|
16
|
-
const glimmersFromHeader = Object.keys(headers).reduce((data, key) => (Object.assign(Object.assign({}, data), { [key]: (
|
|
17
|
-
|
|
16
|
+
const glimmersFromHeader = Object.keys(headers).reduce((data, key) => (Object.assign(Object.assign({}, data), { [key]: (React__default.createElement("div", { className: styles.glimmer },
|
|
17
|
+
React__default.createElement(Glimmer, { size: glimmerSize }))) })), {});
|
|
18
18
|
const loadingData = new Array(LOADING_STATE_LIMIT_ITEMS).fill(glimmersFromHeader);
|
|
19
|
-
return (
|
|
19
|
+
return (React__default.createElement("div", { className: styles.wrapper }, loadingData.map((child, i) => (React__default.createElement("div", { key: i, className: styles.loadingItem, "data-testid": DATALIST_LOADINGSTATE_ROW_TEST_ID }, layout(child))))));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { DATALIST_LOADINGSTATE_ROW_TEST_ID as D, LOADING_STATE_LIMIT_ITEMS as L, DataListLoadingState as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { u as useInView_2 } from './useInView-es.js';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
|
|
@@ -9,14 +9,14 @@ var styles = {"fadeContainer":"a-KvXvaVQks-","overflowItems":"faGQ-G8kLN8-","ove
|
|
|
9
9
|
function DataListOverflowFade({ children }) {
|
|
10
10
|
const [leftRef, isLeftVisible] = useInView_2();
|
|
11
11
|
const [rightRef, isRightVisible] = useInView_2();
|
|
12
|
-
return (
|
|
12
|
+
return (React__default.createElement("div", { "data-testid": CONTAINER_TEST_ID, className: classnames(styles.fadeContainer, {
|
|
13
13
|
[styles.overflowLeft]: !isLeftVisible,
|
|
14
14
|
[styles.overflowRight]: !isRightVisible,
|
|
15
15
|
}) },
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
React__default.createElement("div", { className: styles.overflowGrid },
|
|
17
|
+
React__default.createElement("span", { ref: leftRef, className: styles.overflowTrigger }),
|
|
18
|
+
React__default.createElement("div", { className: styles.overflowItems }, children),
|
|
19
|
+
React__default.createElement("span", { ref: rightRef, className: styles.overflowTrigger }))));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { CONTAINER_TEST_ID as C, DataListOverflowFade as D };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useRef, useState, useCallback } from 'react';
|
|
2
2
|
import { d as debounce } from './debounce-es.js';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { tokens } from '@jobber/design';
|
|
@@ -27,19 +27,19 @@ function InternalDataListSearch() {
|
|
|
27
27
|
if (!searchComponent)
|
|
28
28
|
return null;
|
|
29
29
|
const { placeholder, initialValue } = searchComponent.props;
|
|
30
|
-
return (
|
|
30
|
+
return (React__default.createElement("div", { className: classnames(styles.wrapper, {
|
|
31
31
|
[styles.withNoFilters]: !filterComponent && !sorting,
|
|
32
32
|
}) },
|
|
33
|
-
|
|
33
|
+
React__default.createElement("div", { "data-testid": DATA_LIST_SEARCH_TEST_ID, className: classnames(styles.searchInput, {
|
|
34
34
|
[styles.searchInputVisible]: visible,
|
|
35
35
|
}) },
|
|
36
|
-
|
|
36
|
+
React__default.createElement(InputText
|
|
37
37
|
// If the initial value changes, reset the input.
|
|
38
38
|
, {
|
|
39
39
|
// If the initial value changes, reset the input.
|
|
40
40
|
key: initialValue, defaultValue: initialValue, ref: inputRef, placeholder: getPlaceholder(), onChange: debouncedSearch, prefix: { icon: "search" }, clearable: "always" })),
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
React__default.createElement("div", { className: styles.searchButton },
|
|
42
|
+
React__default.createElement(AnimatedSwitcher, { switched: visible, initialChild: React__default.createElement(Button, { variation: "subtle", icon: "search", ariaLabel: "Search", onClick: toggleSearch }), switchTo: React__default.createElement(Button, { variation: "subtle", icon: "remove", ariaLabel: "Close search bar", onClick: toggleSearch }) }))));
|
|
43
43
|
function getPlaceholder() {
|
|
44
44
|
if (placeholder)
|
|
45
45
|
return placeholder;
|
package/dist/DataListSort-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { C as Combobox } from './Combobox-es.js';
|
|
4
4
|
import './ComboboxProvider-es.js';
|
|
@@ -12,16 +12,16 @@ function DataListSort() {
|
|
|
12
12
|
return null;
|
|
13
13
|
const { sortable, state, onSort } = sorting;
|
|
14
14
|
const sortByOptions = getSortByOptions();
|
|
15
|
-
return (
|
|
15
|
+
return (React__default.createElement(Combobox, { onSelect: selection => handleKeyChange(selection[0].id.toString()), selected: [
|
|
16
16
|
{
|
|
17
17
|
id: getSelectedSortID(),
|
|
18
18
|
label: (state === null || state === void 0 ? void 0 : state.order) || "",
|
|
19
19
|
},
|
|
20
20
|
] },
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
sortByOptions.map(({ label, value }) => (
|
|
21
|
+
React__default.createElement(Combobox.Activator, null,
|
|
22
|
+
React__default.createElement(Chip, { heading: "Sort", label: getButtonLabel(), variation: state ? "base" : "subtle" }, !state && (React__default.createElement(Chip.Suffix, null,
|
|
23
|
+
React__default.createElement(Icon, { name: "arrowDown", size: "small" }))))),
|
|
24
|
+
sortByOptions.map(({ label, value }) => (React__default.createElement(Combobox.Option, { key: value, id: value, label: label })))));
|
|
25
25
|
function getSortByOptions() {
|
|
26
26
|
const options = sortable.reduce((acc, sort) => {
|
|
27
27
|
const label = headers[sort.key];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useEffect } from 'react';
|
|
2
2
|
import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
|
|
3
3
|
import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
@@ -14,9 +14,9 @@ function DataListSortingOptions({ options, selectedOption, onSelectChange, onClo
|
|
|
14
14
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
15
15
|
};
|
|
16
16
|
}, [optionsListRef, dataListHeaderTileRef, onClose]);
|
|
17
|
-
return (
|
|
17
|
+
return (React__default.createElement("ul", { className: styles.optionsList, ref: optionsListRef }, options.map(option => (React__default.createElement("li", { className: styles.option, key: `${option.id}${option.order}`, onClick: () => onSelectChange(option), onKeyDown: event => handleKeyDown(event, option), tabIndex: 0, "data-value": option.id },
|
|
18
18
|
option.label,
|
|
19
|
-
option.label === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) && (
|
|
19
|
+
option.label === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) && (React__default.createElement(Icon, { name: "checkmark", color: "interactiveSubtle" })))))));
|
|
20
20
|
function handleKeyDown(event, option) {
|
|
21
21
|
if (event.key === "Enter") {
|
|
22
22
|
onSelectChange(option);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { g as getCompoundComponent } from './DataList.utils-es.js';
|
|
3
3
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ function InternalDataListStatusBar() {
|
|
|
16
16
|
if (!component)
|
|
17
17
|
return null;
|
|
18
18
|
const children = component === null || component === void 0 ? void 0 : component.props.children;
|
|
19
|
-
return
|
|
19
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { DataListStatusBar as D, InternalDataListStatusBar as I };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classnames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
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-"};
|
|
@@ -17,7 +17,7 @@ function DataListStickyHeader({ children }) {
|
|
|
17
17
|
ref.current && observer.unobserve(ref.current);
|
|
18
18
|
};
|
|
19
19
|
}, [handleObserver, ref.current]);
|
|
20
|
-
return (
|
|
20
|
+
return (React__default.createElement("div", { "data-testid": DATA_LIST_STICKY_HEADER_TEST_ID, ref: ref, className: classnames(styles.header, { [styles.stuck]: isStuck }) }, children));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export { DataListStickyHeader as D };
|
package/dist/DataListTags-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { I as InlineLabel } from './InlineLabel-es.js';
|
|
4
4
|
import { T as Text } from './Text-es.js';
|
|
@@ -25,13 +25,13 @@ function DataListTags({ items }) {
|
|
|
25
25
|
elements === null || elements === void 0 ? void 0 : elements.forEach(element => observer.unobserve(element));
|
|
26
26
|
};
|
|
27
27
|
}, [items]);
|
|
28
|
-
return (
|
|
29
|
-
|
|
28
|
+
return (React__default.createElement("div", { className: styles.tagWrapper, ref: ref },
|
|
29
|
+
React__default.createElement("div", { className: classnames(styles.tags, {
|
|
30
30
|
[styles.tagsMask]: shouldShowTagCount,
|
|
31
|
-
}) }, items.filter(Boolean).map((tag, index) => (
|
|
32
|
-
|
|
33
|
-
shouldShowTagCount && (
|
|
34
|
-
|
|
31
|
+
}) }, items.filter(Boolean).map((tag, index) => (React__default.createElement("div", { key: tag, "data-tag-element": index },
|
|
32
|
+
React__default.createElement(InlineLabel, null, tag))))),
|
|
33
|
+
shouldShowTagCount && (React__default.createElement("div", { className: styles.tagCount },
|
|
34
|
+
React__default.createElement(Text, null,
|
|
35
35
|
"+",
|
|
36
36
|
visibleItems)))));
|
|
37
37
|
function handleIntersection(...[entries]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { T as Text } from './Text-es.js';
|
|
3
3
|
import { G as Glimmer } from './Glimmer-es.js';
|
|
4
4
|
|
|
@@ -6,16 +6,16 @@ var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};
|
|
|
6
6
|
|
|
7
7
|
const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
|
|
8
8
|
function DataListTotalCountContainer({ children }) {
|
|
9
|
-
return (
|
|
9
|
+
return (React__default.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
|
|
10
10
|
}
|
|
11
11
|
function DataListTotalCount({ totalCount, loading, }) {
|
|
12
12
|
if (totalCount === null && loading) {
|
|
13
|
-
return (
|
|
14
|
-
|
|
13
|
+
return (React__default.createElement(DataListTotalCountContainer, null,
|
|
14
|
+
React__default.createElement(Glimmer, { size: "auto", shape: "rectangle" })));
|
|
15
15
|
}
|
|
16
16
|
if (typeof totalCount === "number") {
|
|
17
|
-
return (
|
|
18
|
-
|
|
17
|
+
return (React__default.createElement(DataListTotalCountContainer, null,
|
|
18
|
+
React__default.createElement(Text, { variation: "subdued" },
|
|
19
19
|
"(",
|
|
20
20
|
totalCount.toLocaleString(),
|
|
21
21
|
" ",
|