@carbon-labs/react-animated-header 0.33.0 → 0.35.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.
Files changed (54) hide show
  1. package/assets/animated/header_animated_db2_dark_03.json +1 -0
  2. package/assets/animated/header_animated_db2_light_03.json +1 -0
  3. package/assets/index.js +7 -2
  4. package/assets/static/header_static_db2_dark_01.svg +53 -0
  5. package/assets/static/header_static_db2_light_01.svg +46 -0
  6. package/es/__stories__/AnimatedHeader.stories.d.ts +15328 -4716
  7. package/es/__stories__/data/index.d.ts +25 -0
  8. package/es/assets/animated/header_animated_db2_dark_03.json.js +10 -0
  9. package/es/assets/animated/header_animated_db2_light_03.json.js +10 -0
  10. package/es/assets/index.d.ts +3 -1
  11. package/es/assets/static/header_static_db2_dark_01.svg.js +10 -0
  12. package/es/assets/static/header_static_db2_light_01.svg.js +10 -0
  13. package/es/components/AnimatedHeader/AnimatedHeader.d.ts +4 -1
  14. package/es/components/AnimatedHeader/AnimatedHeader.js +72 -12
  15. package/es/components/ContentSwitcherSelector/ContentSwitcherSelector.d.ts +30 -0
  16. package/es/components/ContentSwitcherSelector/ContentSwitcherSelector.js +70 -0
  17. package/es/components/HeaderAction/HeaderAction.d.ts +15 -0
  18. package/es/components/HeaderAction/HeaderAction.js +69 -0
  19. package/es/components/HeaderAction/header-action.types.d.ts +32 -0
  20. package/es/components/HeaderTitle/HeaderTitle.js +2 -3
  21. package/es/components/TasksController/TasksController.d.ts +4 -1
  22. package/es/components/TasksController/TasksController.js +33 -23
  23. package/es/index.d.ts +2 -1
  24. package/es/index.js +5 -2
  25. package/lib/__stories__/AnimatedHeader.stories.d.ts +15328 -4716
  26. package/lib/__stories__/data/index.d.ts +25 -0
  27. package/lib/assets/animated/header_animated_db2_dark_03.json.js +26 -0
  28. package/lib/assets/animated/header_animated_db2_light_03.json.js +26 -0
  29. package/lib/assets/index.d.ts +3 -1
  30. package/lib/assets/static/header_static_db2_dark_01.svg.js +14 -0
  31. package/lib/assets/static/header_static_db2_light_01.svg.js +14 -0
  32. package/lib/components/AnimatedHeader/AnimatedHeader.d.ts +4 -1
  33. package/lib/components/AnimatedHeader/AnimatedHeader.js +72 -12
  34. package/lib/components/ContentSwitcherSelector/ContentSwitcherSelector.d.ts +30 -0
  35. package/lib/components/ContentSwitcherSelector/ContentSwitcherSelector.js +74 -0
  36. package/lib/components/HeaderAction/HeaderAction.d.ts +15 -0
  37. package/lib/components/HeaderAction/HeaderAction.js +73 -0
  38. package/lib/components/HeaderAction/header-action.types.d.ts +32 -0
  39. package/lib/components/HeaderTitle/HeaderTitle.js +2 -3
  40. package/lib/components/TasksController/TasksController.d.ts +4 -1
  41. package/lib/components/TasksController/TasksController.js +33 -23
  42. package/lib/index.d.ts +2 -1
  43. package/lib/index.js +10 -4
  44. package/package.json +2 -2
  45. package/scss/AnimatedHeader/animated-header.scss +82 -0
  46. package/scss/HeaderAction/header-action.scss +54 -0
  47. package/scss/HeaderTitle/header-title.scss +18 -12
  48. package/scss/animated-header.scss +1 -0
  49. package/assets/static/header_static_db2_dark_02.svg +0 -88
  50. package/assets/static/header_static_db2_light_02.svg +0 -44
  51. package/es/assets/static/header_static_db2_dark_02.svg.js +0 -10
  52. package/es/assets/static/header_static_db2_light_02.svg.js +0 -10
  53. package/lib/assets/static/header_static_db2_dark_02.svg.js +0 -14
  54. package/lib/assets/static/header_static_db2_light_02.svg.js +0 -14
@@ -0,0 +1,73 @@
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
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var React = require('react');
13
+ var react = require('@carbon/react');
14
+ var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
15
+
16
+ const HeaderAction = ({
17
+ config,
18
+ headerExpanded
19
+ }) => {
20
+ const prefix = usePrefix.usePrefix();
21
+ const blockClass = `${prefix}--animated-header__header-action`;
22
+
23
+ // ICON
24
+ if (config.type === 'icon-button') {
25
+ const {
26
+ icon: Icon,
27
+ iconLabel,
28
+ onClick,
29
+ disabled,
30
+ ariaLabel
31
+ } = config;
32
+ return /*#__PURE__*/React.createElement("div", {
33
+ className: blockClass,
34
+ "aria-label": ariaLabel,
35
+ "aria-hidden": !headerExpanded,
36
+ "data-expanded": headerExpanded
37
+ }, /*#__PURE__*/React.createElement(react.IconButton, {
38
+ kind: "ghost",
39
+ size: "lg",
40
+ label: iconLabel,
41
+ onClick: onClick,
42
+ disabled: disabled
43
+ }, Icon && /*#__PURE__*/React.createElement(Icon, {
44
+ fill: `var(--cds-icon-secondary)`,
45
+ size: 16
46
+ })));
47
+ }
48
+
49
+ // GHOST
50
+ if (config.type === 'ghost-button') {
51
+ const {
52
+ label,
53
+ icon,
54
+ onClick,
55
+ disabled,
56
+ ariaLabel
57
+ } = config;
58
+ return /*#__PURE__*/React.createElement("div", {
59
+ className: blockClass,
60
+ "aria-label": ariaLabel,
61
+ "aria-hidden": !headerExpanded,
62
+ "data-expanded": headerExpanded
63
+ }, /*#__PURE__*/React.createElement(react.Button, {
64
+ kind: "ghost",
65
+ size: "lg",
66
+ onClick: onClick,
67
+ disabled: disabled,
68
+ renderIcon: icon
69
+ }, label));
70
+ }
71
+ };
72
+
73
+ exports.default = HeaderAction;
@@ -0,0 +1,32 @@
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 } from 'react';
10
+ type Base = {
11
+ ariaLabel?: string;
12
+ headerExpanded?: boolean;
13
+ };
14
+ export type HeaderActionIcon = Base & {
15
+ type: 'icon-button';
16
+ icon: ElementType;
17
+ iconLabel: string;
18
+ onClick: () => void;
19
+ disabled?: boolean;
20
+ };
21
+ export type HeaderActionGhost = Base & {
22
+ type: 'ghost-button';
23
+ label: string;
24
+ icon?: ElementType;
25
+ onClick: () => void;
26
+ disabled?: boolean;
27
+ };
28
+ export type HeaderActionConfig = HeaderActionIcon | HeaderActionGhost;
29
+ export type HeaderActionProps = {
30
+ headerActionConfig?: HeaderActionConfig | null;
31
+ };
32
+ export {};
@@ -35,13 +35,12 @@ const HeaderTitle = ({
35
35
  const blockClass = `${prefix}--animated-header__title`;
36
36
  const currentLang = typeof window !== 'undefined' ? document.documentElement.lang || 'en' : 'en';
37
37
  const isNameFirst = NAME_FIRST_LANGS.includes(currentLang.slice(0, 2));
38
- const headingCollapsed = `${blockClass}-collapsed`;
39
- const headingExpanded = `${blockClass}-expanded`;
40
38
  return /*#__PURE__*/React.createElement(react.Tooltip, {
41
39
  align: "bottom",
42
40
  label: `${welcomeText}, ${userName}`
43
41
  }, /*#__PURE__*/React.createElement("h1", {
44
- className: `${blockClass} ${headerExpanded ? headingExpanded : headingCollapsed}`,
42
+ className: blockClass,
43
+ "data-expanded": headerExpanded,
45
44
  "aria-label": ariaLabels?.welcome ?? `${welcomeText}, ${userName}`
46
45
  }, isNameFirst ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
47
46
  className: `${blockClass}-first`
@@ -17,6 +17,7 @@ export interface TasksControllerConfig {
17
17
  };
18
18
  dropdown?: {
19
19
  propsOverrides?: Partial<Omit<DropdownProps<TileGroup>, 'id' | 'items' | 'selectedItem'>>;
20
+ label?: string;
20
21
  ariaLabel?: string;
21
22
  };
22
23
  }
@@ -25,7 +26,9 @@ export type TasksControllerProps = {
25
26
  isLoading?: boolean;
26
27
  allTileGroups?: TileGroup[];
27
28
  selectedTileGroup?: TileGroup | null;
28
- setSelectedTileGroup: (e: any) => void;
29
+ setSelectedTileGroup?: (group: TileGroup | {
30
+ selectedItem: TileGroup;
31
+ }) => void;
29
32
  };
30
33
  declare const TasksController: ({ tasksControllerConfig, isLoading, allTileGroups, selectedTileGroup, setSelectedTileGroup, }: TasksControllerProps) => import("react/jsx-runtime").JSX.Element | null;
31
34
  export default TasksController;
@@ -10,8 +10,8 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
- var react = require('@carbon/react');
14
13
  var React = require('react');
14
+ var react = require('@carbon/react');
15
15
  var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
16
16
 
17
17
  const TasksController = ({
@@ -21,54 +21,64 @@ const TasksController = ({
21
21
  selectedTileGroup,
22
22
  setSelectedTileGroup
23
23
  }) => {
24
+ const prefix = usePrefix.usePrefix();
25
+ const blockClass = `${prefix}--animated-header`;
26
+
27
+ /** Button overrides */
24
28
  const {
25
29
  className: buttonCustomClass,
26
30
  ...buttonOverrideProps
27
31
  } = tasksControllerConfig?.button?.propsOverrides || {};
32
+
33
+ /** Dropdown overrides */
28
34
  const {
29
35
  className: dropdownCustomClass,
30
36
  onChange: dropdownCustomOnChange,
31
37
  ...dropdownOverrideProps
32
38
  } = tasksControllerConfig?.dropdown?.propsOverrides || {};
33
- const prefix = usePrefix.usePrefix();
34
- const blockClass = `${prefix}--animated-header`;
39
+
40
+ /** Early outs */
41
+ if (!tasksControllerConfig?.type) return null;
42
+ if (isLoading || tasksControllerConfig?.isLoading) {
43
+ return /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
44
+ className: `${blockClass}__task-controller-skeleton`
45
+ });
46
+ }
47
+
48
+ /** Button mode */
49
+ if (tasksControllerConfig?.type === 'button' && tasksControllerConfig?.button?.text) {
50
+ return /*#__PURE__*/React.createElement(react.Button, _rollupPluginBabelHelpers.extends({
51
+ className: `${blockClass}__button${buttonCustomClass ? ` ${buttonCustomClass}` : ''}`
52
+ }, buttonOverrideProps), tasksControllerConfig.button.text);
53
+ }
54
+
55
+ /** Build Dropdown props (uses top-level list/selection/setter) */
35
56
  const dropdownProps = React.useMemo(() => {
36
- if (!allTileGroups?.length) {
37
- return null;
38
- }
57
+ if (!allTileGroups?.length) return null;
39
58
  return {
40
59
  id: `${blockClass}__header-dropdown`,
41
60
  className: `${blockClass}__header-dropdown${dropdownCustomClass ? ` ${dropdownCustomClass}` : ''}`,
42
61
  size: 'md',
43
62
  titleText: 'Label',
44
- label: allTileGroups[0]?.label ?? '',
63
+ label: tasksControllerConfig?.dropdown?.label ?? allTileGroups[0]?.label ?? '',
45
64
  hideLabel: true,
46
65
  type: 'inline',
47
66
  items: allTileGroups,
48
67
  selectedItem: selectedTileGroup ?? undefined,
49
68
  onChange: e => {
50
- setSelectedTileGroup?.(e);
69
+ if (e.selectedItem) {
70
+ setSelectedTileGroup?.({
71
+ selectedItem: e.selectedItem
72
+ });
73
+ }
51
74
  dropdownCustomOnChange?.(e);
52
75
  },
53
76
  'aria-label': tasksControllerConfig?.dropdown?.ariaLabel ?? 'Select a task group',
54
77
  ...dropdownOverrideProps
55
78
  };
56
- }, [allTileGroups, blockClass, dropdownCustomClass, selectedTileGroup, tasksControllerConfig?.dropdown?.ariaLabel, dropdownOverrideProps, setSelectedTileGroup, dropdownCustomOnChange]);
57
- if (!tasksControllerConfig?.type) {
58
- return null;
59
- }
60
- if (isLoading || tasksControllerConfig?.isLoading) {
61
- return /*#__PURE__*/React.createElement(react.SkeletonPlaceholder, {
62
- className: `${blockClass}__task-controller-skeleton`
63
- });
64
- }
79
+ }, [allTileGroups, selectedTileGroup, setSelectedTileGroup, blockClass, dropdownCustomClass, dropdownOverrideProps, dropdownCustomOnChange, tasksControllerConfig?.dropdown?.label, tasksControllerConfig?.dropdown?.ariaLabel]);
65
80
 
66
- // Button
67
- if (tasksControllerConfig?.type === 'button' && tasksControllerConfig?.button?.text) {
68
- return /*#__PURE__*/React.createElement(react.Button, _rollupPluginBabelHelpers.extends({
69
- className: `${blockClass}__button${buttonCustomClass ? ` ${buttonCustomClass}` : ''}`
70
- }, buttonOverrideProps), tasksControllerConfig.button.text);
71
- }
81
+ /** Dropdown mode */
72
82
  if (tasksControllerConfig?.type === 'dropdown' && dropdownProps) {
73
83
  return /*#__PURE__*/React.createElement("div", {
74
84
  className: `${blockClass}__header-dropdown--container`
package/lib/index.d.ts CHANGED
@@ -8,9 +8,10 @@
8
8
  */
9
9
  import AnimatedHeader from './components/AnimatedHeader/AnimatedHeader';
10
10
  import { AriaLabels, TileGroup } from './components/AnimatedHeader/types';
11
+ import HeaderAction from './components/HeaderAction/HeaderAction';
11
12
  import HeaderTitle from './components/HeaderTitle/HeaderTitle';
12
13
  import { BaseTile } from './components/Tiles/index';
13
14
  export * from './assets';
14
15
  export type { Workspace, WorkspaceSelectorConfig, } from './components/WorkspaceSelector/WorkspaceSelector';
15
16
  export type { TasksControllerConfig } from './components/TasksController/TasksController';
16
- export { AnimatedHeader, BaseTile, HeaderTitle, type AriaLabels, type TileGroup, };
17
+ export { AnimatedHeader, BaseTile, HeaderAction, HeaderTitle, type AriaLabels, type TileGroup, };
package/lib/index.js CHANGED
@@ -8,6 +8,7 @@
8
8
  'use strict';
9
9
 
10
10
  var AnimatedHeader = require('./components/AnimatedHeader/AnimatedHeader.js');
11
+ var HeaderAction = require('./components/HeaderAction/HeaderAction.js');
11
12
  var HeaderTitle = require('./components/HeaderTitle/HeaderTitle.js');
12
13
  require('react');
13
14
  require('@carbon/react');
@@ -15,8 +16,8 @@ require('@carbon/react/icons');
15
16
  var BaseTile = require('./components/Tiles/BaseTile/BaseTile.js');
16
17
  var header_static_data_fabric_light_06 = require('./assets/static/header_static_data_fabric_light_06.svg.js');
17
18
  var header_static_data_fabric_dark_06 = require('./assets/static/header_static_data_fabric_dark_06.svg.js');
18
- var header_static_db2_light_02 = require('./assets/static/header_static_db2_light_02.svg.js');
19
- var header_static_db2_dark_02 = require('./assets/static/header_static_db2_dark_02.svg.js');
19
+ var header_static_db2_light_01 = require('./assets/static/header_static_db2_light_01.svg.js');
20
+ var header_static_db2_dark_01 = require('./assets/static/header_static_db2_dark_01.svg.js');
20
21
  var header_static_watsonx_data_light_06 = require('./assets/static/header_static_watsonx_data_light_06.svg.js');
21
22
  var header_static_watsonx_data_dark_05 = require('./assets/static/header_static_watsonx_data_dark_05.svg.js');
22
23
  var header_static_watsonx_a_light_01 = require('./assets/static/header_static_watsonx_a_light_01.svg.js');
@@ -25,6 +26,8 @@ var header_static_wxbia_light_01 = require('./assets/static/header_static_wxbia_
25
26
  var header_static_wxbia_dark_01 = require('./assets/static/header_static_wxbia_dark_01.svg.js');
26
27
  var header_animated_data_fabric_light_03 = require('./assets/animated/header_animated_data_fabric_light_03.json.js');
27
28
  var header_animated_data_fabric_dark_06 = require('./assets/animated/header_animated_data_fabric_dark_06.json.js');
29
+ var header_animated_db2_light_03 = require('./assets/animated/header_animated_db2_light_03.json.js');
30
+ var header_animated_db2_dark_03 = require('./assets/animated/header_animated_db2_dark_03.json.js');
28
31
  var header_animated_watsonx_data_light_04 = require('./assets/animated/header_animated_watsonx_data_light_04.json.js');
29
32
  var header_animated_watsonx_data_dark_03 = require('./assets/animated/header_animated_watsonx_data_dark_03.json.js');
30
33
  var header_animated_watsonx_a_light_06 = require('./assets/animated/header_animated_watsonx_a_light_06.json.js');
@@ -35,12 +38,13 @@ var header_animated_wxbia_dark_06 = require('./assets/animated/header_animated_w
35
38
 
36
39
 
37
40
  exports.AnimatedHeader = AnimatedHeader.default;
41
+ exports.HeaderAction = HeaderAction.default;
38
42
  exports.HeaderTitle = HeaderTitle.default;
39
43
  exports.BaseTile = BaseTile.BaseTile;
40
44
  exports.dataFabricStaticLight = header_static_data_fabric_light_06.default;
41
45
  exports.dataFabricStaticDark = header_static_data_fabric_dark_06.default;
42
- exports.db2StaticLight = header_static_db2_light_02.default;
43
- exports.db2StaticDark = header_static_db2_dark_02.default;
46
+ exports.db2StaticLight = header_static_db2_light_01.default;
47
+ exports.db2StaticDark = header_static_db2_dark_01.default;
44
48
  exports.watsonXStaticLight = header_static_watsonx_data_light_06.default;
45
49
  exports.watsonXStaticDark = header_static_watsonx_data_dark_05.default;
46
50
  exports.watsonXAStaticLight = header_static_watsonx_a_light_01.default;
@@ -49,6 +53,8 @@ exports.wxbiaStaticLight = header_static_wxbia_light_01.default;
49
53
  exports.wxbiaStaticDark = header_static_wxbia_dark_01.default;
50
54
  exports.dataFabricAnimatedLight = header_animated_data_fabric_light_03.default;
51
55
  exports.dataFabricAnimatedDark = header_animated_data_fabric_dark_06.default;
56
+ exports.db2AnimatedLight = header_animated_db2_light_03.default;
57
+ exports.db2AnimatedDark = header_animated_db2_dark_03.default;
52
58
  exports.watsonXAnimatedLight = header_animated_watsonx_data_light_04.default;
53
59
  exports.watsonXAnimatedDark = header_animated_watsonx_data_dark_03.default;
54
60
  exports.watsonXAAnimatedLight = header_animated_watsonx_a_light_06.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-animated-header",
3
- "version": "0.33.0",
3
+ "version": "0.35.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": "2cb890436fa0c3e0f5a0b9738f2d59fb1a50eb31"
48
+ "gitHead": "e309816781d0fc8aff80cb7c9525830cc20c753c"
49
49
  }
@@ -258,6 +258,80 @@ body {
258
258
  inline-size: 100%;
259
259
  }
260
260
 
261
+ .#{$prefix}__title-and-actions {
262
+ display: flex;
263
+ align-items: center;
264
+ justify-content: space-between;
265
+ gap: $spacing-07;
266
+ min-block-size: $spacing-09;
267
+ }
268
+
269
+ .#{$prefix}__actions {
270
+ display: flex;
271
+ flex-shrink: 0;
272
+ align-items: center;
273
+ }
274
+
275
+ .#{$prefix}__content-switcher--container {
276
+ position: relative;
277
+ z-index: 2;
278
+ display: inline-flex;
279
+ align-items: center;
280
+ inline-size: max-content;
281
+ isolation: isolate;
282
+
283
+ @media (prefers-reduced-motion: no-preference) {
284
+ transition: opacity 500ms linear,
285
+ margin 500ms motion.motion(standard, expressive);
286
+ }
287
+
288
+ &[data-expanded='true'] {
289
+ margin: $spacing-08 0 $spacing-05 0;
290
+ opacity: 1;
291
+ transition-delay: 110ms;
292
+ }
293
+
294
+ &[data-expanded='false'] {
295
+ margin: $spacing-02 0 $spacing-02 0;
296
+ line-height: 1.25;
297
+
298
+ opacity: 0;
299
+ transition-delay: 0ms;
300
+ }
301
+ }
302
+
303
+ .#{$prefix}__content-switcher--container::before {
304
+ position: absolute;
305
+ border-radius: inherit;
306
+ -webkit-backdrop-filter: blur(3px);
307
+ backdrop-filter: blur(3px);
308
+ content: '';
309
+ inset: 0;
310
+ pointer-events: none;
311
+ }
312
+
313
+ .#{$prefix}__content-switcher {
314
+ position: relative;
315
+ z-index: 1;
316
+
317
+ animation: 500ms motion.motion(standard, expressive) 0ms 1 slide-in;
318
+ animation-delay: 383.333ms;
319
+ animation-fill-mode: both;
320
+ }
321
+
322
+ .#{$prefix}__content-switcher-skeleton {
323
+ background: $layer-01;
324
+ block-size: $spacing-08;
325
+ inline-size: 27rem;
326
+ max-inline-size: 18rem;
327
+
328
+ opacity: 0.7;
329
+ }
330
+
331
+ .#{$prefix}__content-switcher-skeleton::before {
332
+ background: $layer-02;
333
+ }
334
+
261
335
  .#{$prefix}__content {
262
336
  z-index: 2;
263
337
  display: flex;
@@ -438,6 +512,10 @@ body {
438
512
  display: none;
439
513
  }
440
514
 
515
+ .#{$prefix}__header-switcher {
516
+ display: none;
517
+ }
518
+
441
519
  .#{$prefix}__content {
442
520
  display: none;
443
521
  }
@@ -457,6 +535,10 @@ body {
457
535
  display: block;
458
536
  }
459
537
 
538
+ .#{$prefix}__header-switcher {
539
+ display: inline-flex;
540
+ }
541
+
460
542
  .#{$prefix}__static {
461
543
  display: flex;
462
544
 
@@ -0,0 +1,54 @@
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
+ @use '@carbon/styles/scss/spacing' as *;
11
+ @use '@carbon/styles/scss/type' as *;
12
+ @use '@carbon/react/scss/theme' as *;
13
+
14
+ $prefix: 'clabs--animated-header__header-action' !default;
15
+
16
+ .#{$prefix} {
17
+ position: relative;
18
+ display: inline-flex;
19
+ align-items: center;
20
+ gap: $spacing-05;
21
+ min-block-size: 2.5rem;
22
+
23
+ &::after {
24
+ position: absolute;
25
+ z-index: 2;
26
+ display: block;
27
+ background-color: $border-subtle;
28
+ block-size: $spacing-06;
29
+ content: '';
30
+ inline-size: 0.0625rem;
31
+ inset-inline-end: 0;
32
+ }
33
+
34
+ button.cds--btn {
35
+ z-index: 3;
36
+ }
37
+
38
+ @media (prefers-reduced-motion: no-preference) {
39
+ transition: opacity 500ms linear, visibility 500ms linear;
40
+ }
41
+
42
+ &[data-expanded='true'] {
43
+ opacity: 1;
44
+ pointer-events: auto;
45
+ visibility: visible;
46
+ }
47
+
48
+ &[data-expanded='false'] {
49
+ opacity: 0;
50
+ pointer-events: none;
51
+ user-select: none;
52
+ visibility: hidden;
53
+ }
54
+ }
@@ -13,17 +13,30 @@
13
13
  $prefix: 'clabs--animated-header__title' !default;
14
14
 
15
15
  .#{$prefix} {
16
- @include type-style('heading-05');
17
-
18
16
  position: relative;
19
17
  z-index: 2;
20
18
  overflow: hidden;
21
- margin: $spacing-08 0 $spacing-05 0;
22
19
  text-overflow: ellipsis;
23
- transition: font-size 500ms motion.motion(standard, expressive),
24
- margin 500ms motion.motion(standard, expressive);
25
20
  white-space: nowrap;
26
21
 
22
+ @media (prefers-reduced-motion: no-preference) {
23
+ transition: font-size 500ms motion.motion(standard, expressive),
24
+ margin 500ms motion.motion(standard, expressive);
25
+ }
26
+
27
+ &[data-expanded='true'] {
28
+ @include type-style('heading-05');
29
+
30
+ margin: $spacing-08 0 $spacing-05 0;
31
+ }
32
+
33
+ &[data-expanded='false'] {
34
+ @include type-style('heading-03');
35
+
36
+ margin: calc($spacing-04 - 0.5px) 0 calc($spacing-04 - 0.5px) 0;
37
+ line-height: 1.25;
38
+ }
39
+
27
40
  @supports (-webkit-line-clamp: 3) {
28
41
  display: -webkit-box;
29
42
  overflow: hidden;
@@ -41,13 +54,6 @@ $prefix: 'clabs--animated-header__title' !default;
41
54
  }
42
55
  }
43
56
 
44
- .#{$prefix}-collapsed {
45
- @include type-style('heading-03');
46
-
47
- margin: $spacing-03 0 $spacing-04 0;
48
- line-height: 1.25;
49
- }
50
-
51
57
  .#{$prefix}-first {
52
58
  animation: 250ms ease-in fade-in;
53
59
  animation-fill-mode: both;
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  @use 'AnimatedHeader/animated-header.scss';
9
+ @use 'HeaderAction/header-action.scss';
9
10
  @use 'HeaderTitle/header-title.scss';
10
11
  @use 'Tiles/AITile/ai-tile.scss';
11
12
  @use 'Tiles/AIPromptTile/ai-prompt-tile.scss';
@@ -1,88 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1312 738">
3
- <defs>
4
- <style>
5
- .cls-1 {
6
- stroke: #003a6d;
7
- }
8
-
9
- .cls-1, .cls-2 {
10
- fill: none;
11
- stroke-miterlimit: 10;
12
- }
13
-
14
- .cls-3 {
15
- fill: #e0e0e0;
16
- }
17
-
18
- .cls-4 {
19
- fill: #161616;
20
- stroke: #007d79;
21
- }
22
-
23
- .cls-5 {
24
- fill: #d9fbfb;
25
- stroke: #03ddbd;
26
- }
27
-
28
- .cls-2 {
29
- stroke: #a6c8ff;
30
- }
31
- </style>
32
- </defs>
33
- <!-- Generator: Adobe Illustrator 28.7.1, SVG Export Plug-In . SVG Version: 1.2.0 Build 142) -->
34
- <g>
35
- <g id="Layer_1">
36
- <path class="cls-2" d="M-2148.3,0v171.3s0,72,72.4,72h583.6"/>
37
- <path class="cls-2" d="M-2804.3,98.9h1016.5s72.5,1,72.5-73V0"/>
38
- <path class="cls-2" d="M-2805,315.2h1162s81.3.3,81.3-71.9v-45.9"/>
39
- <path class="cls-2" d="M-2804.3,171.3h1016.5s144.4.5,144.4-145.3V0"/>
40
- <path class="cls-2" d="M-2804.3,26h1160.3s82.3,0,82.3,80.9v631.1"/>
41
- <path class="cls-5" d="M-1556.6,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
42
- <line class="cls-2" x1="-1859.7" x2="-1859.7" y2="738"/>
43
- <line class="cls-2" x1="-2004" x2="-2004" y2="738"/>
44
- <line class="cls-2" x1="-2075.9" x2="-2075.9" y2="738"/>
45
- <line class="cls-2" x1="-1931.9" x2="-1931.9" y2="738"/>
46
- <line class="cls-2" x1="-1787.8" x2="-1787.8" y2="738"/>
47
- <path class="cls-5" d="M-1782.6,20.8c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
48
- <path class="cls-5" d="M-1638.3,20.8c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
49
- <path class="cls-5" d="M-1926.7,93.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
50
- <path class="cls-5" d="M-1854.6,166.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
51
- <path class="cls-5" d="M-1854.6,310c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
52
- <path class="cls-5" d="M-1926.7,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
53
- <path class="cls-5" d="M-1996.9,25.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
54
- <path class="cls-5" d="M-2068.8,98.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
55
- <path class="cls-5" d="M-2068.8,171.3c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
56
- <path class="cls-5" d="M-1780.7,171.3c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
57
- <path class="cls-5" d="M-1782.6,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
58
- <g>
59
- <rect class="cls-3" x="-2466.1" y="121.6" width="223.5" height="176.1"/>
60
- <rect class="cls-3" x="-2225.6" y="121.6" width="223.5" height="176.1"/>
61
- <rect class="cls-3" x="-1986.4" y="121.6" width="223.5" height="176.1"/>
62
- <rect class="cls-3" x="-1746.1" y="121.6" width="223.5" height="176.1"/>
63
- </g>
64
- <path class="cls-1" d="M656.3-.3v171.3s0,72,72.4,72h583.6"/>
65
- <path class="cls-1" d="M.3,98.6h1016.5s72.5,1,72.5-73V-.3"/>
66
- <path class="cls-1" d="M-.3,314.8h1162s81.3.3,81.3-71.9v-45.9"/>
67
- <path class="cls-1" d="M.3,170.9h1016.5s144.4.5,144.4-145.3V-.3"/>
68
- <path class="cls-1" d="M.3,25.7h1160.3s82.3,0,82.3,80.9v631.1"/>
69
- <path class="cls-4" d="M1248.1,237.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
70
- <line class="cls-1" x1="944.9" y1="-.3" x2="944.9" y2="737.7"/>
71
- <line class="cls-1" x1="800.6" y1="-.3" x2="800.6" y2="737.7"/>
72
- <line class="cls-1" x1="728.7" y1="-.3" x2="728.7" y2="737.7"/>
73
- <line class="cls-1" x1="872.8" y1="-.3" x2="872.8" y2="737.7"/>
74
- <line class="cls-1" x1="1016.9" y1="-.3" x2="1016.9" y2="737.7"/>
75
- <path class="cls-4" d="M1022,20.5c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
76
- <path class="cls-4" d="M1166.4,20.5c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
77
- <path class="cls-4" d="M877.9,93.4c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
78
- <path class="cls-4" d="M950.1,165.8c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
79
- <path class="cls-4" d="M950.1,309.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
80
- <path class="cls-4" d="M877.9,237.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
81
- <path class="cls-4" d="M807.7,25.6c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
82
- <path class="cls-4" d="M735.8,98.6c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
83
- <path class="cls-4" d="M735.8,170.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
84
- <path class="cls-4" d="M1024,170.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
85
- <path class="cls-4" d="M1022,237.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
86
- </g>
87
- </g>
88
- </svg>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1312 738">
3
- <defs>
4
- <style>
5
- .cls-1 {
6
- fill: #d9fbfb;
7
- stroke: #03ddbd;
8
- }
9
-
10
- .cls-2 {
11
- fill: none;
12
- stroke: #a6c8ff;
13
- stroke-miterlimit: 10;
14
- }
15
- </style>
16
- </defs>
17
- <!-- Generator: Adobe Illustrator 28.7.1, SVG Export Plug-In . SVG Version: 1.2.0 Build 142) -->
18
- <g>
19
- <g id="Layer_1">
20
- <path class="cls-2" d="M656,0v171.3s0,72,72.4,72h583.6"/>
21
- <path class="cls-2" d="M0,98.9h1016.5s72.5,1,72.5-73V0"/>
22
- <path class="cls-2" d="M-.6,315.2h1162s81.3.3,81.3-71.9v-45.9"/>
23
- <path class="cls-2" d="M0,171.3h1016.5s144.4.5,144.4-145.3V0"/>
24
- <path class="cls-2" d="M0,26h1160.3s82.3,0,82.3,80.9v631.1"/>
25
- <path class="cls-1" d="M1247.8,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
26
- <line class="cls-2" x1="944.6" x2="944.6" y2="738"/>
27
- <line class="cls-2" x1="800.3" x2="800.3" y2="738"/>
28
- <line class="cls-2" x1="728.4" x2="728.4" y2="738"/>
29
- <line class="cls-2" x1="872.5" x2="872.5" y2="738"/>
30
- <line class="cls-2" x1="1016.5" x2="1016.5" y2="738"/>
31
- <path class="cls-1" d="M1021.7,20.8c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
32
- <path class="cls-1" d="M1166.1,20.8c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
33
- <path class="cls-1" d="M877.6,93.7c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
34
- <path class="cls-1" d="M949.8,166.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
35
- <path class="cls-1" d="M949.8,310c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
36
- <path class="cls-1" d="M877.6,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
37
- <path class="cls-1" d="M807.4,25.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
38
- <path class="cls-1" d="M735.5,98.9c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
39
- <path class="cls-1" d="M735.5,171.3c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
40
- <path class="cls-1" d="M1023.6,171.3c0,3.9-3.2,7.1-7.1,7.1s-7.1-3.2-7.1-7.1,3.2-7.1,7.1-7.1,7.1,3.2,7.1,7.1Z"/>
41
- <path class="cls-1" d="M1021.7,238.1c5.9,7.5-2.9,16.2-10.3,10.3-5.9-7.5,2.9-16.2,10.3-10.3Z"/>
42
- </g>
43
- </g>
44
- </svg>