@devopness/ui-react 2.153.2 → 2.154.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.
@@ -4,6 +4,7 @@ import { InjectedProps as PopupStateProps } from 'material-ui-popup-state';
4
4
  import { Color } from '../../../colors';
5
5
  import { ButtonProps } from '../../Buttons';
6
6
  import { IconProps } from '../Icon';
7
+ import { LinkProps } from '../Link';
7
8
  import { TooltipProps } from '../Tooltip';
8
9
  import { Unwrap } from '../../types';
9
10
  type DropdownOptionIcon = Unwrap<Partial<Pick<IconProps, 'name' | 'size'>> & Pick<React.CSSProperties, 'backgroundColor' | 'color'>> & {
@@ -14,9 +15,9 @@ type DropdownOptionLetter = Unwrap<Pick<React.CSSProperties, 'backgroundColor' |
14
15
  };
15
16
  type DropdownOption = {
16
17
  /**
17
- * Add separator from previous options
18
+ * Background Color to use when option is active
18
19
  */
19
- brokenSequence?: boolean;
20
+ activeBackgroundColor?: Color;
20
21
  /**
21
22
  * Option Badge configuration
22
23
  *
@@ -24,31 +25,37 @@ type DropdownOption = {
24
25
  */
25
26
  badge?: DropdownOptionIcon | DropdownOptionLetter;
26
27
  /**
27
- * Option description
28
+ * Add separator from previous options
28
29
  */
29
- label?: string;
30
+ brokenSequence?: boolean;
31
+ /**
32
+ * Label text color
33
+ *
34
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color}
35
+ */
36
+ color?: Color;
30
37
  /**
31
38
  * Highlight option
32
39
  */
33
40
  isActive?: boolean;
34
41
  /**
35
- * Background Color to use when option is active
42
+ * Disables option
36
43
  */
37
- activeBackgroundColor?: Color;
44
+ isDisabled?: boolean;
38
45
  /**
39
- * Event handler called when this option is clicked.
46
+ * Option description
40
47
  */
41
- onClick?: () => null;
48
+ label?: string;
42
49
  /**
43
- * Transforms label to a Link and point user to this url
50
+ * Link properties
44
51
  *
45
52
  * @see {Link}
46
53
  */
47
- url?: string;
54
+ linkProps?: LinkProps;
48
55
  /**
49
- * Disables option
56
+ * Event handler called when this option is clicked.
50
57
  */
51
- isDisabled?: boolean;
58
+ onClick?: () => null;
52
59
  /**
53
60
  * Tooltip's title
54
61
  *
@@ -56,11 +63,11 @@ type DropdownOption = {
56
63
  */
57
64
  tooltip?: TooltipProps['title'];
58
65
  /**
59
- * Label text color
66
+ * Transforms label to a Link and point user to this url
60
67
  *
61
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/color}
68
+ * @see {Link}
62
69
  */
63
- color?: Color;
70
+ url?: string;
64
71
  };
65
72
  type DropdownSharedProps = {
66
73
  /**
@@ -75,45 +82,45 @@ type DropdownSharedProps = {
75
82
  * help: https://mui.com/material-ui/react-popover/#anchor-playground
76
83
  */
77
84
  anchorOrigin?: PopoverOrigin;
78
- /**
79
- * This is the point on the popover which
80
- * will attach to the anchor's origin.
81
- *
82
- * Options:
83
- * vertical: [top, center, bottom, x(px)];
84
- * horizontal: [left, center, right, x(px)].
85
- *
86
- * help: https://mui.com/material-ui/react-popover/#anchor-playground
87
- */
88
- transformOrigin?: PopoverOrigin;
89
85
  /**
90
86
  * The unique id to identify the dropdown anchor element.
91
87
  */
92
88
  id: string;
93
89
  /**
94
- * Options listed in the Dropdown menu popup.
90
+ * Event handler called when a dropdown option is selected.
91
+ *
92
+ * This prop can be overriden using option.onClick
95
93
  *
96
94
  * @see {DropdownOption}
97
95
  */
98
- options: DropdownOption[] | undefined;
96
+ onSelect?: (itemClicked: DropdownOption) => void;
99
97
  /**
100
98
  * Event handler called when the dropdown is opened or closed.
101
99
  */
102
100
  onToggle?: (popupState: PopupStateProps) => void;
103
101
  /**
104
- * Event handler called when a dropdown option is selected.
105
- *
106
- * This prop can be overriden using option.onClick
102
+ * Options listed in the Dropdown menu popup.
107
103
  *
108
104
  * @see {DropdownOption}
109
105
  */
110
- onSelect?: (itemClicked: DropdownOption) => void;
106
+ options: DropdownOption[] | undefined;
111
107
  /**
112
108
  * Tooltip's title
113
109
  *
114
110
  * @see {Tooltip}
115
111
  */
116
112
  tooltip?: TooltipProps['title'];
113
+ /**
114
+ * This is the point on the popover which
115
+ * will attach to the anchor's origin.
116
+ *
117
+ * Options:
118
+ * vertical: [top, center, bottom, x(px)];
119
+ * horizontal: [left, center, right, x(px)].
120
+ *
121
+ * @see {@link https://mui.com/material-ui/react-popover/#anchor-playground}
122
+ */
123
+ transformOrigin?: PopoverOrigin;
117
124
  };
118
125
  type DropdownVariationButtonProps = DropdownSharedProps & {
119
126
  /**
@@ -122,6 +129,13 @@ type DropdownVariationButtonProps = DropdownSharedProps & {
122
129
  * @see {Button}
123
130
  */
124
131
  anchorType: 'button';
132
+ /**
133
+ * Button properties
134
+ *
135
+ * @see {Button}
136
+ */
137
+ buttonProps?: ButtonProps;
138
+ content?: never;
125
139
  /**
126
140
  * Hide dropdown arrow icon
127
141
  */
@@ -130,19 +144,12 @@ type DropdownVariationButtonProps = DropdownSharedProps & {
130
144
  * Hide dropdown label text
131
145
  */
132
146
  hideLabel?: boolean;
133
- /**
134
- * Button properties
135
- *
136
- * @see {Button}
137
- */
138
- buttonProps?: ButtonProps;
139
147
  /**
140
148
  * Button label
141
149
  *
142
150
  * Default value: 'Open Popover'
143
151
  */
144
152
  label?: string | React.JSX.Element;
145
- content?: never;
146
153
  };
147
154
  type DropdownVariationContainerProps = DropdownSharedProps & {
148
155
  /**
@@ -160,6 +167,6 @@ type DropdownProps = DropdownVariationContainerProps | DropdownVariationButtonPr
160
167
  /**
161
168
  * Display a menu with a list of options
162
169
  */
163
- declare const Dropdown: ({ onToggle, onSelect, content, anchorType, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
170
+ declare const Dropdown: ({ anchorType, content, onSelect, onToggle, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
164
171
  export type { DropdownOption, DropdownProps };
165
172
  export { Dropdown };
@@ -1,17 +1,17 @@
1
1
  import { DropdownOption } from './Dropdown';
2
- import { Color } from '../../../colors';
3
2
  type StyledProps = {
4
- brokenSequence?: boolean;
5
- backgroundColor?: string;
6
- isActive?: boolean;
7
- disabled?: boolean | undefined;
8
- color?: Color;
9
- } & Partial<Pick<DropdownOption, 'activeBackgroundColor'>>;
10
- declare const MenuContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
11
- declare const MenuOption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
12
- declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledProps>> & string;
13
- declare const ContentBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledProps>> & string;
14
- declare const ClickableContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
15
- declare const Grid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
16
- declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProps>> & string;
3
+ [Key in keyof Pick<DropdownOption, 'activeBackgroundColor' | 'brokenSequence' | 'isActive' | 'color'> as `$${Key}`]: DropdownOption[Key];
4
+ } & {
5
+ disabled: DropdownOption['isDisabled'];
6
+ };
7
+ declare const MenuContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
+ declare const MenuOption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<StyledProps, "disabled" | "$activeBackgroundColor" | "$brokenSequence" | "$isActive">>> & string;
9
+ declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<StyledProps, "$color">>> & string;
10
+ type ContentBadgeProps = {
11
+ [Key in keyof Pick<NonNullable<DropdownOption['badge']>, 'backgroundColor'> as `$${Key}`]: NonNullable<DropdownOption['badge']>[Key];
12
+ };
13
+ declare const ContentBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<ContentBadgeProps, "$backgroundColor">>> & string;
14
+ declare const ClickableContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
15
+ declare const Grid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
16
+ declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
17
17
  export { MenuContainer, MenuOption, Text, ContentBadge, ClickableContainer, Grid, Wrapper, };
package/dist/ui-react.cjs CHANGED
@@ -264,8 +264,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
264
264
  height: 42px;
265
265
  padding: 0 15px;
266
266
  opacity: ${({disabled:e})=>e?.3:1};
267
- ${e=>e.brokenSequence&&T2}
268
- ${e=>e.isActive&&!e.disabled&&R2(e.activeBackgroundColor)}
267
+ ${e=>e.$brokenSequence&&T2}
268
+ ${e=>e.$isActive&&!e.disabled&&R2(e.$activeBackgroundColor)}
269
269
  &:hover {
270
270
  border-radius: 0;
271
271
  background-color: ${ce("purple.250")};
@@ -277,7 +277,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
277
277
  text-overflow: ellipsis;
278
278
  font-weight: 500;
279
279
  font-size: 14px;
280
- color: ${({color:e})=>ce(e??"blue.800")};
280
+ color: ${({$color:e})=>ce(e??"blue.800")};
281
281
  `,M2=At`
282
282
  > svg {
283
283
  color: #fff;
@@ -291,7 +291,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
291
291
  align-items: center;
292
292
  width: 20px;
293
293
  height: 20px;
294
- background-color: ${({backgroundColor:e})=>e};
294
+ background-color: ${({$backgroundColor:e})=>e};
295
295
  border-radius: 5px;
296
296
  text-transform: uppercase;
297
297
  font-family: ${$t("roboto")};
@@ -299,7 +299,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
299
299
  font-size: 14px;
300
300
  color: ${ce("blue.800")};
301
301
 
302
- ${({backgroundColor:e})=>!!e&&M2}
302
+ ${({$backgroundColor:e})=>!!e&&M2}
303
303
  `,$2=ge.div`
304
304
  cursor: pointer;
305
305
  display: flex;
@@ -338,7 +338,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
338
338
  overflow: hidden;
339
339
  white-space: nowrap;
340
340
  text-overflow: ellipsis;
341
- `,ry=()=>{const[e,t]=ae.useState([0,0]),r=()=>{t([window.innerWidth,window.innerHeight])};return ae.useEffect(()=>(window.addEventListener("resize",r),r(),()=>{window.removeEventListener("resize",r)}),[]),e},ny=ce("blue.950"),oy=({styles:e,...t})=>{const r=Fe(({className:n,...o})=>$.jsx(yf,{...o,classes:{popper:n}}))(()=>({[`& .${Be.tooltip}`]:{color:e==null?void 0:e.color,backgroundColor:(e==null?void 0:e.backgroundColor)??ny,fontSize:"11px",fontFamily:$t("roboto")}}));return $.jsx(r,{...t})},En=({disableHover:e=!1,enableOnlyWithEllipsisPoints:t=!1,title:r="",children:n,...o})=>{const[i,a]=ae.useState(!1),[c,l]=ry(),f=o.open!==void 0,d=ae.useRef(null),h=t&&!i;return ae.useEffect(()=>{if(d.current){const m=d.current.clientWidth,g=d.current.scrollWidth;a(g>m)}},[c,l]),$.jsx(oy,{placement:"bottom-start",disableHoverListener:e||h||f,disableFocusListener:!0,disableTouchListener:!0,title:r,...o,children:$.jsx(ty,{ref:d,className:"translate",children:n})})},iy=10,ay=10,sy=({popupTrigger:e,popupState:t,buttonProps:r,content:n,tooltip:o,...i})=>{if(i.anchorType==="content")return $.jsx($2,{...e,children:n});const a=t.isOpen?"upArrow":"downArrow";return $.jsx(af,{condition:!!o,wrapper:c=>$.jsx(En,{title:o,children:c}),children:$.jsx(hr,{noMargin:!0,noIconMargin:!!(r!=null&&r.icon),typeSize:"medium",...r,icon:i.hideDropdownIcon?void 0:a,...e,children:$.jsxs("div",{style:{display:"flex",alignItems:"center",gap:ay},children:[$.jsx(Bo,{name:r==null?void 0:r.icon,size:(r==null?void 0:r.iconSize)??iy}),i.hideLabel?null:i.label??"Open Popover"]})})})},cy=({onToggle:e,onSelect:t,content:r,anchorType:n,...o})=>$.jsx(of,{variant:"popover",popupId:"demo-popup-popover",children:i=>(i.anchorEl&&(e==null||e(i)),$.jsxs(ae.Fragment,{children:[$.jsx(sy,{...o,popupTrigger:{...S2(i)},popupState:i,content:r,anchorType:n}),$.jsx(nf,{slotProps:{paper:{style:{marginTop:"10px",backgroundColor:"#FFF",width:"200px",borderRadius:"8px",boxShadow:"0 0 30px 0px rgba(0,0,0,0.15)"}}},...x2(i),...o,children:o.options&&$.jsx(O2,{id:o.id,children:o.options.map((a,c)=>{var l;return $.jsx(En,{title:a.tooltip??"",children:$.jsx(af,{condition:!!a.url,wrapper:f=>$.jsx(sf,{to:a.url,style:{display:"block",marginRight:"auto"},hideUnderline:!0,children:f}),children:$.jsxs(_2,{id:`option_${c.toString()}`,disabled:a.isDisabled,isActive:a.isActive,activeBackgroundColor:a.activeBackgroundColor,brokenSequence:a.brokenSequence,onClick:f=>{a.isDisabled||(f.preventDefault(),f.stopPropagation(),a.onClick?a.onClick():t&&t(a),i.close())},children:[a.badge&&$.jsx(A2,{backgroundColor:a.badge.backgroundColor,children:a.badge.icon?$.jsx(Bo,{name:a.badge.name,size:a.badge.size??12}):(l=a.label)==null?void 0:l.at(0)}),a.label&&$.jsx(En,{title:a.label,enableOnlyWithEllipsisPoints:!0,children:$.jsx(P2,{color:a.color,children:a.label})})]},`option${c.toString()}`)})},c)})})})]}))}),ly=ge.span`
341
+ `,ry=()=>{const[e,t]=ae.useState([0,0]),r=()=>{t([window.innerWidth,window.innerHeight])};return ae.useEffect(()=>(window.addEventListener("resize",r),r(),()=>{window.removeEventListener("resize",r)}),[]),e},ny=ce("blue.950"),oy=({styles:e,...t})=>{const r=Fe(({className:n,...o})=>$.jsx(yf,{...o,classes:{popper:n}}))(()=>({[`& .${Be.tooltip}`]:{color:e==null?void 0:e.color,backgroundColor:(e==null?void 0:e.backgroundColor)??ny,fontSize:"11px",fontFamily:$t("roboto")}}));return $.jsx(r,{...t})},En=({disableHover:e=!1,enableOnlyWithEllipsisPoints:t=!1,title:r="",children:n,...o})=>{const[i,a]=ae.useState(!1),[c,l]=ry(),f=o.open!==void 0,d=ae.useRef(null),h=t&&!i;return ae.useEffect(()=>{if(d.current){const m=d.current.clientWidth,g=d.current.scrollWidth;a(g>m)}},[c,l]),$.jsx(oy,{placement:"bottom-start",disableHoverListener:e||h||f,disableFocusListener:!0,disableTouchListener:!0,title:r,...o,children:$.jsx(ty,{ref:d,className:"translate",children:n})})},iy=10,ay=10,sy=({buttonProps:e,content:t,popupState:r,popupTrigger:n,tooltip:o,...i})=>{if(i.anchorType==="content")return $.jsx($2,{...n,children:t});const a=r.isOpen?"upArrow":"downArrow";return $.jsx(af,{condition:!!o,wrapper:c=>$.jsx(En,{title:o,children:c}),children:$.jsx(hr,{"data-testid":"dropdown-button",noMargin:!0,noIconMargin:!!(e!=null&&e.icon),typeSize:"medium",...e,icon:i.hideDropdownIcon?void 0:a,...n,children:$.jsxs("div",{style:{display:"flex",alignItems:"center",gap:ay},children:[$.jsx(Bo,{name:e==null?void 0:e.icon,size:(e==null?void 0:e.iconSize)??iy}),i.hideLabel?null:i.label??"Open Popover"]})})})},cy=({anchorType:e,content:t,onSelect:r,onToggle:n,...o})=>$.jsx(of,{variant:"popover",popupId:"demo-popup-popover",children:i=>(i.anchorEl&&(n==null||n(i)),$.jsxs(ae.Fragment,{children:[$.jsx(sy,{...o,popupTrigger:{...S2(i)},popupState:i,content:t,anchorType:e}),$.jsx(nf,{slotProps:{paper:{style:{marginTop:"10px",backgroundColor:"#FFF",width:"200px",borderRadius:"8px",boxShadow:"0 0 30px 0px rgba(0,0,0,0.15)"}}},...x2(i),...o,children:o.options&&$.jsx(O2,{id:o.id,children:o.options.map((a,c)=>{var l;return $.jsx(En,{title:a.tooltip??"",children:$.jsx(af,{condition:!!a.url,wrapper:f=>{var d;return $.jsx(sf,{to:a.url,hideUnderline:!0,...a.linkProps,style:{display:"block",marginRight:"auto",...(d=a.linkProps)==null?void 0:d.style},children:f})},children:$.jsxs(_2,{id:`option_${c.toString()}`,disabled:a.isDisabled,$isActive:a.isActive,$activeBackgroundColor:a.activeBackgroundColor,$brokenSequence:a.brokenSequence,onClick:f=>{a.isDisabled||(f.preventDefault(),f.stopPropagation(),a.onClick?a.onClick():r&&r(a),i.close())},children:[a.badge&&$.jsx(A2,{"data-testid":`option-${c.toString()}-badge`,$backgroundColor:a.badge.backgroundColor,children:a.badge.icon?$.jsx(Bo,{name:a.badge.name,size:a.badge.size??12}):(l=a.label)==null?void 0:l.at(0)}),a.label&&$.jsx(En,{title:a.label,enableOnlyWithEllipsisPoints:!0,children:$.jsx(P2,{$color:a.color,children:a.label})})]},`option${c.toString()}`)})},c)})})})]}))}),ly=ge.span`
342
342
  font-family: ${$t("roboto")};
343
343
  font-size: 0.8em;
344
344
  font-weight: 400;
package/dist/ui-react.js CHANGED
@@ -10068,8 +10068,8 @@ const A2 = At`
10068
10068
  height: 42px;
10069
10069
  padding: 0 15px;
10070
10070
  opacity: ${({ disabled: e }) => e ? 0.3 : 1};
10071
- ${(e) => e.brokenSequence && A2}
10072
- ${(e) => e.isActive && !e.disabled && $2(e.activeBackgroundColor)}
10071
+ ${(e) => e.$brokenSequence && A2}
10072
+ ${(e) => e.$isActive && !e.disabled && $2(e.$activeBackgroundColor)}
10073
10073
  &:hover {
10074
10074
  border-radius: 0;
10075
10075
  background-color: ${se("purple.250")};
@@ -10081,7 +10081,7 @@ const A2 = At`
10081
10081
  text-overflow: ellipsis;
10082
10082
  font-weight: 500;
10083
10083
  font-size: 14px;
10084
- color: ${({ color: e }) => se(e ?? "blue.800")};
10084
+ color: ${({ $color: e }) => se(e ?? "blue.800")};
10085
10085
  `, j2 = At`
10086
10086
  > svg {
10087
10087
  color: #fff;
@@ -10095,7 +10095,7 @@ const A2 = At`
10095
10095
  align-items: center;
10096
10096
  width: 20px;
10097
10097
  height: 20px;
10098
- background-color: ${({ backgroundColor: e }) => e};
10098
+ background-color: ${({ $backgroundColor: e }) => e};
10099
10099
  border-radius: 5px;
10100
10100
  text-transform: uppercase;
10101
10101
  font-family: ${Bt("roboto")};
@@ -10103,7 +10103,7 @@ const A2 = At`
10103
10103
  font-size: 14px;
10104
10104
  color: ${se("blue.800")};
10105
10105
 
10106
- ${({ backgroundColor: e }) => !!e && j2}
10106
+ ${({ $backgroundColor: e }) => !!e && j2}
10107
10107
  `, D2 = me.div`
10108
10108
  cursor: pointer;
10109
10109
  display: flex;
@@ -12357,16 +12357,16 @@ const cy = me.span`
12357
12357
  }
12358
12358
  );
12359
12359
  }, dy = 10, py = 10, hy = ({
12360
- popupTrigger: e,
12361
- popupState: t,
12362
- buttonProps: r,
12363
- content: n,
12360
+ buttonProps: e,
12361
+ content: t,
12362
+ popupState: r,
12363
+ popupTrigger: n,
12364
12364
  tooltip: o,
12365
12365
  ...i
12366
12366
  }) => {
12367
12367
  if (i.anchorType === "content")
12368
- return /* @__PURE__ */ $.jsx(D2, { ...e, children: n });
12369
- const a = t.isOpen ? "upArrow" : "downArrow";
12368
+ return /* @__PURE__ */ $.jsx(D2, { ...n, children: t });
12369
+ const a = r.isOpen ? "upArrow" : "downArrow";
12370
12370
  return /* @__PURE__ */ $.jsx(
12371
12371
  ff,
12372
12372
  {
@@ -12375,12 +12375,13 @@ const cy = me.span`
12375
12375
  children: /* @__PURE__ */ $.jsx(
12376
12376
  Mr,
12377
12377
  {
12378
+ "data-testid": "dropdown-button",
12378
12379
  noMargin: !0,
12379
- noIconMargin: !!(r != null && r.icon),
12380
+ noIconMargin: !!(e != null && e.icon),
12380
12381
  typeSize: "medium",
12381
- ...r,
12382
- icon: i.hideDropdownIcon ? void 0 : a,
12383
12382
  ...e,
12383
+ icon: i.hideDropdownIcon ? void 0 : a,
12384
+ ...n,
12384
12385
  children: /* @__PURE__ */ $.jsxs(
12385
12386
  "div",
12386
12387
  {
@@ -12393,8 +12394,8 @@ const cy = me.span`
12393
12394
  /* @__PURE__ */ $.jsx(
12394
12395
  rs,
12395
12396
  {
12396
- name: r == null ? void 0 : r.icon,
12397
- size: (r == null ? void 0 : r.iconSize) ?? dy
12397
+ name: e == null ? void 0 : e.icon,
12398
+ size: (e == null ? void 0 : e.iconSize) ?? dy
12398
12399
  }
12399
12400
  ),
12400
12401
  i.hideLabel ? null : i.label ?? "Open Popover"
@@ -12406,25 +12407,25 @@ const cy = me.span`
12406
12407
  }
12407
12408
  );
12408
12409
  }, $b = ({
12409
- onToggle: e,
12410
- onSelect: t,
12411
- content: r,
12412
- anchorType: n,
12410
+ anchorType: e,
12411
+ content: t,
12412
+ onSelect: r,
12413
+ onToggle: n,
12413
12414
  ...o
12414
12415
  }) => /* @__PURE__ */ $.jsx(
12415
12416
  uf,
12416
12417
  {
12417
12418
  variant: "popover",
12418
12419
  popupId: "demo-popup-popover",
12419
- children: (i) => (i.anchorEl && (e == null || e(i)), /* @__PURE__ */ $.jsxs(De.Fragment, { children: [
12420
+ children: (i) => (i.anchorEl && (n == null || n(i)), /* @__PURE__ */ $.jsxs(De.Fragment, { children: [
12420
12421
  /* @__PURE__ */ $.jsx(
12421
12422
  hy,
12422
12423
  {
12423
12424
  ...o,
12424
12425
  popupTrigger: { ..._2(i) },
12425
12426
  popupState: i,
12426
- content: r,
12427
- anchorType: n
12427
+ content: t,
12428
+ anchorType: e
12428
12429
  }
12429
12430
  ),
12430
12431
  /* @__PURE__ */ $.jsx(
@@ -12453,31 +12454,40 @@ const cy = me.span`
12453
12454
  ff,
12454
12455
  {
12455
12456
  condition: !!a.url,
12456
- wrapper: (f) => /* @__PURE__ */ $.jsx(
12457
- F2,
12458
- {
12459
- to: a.url,
12460
- style: { display: "block", marginRight: "auto" },
12461
- hideUnderline: !0,
12462
- children: f
12463
- }
12464
- ),
12457
+ wrapper: (f) => {
12458
+ var d;
12459
+ return /* @__PURE__ */ $.jsx(
12460
+ F2,
12461
+ {
12462
+ to: a.url,
12463
+ hideUnderline: !0,
12464
+ ...a.linkProps,
12465
+ style: {
12466
+ display: "block",
12467
+ marginRight: "auto",
12468
+ ...(d = a.linkProps) == null ? void 0 : d.style
12469
+ },
12470
+ children: f
12471
+ }
12472
+ );
12473
+ },
12465
12474
  children: /* @__PURE__ */ $.jsxs(
12466
12475
  N2,
12467
12476
  {
12468
12477
  id: `option_${c.toString()}`,
12469
12478
  disabled: a.isDisabled,
12470
- isActive: a.isActive,
12471
- activeBackgroundColor: a.activeBackgroundColor,
12472
- brokenSequence: a.brokenSequence,
12479
+ $isActive: a.isActive,
12480
+ $activeBackgroundColor: a.activeBackgroundColor,
12481
+ $brokenSequence: a.brokenSequence,
12473
12482
  onClick: (f) => {
12474
- a.isDisabled || (f.preventDefault(), f.stopPropagation(), a.onClick ? a.onClick() : t && t(a), i.close());
12483
+ a.isDisabled || (f.preventDefault(), f.stopPropagation(), a.onClick ? a.onClick() : r && r(a), i.close());
12475
12484
  },
12476
12485
  children: [
12477
12486
  a.badge && /* @__PURE__ */ $.jsx(
12478
12487
  L2,
12479
12488
  {
12480
- backgroundColor: a.badge.backgroundColor,
12489
+ "data-testid": `option-${c.toString()}-badge`,
12490
+ $backgroundColor: a.badge.backgroundColor,
12481
12491
  children: a.badge.icon ? /* @__PURE__ */ $.jsx(
12482
12492
  rs,
12483
12493
  {
@@ -12492,7 +12502,7 @@ const cy = me.span`
12492
12502
  {
12493
12503
  title: a.label,
12494
12504
  enableOnlyWithEllipsisPoints: !0,
12495
- children: /* @__PURE__ */ $.jsx(I2, { color: a.color, children: a.label })
12505
+ children: /* @__PURE__ */ $.jsx(I2, { $color: a.color, children: a.label })
12496
12506
  }
12497
12507
  )
12498
12508
  ]
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "type": "module",
4
4
  "name": "@devopness/ui-react",
5
- "version": "2.153.2",
5
+ "version": "2.154.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },