@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;
|
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
|
14
14
|
var react = require('@carbon/react');
|
|
15
15
|
var lottie = require('../../_virtual/lottie.js');
|
|
16
16
|
var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
|
|
17
|
+
require('@carbon/react/icons');
|
|
17
18
|
var BaseTile = require('../Tiles/BaseTile/BaseTile.js');
|
|
18
19
|
var TasksController = require('../TasksController/TasksController.js');
|
|
19
20
|
var WorkspaceSelector = require('../WorkspaceSelector/WorkspaceSelector.js');
|
|
@@ -165,7 +166,8 @@ const AnimatedHeader = _ref => {
|
|
|
165
166
|
customContent: tile.customContent,
|
|
166
167
|
isLoading: isLoading || tile.isLoading,
|
|
167
168
|
isDisabled: tile.isDisabled,
|
|
168
|
-
disabledTaskLabel: disabledTaskLabel
|
|
169
|
+
disabledTaskLabel: disabledTaskLabel,
|
|
170
|
+
isInteractive: tile.isInteractive
|
|
169
171
|
});
|
|
170
172
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
171
173
|
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;
|
|
@@ -46,7 +46,7 @@ const TasksController = _ref => {
|
|
|
46
46
|
hideLabel: true,
|
|
47
47
|
type: 'inline',
|
|
48
48
|
items: allTileGroups,
|
|
49
|
-
selectedItem: selectedTileGroup,
|
|
49
|
+
selectedItem: selectedTileGroup ?? undefined,
|
|
50
50
|
onChange: e => {
|
|
51
51
|
setSelectedTileGroup?.(e);
|
|
52
52
|
dropdownCustomOnChange?.(e);
|
|
@@ -54,6 +54,9 @@ const TasksController = _ref => {
|
|
|
54
54
|
...dropdownOverrideProps
|
|
55
55
|
};
|
|
56
56
|
}, [allTileGroups, selectedTileGroup, setSelectedTileGroup, blockClass, dropdownCustomClass, dropdownOverrideProps, dropdownCustomOnChange]);
|
|
57
|
+
if (!tasksControllerConfig?.type) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
57
60
|
if (isLoading || tasksControllerConfig?.isLoading) {
|
|
58
61
|
return /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
|
|
59
62
|
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;
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var react = require('@carbon/react');
|
|
12
|
-
var index = require('../../../node_modules/@carbon/icons-react/es/index.js');
|
|
13
12
|
var usePrefix = require('../../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
|
|
14
|
-
var
|
|
13
|
+
var icons = require('@carbon/react/icons');
|
|
15
14
|
|
|
16
|
-
var _AILabel;
|
|
15
|
+
var _AILabel, _Send;
|
|
17
16
|
|
|
18
17
|
/** Primary UI component for user interaction */
|
|
19
18
|
|
|
@@ -21,7 +20,7 @@ const AIPromptTile = _ref => {
|
|
|
21
20
|
let {
|
|
22
21
|
href,
|
|
23
22
|
id,
|
|
24
|
-
mainIcon,
|
|
23
|
+
mainIcon: MainIcon,
|
|
25
24
|
open,
|
|
26
25
|
productName,
|
|
27
26
|
title,
|
|
@@ -34,8 +33,6 @@ const AIPromptTile = _ref => {
|
|
|
34
33
|
const collapsed = `${blockClass}--collapsed`;
|
|
35
34
|
const disabled = `${blockClass}--disabled`;
|
|
36
35
|
const [textInput, setTextInput] = React.useState('');
|
|
37
|
-
const MainIcon = mainIcon ? index[mainIcon] : null;
|
|
38
|
-
const Send = bucket15.Send;
|
|
39
36
|
const handleTextInput = e => {
|
|
40
37
|
setTextInput(e.target.value);
|
|
41
38
|
};
|
|
@@ -96,7 +93,7 @@ const AIPromptTile = _ref => {
|
|
|
96
93
|
align: "top-right",
|
|
97
94
|
onClick: () => openInNewTab(`${href}&primed_chat=${textInput}`),
|
|
98
95
|
onKeyDown: handleTextInputKeyDown
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Send, null))), /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
}, _Send || (_Send = /*#__PURE__*/React.createElement(icons.Send, null)))), /*#__PURE__*/React.createElement("div", {
|
|
100
97
|
className: `${blockClass}--footer`
|
|
101
98
|
}, /*#__PURE__*/React.createElement(react.Button, {
|
|
102
99
|
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 {};
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var react = require('@carbon/react');
|
|
12
|
-
var index = require('../../../node_modules/@carbon/icons-react/es/index.js');
|
|
13
12
|
var usePrefix = require('../../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
|
|
13
|
+
var GlassTileBody = require('./GlassTileBody.js');
|
|
14
14
|
|
|
15
15
|
/** Primary UI component for user interaction */
|
|
16
16
|
|
|
@@ -27,13 +27,26 @@ const GlassTile = _ref => {
|
|
|
27
27
|
isLoading,
|
|
28
28
|
isDisabled,
|
|
29
29
|
disabledTaskLabel,
|
|
30
|
-
onClick: glassTileClickHandler
|
|
30
|
+
onClick: glassTileClickHandler,
|
|
31
|
+
isInteractive = true
|
|
31
32
|
} = _ref;
|
|
32
33
|
const prefix = usePrefix.usePrefix();
|
|
33
34
|
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const body = /*#__PURE__*/React.createElement(GlassTileBody.GlassTileBody, {
|
|
36
|
+
mainIcon: mainIcon,
|
|
37
|
+
open: open,
|
|
38
|
+
secondaryIcon: secondaryIcon,
|
|
39
|
+
title: title,
|
|
40
|
+
subtitle: subtitle,
|
|
41
|
+
customContent: customContent,
|
|
42
|
+
isLoading: isLoading
|
|
43
|
+
});
|
|
44
|
+
if (isInteractive === false) {
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
47
|
+
key: id
|
|
48
|
+
}, body);
|
|
49
|
+
}
|
|
37
50
|
return /*#__PURE__*/React.createElement(react.Link, {
|
|
38
51
|
onClick: () => {
|
|
39
52
|
glassTileClickHandler?.();
|
|
@@ -43,29 +56,7 @@ const GlassTile = _ref => {
|
|
|
43
56
|
href: href ?? undefined,
|
|
44
57
|
disabled: isDisabled || isLoading,
|
|
45
58
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
46
|
-
},
|
|
47
|
-
className: `${blockClass}--loading-skeleton`
|
|
48
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
|
|
50
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: `${blockClass}--body-background`
|
|
52
|
-
}), customContent ? /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: `${blockClass}--custom-content`
|
|
54
|
-
}, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: `${blockClass}--icons`
|
|
56
|
-
}, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
|
|
57
|
-
fill: `var(--cds-icon-secondary)`,
|
|
58
|
-
size: 24
|
|
59
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: `${blockClass}--title`
|
|
61
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: `${blockClass}--footer`
|
|
63
|
-
}, subtitle && /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: `${blockClass}--subtitle`
|
|
65
|
-
}, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
|
|
66
|
-
size: 16,
|
|
67
|
-
fill: `var(--cds-icon-secondary)`
|
|
68
|
-
})))));
|
|
59
|
+
}, body);
|
|
69
60
|
};
|
|
70
61
|
|
|
71
62
|
exports.GlassTile = 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,55 @@
|
|
|
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
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var usePrefix = require('../../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
|
|
12
|
+
var react = require('@carbon/react');
|
|
13
|
+
|
|
14
|
+
const GlassTileBody = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
mainIcon: MainIcon,
|
|
17
|
+
open,
|
|
18
|
+
secondaryIcon: SecondaryIcon,
|
|
19
|
+
subtitle,
|
|
20
|
+
title,
|
|
21
|
+
customContent,
|
|
22
|
+
isLoading
|
|
23
|
+
} = _ref;
|
|
24
|
+
const prefix = usePrefix.usePrefix();
|
|
25
|
+
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
26
|
+
const collapsed = `${blockClass}--collapsed`;
|
|
27
|
+
if (isLoading) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
|
|
29
|
+
className: `${blockClass}--loading-skeleton`
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: `${blockClass}--body-background`
|
|
36
|
+
}), customContent ? /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: `${blockClass}--custom-content`
|
|
38
|
+
}, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: `${blockClass}--icons`
|
|
40
|
+
}, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
|
|
41
|
+
fill: `var(--cds-icon-secondary)`,
|
|
42
|
+
size: 24
|
|
43
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: `${blockClass}--title`
|
|
45
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: `${blockClass}--footer`
|
|
47
|
+
}, subtitle && /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: `${blockClass}--subtitle`
|
|
49
|
+
}, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
|
|
50
|
+
size: 16,
|
|
51
|
+
fill: `var(--cds-icon-secondary)`
|
|
52
|
+
}))));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.GlassTileBody = 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
|
};
|
|
@@ -39,7 +39,7 @@ const WorkspaceSelector = _ref => {
|
|
|
39
39
|
hideLabel: true,
|
|
40
40
|
type: 'inline',
|
|
41
41
|
items: workspaceSelectorConfig?.allWorkspaces,
|
|
42
|
-
selectedItem: workspaceSelectorConfig?.selectedWorkspace,
|
|
42
|
+
selectedItem: workspaceSelectorConfig?.selectedWorkspace ?? undefined,
|
|
43
43
|
onChange: e => {
|
|
44
44
|
workspaceSelectorConfig?.setSelectedWorkspace?.(e);
|
|
45
45
|
dropdownCustomOnChange?.(e);
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
var AnimatedHeader = require('./components/AnimatedHeader/AnimatedHeader.js');
|
|
11
11
|
require('react');
|
|
12
12
|
require('@carbon/react');
|
|
13
|
+
require('@carbon/react/icons');
|
|
13
14
|
var BaseTile = require('./components/Tiles/BaseTile/BaseTile.js');
|
|
14
15
|
var header_1312x738_data_fabric_light_03 = require('./assets/animated/header_1312x738_data_fabric_light_03.json.js');
|
|
15
16
|
var header_1312x738_data_fabric_dark_06 = require('./assets/animated/header_1312x738_data_fabric_dark_06.json.js');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon-labs/react-animated-header",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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": "
|
|
48
|
+
"gitHead": "56be4e1c18c10467e7e5117bc9b93099969231d5"
|
|
49
49
|
}
|