@devtron-labs/devtron-fe-common-lib 0.0.82-beta-12 → 0.0.82-beta-13

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.
@@ -34,5 +34,5 @@ import { SearchBarProps } from './types';
34
34
  * <SearchBar inputProps={{ placeholder: 'Enter search text' }} />
35
35
  * ```
36
36
  */
37
- declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, }: SearchBarProps) => JSX.Element;
37
+ declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, noBackgroundAndBorder, }: SearchBarProps) => JSX.Element;
38
38
  export default SearchBar;
@@ -32,4 +32,8 @@ export interface SearchBarProps {
32
32
  * Timeout for the debounce handler to be triggered
33
33
  */
34
34
  debounceTimeout?: number;
35
+ /**
36
+ * Hide the background and border of the search
37
+ */
38
+ noBackgroundAndBorder?: boolean;
35
39
  }
@@ -14,5 +14,5 @@ import { ButtonWithSelectorProps } from './types';
14
14
  * </ButtonWithSelector>
15
15
  * ```
16
16
  */
17
- declare const ButtonWithSelector: ({ content, onClick, children, className, popUpBodyClassName, showPopUp, }: ButtonWithSelectorProps) => JSX.Element;
17
+ declare const ButtonWithSelector: ({ content, onClick, children, className, popUpBodyClassName, showPopUp, disabled, }: ButtonWithSelectorProps) => JSX.Element;
18
18
  export default ButtonWithSelector;
@@ -7,4 +7,5 @@ export interface ButtonWithSelectorProps {
7
7
  className?: string;
8
8
  popUpBodyClassName?: string;
9
9
  showPopUp?: boolean;
10
+ disabled?: boolean;
10
11
  }
package/dist/index.js CHANGED
@@ -14544,9 +14544,10 @@ const Sy = ({
14544
14544
  children: n,
14545
14545
  className: r = "",
14546
14546
  popUpBodyClassName: i = "",
14547
- showPopUp: a = !0
14547
+ showPopUp: a = !0,
14548
+ disabled: s = !1
14548
14549
  }) => {
14549
- const [s, c] = k(!1);
14550
+ const [c, l] = k(!1);
14550
14551
  return /* @__PURE__ */ o.jsxs("div", { className: "flexbox bcb-5 br-4", children: [
14551
14552
  /* @__PURE__ */ o.jsx(
14552
14553
  "button",
@@ -14554,17 +14555,25 @@ const Sy = ({
14554
14555
  className: `cta flex h-28 ${a ? "dc__no-right-radius" : ""} dc__no-border-imp fs-12 fw-6 lh-20-imp ${r}`,
14555
14556
  type: "button",
14556
14557
  onClick: t,
14558
+ disabled: s,
14557
14559
  children: e
14558
14560
  }
14559
14561
  ),
14560
- a && /* @__PURE__ */ o.jsxs(Pt, { autoClose: !0, autoPosition: !0, onToggleCallback: c, children: [
14561
- /* @__PURE__ */ o.jsx(Pt.Button, { rootClassName: "flex dc__transparent p-0 w-28 bcb-5 dc__right-radius-4 dc__no-left-radius dc__no-top-border dc__no-bottom-border dc__no-right-border button-with-selector", children: /* @__PURE__ */ o.jsx(
14562
- sa,
14562
+ a && /* @__PURE__ */ o.jsxs(Pt, { autoClose: !0, autoPosition: !0, onToggleCallback: l, children: [
14563
+ /* @__PURE__ */ o.jsx(
14564
+ Pt.Button,
14563
14565
  {
14564
- className: "icon-dim-16 fcn-0 dc__no-shrink rotate",
14565
- style: { "--rotateBy": s ? "180deg" : "0deg" }
14566
+ disabled: s,
14567
+ rootClassName: "flex dc__transparent p-0 w-28 bcb-5 dc__right-radius-4 dc__no-left-radius dc__no-top-border dc__no-bottom-border dc__no-right-border button-with-selector",
14568
+ children: /* @__PURE__ */ o.jsx(
14569
+ sa,
14570
+ {
14571
+ className: "icon-dim-16 fcn-0 dc__no-shrink rotate",
14572
+ style: { "--rotateBy": c ? "180deg" : "0deg" }
14573
+ }
14574
+ )
14566
14575
  }
14567
- ) }),
14576
+ ),
14568
14577
  /* @__PURE__ */ o.jsx(Pt.Body, { rootClassName: `pt-4 pb-4 dc__border dc__overflow-hidden ${i}`, children: n })
14569
14578
  ] })
14570
14579
  ] });
@@ -16573,57 +16582,64 @@ const zb = ({
16573
16582
  inputProps: r = {},
16574
16583
  containerClassName: i,
16575
16584
  shouldDebounce: a = !1,
16576
- debounceTimeout: s = 300
16585
+ debounceTimeout: s = 300,
16586
+ noBackgroundAndBorder: c = !1
16577
16587
  }) => {
16578
- const [c, l] = k(!!e), u = De(), d = ft(Zy(t, s), [
16588
+ const [l, u] = k(!!e), d = De(), g = ft(Zy(t, s), [
16579
16589
  t,
16580
16590
  s
16581
16591
  ]);
16582
16592
  ne(() => {
16583
- u.current.value = e, l(!!e);
16593
+ d.current.value = e, u(!!e);
16584
16594
  }, [e]);
16585
- const g = (A) => {
16586
- t(A), n(A);
16587
- }, f = () => {
16588
- u.current.value = "", g(""), l(!1);
16589
- }, I = (A) => {
16590
- const { value: M } = A.target;
16591
- l(!!M), a ? d(M) : t(M);
16592
- }, p = (A) => {
16593
- const { key: M } = A;
16594
- if (M === "Enter") {
16595
- A.preventDefault();
16596
- const v = A.target.value.trim();
16597
- g(v);
16595
+ const f = (M) => {
16596
+ t(M), n(M);
16597
+ }, I = () => {
16598
+ d.current.value = "", f(""), u(!1);
16599
+ }, p = (M) => {
16600
+ const { value: N } = M.target;
16601
+ u(!!N), a ? g(N) : t(N);
16602
+ }, A = (M) => {
16603
+ const { key: N } = M;
16604
+ if (N === "Enter") {
16605
+ M.preventDefault();
16606
+ const E = M.target.value.trim();
16607
+ f(E);
16598
16608
  }
16599
16609
  };
16600
- return /* @__PURE__ */ o.jsx("div", { className: i, children: /* @__PURE__ */ o.jsxs("div", { className: "search-bar bc-n50 focus-within-border-b5 dc__hover-border-n300 dc__block w-100 min-w-200 dc__position-rel en-2 bw-1 br-4 h-32", children: [
16601
- /* @__PURE__ */ o.jsx(Lb, { className: "search-bar__icon dc__position-abs icon-color-n6 icon-dim-16" }),
16602
- /* @__PURE__ */ o.jsx(
16603
- "input",
16604
- {
16605
- placeholder: "Search",
16606
- "data-testid": "search-bar",
16607
- type: "text",
16608
- ...r,
16609
- defaultValue: e,
16610
- className: `search-bar__input bc-n50 dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ${c ? "pr-30" : "pr-10"}`,
16611
- onChange: I,
16612
- onKeyDown: p,
16613
- ref: u
16614
- }
16615
- ),
16616
- c && /* @__PURE__ */ o.jsx(
16617
- "button",
16618
- {
16619
- className: "flex search-bar__clear-button dc__position-abs dc__transparent mt-0 mb-0 mr-5 ml-5",
16620
- type: "button",
16621
- onClick: f,
16622
- "aria-label": "Clear search",
16623
- children: /* @__PURE__ */ o.jsx(V0, { className: "icon-dim-16 icon-n4 dc__vertical-align-middle" })
16624
- }
16625
- )
16626
- ] }) });
16610
+ return /* @__PURE__ */ o.jsx("div", { className: i, children: /* @__PURE__ */ o.jsxs(
16611
+ "div",
16612
+ {
16613
+ className: `search-bar ${c ? "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`,
16614
+ children: [
16615
+ /* @__PURE__ */ o.jsx(Lb, { className: "search-bar__icon dc__position-abs icon-color-n6 icon-dim-16" }),
16616
+ /* @__PURE__ */ o.jsx(
16617
+ "input",
16618
+ {
16619
+ placeholder: "Search",
16620
+ "data-testid": "search-bar",
16621
+ type: "text",
16622
+ ...r,
16623
+ defaultValue: e,
16624
+ className: `search-bar__input dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ${l ? "pr-30" : "pr-10"} ${c ? "dc__no-background" : "bc-n50"}`,
16625
+ onChange: p,
16626
+ onKeyDown: A,
16627
+ ref: d
16628
+ }
16629
+ ),
16630
+ l && /* @__PURE__ */ o.jsx(
16631
+ "button",
16632
+ {
16633
+ className: "flex search-bar__clear-button dc__position-abs dc__transparent mt-0 mb-0 mr-5 ml-5",
16634
+ type: "button",
16635
+ onClick: I,
16636
+ "aria-label": "Clear search",
16637
+ children: /* @__PURE__ */ o.jsx(V0, { className: "icon-dim-16 icon-n4 dc__vertical-align-middle" })
16638
+ }
16639
+ )
16640
+ ]
16641
+ }
16642
+ ) });
16627
16643
  }, v6 = zb, Pb = (e) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M4.125 8.5L6 10.75L7.875 8.5M4.125 3.5L6 1.25L7.875 3.5", stroke: "#3B444C", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), Rb = (e) => /* @__PURE__ */ C.createElement("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M3.5 7.50009L6.00004 10.0001M6.00004 10.0001L8.5 7.50054M6.00004 10.0001V2", stroke: "#596168", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), kb = ({
16628
16644
  isSorted: e,
16629
16645
  triggerSorting: t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.82-beta-12",
3
+ "version": "0.0.82-beta-13",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",