@centreon/ui 24.4.28 → 24.4.29

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "24.4.28",
3
+ "version": "24.4.29",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -82,14 +82,14 @@ const DataTableItem = forwardRef(
82
82
  labels={labelsDelete}
83
83
  onConfirm={onDelete}
84
84
  >
85
- {(openTooltip) => (
85
+ {({ toggleTooltip }) => (
86
86
  <IconButton
87
87
  aria-label="delete"
88
88
  data-testid="delete"
89
89
  icon={<DeleteIcon />}
90
90
  size="small"
91
91
  variant="ghost"
92
- onClick={openTooltip}
92
+ onClick={toggleTooltip}
93
93
  />
94
94
  )}
95
95
  </ConfirmationTooltip>
@@ -15,7 +15,7 @@ type Story = StoryObj<typeof ConfirmationTooltip>;
15
15
 
16
16
  export const Default: Story = {
17
17
  args: {
18
- children: (toggleTooltip) => (
18
+ children: ({ toggleTooltip }) => (
19
19
  <IconButton icon={<SaveIcon />} onClick={toggleTooltip} />
20
20
  ),
21
21
  labels: {
@@ -30,7 +30,7 @@ export const Default: Story = {
30
30
 
31
31
  export const WithConfirmVariant: Story = {
32
32
  args: {
33
- children: (toggleTooltip) => (
33
+ children: ({ toggleTooltip }) => (
34
34
  <IconButton icon={<DeleteIcon color="error" />} onClick={toggleTooltip} />
35
35
  ),
36
36
  confirmVariant: 'error',
@@ -46,7 +46,7 @@ export const WithConfirmVariant: Story = {
46
46
 
47
47
  export const WithSecondaryLabel: Story = {
48
48
  args: {
49
- children: (toggleTooltip) => (
49
+ children: ({ toggleTooltip }) => (
50
50
  <IconButton icon={<DeleteIcon color="error" />} onClick={toggleTooltip} />
51
51
  ),
52
52
  confirmVariant: 'error',
@@ -49,7 +49,7 @@ export const ConfirmationTooltip = ({
49
49
  return (
50
50
  <ClickAwayListener onClickAway={close}>
51
51
  <div>
52
- {children(isOpen ? close : open)}
52
+ {children({ isOpen, toggleTooltip: isOpen ? close : open })}
53
53
  <Popper
54
54
  anchorEl={anchorElement}
55
55
  className={classes.popper}
@@ -11,7 +11,7 @@ interface Labels {
11
11
  }
12
12
 
13
13
  export interface Props {
14
- children: (toggleTooltip) => ReactElement;
14
+ children: ({ toggleTooltip, isOpen }) => ReactElement;
15
15
  confirmVariant?: ActionVariants;
16
16
  labels: Labels;
17
17
  onConfirm: () => void;