kwant-ui 3.32.0-alpha.0 → 3.32.1-alpha.0

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.
@@ -1,4 +1,5 @@
1
1
  import { Ref } from 'react';
2
+ import { TooltipComponent } from '../../components/Tooltip/types';
2
3
  export type HoverTypes = {
3
4
  children: JSX.Element[] | JSX.Element;
4
5
  label?: string;
@@ -10,6 +11,8 @@ export type HoverTypes = {
10
11
  onMouseLeaveFromInput?: any;
11
12
  disableEdit?: boolean;
12
13
  inputRef?: Ref<HTMLInputElement>;
14
+ tooltipContent?: string | null;
15
+ tooltipPosition?: TooltipComponent.Position;
13
16
  };
14
17
  export type HoverStyleTypes = {
15
18
  editMode?: boolean;
@@ -1,4 +1,5 @@
1
1
  import { ISelect } from '../Select/Select.types';
2
+ import { TooltipComponent } from '../Tooltip/types';
2
3
  export type HIStyles = {
3
4
  label?: string;
4
5
  activeOption?: {
@@ -13,4 +14,6 @@ export type HIStyles = {
13
14
  allowSearch?: boolean;
14
15
  disableEdit?: boolean;
15
16
  selectProps?: Omit<ISelect.Props, 'required'>;
17
+ tooltipContent?: string | null;
18
+ tooltipPosition?: TooltipComponent.Position;
16
19
  };
package/dist/index.es.js CHANGED
@@ -3517,6 +3517,9 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
3517
3517
  font-style: normal;
3518
3518
  font-weight: 400;
3519
3519
  line-height: 20px;
3520
+ display: flex;
3521
+ align-items: center;
3522
+ column-gap: 8px;
3520
3523
  }
3521
3524
 
3522
3525
  .edit-mode {
@@ -3572,7 +3575,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
3572
3575
  }
3573
3576
  }
3574
3577
  }
3575
- `,Lc=h(((r,n)=>{const{label:a,value:c,editMode:i,editActive:o,setEditActive:s,onMouseLeaveFromInput:l,disableEdit:h,...v}=r;return e(Ac,{children:t("div",{className:`hover-hoc-container ${(o||i)&&"hover"}`,children:[a&&e("div",{className:`hover-hoc-container__label ${(o||i)&&"label-active"}`,children:a}),t("div",{className:"hover-hoc-container__input",children:[!i&&t("div",{onClick:()=>{s(!0),n&&n.current&&setTimeout((()=>n.current.focus()),200)},className:"hover-hoc-container__input__display-value",children:[c||"-",!h&&e("div",{className:"edit-icon",children:e("svg",{width:"18",height:"18",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.7167 7.51667L12.4833 8.28333L4.93333 15.8333H4.16667V15.0667L11.7167 7.51667ZM14.7167 2.5C14.5083 2.5 14.2917 2.58333 14.1333 2.74167L12.6083 4.26667L15.7333 7.39167L17.2583 5.86667C17.5833 5.54167 17.5833 5.01667 17.2583 4.69167L15.3083 2.74167C15.1417 2.575 14.9333 2.5 14.7167 2.5ZM11.7167 5.15833L2.5 14.375V17.5H5.625L14.8417 8.28333L11.7167 5.15833Z"})})})]}),e("div",{onMouseLeave:()=>{l()},className:`hover-hoc-container__input__display-input ${i&&"edit-mode"}`,children:v?.children})]})]})})})),zc=n.div`
3578
+ `,Lc=h(((r,n)=>{const{label:a,value:c,editMode:i,editActive:o,setEditActive:s,onMouseLeaveFromInput:l,disableEdit:h,tooltipContent:v,tooltipPosition:p="right-center",...u}=r;return e(Ac,{children:t("div",{className:`hover-hoc-container ${(o||i)&&"hover"}`,children:[a&&t("div",{className:`hover-hoc-container__label ${(o||i)&&"label-active"}`,children:[a,v&&e(Je,{children:e(be,{tooltipContent:()=>v,position:p,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:A.grey.grey400})})})]}),t("div",{className:"hover-hoc-container__input",children:[!i&&t("div",{onClick:()=>{s(!0),n&&n.current&&setTimeout((()=>n.current.focus()),200)},className:"hover-hoc-container__input__display-value",children:[c||"-",!h&&e("div",{className:"edit-icon",children:e("svg",{width:"18",height:"18",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.7167 7.51667L12.4833 8.28333L4.93333 15.8333H4.16667V15.0667L11.7167 7.51667ZM14.7167 2.5C14.5083 2.5 14.2917 2.58333 14.1333 2.74167L12.6083 4.26667L15.7333 7.39167L17.2583 5.86667C17.5833 5.54167 17.5833 5.01667 17.2583 4.69167L15.3083 2.74167C15.1417 2.575 14.9333 2.5 14.7167 2.5ZM11.7167 5.15833L2.5 14.375V17.5H5.625L14.8417 8.28333L11.7167 5.15833Z"})})})]}),e("div",{onMouseLeave:()=>{l()},className:`hover-hoc-container__input__display-input ${i&&"edit-mode"}`,children:u?.children})]})]})})})),zc=n.div`
3576
3579
  display: flex;
3577
3580
  width: 100%;
3578
3581
 
@@ -3672,7 +3675,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
3672
3675
  }
3673
3676
  }
3674
3677
  }
3675
- `;function Sc(t){const{label:r,activeOption:n,placeholder:a="Enter",editMode:c,data:i=[],onSelect:o,allowSearch:s=!0,disableEdit:h,selectProps:v}=t,[u,g]=p(!1),[m,d]=p(""),[f,_]=p(!1);l((()=>{n?.label&&d(n?.label)}),[n,u]),l((()=>{m&&g(!0)}),[m]);return e(kc,{children:e(Lc,{editActive:!h&&f,setEditActive:_,onMouseLeaveFromInput:()=>{},disableHover:!0,editMode:!h&&c,label:r,value:n?.label,disableEdit:h,children:e("div",{onMouseLeave:()=>{d(n?.label),_(!1)},children:e(mn,{...v,onSelect:e=>{o(e),_(!1)},onInputChange:e=>{d(e.target.value)},width:"100%",placeholder:a,allowInput:s,offsetTop:"48px",searchable:!1,data:i,selectedValue:n?.value,inputProps:{id:"select-input"},required:!1})})})})}const Rc=n.div`
3678
+ `;function Sc(t){const{label:r,activeOption:n,placeholder:a="Enter",editMode:c,data:i=[],onSelect:o,allowSearch:s=!0,disableEdit:h,selectProps:v,tooltipContent:u,tooltipPosition:g}=t,[m,d]=p(!1),[f,_]=p(""),[w,b]=p(!1);l((()=>{n?.label&&_(n?.label)}),[n,m]),l((()=>{f&&d(!0)}),[f]);return e(kc,{children:e(Lc,{editActive:!h&&w,setEditActive:b,onMouseLeaveFromInput:()=>{},disableHover:!0,editMode:!h&&c,label:r,value:n?.label,disableEdit:h,tooltipContent:u,tooltipPosition:g,children:e("div",{onMouseLeave:()=>{_(n?.label),b(!1)},children:e(mn,{...v,onSelect:e=>{o(e),b(!1)},onInputChange:e=>{_(e.target.value)},width:"100%",placeholder:a,allowInput:s,offsetTop:"48px",searchable:!1,data:i,selectedValue:n?.value,inputProps:{id:"select-input"},required:!1})})})})}const Rc=n.div`
3676
3679
  width: 100%;
3677
3680
 
3678
3681
  .hover-input-container {
@@ -3699,7 +3702,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
3699
3702
  }
3700
3703
  }
3701
3704
  }
3702
- `;function Dc(t){const{label:n,value:a,type:c="text",placeholder:i="Enter",onChange:o,editMode:s,disableEdit:l,...h}=t,[v,g]=p(!1),m=u(null);return e(r,{children:e(Rc,{children:e(Lc,{editActive:!l&&v,setEditActive:g,onMouseLeaveFromInput:()=>{g(!1)},editMode:!l&&s,label:n,value:a,disableEdit:l,ref:m,children:e(at,{className:"input-hover",id:"hover-input",onChange:o,type:c,value:a||"",placeholder:i,...h,required:!1,ref:m})})})})}const Ic=n.div`
3705
+ `;function Dc(t){const{label:n,value:a,type:c="text",placeholder:i="Enter",onChange:o,editMode:s,disableEdit:l,tooltipContent:h,tooltipPosition:v="right-center",...g}=t,[m,d]=p(!1),f=u(null);return e(r,{children:e(Rc,{children:e(Lc,{editActive:!l&&m,setEditActive:d,onMouseLeaveFromInput:()=>{d(!1)},editMode:!l&&s,label:n,value:a,disableEdit:l,ref:f,tooltipContent:h,tooltipPosition:v,children:e(at,{className:"input-hover",id:"hover-input",onChange:o,type:c,value:a||"",placeholder:i,...g,required:!1,ref:f})})})})}const Ic=n.div`
3703
3706
  display: grid;
3704
3707
  grid-template-columns: 24px 1fr;
3705
3708
  width: fit-content;