react-instantsearch 7.32.0 → 7.32.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.
@@ -19,7 +19,7 @@ var AutocompleteSearchComponent = (0, _instantsearchuicomponents.createAutocompl
19
19
  Fragment: _react.Fragment
20
20
  });
21
21
  function AutocompleteSearch(param) {
22
- var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick;
22
+ var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick, classNames = param.classNames;
23
23
  return /*#__PURE__*/ _react.default.createElement(AutocompleteSearchComponent, {
24
24
  inputProps: _object_spread_props._(_object_spread._({}, inputProps), {
25
25
  onChange: function onChange(event) {
@@ -33,6 +33,7 @@ function AutocompleteSearch(param) {
33
33
  onCancel: onCancel,
34
34
  isDetached: isDetached,
35
35
  submitTitle: submitTitle,
36
- onAiModeClick: onAiModeClick
36
+ onAiModeClick: onAiModeClick,
37
+ classNames: classNames
37
38
  });
38
39
  }
@@ -582,9 +582,16 @@ function InnerAutocomplete(_0) {
582
582
  });
583
583
  }
584
584
  }
585
- } : undefined
585
+ } : undefined,
586
+ classNames: classNames
586
587
  });
587
- var panelContent = /*#__PURE__*/ _react.default.createElement(AutocompletePanel, getPanelProps(), PanelComponent ? /*#__PURE__*/ _react.default.createElement(PanelComponent, {
588
+ var panelContent = /*#__PURE__*/ _react.default.createElement(AutocompletePanel, _object_spread_props._(_object_spread._({}, getPanelProps()), {
589
+ classNames: {
590
+ root: classNames === null || classNames === void 0 ? void 0 : classNames.panel,
591
+ open: classNames === null || classNames === void 0 ? void 0 : classNames.panelOpen,
592
+ layout: classNames === null || classNames === void 0 ? void 0 : classNames.panelLayout
593
+ }
594
+ }), PanelComponent ? /*#__PURE__*/ _react.default.createElement(PanelComponent, {
588
595
  elements: elements,
589
596
  indices: indicesForPanel
590
597
  }) : Object.keys(elements).map(function(elementId) {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ComponentProps } from 'instantsearch-ui-components';
2
+ import type { AutocompleteClassNames, ComponentProps } from 'instantsearch-ui-components';
3
3
  export type AutocompleteSearchProps = {
4
4
  inputProps: ComponentProps<'input'>;
5
5
  clearQuery: () => void;
@@ -10,5 +10,6 @@ export type AutocompleteSearchProps = {
10
10
  isDetached?: boolean;
11
11
  submitTitle?: string;
12
12
  onAiModeClick?: () => void;
13
+ classNames?: Partial<AutocompleteClassNames>;
13
14
  };
14
- export declare function AutocompleteSearch({ inputProps, clearQuery, onQueryChange, query, isSearchStalled, onCancel, isDetached, submitTitle, onAiModeClick, }: AutocompleteSearchProps): React.JSX.Element;
15
+ export declare function AutocompleteSearch({ inputProps, clearQuery, onQueryChange, query, isSearchStalled, onCancel, isDetached, submitTitle, onAiModeClick, classNames, }: AutocompleteSearchProps): React.JSX.Element;
@@ -8,7 +8,7 @@ var AutocompleteSearchComponent = createAutocompleteSearchComponent({
8
8
  Fragment: Fragment
9
9
  });
10
10
  function AutocompleteSearch(param) {
11
- var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick;
11
+ var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick, classNames = param.classNames;
12
12
  return /*#__PURE__*/ React.createElement(AutocompleteSearchComponent, {
13
13
  inputProps: _(_$1({}, inputProps), {
14
14
  onChange: function onChange(event) {
@@ -22,7 +22,8 @@ function AutocompleteSearch(param) {
22
22
  onCancel: onCancel,
23
23
  isDetached: isDetached,
24
24
  submitTitle: submitTitle,
25
- onAiModeClick: onAiModeClick
25
+ onAiModeClick: onAiModeClick,
26
+ classNames: classNames
26
27
  });
27
28
  }
28
29
 
@@ -571,9 +571,16 @@ function InnerAutocomplete(_0) {
571
571
  });
572
572
  }
573
573
  }
574
- } : undefined
574
+ } : undefined,
575
+ classNames: classNames
575
576
  });
576
- var panelContent = /*#__PURE__*/ React.createElement(AutocompletePanel, getPanelProps(), PanelComponent ? /*#__PURE__*/ React.createElement(PanelComponent, {
577
+ var panelContent = /*#__PURE__*/ React.createElement(AutocompletePanel, _$4(_$1({}, getPanelProps()), {
578
+ classNames: {
579
+ root: classNames === null || classNames === void 0 ? void 0 : classNames.panel,
580
+ open: classNames === null || classNames === void 0 ? void 0 : classNames.panelOpen,
581
+ layout: classNames === null || classNames === void 0 ? void 0 : classNames.panelLayout
582
+ }
583
+ }), PanelComponent ? /*#__PURE__*/ React.createElement(PanelComponent, {
577
584
  elements: elements,
578
585
  indices: indicesForPanel
579
586
  }) : Object.keys(elements).map(function(elementId) {
@@ -1,4 +1,4 @@
1
- /*! React InstantSearch 7.32.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! React InstantSearch 7.32.1 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
@@ -24,7 +24,7 @@
24
24
 
25
25
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
26
26
 
27
- var version$2 = '7.32.0';
27
+ var version$2 = '7.32.1';
28
28
 
29
29
  function _define_property(obj, key, value) {
30
30
  if (key in obj) {
@@ -8070,11 +8070,11 @@
8070
8070
  var unmountFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
8071
8071
  checkRendering(renderFn, withUsage$s());
8072
8072
  return function(widgetParams) {
8073
- var searchScope = widgetParams.searchScope, _widgetParams_transformFeeds = widgetParams.transformFeeds, transformFeeds = _widgetParams_transformFeeds === void 0 ? function(feeds) {
8073
+ var isolated = widgetParams.isolated, _widgetParams_transformFeeds = widgetParams.transformFeeds, transformFeeds = _widgetParams_transformFeeds === void 0 ? function(feeds) {
8074
8074
  return feeds;
8075
8075
  } : _widgetParams_transformFeeds;
8076
- if (searchScope !== 'global') {
8077
- throw new Error(withUsage$s('The `searchScope` option currently only supports "global".'));
8076
+ if (isolated !== false) {
8077
+ throw new Error(withUsage$s('The `isolated` option currently only supports `false`.'));
8078
8078
  }
8079
8079
  return {
8080
8080
  $$type: 'ais.feeds',
@@ -10821,7 +10821,7 @@
10821
10821
  };
10822
10822
  }
10823
10823
 
10824
- var version = '4.96.0';
10824
+ var version = '4.96.1';
10825
10825
 
10826
10826
  var withUsage$q = createDocumentationMessageGenerator({
10827
10827
  name: 'instantsearch'
@@ -18216,9 +18216,9 @@
18216
18216
  }
18217
18217
  }
18218
18218
  function SubmitIcon(param) {
18219
- var createElement = param.createElement;
18219
+ var createElement = param.createElement, className = param.className;
18220
18220
  return /*#__PURE__*/ createElement("svg", {
18221
- className: "ais-AutocompleteSubmitIcon",
18221
+ className: cx('ais-AutocompleteSubmitIcon', className),
18222
18222
  viewBox: "0 0 24 24",
18223
18223
  fill: "currentColor"
18224
18224
  }, /*#__PURE__*/ createElement("path", {
@@ -18226,9 +18226,9 @@
18226
18226
  }));
18227
18227
  }
18228
18228
  function LoadingIcon(param) {
18229
- var createElement = param.createElement, isSearchStalled = param.isSearchStalled;
18229
+ var createElement = param.createElement, isSearchStalled = param.isSearchStalled, className = param.className;
18230
18230
  return /*#__PURE__*/ createElement("svg", {
18231
- className: "ais-AutocompleteLoadingIcon",
18231
+ className: cx('ais-AutocompleteLoadingIcon', className),
18232
18232
  viewBox: "0 0 100 100",
18233
18233
  ref: function ref(element) {
18234
18234
  return syncLoadingSvgAnimation(element, isSearchStalled);
@@ -18251,9 +18251,9 @@
18251
18251
  })));
18252
18252
  }
18253
18253
  function ClearIcon(param) {
18254
- var createElement = param.createElement;
18254
+ var createElement = param.createElement, className = param.className;
18255
18255
  return /*#__PURE__*/ createElement("svg", {
18256
- className: "ais-AutocompleteClearIcon",
18256
+ className: cx('ais-AutocompleteClearIcon', className),
18257
18257
  viewBox: "0 0 24 24",
18258
18258
  fill: "currentColor"
18259
18259
  }, /*#__PURE__*/ createElement("path", {
@@ -18261,8 +18261,9 @@
18261
18261
  }));
18262
18262
  }
18263
18263
  function ClockIcon(param) {
18264
- var createElement = param.createElement;
18264
+ var createElement = param.createElement, className = param.className;
18265
18265
  return /*#__PURE__*/ createElement("svg", {
18266
+ className: cx(className) || undefined,
18266
18267
  viewBox: "0 0 24 24",
18267
18268
  fill: "currentColor"
18268
18269
  }, /*#__PURE__*/ createElement("path", {
@@ -18270,8 +18271,9 @@
18270
18271
  }));
18271
18272
  }
18272
18273
  function TrashIcon(param) {
18273
- var createElement = param.createElement;
18274
+ var createElement = param.createElement, className = param.className;
18274
18275
  return /*#__PURE__*/ createElement("svg", {
18276
+ className: cx(className) || undefined,
18275
18277
  viewBox: "0 0 24 24",
18276
18278
  fill: "currentColor"
18277
18279
  }, /*#__PURE__*/ createElement("path", {
@@ -18279,8 +18281,9 @@
18279
18281
  }));
18280
18282
  }
18281
18283
  function ApplyIcon(param) {
18282
- var createElement = param.createElement;
18284
+ var createElement = param.createElement, className = param.className;
18283
18285
  return /*#__PURE__*/ createElement("svg", {
18286
+ className: cx(className) || undefined,
18284
18287
  viewBox: "0 0 24 24",
18285
18288
  fill: "currentColor"
18286
18289
  }, /*#__PURE__*/ createElement("path", {
@@ -18288,9 +18291,9 @@
18288
18291
  }));
18289
18292
  }
18290
18293
  function AiModeIcon(param) {
18291
- var createElement = param.createElement;
18294
+ var createElement = param.createElement, className = param.className;
18292
18295
  return /*#__PURE__*/ createElement("svg", {
18293
- className: "ais-AiModeButton-icon",
18296
+ className: cx('ais-AiModeButton-icon', className),
18294
18297
  xmlns: "http://www.w3.org/2000/svg",
18295
18298
  fill: "none",
18296
18299
  viewBox: "0 0 20 20",
@@ -18310,9 +18313,9 @@
18310
18313
  }));
18311
18314
  }
18312
18315
  function SearchIcon(param) {
18313
- var createElement = param.createElement;
18316
+ var createElement = param.createElement, className = param.className;
18314
18317
  return /*#__PURE__*/ createElement("svg", {
18315
- className: "ais-AutocompleteDetachedSearchIcon",
18318
+ className: cx('ais-AutocompleteDetachedSearchIcon', className),
18316
18319
  viewBox: "0 0 24 24",
18317
18320
  fill: "currentColor"
18318
18321
  }, /*#__PURE__*/ createElement("path", {
@@ -18320,9 +18323,9 @@
18320
18323
  }));
18321
18324
  }
18322
18325
  function BackIcon(param) {
18323
- var createElement = param.createElement;
18326
+ var createElement = param.createElement, className = param.className;
18324
18327
  return /*#__PURE__*/ createElement("svg", {
18325
- className: "ais-AutocompleteBackIcon",
18328
+ className: cx('ais-AutocompleteBackIcon', className),
18326
18329
  viewBox: "0 0 24 24",
18327
18330
  fill: "currentColor"
18328
18331
  }, /*#__PURE__*/ createElement("path", {
@@ -18349,7 +18352,8 @@
18349
18352
  }, /*#__PURE__*/ createElement("div", {
18350
18353
  className: cx('ais-AutocompleteDetachedSearchButtonIcon', classNames.detachedSearchButtonIcon)
18351
18354
  }, /*#__PURE__*/ createElement(SearchIcon, {
18352
- createElement: createElement
18355
+ createElement: createElement,
18356
+ className: classNames.detachedSearchButtonSearchIcon
18353
18357
  })), /*#__PURE__*/ createElement("div", {
18354
18358
  className: cx('ais-AutocompleteDetachedSearchButtonPlaceholder', classNames.detachedSearchButtonPlaceholder),
18355
18359
  hidden: Boolean(query)
@@ -18364,7 +18368,8 @@
18364
18368
  onClear();
18365
18369
  }
18366
18370
  }, /*#__PURE__*/ createElement(ClearIcon, {
18367
- createElement: createElement
18371
+ createElement: createElement,
18372
+ className: classNames.detachedSearchButtonClearIcon
18368
18373
  })));
18369
18374
  };
18370
18375
  }
@@ -18421,7 +18426,7 @@
18421
18426
  ]);
18422
18427
  return /*#__PURE__*/ createElement("div", _object_spread_props(_object_spread({}, props), {
18423
18428
  "aria-hidden": hidden,
18424
- className: cx('ais-AutocompletePanel', !hidden && 'ais-AutocompletePanel--open', classNames.root, props.className),
18429
+ className: cx('ais-AutocompletePanel', !hidden && 'ais-AutocompletePanel--open', classNames.root, !hidden && classNames.open, props.className),
18425
18430
  onMouseDown: function onMouseDown(event) {
18426
18431
  // Prevents the autocomplete panel from blurring the input when
18427
18432
  // clicking inside the panel.
@@ -18792,12 +18797,12 @@
18792
18797
  function createAutocompleteSearchComponent(param) {
18793
18798
  var createElement = param.createElement;
18794
18799
  return function AutocompleteSearch(userProps) {
18795
- var inputProps = userProps.inputProps, onClear = userProps.onClear, query = userProps.query, isSearchStalled = userProps.isSearchStalled, onCancel = userProps.onCancel, isDetached = userProps.isDetached, submitTitle = userProps.submitTitle, onAiModeClick = userProps.onAiModeClick;
18800
+ var inputProps = userProps.inputProps, onClear = userProps.onClear, query = userProps.query, isSearchStalled = userProps.isSearchStalled, onCancel = userProps.onCancel, isDetached = userProps.isDetached, submitTitle = userProps.submitTitle, onAiModeClick = userProps.onAiModeClick, _userProps_classNames = userProps.classNames, classNames = _userProps_classNames === void 0 ? {} : _userProps_classNames;
18796
18801
  var isBackButton = Boolean(isDetached && onCancel);
18797
18802
  var resolvedCancelTitle = submitTitle !== null && submitTitle !== void 0 ? submitTitle : 'Close';
18798
18803
  var inputRef = inputProps.ref;
18799
18804
  return /*#__PURE__*/ createElement("form", {
18800
- className: "ais-AutocompleteForm",
18805
+ className: cx('ais-AutocompleteForm', classNames.form),
18801
18806
  action: "",
18802
18807
  noValidate: true,
18803
18808
  role: "search",
@@ -18809,38 +18814,41 @@
18809
18814
  return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
18810
18815
  }
18811
18816
  }, /*#__PURE__*/ createElement("div", {
18812
- className: "ais-AutocompleteInputWrapperPrefix"
18817
+ className: cx('ais-AutocompleteInputWrapperPrefix', classNames.inputWrapperPrefix)
18813
18818
  }, isBackButton && /*#__PURE__*/ createElement("button", {
18814
- className: "ais-AutocompleteBackButton",
18819
+ className: cx('ais-AutocompleteBackButton', classNames.backButton),
18815
18820
  type: "button",
18816
18821
  title: resolvedCancelTitle,
18817
18822
  onClick: onCancel,
18818
18823
  hidden: isSearchStalled
18819
18824
  }, /*#__PURE__*/ createElement(BackIcon, {
18820
- createElement: createElement
18825
+ createElement: createElement,
18826
+ className: classNames.backButtonIcon
18821
18827
  })), /*#__PURE__*/ createElement("label", {
18822
- className: "ais-AutocompleteLabel",
18828
+ className: cx('ais-AutocompleteLabel', classNames.label),
18823
18829
  "aria-label": "Submit",
18824
18830
  htmlFor: inputProps.id,
18825
18831
  id: "".concat(inputProps.id, "-label"),
18826
18832
  hidden: isBackButton || undefined
18827
18833
  }, /*#__PURE__*/ createElement("button", {
18828
- className: "ais-AutocompleteSubmitButton",
18834
+ className: cx('ais-AutocompleteSubmitButton', classNames.submitButton),
18829
18835
  type: "submit",
18830
18836
  title: "Submit",
18831
18837
  hidden: isSearchStalled
18832
18838
  }, /*#__PURE__*/ createElement(SubmitIcon, {
18833
- createElement: createElement
18839
+ createElement: createElement,
18840
+ className: classNames.submitButtonIcon
18834
18841
  }))), /*#__PURE__*/ createElement("div", {
18835
- className: "ais-AutocompleteLoadingIndicator",
18842
+ className: cx('ais-AutocompleteLoadingIndicator', classNames.loadingIndicator),
18836
18843
  hidden: !isSearchStalled
18837
18844
  }, /*#__PURE__*/ createElement(LoadingIcon, {
18838
18845
  createElement: createElement,
18839
- isSearchStalled: isSearchStalled
18846
+ isSearchStalled: isSearchStalled,
18847
+ className: classNames.loadingIndicatorIcon
18840
18848
  }))), /*#__PURE__*/ createElement("div", {
18841
- className: "ais-AutocompleteInputWrapper"
18849
+ className: cx('ais-AutocompleteInputWrapper', classNames.inputWrapper)
18842
18850
  }, /*#__PURE__*/ createElement("input", _object_spread({
18843
- className: "ais-AutocompleteInput",
18851
+ className: cx('ais-AutocompleteInput', classNames.input),
18844
18852
  "aria-autocomplete": "both",
18845
18853
  "aria-labelledby": "".concat(inputProps.id, "-label"),
18846
18854
  autoComplete: "off",
@@ -18852,17 +18860,18 @@
18852
18860
  type: "search",
18853
18861
  value: query
18854
18862
  }, inputProps))), /*#__PURE__*/ createElement("div", {
18855
- className: "ais-AutocompleteInputWrapperSuffix"
18863
+ className: cx('ais-AutocompleteInputWrapperSuffix', classNames.inputWrapperSuffix)
18856
18864
  }, /*#__PURE__*/ createElement("button", {
18857
- className: "ais-AutocompleteClearButton",
18865
+ className: cx('ais-AutocompleteClearButton', classNames.resetButton),
18858
18866
  type: "reset",
18859
18867
  title: "Clear",
18860
18868
  hidden: query.length === 0 || isSearchStalled,
18861
18869
  onClick: onClear
18862
18870
  }, /*#__PURE__*/ createElement(ClearIcon, {
18863
- createElement: createElement
18871
+ createElement: createElement,
18872
+ className: classNames.resetButtonIcon
18864
18873
  })), onAiModeClick && /*#__PURE__*/ createElement("button", {
18865
- className: "ais-AiModeButton",
18874
+ className: cx('ais-AiModeButton', classNames.aiModeButton),
18866
18875
  type: "button",
18867
18876
  title: "AI Mode",
18868
18877
  onClick: function onClick(e) {
@@ -18870,9 +18879,10 @@
18870
18879
  onAiModeClick();
18871
18880
  }
18872
18881
  }, /*#__PURE__*/ createElement(AiModeIcon, {
18873
- createElement: createElement
18882
+ createElement: createElement,
18883
+ className: classNames.aiModeButtonIcon
18874
18884
  }), /*#__PURE__*/ createElement("span", {
18875
- className: "ais-AiModeButton-label"
18885
+ className: cx('ais-AiModeButton-label', classNames.aiModeButtonLabel)
18876
18886
  }, "AI Mode"))));
18877
18887
  };
18878
18888
  }
@@ -21679,7 +21689,7 @@
21679
21689
  Fragment: React.Fragment
21680
21690
  });
21681
21691
  function AutocompleteSearch(param) {
21682
- var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick;
21692
+ var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick, classNames = param.classNames;
21683
21693
  return /*#__PURE__*/ React.createElement(AutocompleteSearchComponent, {
21684
21694
  inputProps: _object_spread_props(_object_spread({}, inputProps), {
21685
21695
  onChange: function onChange(event) {
@@ -21693,7 +21703,8 @@
21693
21703
  onCancel: onCancel,
21694
21704
  isDetached: isDetached,
21695
21705
  submitTitle: submitTitle,
21696
- onAiModeClick: onAiModeClick
21706
+ onAiModeClick: onAiModeClick,
21707
+ classNames: classNames
21697
21708
  });
21698
21709
  }
21699
21710
 
@@ -22346,9 +22357,16 @@
22346
22357
  });
22347
22358
  }
22348
22359
  }
22349
- } : undefined
22360
+ } : undefined,
22361
+ classNames: classNames
22350
22362
  });
22351
- var panelContent = /*#__PURE__*/ React.createElement(AutocompletePanel, getPanelProps(), PanelComponent ? /*#__PURE__*/ React.createElement(PanelComponent, {
22363
+ var panelContent = /*#__PURE__*/ React.createElement(AutocompletePanel, _object_spread_props(_object_spread({}, getPanelProps()), {
22364
+ classNames: {
22365
+ root: classNames === null || classNames === void 0 ? void 0 : classNames.panel,
22366
+ open: classNames === null || classNames === void 0 ? void 0 : classNames.panelOpen,
22367
+ layout: classNames === null || classNames === void 0 ? void 0 : classNames.panelLayout
22368
+ }
22369
+ }), PanelComponent ? /*#__PURE__*/ React.createElement(PanelComponent, {
22352
22370
  elements: elements,
22353
22371
  indices: indicesForPanel
22354
22372
  }) : Object.keys(elements).map(function(elementId) {