@carbon-labs/react-animated-header 0.37.0 → 0.38.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.
@@ -15065,7 +15065,7 @@ export declare const ThemeG10: {
15065
15065
  type: string;
15066
15066
  button: {
15067
15067
  href: string;
15068
- icon: import("@carbon/icons-react").CarbonIconType;
15068
+ icon: import("@carbon/react/icons").CarbonIconType;
15069
15069
  text: string;
15070
15070
  type: "tertiary";
15071
15071
  };
@@ -30258,7 +30258,7 @@ export declare const ThemeG100: {
30258
30258
  type: string;
30259
30259
  button: {
30260
30260
  href: string;
30261
- icon: import("@carbon/icons-react").CarbonIconType;
30261
+ icon: import("@carbon/react/icons").CarbonIconType;
30262
30262
  text: string;
30263
30263
  type: "tertiary";
30264
30264
  };
@@ -194,11 +194,9 @@ const AnimatedHeader = ({
194
194
  productName: productName,
195
195
  isLoading: isLoading || tile.isLoading,
196
196
  disabledTaskLabel: disabledTaskLabel,
197
- onClick: hasAction ? () => {
197
+ onClick: hasAction ? event => {
198
198
  tileClickHandler?.(tile);
199
- if (typeof tile.onClick === 'function') {
200
- tile.onClick();
201
- }
199
+ tile.onClick?.(event);
202
200
  } : undefined
203
201
  }));
204
202
  }))), /*#__PURE__*/React.createElement("div", {
@@ -16,7 +16,7 @@ export type AIPromptTileProps = {
16
16
  productName?: string;
17
17
  promptPlaceholder?: string;
18
18
  primaryIcon?: ElementType | null;
19
- onClick?: (() => void) | null;
19
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
20
20
  ariaLabel?: string;
21
21
  open?: boolean;
22
22
  isLoading?: boolean;
@@ -90,8 +90,8 @@ const AIPromptTile = ({
90
90
  size: "sm",
91
91
  disabled: !textInput,
92
92
  align: "top-end",
93
- onClick: () => {
94
- onClick?.();
93
+ onClick: event => {
94
+ onClick?.(event);
95
95
  openInNewTab(`${href}&primed_chat=${textInput}`);
96
96
  },
97
97
  onKeyDown: handleTextInputKeyDown
@@ -17,7 +17,7 @@ export type AITileProps = {
17
17
  customContent?: React.ReactNode | null;
18
18
  primaryIcon?: ElementType | null;
19
19
  secondaryIcon?: ElementType | null;
20
- onClick?: (() => void) | null;
20
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
21
21
  ariaLabel?: string;
22
22
  open?: boolean;
23
23
  isLoading?: boolean;
@@ -48,8 +48,8 @@ const AITile = ({
48
48
  }, body);
49
49
  }
50
50
  return /*#__PURE__*/React.createElement(Link, {
51
- onClick: () => {
52
- aiTileClickHandler?.();
51
+ onClick: event => {
52
+ aiTileClickHandler?.(event);
53
53
  },
54
54
  className: `${prefix}--animated-header__tile ${blockClass}`,
55
55
  "aria-label": ariaLabel ?? title ?? 'AI Tile',
@@ -17,7 +17,7 @@ export type GlassTileProps = {
17
17
  customContent?: React.ReactNode | null;
18
18
  primaryIcon?: ElementType | null;
19
19
  secondaryIcon?: ElementType | null;
20
- onClick?: (() => void) | null;
20
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
21
21
  ariaLabel?: string;
22
22
  open?: boolean;
23
23
  isLoading?: boolean;
@@ -48,8 +48,8 @@ const GlassTile = ({
48
48
  }, body);
49
49
  }
50
50
  return /*#__PURE__*/React.createElement(Link, {
51
- onClick: () => {
52
- glassTileClickHandler?.();
51
+ onClick: event => {
52
+ glassTileClickHandler?.(event);
53
53
  },
54
54
  className: `${prefix}--animated-header__tile ${blockClass}`,
55
55
  "aria-label": ariaLabel ?? title ?? 'Glass Tile',
@@ -15065,7 +15065,7 @@ export declare const ThemeG10: {
15065
15065
  type: string;
15066
15066
  button: {
15067
15067
  href: string;
15068
- icon: import("@carbon/icons-react").CarbonIconType;
15068
+ icon: import("@carbon/react/icons").CarbonIconType;
15069
15069
  text: string;
15070
15070
  type: "tertiary";
15071
15071
  };
@@ -30258,7 +30258,7 @@ export declare const ThemeG100: {
30258
30258
  type: string;
30259
30259
  button: {
30260
30260
  href: string;
30261
- icon: import("@carbon/icons-react").CarbonIconType;
30261
+ icon: import("@carbon/react/icons").CarbonIconType;
30262
30262
  text: string;
30263
30263
  type: "tertiary";
30264
30264
  };
@@ -198,11 +198,9 @@ const AnimatedHeader = ({
198
198
  productName: productName,
199
199
  isLoading: isLoading || tile.isLoading,
200
200
  disabledTaskLabel: disabledTaskLabel,
201
- onClick: hasAction ? () => {
201
+ onClick: hasAction ? event => {
202
202
  tileClickHandler?.(tile);
203
- if (typeof tile.onClick === 'function') {
204
- tile.onClick();
205
- }
203
+ tile.onClick?.(event);
206
204
  } : undefined
207
205
  }));
208
206
  }))), /*#__PURE__*/React.createElement("div", {
@@ -16,7 +16,7 @@ export type AIPromptTileProps = {
16
16
  productName?: string;
17
17
  promptPlaceholder?: string;
18
18
  primaryIcon?: ElementType | null;
19
- onClick?: (() => void) | null;
19
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
20
20
  ariaLabel?: string;
21
21
  open?: boolean;
22
22
  isLoading?: boolean;
@@ -92,8 +92,8 @@ const AIPromptTile = ({
92
92
  size: "sm",
93
93
  disabled: !textInput,
94
94
  align: "top-end",
95
- onClick: () => {
96
- onClick?.();
95
+ onClick: event => {
96
+ onClick?.(event);
97
97
  openInNewTab(`${href}&primed_chat=${textInput}`);
98
98
  },
99
99
  onKeyDown: handleTextInputKeyDown
@@ -17,7 +17,7 @@ export type AITileProps = {
17
17
  customContent?: React.ReactNode | null;
18
18
  primaryIcon?: ElementType | null;
19
19
  secondaryIcon?: ElementType | null;
20
- onClick?: (() => void) | null;
20
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
21
21
  ariaLabel?: string;
22
22
  open?: boolean;
23
23
  isLoading?: boolean;
@@ -52,8 +52,8 @@ const AITile = ({
52
52
  }, body);
53
53
  }
54
54
  return /*#__PURE__*/React.createElement(react.Link, {
55
- onClick: () => {
56
- aiTileClickHandler?.();
55
+ onClick: event => {
56
+ aiTileClickHandler?.(event);
57
57
  },
58
58
  className: `${prefix}--animated-header__tile ${blockClass}`,
59
59
  "aria-label": ariaLabel ?? title ?? 'AI Tile',
@@ -17,7 +17,7 @@ export type GlassTileProps = {
17
17
  customContent?: React.ReactNode | null;
18
18
  primaryIcon?: ElementType | null;
19
19
  secondaryIcon?: ElementType | null;
20
- onClick?: (() => void) | null;
20
+ onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
21
21
  ariaLabel?: string;
22
22
  open?: boolean;
23
23
  isLoading?: boolean;
@@ -50,8 +50,8 @@ const GlassTile = ({
50
50
  }, body);
51
51
  }
52
52
  return /*#__PURE__*/React.createElement(react.Link, {
53
- onClick: () => {
54
- glassTileClickHandler?.();
53
+ onClick: event => {
54
+ glassTileClickHandler?.(event);
55
55
  },
56
56
  className: `${prefix}--animated-header__tile ${blockClass}`,
57
57
  "aria-label": ariaLabel ?? title ?? 'Glass Tile',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-animated-header",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@carbon-labs/utilities": "canary"
47
47
  },
48
- "gitHead": "864d211894887413eba51fb15c147b1711c83e33"
48
+ "gitHead": "f339f983db13e1cc4af78c6f9dcd20370b07290d"
49
49
  }