@dreamcommerce/aurora 2.3.7 → 2.3.8-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.
@@ -11,22 +11,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
 
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
- const Accordion = ({ id, title, isOpened = false, isStatic = false, secondary, negativeIndentValue, children }) => {
14
+ const Accordion = ({ id, title, isOpened = false, secondary, negativeIndentValue, children }) => {
15
15
  const [isOpen, setIsOpen] = React.useState(isOpened);
16
16
  const handleOnClick = () => {
17
17
  setIsOpen(!isOpen);
18
18
  };
19
- React.useEffect(() => {
20
- if (isStatic) {
21
- setIsOpen(true);
22
- }
23
- }, [isStatic]);
24
19
  const wrapperIndentStyles = { marginLeft: `-${negativeIndentValue}px`, marginRight: `-${negativeIndentValue}px` };
25
20
  const contentIndentStyles = { paddingLeft: `${negativeIndentValue}px`, paddingRight: `${negativeIndentValue}px` };
26
21
  return (React__default['default'].createElement("div", { className: `${main_module['default'][css_classes['default'].accordion]} ${secondary ? main_module['default'][css_classes['default'].accordionSecondary] : ''}`, style: negativeIndentValue ? wrapperIndentStyles : undefined },
27
- React__default['default'].createElement("div", { className: main_module['default'][css_classes['default'].accordionHeader], onClick: !isStatic ? handleOnClick : undefined, "aria-expanded": isOpen, "aria-controls": id, style: negativeIndentValue ? contentIndentStyles : undefined },
22
+ React__default['default'].createElement("div", { className: main_module['default'][css_classes['default'].accordionHeader], onClick: handleOnClick, "aria-expanded": isOpen, "aria-controls": id, style: negativeIndentValue ? contentIndentStyles : undefined },
28
23
  React__default['default'].createElement("div", { className: main_module['default'][css_classes['default'].accordionTitle] }, title),
29
- !isStatic && React__default['default'].createElement(icon_arrow_down['default'], { size: "m", className: `${isOpen ? main_module['default'][css_classes['default'].accordionIconRotate180] : ''}` })),
24
+ React__default['default'].createElement(icon_arrow_down['default'], { size: "m", className: `${isOpen ? main_module['default'][css_classes['default'].accordionIconRotate180] : ''}` })),
30
25
  isOpen && (React__default['default'].createElement("div", { id: id, className: main_module['default'][css_classes['default'].accordionContent], style: negativeIndentValue ? contentIndentStyles : undefined }, children))));
31
26
  };
32
27
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -22,7 +22,7 @@ const reducer = (state, action) => {
22
22
  case constants.FILTER_ITEMS: {
23
23
  const filteredItems = state.initialData.filter((item) => {
24
24
  var _a;
25
- return (_a = item[action.payload.filterKey]) === null || _a === void 0 ? void 0 : _a.includes(action.payload.searchValue);
25
+ return (_a = item[action.payload.filterKey]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(action.payload.searchValue.toLowerCase());
26
26
  });
27
27
  return {
28
28
  ...state,
@@ -1,24 +1,19 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import CSS_CLASSES from './css_classes.js';
3
3
  import IconArrowDown from '../../assets/icon_arrow_down.js';
4
4
  import cssClasses from '../../css/accordion/main.module.less.js';
5
5
 
6
- const Accordion = ({ id, title, isOpened = false, isStatic = false, secondary, negativeIndentValue, children }) => {
6
+ const Accordion = ({ id, title, isOpened = false, secondary, negativeIndentValue, children }) => {
7
7
  const [isOpen, setIsOpen] = useState(isOpened);
8
8
  const handleOnClick = () => {
9
9
  setIsOpen(!isOpen);
10
10
  };
11
- useEffect(() => {
12
- if (isStatic) {
13
- setIsOpen(true);
14
- }
15
- }, [isStatic]);
16
11
  const wrapperIndentStyles = { marginLeft: `-${negativeIndentValue}px`, marginRight: `-${negativeIndentValue}px` };
17
12
  const contentIndentStyles = { paddingLeft: `${negativeIndentValue}px`, paddingRight: `${negativeIndentValue}px` };
18
13
  return (React.createElement("div", { className: `${cssClasses[CSS_CLASSES.accordion]} ${secondary ? cssClasses[CSS_CLASSES.accordionSecondary] : ''}`, style: negativeIndentValue ? wrapperIndentStyles : undefined },
19
- React.createElement("div", { className: cssClasses[CSS_CLASSES.accordionHeader], onClick: !isStatic ? handleOnClick : undefined, "aria-expanded": isOpen, "aria-controls": id, style: negativeIndentValue ? contentIndentStyles : undefined },
14
+ React.createElement("div", { className: cssClasses[CSS_CLASSES.accordionHeader], onClick: handleOnClick, "aria-expanded": isOpen, "aria-controls": id, style: negativeIndentValue ? contentIndentStyles : undefined },
20
15
  React.createElement("div", { className: cssClasses[CSS_CLASSES.accordionTitle] }, title),
21
- !isStatic && React.createElement(IconArrowDown, { size: "m", className: `${isOpen ? cssClasses[CSS_CLASSES.accordionIconRotate180] : ''}` })),
16
+ React.createElement(IconArrowDown, { size: "m", className: `${isOpen ? cssClasses[CSS_CLASSES.accordionIconRotate180] : ''}` })),
22
17
  isOpen && (React.createElement("div", { id: id, className: cssClasses[CSS_CLASSES.accordionContent], style: negativeIndentValue ? contentIndentStyles : undefined }, children))));
23
18
  };
24
19
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -3,7 +3,6 @@ export declare type IAccordionProps = {
3
3
  id: string;
4
4
  title: string | ReactNode;
5
5
  isOpened?: boolean;
6
- isStatic?: boolean;
7
6
  secondary?: boolean;
8
7
  negativeIndentValue?: number;
9
8
  children: ReactNode;
@@ -14,7 +14,7 @@ const reducer = (state, action) => {
14
14
  case FILTER_ITEMS: {
15
15
  const filteredItems = state.initialData.filter((item) => {
16
16
  var _a;
17
- return (_a = item[action.payload.filterKey]) === null || _a === void 0 ? void 0 : _a.includes(action.payload.searchValue);
17
+ return (_a = item[action.payload.filterKey]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(action.payload.searchValue.toLowerCase());
18
18
  });
19
19
  return {
20
20
  ...state,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.3.7",
5
+ "version": "2.3.8-1",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",