@carbon-labs/react-animated-header 0.19.0 → 0.21.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.
- package/es/__stories__/AnimatedHeader.stories.d.ts +24 -120
- package/es/__stories__/data/index.d.ts +2 -10
- package/es/components/AnimatedHeader/AnimatedHeader.d.ts +1 -1
- package/es/components/AnimatedHeader/AnimatedHeader.js +6 -4
- package/es/components/Tiles/AIPromptTile/AIPromptTile.d.ts +1 -0
- package/es/components/Tiles/AIPromptTile/AIPromptTile.js +6 -2
- package/es/components/Tiles/BaseTile/BaseTile.d.ts +1 -2
- package/es/components/Tiles/GlassTile/GlassTile.d.ts +1 -2
- package/es/components/Tiles/GlassTile/GlassTile.js +4 -3
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +615 -637
- package/es/node_modules/@carbon/icons-react/node_modules/@carbon/icon-helpers/es/index.js +3 -3
- package/lib/__stories__/AnimatedHeader.stories.d.ts +24 -120
- package/lib/__stories__/data/index.d.ts +2 -10
- package/lib/components/AnimatedHeader/AnimatedHeader.d.ts +1 -1
- package/lib/components/AnimatedHeader/AnimatedHeader.js +6 -4
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.d.ts +1 -0
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.js +6 -2
- package/lib/components/Tiles/BaseTile/BaseTile.d.ts +1 -2
- package/lib/components/Tiles/GlassTile/GlassTile.d.ts +1 -2
- package/lib/components/Tiles/GlassTile/GlassTile.js +4 -3
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +621 -643
- package/lib/node_modules/@carbon/icons-react/node_modules/@carbon/icon-helpers/es/index.js +3 -3
- package/package.json +2 -2
|
@@ -46,16 +46,14 @@ export const headerTiles: ({
|
|
|
46
46
|
subtitle: string;
|
|
47
47
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
48
48
|
isLoading: boolean;
|
|
49
|
-
isInteractive?: undefined;
|
|
50
49
|
isDisabled?: undefined;
|
|
51
50
|
secondaryIcon?: undefined;
|
|
52
51
|
} | {
|
|
53
52
|
id: string;
|
|
54
|
-
href: string;
|
|
55
53
|
title: string;
|
|
56
54
|
subtitle: string;
|
|
57
55
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
58
|
-
|
|
56
|
+
href?: undefined;
|
|
59
57
|
isLoading?: undefined;
|
|
60
58
|
isDisabled?: undefined;
|
|
61
59
|
secondaryIcon?: undefined;
|
|
@@ -67,7 +65,6 @@ export const headerTiles: ({
|
|
|
67
65
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
68
66
|
isDisabled: boolean;
|
|
69
67
|
isLoading?: undefined;
|
|
70
|
-
isInteractive?: undefined;
|
|
71
68
|
secondaryIcon?: undefined;
|
|
72
69
|
} | {
|
|
73
70
|
id: string;
|
|
@@ -77,7 +74,6 @@ export const headerTiles: ({
|
|
|
77
74
|
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
78
75
|
subtitle?: undefined;
|
|
79
76
|
isLoading?: undefined;
|
|
80
|
-
isInteractive?: undefined;
|
|
81
77
|
isDisabled?: undefined;
|
|
82
78
|
})[];
|
|
83
79
|
} | {
|
|
@@ -148,16 +144,14 @@ export namespace tasksControllerConfigDropdown {
|
|
|
148
144
|
subtitle: string;
|
|
149
145
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
150
146
|
isLoading: boolean;
|
|
151
|
-
isInteractive?: undefined;
|
|
152
147
|
isDisabled?: undefined;
|
|
153
148
|
secondaryIcon?: undefined;
|
|
154
149
|
} | {
|
|
155
150
|
id: string;
|
|
156
|
-
href: string;
|
|
157
151
|
title: string;
|
|
158
152
|
subtitle: string;
|
|
159
153
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
160
|
-
|
|
154
|
+
href?: undefined;
|
|
161
155
|
isLoading?: undefined;
|
|
162
156
|
isDisabled?: undefined;
|
|
163
157
|
secondaryIcon?: undefined;
|
|
@@ -169,7 +163,6 @@ export namespace tasksControllerConfigDropdown {
|
|
|
169
163
|
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
170
164
|
isDisabled: boolean;
|
|
171
165
|
isLoading?: undefined;
|
|
172
|
-
isInteractive?: undefined;
|
|
173
166
|
secondaryIcon?: undefined;
|
|
174
167
|
} | {
|
|
175
168
|
id: string;
|
|
@@ -179,7 +172,6 @@ export namespace tasksControllerConfigDropdown {
|
|
|
179
172
|
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
180
173
|
subtitle?: undefined;
|
|
181
174
|
isLoading?: undefined;
|
|
182
|
-
isInteractive?: undefined;
|
|
183
175
|
isDisabled?: undefined;
|
|
184
176
|
})[];
|
|
185
177
|
} | {
|
|
@@ -143,7 +143,7 @@ const AnimatedHeader = _ref => {
|
|
|
143
143
|
md: 8,
|
|
144
144
|
lg: 12,
|
|
145
145
|
className: `${blockClass}__content`
|
|
146
|
-
}, workspaceSelectorConfig?.allWorkspaces?.length && /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
}, !!workspaceSelectorConfig?.allWorkspaces?.length && /*#__PURE__*/React.createElement("div", {
|
|
147
147
|
className: `${blockClass}__workspace--container${!open ? ` ${contentCollapsed}` : ''}`
|
|
148
148
|
}, /*#__PURE__*/React.createElement(WorkspaceSelector.default, {
|
|
149
149
|
workspaceSelectorConfig: workspaceSelectorConfig,
|
|
@@ -153,7 +153,10 @@ const AnimatedHeader = _ref => {
|
|
|
153
153
|
className: `${blockClass}__tiles-container`
|
|
154
154
|
}, selectedTileGroup.tiles.map(tile => {
|
|
155
155
|
return /*#__PURE__*/React.createElement(BaseTile.BaseTile, {
|
|
156
|
-
onClick: () =>
|
|
156
|
+
onClick: tile.href || tile.onClick ? () => {
|
|
157
|
+
tileClickHandler?.(tile);
|
|
158
|
+
tile.onClick?.();
|
|
159
|
+
} : null,
|
|
157
160
|
key: tile.id,
|
|
158
161
|
id: tile.id,
|
|
159
162
|
open: open,
|
|
@@ -166,8 +169,7 @@ const AnimatedHeader = _ref => {
|
|
|
166
169
|
customContent: tile.customContent,
|
|
167
170
|
isLoading: isLoading || tile.isLoading,
|
|
168
171
|
isDisabled: tile.isDisabled,
|
|
169
|
-
disabledTaskLabel: disabledTaskLabel
|
|
170
|
-
isInteractive: tile.isInteractive
|
|
172
|
+
disabledTaskLabel: disabledTaskLabel
|
|
171
173
|
});
|
|
172
174
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
173
175
|
className: `${blockClass}__button-collapse--gradient`
|
|
@@ -26,7 +26,8 @@ const AIPromptTile = _ref => {
|
|
|
26
26
|
title,
|
|
27
27
|
isLoading,
|
|
28
28
|
isDisabled,
|
|
29
|
-
disabledTaskLabel
|
|
29
|
+
disabledTaskLabel,
|
|
30
|
+
onClick
|
|
30
31
|
} = _ref;
|
|
31
32
|
const prefix = usePrefix.usePrefix();
|
|
32
33
|
const blockClass = `${prefix}--animated-header__ai-prompt-tile`;
|
|
@@ -91,7 +92,10 @@ const AIPromptTile = _ref => {
|
|
|
91
92
|
size: "sm",
|
|
92
93
|
disabled: !textInput,
|
|
93
94
|
align: "top-right",
|
|
94
|
-
onClick: () =>
|
|
95
|
+
onClick: () => {
|
|
96
|
+
onClick?.();
|
|
97
|
+
openInNewTab(`${href}&primed_chat=${textInput}`);
|
|
98
|
+
},
|
|
95
99
|
onKeyDown: handleTextInputKeyDown
|
|
96
100
|
}, _Send || (_Send = /*#__PURE__*/React.createElement(icons.Send, null)))), /*#__PURE__*/React.createElement("div", {
|
|
97
101
|
className: `${blockClass}--footer`
|
|
@@ -21,8 +21,7 @@ interface BaseTileProps {
|
|
|
21
21
|
isLoading?: boolean;
|
|
22
22
|
isDisabled?: boolean;
|
|
23
23
|
disabledTaskLabel?: string;
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
isInteractive?: boolean;
|
|
24
|
+
onClick?: (() => void) | null;
|
|
26
25
|
}
|
|
27
26
|
export declare const BaseTile: React.FC<BaseTileProps>;
|
|
28
27
|
export {};
|
|
@@ -14,8 +14,7 @@ interface GlassTileProps {
|
|
|
14
14
|
isLoading?: boolean;
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
disabledTaskLabel?: string;
|
|
17
|
-
onClick?: () => void;
|
|
18
|
-
isInteractive?: boolean;
|
|
17
|
+
onClick?: (() => void) | null;
|
|
19
18
|
}
|
|
20
19
|
export declare const GlassTile: React.FC<GlassTileProps>;
|
|
21
20
|
export {};
|
|
@@ -27,8 +27,7 @@ const GlassTile = _ref => {
|
|
|
27
27
|
isLoading,
|
|
28
28
|
isDisabled,
|
|
29
29
|
disabledTaskLabel,
|
|
30
|
-
onClick: glassTileClickHandler
|
|
31
|
-
isInteractive = true
|
|
30
|
+
onClick: glassTileClickHandler
|
|
32
31
|
} = _ref;
|
|
33
32
|
const prefix = usePrefix.usePrefix();
|
|
34
33
|
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
@@ -41,7 +40,9 @@ const GlassTile = _ref => {
|
|
|
41
40
|
customContent: customContent,
|
|
42
41
|
isLoading: isLoading
|
|
43
42
|
});
|
|
44
|
-
|
|
43
|
+
|
|
44
|
+
// Non-interactive tile
|
|
45
|
+
if (!href && !glassTileClickHandler) {
|
|
45
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
47
|
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
47
48
|
key: id
|