Skip to content

Commit c91a0c4

Browse files
committed
fix: add default for Tab type in collapsible list
1 parent 6ef313f commit c91a0c4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.0.1-beta-1",
3+
"version": "1.0.2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/CollapsibleList/CollapsibleList.types.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import React from 'react'
22
import { TippyProps } from '@tippyjs/react'
33
import { NavLinkProps } from 'react-router-dom'
44

5-
interface ButtonTab extends Required<Pick<NavLinkProps, 'isActive'>> {
5+
interface ButtonTab {
6+
/**
7+
* Is tab active ( for button tab )
8+
*/
9+
isActive: boolean
610
/**
711
* The callback function to handle click events on the button.
812
*/
@@ -19,7 +23,6 @@ interface NavLinkTab extends Pick<NavLinkProps, 'isActive'> {
1923
* The callback function to handle click events on the nav link.
2024
*/
2125
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void
22-
isActive?: never
2326
}
2427

2528
export type TabOptions = 'button' | 'navLink'
@@ -58,7 +61,7 @@ export type CollapsibleListItem<TabType extends TabOptions = 'navLink'> = Condit
5861
}
5962
}
6063

61-
export interface CollapsibleListConfig<TabType extends 'button' | 'navLink'> {
64+
export interface CollapsibleListConfig<TabType extends 'button' | 'navLink' = 'navLink'> {
6265
/**
6366
* The unique identifier for the collapsible list.
6467
*/
@@ -103,7 +106,7 @@ export interface CollapsibleListConfig<TabType extends 'button' | 'navLink'> {
103106
isExpanded?: boolean
104107
}
105108

106-
export interface CollapsibleListProps<TabType extends TabOptions> {
109+
export interface CollapsibleListProps<TabType extends TabOptions = 'navLink'> {
107110
/**
108111
* An array of collapsible list configurations.
109112
*/

0 commit comments

Comments
 (0)