@carbon-labs/react-animated-header 0.10.0 → 0.12.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.
@@ -8250,6 +8250,7 @@ export declare const ThemeG10: {
8250
8250
  5: string;
8251
8251
  6: string;
8252
8252
  7: string;
8253
+ 8: string;
8253
8254
  };
8254
8255
  };
8255
8256
  options: number[];
@@ -8289,6 +8290,13 @@ export declare const ThemeG10: {
8289
8290
  secondaryIcon: string;
8290
8291
  subtitle?: undefined;
8291
8292
  })[];
8293
+ } | {
8294
+ id: number;
8295
+ label: string;
8296
+ tiles: {
8297
+ id: string;
8298
+ customContent: import("react/jsx-runtime").JSX.Element;
8299
+ }[];
8292
8300
  };
8293
8301
  2: {
8294
8302
  id: number;
@@ -8324,6 +8332,13 @@ export declare const ThemeG10: {
8324
8332
  secondaryIcon: string;
8325
8333
  subtitle?: undefined;
8326
8334
  })[];
8335
+ } | {
8336
+ id: number;
8337
+ label: string;
8338
+ tiles: {
8339
+ id: string;
8340
+ customContent: import("react/jsx-runtime").JSX.Element;
8341
+ }[];
8327
8342
  };
8328
8343
  3: {
8329
8344
  id: number;
@@ -8359,6 +8374,13 @@ export declare const ThemeG10: {
8359
8374
  secondaryIcon: string;
8360
8375
  subtitle?: undefined;
8361
8376
  })[];
8377
+ } | {
8378
+ id: number;
8379
+ label: string;
8380
+ tiles: {
8381
+ id: string;
8382
+ customContent: import("react/jsx-runtime").JSX.Element;
8383
+ }[];
8362
8384
  };
8363
8385
  4: {
8364
8386
  id: number;
@@ -8394,6 +8416,13 @@ export declare const ThemeG10: {
8394
8416
  secondaryIcon: string;
8395
8417
  subtitle?: undefined;
8396
8418
  })[];
8419
+ } | {
8420
+ id: number;
8421
+ label: string;
8422
+ tiles: {
8423
+ id: string;
8424
+ customContent: import("react/jsx-runtime").JSX.Element;
8425
+ }[];
8397
8426
  };
8398
8427
  5: {
8399
8428
  id: number;
@@ -8429,6 +8458,13 @@ export declare const ThemeG10: {
8429
8458
  secondaryIcon: string;
8430
8459
  subtitle?: undefined;
8431
8460
  })[];
8461
+ } | {
8462
+ id: number;
8463
+ label: string;
8464
+ tiles: {
8465
+ id: string;
8466
+ customContent: import("react/jsx-runtime").JSX.Element;
8467
+ }[];
8432
8468
  };
8433
8469
  6: {
8434
8470
  id: number;
@@ -8464,6 +8500,13 @@ export declare const ThemeG10: {
8464
8500
  secondaryIcon: string;
8465
8501
  subtitle?: undefined;
8466
8502
  })[];
8503
+ } | {
8504
+ id: number;
8505
+ label: string;
8506
+ tiles: {
8507
+ id: string;
8508
+ customContent: import("react/jsx-runtime").JSX.Element;
8509
+ }[];
8467
8510
  };
8468
8511
  7: {
8469
8512
  id: number;
@@ -8499,6 +8542,55 @@ export declare const ThemeG10: {
8499
8542
  secondaryIcon: string;
8500
8543
  subtitle?: undefined;
8501
8544
  })[];
8545
+ } | {
8546
+ id: number;
8547
+ label: string;
8548
+ tiles: {
8549
+ id: string;
8550
+ customContent: import("react/jsx-runtime").JSX.Element;
8551
+ }[];
8552
+ };
8553
+ 8: {
8554
+ id: number;
8555
+ label: string;
8556
+ tiles: ({
8557
+ id: string;
8558
+ href: string;
8559
+ title: string;
8560
+ mainIcon: string;
8561
+ subtitle?: undefined;
8562
+ } | {
8563
+ id: string;
8564
+ href: string;
8565
+ title: string;
8566
+ subtitle: string;
8567
+ mainIcon: string;
8568
+ })[];
8569
+ } | {
8570
+ id: number;
8571
+ label: string;
8572
+ tiles: ({
8573
+ id: string;
8574
+ href: string;
8575
+ title: string;
8576
+ subtitle: string;
8577
+ mainIcon: string;
8578
+ secondaryIcon?: undefined;
8579
+ } | {
8580
+ id: string;
8581
+ href: string;
8582
+ title: string;
8583
+ mainIcon: string;
8584
+ secondaryIcon: string;
8585
+ subtitle?: undefined;
8586
+ })[];
8587
+ } | {
8588
+ id: number;
8589
+ label: string;
8590
+ tiles: {
8591
+ id: string;
8592
+ customContent: import("react/jsx-runtime").JSX.Element;
8593
+ }[];
8502
8594
  };
8503
8595
  };
8504
8596
  };
@@ -8545,6 +8637,14 @@ export declare const ThemeG10: {
8545
8637
  workspaceLabel: {
8546
8638
  description: string;
8547
8639
  };
8640
+ expandButtonLabel: {
8641
+ description: string;
8642
+ type: string;
8643
+ };
8644
+ collapseButtonLabel: {
8645
+ description: string;
8646
+ type: string;
8647
+ };
8548
8648
  };
8549
8649
  args: {
8550
8650
  allTiles: ({
@@ -8581,6 +8681,13 @@ export declare const ThemeG10: {
8581
8681
  secondaryIcon: string;
8582
8682
  subtitle?: undefined;
8583
8683
  })[];
8684
+ } | {
8685
+ id: number;
8686
+ label: string;
8687
+ tiles: {
8688
+ id: string;
8689
+ customContent: import("react/jsx-runtime").JSX.Element;
8690
+ }[];
8584
8691
  })[];
8585
8692
  allWorkspaces: {
8586
8693
  id: string;
@@ -8597,6 +8704,8 @@ export declare const ThemeG10: {
8597
8704
  tasksConfig: number;
8598
8705
  userName: string;
8599
8706
  welcomeText: string;
8707
+ expandButtonLabel: string;
8708
+ collapseButtonLabel: string;
8600
8709
  headerAnimation: number;
8601
8710
  };
8602
8711
  };
@@ -16847,6 +16956,7 @@ export declare const ThemeG100: {
16847
16956
  5: string;
16848
16957
  6: string;
16849
16958
  7: string;
16959
+ 8: string;
16850
16960
  };
16851
16961
  };
16852
16962
  options: number[];
@@ -16886,6 +16996,13 @@ export declare const ThemeG100: {
16886
16996
  secondaryIcon: string;
16887
16997
  subtitle?: undefined;
16888
16998
  })[];
16999
+ } | {
17000
+ id: number;
17001
+ label: string;
17002
+ tiles: {
17003
+ id: string;
17004
+ customContent: import("react/jsx-runtime").JSX.Element;
17005
+ }[];
16889
17006
  };
16890
17007
  2: {
16891
17008
  id: number;
@@ -16921,6 +17038,13 @@ export declare const ThemeG100: {
16921
17038
  secondaryIcon: string;
16922
17039
  subtitle?: undefined;
16923
17040
  })[];
17041
+ } | {
17042
+ id: number;
17043
+ label: string;
17044
+ tiles: {
17045
+ id: string;
17046
+ customContent: import("react/jsx-runtime").JSX.Element;
17047
+ }[];
16924
17048
  };
16925
17049
  3: {
16926
17050
  id: number;
@@ -16956,6 +17080,13 @@ export declare const ThemeG100: {
16956
17080
  secondaryIcon: string;
16957
17081
  subtitle?: undefined;
16958
17082
  })[];
17083
+ } | {
17084
+ id: number;
17085
+ label: string;
17086
+ tiles: {
17087
+ id: string;
17088
+ customContent: import("react/jsx-runtime").JSX.Element;
17089
+ }[];
16959
17090
  };
16960
17091
  4: {
16961
17092
  id: number;
@@ -16991,6 +17122,13 @@ export declare const ThemeG100: {
16991
17122
  secondaryIcon: string;
16992
17123
  subtitle?: undefined;
16993
17124
  })[];
17125
+ } | {
17126
+ id: number;
17127
+ label: string;
17128
+ tiles: {
17129
+ id: string;
17130
+ customContent: import("react/jsx-runtime").JSX.Element;
17131
+ }[];
16994
17132
  };
16995
17133
  5: {
16996
17134
  id: number;
@@ -17026,6 +17164,13 @@ export declare const ThemeG100: {
17026
17164
  secondaryIcon: string;
17027
17165
  subtitle?: undefined;
17028
17166
  })[];
17167
+ } | {
17168
+ id: number;
17169
+ label: string;
17170
+ tiles: {
17171
+ id: string;
17172
+ customContent: import("react/jsx-runtime").JSX.Element;
17173
+ }[];
17029
17174
  };
17030
17175
  6: {
17031
17176
  id: number;
@@ -17061,6 +17206,13 @@ export declare const ThemeG100: {
17061
17206
  secondaryIcon: string;
17062
17207
  subtitle?: undefined;
17063
17208
  })[];
17209
+ } | {
17210
+ id: number;
17211
+ label: string;
17212
+ tiles: {
17213
+ id: string;
17214
+ customContent: import("react/jsx-runtime").JSX.Element;
17215
+ }[];
17064
17216
  };
17065
17217
  7: {
17066
17218
  id: number;
@@ -17096,6 +17248,55 @@ export declare const ThemeG100: {
17096
17248
  secondaryIcon: string;
17097
17249
  subtitle?: undefined;
17098
17250
  })[];
17251
+ } | {
17252
+ id: number;
17253
+ label: string;
17254
+ tiles: {
17255
+ id: string;
17256
+ customContent: import("react/jsx-runtime").JSX.Element;
17257
+ }[];
17258
+ };
17259
+ 8: {
17260
+ id: number;
17261
+ label: string;
17262
+ tiles: ({
17263
+ id: string;
17264
+ href: string;
17265
+ title: string;
17266
+ mainIcon: string;
17267
+ subtitle?: undefined;
17268
+ } | {
17269
+ id: string;
17270
+ href: string;
17271
+ title: string;
17272
+ subtitle: string;
17273
+ mainIcon: string;
17274
+ })[];
17275
+ } | {
17276
+ id: number;
17277
+ label: string;
17278
+ tiles: ({
17279
+ id: string;
17280
+ href: string;
17281
+ title: string;
17282
+ subtitle: string;
17283
+ mainIcon: string;
17284
+ secondaryIcon?: undefined;
17285
+ } | {
17286
+ id: string;
17287
+ href: string;
17288
+ title: string;
17289
+ mainIcon: string;
17290
+ secondaryIcon: string;
17291
+ subtitle?: undefined;
17292
+ })[];
17293
+ } | {
17294
+ id: number;
17295
+ label: string;
17296
+ tiles: {
17297
+ id: string;
17298
+ customContent: import("react/jsx-runtime").JSX.Element;
17299
+ }[];
17099
17300
  };
17100
17301
  };
17101
17302
  };
@@ -17142,6 +17343,14 @@ export declare const ThemeG100: {
17142
17343
  workspaceLabel: {
17143
17344
  description: string;
17144
17345
  };
17346
+ expandButtonLabel: {
17347
+ description: string;
17348
+ type: string;
17349
+ };
17350
+ collapseButtonLabel: {
17351
+ description: string;
17352
+ type: string;
17353
+ };
17145
17354
  };
17146
17355
  args: {
17147
17356
  allTiles: ({
@@ -17178,6 +17387,13 @@ export declare const ThemeG100: {
17178
17387
  secondaryIcon: string;
17179
17388
  subtitle?: undefined;
17180
17389
  })[];
17390
+ } | {
17391
+ id: number;
17392
+ label: string;
17393
+ tiles: {
17394
+ id: string;
17395
+ customContent: import("react/jsx-runtime").JSX.Element;
17396
+ }[];
17181
17397
  })[];
17182
17398
  allWorkspaces: {
17183
17399
  id: string;
@@ -17194,6 +17410,8 @@ export declare const ThemeG100: {
17194
17410
  tasksConfig: number;
17195
17411
  userName: string;
17196
17412
  welcomeText: string;
17413
+ expandButtonLabel: string;
17414
+ collapseButtonLabel: string;
17197
17415
  headerAnimation: number;
17198
17416
  };
17199
17417
  globals: {
@@ -0,0 +1,10 @@
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
+ declare const SampleCustomTaskContent: () => import("react/jsx-runtime").JSX.Element;
10
+ export default SampleCustomTaskContent;
@@ -36,6 +36,13 @@ export const headerTiles: ({
36
36
  secondaryIcon: string;
37
37
  subtitle?: undefined;
38
38
  })[];
39
+ } | {
40
+ id: number;
41
+ label: string;
42
+ tiles: {
43
+ id: string;
44
+ customContent: import("react/jsx-runtime").JSX.Element;
45
+ }[];
39
46
  })[];
40
47
  export namespace tasksConfigButton {
41
48
  let type: string;
@@ -18,12 +18,13 @@ export interface SelectedWorkspace {
18
18
  label: string;
19
19
  }
20
20
  export interface Tile {
21
- href: string | null;
21
+ href?: string | null;
22
22
  id: string;
23
- mainIcon: string | null;
23
+ mainIcon?: string | null;
24
24
  secondaryIcon?: string | null;
25
25
  subtitle?: string | null;
26
- title: string | null;
26
+ title?: string | null;
27
+ customContent?: ReactNode | null;
27
28
  }
28
29
  export interface TileGroup {
29
30
  id: number;
@@ -49,6 +50,8 @@ export interface AnimatedHeaderProps {
49
50
  userName?: string;
50
51
  welcomeText?: string;
51
52
  workspaceLabel?: string;
53
+ expandButtonLabel?: string;
54
+ collapseButtonLabel?: string;
52
55
  }
53
56
  declare const AnimatedHeader: React.FC<AnimatedHeaderProps>;
54
57
  export default AnimatedHeader;
@@ -35,7 +35,9 @@ const AnimatedHeader = _ref => {
35
35
  tasksConfig,
36
36
  userName,
37
37
  welcomeText,
38
- workspaceLabel = `Open in: ${userName}'s workspace` || `Select a workspace`
38
+ workspaceLabel = `Open in: ${userName}'s workspace` || `Select a workspace`,
39
+ expandButtonLabel = 'Expand',
40
+ collapseButtonLabel = 'Collapse'
39
41
  } = _ref;
40
42
  const prefix = usePrefix();
41
43
  const blockClass = `${prefix}--animated-header`;
@@ -168,6 +170,8 @@ const AnimatedHeader = _ref => {
168
170
  itemToString: handleWorkspaceItemsToString
169
171
  } : {}, renderWorkspaceSelectedItem ? {
170
172
  renderSelectedItem: renderWorkspaceSelectedItem
173
+ } : {}, selectedWorkspace ? {
174
+ selectedItem: selectedWorkspace
171
175
  } : {}))), /*#__PURE__*/React.createElement("div", {
172
176
  className: `${blockClass}__tiles-container`
173
177
  }, selectedTileGroup.tiles.map(tile => {
@@ -180,7 +184,8 @@ const AnimatedHeader = _ref => {
180
184
  secondaryIcon: tile.secondaryIcon,
181
185
  title: tile.title,
182
186
  subtitle: tile.subtitle,
183
- productName: productName
187
+ productName: productName,
188
+ customContent: tile.customContent
184
189
  });
185
190
  }))), /*#__PURE__*/React.createElement("div", {
186
191
  className: `${blockClass}__button-collapse--gradient`
@@ -191,7 +196,7 @@ const AnimatedHeader = _ref => {
191
196
  kind: "ghost",
192
197
  renderIcon: open ? ChevronUp : ChevronDown,
193
198
  onClick: handleButtonCollapseClick
194
- }, open ? `Collapse` : `Expand`))));
199
+ }, open ? collapseButtonLabel : expandButtonLabel))));
195
200
  };
196
201
  AnimatedHeader.displayName = 'Animated Header';
197
202
  AnimatedHeader.propTypes = {
@@ -207,10 +212,18 @@ AnimatedHeader.propTypes = {
207
212
  * Specify an optional className to be added to your Animated Header
208
213
  */
209
214
  className: PropTypes.string,
215
+ /**
216
+ * Custom collapse button label
217
+ */
218
+ collapseButtonLabel: PropTypes.string,
210
219
  /**
211
220
  * Provide short sentence in max. 3 lines related to product context
212
221
  */
213
222
  description: PropTypes.string,
223
+ /**
224
+ * Custom expand button label
225
+ */
226
+ expandButtonLabel: PropTypes.string,
214
227
  /**
215
228
  * Helper function passed to downshift that allows the library to render a
216
229
  * given item to a string label. By default, it extracts the `label` field
@@ -6,7 +6,7 @@
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, { ReactNode } from 'react';
10
10
  /** Base Tile */
11
11
  interface BaseTileProps {
12
12
  id?: string;
@@ -17,6 +17,7 @@ interface BaseTileProps {
17
17
  title?: string;
18
18
  subtitle?: string;
19
19
  productName?: string;
20
+ customContent?: ReactNode;
20
21
  }
21
22
  export declare const BaseTile: React.FC<BaseTileProps>;
22
23
  export {};
@@ -20,7 +20,8 @@ const BaseTile = _ref => {
20
20
  secondaryIcon,
21
21
  title,
22
22
  subtitle,
23
- productName
23
+ productName,
24
+ customContent
24
25
  } = _ref;
25
26
  const props = {
26
27
  id,
@@ -30,7 +31,8 @@ const BaseTile = _ref => {
30
31
  secondaryIcon,
31
32
  title,
32
33
  subtitle,
33
- productName
34
+ productName,
35
+ customContent
34
36
  };
35
37
  const tile = id === 'ai-tile' ? /*#__PURE__*/React.createElement(AIPromptTile, props) : /*#__PURE__*/React.createElement(GlassTile, props);
36
38
  return tile;
@@ -6,7 +6,7 @@
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, { ReactNode } from 'react';
10
10
  /** Primary UI component for user interaction */
11
11
  interface GlassTileProps {
12
12
  href?: string;
@@ -16,6 +16,7 @@ interface GlassTileProps {
16
16
  secondaryIcon?: string;
17
17
  subtitle?: string;
18
18
  title?: string;
19
+ customContent?: ReactNode;
19
20
  }
20
21
  export declare const GlassTile: React.FC<GlassTileProps>;
21
22
  export {};
@@ -20,7 +20,8 @@ const GlassTile = _ref => {
20
20
  open,
21
21
  secondaryIcon,
22
22
  subtitle,
23
- title
23
+ title,
24
+ customContent
24
25
  } = _ref;
25
26
  const prefix = usePrefix();
26
27
  const blockClass = `${prefix}--animated-header__glass-tile`;
@@ -35,7 +36,9 @@ const GlassTile = _ref => {
35
36
  className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
36
37
  }, /*#__PURE__*/React.createElement("div", {
37
38
  className: `${blockClass}--body-background`
38
- }), /*#__PURE__*/React.createElement("div", {
39
+ }), customContent ? /*#__PURE__*/React.createElement("div", {
40
+ className: `${blockClass}--custom-content`
41
+ }, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
39
42
  className: `${blockClass}--icons`
40
43
  }, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
41
44
  fill: `var(--cds-icon-secondary)`,
@@ -49,7 +52,7 @@ const GlassTile = _ref => {
49
52
  }, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
50
53
  size: 16,
51
54
  fill: `var(--cds-icon-secondary)`
52
- }))));
55
+ })))));
53
56
  };
54
57
 
55
58
  export { GlassTile };
@@ -8250,6 +8250,7 @@ export declare const ThemeG10: {
8250
8250
  5: string;
8251
8251
  6: string;
8252
8252
  7: string;
8253
+ 8: string;
8253
8254
  };
8254
8255
  };
8255
8256
  options: number[];
@@ -8289,6 +8290,13 @@ export declare const ThemeG10: {
8289
8290
  secondaryIcon: string;
8290
8291
  subtitle?: undefined;
8291
8292
  })[];
8293
+ } | {
8294
+ id: number;
8295
+ label: string;
8296
+ tiles: {
8297
+ id: string;
8298
+ customContent: import("react/jsx-runtime").JSX.Element;
8299
+ }[];
8292
8300
  };
8293
8301
  2: {
8294
8302
  id: number;
@@ -8324,6 +8332,13 @@ export declare const ThemeG10: {
8324
8332
  secondaryIcon: string;
8325
8333
  subtitle?: undefined;
8326
8334
  })[];
8335
+ } | {
8336
+ id: number;
8337
+ label: string;
8338
+ tiles: {
8339
+ id: string;
8340
+ customContent: import("react/jsx-runtime").JSX.Element;
8341
+ }[];
8327
8342
  };
8328
8343
  3: {
8329
8344
  id: number;
@@ -8359,6 +8374,13 @@ export declare const ThemeG10: {
8359
8374
  secondaryIcon: string;
8360
8375
  subtitle?: undefined;
8361
8376
  })[];
8377
+ } | {
8378
+ id: number;
8379
+ label: string;
8380
+ tiles: {
8381
+ id: string;
8382
+ customContent: import("react/jsx-runtime").JSX.Element;
8383
+ }[];
8362
8384
  };
8363
8385
  4: {
8364
8386
  id: number;
@@ -8394,6 +8416,13 @@ export declare const ThemeG10: {
8394
8416
  secondaryIcon: string;
8395
8417
  subtitle?: undefined;
8396
8418
  })[];
8419
+ } | {
8420
+ id: number;
8421
+ label: string;
8422
+ tiles: {
8423
+ id: string;
8424
+ customContent: import("react/jsx-runtime").JSX.Element;
8425
+ }[];
8397
8426
  };
8398
8427
  5: {
8399
8428
  id: number;
@@ -8429,6 +8458,13 @@ export declare const ThemeG10: {
8429
8458
  secondaryIcon: string;
8430
8459
  subtitle?: undefined;
8431
8460
  })[];
8461
+ } | {
8462
+ id: number;
8463
+ label: string;
8464
+ tiles: {
8465
+ id: string;
8466
+ customContent: import("react/jsx-runtime").JSX.Element;
8467
+ }[];
8432
8468
  };
8433
8469
  6: {
8434
8470
  id: number;
@@ -8464,6 +8500,13 @@ export declare const ThemeG10: {
8464
8500
  secondaryIcon: string;
8465
8501
  subtitle?: undefined;
8466
8502
  })[];
8503
+ } | {
8504
+ id: number;
8505
+ label: string;
8506
+ tiles: {
8507
+ id: string;
8508
+ customContent: import("react/jsx-runtime").JSX.Element;
8509
+ }[];
8467
8510
  };
8468
8511
  7: {
8469
8512
  id: number;
@@ -8499,6 +8542,55 @@ export declare const ThemeG10: {
8499
8542
  secondaryIcon: string;
8500
8543
  subtitle?: undefined;
8501
8544
  })[];
8545
+ } | {
8546
+ id: number;
8547
+ label: string;
8548
+ tiles: {
8549
+ id: string;
8550
+ customContent: import("react/jsx-runtime").JSX.Element;
8551
+ }[];
8552
+ };
8553
+ 8: {
8554
+ id: number;
8555
+ label: string;
8556
+ tiles: ({
8557
+ id: string;
8558
+ href: string;
8559
+ title: string;
8560
+ mainIcon: string;
8561
+ subtitle?: undefined;
8562
+ } | {
8563
+ id: string;
8564
+ href: string;
8565
+ title: string;
8566
+ subtitle: string;
8567
+ mainIcon: string;
8568
+ })[];
8569
+ } | {
8570
+ id: number;
8571
+ label: string;
8572
+ tiles: ({
8573
+ id: string;
8574
+ href: string;
8575
+ title: string;
8576
+ subtitle: string;
8577
+ mainIcon: string;
8578
+ secondaryIcon?: undefined;
8579
+ } | {
8580
+ id: string;
8581
+ href: string;
8582
+ title: string;
8583
+ mainIcon: string;
8584
+ secondaryIcon: string;
8585
+ subtitle?: undefined;
8586
+ })[];
8587
+ } | {
8588
+ id: number;
8589
+ label: string;
8590
+ tiles: {
8591
+ id: string;
8592
+ customContent: import("react/jsx-runtime").JSX.Element;
8593
+ }[];
8502
8594
  };
8503
8595
  };
8504
8596
  };
@@ -8545,6 +8637,14 @@ export declare const ThemeG10: {
8545
8637
  workspaceLabel: {
8546
8638
  description: string;
8547
8639
  };
8640
+ expandButtonLabel: {
8641
+ description: string;
8642
+ type: string;
8643
+ };
8644
+ collapseButtonLabel: {
8645
+ description: string;
8646
+ type: string;
8647
+ };
8548
8648
  };
8549
8649
  args: {
8550
8650
  allTiles: ({
@@ -8581,6 +8681,13 @@ export declare const ThemeG10: {
8581
8681
  secondaryIcon: string;
8582
8682
  subtitle?: undefined;
8583
8683
  })[];
8684
+ } | {
8685
+ id: number;
8686
+ label: string;
8687
+ tiles: {
8688
+ id: string;
8689
+ customContent: import("react/jsx-runtime").JSX.Element;
8690
+ }[];
8584
8691
  })[];
8585
8692
  allWorkspaces: {
8586
8693
  id: string;
@@ -8597,6 +8704,8 @@ export declare const ThemeG10: {
8597
8704
  tasksConfig: number;
8598
8705
  userName: string;
8599
8706
  welcomeText: string;
8707
+ expandButtonLabel: string;
8708
+ collapseButtonLabel: string;
8600
8709
  headerAnimation: number;
8601
8710
  };
8602
8711
  };
@@ -16847,6 +16956,7 @@ export declare const ThemeG100: {
16847
16956
  5: string;
16848
16957
  6: string;
16849
16958
  7: string;
16959
+ 8: string;
16850
16960
  };
16851
16961
  };
16852
16962
  options: number[];
@@ -16886,6 +16996,13 @@ export declare const ThemeG100: {
16886
16996
  secondaryIcon: string;
16887
16997
  subtitle?: undefined;
16888
16998
  })[];
16999
+ } | {
17000
+ id: number;
17001
+ label: string;
17002
+ tiles: {
17003
+ id: string;
17004
+ customContent: import("react/jsx-runtime").JSX.Element;
17005
+ }[];
16889
17006
  };
16890
17007
  2: {
16891
17008
  id: number;
@@ -16921,6 +17038,13 @@ export declare const ThemeG100: {
16921
17038
  secondaryIcon: string;
16922
17039
  subtitle?: undefined;
16923
17040
  })[];
17041
+ } | {
17042
+ id: number;
17043
+ label: string;
17044
+ tiles: {
17045
+ id: string;
17046
+ customContent: import("react/jsx-runtime").JSX.Element;
17047
+ }[];
16924
17048
  };
16925
17049
  3: {
16926
17050
  id: number;
@@ -16956,6 +17080,13 @@ export declare const ThemeG100: {
16956
17080
  secondaryIcon: string;
16957
17081
  subtitle?: undefined;
16958
17082
  })[];
17083
+ } | {
17084
+ id: number;
17085
+ label: string;
17086
+ tiles: {
17087
+ id: string;
17088
+ customContent: import("react/jsx-runtime").JSX.Element;
17089
+ }[];
16959
17090
  };
16960
17091
  4: {
16961
17092
  id: number;
@@ -16991,6 +17122,13 @@ export declare const ThemeG100: {
16991
17122
  secondaryIcon: string;
16992
17123
  subtitle?: undefined;
16993
17124
  })[];
17125
+ } | {
17126
+ id: number;
17127
+ label: string;
17128
+ tiles: {
17129
+ id: string;
17130
+ customContent: import("react/jsx-runtime").JSX.Element;
17131
+ }[];
16994
17132
  };
16995
17133
  5: {
16996
17134
  id: number;
@@ -17026,6 +17164,13 @@ export declare const ThemeG100: {
17026
17164
  secondaryIcon: string;
17027
17165
  subtitle?: undefined;
17028
17166
  })[];
17167
+ } | {
17168
+ id: number;
17169
+ label: string;
17170
+ tiles: {
17171
+ id: string;
17172
+ customContent: import("react/jsx-runtime").JSX.Element;
17173
+ }[];
17029
17174
  };
17030
17175
  6: {
17031
17176
  id: number;
@@ -17061,6 +17206,13 @@ export declare const ThemeG100: {
17061
17206
  secondaryIcon: string;
17062
17207
  subtitle?: undefined;
17063
17208
  })[];
17209
+ } | {
17210
+ id: number;
17211
+ label: string;
17212
+ tiles: {
17213
+ id: string;
17214
+ customContent: import("react/jsx-runtime").JSX.Element;
17215
+ }[];
17064
17216
  };
17065
17217
  7: {
17066
17218
  id: number;
@@ -17096,6 +17248,55 @@ export declare const ThemeG100: {
17096
17248
  secondaryIcon: string;
17097
17249
  subtitle?: undefined;
17098
17250
  })[];
17251
+ } | {
17252
+ id: number;
17253
+ label: string;
17254
+ tiles: {
17255
+ id: string;
17256
+ customContent: import("react/jsx-runtime").JSX.Element;
17257
+ }[];
17258
+ };
17259
+ 8: {
17260
+ id: number;
17261
+ label: string;
17262
+ tiles: ({
17263
+ id: string;
17264
+ href: string;
17265
+ title: string;
17266
+ mainIcon: string;
17267
+ subtitle?: undefined;
17268
+ } | {
17269
+ id: string;
17270
+ href: string;
17271
+ title: string;
17272
+ subtitle: string;
17273
+ mainIcon: string;
17274
+ })[];
17275
+ } | {
17276
+ id: number;
17277
+ label: string;
17278
+ tiles: ({
17279
+ id: string;
17280
+ href: string;
17281
+ title: string;
17282
+ subtitle: string;
17283
+ mainIcon: string;
17284
+ secondaryIcon?: undefined;
17285
+ } | {
17286
+ id: string;
17287
+ href: string;
17288
+ title: string;
17289
+ mainIcon: string;
17290
+ secondaryIcon: string;
17291
+ subtitle?: undefined;
17292
+ })[];
17293
+ } | {
17294
+ id: number;
17295
+ label: string;
17296
+ tiles: {
17297
+ id: string;
17298
+ customContent: import("react/jsx-runtime").JSX.Element;
17299
+ }[];
17099
17300
  };
17100
17301
  };
17101
17302
  };
@@ -17142,6 +17343,14 @@ export declare const ThemeG100: {
17142
17343
  workspaceLabel: {
17143
17344
  description: string;
17144
17345
  };
17346
+ expandButtonLabel: {
17347
+ description: string;
17348
+ type: string;
17349
+ };
17350
+ collapseButtonLabel: {
17351
+ description: string;
17352
+ type: string;
17353
+ };
17145
17354
  };
17146
17355
  args: {
17147
17356
  allTiles: ({
@@ -17178,6 +17387,13 @@ export declare const ThemeG100: {
17178
17387
  secondaryIcon: string;
17179
17388
  subtitle?: undefined;
17180
17389
  })[];
17390
+ } | {
17391
+ id: number;
17392
+ label: string;
17393
+ tiles: {
17394
+ id: string;
17395
+ customContent: import("react/jsx-runtime").JSX.Element;
17396
+ }[];
17181
17397
  })[];
17182
17398
  allWorkspaces: {
17183
17399
  id: string;
@@ -17194,6 +17410,8 @@ export declare const ThemeG100: {
17194
17410
  tasksConfig: number;
17195
17411
  userName: string;
17196
17412
  welcomeText: string;
17413
+ expandButtonLabel: string;
17414
+ collapseButtonLabel: string;
17197
17415
  headerAnimation: number;
17198
17416
  };
17199
17417
  globals: {
@@ -0,0 +1,10 @@
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
+ declare const SampleCustomTaskContent: () => import("react/jsx-runtime").JSX.Element;
10
+ export default SampleCustomTaskContent;
@@ -36,6 +36,13 @@ export const headerTiles: ({
36
36
  secondaryIcon: string;
37
37
  subtitle?: undefined;
38
38
  })[];
39
+ } | {
40
+ id: number;
41
+ label: string;
42
+ tiles: {
43
+ id: string;
44
+ customContent: import("react/jsx-runtime").JSX.Element;
45
+ }[];
39
46
  })[];
40
47
  export namespace tasksConfigButton {
41
48
  let type: string;
@@ -18,12 +18,13 @@ export interface SelectedWorkspace {
18
18
  label: string;
19
19
  }
20
20
  export interface Tile {
21
- href: string | null;
21
+ href?: string | null;
22
22
  id: string;
23
- mainIcon: string | null;
23
+ mainIcon?: string | null;
24
24
  secondaryIcon?: string | null;
25
25
  subtitle?: string | null;
26
- title: string | null;
26
+ title?: string | null;
27
+ customContent?: ReactNode | null;
27
28
  }
28
29
  export interface TileGroup {
29
30
  id: number;
@@ -49,6 +50,8 @@ export interface AnimatedHeaderProps {
49
50
  userName?: string;
50
51
  welcomeText?: string;
51
52
  workspaceLabel?: string;
53
+ expandButtonLabel?: string;
54
+ collapseButtonLabel?: string;
52
55
  }
53
56
  declare const AnimatedHeader: React.FC<AnimatedHeaderProps>;
54
57
  export default AnimatedHeader;
@@ -39,7 +39,9 @@ const AnimatedHeader = _ref => {
39
39
  tasksConfig,
40
40
  userName,
41
41
  welcomeText,
42
- workspaceLabel = `Open in: ${userName}'s workspace` || `Select a workspace`
42
+ workspaceLabel = `Open in: ${userName}'s workspace` || `Select a workspace`,
43
+ expandButtonLabel = 'Expand',
44
+ collapseButtonLabel = 'Collapse'
43
45
  } = _ref;
44
46
  const prefix = usePrefix.usePrefix();
45
47
  const blockClass = `${prefix}--animated-header`;
@@ -172,6 +174,8 @@ const AnimatedHeader = _ref => {
172
174
  itemToString: handleWorkspaceItemsToString
173
175
  } : {}, renderWorkspaceSelectedItem ? {
174
176
  renderSelectedItem: renderWorkspaceSelectedItem
177
+ } : {}, selectedWorkspace ? {
178
+ selectedItem: selectedWorkspace
175
179
  } : {}))), /*#__PURE__*/React.createElement("div", {
176
180
  className: `${blockClass}__tiles-container`
177
181
  }, selectedTileGroup.tiles.map(tile => {
@@ -184,7 +188,8 @@ const AnimatedHeader = _ref => {
184
188
  secondaryIcon: tile.secondaryIcon,
185
189
  title: tile.title,
186
190
  subtitle: tile.subtitle,
187
- productName: productName
191
+ productName: productName,
192
+ customContent: tile.customContent
188
193
  });
189
194
  }))), /*#__PURE__*/React.createElement("div", {
190
195
  className: `${blockClass}__button-collapse--gradient`
@@ -195,7 +200,7 @@ const AnimatedHeader = _ref => {
195
200
  kind: "ghost",
196
201
  renderIcon: open ? bucket3.ChevronUp : bucket3.ChevronDown,
197
202
  onClick: handleButtonCollapseClick
198
- }, open ? `Collapse` : `Expand`))));
203
+ }, open ? collapseButtonLabel : expandButtonLabel))));
199
204
  };
200
205
  AnimatedHeader.displayName = 'Animated Header';
201
206
  AnimatedHeader.propTypes = {
@@ -211,10 +216,18 @@ AnimatedHeader.propTypes = {
211
216
  * Specify an optional className to be added to your Animated Header
212
217
  */
213
218
  className: PropTypes.string,
219
+ /**
220
+ * Custom collapse button label
221
+ */
222
+ collapseButtonLabel: PropTypes.string,
214
223
  /**
215
224
  * Provide short sentence in max. 3 lines related to product context
216
225
  */
217
226
  description: PropTypes.string,
227
+ /**
228
+ * Custom expand button label
229
+ */
230
+ expandButtonLabel: PropTypes.string,
218
231
  /**
219
232
  * Helper function passed to downshift that allows the library to render a
220
233
  * given item to a string label. By default, it extracts the `label` field
@@ -6,7 +6,7 @@
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, { ReactNode } from 'react';
10
10
  /** Base Tile */
11
11
  interface BaseTileProps {
12
12
  id?: string;
@@ -17,6 +17,7 @@ interface BaseTileProps {
17
17
  title?: string;
18
18
  subtitle?: string;
19
19
  productName?: string;
20
+ customContent?: ReactNode;
20
21
  }
21
22
  export declare const BaseTile: React.FC<BaseTileProps>;
22
23
  export {};
@@ -22,7 +22,8 @@ const BaseTile = _ref => {
22
22
  secondaryIcon,
23
23
  title,
24
24
  subtitle,
25
- productName
25
+ productName,
26
+ customContent
26
27
  } = _ref;
27
28
  const props = {
28
29
  id,
@@ -32,7 +33,8 @@ const BaseTile = _ref => {
32
33
  secondaryIcon,
33
34
  title,
34
35
  subtitle,
35
- productName
36
+ productName,
37
+ customContent
36
38
  };
37
39
  const tile = id === 'ai-tile' ? /*#__PURE__*/React.createElement(AIPromptTile.AIPromptTile, props) : /*#__PURE__*/React.createElement(GlassTile.GlassTile, props);
38
40
  return tile;
@@ -6,7 +6,7 @@
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, { ReactNode } from 'react';
10
10
  /** Primary UI component for user interaction */
11
11
  interface GlassTileProps {
12
12
  href?: string;
@@ -16,6 +16,7 @@ interface GlassTileProps {
16
16
  secondaryIcon?: string;
17
17
  subtitle?: string;
18
18
  title?: string;
19
+ customContent?: ReactNode;
19
20
  }
20
21
  export declare const GlassTile: React.FC<GlassTileProps>;
21
22
  export {};
@@ -22,7 +22,8 @@ const GlassTile = _ref => {
22
22
  open,
23
23
  secondaryIcon,
24
24
  subtitle,
25
- title
25
+ title,
26
+ customContent
26
27
  } = _ref;
27
28
  const prefix = usePrefix.usePrefix();
28
29
  const blockClass = `${prefix}--animated-header__glass-tile`;
@@ -37,7 +38,9 @@ const GlassTile = _ref => {
37
38
  className: `${blockClass}--body${!open ? ` ${collapsed}` : ''}`
38
39
  }, /*#__PURE__*/React.createElement("div", {
39
40
  className: `${blockClass}--body-background`
40
- }), /*#__PURE__*/React.createElement("div", {
41
+ }), customContent ? /*#__PURE__*/React.createElement("div", {
42
+ className: `${blockClass}--custom-content`
43
+ }, customContent) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
41
44
  className: `${blockClass}--icons`
42
45
  }, MainIcon && /*#__PURE__*/React.createElement(MainIcon, {
43
46
  fill: `var(--cds-icon-secondary)`,
@@ -51,7 +54,7 @@ const GlassTile = _ref => {
51
54
  }, subtitle), SecondaryIcon && /*#__PURE__*/React.createElement(SecondaryIcon, {
52
55
  size: 16,
53
56
  fill: `var(--cds-icon-secondary)`
54
- }))));
57
+ })))));
55
58
  };
56
59
 
57
60
  exports.GlassTile = GlassTile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-animated-header",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -36,5 +36,5 @@
36
36
  "devDependencies": {
37
37
  "@carbon-labs/utilities": "canary"
38
38
  },
39
- "gitHead": "74de03e1cd9ba159fd11071f1c2f481c907e8ef2"
39
+ "gitHead": "1ea42e5a8c5c9bf5797973dd614f2d44851d595d"
40
40
  }
@@ -188,6 +188,10 @@ $prefix: 'clabs--animated-header__ai-prompt-tile' !default;
188
188
  fill: $icon-primary;
189
189
  }
190
190
 
191
+ .#{$prefix}--custom-content {
192
+ z-index: 4;
193
+ }
194
+
191
195
  @keyframes animate-border {
192
196
  0% {
193
197
  background-position: 100% 0%;
@@ -129,3 +129,7 @@ $prefix: 'clabs--animated-header__glass-tile' !default;
129
129
  white-space: initial;
130
130
  }
131
131
  }
132
+
133
+ .#{$prefix}--custom-content {
134
+ z-index: 2;
135
+ }