@jobber/components 6.38.2 → 6.38.3
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/Banner-cjs.js +1 -1
- package/dist/Banner-es.js +2 -2
- package/dist/Button/Button.d.ts +6 -742
- package/dist/Button/index.cjs +1 -1
- package/dist/Button-cjs.js +13 -30
- package/dist/Button-es.js +14 -31
- package/dist/ButtonDismiss-cjs.js +1 -1
- package/dist/ButtonDismiss-es.js +2 -2
- package/dist/Card-cjs.js +2 -2
- package/dist/Card-es.js +3 -3
- package/dist/Chip/Chip.d.ts +2 -3
- package/dist/Chip/index.cjs +1 -1
- package/dist/Chip-cjs.js +23 -48
- package/dist/Chip-es.js +24 -49
- package/dist/ChipDismissible-cjs.js +4 -4
- package/dist/ChipDismissible-es.js +5 -5
- package/dist/ComboboxActivator-cjs.js +1 -1
- package/dist/ComboboxActivator-es.js +3 -3
- package/dist/ComboboxContentHeader-cjs.js +1 -1
- package/dist/ComboboxContentHeader-es.js +2 -2
- package/dist/ComboboxTrigger-cjs.js +1 -1
- package/dist/ComboboxTrigger-es.js +2 -2
- package/dist/DataListActions-cjs.js +2 -2
- package/dist/DataListActions-es.js +3 -3
- package/dist/DataListEmptyState-cjs.js +1 -1
- package/dist/DataListEmptyState-es.js +2 -2
- package/dist/DataListHeader-cjs.js +1 -1
- package/dist/DataListHeader-es.js +2 -2
- package/dist/DataListItemActionsOverflow-cjs.js +1 -1
- package/dist/DataListItemActionsOverflow-es.js +2 -2
- package/dist/DataListLoadMore-cjs.js +1 -1
- package/dist/DataListLoadMore-es.js +2 -2
- package/dist/DataListSearch-cjs.js +1 -1
- package/dist/DataListSearch-es.js +2 -2
- package/dist/DataListSort-cjs.js +1 -1
- package/dist/DataListSort-es.js +2 -2
- package/dist/DataTable-cjs.js +2 -2
- package/dist/DataTable-es.js +3 -3
- package/dist/DatePicker-cjs.js +3 -3
- package/dist/DatePicker-es.js +4 -4
- package/dist/FeatureSwitch-cjs.js +1 -1
- package/dist/FeatureSwitch-es.js +2 -2
- package/dist/FormField-cjs.js +1 -1
- package/dist/FormField-es.js +2 -2
- package/dist/FormatFile-cjs.js +1 -1
- package/dist/FormatFile-es.js +2 -2
- package/dist/Gallery-cjs.js +1 -1
- package/dist/Gallery-es.js +2 -2
- package/dist/InputAvatar-cjs.js +1 -1
- package/dist/InputAvatar-es.js +2 -2
- package/dist/InputFile-cjs.js +1 -1
- package/dist/InputFile-es.js +2 -2
- package/dist/InternalChipDismissible-cjs.js +4 -4
- package/dist/InternalChipDismissible-es.js +6 -6
- package/dist/LightBox-cjs.js +2 -2
- package/dist/LightBox-es.js +3 -3
- package/dist/Menu-cjs.js +1 -1
- package/dist/Menu-es.js +2 -2
- package/dist/Modal-cjs.js +3 -3
- package/dist/Modal-es.js +4 -4
- package/dist/Page-cjs.js +2 -2
- package/dist/Page-es.js +3 -3
- package/dist/SideDrawer-cjs.js +2 -2
- package/dist/SideDrawer-es.js +3 -3
- package/dist/index.cjs +2 -2
- package/dist/showToast-cjs.js +2 -2
- package/dist/showToast-es.js +3 -3
- package/package.json +2 -2
- package/dist/Chip/Chip.types.d.ts +0 -64
package/dist/Button/index.cjs
CHANGED
package/dist/Button-cjs.js
CHANGED
|
@@ -68,45 +68,28 @@ function ButtonLabel(_a) {
|
|
|
68
68
|
return (React.createElement(Typography.Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
function Button(props) {
|
|
72
72
|
const { size } = props;
|
|
73
73
|
return (React.createElement(ButtonProvider, { size: size },
|
|
74
|
-
React.createElement(ButtonWrapper, Object.assign({}, props
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const ButtonWrapper = React.forwardRef(
|
|
78
|
-
// eslint-disable-next-line max-statements
|
|
79
|
-
(props, ref) => {
|
|
74
|
+
React.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
75
|
+
}
|
|
76
|
+
function ButtonWrapper(props) {
|
|
80
77
|
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, UNSAFE_className = {}, UNSAFE_style = {}, children, } = props;
|
|
81
78
|
const { combined } = useButtonStyles(props);
|
|
82
79
|
const buttonType = submit ? "submit" : "button";
|
|
83
80
|
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
id, style: UNSAFE_style.container }, (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
81
|
+
const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
|
|
82
|
+
id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
87
83
|
const buttonInternals = children || React.createElement(ButtonContent, Object.assign({}, props));
|
|
88
84
|
if (to) {
|
|
89
|
-
|
|
90
|
-
const linkProps = Object.assign(Object.assign({}, commonProps), { to: to });
|
|
91
|
-
return React.createElement(reactRouterDom.Link, Object.assign({}, linkProps), buttonInternals);
|
|
92
|
-
}
|
|
93
|
-
if (url) {
|
|
94
|
-
// Props specific to anchor
|
|
95
|
-
const anchorProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { href: !disabled ? url : undefined }), (external && { target: "_blank" })), { ref: ref });
|
|
96
|
-
return React.createElement("a", Object.assign({}, anchorProps), buttonInternals);
|
|
85
|
+
return (React.createElement(reactRouterDom.Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
97
86
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
ButtonWrapper.displayName = "ButtonWrapper";
|
|
105
|
-
const ButtonNamespace = Object.assign(ButtonComponent, {
|
|
106
|
-
Label: ButtonLabel,
|
|
107
|
-
Icon: ButtonIcon,
|
|
108
|
-
});
|
|
87
|
+
const Tag = url ? "a" : "button";
|
|
88
|
+
return React.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
89
|
+
}
|
|
90
|
+
Button.Label = ButtonLabel;
|
|
91
|
+
Button.Icon = ButtonIcon;
|
|
109
92
|
|
|
110
|
-
exports.
|
|
93
|
+
exports.Button = Button;
|
|
111
94
|
exports.useButtonContext = useButtonContext;
|
|
112
95
|
exports.useButtonStyles = useButtonStyles;
|
package/dist/Button-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { createContext, useContext
|
|
1
|
+
import React__default, { createContext, useContext } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
@@ -66,43 +66,26 @@ function ButtonLabel(_a) {
|
|
|
66
66
|
return (React__default.createElement(Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
function Button(props) {
|
|
70
70
|
const { size } = props;
|
|
71
71
|
return (React__default.createElement(ButtonProvider, { size: size },
|
|
72
|
-
React__default.createElement(ButtonWrapper, Object.assign({}, props
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const ButtonWrapper = forwardRef(
|
|
76
|
-
// eslint-disable-next-line max-statements
|
|
77
|
-
(props, ref) => {
|
|
72
|
+
React__default.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
73
|
+
}
|
|
74
|
+
function ButtonWrapper(props) {
|
|
78
75
|
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, UNSAFE_className = {}, UNSAFE_style = {}, children, } = props;
|
|
79
76
|
const { combined } = useButtonStyles(props);
|
|
80
77
|
const buttonType = submit ? "submit" : "button";
|
|
81
78
|
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
id, style: UNSAFE_style.container }, (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
79
|
+
const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
|
|
80
|
+
id, style: UNSAFE_style.container }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
85
81
|
const buttonInternals = children || React__default.createElement(ButtonContent, Object.assign({}, props));
|
|
86
82
|
if (to) {
|
|
87
|
-
|
|
88
|
-
const linkProps = Object.assign(Object.assign({}, commonProps), { to: to });
|
|
89
|
-
return React__default.createElement(Link, Object.assign({}, linkProps), buttonInternals);
|
|
90
|
-
}
|
|
91
|
-
if (url) {
|
|
92
|
-
// Props specific to anchor
|
|
93
|
-
const anchorProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { href: !disabled ? url : undefined }), (external && { target: "_blank" })), { ref: ref });
|
|
94
|
-
return React__default.createElement("a", Object.assign({}, anchorProps), buttonInternals);
|
|
83
|
+
return (React__default.createElement(Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
95
84
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
});
|
|
102
|
-
ButtonWrapper.displayName = "ButtonWrapper";
|
|
103
|
-
const ButtonNamespace = Object.assign(ButtonComponent, {
|
|
104
|
-
Label: ButtonLabel,
|
|
105
|
-
Icon: ButtonIcon,
|
|
106
|
-
});
|
|
85
|
+
const Tag = url ? "a" : "button";
|
|
86
|
+
return React__default.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
87
|
+
}
|
|
88
|
+
Button.Label = ButtonLabel;
|
|
89
|
+
Button.Icon = ButtonIcon;
|
|
107
90
|
|
|
108
|
-
export {
|
|
91
|
+
export { Button as B, useButtonContext as a, useButtonStyles as u };
|
|
@@ -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.
|
|
8
|
+
return (React.createElement(Button.Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
exports.ButtonDismiss = ButtonDismiss;
|
package/dist/ButtonDismiss-es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { B as
|
|
2
|
+
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(
|
|
6
|
+
return (React__default.createElement(Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { ButtonDismiss as B };
|
package/dist/Card-cjs.js
CHANGED
|
@@ -59,9 +59,9 @@ function CardHeader({ title, header, }) {
|
|
|
59
59
|
return React.createElement(React.Fragment, null);
|
|
60
60
|
}
|
|
61
61
|
function renderHeaderAction(action) {
|
|
62
|
-
if ((action === null || action === void 0 ? void 0 : action.type) === Button.
|
|
62
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === Button.Button) {
|
|
63
63
|
const props = Object.assign(Object.assign({ type: "tertiary" }, action.props), { size: "small" });
|
|
64
|
-
return action && React.createElement(Button.
|
|
64
|
+
return action && React.createElement(Button.Button, Object.assign({}, props));
|
|
65
65
|
}
|
|
66
66
|
if ((action === null || action === void 0 ? void 0 : action.type) === Menu.Menu) {
|
|
67
67
|
return action && React.createElement(Menu.Menu, Object.assign({}, action.props));
|
package/dist/Card-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useRef } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { H as Heading } from './Heading-es.js';
|
|
4
|
-
import { B as
|
|
4
|
+
import { B as Button } from './Button-es.js';
|
|
5
5
|
import { M as Menu } from './Menu-es.js';
|
|
6
6
|
|
|
7
7
|
var styles = {"card":"-PlHaWx00Hw-","accent":"Iilm5Uhxo50-","clickable":"Vppn4k0fBsc-","header":"l3-Pkynq2zA-","spinning":"hvqmZrWenIs-"};
|
|
@@ -57,9 +57,9 @@ function CardHeader({ title, header, }) {
|
|
|
57
57
|
return React__default.createElement(React__default.Fragment, null);
|
|
58
58
|
}
|
|
59
59
|
function renderHeaderAction(action) {
|
|
60
|
-
if ((action === null || action === void 0 ? void 0 : action.type) ===
|
|
60
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === Button) {
|
|
61
61
|
const props = Object.assign(Object.assign({ type: "tertiary" }, action.props), { size: "small" });
|
|
62
|
-
return action && React__default.createElement(
|
|
62
|
+
return action && React__default.createElement(Button, Object.assign({}, props));
|
|
63
63
|
}
|
|
64
64
|
if ((action === null || action === void 0 ? void 0 : action.type) === Menu) {
|
|
65
65
|
return action && React__default.createElement(Menu, Object.assign({}, action.props));
|
package/dist/Chip/Chip.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { ChipPrefix } from "./components/ChipPrefix/Chip.Prefix";
|
|
3
2
|
import { ChipSuffix } from "./components/ChipSuffix/Chip.Suffix";
|
|
4
3
|
import { ChipProps } from "./Chip.types";
|
|
5
|
-
declare const
|
|
4
|
+
export declare const Chip: {
|
|
5
|
+
({ ariaLabel, disabled, heading, invalid, label, value, testID, onClick, onKeyDown, children, role, tabIndex, variation, }: ChipProps): JSX.Element;
|
|
6
6
|
Prefix: typeof ChipPrefix;
|
|
7
7
|
Suffix: typeof ChipSuffix;
|
|
8
8
|
};
|
|
9
|
-
export { ChipNamespace as Chip };
|
package/dist/Chip/index.cjs
CHANGED
package/dist/Chip-cjs.js
CHANGED
|
@@ -75,56 +75,35 @@ const allowedSuffixIcons = [
|
|
|
75
75
|
"arrowDown",
|
|
76
76
|
];
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const Chip = ({ ariaLabel, disabled, heading, invalid, label, value, testID, onClick, onKeyDown, children, role = "button", tabIndex = 0, variation = "base", }) => {
|
|
79
79
|
const classes = classnames(styles$1.chip, {
|
|
80
80
|
[styles$1.invalid]: invalid,
|
|
81
81
|
[styles$1.base]: variation === "base",
|
|
82
82
|
[styles$1.subtle]: variation === "subtle",
|
|
83
83
|
[styles$1.disabled]: disabled,
|
|
84
84
|
});
|
|
85
|
-
const prefix = useChildComponent.useChildComponent(children, d => d.type ===
|
|
86
|
-
const suffix = useChildComponent.useChildComponent(children, d => d.type ===
|
|
85
|
+
const prefix = useChildComponent.useChildComponent(children, d => d.type === Chip.Prefix);
|
|
86
|
+
const suffix = useChildComponent.useChildComponent(children, d => d.type === Chip.Suffix);
|
|
87
87
|
const [labelRef, labelFullyVisible] = useInView.useInView_2();
|
|
88
88
|
const [headingRef, headingFullyVisible] = useInView.useInView_2();
|
|
89
89
|
const tooltipMessage = getTooltipMessage(labelFullyVisible, headingFullyVisible, label, heading);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
React.createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
React.createElement(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
React.createElement(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
className: classes,
|
|
108
|
-
onClick: (ev) => onClick === null || onClick === void 0 ? void 0 : onClick(value, ev),
|
|
109
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
110
|
-
onKeyDown,
|
|
111
|
-
"aria-label": ariaLabel,
|
|
112
|
-
disabled,
|
|
113
|
-
role,
|
|
114
|
-
"data-testid": testID,
|
|
115
|
-
type: "button",
|
|
116
|
-
ref,
|
|
117
|
-
}, chipContent)
|
|
118
|
-
: React.createElement("div", {
|
|
119
|
-
className: classes,
|
|
120
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
121
|
-
onKeyDown,
|
|
122
|
-
"aria-label": ariaLabel,
|
|
123
|
-
role,
|
|
124
|
-
"data-testid": testID,
|
|
125
|
-
ref,
|
|
126
|
-
}, chipContent)));
|
|
127
|
-
});
|
|
90
|
+
const Tag = onClick ? "button" : "div";
|
|
91
|
+
return (React.createElement(Tooltip.Tooltip, { message: tooltipMessage, setTabIndex: false },
|
|
92
|
+
React.createElement(Tag, { className: classes, onClick: (ev) => onClick === null || onClick === void 0 ? void 0 : onClick(value, ev), tabIndex: disabled ? -1 : tabIndex, onKeyDown: onKeyDown, "aria-label": ariaLabel, disabled: disabled, role: role, "data-testid": testID, type: "button" },
|
|
93
|
+
prefix,
|
|
94
|
+
React.createElement("div", { className: styles$1.chipContent },
|
|
95
|
+
heading && (React.createElement(React.Fragment, null,
|
|
96
|
+
React.createElement(Typography.Typography, { size: "base", fontWeight: "medium" },
|
|
97
|
+
heading,
|
|
98
|
+
React.createElement("span", { ref: headingRef, className: styles$1.chipLabelRef })),
|
|
99
|
+
label && React.createElement("span", { className: styles$1.chipBar }))),
|
|
100
|
+
React.createElement(Typography.Typography, { size: "base" },
|
|
101
|
+
label,
|
|
102
|
+
React.createElement("span", { ref: labelRef, className: styles$1.chipLabelRef })),
|
|
103
|
+
!labelFullyVisible && (React.createElement("div", { className: styles$1.truncateGradient, "data-testid": "ATL-Chip-Truncation-Gradient" },
|
|
104
|
+
React.createElement("span", null)))),
|
|
105
|
+
suffix)));
|
|
106
|
+
};
|
|
128
107
|
function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, heading) {
|
|
129
108
|
let message = "";
|
|
130
109
|
if (heading && !headingFullyVisible) {
|
|
@@ -135,14 +114,10 @@ function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, headin
|
|
|
135
114
|
}
|
|
136
115
|
return message;
|
|
137
116
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const ChipNamespace = Object.assign(ChipComponent, {
|
|
141
|
-
Prefix: ChipPrefix,
|
|
142
|
-
Suffix: ChipSuffix,
|
|
143
|
-
});
|
|
117
|
+
Chip.Prefix = ChipPrefix;
|
|
118
|
+
Chip.Suffix = ChipSuffix;
|
|
144
119
|
|
|
145
|
-
exports.
|
|
120
|
+
exports.Chip = Chip;
|
|
146
121
|
exports.InternalChipButton = InternalChipButton;
|
|
147
122
|
exports.styles = styles$1;
|
|
148
123
|
exports.styles$1 = styles;
|
package/dist/Chip-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { useRef
|
|
1
|
+
import React__default, { useRef } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { u as useInView_2 } from './useInView-es.js';
|
|
4
4
|
import { A as Avatar } from './Avatar-es.js';
|
|
@@ -73,56 +73,35 @@ const allowedSuffixIcons = [
|
|
|
73
73
|
"arrowDown",
|
|
74
74
|
];
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const Chip = ({ ariaLabel, disabled, heading, invalid, label, value, testID, onClick, onKeyDown, children, role = "button", tabIndex = 0, variation = "base", }) => {
|
|
77
77
|
const classes = classnames(styles$1.chip, {
|
|
78
78
|
[styles$1.invalid]: invalid,
|
|
79
79
|
[styles$1.base]: variation === "base",
|
|
80
80
|
[styles$1.subtle]: variation === "subtle",
|
|
81
81
|
[styles$1.disabled]: disabled,
|
|
82
82
|
});
|
|
83
|
-
const prefix = useChildComponent(children, d => d.type ===
|
|
84
|
-
const suffix = useChildComponent(children, d => d.type ===
|
|
83
|
+
const prefix = useChildComponent(children, d => d.type === Chip.Prefix);
|
|
84
|
+
const suffix = useChildComponent(children, d => d.type === Chip.Suffix);
|
|
85
85
|
const [labelRef, labelFullyVisible] = useInView_2();
|
|
86
86
|
const [headingRef, headingFullyVisible] = useInView_2();
|
|
87
87
|
const tooltipMessage = getTooltipMessage(labelFullyVisible, headingFullyVisible, label, heading);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
React__default.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
React__default.createElement(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
React__default.createElement(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
className: classes,
|
|
106
|
-
onClick: (ev) => onClick === null || onClick === void 0 ? void 0 : onClick(value, ev),
|
|
107
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
108
|
-
onKeyDown,
|
|
109
|
-
"aria-label": ariaLabel,
|
|
110
|
-
disabled,
|
|
111
|
-
role,
|
|
112
|
-
"data-testid": testID,
|
|
113
|
-
type: "button",
|
|
114
|
-
ref,
|
|
115
|
-
}, chipContent)
|
|
116
|
-
: React__default.createElement("div", {
|
|
117
|
-
className: classes,
|
|
118
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
119
|
-
onKeyDown,
|
|
120
|
-
"aria-label": ariaLabel,
|
|
121
|
-
role,
|
|
122
|
-
"data-testid": testID,
|
|
123
|
-
ref,
|
|
124
|
-
}, chipContent)));
|
|
125
|
-
});
|
|
88
|
+
const Tag = onClick ? "button" : "div";
|
|
89
|
+
return (React__default.createElement(Tooltip, { message: tooltipMessage, setTabIndex: false },
|
|
90
|
+
React__default.createElement(Tag, { className: classes, onClick: (ev) => onClick === null || onClick === void 0 ? void 0 : onClick(value, ev), tabIndex: disabled ? -1 : tabIndex, onKeyDown: onKeyDown, "aria-label": ariaLabel, disabled: disabled, role: role, "data-testid": testID, type: "button" },
|
|
91
|
+
prefix,
|
|
92
|
+
React__default.createElement("div", { className: styles$1.chipContent },
|
|
93
|
+
heading && (React__default.createElement(React__default.Fragment, null,
|
|
94
|
+
React__default.createElement(Typography, { size: "base", fontWeight: "medium" },
|
|
95
|
+
heading,
|
|
96
|
+
React__default.createElement("span", { ref: headingRef, className: styles$1.chipLabelRef })),
|
|
97
|
+
label && React__default.createElement("span", { className: styles$1.chipBar }))),
|
|
98
|
+
React__default.createElement(Typography, { size: "base" },
|
|
99
|
+
label,
|
|
100
|
+
React__default.createElement("span", { ref: labelRef, className: styles$1.chipLabelRef })),
|
|
101
|
+
!labelFullyVisible && (React__default.createElement("div", { className: styles$1.truncateGradient, "data-testid": "ATL-Chip-Truncation-Gradient" },
|
|
102
|
+
React__default.createElement("span", null)))),
|
|
103
|
+
suffix)));
|
|
104
|
+
};
|
|
126
105
|
function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, heading) {
|
|
127
106
|
let message = "";
|
|
128
107
|
if (heading && !headingFullyVisible) {
|
|
@@ -133,11 +112,7 @@ function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, headin
|
|
|
133
112
|
}
|
|
134
113
|
return message;
|
|
135
114
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const ChipNamespace = Object.assign(ChipComponent, {
|
|
139
|
-
Prefix: ChipPrefix,
|
|
140
|
-
Suffix: ChipSuffix,
|
|
141
|
-
});
|
|
115
|
+
Chip.Prefix = ChipPrefix;
|
|
116
|
+
Chip.Suffix = ChipSuffix;
|
|
142
117
|
|
|
143
|
-
export {
|
|
118
|
+
export { Chip as C, InternalChipButton as I, styles as a, styles$1 as s };
|
|
@@ -7,14 +7,14 @@ var Chip = require('./Chip-cjs.js');
|
|
|
7
7
|
|
|
8
8
|
function ChipSelectable(_a) {
|
|
9
9
|
var { selected } = _a, rest = tslib_es6.__rest(_a, ["selected"]);
|
|
10
|
-
return (React.createElement(Chip.
|
|
11
|
-
React.createElement(Chip.
|
|
10
|
+
return (React.createElement(Chip.Chip, Object.assign({}, rest),
|
|
11
|
+
React.createElement(Chip.Chip.Suffix, { className: selected ? Chip.styles.selected : "" },
|
|
12
12
|
React.createElement(Icon.Icon, { name: selected ? "checkmark" : "add", size: "small", color: "interactiveSubtle" }))));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function ChipDismissible(props) {
|
|
16
|
-
return (React.createElement(Chip.
|
|
17
|
-
React.createElement(Chip.
|
|
16
|
+
return (React.createElement(Chip.Chip, Object.assign({}, props),
|
|
17
|
+
React.createElement(Chip.Chip.Suffix, null,
|
|
18
18
|
React.createElement(Icon.Icon, { name: "cross", size: "small", color: "interactiveSubtle" }))));
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { I as Icon } from './Icon-es.js';
|
|
4
|
-
import { C as
|
|
4
|
+
import { C as Chip, s as styles } from './Chip-es.js';
|
|
5
5
|
|
|
6
6
|
function ChipSelectable(_a) {
|
|
7
7
|
var { selected } = _a, rest = __rest(_a, ["selected"]);
|
|
8
|
-
return (React__default.createElement(
|
|
9
|
-
React__default.createElement(
|
|
8
|
+
return (React__default.createElement(Chip, Object.assign({}, rest),
|
|
9
|
+
React__default.createElement(Chip.Suffix, { className: selected ? styles.selected : "" },
|
|
10
10
|
React__default.createElement(Icon, { name: selected ? "checkmark" : "add", size: "small", color: "interactiveSubtle" }))));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function ChipDismissible(props) {
|
|
14
|
-
return (React__default.createElement(
|
|
15
|
-
React__default.createElement(
|
|
14
|
+
return (React__default.createElement(Chip, Object.assign({}, props),
|
|
15
|
+
React__default.createElement(Chip.Suffix, null,
|
|
16
16
|
React__default.createElement(Icon, { name: "cross", size: "small", color: "interactiveSubtle" }))));
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ function ComboboxActivator(props) {
|
|
|
23
23
|
const { handleOpen } = React.useContext(ComboboxProvider.ComboboxContext);
|
|
24
24
|
const accessibilityAttributes = useComboboxActivatorAccessibility();
|
|
25
25
|
if (typeof props.children !== "function" &&
|
|
26
|
-
(props.children.type === Button.
|
|
26
|
+
(props.children.type === Button.Button || props.children.type === Chip.Chip)) {
|
|
27
27
|
return React.cloneElement(props.children, {
|
|
28
28
|
role: accessibilityAttributes.role,
|
|
29
29
|
onClick: handleOpen,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useContext } from 'react';
|
|
2
|
-
import { B as
|
|
2
|
+
import { B as Button } from './Button-es.js';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import { C as
|
|
4
|
+
import { C as Chip } from './Chip-es.js';
|
|
5
5
|
import './tslib.es6-es.js';
|
|
6
6
|
import '@jobber/design';
|
|
7
7
|
import { a as ComboboxContext } from './ComboboxProvider-es.js';
|
|
@@ -21,7 +21,7 @@ function ComboboxActivator(props) {
|
|
|
21
21
|
const { handleOpen } = React__default.useContext(ComboboxContext);
|
|
22
22
|
const accessibilityAttributes = useComboboxActivatorAccessibility();
|
|
23
23
|
if (typeof props.children !== "function" &&
|
|
24
|
-
(props.children.type ===
|
|
24
|
+
(props.children.type === Button || props.children.type === Chip)) {
|
|
25
25
|
return React__default.cloneElement(props.children, {
|
|
26
26
|
role: accessibilityAttributes.role,
|
|
27
27
|
onClick: handleOpen,
|
|
@@ -15,7 +15,7 @@ function ComboboxContentHeader(props) {
|
|
|
15
15
|
const showAction = hasSelected || props.hasOptionsVisible;
|
|
16
16
|
return (React.createElement("div", { className: styles.header, "data-testid": "ATL-Combobox-Header" },
|
|
17
17
|
React.createElement(Typography.Typography, { textColor: "heading", fontWeight: "semiBold" }, label),
|
|
18
|
-
showAction && (React.createElement(Button.
|
|
18
|
+
showAction && (React.createElement(Button.Button, { size: "small", label: actionLabel, type: "tertiary", onClick: handleSelectAll }))));
|
|
19
19
|
}
|
|
20
20
|
function getLabel(hasSelected, count, subjectNoun) {
|
|
21
21
|
if (hasSelected) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { T as Typography } from './Typography-es.js';
|
|
3
|
-
import { B as
|
|
3
|
+
import { B as Button } from './Button-es.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
|
|
6
6
|
var styles = {"header":"nrNh3feibg8-","spinning":"rcoGBsZN55M-"};
|
|
@@ -13,7 +13,7 @@ function ComboboxContentHeader(props) {
|
|
|
13
13
|
const showAction = hasSelected || props.hasOptionsVisible;
|
|
14
14
|
return (React__default.createElement("div", { className: styles.header, "data-testid": "ATL-Combobox-Header" },
|
|
15
15
|
React__default.createElement(Typography, { textColor: "heading", fontWeight: "semiBold" }, label),
|
|
16
|
-
showAction && (React__default.createElement(
|
|
16
|
+
showAction && (React__default.createElement(Button, { size: "small", label: actionLabel, type: "tertiary", onClick: handleSelectAll }))));
|
|
17
17
|
}
|
|
18
18
|
function getLabel(hasSelected, count, subjectNoun) {
|
|
19
19
|
if (hasSelected) {
|
|
@@ -10,7 +10,7 @@ function ComboboxTrigger({ label = "Select", selected, }) {
|
|
|
10
10
|
const { handleOpen } = React.useContext(ComboboxProvider.ComboboxContext);
|
|
11
11
|
const hasSelection = selected.length;
|
|
12
12
|
const selectedLabel = selected.map(option => option.label).join(", ");
|
|
13
|
-
return (React.createElement(Chip.
|
|
13
|
+
return (React.createElement(Chip.Chip, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox" }, !hasSelection && (React.createElement(Chip.Chip.Suffix, null,
|
|
14
14
|
React.createElement(Icon.Icon, { name: "add", size: "small" })))));
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as Chip } from './Chip-es.js';
|
|
3
3
|
import './tslib.es6-es.js';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
5
5
|
import { a as ComboboxContext } from './ComboboxProvider-es.js';
|
|
@@ -8,7 +8,7 @@ function ComboboxTrigger({ label = "Select", selected, }) {
|
|
|
8
8
|
const { handleOpen } = React__default.useContext(ComboboxContext);
|
|
9
9
|
const hasSelection = selected.length;
|
|
10
10
|
const selectedLabel = selected.map(option => option.label).join(", ");
|
|
11
|
-
return (React__default.createElement(
|
|
11
|
+
return (React__default.createElement(Chip, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox" }, !hasSelection && (React__default.createElement(Chip.Suffix, null,
|
|
12
12
|
React__default.createElement(Icon, { name: "add", size: "small" })))));
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -31,13 +31,13 @@ function DataListActions({ children, itemsToExpose = 2, }) {
|
|
|
31
31
|
const actionLabel = getActionLabel();
|
|
32
32
|
// If the action is always visible, we don't want a tooltip.
|
|
33
33
|
if (props.alwaysVisible) {
|
|
34
|
-
return (React.createElement(Button.
|
|
34
|
+
return (React.createElement(Button.Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
|
|
35
35
|
var _a;
|
|
36
36
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
37
37
|
}, type: "secondary", variation: "subtle" }));
|
|
38
38
|
}
|
|
39
39
|
return (React.createElement(Tooltip.Tooltip, { key: actionLabel, message: actionLabel },
|
|
40
|
-
React.createElement(Button.
|
|
40
|
+
React.createElement(Button.Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
|
|
41
41
|
var _a, _b;
|
|
42
42
|
if (activeItem) {
|
|
43
43
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { Children, isValidElement } from 'react';
|
|
2
2
|
import { T as Tooltip } from './Tooltip-es.js';
|
|
3
|
-
import { B as
|
|
3
|
+
import { B as Button } from './Button-es.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import { b as getExposedActions } from './DataList.utils-es.js';
|
|
6
6
|
import { u as useDataListLayoutActionsContext } from './DataListLayoutContext-es2.js';
|
|
@@ -29,13 +29,13 @@ function DataListActions({ children, itemsToExpose = 2, }) {
|
|
|
29
29
|
const actionLabel = getActionLabel();
|
|
30
30
|
// If the action is always visible, we don't want a tooltip.
|
|
31
31
|
if (props.alwaysVisible) {
|
|
32
|
-
return (React__default.createElement(
|
|
32
|
+
return (React__default.createElement(Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
|
|
33
33
|
var _a;
|
|
34
34
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
35
35
|
}, type: "secondary", variation: "subtle" }));
|
|
36
36
|
}
|
|
37
37
|
return (React__default.createElement(Tooltip, { key: actionLabel, message: actionLabel },
|
|
38
|
-
React__default.createElement(
|
|
38
|
+
React__default.createElement(Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
if (activeItem) {
|
|
41
41
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
@@ -38,7 +38,7 @@ function InternalDataListEmptyState() {
|
|
|
38
38
|
}
|
|
39
39
|
function renderButton(action) {
|
|
40
40
|
if (action) {
|
|
41
|
-
if (action.type === Button.
|
|
41
|
+
if (action.type === Button.Button) {
|
|
42
42
|
return React.cloneElement(action, {
|
|
43
43
|
variation: action.props.variation || "subtle",
|
|
44
44
|
});
|
|
@@ -2,7 +2,7 @@ import { _ as __rest } from './tslib.es6-es.js';
|
|
|
2
2
|
import React__default, { 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
|
-
import { B as
|
|
5
|
+
import { B as Button } from './Button-es.js';
|
|
6
6
|
import 'classnames';
|
|
7
7
|
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';
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ function InternalDataListEmptyState() {
|
|
|
36
36
|
}
|
|
37
37
|
function renderButton(action) {
|
|
38
38
|
if (action) {
|
|
39
|
-
if (action.type ===
|
|
39
|
+
if (action.type === Button) {
|
|
40
40
|
return cloneElement(action, {
|
|
41
41
|
variation: action.props.variation || "subtle",
|
|
42
42
|
});
|