nntc-ui 0.0.23 → 0.0.25

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.
@@ -29,7 +29,7 @@ import {
29
29
  TableChartIcon,
30
30
  UploadIcon,
31
31
  WellIcon
32
- } from "../chunk-4HWWEHXN.mjs";
32
+ } from "../chunk-KAV5YKL7.js";
33
33
  export {
34
34
  AddIcon,
35
35
  ArrowDropDownIcon,
@@ -221,6 +221,7 @@ interface Props$8<T> {
221
221
  filled?: boolean;
222
222
  isVertical?: boolean;
223
223
  disableBorder?: boolean;
224
+ allowDeselect?: boolean;
224
225
  }
225
226
  declare function Tabs<T>(props: UiProps<Props$8<T>>): react_jsx_runtime.JSX.Element;
226
227
 
@@ -16,7 +16,7 @@ import {
16
16
  SortDownIcon,
17
17
  SortUpIcon,
18
18
  __export
19
- } from "./chunk-4HWWEHXN.mjs";
19
+ } from "./chunk-KAV5YKL7.js";
20
20
 
21
21
  // src/components/common/Button/Button.tsx
22
22
  import classnames from "classnames";
@@ -2020,15 +2020,20 @@ function Tabs(props) {
2020
2020
  filled: filled7 = false,
2021
2021
  isVertical = false,
2022
2022
  disableBorder: disableBorder2 = false,
2023
+ allowDeselect = false,
2023
2024
  classes
2024
2025
  } = props;
2025
2026
  const [isMounted, setIsMounted] = useState8(false);
2026
2027
  const [selectedTab, setSelectedTab] = useState8(defaultSelected);
2027
2028
  const handleClick = (newValue) => () => {
2028
- setSelectedTab(newValue);
2029
+ if (allowDeselect && selectedTab === newValue) {
2030
+ setSelectedTab(void 0);
2031
+ } else {
2032
+ setSelectedTab(newValue);
2033
+ }
2029
2034
  };
2030
2035
  useEffect5(() => {
2031
- if (isMounted && !!selectedTab) {
2036
+ if (isMounted) {
2032
2037
  onChange?.(selectedTab);
2033
2038
  }
2034
2039
  if (!isMounted) {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "nntc-ui",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "author": "NNTC",
5
5
  "description": "React UI-kit for NNTC",
6
+ "type": "module",
6
7
  "exports": {
7
8
  ".": {
8
9
  "import": "./index.js",
File without changes
File without changes