@jobber/components 6.69.0 → 6.70.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.
@@ -6,4 +6,3 @@ export interface ChipSuffixProps extends PropsWithChildren {
6
6
  readonly ariaLabel?: string;
7
7
  readonly onClick?: (event: React.MouseEvent<HTMLSpanElement, MouseEvent> | React.KeyboardEvent<HTMLSpanElement>) => void;
8
8
  }
9
- export declare const allowedSuffixIcons: string[];
package/dist/Chip-cjs.js CHANGED
@@ -51,8 +51,7 @@ function InternalChipButton({ icon, invalid, disabled, label, onClick, }) {
51
51
  }
52
52
 
53
53
  function ChipSuffix({ children, className, onClick, testID, ariaLabel, }) {
54
- var _a, _b;
55
- let singleChild = useChildComponent.useChildComponent(children, d => d.type === Icon.Icon || d.type == InternalChipButton);
54
+ const singleChild = useChildComponent.useChildComponent(children, d => d.type === Icon.Icon || d.type == InternalChipButton);
56
55
  const handleClick = (event) => {
57
56
  if (!onClick) {
58
57
  return;
@@ -61,20 +60,8 @@ function ChipSuffix({ children, className, onClick, testID, ariaLabel, }) {
61
60
  event.stopPropagation();
62
61
  onClick(event);
63
62
  };
64
- const iconName = ((_a = singleChild === null || singleChild === void 0 ? void 0 : singleChild.props) === null || _a === void 0 ? void 0 : _a.name) || ((_b = singleChild === null || singleChild === void 0 ? void 0 : singleChild.props) === null || _b === void 0 ? void 0 : _b.icon);
65
- if (!allowedSuffixIcons.includes(iconName)) {
66
- singleChild = undefined;
67
- }
68
63
  return (React.createElement("span", { className: classnames(onClick ? styles$1.clickableSuffix : styles$1.suffix, className, !singleChild && styles$1.empty), onClick: handleClick, onKeyPress: handleClick, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, "data-testid": testID, "aria-label": ariaLabel }, singleChild));
69
64
  }
70
- const allowedSuffixIcons = [
71
- "cross",
72
- "add",
73
- "edit",
74
- "checkmark",
75
- "remove",
76
- "arrowDown",
77
- ];
78
65
 
79
66
  const ChipComponent = React.forwardRef(({ ariaLabel, disabled, heading, invalid, label, value, testID, onClick, onKeyDown, children, role = "button", tabIndex = 0, variation = "base", }, ref) => {
80
67
  const classes = classnames(styles$1.chip, {
package/dist/Chip-es.js CHANGED
@@ -49,8 +49,7 @@ function InternalChipButton({ icon, invalid, disabled, label, onClick, }) {
49
49
  }
50
50
 
51
51
  function ChipSuffix({ children, className, onClick, testID, ariaLabel, }) {
52
- var _a, _b;
53
- let singleChild = useChildComponent(children, d => d.type === Icon || d.type == InternalChipButton);
52
+ const singleChild = useChildComponent(children, d => d.type === Icon || d.type == InternalChipButton);
54
53
  const handleClick = (event) => {
55
54
  if (!onClick) {
56
55
  return;
@@ -59,20 +58,8 @@ function ChipSuffix({ children, className, onClick, testID, ariaLabel, }) {
59
58
  event.stopPropagation();
60
59
  onClick(event);
61
60
  };
62
- const iconName = ((_a = singleChild === null || singleChild === void 0 ? void 0 : singleChild.props) === null || _a === void 0 ? void 0 : _a.name) || ((_b = singleChild === null || singleChild === void 0 ? void 0 : singleChild.props) === null || _b === void 0 ? void 0 : _b.icon);
63
- if (!allowedSuffixIcons.includes(iconName)) {
64
- singleChild = undefined;
65
- }
66
61
  return (React__default.createElement("span", { className: classnames(onClick ? styles$1.clickableSuffix : styles$1.suffix, className, !singleChild && styles$1.empty), onClick: handleClick, onKeyPress: handleClick, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, "data-testid": testID, "aria-label": ariaLabel }, singleChild));
67
62
  }
68
- const allowedSuffixIcons = [
69
- "cross",
70
- "add",
71
- "edit",
72
- "checkmark",
73
- "remove",
74
- "arrowDown",
75
- ];
76
63
 
77
64
  const ChipComponent = forwardRef(({ ariaLabel, disabled, heading, invalid, label, value, testID, onClick, onKeyDown, children, role = "button", tabIndex = 0, variation = "base", }, ref) => {
78
65
  const classes = classnames(styles$1.chip, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.69.0",
3
+ "version": "6.70.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -542,5 +542,5 @@
542
542
  "> 1%",
543
543
  "IE 10"
544
544
  ],
545
- "gitHead": "ee554c8fe1eb06aa2b892ecfa5a6ef52fadfb4c8"
545
+ "gitHead": "b450041a90629d9384df2356c92239d69be24ce2"
546
546
  }