@devtron-labs/devtron-fe-common-lib 0.0.54 → 0.0.55-beta-2

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.
Files changed (46) hide show
  1. package/.eslintrc.js +16 -84
  2. package/.github/workflows/release-package.yml +3 -2
  3. package/dist/Common/Common.service.d.ts +2 -2
  4. package/dist/Common/Constants.d.ts +0 -1
  5. package/dist/Common/DebouncedSearch/DebouncedSearch.d.ts +0 -2
  6. package/dist/Common/Grid/Grid.d.ts +1 -1
  7. package/dist/Common/Grid/types.d.ts +2 -2
  8. package/dist/Common/Helper.d.ts +4 -5
  9. package/dist/Common/Hooks/index.d.ts +0 -1
  10. package/dist/Common/Types.d.ts +2 -15
  11. package/dist/Common/index.d.ts +0 -2
  12. package/dist/index.js +225 -474
  13. package/package.json +3 -21
  14. package/src/Common/Constants.ts +1 -3
  15. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +0 -2
  16. package/src/Common/Grid/Grid.tsx +2 -7
  17. package/src/Common/Grid/types.ts +1 -3
  18. package/src/Common/Helper.tsx +23 -31
  19. package/src/Common/Hooks/index.ts +0 -1
  20. package/src/Common/Types.ts +2 -15
  21. package/src/Common/index.ts +0 -2
  22. package/.eslintignore +0 -96
  23. package/.github/pull_request_template.md +0 -25
  24. package/.github/workflows/ci.yml +0 -31
  25. package/.husky/pre-commit +0 -5
  26. package/.lintstagedrc +0 -3
  27. package/.nvmrc +0 -1
  28. package/dist/Common/DraggableWrapper/DraggableButton.d.ts +0 -3
  29. package/dist/Common/DraggableWrapper/DraggableWrapper.d.ts +0 -9
  30. package/dist/Common/DraggableWrapper/index.d.ts +0 -3
  31. package/dist/Common/DraggableWrapper/types.d.ts +0 -23
  32. package/dist/Common/Hooks/UseWindowSize/UseWindowSize.d.ts +0 -4
  33. package/dist/Common/SearchBar/SearchBar.component.d.ts +0 -39
  34. package/dist/Common/SearchBar/index.d.ts +0 -2
  35. package/dist/Common/SearchBar/types.d.ts +0 -35
  36. package/src/Assets/Icon/ic-drag.svg +0 -8
  37. package/src/Assets/Icon/ic-search.svg +0 -6
  38. package/src/Common/DraggableWrapper/DraggableButton.tsx +0 -14
  39. package/src/Common/DraggableWrapper/DraggableWrapper.tsx +0 -116
  40. package/src/Common/DraggableWrapper/index.ts +0 -3
  41. package/src/Common/DraggableWrapper/types.ts +0 -27
  42. package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +0 -31
  43. package/src/Common/SearchBar/SearchBar.component.tsx +0 -120
  44. package/src/Common/SearchBar/index.ts +0 -2
  45. package/src/Common/SearchBar/searchBar.scss +0 -31
  46. package/src/Common/SearchBar/types.ts +0 -36
package/package.json CHANGED
@@ -1,16 +1,12 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.54",
3
+ "version": "0.0.55-beta-2",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
- "prepare": "node -e \"try { require('husky').install() } catch (e) {}\"",
8
- "lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
9
- "lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
10
7
  "test": "exit 0",
11
8
  "build-lib": "rollup -c --bundleConfigAsCjs",
12
- "build-watch": "rollup -c --bundleConfigAsCjs -w",
13
- "lint-staged": "lint-staged"
9
+ "build-watch": "rollup -c --bundleConfigAsCjs -w"
14
10
  },
15
11
  "repository": {
16
12
  "type": "git",
@@ -34,20 +30,7 @@
34
30
  "@types/react": "17.0.39",
35
31
  "@types/react-dom": "17.0.13",
36
32
  "@types/react-router-dom": "^5.3.3",
37
- "@typescript-eslint/eslint-plugin": "^6.17.0",
38
- "@typescript-eslint/parser": "^6.17.0",
39
- "eslint": "^8.56.0",
40
- "eslint-config-airbnb": "^19.0.4",
41
- "eslint-config-prettier": "^9.1.0",
42
- "eslint-plugin-import": "^2.29.1",
43
- "eslint-plugin-jsx-a11y": "^6.8.0",
44
- "eslint-plugin-prettier": "^5.1.2",
45
- "eslint-plugin-react": "^7.33.2",
46
- "eslint-plugin-react-hooks": "^4.6.0",
47
- "husky": "^7.0.4",
48
- "lint-staged": "^12.5.0",
49
33
  "moment": "^2.29.4",
50
- "prettier": "^3.1.1",
51
34
  "react-select": "5.2.2",
52
35
  "react-toastify": "^8.2.0",
53
36
  "rollup": "^3.10.0",
@@ -64,8 +47,7 @@
64
47
  "react": "^17.0.2",
65
48
  "react-dom": "^17.0.2",
66
49
  "react-router": "^5.3.0",
67
- "react-router-dom": "^5.3.0",
68
- "react-draggable": "^4.4.5"
50
+ "react-router-dom": "^5.3.0"
69
51
  },
70
52
  "dependencies": {
71
53
  "fast-json-patch": "^3.1.1",
@@ -240,6 +240,4 @@ export const RepositoryAction = {
240
240
  CONTAINER: "CONTAINER",
241
241
  CHART_PULL: "CHART_PULL",
242
242
  CHART_PUSH: "CHART_PUSH"
243
- }
244
-
245
- export const MAX_Z_INDEX = 2147483647
243
+ }
@@ -4,8 +4,6 @@ import { ReactComponent as ICClear } from '../../Assets/Icon/ic-error-cross.svg'
4
4
  import { DebouncedSearchProps } from './Types'
5
5
 
6
6
  /**
7
- * @deprecated Use `SearchBar` component instead.
8
- *
9
7
  * @param onSearch - Callback function to be called on search
10
8
  * @param Icon - (Optional) Icon to be shown before the input
11
9
  * @param iconClass - (Optional) Class for the icon
@@ -10,7 +10,6 @@ export default function Grid({
10
10
  containerClass = '',
11
11
  itemClass = '',
12
12
  children,
13
- ...containerDivProps
14
13
  }: GridProps) {
15
14
  const containerStyles = container ? { gap: spacing + 'px' } : {}
16
15
 
@@ -26,18 +25,14 @@ export default function Grid({
26
25
  }
27
26
 
28
27
  return (
29
- <div className={`p-0 ${itemClass}`} style={itemStyles} {...containerDivProps}>
28
+ <div className={`p-0 ${itemClass}`} style={itemStyles}>
30
29
  {children}
31
30
  </div>
32
31
  )
33
32
  }
34
33
 
35
34
  return (
36
- <div
37
- className={`flex-wrap flexbox ${container ? containerClass : ''}`}
38
- style={containerStyles}
39
- {...containerDivProps}
40
- >
35
+ <div className={`flex-wrap flexbox ${container ? containerClass : ''}`} style={containerStyles}>
41
36
  {children}
42
37
  </div>
43
38
  )
@@ -1,6 +1,4 @@
1
- import { HTMLAttributes } from 'react'
2
-
3
- export interface GridProps extends HTMLAttributes<HTMLDivElement> {
1
+ export interface GridProps {
4
2
  container?: boolean
5
3
  spacing?: number
6
4
  item?: boolean
@@ -499,18 +499,20 @@ export const getFilteredChartVersions = (charts, selectedChartType) => {
499
499
  chartRefId: item.chartRefId,
500
500
  }))
501
501
  }
502
- function removeEmptyObjectKeysAndNullValues(obj) {
503
- // It recursively removes empty object keys and array values that are null
502
+
503
+ function removeEmptyObjectKeysAndNullValues(obj, originaljsonCopy) {
504
+ // It recursively removes empty object keys and empty array keys
504
505
  for (let key in obj) {
505
506
  if (Array.isArray(obj[key])) {
506
- if (obj[key].length === 0) continue
507
- obj[key] = obj[key].filter((item) => item !== null)
508
507
  // Check if the array is empty
509
- if (obj[key].length === 0) {
510
- delete obj[key] // Delete the key if the array is empty
508
+ if (obj[key].length === 0 && originaljsonCopy[key].length !== 0) {
509
+ delete obj[key]
511
510
  }
512
511
  } else if (obj[key] && typeof obj[key] === 'object') {
513
- if (removeEmptyObjectKeysAndNullValues(obj[key])) {
512
+ if (
513
+ removeEmptyObjectKeysAndNullValues(obj[key], originaljsonCopy[key]) &&
514
+ Object.keys(originaljsonCopy[key]).length !== 0
515
+ ) {
514
516
  delete obj[key]
515
517
  }
516
518
  } else if (obj[key] === undefined) {
@@ -520,20 +522,25 @@ function removeEmptyObjectKeysAndNullValues(obj) {
520
522
  return Object.keys(obj).length === 0
521
523
  }
522
524
 
523
- export function getUnlockedJSON(json, jsonPathArray) {
525
+ export function getUnlockedJSON(json, jsonPathArray, removeParentKeysAndEmptyArrays = false) {
526
+ if (!jsonPathArray.length) return { newDocument: json, removedPatches: [] }
527
+
524
528
  const jsonCopy = JSON.parse(JSON.stringify(json))
529
+ const originaljsonCopy = JSON.parse(JSON.stringify(json))
530
+ let removedPatches = []
525
531
  let patches = jsonPathArray.flatMap((jsonPath) => {
526
532
  const pathsToRemove = JSONPath({ path: jsonPath, json: jsonCopy, resultType: 'all' })
527
- return pathsToRemove.map((result) =>
528
- Array.isArray(result.parent)
529
- ? { op: 'replace', path: result.pointer, value: null }
530
- : { op: 'remove', path: result.pointer },
531
- )
533
+ //reversing patches to handle correct array index deletion
534
+ pathsToRemove.reverse()
535
+ return pathsToRemove.map((result) => {
536
+ //storing removed patches to have functionality of undo
537
+ removedPatches.push({ op: 'add', path: result.pointer, value: result.value })
538
+ return { op: 'remove', path: result.pointer }
539
+ })
532
540
  })
533
541
  let newDocument = jsonpatch.applyPatch(jsonCopy, patches).newDocument
534
-
535
- removeEmptyObjectKeysAndNullValues(newDocument)
536
- return newDocument
542
+ if (removeParentKeysAndEmptyArrays) removeEmptyObjectKeysAndNullValues(newDocument, originaljsonCopy)
543
+ return { newDocument, removedPatches: removedPatches.reverse() }
537
544
  }
538
545
 
539
546
  export function getLockedJSON(json, jsonPathArray: string[]) {
@@ -559,18 +566,3 @@ export function getLockedJSON(json, jsonPathArray: string[]) {
559
566
  return resultJson['$']
560
567
  }
561
568
 
562
- /**
563
- * Returns a debounced variant of the function
564
- */
565
- export const debounce = (func, timeout = 500) => {
566
- let timer
567
-
568
- return function (this, ...args) {
569
- const context = this
570
- if (timer) clearTimeout(timer)
571
- timer = setTimeout(() => {
572
- timer = null
573
- func.apply(context, args)
574
- }, timeout)
575
- }
576
- }
@@ -1,3 +1,2 @@
1
1
  export { useSuperAdmin } from './UseSuperAdmin/UseSuperAdmin'
2
2
  export { useClickOutside } from './UseClickOutside/UseClickOutside'
3
- export { useWindowSize } from './UseWindowSize/UseWindowSize'
@@ -3,23 +3,10 @@ import { Placement } from 'tippy.js'
3
3
  import { ImageComment, ReleaseTag } from './ImageTags.Types'
4
4
  import { DockerConfigOverrideType, TaskErrorObj } from '.'
5
5
 
6
- /**
7
- * Generic response type object with support for overriding the result type
8
- *
9
- * @example Default usage:
10
- * ```ts
11
- * interface UserResponse extends ResponseType {}
12
- * ```
13
- *
14
- * @example Override the response type:
15
- * ```ts
16
- * interface UserResponse extends ResponseType<Record<string, string>> {}
17
- * ```
18
- */
19
- export interface ResponseType<T = any> {
6
+ export interface ResponseType {
20
7
  code: number
21
8
  status: string
22
- result?: T
9
+ result?: any
23
10
  errors?: any
24
11
  }
25
12
 
@@ -26,7 +26,6 @@ export * from './Common.service'
26
26
  export * from './Checkbox'
27
27
  export { default as EmptyState } from './EmptyState/EmptyState'
28
28
  export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
29
- export * from './SearchBar'
30
29
  export { default as Toggle } from './Toggle/Toggle'
31
30
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable'
32
31
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup'
@@ -46,4 +45,3 @@ export * from './DevtronProgressing'
46
45
  export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector'
47
46
  export * from './AddCDButton'
48
47
  export * from './CustomInput'
49
- export * from './DraggableWrapper'
package/.eslintignore DELETED
@@ -1,96 +0,0 @@
1
- .eslintrc.js
2
-
3
- # Files with ESLint errors/warnings
4
- src/Common/AddCDButton/AddCDButton.tsx
5
- src/Common/AddCDButton/utils.tsx
6
- src/Common/Api.ts
7
- src/Common/AppStatus/AppStatus.tsx
8
- src/Common/AppStatus/index.ts
9
- src/Common/AppStatus/utils.ts
10
- src/Common/BreadCrumb/BreadCrumb.tsx
11
- src/Common/BreadCrumb/BreadcrumbStore.tsx
12
- src/Common/BreadCrumb/Types.ts
13
- src/Common/CIPipeline.Types.ts
14
- src/Common/ChartVersionAndTypeSelector.tsx
15
- src/Common/Checkbox.tsx
16
- src/Common/ClipboardButton/ClipboardButton.tsx
17
- src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx
18
- src/Common/Common.service.ts
19
- src/Common/Constants.ts
20
- src/Common/CustomInput/CustomInput.tsx
21
- src/Common/CustomInput/Types.ts
22
- src/Common/CustomInput/index.ts
23
- src/Common/CustomTagSelector/PropagateTagInfo.tsx
24
- src/Common/CustomTagSelector/ResizableTagTextArea.tsx
25
- src/Common/CustomTagSelector/TagDetails.tsx
26
- src/Common/CustomTagSelector/TagLabelSelect.tsx
27
- src/Common/CustomTagSelector/TagLabelValueSelector.tsx
28
- src/Common/CustomTagSelector/TagSelector.utils.ts
29
- src/Common/CustomTagSelector/Types.ts
30
- src/Common/CustomTagSelector/ValidationRules.ts
31
- src/Common/CustomTagSelector/index.ts
32
- src/Common/DebouncedSearch/DebouncedSearch.tsx
33
- src/Common/DebouncedSearch/Utils.ts
34
- src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx
35
- src/Common/DeleteComponentModal/DeleteComponent.tsx
36
- src/Common/DeleteComponentModal/types.ts
37
- src/Common/DevtronProgressing/DevtronProgressing.tsx
38
- src/Common/Dialogs/ConfirmationDialog.tsx
39
- src/Common/Dialogs/DeleteDialog.tsx
40
- src/Common/Dialogs/DialogForm.tsx
41
- src/Common/Dialogs/ForceDeleteDialog.tsx
42
- src/Common/Dialogs/Types.ts
43
- src/Common/Dialogs/index.ts
44
- src/Common/DraggableWrapper/DraggableButton.tsx
45
- src/Common/DraggableWrapper/DraggableWrapper.tsx
46
- src/Common/Drawer/Drawer.tsx
47
- src/Common/EmptyState/EmptyState.tsx
48
- src/Common/EmptyState/GenericEmptyState.tsx
49
- src/Common/Error.tsx
50
- src/Common/ErrorScreenNotFound.tsx
51
- src/Common/Grid/Grid.tsx
52
- src/Common/Helper.tsx
53
- src/Common/Hooks/UseClickOutside/UseClickOutside.tsx
54
- src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx
55
- src/Common/Hooks/UseWindowSize/UseWindowSize.tsx
56
- src/Common/ImageTags.Types.ts
57
- src/Common/ImageTags.tsx
58
- src/Common/InfoColorBar/InfoColourbar.tsx
59
- src/Common/Modals/Modal.tsx
60
- src/Common/Modals/OpaqueModal.tsx
61
- src/Common/Modals/VisibleModal.tsx
62
- src/Common/Modals/VisibleModal2.tsx
63
- src/Common/MultiSelectCustomization.tsx
64
- src/Common/Policy.Types.ts
65
- src/Common/PopupMenu.tsx
66
- src/Common/Progressing.tsx
67
- src/Common/RJSF/Form.tsx
68
- src/Common/RJSF/common/FieldRow.tsx
69
- src/Common/RJSF/config.ts
70
- src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx
71
- src/Common/RJSF/templates/ArrayFieldTemplate.tsx
72
- src/Common/RJSF/templates/BaseInput.tsx
73
- src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx
74
- src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx
75
- src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx
76
- src/Common/RJSF/templates/Description.tsx
77
- src/Common/RJSF/templates/Field.tsx
78
- src/Common/RJSF/templates/FieldErrorTemplate.tsx
79
- src/Common/RJSF/templates/ObjectFieldTemplate.tsx
80
- src/Common/RJSF/templates/TitleField.tsx
81
- src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx
82
- src/Common/RJSF/utils.ts
83
- src/Common/RJSF/widgets/Checkbox.tsx
84
- src/Common/RJSF/widgets/Select.tsx
85
- src/Common/RadioGroup.tsx
86
- src/Common/RadioGroup/RadioGroup.tsx
87
- src/Common/Reload.tsx
88
- src/Common/ResizableTextarea.tsx
89
- src/Common/Security/ScanVulnerabilitiesTable.tsx
90
- src/Common/ServerError.ts
91
- src/Common/TippyCustomized.tsx
92
- src/Common/ToastBody.tsx
93
- src/Common/Toggle/Toggle.tsx
94
- src/Common/Types.ts
95
- src/custom.d.ts
96
- src/index.ts
@@ -1,25 +0,0 @@
1
- # Description
2
-
3
- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4
-
5
- ## Type of change
6
-
7
- - [ ] Bug fix (non-breaking change which fixes an issue)
8
- - [ ] New feature (non-breaking change which adds functionality)
9
- - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10
- - [ ] This change requires a documentation update
11
-
12
- ## How Has This Been Tested?
13
-
14
- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
15
-
16
- - [ ] Test A
17
- - [ ] Test B
18
-
19
- ## Checklist
20
-
21
- - [ ] The title of the PR states what changed and the related issues number (used for the release note).
22
- - [ ] Does this PR require documentation updates?
23
- - [ ] I've updated documentation as required by this PR.
24
- - [ ] I have performed a self-review of my own code
25
- - [ ] I have commented my code, particularly in hard-to-understand areas
@@ -1,31 +0,0 @@
1
- name: Common Lib CI
2
-
3
- on:
4
- pull_request:
5
- types:
6
- - opened
7
- - synchronize
8
- - edited
9
- - reopened
10
-
11
- jobs:
12
- ci:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - name: Checkout repository
16
- uses: actions/checkout@v3
17
-
18
- - name: Use Node.js
19
- uses: actions/setup-node@v3
20
- with:
21
- node-version-file: '.nvmrc'
22
- cache: 'npm'
23
-
24
- - name: Install dependencies
25
- run: npm ci
26
-
27
- - name: Check linting issues
28
- run: npm run lint
29
-
30
- - name: Build Lib
31
- run: npm run build-lib
package/.husky/pre-commit DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx tsc --noEmit
5
- npm run lint-staged
package/.lintstagedrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "*.{js,jsx,ts,tsx}": ["npx eslint"]
3
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v16.13.0
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { DraggableButtonProps } from './types';
3
- export default function DraggableButton({ dragClassName }: DraggableButtonProps): JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { DraggableWrapperProps } from './types';
3
- /**
4
- * TODO: import it as lazy, after it is supported in common
5
- * 1. If using react select please use menuPlacement='auto'
6
- * 2. dragSelector will be used to identify the grabbable button that will grab the div to drag
7
- * 3. parentRef is the reference point from which we will derive the base top:0 ,left: 0 position
8
- */
9
- export default function DraggableWrapper({ children, zIndex, positionVariant, dragSelector, parentRef, boundaryGap, childDivProps, }: DraggableWrapperProps): JSX.Element;
@@ -1,3 +0,0 @@
1
- export { default as DraggableWrapper } from './DraggableWrapper';
2
- export { default as DraggableButton } from './DraggableButton';
3
- export * from './types';
@@ -1,23 +0,0 @@
1
- import { HTMLAttributes, ReactNode, RefObject } from 'react';
2
- export declare enum DraggablePositionVariant {
3
- PARENT_BOTTOM_CENTER = "PARENT_BOTTOM_CENTER",
4
- SCREEN_BOTTOM_CENTER = "SCREEN_BOTTOM_CENTER"
5
- }
6
- export interface DraggableWrapperProps {
7
- children: ReactNode;
8
- zIndex?: number;
9
- positionVariant?: DraggablePositionVariant;
10
- /**
11
- * dragSelector (class - (append with .), id, etc) will be used to identify the grabbable button that will grab the div to drag
12
- */
13
- dragSelector: string;
14
- parentRef?: RefObject<HTMLDivElement>;
15
- boundaryGap?: number;
16
- childDivProps?: HTMLAttributes<HTMLDivElement>;
17
- }
18
- /**
19
- * dragClassName is the class that we feed to Draggable to identify dragging buttons
20
- */
21
- export interface DraggableButtonProps {
22
- dragClassName: string;
23
- }
@@ -1,4 +0,0 @@
1
- export declare const useWindowSize: () => {
2
- width: number;
3
- height: number;
4
- };
@@ -1,39 +0,0 @@
1
- /// <reference types="react" />
2
- import { SearchBarProps } from './types';
3
- import './searchBar.scss';
4
- /**
5
- * Generic search input component with support for enter based and debounced search
6
- * Note: The component is uncontrolled
7
- *
8
- * @example Usage with default debounced search
9
- * ```tsx
10
- * <SearchBar handleSearchChange={triggerSearchApi} shouldDebounce />
11
- * ```
12
- *
13
- * @example Initial search text
14
- * ```tsx
15
- * <SearchBar initialSearchText="Keyword" />
16
- * ```
17
- *
18
- * @example Custom width
19
- * ```tsx
20
- * <SearchBar containerClassName="w-300" />
21
- * ```
22
- *
23
- * @example Trigger search on enter key press
24
- * ```tsx
25
- * <SearchBar handleEnter={triggerSearchApi} />
26
- * ```
27
- *
28
- * @example Custom timeout for debounced search
29
- * ```tsx
30
- * <SearchBar handleSearchChange={triggerSearchApi} shouldDebounce debounceTimeout={500} />
31
- * ```
32
- *
33
- * @example Placeholder for the search
34
- * ```tsx
35
- * <SearchBar inputProps={{ placeholder: 'Enter search text' }} />
36
- * ```
37
- */
38
- declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, }: SearchBarProps) => JSX.Element;
39
- export default SearchBar;
@@ -1,2 +0,0 @@
1
- export { default as SearchBar } from './SearchBar.component';
2
- export type { SearchBarProps } from './types';
@@ -1,35 +0,0 @@
1
- import { InputHTMLAttributes } from 'react';
2
- export interface SearchBarProps {
3
- /**
4
- * Initial search text
5
- *
6
- * @default ''
7
- */
8
- initialSearchText?: string;
9
- /**
10
- * Search handler for the search input
11
- */
12
- handleSearchChange?: (searchText: string) => void;
13
- /**
14
- * Enter event handler for the search input
15
- */
16
- handleEnter?: (searchText: string) => void;
17
- /**
18
- * Input props for the search input
19
- */
20
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
21
- /**
22
- * Class name for the container; can be used for handling width
23
- */
24
- containerClassName?: string;
25
- /**
26
- * If true, the change handler would be triggered with debounce
27
- *
28
- * @default false
29
- */
30
- shouldDebounce?: boolean;
31
- /**
32
- * Timeout for the debounce handler to be triggered
33
- */
34
- debounceTimeout?: number;
35
- }
@@ -1,8 +0,0 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M10.3335 9.33325C10.8858 9.33325 11.3335 8.88554 11.3335 8.33325C11.3335 7.78097 10.8858 7.33325 10.3335 7.33325C9.78121 7.33325 9.3335 7.78097 9.3335 8.33325C9.3335 8.88554 9.78121 9.33325 10.3335 9.33325Z" fill="#596168"/>
3
- <path d="M5.66675 9.33325C6.21903 9.33325 6.66675 8.88554 6.66675 8.33325C6.66675 7.78097 6.21903 7.33325 5.66675 7.33325C5.11446 7.33325 4.66675 7.78097 4.66675 8.33325C4.66675 8.88554 5.11446 9.33325 5.66675 9.33325Z" fill="#596168"/>
4
- <path d="M10.3335 5.33325C10.8858 5.33325 11.3335 4.88554 11.3335 4.33325C11.3335 3.78097 10.8858 3.33325 10.3335 3.33325C9.78121 3.33325 9.3335 3.78097 9.3335 4.33325C9.3335 4.88554 9.78121 5.33325 10.3335 5.33325Z" fill="#596168"/>
5
- <path d="M5.66675 5.33325C6.21903 5.33325 6.66675 4.88554 6.66675 4.33325C6.66675 3.78097 6.21903 3.33325 5.66675 3.33325C5.11446 3.33325 4.66675 3.78097 4.66675 4.33325C4.66675 4.88554 5.11446 5.33325 5.66675 5.33325Z" fill="#596168"/>
6
- <path d="M10.3335 13.3333C10.8858 13.3333 11.3335 12.8855 11.3335 12.3333C11.3335 11.781 10.8858 11.3333 10.3335 11.3333C9.78121 11.3333 9.3335 11.781 9.3335 12.3333C9.3335 12.8855 9.78121 13.3333 10.3335 13.3333Z" fill="#596168"/>
7
- <path d="M5.66675 13.3333C6.21903 13.3333 6.66675 12.8855 6.66675 12.3333C6.66675 11.781 6.21903 11.3333 5.66675 11.3333C5.11446 11.3333 4.66675 11.781 4.66675 12.3333C4.66675 12.8855 5.11446 13.3333 5.66675 13.3333Z" fill="#596168"/>
8
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
- <g fill="none" fill-rule="evenodd">
3
- <path d="M0 0h24v24H0z"/>
4
- <path fill="#959BA1" d="M10 2a8 8 0 0 1 6.32 12.905l5.044 5.045a1 1 0 1 1-1.414 1.414l-5.045-5.043A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z"/>
5
- </g>
6
- </svg>
@@ -1,14 +0,0 @@
1
- import React from 'react'
2
- import { ReactComponent as ICDrag } from '../../Assets/Icon/ic-drag.svg'
3
- import { DraggableButtonProps } from './types'
4
-
5
- export default function DraggableButton({ dragClassName }: DraggableButtonProps) {
6
- return (
7
- <button
8
- type="button"
9
- className={`${dragClassName} dc__outline-none-imp dc__no-border p-0 dc__transparent h-20`}
10
- >
11
- <ICDrag className="dc__grabbable icon-dim-20 fcn-6" />
12
- </button>
13
- )
14
- }