@carbon-labs/react-animated-header 0.44.0 → 0.45.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/components/Tiles/AIPromptTile/AIPromptTile.d.ts +2 -1
- package/es/components/Tiles/AIPromptTile/AIPromptTile.js +9 -3
- package/es/components/Tiles/AITile/AITile.d.ts +2 -1
- package/es/components/Tiles/AITile/AITile.js +11 -5
- package/es/components/Tiles/GlassTile/GlassTile.d.ts +2 -1
- package/es/components/Tiles/GlassTile/GlassTile.js +11 -5
- package/es/components/Tiles/index.d.ts +2 -0
- package/es/components/types.d.ts +171 -0
- package/es/components/utils.d.ts +23 -0
- package/es/components/utils.js +31 -0
- package/es/index.d.ts +7 -0
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.d.ts +2 -1
- package/lib/components/Tiles/AIPromptTile/AIPromptTile.js +9 -3
- package/lib/components/Tiles/AITile/AITile.d.ts +2 -1
- package/lib/components/Tiles/AITile/AITile.js +11 -5
- package/lib/components/Tiles/GlassTile/GlassTile.d.ts +2 -1
- package/lib/components/Tiles/GlassTile/GlassTile.js +11 -5
- package/lib/components/Tiles/index.d.ts +2 -0
- package/lib/components/types.d.ts +171 -0
- package/lib/components/utils.d.ts +23 -0
- package/lib/components/utils.js +33 -0
- package/lib/es/components/Tiles/AIPromptTile/AIPromptTile.d.ts +3 -9
- package/lib/es/components/Tiles/AITile/AITile.d.ts +3 -8
- package/lib/es/components/Tiles/GlassTile/GlassTile.d.ts +3 -8
- package/lib/es/components/utils.d.ts +21 -0
- package/lib/index.d.ts +7 -0
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { type AITileBodyProps, type AITileLabelVariant } from '../AITile/AITileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type AIPromptTileProps = {
|
|
12
13
|
variant: 'aiPrompt';
|
|
13
14
|
tileId: string;
|
|
@@ -25,5 +26,5 @@ export type AIPromptTileProps = {
|
|
|
25
26
|
open?: boolean;
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
isDisabled?: boolean;
|
|
28
|
-
};
|
|
29
|
+
} & AutotrackDataAttributes;
|
|
29
30
|
export declare const AIPromptTile: React.FC<AIPromptTileProps>;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
9
|
import React, { useState } from 'react';
|
|
9
10
|
import { SkeletonPlaceholder, Tag, AILabel, TextInput, IconButton, Button } from '@carbon/react';
|
|
10
11
|
import { usePrefix } from '@carbon-labs/utilities/usePrefix';
|
|
11
12
|
import { Send } from '@carbon/react/icons';
|
|
13
|
+
import { extractAutotrackAttributes } from '../../utils.js';
|
|
12
14
|
|
|
13
15
|
var _AILabel, _Send;
|
|
14
16
|
const AIPromptTile = ({
|
|
@@ -26,7 +28,8 @@ const AIPromptTile = ({
|
|
|
26
28
|
ariaLabel,
|
|
27
29
|
open,
|
|
28
30
|
isLoading,
|
|
29
|
-
isDisabled
|
|
31
|
+
isDisabled,
|
|
32
|
+
...rest
|
|
30
33
|
}) => {
|
|
31
34
|
const prefix = usePrefix();
|
|
32
35
|
const blockClass = `${prefix}--animated-header__ai-prompt-tile`;
|
|
@@ -46,14 +49,17 @@ const AIPromptTile = ({
|
|
|
46
49
|
openInNewTab(`${href}&primed_chat=${textInput}`);
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
|
-
|
|
52
|
+
|
|
53
|
+
// Extract data attributes from rest props
|
|
54
|
+
const dataAttributes = extractAutotrackAttributes(rest);
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
50
56
|
id: `${blockClass}`,
|
|
51
57
|
className: `${prefix}--animated-header__tile ${blockClass}${isDisabled ? ' ' + disabled : ''}`,
|
|
52
58
|
"aria-label": ariaLabel ?? title ?? 'AI Tile',
|
|
53
59
|
role: "listitem",
|
|
54
60
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
55
61
|
key: tileId
|
|
56
|
-
}, isLoading ? /*#__PURE__*/React.createElement(SkeletonPlaceholder, {
|
|
62
|
+
}, dataAttributes), isLoading ? /*#__PURE__*/React.createElement(SkeletonPlaceholder, {
|
|
57
63
|
className: `${blockClass}--loading-skeleton`
|
|
58
64
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
59
65
|
className: `${blockClass}--body`,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { AITileBodyProps, AITileLabelVariant } from '../AITile/AITileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type AITileProps = {
|
|
12
13
|
variant: 'ai';
|
|
13
14
|
tileId: string;
|
|
@@ -26,6 +27,6 @@ export type AITileProps = {
|
|
|
26
27
|
open?: boolean;
|
|
27
28
|
isLoading?: boolean;
|
|
28
29
|
isDisabled?: boolean;
|
|
29
|
-
};
|
|
30
|
+
} & AutotrackDataAttributes;
|
|
30
31
|
export declare const AITile: React.FC<AITileProps>;
|
|
31
32
|
export default AITile;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
9
|
import React from 'react';
|
|
9
10
|
import { Link } from '@carbon/react';
|
|
10
11
|
import { usePrefix } from '@carbon-labs/utilities/usePrefix';
|
|
11
12
|
import { AITileBody } from './AITileBody.js';
|
|
13
|
+
import { extractAutotrackAttributes } from '../../utils.js';
|
|
12
14
|
|
|
13
15
|
const AITile = ({
|
|
14
16
|
tileId,
|
|
@@ -26,7 +28,8 @@ const AITile = ({
|
|
|
26
28
|
ariaLabel,
|
|
27
29
|
open,
|
|
28
30
|
isLoading,
|
|
29
|
-
isDisabled
|
|
31
|
+
isDisabled,
|
|
32
|
+
...rest
|
|
30
33
|
}) => {
|
|
31
34
|
const prefix = usePrefix();
|
|
32
35
|
const blockClass = `${prefix}--animated-header__ai-tile`;
|
|
@@ -43,17 +46,20 @@ const AITile = ({
|
|
|
43
46
|
isLoading: isLoading
|
|
44
47
|
});
|
|
45
48
|
|
|
49
|
+
// Extract data attributes from rest props
|
|
50
|
+
const dataAttributes = extractAutotrackAttributes(rest);
|
|
51
|
+
|
|
46
52
|
// Non-interactive tile
|
|
47
53
|
if (!href && !aiTileClickHandler) {
|
|
48
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
49
55
|
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
50
56
|
key: tileId,
|
|
51
57
|
"aria-label": ariaLabel ?? title ?? 'AI Tile',
|
|
52
58
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
53
59
|
tabIndex: -1
|
|
54
|
-
}, body);
|
|
60
|
+
}, dataAttributes), body);
|
|
55
61
|
}
|
|
56
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
62
|
+
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
57
63
|
onClick: event => {
|
|
58
64
|
aiTileClickHandler?.(event);
|
|
59
65
|
},
|
|
@@ -65,7 +71,7 @@ const AITile = ({
|
|
|
65
71
|
href: href ?? undefined,
|
|
66
72
|
disabled: isDisabled || isLoading,
|
|
67
73
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
68
|
-
}, body);
|
|
74
|
+
}, dataAttributes), body);
|
|
69
75
|
};
|
|
70
76
|
|
|
71
77
|
export { AITile };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { GlassTileBodyProps } from './GlassTileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type GlassTileProps = {
|
|
12
13
|
variant?: 'glass';
|
|
13
14
|
tileId: string;
|
|
@@ -25,5 +26,5 @@ export type GlassTileProps = {
|
|
|
25
26
|
open?: boolean;
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
isDisabled?: boolean;
|
|
28
|
-
};
|
|
29
|
+
} & AutotrackDataAttributes;
|
|
29
30
|
export declare const GlassTile: React.FC<GlassTileProps>;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
9
|
import React from 'react';
|
|
9
10
|
import { Link } from '@carbon/react';
|
|
10
11
|
import { usePrefix } from '@carbon-labs/utilities/usePrefix';
|
|
11
12
|
import { GlassTileBody } from './GlassTileBody.js';
|
|
13
|
+
import { extractAutotrackAttributes } from '../../utils.js';
|
|
12
14
|
|
|
13
15
|
const GlassTile = ({
|
|
14
16
|
tileId,
|
|
@@ -25,7 +27,8 @@ const GlassTile = ({
|
|
|
25
27
|
ariaLabel,
|
|
26
28
|
open,
|
|
27
29
|
isLoading,
|
|
28
|
-
isDisabled
|
|
30
|
+
isDisabled,
|
|
31
|
+
...rest
|
|
29
32
|
}) => {
|
|
30
33
|
const prefix = usePrefix();
|
|
31
34
|
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
@@ -41,17 +44,20 @@ const GlassTile = ({
|
|
|
41
44
|
isLoading: isLoading
|
|
42
45
|
});
|
|
43
46
|
|
|
47
|
+
// Extract data attributes from rest props
|
|
48
|
+
const dataAttributes = extractAutotrackAttributes(rest);
|
|
49
|
+
|
|
44
50
|
// Non-interactive tile
|
|
45
51
|
if (!href && !glassTileClickHandler) {
|
|
46
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
47
53
|
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
48
54
|
key: tileId,
|
|
49
55
|
"aria-label": ariaLabel ?? title ?? 'Glass Tile',
|
|
50
56
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
51
57
|
tabIndex: -1
|
|
52
|
-
}, body);
|
|
58
|
+
}, dataAttributes), body);
|
|
53
59
|
}
|
|
54
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
60
|
+
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
55
61
|
onClick: event => {
|
|
56
62
|
glassTileClickHandler?.(event);
|
|
57
63
|
},
|
|
@@ -63,7 +69,7 @@ const GlassTile = ({
|
|
|
63
69
|
href: href ?? undefined,
|
|
64
70
|
disabled: isDisabled || isLoading,
|
|
65
71
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
66
|
-
}, body);
|
|
72
|
+
}, dataAttributes), body);
|
|
67
73
|
};
|
|
68
74
|
|
|
69
75
|
export { GlassTile };
|
|
@@ -11,3 +11,5 @@ import { AIPromptTile } from './AIPromptTile/AIPromptTile';
|
|
|
11
11
|
import { BaseTile } from './BaseTile/BaseTile';
|
|
12
12
|
import { GlassTile } from './GlassTile/GlassTile';
|
|
13
13
|
export { AITile, AIPromptTile, BaseTile, GlassTile };
|
|
14
|
+
export type { AutotrackDataAttributes } from '../types';
|
|
15
|
+
export { extractAutotrackAttributes } from '../utils';
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Supported data attributes for IBM Carbon autotrack instrumentation.
|
|
11
|
+
* These attributes enable automatic tracking and analytics for user interactions.
|
|
12
|
+
*
|
|
13
|
+
* @see https://pages.github.ibm.com/carbon/ibm-products/developing/instrumentation/autotrack/#supported-data-attributes
|
|
14
|
+
*/
|
|
15
|
+
export type AutotrackDataAttributes = {
|
|
16
|
+
'data-autotrack-accountgroup'?: string;
|
|
17
|
+
'data-autotrack-accountgroupname'?: string;
|
|
18
|
+
'data-autotrack-accountgroupowner'?: string;
|
|
19
|
+
'data-autotrack-accountgroupstate'?: string;
|
|
20
|
+
'data-autotrack-accountguid'?: string;
|
|
21
|
+
'data-autotrack-accountid'?: string;
|
|
22
|
+
'data-autotrack-accountidcountrycode'?: string;
|
|
23
|
+
'data-autotrack-accountidcustnum_rdcctrynum'?: string;
|
|
24
|
+
'data-autotrack-accountidibmcustomernumber'?: string;
|
|
25
|
+
'data-autotrack-accountidsapcustnum'?: string;
|
|
26
|
+
'data-autotrack-accountidsapsiteid'?: string;
|
|
27
|
+
'data-autotrack-accountidtype'?: string;
|
|
28
|
+
'data-autotrack-accountlevel'?: string;
|
|
29
|
+
'data-autotrack-accountname'?: string;
|
|
30
|
+
'data-autotrack-accountowner'?: string;
|
|
31
|
+
'data-autotrack-accountplan'?: string;
|
|
32
|
+
'data-autotrack-accountstatus'?: string;
|
|
33
|
+
'data-autotrack-action'?: string;
|
|
34
|
+
'data-autotrack-actiontype'?: string;
|
|
35
|
+
'data-autotrack-agentid'?: string;
|
|
36
|
+
'data-autotrack-agentname'?: string;
|
|
37
|
+
'data-autotrack-agenttype'?: string;
|
|
38
|
+
'data-autotrack-altuserid'?: string;
|
|
39
|
+
'data-autotrack-anonymousid'?: string;
|
|
40
|
+
'data-autotrack-category'?: string;
|
|
41
|
+
'data-autotrack-channel'?: string;
|
|
42
|
+
'data-autotrack-channelname'?: string;
|
|
43
|
+
'data-autotrack-chargeagreementnumber'?: string;
|
|
44
|
+
'data-autotrack-cloudenvironment'?: string;
|
|
45
|
+
'data-autotrack-code'?: string;
|
|
46
|
+
'data-autotrack-color'?: string;
|
|
47
|
+
'data-autotrack-commonmilestonename'?: string;
|
|
48
|
+
'data-autotrack-commonmilestonetriggeruserid'?: string;
|
|
49
|
+
'data-autotrack-context_device_id'?: string;
|
|
50
|
+
'data-autotrack-context_page_path'?: string;
|
|
51
|
+
'data-autotrack-context_page_referrer'?: string;
|
|
52
|
+
'data-autotrack-context_page_title'?: string;
|
|
53
|
+
'data-autotrack-context_page_url'?: string;
|
|
54
|
+
'data-autotrack-cta'?: string;
|
|
55
|
+
'data-autotrack-customerid'?: string;
|
|
56
|
+
'data-autotrack-data'?: string;
|
|
57
|
+
'data-autotrack-datacenter'?: string;
|
|
58
|
+
'data-autotrack-distributorid'?: string;
|
|
59
|
+
'data-autotrack-elementid'?: string;
|
|
60
|
+
'data-autotrack-enterpriseaccount'?: string;
|
|
61
|
+
'data-autotrack-enterpriseaccountdomain'?: string;
|
|
62
|
+
'data-autotrack-enterpriseaccountflag'?: string;
|
|
63
|
+
'data-autotrack-enterpriseaccountname'?: string;
|
|
64
|
+
'data-autotrack-enterpriseaccountstate'?: string;
|
|
65
|
+
'data-autotrack-enterpriseowner'?: string;
|
|
66
|
+
'data-autotrack-environment'?: string;
|
|
67
|
+
'data-autotrack-environmenttype'?: string;
|
|
68
|
+
'data-autotrack-eventid'?: string;
|
|
69
|
+
'data-autotrack-field'?: string;
|
|
70
|
+
'data-autotrack-frequency'?: string;
|
|
71
|
+
'data-autotrack-hyperscalerchannel'?: string;
|
|
72
|
+
'data-autotrack-hyperscalerformat'?: string;
|
|
73
|
+
'data-autotrack-hyperscalerproductid'?: string;
|
|
74
|
+
'data-autotrack-hyperscalerprovider'?: string;
|
|
75
|
+
'data-autotrack-hyperscalertier'?: string;
|
|
76
|
+
'data-autotrack-instancebssfirstbillabledate'?: string;
|
|
77
|
+
'data-autotrack-instanceguid'?: string;
|
|
78
|
+
'data-autotrack-instanceid'?: string;
|
|
79
|
+
'data-autotrack-instancemetricspaidmilestoneintermediateusagecount'?: string;
|
|
80
|
+
'data-autotrack-instancemetricspaidmilestoneintermediateusagelastts'?: string;
|
|
81
|
+
'data-autotrack-instancename'?: string;
|
|
82
|
+
'data-autotrack-isibmer'?: string;
|
|
83
|
+
'data-autotrack-kubernetesdistribution'?: string;
|
|
84
|
+
'data-autotrack-kubernetesdistributionversion'?: string;
|
|
85
|
+
'data-autotrack-kubernetesid'?: string;
|
|
86
|
+
'data-autotrack-kubernetesnamespace'?: string;
|
|
87
|
+
'data-autotrack-kubernetesresourceapi'?: string;
|
|
88
|
+
'data-autotrack-kubernetesresourcename'?: string;
|
|
89
|
+
'data-autotrack-kubernetesversion'?: string;
|
|
90
|
+
'data-autotrack-label'?: string;
|
|
91
|
+
'data-autotrack-locale'?: string;
|
|
92
|
+
'data-autotrack-location'?: string;
|
|
93
|
+
'data-autotrack-marketplace'?: string;
|
|
94
|
+
'data-autotrack-message'?: string;
|
|
95
|
+
'data-autotrack-milestonename'?: string;
|
|
96
|
+
'data-autotrack-name'?: string;
|
|
97
|
+
'data-autotrack-namespace'?: string;
|
|
98
|
+
'data-autotrack-object'?: string;
|
|
99
|
+
'data-autotrack-objecttype'?: string;
|
|
100
|
+
'data-autotrack-observetype'?: string;
|
|
101
|
+
'data-autotrack-offeringid'?: string;
|
|
102
|
+
'data-autotrack-openshiftclusterid'?: string;
|
|
103
|
+
'data-autotrack-openshiftinfrastructurename'?: string;
|
|
104
|
+
'data-autotrack-openshiftplatform'?: string;
|
|
105
|
+
'data-autotrack-openshiftversion'?: string;
|
|
106
|
+
'data-autotrack-operationalid'?: string;
|
|
107
|
+
'data-autotrack-orgguid'?: string;
|
|
108
|
+
'data-autotrack-orgname'?: string;
|
|
109
|
+
'data-autotrack-originalmessageid'?: string;
|
|
110
|
+
'data-autotrack-pagename'?: string;
|
|
111
|
+
'data-autotrack-pagepathurl'?: string;
|
|
112
|
+
'data-autotrack-pagesubject'?: string;
|
|
113
|
+
'data-autotrack-pagetitle'?: string;
|
|
114
|
+
'data-autotrack-pageurl'?: string;
|
|
115
|
+
'data-autotrack-parentpagecategory'?: string;
|
|
116
|
+
'data-autotrack-parentpagename'?: string;
|
|
117
|
+
'data-autotrack-partids'?: string;
|
|
118
|
+
'data-autotrack-partname'?: string;
|
|
119
|
+
'data-autotrack-partnumber'?: string;
|
|
120
|
+
'data-autotrack-path'?: string;
|
|
121
|
+
'data-autotrack-payload'?: string;
|
|
122
|
+
'data-autotrack-platformtitle'?: string;
|
|
123
|
+
'data-autotrack-previousproductversion'?: string;
|
|
124
|
+
'data-autotrack-productcode'?: string;
|
|
125
|
+
'data-autotrack-productcodetype'?: string;
|
|
126
|
+
'data-autotrack-productid'?: string;
|
|
127
|
+
'data-autotrack-productplan'?: string;
|
|
128
|
+
'data-autotrack-productplanname'?: string;
|
|
129
|
+
'data-autotrack-productplantier'?: string;
|
|
130
|
+
'data-autotrack-productplantype'?: string;
|
|
131
|
+
'data-autotrack-productstatus'?: string;
|
|
132
|
+
'data-autotrack-producttitle'?: string;
|
|
133
|
+
'data-autotrack-productversion'?: string;
|
|
134
|
+
'data-autotrack-quantity'?: string;
|
|
135
|
+
'data-autotrack-region'?: string;
|
|
136
|
+
'data-autotrack-resellerid'?: string;
|
|
137
|
+
'data-autotrack-resultvalue'?: string;
|
|
138
|
+
'data-autotrack-roles'?: string;
|
|
139
|
+
'data-autotrack-sabasubscriptionid'?: string;
|
|
140
|
+
'data-autotrack-saletype'?: string;
|
|
141
|
+
'data-autotrack-sapsiteid'?: string;
|
|
142
|
+
'data-autotrack-segmentsourceslug'?: string;
|
|
143
|
+
'data-autotrack-serviceagreementnumber'?: string;
|
|
144
|
+
'data-autotrack-sessionid'?: string;
|
|
145
|
+
'data-autotrack-size'?: string;
|
|
146
|
+
'data-autotrack-source'?: string;
|
|
147
|
+
'data-autotrack-subproducttitle'?: string;
|
|
148
|
+
'data-autotrack-subscriptionid'?: string;
|
|
149
|
+
'data-autotrack-successflag'?: string;
|
|
150
|
+
'data-autotrack-tenantid'?: string;
|
|
151
|
+
'data-autotrack-tenantname'?: string;
|
|
152
|
+
'data-autotrack-text'?: string;
|
|
153
|
+
'data-autotrack-type'?: string;
|
|
154
|
+
'data-autotrack-uielement'?: string;
|
|
155
|
+
'data-autotrack-unit'?: string;
|
|
156
|
+
'data-autotrack-unitdescription'?: string;
|
|
157
|
+
'data-autotrack-url'?: string;
|
|
158
|
+
'data-autotrack-urlsubdomain'?: string;
|
|
159
|
+
'data-autotrack-usersessionid'?: string;
|
|
160
|
+
'data-autotrack-ut10'?: string;
|
|
161
|
+
'data-autotrack-ut15'?: string;
|
|
162
|
+
'data-autotrack-ut17'?: string;
|
|
163
|
+
'data-autotrack-ut20'?: string;
|
|
164
|
+
'data-autotrack-ut30'?: string;
|
|
165
|
+
'data-autotrack-ut30_description'?: string;
|
|
166
|
+
'data-autotrack-ut35'?: string;
|
|
167
|
+
'data-autotrack-ut40'?: string;
|
|
168
|
+
'data-autotrack-utlvlcd'?: string;
|
|
169
|
+
'data-autotrack-variation'?: string;
|
|
170
|
+
'data-autotrack-version'?: string;
|
|
171
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Extracts data-autotrack-* attributes from props object.
|
|
11
|
+
* This utility filters out only the autotrack data attributes for spreading onto DOM elements.
|
|
12
|
+
*
|
|
13
|
+
* @param {Record<string, any>} props - Props object that may contain data-autotrack-* attributes
|
|
14
|
+
* @returns {Record<string, string | undefined>} Object containing only data-autotrack-* attributes
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const props = { title: 'My Tile', 'data-autotrack-action': 'click', ...rest };
|
|
19
|
+
* const dataAttrs = extractAutotrackAttributes(rest);
|
|
20
|
+
* // Returns: { 'data-autotrack-action': 'click' }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractAutotrackAttributes(props: Record<string, any>): Record<string, string | undefined>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* Extracts data-autotrack-* attributes from props object.
|
|
10
|
+
* This utility filters out only the autotrack data attributes for spreading onto DOM elements.
|
|
11
|
+
*
|
|
12
|
+
* @param {Record<string, any>} props - Props object that may contain data-autotrack-* attributes
|
|
13
|
+
* @returns {Record<string, string | undefined>} Object containing only data-autotrack-* attributes
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const props = { title: 'My Tile', 'data-autotrack-action': 'click', ...rest };
|
|
18
|
+
* const dataAttrs = extractAutotrackAttributes(rest);
|
|
19
|
+
* // Returns: { 'data-autotrack-action': 'click' }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function extractAutotrackAttributes(props) {
|
|
23
|
+
return Object.keys(props).reduce((acc, key) => {
|
|
24
|
+
if (key.startsWith('data-autotrack-')) {
|
|
25
|
+
acc[key] = props[key];
|
|
26
|
+
}
|
|
27
|
+
return acc;
|
|
28
|
+
}, {});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { extractAutotrackAttributes };
|
package/es/index.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ import HeaderAction from './components/HeaderAction/HeaderAction';
|
|
|
12
12
|
import HeaderTitle from './components/HeaderTitle/HeaderTitle';
|
|
13
13
|
import { BaseTile } from './components/Tiles/index';
|
|
14
14
|
export * from './assets';
|
|
15
|
+
export type { AnimatedHeaderProps } from './components/AnimatedHeader/AnimatedHeader';
|
|
16
|
+
export type { Tile } from './components/AnimatedHeader/types';
|
|
17
|
+
export type { AITileProps } from './components/Tiles/AITile/AITile';
|
|
18
|
+
export type { AIPromptTileProps } from './components/Tiles/AIPromptTile/AIPromptTile';
|
|
19
|
+
export type { GlassTileProps } from './components/Tiles/GlassTile/GlassTile';
|
|
20
|
+
export type { BaseTileProps, TileVariant, } from './components/Tiles/BaseTile/BaseTile';
|
|
21
|
+
export type { AutotrackDataAttributes } from './components/types';
|
|
15
22
|
export type { Workspace, WorkspaceSelectorConfig, } from './components/WorkspaceSelector/WorkspaceSelector';
|
|
16
23
|
export type { TasksControllerConfig } from './components/TasksController/TasksController';
|
|
17
24
|
export type { HeaderActionConfig } from './components/HeaderAction/header-action.types';
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { type AITileBodyProps, type AITileLabelVariant } from '../AITile/AITileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type AIPromptTileProps = {
|
|
12
13
|
variant: 'aiPrompt';
|
|
13
14
|
tileId: string;
|
|
@@ -25,5 +26,5 @@ export type AIPromptTileProps = {
|
|
|
25
26
|
open?: boolean;
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
isDisabled?: boolean;
|
|
28
|
-
};
|
|
29
|
+
} & AutotrackDataAttributes;
|
|
29
30
|
export declare const AIPromptTile: React.FC<AIPromptTileProps>;
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
10
11
|
var React = require('react');
|
|
11
12
|
var react = require('@carbon/react');
|
|
12
13
|
var usePrefix = require('@carbon-labs/utilities/usePrefix');
|
|
13
14
|
var icons = require('@carbon/react/icons');
|
|
15
|
+
var utils = require('../../utils.js');
|
|
14
16
|
|
|
15
17
|
var _AILabel, _Send;
|
|
16
18
|
const AIPromptTile = ({
|
|
@@ -28,7 +30,8 @@ const AIPromptTile = ({
|
|
|
28
30
|
ariaLabel,
|
|
29
31
|
open,
|
|
30
32
|
isLoading,
|
|
31
|
-
isDisabled
|
|
33
|
+
isDisabled,
|
|
34
|
+
...rest
|
|
32
35
|
}) => {
|
|
33
36
|
const prefix = usePrefix.usePrefix();
|
|
34
37
|
const blockClass = `${prefix}--animated-header__ai-prompt-tile`;
|
|
@@ -48,14 +51,17 @@ const AIPromptTile = ({
|
|
|
48
51
|
openInNewTab(`${href}&primed_chat=${textInput}`);
|
|
49
52
|
}
|
|
50
53
|
};
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
// Extract data attributes from rest props
|
|
56
|
+
const dataAttributes = utils.extractAutotrackAttributes(rest);
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
52
58
|
id: `${blockClass}`,
|
|
53
59
|
className: `${prefix}--animated-header__tile ${blockClass}${isDisabled ? ' ' + disabled : ''}`,
|
|
54
60
|
"aria-label": ariaLabel ?? title ?? 'AI Tile',
|
|
55
61
|
role: "listitem",
|
|
56
62
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
57
63
|
key: tileId
|
|
58
|
-
}, isLoading ? /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
|
|
64
|
+
}, dataAttributes), isLoading ? /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
|
|
59
65
|
className: `${blockClass}--loading-skeleton`
|
|
60
66
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
61
67
|
className: `${blockClass}--body`,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { AITileBodyProps, AITileLabelVariant } from '../AITile/AITileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type AITileProps = {
|
|
12
13
|
variant: 'ai';
|
|
13
14
|
tileId: string;
|
|
@@ -26,6 +27,6 @@ export type AITileProps = {
|
|
|
26
27
|
open?: boolean;
|
|
27
28
|
isLoading?: boolean;
|
|
28
29
|
isDisabled?: boolean;
|
|
29
|
-
};
|
|
30
|
+
} & AutotrackDataAttributes;
|
|
30
31
|
export declare const AITile: React.FC<AITileProps>;
|
|
31
32
|
export default AITile;
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
10
11
|
var React = require('react');
|
|
11
12
|
var react = require('@carbon/react');
|
|
12
13
|
var usePrefix = require('@carbon-labs/utilities/usePrefix');
|
|
13
14
|
var AITileBody = require('./AITileBody.js');
|
|
15
|
+
var utils = require('../../utils.js');
|
|
14
16
|
|
|
15
17
|
const AITile = ({
|
|
16
18
|
tileId,
|
|
@@ -28,7 +30,8 @@ const AITile = ({
|
|
|
28
30
|
ariaLabel,
|
|
29
31
|
open,
|
|
30
32
|
isLoading,
|
|
31
|
-
isDisabled
|
|
33
|
+
isDisabled,
|
|
34
|
+
...rest
|
|
32
35
|
}) => {
|
|
33
36
|
const prefix = usePrefix.usePrefix();
|
|
34
37
|
const blockClass = `${prefix}--animated-header__ai-tile`;
|
|
@@ -45,17 +48,20 @@ const AITile = ({
|
|
|
45
48
|
isLoading: isLoading
|
|
46
49
|
});
|
|
47
50
|
|
|
51
|
+
// Extract data attributes from rest props
|
|
52
|
+
const dataAttributes = utils.extractAutotrackAttributes(rest);
|
|
53
|
+
|
|
48
54
|
// Non-interactive tile
|
|
49
55
|
if (!href && !aiTileClickHandler) {
|
|
50
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
51
57
|
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
52
58
|
key: tileId,
|
|
53
59
|
"aria-label": ariaLabel ?? title ?? 'AI Tile',
|
|
54
60
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
55
61
|
tabIndex: -1
|
|
56
|
-
}, body);
|
|
62
|
+
}, dataAttributes), body);
|
|
57
63
|
}
|
|
58
|
-
return /*#__PURE__*/React.createElement(react.Link, {
|
|
64
|
+
return /*#__PURE__*/React.createElement(react.Link, _rollupPluginBabelHelpers.extends({
|
|
59
65
|
onClick: event => {
|
|
60
66
|
aiTileClickHandler?.(event);
|
|
61
67
|
},
|
|
@@ -67,7 +73,7 @@ const AITile = ({
|
|
|
67
73
|
href: href ?? undefined,
|
|
68
74
|
disabled: isDisabled || isLoading,
|
|
69
75
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
70
|
-
}, body);
|
|
76
|
+
}, dataAttributes), body);
|
|
71
77
|
};
|
|
72
78
|
|
|
73
79
|
exports.AITile = AITile;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { ElementType } from 'react';
|
|
10
10
|
import { GlassTileBodyProps } from './GlassTileBody';
|
|
11
|
+
import { AutotrackDataAttributes } from '../../types';
|
|
11
12
|
export type GlassTileProps = {
|
|
12
13
|
variant?: 'glass';
|
|
13
14
|
tileId: string;
|
|
@@ -25,5 +26,5 @@ export type GlassTileProps = {
|
|
|
25
26
|
open?: boolean;
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
isDisabled?: boolean;
|
|
28
|
-
};
|
|
29
|
+
} & AutotrackDataAttributes;
|
|
29
30
|
export declare const GlassTile: React.FC<GlassTileProps>;
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
10
11
|
var React = require('react');
|
|
11
12
|
var react = require('@carbon/react');
|
|
12
13
|
var usePrefix = require('@carbon-labs/utilities/usePrefix');
|
|
13
14
|
var GlassTileBody = require('./GlassTileBody.js');
|
|
15
|
+
var utils = require('../../utils.js');
|
|
14
16
|
|
|
15
17
|
const GlassTile = ({
|
|
16
18
|
tileId,
|
|
@@ -27,7 +29,8 @@ const GlassTile = ({
|
|
|
27
29
|
ariaLabel,
|
|
28
30
|
open,
|
|
29
31
|
isLoading,
|
|
30
|
-
isDisabled
|
|
32
|
+
isDisabled,
|
|
33
|
+
...rest
|
|
31
34
|
}) => {
|
|
32
35
|
const prefix = usePrefix.usePrefix();
|
|
33
36
|
const blockClass = `${prefix}--animated-header__glass-tile`;
|
|
@@ -43,17 +46,20 @@ const GlassTile = ({
|
|
|
43
46
|
isLoading: isLoading
|
|
44
47
|
});
|
|
45
48
|
|
|
49
|
+
// Extract data attributes from rest props
|
|
50
|
+
const dataAttributes = utils.extractAutotrackAttributes(rest);
|
|
51
|
+
|
|
46
52
|
// Non-interactive tile
|
|
47
53
|
if (!href && !glassTileClickHandler) {
|
|
48
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
49
55
|
className: `${prefix}--animated-header__tile ${blockClass}`,
|
|
50
56
|
key: tileId,
|
|
51
57
|
"aria-label": ariaLabel ?? title ?? 'Glass Tile',
|
|
52
58
|
title: isDisabled ? disabledTaskLabel ?? '' : '',
|
|
53
59
|
tabIndex: -1
|
|
54
|
-
}, body);
|
|
60
|
+
}, dataAttributes), body);
|
|
55
61
|
}
|
|
56
|
-
return /*#__PURE__*/React.createElement(react.Link, {
|
|
62
|
+
return /*#__PURE__*/React.createElement(react.Link, _rollupPluginBabelHelpers.extends({
|
|
57
63
|
onClick: event => {
|
|
58
64
|
glassTileClickHandler?.(event);
|
|
59
65
|
},
|
|
@@ -65,7 +71,7 @@ const GlassTile = ({
|
|
|
65
71
|
href: href ?? undefined,
|
|
66
72
|
disabled: isDisabled || isLoading,
|
|
67
73
|
title: isDisabled ? disabledTaskLabel ?? '' : ''
|
|
68
|
-
}, body);
|
|
74
|
+
}, dataAttributes), body);
|
|
69
75
|
};
|
|
70
76
|
|
|
71
77
|
exports.GlassTile = GlassTile;
|
|
@@ -11,3 +11,5 @@ import { AIPromptTile } from './AIPromptTile/AIPromptTile';
|
|
|
11
11
|
import { BaseTile } from './BaseTile/BaseTile';
|
|
12
12
|
import { GlassTile } from './GlassTile/GlassTile';
|
|
13
13
|
export { AITile, AIPromptTile, BaseTile, GlassTile };
|
|
14
|
+
export type { AutotrackDataAttributes } from '../types';
|
|
15
|
+
export { extractAutotrackAttributes } from '../utils';
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Supported data attributes for IBM Carbon autotrack instrumentation.
|
|
11
|
+
* These attributes enable automatic tracking and analytics for user interactions.
|
|
12
|
+
*
|
|
13
|
+
* @see https://pages.github.ibm.com/carbon/ibm-products/developing/instrumentation/autotrack/#supported-data-attributes
|
|
14
|
+
*/
|
|
15
|
+
export type AutotrackDataAttributes = {
|
|
16
|
+
'data-autotrack-accountgroup'?: string;
|
|
17
|
+
'data-autotrack-accountgroupname'?: string;
|
|
18
|
+
'data-autotrack-accountgroupowner'?: string;
|
|
19
|
+
'data-autotrack-accountgroupstate'?: string;
|
|
20
|
+
'data-autotrack-accountguid'?: string;
|
|
21
|
+
'data-autotrack-accountid'?: string;
|
|
22
|
+
'data-autotrack-accountidcountrycode'?: string;
|
|
23
|
+
'data-autotrack-accountidcustnum_rdcctrynum'?: string;
|
|
24
|
+
'data-autotrack-accountidibmcustomernumber'?: string;
|
|
25
|
+
'data-autotrack-accountidsapcustnum'?: string;
|
|
26
|
+
'data-autotrack-accountidsapsiteid'?: string;
|
|
27
|
+
'data-autotrack-accountidtype'?: string;
|
|
28
|
+
'data-autotrack-accountlevel'?: string;
|
|
29
|
+
'data-autotrack-accountname'?: string;
|
|
30
|
+
'data-autotrack-accountowner'?: string;
|
|
31
|
+
'data-autotrack-accountplan'?: string;
|
|
32
|
+
'data-autotrack-accountstatus'?: string;
|
|
33
|
+
'data-autotrack-action'?: string;
|
|
34
|
+
'data-autotrack-actiontype'?: string;
|
|
35
|
+
'data-autotrack-agentid'?: string;
|
|
36
|
+
'data-autotrack-agentname'?: string;
|
|
37
|
+
'data-autotrack-agenttype'?: string;
|
|
38
|
+
'data-autotrack-altuserid'?: string;
|
|
39
|
+
'data-autotrack-anonymousid'?: string;
|
|
40
|
+
'data-autotrack-category'?: string;
|
|
41
|
+
'data-autotrack-channel'?: string;
|
|
42
|
+
'data-autotrack-channelname'?: string;
|
|
43
|
+
'data-autotrack-chargeagreementnumber'?: string;
|
|
44
|
+
'data-autotrack-cloudenvironment'?: string;
|
|
45
|
+
'data-autotrack-code'?: string;
|
|
46
|
+
'data-autotrack-color'?: string;
|
|
47
|
+
'data-autotrack-commonmilestonename'?: string;
|
|
48
|
+
'data-autotrack-commonmilestonetriggeruserid'?: string;
|
|
49
|
+
'data-autotrack-context_device_id'?: string;
|
|
50
|
+
'data-autotrack-context_page_path'?: string;
|
|
51
|
+
'data-autotrack-context_page_referrer'?: string;
|
|
52
|
+
'data-autotrack-context_page_title'?: string;
|
|
53
|
+
'data-autotrack-context_page_url'?: string;
|
|
54
|
+
'data-autotrack-cta'?: string;
|
|
55
|
+
'data-autotrack-customerid'?: string;
|
|
56
|
+
'data-autotrack-data'?: string;
|
|
57
|
+
'data-autotrack-datacenter'?: string;
|
|
58
|
+
'data-autotrack-distributorid'?: string;
|
|
59
|
+
'data-autotrack-elementid'?: string;
|
|
60
|
+
'data-autotrack-enterpriseaccount'?: string;
|
|
61
|
+
'data-autotrack-enterpriseaccountdomain'?: string;
|
|
62
|
+
'data-autotrack-enterpriseaccountflag'?: string;
|
|
63
|
+
'data-autotrack-enterpriseaccountname'?: string;
|
|
64
|
+
'data-autotrack-enterpriseaccountstate'?: string;
|
|
65
|
+
'data-autotrack-enterpriseowner'?: string;
|
|
66
|
+
'data-autotrack-environment'?: string;
|
|
67
|
+
'data-autotrack-environmenttype'?: string;
|
|
68
|
+
'data-autotrack-eventid'?: string;
|
|
69
|
+
'data-autotrack-field'?: string;
|
|
70
|
+
'data-autotrack-frequency'?: string;
|
|
71
|
+
'data-autotrack-hyperscalerchannel'?: string;
|
|
72
|
+
'data-autotrack-hyperscalerformat'?: string;
|
|
73
|
+
'data-autotrack-hyperscalerproductid'?: string;
|
|
74
|
+
'data-autotrack-hyperscalerprovider'?: string;
|
|
75
|
+
'data-autotrack-hyperscalertier'?: string;
|
|
76
|
+
'data-autotrack-instancebssfirstbillabledate'?: string;
|
|
77
|
+
'data-autotrack-instanceguid'?: string;
|
|
78
|
+
'data-autotrack-instanceid'?: string;
|
|
79
|
+
'data-autotrack-instancemetricspaidmilestoneintermediateusagecount'?: string;
|
|
80
|
+
'data-autotrack-instancemetricspaidmilestoneintermediateusagelastts'?: string;
|
|
81
|
+
'data-autotrack-instancename'?: string;
|
|
82
|
+
'data-autotrack-isibmer'?: string;
|
|
83
|
+
'data-autotrack-kubernetesdistribution'?: string;
|
|
84
|
+
'data-autotrack-kubernetesdistributionversion'?: string;
|
|
85
|
+
'data-autotrack-kubernetesid'?: string;
|
|
86
|
+
'data-autotrack-kubernetesnamespace'?: string;
|
|
87
|
+
'data-autotrack-kubernetesresourceapi'?: string;
|
|
88
|
+
'data-autotrack-kubernetesresourcename'?: string;
|
|
89
|
+
'data-autotrack-kubernetesversion'?: string;
|
|
90
|
+
'data-autotrack-label'?: string;
|
|
91
|
+
'data-autotrack-locale'?: string;
|
|
92
|
+
'data-autotrack-location'?: string;
|
|
93
|
+
'data-autotrack-marketplace'?: string;
|
|
94
|
+
'data-autotrack-message'?: string;
|
|
95
|
+
'data-autotrack-milestonename'?: string;
|
|
96
|
+
'data-autotrack-name'?: string;
|
|
97
|
+
'data-autotrack-namespace'?: string;
|
|
98
|
+
'data-autotrack-object'?: string;
|
|
99
|
+
'data-autotrack-objecttype'?: string;
|
|
100
|
+
'data-autotrack-observetype'?: string;
|
|
101
|
+
'data-autotrack-offeringid'?: string;
|
|
102
|
+
'data-autotrack-openshiftclusterid'?: string;
|
|
103
|
+
'data-autotrack-openshiftinfrastructurename'?: string;
|
|
104
|
+
'data-autotrack-openshiftplatform'?: string;
|
|
105
|
+
'data-autotrack-openshiftversion'?: string;
|
|
106
|
+
'data-autotrack-operationalid'?: string;
|
|
107
|
+
'data-autotrack-orgguid'?: string;
|
|
108
|
+
'data-autotrack-orgname'?: string;
|
|
109
|
+
'data-autotrack-originalmessageid'?: string;
|
|
110
|
+
'data-autotrack-pagename'?: string;
|
|
111
|
+
'data-autotrack-pagepathurl'?: string;
|
|
112
|
+
'data-autotrack-pagesubject'?: string;
|
|
113
|
+
'data-autotrack-pagetitle'?: string;
|
|
114
|
+
'data-autotrack-pageurl'?: string;
|
|
115
|
+
'data-autotrack-parentpagecategory'?: string;
|
|
116
|
+
'data-autotrack-parentpagename'?: string;
|
|
117
|
+
'data-autotrack-partids'?: string;
|
|
118
|
+
'data-autotrack-partname'?: string;
|
|
119
|
+
'data-autotrack-partnumber'?: string;
|
|
120
|
+
'data-autotrack-path'?: string;
|
|
121
|
+
'data-autotrack-payload'?: string;
|
|
122
|
+
'data-autotrack-platformtitle'?: string;
|
|
123
|
+
'data-autotrack-previousproductversion'?: string;
|
|
124
|
+
'data-autotrack-productcode'?: string;
|
|
125
|
+
'data-autotrack-productcodetype'?: string;
|
|
126
|
+
'data-autotrack-productid'?: string;
|
|
127
|
+
'data-autotrack-productplan'?: string;
|
|
128
|
+
'data-autotrack-productplanname'?: string;
|
|
129
|
+
'data-autotrack-productplantier'?: string;
|
|
130
|
+
'data-autotrack-productplantype'?: string;
|
|
131
|
+
'data-autotrack-productstatus'?: string;
|
|
132
|
+
'data-autotrack-producttitle'?: string;
|
|
133
|
+
'data-autotrack-productversion'?: string;
|
|
134
|
+
'data-autotrack-quantity'?: string;
|
|
135
|
+
'data-autotrack-region'?: string;
|
|
136
|
+
'data-autotrack-resellerid'?: string;
|
|
137
|
+
'data-autotrack-resultvalue'?: string;
|
|
138
|
+
'data-autotrack-roles'?: string;
|
|
139
|
+
'data-autotrack-sabasubscriptionid'?: string;
|
|
140
|
+
'data-autotrack-saletype'?: string;
|
|
141
|
+
'data-autotrack-sapsiteid'?: string;
|
|
142
|
+
'data-autotrack-segmentsourceslug'?: string;
|
|
143
|
+
'data-autotrack-serviceagreementnumber'?: string;
|
|
144
|
+
'data-autotrack-sessionid'?: string;
|
|
145
|
+
'data-autotrack-size'?: string;
|
|
146
|
+
'data-autotrack-source'?: string;
|
|
147
|
+
'data-autotrack-subproducttitle'?: string;
|
|
148
|
+
'data-autotrack-subscriptionid'?: string;
|
|
149
|
+
'data-autotrack-successflag'?: string;
|
|
150
|
+
'data-autotrack-tenantid'?: string;
|
|
151
|
+
'data-autotrack-tenantname'?: string;
|
|
152
|
+
'data-autotrack-text'?: string;
|
|
153
|
+
'data-autotrack-type'?: string;
|
|
154
|
+
'data-autotrack-uielement'?: string;
|
|
155
|
+
'data-autotrack-unit'?: string;
|
|
156
|
+
'data-autotrack-unitdescription'?: string;
|
|
157
|
+
'data-autotrack-url'?: string;
|
|
158
|
+
'data-autotrack-urlsubdomain'?: string;
|
|
159
|
+
'data-autotrack-usersessionid'?: string;
|
|
160
|
+
'data-autotrack-ut10'?: string;
|
|
161
|
+
'data-autotrack-ut15'?: string;
|
|
162
|
+
'data-autotrack-ut17'?: string;
|
|
163
|
+
'data-autotrack-ut20'?: string;
|
|
164
|
+
'data-autotrack-ut30'?: string;
|
|
165
|
+
'data-autotrack-ut30_description'?: string;
|
|
166
|
+
'data-autotrack-ut35'?: string;
|
|
167
|
+
'data-autotrack-ut40'?: string;
|
|
168
|
+
'data-autotrack-utlvlcd'?: string;
|
|
169
|
+
'data-autotrack-variation'?: string;
|
|
170
|
+
'data-autotrack-version'?: string;
|
|
171
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Extracts data-autotrack-* attributes from props object.
|
|
11
|
+
* This utility filters out only the autotrack data attributes for spreading onto DOM elements.
|
|
12
|
+
*
|
|
13
|
+
* @param {Record<string, any>} props - Props object that may contain data-autotrack-* attributes
|
|
14
|
+
* @returns {Record<string, string | undefined>} Object containing only data-autotrack-* attributes
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const props = { title: 'My Tile', 'data-autotrack-action': 'click', ...rest };
|
|
19
|
+
* const dataAttrs = extractAutotrackAttributes(rest);
|
|
20
|
+
* // Returns: { 'data-autotrack-action': 'click' }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractAutotrackAttributes(props: Record<string, any>): Record<string, string | undefined>;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
/**
|
|
11
|
+
* Extracts data-autotrack-* attributes from props object.
|
|
12
|
+
* This utility filters out only the autotrack data attributes for spreading onto DOM elements.
|
|
13
|
+
*
|
|
14
|
+
* @param {Record<string, any>} props - Props object that may contain data-autotrack-* attributes
|
|
15
|
+
* @returns {Record<string, string | undefined>} Object containing only data-autotrack-* attributes
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const props = { title: 'My Tile', 'data-autotrack-action': 'click', ...rest };
|
|
20
|
+
* const dataAttrs = extractAutotrackAttributes(rest);
|
|
21
|
+
* // Returns: { 'data-autotrack-action': 'click' }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
function extractAutotrackAttributes(props) {
|
|
25
|
+
return Object.keys(props).reduce((acc, key) => {
|
|
26
|
+
if (key.startsWith('data-autotrack-')) {
|
|
27
|
+
acc[key] = props[key];
|
|
28
|
+
}
|
|
29
|
+
return acc;
|
|
30
|
+
}, {});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.extractAutotrackAttributes = extractAutotrackAttributes;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function AIPromptTile({ tileId, href, title, disabledTaskLabel, productName, promptPlaceholder, primaryIcon: PrimaryIcon, aiLabelVariant, aiLabelText, aiLabelTagType, onClick, ariaLabel, open, isLoading, isDisabled }: {
|
|
1
|
+
export function AIPromptTile({ tileId, href, title, disabledTaskLabel, productName, promptPlaceholder, primaryIcon: PrimaryIcon, aiLabelVariant, aiLabelText, aiLabelTagType, onClick, ariaLabel, open, isLoading, isDisabled, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
2
3
|
tileId: any;
|
|
3
4
|
href: any;
|
|
4
5
|
title: any;
|
|
@@ -14,12 +15,5 @@ export function AIPromptTile({ tileId, href, title, disabledTaskLabel, productNa
|
|
|
14
15
|
open: any;
|
|
15
16
|
isLoading: any;
|
|
16
17
|
isDisabled: any;
|
|
17
|
-
}): React.DetailedReactHTMLElement<
|
|
18
|
-
id: string;
|
|
19
|
-
className: string;
|
|
20
|
-
"aria-label": any;
|
|
21
|
-
role: "listitem";
|
|
22
|
-
title: any;
|
|
23
|
-
key: any;
|
|
24
|
-
}, HTMLElement>;
|
|
18
|
+
}): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
25
19
|
import React from 'react';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function AITile({ tileId, href, title, subtitle, disabledTaskLabel, customContent, primaryIcon: PrimaryIcon, secondaryIcon: SecondaryIcon, aiLabelVariant, aiLabelText, aiLabelTagType, onClick: aiTileClickHandler, ariaLabel, open, isLoading, isDisabled }: {
|
|
1
|
+
export function AITile({ tileId, href, title, subtitle, disabledTaskLabel, customContent, primaryIcon: PrimaryIcon, secondaryIcon: SecondaryIcon, aiLabelVariant, aiLabelText, aiLabelTagType, onClick: aiTileClickHandler, ariaLabel, open, isLoading, isDisabled, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
2
3
|
tileId: any;
|
|
3
4
|
href: any;
|
|
4
5
|
title: any;
|
|
@@ -15,11 +16,5 @@ export function AITile({ tileId, href, title, subtitle, disabledTaskLabel, custo
|
|
|
15
16
|
open: any;
|
|
16
17
|
isLoading: any;
|
|
17
18
|
isDisabled: any;
|
|
18
|
-
}): React.DetailedReactHTMLElement<
|
|
19
|
-
className: string;
|
|
20
|
-
key: any;
|
|
21
|
-
"aria-label": any;
|
|
22
|
-
title: any;
|
|
23
|
-
tabIndex: number;
|
|
24
|
-
}, HTMLElement> | React.FunctionComponentElement<import("@carbon/react").LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
19
|
+
}): React.DetailedReactHTMLElement<any, HTMLElement> | React.FunctionComponentElement<import("@carbon/react").LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
25
20
|
import React from 'react';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function GlassTile({ tileId, href, title, subtitle, disabledTaskLabel, customContent, primaryIcon: PrimaryIcon, secondaryIcon: SecondaryIcon, tagLabel, tagType, onClick: glassTileClickHandler, ariaLabel, open, isLoading, isDisabled }: {
|
|
1
|
+
export function GlassTile({ tileId, href, title, subtitle, disabledTaskLabel, customContent, primaryIcon: PrimaryIcon, secondaryIcon: SecondaryIcon, tagLabel, tagType, onClick: glassTileClickHandler, ariaLabel, open, isLoading, isDisabled, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
2
3
|
tileId: any;
|
|
3
4
|
href: any;
|
|
4
5
|
title: any;
|
|
@@ -14,11 +15,5 @@ export function GlassTile({ tileId, href, title, subtitle, disabledTaskLabel, cu
|
|
|
14
15
|
open: any;
|
|
15
16
|
isLoading: any;
|
|
16
17
|
isDisabled: any;
|
|
17
|
-
}): React.FunctionComponentElement<import("@carbon/react").LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements
|
|
18
|
-
className: string;
|
|
19
|
-
key: any;
|
|
20
|
-
"aria-label": any;
|
|
21
|
-
title: any;
|
|
22
|
-
tabIndex: number;
|
|
23
|
-
}, HTMLElement>;
|
|
18
|
+
}): React.DetailedReactHTMLElement<any, HTMLElement> | React.FunctionComponentElement<import("@carbon/react").LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
24
19
|
import React from 'react';
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Extracts data-autotrack-* attributes from props object.
|
|
9
|
+
* This utility filters out only the autotrack data attributes for spreading onto DOM elements.
|
|
10
|
+
*
|
|
11
|
+
* @param {Record<string, any>} props - Props object that may contain data-autotrack-* attributes
|
|
12
|
+
* @returns {Record<string, string | undefined>} Object containing only data-autotrack-* attributes
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const props = { title: 'My Tile', 'data-autotrack-action': 'click', ...rest };
|
|
17
|
+
* const dataAttrs = extractAutotrackAttributes(rest);
|
|
18
|
+
* // Returns: { 'data-autotrack-action': 'click' }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function extractAutotrackAttributes(props: Record<string, any>): Record<string, string | undefined>;
|
package/lib/index.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ import HeaderAction from './components/HeaderAction/HeaderAction';
|
|
|
12
12
|
import HeaderTitle from './components/HeaderTitle/HeaderTitle';
|
|
13
13
|
import { BaseTile } from './components/Tiles/index';
|
|
14
14
|
export * from './assets';
|
|
15
|
+
export type { AnimatedHeaderProps } from './components/AnimatedHeader/AnimatedHeader';
|
|
16
|
+
export type { Tile } from './components/AnimatedHeader/types';
|
|
17
|
+
export type { AITileProps } from './components/Tiles/AITile/AITile';
|
|
18
|
+
export type { AIPromptTileProps } from './components/Tiles/AIPromptTile/AIPromptTile';
|
|
19
|
+
export type { GlassTileProps } from './components/Tiles/GlassTile/GlassTile';
|
|
20
|
+
export type { BaseTileProps, TileVariant, } from './components/Tiles/BaseTile/BaseTile';
|
|
21
|
+
export type { AutotrackDataAttributes } from './components/types';
|
|
15
22
|
export type { Workspace, WorkspaceSelectorConfig, } from './components/WorkspaceSelector/WorkspaceSelector';
|
|
16
23
|
export type { TasksControllerConfig } from './components/TasksController/TasksController';
|
|
17
24
|
export type { HeaderActionConfig } from './components/HeaderAction/header-action.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon-labs/react-animated-header",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@carbon-labs/utilities": "0.22.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "12c33bd8782aef4764a3a72b9fedb0d010be2391"
|
|
49
49
|
}
|