@semcore/add-filter 16.6.3 → 16.7.0-prerelease.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [16.7.0] - 2026-05-07
6
+
7
+ ### Added
8
+
9
+ - New brand theme.
10
+
5
11
  ## [16.6.3] - 2025-12-18
6
12
 
7
13
  ### Fixed
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![version](https://img.shields.io/npm/v/@semcore/add-filter.svg)](https://www.npmjs.com/@semcore/add-filter)
4
4
  [![downloads](https://img.shields.io/npm/dt/@semcore/add-filter.svg)](https://www.npmjs.com/package/@semcore/add-filter)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/semrush/intergalactic/blob/master/LICENSE)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/semrush/intergalactic/blob/HEAD/LICENSE)
6
6
 
7
7
  > This component is part of the Intergalactic Design System
8
8
 
@@ -20,13 +20,13 @@ npm install @semcore/add-filter
20
20
 
21
21
  ## 👤 Author
22
22
 
23
- [UI-kit team](https://github.com/semrush/intergalactic/blob/master/MAINTAINERS) and [others ❤️](https://github.com/semrush/intergalactic/graphs/contributors)
23
+ [UI-kit team](https://github.com/semrush/intergalactic/blob/HEAD/MAINTAINERS) and [others ❤️](https://github.com/semrush/intergalactic/graphs/contributors)
24
24
 
25
25
  ## 🤝 Contributing
26
26
 
27
27
  Contributions, issues and feature requests are welcome!
28
28
 
29
- Feel free to check [issues page](https://github.com/semrush/intergalactic/issues). You can also take a look at the [contributing guide](https://github.com/semrush/intergalactic/blob/master/CONTRIBUTING.md).
29
+ Feel free to check [issues page](https://github.com/semrush/intergalactic/issues). You can also take a look at the [contributing guide](https://github.com/semrush/intergalactic/blob/HEAD/CONTRIBUTING.md).
30
30
 
31
31
  ## Show your support
32
32
 
@@ -34,4 +34,4 @@ Give a ⭐️ if this project helped you!
34
34
 
35
35
  ## 📝 License
36
36
 
37
- This project is [MIT](https://github.com/semrush/intergalactic/blob/master/LICENSE) licensed.
37
+ This project is [MIT](https://github.com/semrush/intergalactic/blob/HEAD/LICENSE) licensed.
@@ -70,10 +70,10 @@ var AddFilterInputRoot = /*#__PURE__*/function (_Component) {
70
70
  }]);
71
71
  }(_core.Component);
72
72
  (0, _defineProperty2["default"])(AddFilterInputRoot, "displayName", 'AddFilterInput');
73
- var Clear = function Clear() {
73
+ function Clear() {
74
74
  var _ref2 = arguments[0];
75
75
  return /*#__PURE__*/_react["default"].createElement(_button.ButtonLink, (0, _core.assignProps)({}, _ref2));
76
- };
76
+ }
77
77
  var AddFilterInput = (0, _core.createComponent)(AddFilterInputRoot, {
78
78
  Value: _input["default"].Value,
79
79
  Addon: _input["default"].Addon,
@@ -1 +1 @@
1
- {"version":3,"file":"AddFilterInput.js","names":["_core","require","_button","_input","_interopRequireDefault","_react","AddFilterInputRoot","_Component","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread2","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","Input","assignProps","Component","_defineProperty2","Clear","_ref2","arguments[0]","ButtonLink","AddFilterInput","createComponent","Value","Addon","_default","exports"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import { ButtonLink } from '@semcore/button';\nimport { createComponent, Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport type { InputValueProps } from '@semcore/input';\nimport React from 'react';\n\nimport type { AddFilterItemProps } from '../AddFilter.types';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w='auto' inline={false} />;\n }\n}\n\nconst Clear = () => {\n return <Root render={ButtonLink} />;\n};\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0B,IASpBK,kBAAkB,0BAAAC,UAAA;EAAA,SAAAD,mBAAA;IAAA,IAAAE,gBAAA,mBAAAF,kBAAA;IAAA,WAAAG,WAAA,mBAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAL,kBAAA,EAAAC,UAAA;EAAA,WAAAK,aAAA,aAAAN,kBAAA;IAAAO,GAAA;IAAAC,KAAA,EAGtB,SAAAC,oBAAoBA,CAAA,EAAG;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,eAAtBA,qBAAA,CAAAI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A,KAAKA,CAAA,EAAS;EAAA,IAAAC,KAAA,GAAAC,YAAA;EAClB,oBAAOxC,MAAA,YAAAiC,aAAA,CAAcQ,kBAAU,MAAA9C,KAAA,CAAAwC,WAAA,MAAAI,KAAA,CAAG,CAAC;AACrC,CAAC;AAED,IAAMG,cAAc,GAAG,IAAAC,qBAAe,EAAC1C,kBAAkB,EAAE;EACzD2C,KAAK,EAAEV,iBAAK,CAACU,KAAK;EAClBC,KAAK,EAAEX,iBAAK,CAACW,KAAK;EAClBP,KAAK,EAALA;AACF,CAAC,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEYL,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"AddFilterInput.js","names":["_core","require","_button","_input","_interopRequireDefault","_react","AddFilterInputRoot","_Component","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread2","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","Input","assignProps","Component","_defineProperty2","Clear","_ref2","arguments[0]","ButtonLink","AddFilterInput","createComponent","Value","Addon","_default","exports"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import { ButtonLink } from '@semcore/button';\nimport { createComponent, Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport type { InputValueProps } from '@semcore/input';\nimport React from 'react';\n\nimport type { AddFilterItemProps } from '../AddFilter.types';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w='auto' inline={false} />;\n }\n}\n\nfunction Clear() {\n return <Root render={ButtonLink} />;\n}\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0B,IASpBK,kBAAkB,0BAAAC,UAAA;EAAA,SAAAD,mBAAA;IAAA,IAAAE,gBAAA,mBAAAF,kBAAA;IAAA,WAAAG,WAAA,mBAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAL,kBAAA,EAAAC,UAAA;EAAA,WAAAK,aAAA,aAAAN,kBAAA;IAAAO,GAAA;IAAAC,KAAA,EAGtB,SAAAC,oBAAoBA,CAAA,EAAG;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,eAAtBA,qBAAA,CAAAI,IAAA,CAAAH,aAAyB,CAAC;IAC5B;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAO,aAAaA,CAACC,KAAsB,EAAE;MACpC,IAAAC,KAAA,GAAwC,IAAI,CAACL,OAAO;QAA5CJ,KAAK,GAAAS,KAAA,CAALT,KAAK;QAAEU,OAAO,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E;EACzD2C,KAAK,EAAEV,iBAAK,CAACU,KAAK;EAClBC,KAAK,EAAEX,iBAAK,CAACW,KAAK;EAClBP,KAAK,EAALA;AACF,CAAC,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEYL,cAAc","ignoreList":[]}
@@ -65,10 +65,10 @@ var AddFilterInputRoot = /*#__PURE__*/function (_Component) {
65
65
  }]);
66
66
  }(Component);
67
67
  _defineProperty(AddFilterInputRoot, "displayName", 'AddFilterInput');
68
- var Clear = function Clear() {
68
+ function Clear() {
69
69
  var _ref2 = arguments[0];
70
70
  return /*#__PURE__*/React.createElement(ButtonLink, _assignProps2({}, _ref2));
71
- };
71
+ }
72
72
  var AddFilterInput = createComponent(AddFilterInputRoot, {
73
73
  Value: Input.Value,
74
74
  Addon: Input.Addon,
@@ -1 +1 @@
1
- {"version":3,"file":"AddFilterInput.js","names":["ButtonLink","createComponent","Component","Root","Input","React","AddFilterInputRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","_assignProps","_defineProperty","Clear","_ref2","arguments[0]","_assignProps2","AddFilterInput","Value","Addon"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import { ButtonLink } from '@semcore/button';\nimport { createComponent, Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport type { InputValueProps } from '@semcore/input';\nimport React from 'react';\n\nimport type { AddFilterItemProps } from '../AddFilter.types';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w='auto' inline={false} />;\n }\n}\n\nconst Clear = () => {\n return <Root render={ButtonLink} />;\n};\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,KAAK,MAAM,gBAAgB;AAElC,OAAOC,KAAK,MAAM,OAAO;AAAC,IASpBC,kBAAkB,0BAAAC,UAAA;EAAA,SAAAD,mBAAA;IAAAE,eAAA,OAAAF,kBAAA;IAAA,OAAAG,UAAA,OAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,kBAAA,EAAAC,UAAA;EAAA,OAAAK,YAAA,CAAAN,kBAAA;IAAAO,GAAA;IAAAC,KAAA,EAGtB,SAAAC,oBAAoBA,CAAA,EAAG;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,eAAtBA,qBAAA,CAAAI,IAAA,CAAAH,aAAyB,CAAC;IAC5B;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAO,aAAaA,CAACC,KAAsB,EAAE;MACpC,IAAAC,KAAA,GAAwC,IAAI,CAACL,OA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GAAG5C,eAAe,CAACK,kBAAkB,EAAE;EACzDwC,KAAK,EAAE1C,KAAK,CAAC0C,KAAK;EAClBC,KAAK,EAAE3C,KAAK,CAAC2C,KAAK;EAClBN,KAAK,EAALA;AACF,CAAC,CAAC;AAEF,eAAeI,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"AddFilterInput.js","names":["ButtonLink","createComponent","Component","Root","Input","React","AddFilterInputRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","_assignProps","_defineProperty","Clear","_ref2","arguments[0]","_assignProps2","AddFilterInput","Value","Addon"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import { ButtonLink } from '@semcore/button';\nimport { createComponent, Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport type { InputValueProps } from '@semcore/input';\nimport React from 'react';\n\nimport type { AddFilterItemProps } from '../AddFilter.types';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w='auto' inline={false} />;\n }\n}\n\nfunction Clear() {\n return <Root render={ButtonLink} />;\n}\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,KAAK,MAAM,gBAAgB;AAElC,OAAOC,KAAK,MAAM,OAAO;AAAC,IASpBC,kBAAkB,0BAAAC,UAAA;EAAA,SAAAD,mBAAA;IAAAE,eAAA,OAAAF,kBAAA;IAAA,OAAAG,UAAA,OAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,kBAAA,EAAAC,UAAA;EAAA,OAAAK,YAAA,CAAAN,kBAAA;IAAAO,GAAA;IAAAC,KAAA,EAGtB,SAAAC,oBAAoBA,CAAA,EAAG;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,eAAtBA,qBAAA,CAAAI,IAAA,CAAAH,aAAyB,CAAC;IAC5B;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAO,aAAaA,CAACC,KAAsB,EAAE;MACpC,IAAAC,KAAA,GAAwC,IAAI,CAACL,OAAO;QAA5CJ,KAAK,GAAAS,KAAA,CAALT,KAAK;QAAEU,OAAO,GAAAD,KAAA,CAAPC,OAAO;QAAEC,WAAW,GAAAF,KAAA,CAAXE,WAAW;MAEnC,OAAAC,aAAA,CAAAA,aAAA,KACKJ,KAAK;QACRK,GAAG,EAAEF,WAAW;QAChBG,MAAM,EAAE,SAARA,MAAMA,CAAA,EAAQ;UACZ,IAAI,CAACd,KAAK,EAAE;YACVe,UAAU,CAACL,OAAO,EAAE,GAAG,CAAC;UAC1B;QACF,CAAC;QACDM,SAAS,EAAE,SAAXA,SAASA,CAAGC,CAAwC,EAAK;UACvD,IAAI,CAACjB,KAAK,IAAIiB,CAAC,CAAClB,GAAG,KAAK,QAAQ,EAAE;YAChCW,OAAO,CAAC,CAAC;UACX;QACF,CAAC;QACDQ,SAAS,EAAE;MAAI;IAEnB;EAAC;IAAAnB,GAAA;IAAAC,KAAA,EAED,SAAAmB,aAAaA,CAAA,EAAG;MACd,IAAAC,KAAA,GAAoB,IAAI,CAAChB,OAAO;QAAxBM,OAAO,GAAAU,KAAA,CAAPV,OAAO;MAEf,OAAO;QACLW,OAAO,EAAEX;MACX,CAAC;IACH;EAAC;IAAAX,GAAA;IAAAC,KAAA,EAED,SAAAsB,MAAMA,CAAA,EAAG;MAAA,IAAAC,IAAA,QAAAnB,OAAA;MACP,oBAAOb,KAAA,CAAAiC,aAAA,CAAclC,KAAK,EAAAmC,YAAA;QAAA,KAAI,MAAM;QAAA,UAAS;MAAK,GAAAF,IAAA,CAAG,CAAC;IACxD;EAAC;AAAA,EArC8BnC,SAAS;AAAAsC,eAAA,CAApClC,kBAAkB,iBACD,gBAAgB;AAuCvC,SAASmC,KAAKA,CAAA,EAAG;EAAA,IAAAC,KAAA,GAAAC,YAAA;EACf,oBAAOtC,KAAA,CAAAiC,aAAA,CAActC,UAAU,EAAA4C,aAAA,KAAAF,KAAA,CAAG,CAAC;AACrC;AAEA,IAAMG,cAAc,GAAG5C,eAAe,CAACK,kBAAkB,EAAE;EACzDwC,KAAK,EAAE1C,KAAK,CAAC0C,KAAK;EAClBC,KAAK,EAAE3C,KAAK,CAAC2C,KAAK;EAClBN,KAAK,EAALA;AACF,CAAC,CAAC;AAEF,eAAeI,cAAc","ignoreList":[]}
@@ -59,10 +59,10 @@ var AddFilterInputRoot = /* @__PURE__ */ (function(_Component) {
59
59
  }]);
60
60
  })(Component);
61
61
  _defineProperty(AddFilterInputRoot, "displayName", "AddFilterInput");
62
- var Clear = function Clear2() {
62
+ function Clear() {
63
63
  var _ref2 = arguments[0];
64
64
  return /* @__PURE__ */ React.createElement(ButtonLink, assignProps({}, _ref2));
65
- };
65
+ }
66
66
  var AddFilterInput = createComponent(AddFilterInputRoot, {
67
67
  Value: Input.Value,
68
68
  Addon: Input.Addon,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/add-filter",
3
3
  "description": "Semrush Add Filter component",
4
- "version": "16.6.3",
4
+ "version": "16.7.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,17 +14,17 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/select": "16.1.12",
18
- "@semcore/icon": "16.7.3",
19
- "@semcore/button": "16.0.12",
20
- "@semcore/flex-box": "16.0.11",
21
- "@semcore/dropdown-menu": "16.1.14",
22
- "@semcore/dropdown": "16.1.3",
23
- "@semcore/input": "16.1.1",
24
- "@semcore/base-trigger": "16.4.4"
17
+ "@semcore/select": "16.2.0-prerelease.0",
18
+ "@semcore/icon": "16.8.0-prerelease.0",
19
+ "@semcore/button": "16.1.0-prerelease.0",
20
+ "@semcore/flex-box": "16.1.0-prerelease.0",
21
+ "@semcore/dropdown-menu": "16.3.0-prerelease.0",
22
+ "@semcore/dropdown": "16.2.0-prerelease.0",
23
+ "@semcore/input": "16.2.0-prerelease.0",
24
+ "@semcore/base-trigger": "16.5.0-prerelease.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@semcore/base-components": "^16.0.0"
27
+ "@semcore/base-components": "^16.6.0-prerelease.0"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "directory": "semcore/add-filter"
33
33
  },
34
34
  "devDependencies": {
35
- "@semcore/core": "16.5.1",
35
+ "@semcore/core": "16.6.0-prerelease.0",
36
36
  "@semcore/testing-utils": "1.0.0"
37
37
  },
38
38
  "scripts": {