Skip to content

Commit 2941a97

Browse files
committed
Merge branch 'main' into feat/create-plugin
2 parents 028fc29 + 0fe0cec commit 2941a97

32 files changed

+956
-286
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": "0.1.16-beta-7",
3+
"version": "0.1.18-beta-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/Icon/ic-caret-down.svg

Lines changed: 16 additions & 0 deletions
Loading

src/Assets/Icon/ic-circle.svg

Lines changed: 9 additions & 0 deletions
Loading

src/Assets/Icon/ic-exit-fullscreen.svg

Lines changed: 2 additions & 15 deletions
Loading

src/Assets/Icon/ic-fullscreen.svg

Lines changed: 2 additions & 2 deletions
Loading

src/Assets/Icon/ic-in-progress.svg

Lines changed: 10 additions & 0 deletions
Loading

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { useState, useEffect, useCallback } from 'react'
1818
import Tippy from '@tippyjs/react'
19-
import { copyToClipboard, noop } from '../Helper'
19+
import { copyToClipboard, noop, stopPropagation } from '../Helper'
2020
import ClipboardProps from './types'
2121
import { ReactComponent as ICCopy } from '../../Assets/Icon/ic-copy.svg'
2222
import { ReactComponent as Check } from '../../Assets/Icon/ic-check.svg'
@@ -42,10 +42,16 @@ export default function ClipboardButton({
4242
const [copied, setCopied] = useState<boolean>(false)
4343
const [enableTippy, setEnableTippy] = useState<boolean>(false)
4444

45-
const handleTextCopied = () => setCopied(true)
45+
const handleTextCopied = () => {setCopied(true)}
4646
const handleEnableTippy = () => setEnableTippy(true)
4747
const handleDisableTippy = () => setEnableTippy(false)
48-
const handleCopyContent = useCallback(() => copyToClipboard(content, handleTextCopied), [content])
48+
const handleCopyContent = useCallback(
49+
(e?) => {
50+
if(e) stopPropagation(e)
51+
copyToClipboard(content, handleTextCopied)
52+
},
53+
[content],
54+
)
4955

5056
useEffect(() => {
5157
if (!copied) return

src/Common/SearchBar/SearchBar.component.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
*/
1616

1717
import { ChangeEvent, useCallback, useRef, useState, KeyboardEvent, useEffect } from 'react'
18+
import { ComponentSizeType } from '@Shared/constants'
1819
import { ReactComponent as Search } from '@Icons/ic-search.svg'
1920
import { ReactComponent as Clear } from '@Icons/ic-error-cross.svg'
2021
import { SearchBarProps } from './types'
2122
import './searchBar.scss'
2223
import { debounce } from '../Helper'
24+
import { getSearchBarHeightFromSize } from './utils'
2325

2426
/**
2527
* Generic search input component with support for enter based and debounced search
@@ -65,6 +67,7 @@ const SearchBar = ({
6567
debounceTimeout = 300,
6668
dataTestId = 'search-bar',
6769
noBackgroundAndBorder = false,
70+
size = ComponentSizeType.medium,
6871
}: SearchBarProps) => {
6972
const [showClearButton, setShowClearButton] = useState(!!initialSearchText)
7073
const inputRef = useRef<HTMLInputElement>()
@@ -116,7 +119,7 @@ const SearchBar = ({
116119
return (
117120
<div className={containerClassName}>
118121
<div
119-
className={`search-bar ${noBackgroundAndBorder ? 'dc__no-border dc__no-background dc__hover-n50' : 'bc-n50 en-2 dc__hover-border-n300'} focus-within-border-b5 dc__block w-100 min-w-200 dc__position-rel br-4 bw-1 h-32`}
122+
className={`search-bar ${noBackgroundAndBorder ? 'dc__no-border dc__no-background dc__hover-n50' : 'bc-n50 en-2 dc__hover-border-n300'} focus-within-border-b5 dc__block w-100 min-w-200 dc__position-rel br-4 bw-1 ${getSearchBarHeightFromSize(size)}`}
120123
>
121124
<Search className="search-bar__icon dc__position-abs icon-color-n6 icon-dim-16" />
122125
<input

src/Common/SearchBar/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { ComponentSizeType } from '@Shared/constants'
18+
1719
export interface SearchBarProps {
1820
/**
1921
* Initial search text
@@ -55,4 +57,10 @@ export interface SearchBarProps {
5557
* Hide the background and border of the search
5658
*/
5759
noBackgroundAndBorder?: boolean
60+
/**
61+
* Height of the searchbar
62+
*
63+
* @default 'ComponentSizeType.medium'
64+
*/
65+
size?: ComponentSizeType.medium | ComponentSizeType.large
5866
}

0 commit comments

Comments
 (0)