@trafilea/afrodita-components 5.0.0-beta.100 → 5.0.0-beta.101

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/build/index.d.ts CHANGED
@@ -2095,8 +2095,12 @@ interface SearchBarProps {
2095
2095
  initialTerm?: string;
2096
2096
  shouldClear?: boolean;
2097
2097
  isBlogSearchBar?: boolean;
2098
+ ariaLabel?: string;
2099
+ placeholder?: string;
2100
+ id?: string;
2101
+ autoComplete?: string;
2098
2102
  }
2099
- declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, }: SearchBarProps) => JSX.Element;
2103
+ declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, ariaLabel, placeholder, id, autoComplete, }: SearchBarProps) => JSX.Element;
2100
2104
 
2101
2105
  interface ProductGalleryMobileProps {
2102
2106
  images: ImageType[];
@@ -12975,12 +12975,12 @@ var Container$f = newStyled.div({
12975
12975
  display: 'flex',
12976
12976
  });
12977
12977
  var SearchBar = function (_a) {
12978
- var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c;
12978
+ var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c, _d = _a.ariaLabel, ariaLabel = _d === void 0 ? 'Search for products' : _d, _e = _a.placeholder, placeholder = _e === void 0 ? 'Search for products' : _e, _f = _a.id, id = _f === void 0 ? 'search' : _f, _g = _a.autoComplete, autoComplete = _g === void 0 ? 'off' : _g;
12979
12979
  var theme = useTheme();
12980
12980
  if (initialTerm) {
12981
12981
  initialState$1.term = initialTerm;
12982
12982
  }
12983
- var _d = useReducer(reducer, initialState$1), state = _d[0], dispatch = _d[1];
12983
+ var _h = useReducer(reducer, initialState$1), state = _h[0], dispatch = _h[1];
12984
12984
  var ref = useRef(null);
12985
12985
  var shouldDisplaySuggestion = function () {
12986
12986
  return resultOptions.length === 0 && suggestions.length > 0 && !state.term;
@@ -13006,7 +13006,7 @@ var SearchBar = function (_a) {
13006
13006
  onClose();
13007
13007
  }
13008
13008
  };
13009
- return (jsxs$1("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxs$1(Container$f, __assign$1({ theme: theme }, { children: [jsx$1(Input, { value: state.term, placeholder: "Search for products", onChange: function (e) { return dispatch({ type: 'UPDATE_TERM', payload: { term: e.target.value } }); }, onFocus: function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: true } }); }, id: "search", autoComplete: "off", theme: theme, "aria-label": "Search for products", onKeyDown: function (e) {
13009
+ return (jsxs$1("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxs$1(Container$f, __assign$1({ theme: theme }, { children: [jsx$1(Input, { value: state.term, placeholder: placeholder, onChange: function (e) { return dispatch({ type: 'UPDATE_TERM', payload: { term: e.target.value } }); }, onFocus: function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: true } }); }, id: id, autoComplete: autoComplete, theme: theme, "aria-label": ariaLabel, onKeyDown: function (e) {
13010
13010
  if (e.key === 'Enter') {
13011
13011
  e.preventDefault();
13012
13012
  e.stopPropagation();
package/build/index.js CHANGED
@@ -13001,12 +13001,12 @@ var Container$f = newStyled.div({
13001
13001
  display: 'flex',
13002
13002
  });
13003
13003
  var SearchBar = function (_a) {
13004
- var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c;
13004
+ var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c, _d = _a.ariaLabel, ariaLabel = _d === void 0 ? 'Search for products' : _d, _e = _a.placeholder, placeholder = _e === void 0 ? 'Search for products' : _e, _f = _a.id, id = _f === void 0 ? 'search' : _f, _g = _a.autoComplete, autoComplete = _g === void 0 ? 'off' : _g;
13005
13005
  var theme = useTheme();
13006
13006
  if (initialTerm) {
13007
13007
  initialState$1.term = initialTerm;
13008
13008
  }
13009
- var _d = React$2.useReducer(reducer, initialState$1), state = _d[0], dispatch = _d[1];
13009
+ var _h = React$2.useReducer(reducer, initialState$1), state = _h[0], dispatch = _h[1];
13010
13010
  var ref = React$2.useRef(null);
13011
13011
  var shouldDisplaySuggestion = function () {
13012
13012
  return resultOptions.length === 0 && suggestions.length > 0 && !state.term;
@@ -13032,7 +13032,7 @@ var SearchBar = function (_a) {
13032
13032
  onClose();
13033
13033
  }
13034
13034
  };
13035
- return (jsxRuntime.jsxs("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxRuntime.jsxs(Container$f, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(Input, { value: state.term, placeholder: "Search for products", onChange: function (e) { return dispatch({ type: 'UPDATE_TERM', payload: { term: e.target.value } }); }, onFocus: function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: true } }); }, id: "search", autoComplete: "off", theme: theme, "aria-label": "Search for products", onKeyDown: function (e) {
13035
+ return (jsxRuntime.jsxs("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxRuntime.jsxs(Container$f, __assign$1({ theme: theme }, { children: [jsxRuntime.jsx(Input, { value: state.term, placeholder: placeholder, onChange: function (e) { return dispatch({ type: 'UPDATE_TERM', payload: { term: e.target.value } }); }, onFocus: function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: true } }); }, id: id, autoComplete: autoComplete, theme: theme, "aria-label": ariaLabel, onKeyDown: function (e) {
13036
13036
  if (e.key === 'Enter') {
13037
13037
  e.preventDefault();
13038
13038
  e.stopPropagation();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "5.0.0-beta.100",
6
+ "version": "5.0.0-beta.101",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "style": "build/index.css",