@carbon-labs/react-animated-header 0.17.0 → 0.19.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 +696 -168
- package/es/__stories__/data/index.d.ts +58 -14
- package/es/components/AnimatedHeader/AnimatedHeader.d.ts +4 -3
- package/es/components/AnimatedHeader/AnimatedHeader.js +3 -1
- package/es/components/TasksController/TasksController.d.ts +3 -3
- package/es/components/TasksController/TasksController.js +4 -1
- package/es/components/Tiles/AIPromptTile/AIPromptTile.d.ts +2 -2
- package/es/components/Tiles/AIPromptTile/AIPromptTile.js +4 -7
- package/es/components/Tiles/BaseTile/BaseTile.d.ts +4 -3
- package/es/components/Tiles/GlassTile/GlassTile.d.ts +2 -7
- package/es/components/Tiles/GlassTile/GlassTile.js +20 -29
- package/es/components/Tiles/GlassTile/GlassTileBody.d.ts +19 -0
- package/es/components/Tiles/GlassTile/GlassTileBody.js +53 -0
- package/es/components/WorkspaceSelector/WorkspaceSelector.d.ts +2 -2
- package/es/components/WorkspaceSelector/WorkspaceSelector.js +1 -1
- package/es/index.js +1 -0
- package/lib/__stories__/AnimatedHeader.stories.d.ts +696 -168
- package/lib/__stories__/data/index.d.ts +58 -14
- package/lib/components/AnimatedHeader/AnimatedHeader.d.ts +4 -3
- package/lib/components/AnimatedHeader/AnimatedHeader.js +3 -1
- package/lib/components/TasksController/TasksController.d.ts +3 -3
- package/lib/components/TasksController/TasksController.js +4 -1
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.d.ts +2 -2
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.js +4 -7
- package/lib/components/Tiles/BaseTile/BaseTile.d.ts +4 -3
- package/lib/components/Tiles/GlassTile/GlassTile.d.ts +2 -7
- package/lib/components/Tiles/GlassTile/GlassTile.js +19 -28
- package/lib/components/Tiles/GlassTile/GlassTileBody.d.ts +19 -0
- package/lib/components/Tiles/GlassTile/GlassTileBody.js +55 -0
- package/lib/components/WorkspaceSelector/WorkspaceSelector.d.ts +2 -2
- package/lib/components/WorkspaceSelector/WorkspaceSelector.js +1 -1
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/scss/Tiles/GlassTile/glass-tile.scss +0 -1
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -2956
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-1.js +0 -3263
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-10.js +0 -2946
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-11.js +0 -3112
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-12.js +0 -2967
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-13.js +0 -3056
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-14.js +0 -2888
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-15.js +0 -3072
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-16.js +0 -2992
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-17.js +0 -2843
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-18.js +0 -3080
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-19.js +0 -1680
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +0 -3096
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-4.js +0 -3008
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-5.js +0 -2916
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-6.js +0 -2992
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-7.js +0 -2983
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3106
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +0 -3090
- package/es/node_modules/@carbon/icons-react/es/index.js +0 -30
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-0.js +0 -3082
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-1.js +0 -3389
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-10.js +0 -3072
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-11.js +0 -3238
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-12.js +0 -3093
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-13.js +0 -3182
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-14.js +0 -3014
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-15.js +0 -3198
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-16.js +0 -3118
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-17.js +0 -2969
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-18.js +0 -3206
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-19.js +0 -1750
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +0 -3222
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-4.js +0 -3134
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-5.js +0 -3042
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-6.js +0 -3118
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-7.js +0 -3109
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3232
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +0 -3216
- package/lib/node_modules/@carbon/icons-react/es/index.js +0 -2480
|
@@ -9,14 +9,14 @@ export const headerTiles: ({
|
|
|
9
9
|
id: string;
|
|
10
10
|
href: string;
|
|
11
11
|
title: string;
|
|
12
|
-
mainIcon:
|
|
12
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
13
13
|
subtitle?: undefined;
|
|
14
14
|
} | {
|
|
15
15
|
id: string;
|
|
16
16
|
href: string;
|
|
17
17
|
title: string;
|
|
18
18
|
subtitle: string;
|
|
19
|
-
mainIcon:
|
|
19
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
20
20
|
})[];
|
|
21
21
|
} | {
|
|
22
22
|
id: number;
|
|
@@ -26,8 +26,27 @@ export const headerTiles: ({
|
|
|
26
26
|
href: string;
|
|
27
27
|
title: string;
|
|
28
28
|
subtitle: string;
|
|
29
|
-
mainIcon:
|
|
29
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
30
|
+
secondaryIcon?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
id: string;
|
|
33
|
+
href: string;
|
|
34
|
+
title: string;
|
|
35
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
36
|
+
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
37
|
+
subtitle?: undefined;
|
|
38
|
+
})[];
|
|
39
|
+
} | {
|
|
40
|
+
id: number;
|
|
41
|
+
label: string;
|
|
42
|
+
tiles: ({
|
|
43
|
+
id: string;
|
|
44
|
+
href: string;
|
|
45
|
+
title: string;
|
|
46
|
+
subtitle: string;
|
|
47
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
30
48
|
isLoading: boolean;
|
|
49
|
+
isInteractive?: undefined;
|
|
31
50
|
isDisabled?: undefined;
|
|
32
51
|
secondaryIcon?: undefined;
|
|
33
52
|
} | {
|
|
@@ -35,7 +54,8 @@ export const headerTiles: ({
|
|
|
35
54
|
href: string;
|
|
36
55
|
title: string;
|
|
37
56
|
subtitle: string;
|
|
38
|
-
mainIcon:
|
|
57
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
58
|
+
isInteractive: boolean;
|
|
39
59
|
isLoading?: undefined;
|
|
40
60
|
isDisabled?: undefined;
|
|
41
61
|
secondaryIcon?: undefined;
|
|
@@ -44,18 +64,20 @@ export const headerTiles: ({
|
|
|
44
64
|
href: string;
|
|
45
65
|
title: string;
|
|
46
66
|
subtitle: string;
|
|
47
|
-
mainIcon:
|
|
67
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
48
68
|
isDisabled: boolean;
|
|
49
69
|
isLoading?: undefined;
|
|
70
|
+
isInteractive?: undefined;
|
|
50
71
|
secondaryIcon?: undefined;
|
|
51
72
|
} | {
|
|
52
73
|
id: string;
|
|
53
74
|
href: string;
|
|
54
75
|
title: string;
|
|
55
|
-
mainIcon:
|
|
56
|
-
secondaryIcon:
|
|
76
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
77
|
+
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
57
78
|
subtitle?: undefined;
|
|
58
79
|
isLoading?: undefined;
|
|
80
|
+
isInteractive?: undefined;
|
|
59
81
|
isDisabled?: undefined;
|
|
60
82
|
})[];
|
|
61
83
|
} | {
|
|
@@ -89,14 +111,32 @@ export namespace tasksControllerConfigDropdown {
|
|
|
89
111
|
id: string;
|
|
90
112
|
href: string;
|
|
91
113
|
title: string;
|
|
92
|
-
mainIcon:
|
|
114
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
93
115
|
subtitle?: undefined;
|
|
94
116
|
} | {
|
|
95
117
|
id: string;
|
|
96
118
|
href: string;
|
|
97
119
|
title: string;
|
|
98
120
|
subtitle: string;
|
|
99
|
-
mainIcon:
|
|
121
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
122
|
+
})[];
|
|
123
|
+
} | {
|
|
124
|
+
id: number;
|
|
125
|
+
label: string;
|
|
126
|
+
tiles: ({
|
|
127
|
+
id: string;
|
|
128
|
+
href: string;
|
|
129
|
+
title: string;
|
|
130
|
+
subtitle: string;
|
|
131
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
132
|
+
secondaryIcon?: undefined;
|
|
133
|
+
} | {
|
|
134
|
+
id: string;
|
|
135
|
+
href: string;
|
|
136
|
+
title: string;
|
|
137
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
138
|
+
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
139
|
+
subtitle?: undefined;
|
|
100
140
|
})[];
|
|
101
141
|
} | {
|
|
102
142
|
id: number;
|
|
@@ -106,8 +146,9 @@ export namespace tasksControllerConfigDropdown {
|
|
|
106
146
|
href: string;
|
|
107
147
|
title: string;
|
|
108
148
|
subtitle: string;
|
|
109
|
-
mainIcon:
|
|
149
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
110
150
|
isLoading: boolean;
|
|
151
|
+
isInteractive?: undefined;
|
|
111
152
|
isDisabled?: undefined;
|
|
112
153
|
secondaryIcon?: undefined;
|
|
113
154
|
} | {
|
|
@@ -115,7 +156,8 @@ export namespace tasksControllerConfigDropdown {
|
|
|
115
156
|
href: string;
|
|
116
157
|
title: string;
|
|
117
158
|
subtitle: string;
|
|
118
|
-
mainIcon:
|
|
159
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
160
|
+
isInteractive: boolean;
|
|
119
161
|
isLoading?: undefined;
|
|
120
162
|
isDisabled?: undefined;
|
|
121
163
|
secondaryIcon?: undefined;
|
|
@@ -124,18 +166,20 @@ export namespace tasksControllerConfigDropdown {
|
|
|
124
166
|
href: string;
|
|
125
167
|
title: string;
|
|
126
168
|
subtitle: string;
|
|
127
|
-
mainIcon:
|
|
169
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
128
170
|
isDisabled: boolean;
|
|
129
171
|
isLoading?: undefined;
|
|
172
|
+
isInteractive?: undefined;
|
|
130
173
|
secondaryIcon?: undefined;
|
|
131
174
|
} | {
|
|
132
175
|
id: string;
|
|
133
176
|
href: string;
|
|
134
177
|
title: string;
|
|
135
|
-
mainIcon:
|
|
136
|
-
secondaryIcon:
|
|
178
|
+
mainIcon: import("@carbon/react/icons").CarbonIconType;
|
|
179
|
+
secondaryIcon: import("@carbon/react/icons").CarbonIconType;
|
|
137
180
|
subtitle?: undefined;
|
|
138
181
|
isLoading?: undefined;
|
|
182
|
+
isInteractive?: undefined;
|
|
139
183
|
isDisabled?: undefined;
|
|
140
184
|
})[];
|
|
141
185
|
} | {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { TasksControllerProps } from '../TasksController/TasksController';
|
|
3
3
|
import { WorkspaceSelectorProps } from '../WorkspaceSelector/WorkspaceSelector';
|
|
4
4
|
/** Animated Header */
|
|
5
5
|
export interface Tile {
|
|
6
6
|
href?: string | null;
|
|
7
7
|
id: string;
|
|
8
|
-
mainIcon?:
|
|
9
|
-
secondaryIcon?:
|
|
8
|
+
mainIcon?: ElementType | null;
|
|
9
|
+
secondaryIcon?: ElementType | null;
|
|
10
10
|
subtitle?: string | null;
|
|
11
11
|
title?: string | null;
|
|
12
12
|
customContent?: ReactNode | null;
|
|
13
13
|
isLoading?: boolean;
|
|
14
14
|
isDisabled?: boolean;
|
|
15
|
+
isInteractive?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export interface TileGroup {
|
|
17
18
|
id: number;
|
|
@@ -10,6 +10,7 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
10
10
|
import { Grid, Column, Tooltip, Button } from '@carbon/react';
|
|
11
11
|
import lottie from '../../_virtual/lottie.js';
|
|
12
12
|
import { usePrefix } from '../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
|
|
13
|
+
import '@carbon/react/icons';
|
|
13
14
|
import { BaseTile } from '../Tiles/BaseTile/BaseTile.js';
|
|
14
15
|
import TasksController from '../TasksController/TasksController.js';
|
|
15
16
|
import WorkspaceSelector from '../WorkspaceSelector/WorkspaceSelector.js';
|
|
@@ -161,7 +162,8 @@ const AnimatedHeader = _ref => {
|
|
|
161
162
|
customContent: tile.customContent,
|
|
162
163
|
isLoading: isLoading || tile.isLoading,
|
|
163
164
|
isDisabled: tile.isDisabled,
|
|
164
|
-
disabledTaskLabel: disabledTaskLabel
|
|
165
|
+
disabledTaskLabel: disabledTaskLabel,
|
|
166
|
+
isInteractive: tile.isInteractive
|
|
165
167
|
});
|
|
166
168
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
167
169
|
className: `${blockClass}__button-collapse--gradient`
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { ButtonBaseProps, DropdownProps } from '@carbon/react';
|
|
10
10
|
import { TileGroup } from '../AnimatedHeader/AnimatedHeader';
|
|
11
11
|
export interface TasksControllerConfig {
|
|
12
|
-
type: 'button' | 'dropdown';
|
|
12
|
+
type: 'button' | 'dropdown' | null;
|
|
13
13
|
isLoading?: boolean;
|
|
14
14
|
button?: {
|
|
15
15
|
text: string;
|
|
@@ -20,10 +20,10 @@ export interface TasksControllerConfig {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export type TasksControllerProps = {
|
|
23
|
-
tasksControllerConfig?: TasksControllerConfig;
|
|
23
|
+
tasksControllerConfig?: TasksControllerConfig | null;
|
|
24
24
|
isLoading?: boolean;
|
|
25
25
|
allTileGroups?: TileGroup[];
|
|
26
|
-
selectedTileGroup?: TileGroup;
|
|
26
|
+
selectedTileGroup?: TileGroup | null;
|
|
27
27
|
setSelectedTileGroup: (e: any) => void;
|
|
28
28
|
};
|
|
29
29
|
declare const TasksController: ({ tasksControllerConfig, isLoading, allTileGroups, selectedTileGroup, setSelectedTileGroup, }: TasksControllerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -42,7 +42,7 @@ const TasksController = _ref => {
|
|
|
42
42
|
hideLabel: true,
|
|
43
43
|
type: 'inline',
|
|
44
44
|
items: allTileGroups,
|
|
45
|
-
selectedItem: selectedTileGroup,
|
|
45
|
+
selectedItem: selectedTileGroup ?? undefined,
|
|
46
46
|
onChange: e => {
|
|
47
47
|
setSelectedTileGroup?.(e);
|
|
48
48
|
dropdownCustomOnChange?.(e);
|
|
@@ -50,6 +50,9 @@ const TasksController = _ref => {
|
|
|
50
50
|
...dropdownOverrideProps
|
|
51
51
|
};
|
|
52
52
|
}, [allTileGroups, selectedTileGroup, setSelectedTileGroup, blockClass, dropdownCustomClass, dropdownOverrideProps, dropdownCustomOnChange]);
|
|
53
|
+
if (!tasksControllerConfig?.type) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
53
56
|
if (isLoading || tasksControllerConfig?.isLoading) {
|
|
54
57
|
return /*#__PURE__*/React.createElement(SkeletonPlaceholder, {
|
|
55
58
|
className: `${blockClass}__task-controller-skeleton`
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ElementType } from 'react';
|
|
10
10
|
/** Primary UI component for user interaction */
|
|
11
11
|
interface AIPromptTileProps {
|
|
12
12
|
href?: string | null;
|
|
13
13
|
id?: string;
|
|
14
|
-
mainIcon?:
|
|
14
|
+
mainIcon?: ElementType | null;
|
|
15
15
|
open?: boolean;
|
|
16
16
|
productName?: string;
|
|
17
17
|
title?: string | null;
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
import { SkeletonPlaceholder, AILabel, TextInput, IconButton, Button } from '@carbon/react';
|
|
10
|
-
import * as index from '../../../node_modules/@carbon/icons-react/es/index.js';
|
|
11
10
|
import { usePrefix } from '../../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
|
|
12
|
-
import { Send } from '
|
|
11
|
+
import { Send } from '@carbon/react/icons';
|
|
13
12
|
|
|
14
|
-
var _AILabel;
|
|
13
|
+
var _AILabel, _Send;
|
|
15
14
|
|
|
16
15
|
/** Primary UI component for user interaction */
|
|
17
16
|
|
|
@@ -19,7 +18,7 @@ const AIPromptTile = _ref => {
|
|
|
19
18
|
let {
|
|
20
19
|
href,
|
|
21
20
|
id,
|
|
22
|
-
mainIcon,
|
|
21
|
+
mainIcon: MainIcon,
|
|
23
22
|
open,
|
|
24
23
|
productName,
|
|
25
24
|
title,
|
|
@@ -32,8 +31,6 @@ const AIPromptTile = _ref => {
|
|
|
32
31
|
const collapsed = `${blockClass}--collapsed`;
|
|
33
32
|
const disabled = `${blockClass}--disabled`;
|
|
34
33
|
const [textInput, setTextInput] = useState('');
|
|
35
|
-
const MainIcon = mainIcon ? index[mainIcon] : null;
|
|
36
|
-
const Send$1 = Send;
|
|
37
34
|
const handleTextInput = e => {
|
|
38
35
|
setTextInput(e.target.value);
|
|
39
36
|
};
|
|
@@ -94,7 +91,7 @@ const AIPromptTile = _ref => {
|
|
|
94
91
|
align: "top-right",
|
|
95
92
|
onClick: () => openInNewTab(`${href}&primed_chat=${textInput}`),
|
|
96
93
|
onKeyDown: handleTextInputKeyDown
|
|
97
|
-
}, /*#__PURE__*/React.createElement(Send
|
|
94
|
+
}, _Send || (_Send = /*#__PURE__*/React.createElement(Send, null)))), /*#__PURE__*/React.createElement("div", {
|
|
98
95
|
className: `${blockClass}--footer`
|
|
99
96
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
100
97
|
kind: "ghost",
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import React, { ReactNode } from 'react';
|
|
9
|
+
import React, { ElementType, ReactNode } from 'react';
|
|
10
10
|
/** Base Tile */
|
|
11
11
|
interface BaseTileProps {
|
|
12
12
|
id?: string;
|
|
13
13
|
open?: boolean;
|
|
14
14
|
href?: string | null;
|
|
15
|
-
mainIcon?:
|
|
16
|
-
secondaryIcon?:
|
|
15
|
+
mainIcon?: ElementType | null;
|
|
16
|
+
secondaryIcon?: ElementType | null;
|
|
17
17
|
title?: string | null;
|
|
18
18
|
subtitle?: string | null;
|
|
19
19
|
productName?: string;
|
|
@@ -22,6 +22,7 @@ interface BaseTileProps {
|
|
|
22
22
|
isDisabled?: boolean;
|
|
23
23
|
disabledTaskLabel?: string;
|
|
24
24
|
onClick?: () => void;
|
|
25
|
+
isInteractive?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare const BaseTile: React.FC<BaseTileProps>;
|
|
27
28
|
export {};
|
|
@@ -6,21 +6,16 @@
|
|
|
6
6
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import React
|
|
9
|
+
import React from 'react';
|
|
10
10
|
/** Primary UI component for user interaction */
|
|
11
11
|
interface GlassTileProps {
|
|
12
12
|
href?: string | null;
|
|
13
13
|
id?: string;
|
|
14
|
-
mainIcon?: string | null;
|
|
15
|
-
open?: boolean;
|
|
16
|
-
secondaryIcon?: string | null;
|
|
17
|
-
subtitle?: string | null;
|
|
18
|
-
title?: string | null;
|
|
19
|
-
customContent?: ReactNode;
|
|
20
14
|
isLoading?: boolean;
|
|
21
15
|
isDisabled?: boolean;
|
|
22
16
|
disabledTaskLabel?: string;
|
|
23
17
|
onClick?: () => void;
|
|
18
|
+
isInteractive?: boolean;
|
|
24
19
|
}
|
|
25
20
|
export declare const GlassTile: React.FC<GlassTileProps>;
|
|
26
21
|
export {};
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { Link
|
|
10
|
-
import * as index from '../../../node_modules/@carbon/icons-react/es/index.js';
|
|
9
|
+
import { Link } from '@carbon/react';
|
|
11
10
|
import { usePrefix } from '../../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
|
|
11
|
+
import { GlassTileBody } from './GlassTileBody.js';
|
|
12
12
|
|
|
13
13
|
/** Primary UI component for user interaction */
|
|
14
14
|
|
|
@@ -25,13 +25,26 @@ const GlassTile = _ref => {
|
|
|
25
25
|
isLoading,
|
|
26
26
|
isDisabled,
|
|
27
27
|
disabledTaskLabel,
|
|
28
|
-
onClick: glassTileClickHandler
|
|
28
|
+
onClick: glassTileClickHandler,
|
|
29
|
+
isInteractive = true
|
|
29
30
|
} = _ref;
|
|
30
31
|
const prefix = usePrefix();
|
|
31
32
|
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const body = /*#__PURE__*/React.createElement(GlassTileBody, {
|
|
34
|
+
mainIcon: mainIcon,
|
|
35
|
+
open: open,
|
|
36
|
+
secondaryIcon: secondaryIcon,
|
|
37
|
+
title: title,
|
|
38
|
+
subtitle: subtitle,
|
|
39
|
+
customContent: customContent,
|
|
40
|
+
isLoading: isLoading
|
|
41
|
+
});
|
|
42
|
+
if (isInteractive === false) {
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
45
|
+
key: id
|
|
46
|
+
}, body);
|
|
47
|
+
}
|
|
35
48
|
return /*#__PURE__*/React.createElement(Link, {
|
|
36
49
|
onClick: () => {
|
|
37
50
|
glassTileClickHandler?.();
|
|
@@ -41,29 +54,7 @@ const GlassTile = _ref => {
|
|
|
41
54
|
href: href ?? undefined,
|
|
42
55
|
disabled: isDisabled || isLoading,
|
|
43
56
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
44
|
-
},
|
|
45
|
-
className: `${blockClass}--loading-skeleton`
|
|
46
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
|
|
48
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: `${blockClass}--body-background`
|
|
50
|
-
}), customContent ? /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: `${blockClass}--custom-content`
|
|
52
|
-
}, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: `${blockClass}--icons`
|
|
54
|
-
}, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
|
|
55
|
-
fill: `var(--cds-icon-secondary)`,
|
|
56
|
-
size: 24
|
|
57
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: `${blockClass}--title`
|
|
59
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: `${blockClass}--footer`
|
|
61
|
-
}, subtitle && /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: `${blockClass}--subtitle`
|
|
63
|
-
}, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
|
|
64
|
-
size: 16,
|
|
65
|
-
fill: `var(--cds-icon-secondary)`
|
|
66
|
-
})))));
|
|
57
|
+
}, body);
|
|
67
58
|
};
|
|
68
59
|
|
|
69
60
|
export { GlassTile };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { ElementType, ReactNode } from 'react';
|
|
10
|
+
export type GlassTileBodyProps = {
|
|
11
|
+
mainIcon?: ElementType | null;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
secondaryIcon?: ElementType | null;
|
|
14
|
+
subtitle?: string | null;
|
|
15
|
+
title?: string | null;
|
|
16
|
+
customContent?: ReactNode;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const GlassTileBody: ({ mainIcon: MainIcon, open, secondaryIcon: SecondaryIcon, subtitle, title, customContent, isLoading, }: GlassTileBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { usePrefix } from '../../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
|
|
10
|
+
import { SkeletonPlaceholder } from '@carbon/react';
|
|
11
|
+
|
|
12
|
+
const GlassTileBody = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
mainIcon: MainIcon,
|
|
15
|
+
open,
|
|
16
|
+
secondaryIcon: SecondaryIcon,
|
|
17
|
+
subtitle,
|
|
18
|
+
title,
|
|
19
|
+
customContent,
|
|
20
|
+
isLoading
|
|
21
|
+
} = _ref;
|
|
22
|
+
const prefix = usePrefix();
|
|
23
|
+
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
24
|
+
const collapsed = `${blockClass}--collapsed`;
|
|
25
|
+
if (isLoading) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(SkeletonPlaceholder, {
|
|
27
|
+
className: `${blockClass}--loading-skeleton`
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: `${blockClass}--body-background`
|
|
34
|
+
}), customContent ? /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: `${blockClass}--custom-content`
|
|
36
|
+
}, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: `${blockClass}--icons`
|
|
38
|
+
}, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
|
|
39
|
+
fill: `var(--cds-icon-secondary)`,
|
|
40
|
+
size: 24
|
|
41
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: `${blockClass}--title`
|
|
43
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: `${blockClass}--footer`
|
|
45
|
+
}, subtitle && /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: `${blockClass}--subtitle`
|
|
47
|
+
}, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
|
|
48
|
+
size: 16,
|
|
49
|
+
fill: `var(--cds-icon-secondary)`
|
|
50
|
+
}))));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { GlassTileBody };
|
|
@@ -14,12 +14,12 @@ export interface Workspace {
|
|
|
14
14
|
export type WorkspaceSelectorConfig = {
|
|
15
15
|
propsOverrides: Partial<Omit<DropdownProps<Workspace>, 'id' | 'items' | 'selectedItem' | 'setSelectedWorkspace'>>;
|
|
16
16
|
allWorkspaces: Workspace[];
|
|
17
|
-
selectedWorkspace?: Workspace;
|
|
17
|
+
selectedWorkspace?: Workspace | null;
|
|
18
18
|
setSelectedWorkspace: (e: any) => void;
|
|
19
19
|
isLoading?: boolean;
|
|
20
20
|
};
|
|
21
21
|
export type WorkspaceSelectorProps = {
|
|
22
|
-
workspaceSelectorConfig?: WorkspaceSelectorConfig;
|
|
22
|
+
workspaceSelectorConfig?: WorkspaceSelectorConfig | null;
|
|
23
23
|
userName?: string;
|
|
24
24
|
isLoading?: boolean;
|
|
25
25
|
};
|
|
@@ -35,7 +35,7 @@ const WorkspaceSelector = _ref => {
|
|
|
35
35
|
hideLabel: true,
|
|
36
36
|
type: 'inline',
|
|
37
37
|
items: workspaceSelectorConfig?.allWorkspaces,
|
|
38
|
-
selectedItem: workspaceSelectorConfig?.selectedWorkspace,
|
|
38
|
+
selectedItem: workspaceSelectorConfig?.selectedWorkspace ?? undefined,
|
|
39
39
|
onChange: e => {
|
|
40
40
|
workspaceSelectorConfig?.setSelectedWorkspace?.(e);
|
|
41
41
|
dropdownCustomOnChange?.(e);
|
package/es/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export { default as AnimatedHeader } from './components/AnimatedHeader/AnimatedHeader.js';
|
|
9
9
|
import 'react';
|
|
10
10
|
import '@carbon/react';
|
|
11
|
+
import '@carbon/react/icons';
|
|
11
12
|
export { BaseTile } from './components/Tiles/BaseTile/BaseTile.js';
|
|
12
13
|
export { default as dataFabricAnimatedLight } from './assets/animated/header_1312x738_data_fabric_light_03.json.js';
|
|
13
14
|
export { default as dataFabricAnimatedDark } from './assets/animated/header_1312x738_data_fabric_dark_06.json.js';
|