@jobber/components 6.86.5 → 6.87.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.
@@ -109,8 +109,10 @@ export interface ComboboxOptionProps {
109
109
  * Advanced: A custom render prop to completely control how this option is rendered.
110
110
  * The function receives the option's props, and a boolean indicating if the option is selected.
111
111
  */
112
- readonly customRender?: (option: Omit<ComboboxOptionProps, "customRender"> & {
112
+ readonly customRender?: (option: Pick<ComboboxOptionProps, "id" | "label" | "prefix"> & {
113
113
  isSelected: boolean;
114
+ /** Render the default option content. */
115
+ defaultContent: ReactElement;
114
116
  }) => React.ReactNode;
115
117
  /**
116
118
  * Callback function invoked when the option is clicked.
@@ -18,7 +18,7 @@ function ComboboxOption(props) {
18
18
  selectionHandler === null || selectionHandler === void 0 ? void 0 : selectionHandler({ id, label });
19
19
  onClick === null || onClick === void 0 ? void 0 : onClick({ id, label });
20
20
  };
21
- return (React.createElement("li", { key: props.id, tabIndex: -1, "data-selected": isSelected, role: "option", "aria-selected": isSelected, onClick: handleClick, className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected }))) : (React.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected })))));
21
+ return (React.createElement("li", { key: props.id, tabIndex: -1, "data-selected": isSelected, role: "option", "aria-selected": isSelected, onClick: handleClick, className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected, defaultContent: (React.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected }))) }))) : (React.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected })))));
22
22
  }
23
23
  function InternalDefaultContent(props) {
24
24
  return (React.createElement(React.Fragment, null,
@@ -16,7 +16,7 @@ function ComboboxOption(props) {
16
16
  selectionHandler === null || selectionHandler === void 0 ? void 0 : selectionHandler({ id, label });
17
17
  onClick === null || onClick === void 0 ? void 0 : onClick({ id, label });
18
18
  };
19
- return (React__default.createElement("li", { key: props.id, tabIndex: -1, "data-selected": isSelected, role: "option", "aria-selected": isSelected, onClick: handleClick, className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected }))) : (React__default.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected })))));
19
+ return (React__default.createElement("li", { key: props.id, tabIndex: -1, "data-selected": isSelected, role: "option", "aria-selected": isSelected, onClick: handleClick, className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected, defaultContent: (React__default.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected }))) }))) : (React__default.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected })))));
20
20
  }
21
21
  function InternalDefaultContent(props) {
22
22
  return (React__default.createElement(React__default.Fragment, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.86.5",
3
+ "version": "6.87.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -543,5 +543,5 @@
543
543
  "> 1%",
544
544
  "IE 10"
545
545
  ],
546
- "gitHead": "69bf4a19f39dc779173c705accb66f3514f80604"
546
+ "gitHead": "7db86359da96f269fb9c182ef957f0c90b8a9c66"
547
547
  }