@carbon-labs/react-animated-header 0.21.0 → 0.22.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.
@@ -8,35 +8,34 @@
8
8
  import PropTypes from 'prop-types';
9
9
  import React, { useRef, useState, useEffect } from 'react';
10
10
  import { Grid, Column, Tooltip, Button } from '@carbon/react';
11
+ import { ChevronUp, ChevronDown } from '@carbon/icons-react';
11
12
  import lottie from '../../_virtual/lottie.js';
12
13
  import { usePrefix } from '../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
13
14
  import '@carbon/react/icons';
14
15
  import { BaseTile } from '../Tiles/BaseTile/BaseTile.js';
15
16
  import TasksController from '../TasksController/TasksController.js';
16
17
  import WorkspaceSelector from '../WorkspaceSelector/WorkspaceSelector.js';
17
- import { ChevronUp, ChevronDown } from '../../node_modules/@carbon/icons-react/es/generated/bucket-3.js';
18
18
 
19
19
  /** Animated Header */
20
20
 
21
- const AnimatedHeader = _ref => {
22
- let {
23
- allTileGroups,
24
- selectedTileGroup,
25
- setSelectedTileGroup,
26
- description,
27
- headerAnimation,
28
- headerStatic,
29
- productName = '[Product name]',
30
- userName,
31
- welcomeText,
32
- tasksControllerConfig,
33
- workspaceSelectorConfig,
34
- isLoading,
35
- disabledTaskLabel,
36
- expandButtonLabel = 'Expand',
37
- collapseButtonLabel = 'Collapse',
38
- tileClickHandler
39
- } = _ref;
21
+ const AnimatedHeader = ({
22
+ allTileGroups,
23
+ selectedTileGroup,
24
+ setSelectedTileGroup,
25
+ description,
26
+ headerAnimation,
27
+ headerStatic,
28
+ productName = '[Product name]',
29
+ userName,
30
+ welcomeText,
31
+ tasksControllerConfig,
32
+ workspaceSelectorConfig,
33
+ isLoading,
34
+ disabledTaskLabel,
35
+ expandButtonLabel = 'Expand',
36
+ collapseButtonLabel = 'Collapse',
37
+ tileClickHandler
38
+ }) => {
40
39
  const prefix = usePrefix();
41
40
  const blockClass = `${prefix}--animated-header`;
42
41
  const animationContainer = useRef(null);
@@ -10,14 +10,13 @@ import { SkeletonPlaceholder, Button, Dropdown } from '@carbon/react';
10
10
  import React, { useMemo } from 'react';
11
11
  import { usePrefix } from '../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
12
12
 
13
- const TasksController = _ref => {
14
- let {
15
- tasksControllerConfig,
16
- isLoading,
17
- allTileGroups,
18
- selectedTileGroup,
19
- setSelectedTileGroup
20
- } = _ref;
13
+ const TasksController = ({
14
+ tasksControllerConfig,
15
+ isLoading,
16
+ allTileGroups,
17
+ selectedTileGroup,
18
+ setSelectedTileGroup
19
+ }) => {
21
20
  const {
22
21
  className: buttonCustomClass,
23
22
  ...buttonOverrideProps
@@ -14,19 +14,18 @@ var _AILabel, _Send;
14
14
 
15
15
  /** Primary UI component for user interaction */
16
16
 
17
- const AIPromptTile = _ref => {
18
- let {
19
- href,
20
- id,
21
- mainIcon: MainIcon,
22
- open,
23
- productName,
24
- title,
25
- isLoading,
26
- isDisabled,
27
- disabledTaskLabel,
28
- onClick
29
- } = _ref;
17
+ const AIPromptTile = ({
18
+ href,
19
+ id,
20
+ mainIcon: MainIcon,
21
+ open,
22
+ productName,
23
+ title,
24
+ isLoading,
25
+ isDisabled,
26
+ disabledTaskLabel,
27
+ onClick
28
+ }) => {
30
29
  const prefix = usePrefix();
31
30
  const blockClass = `${prefix}--animated-header__ai-prompt-tile`;
32
31
  const collapsed = `${blockClass}--collapsed`;
@@ -12,21 +12,20 @@ import { GlassTileBody } from './GlassTileBody.js';
12
12
 
13
13
  /** Primary UI component for user interaction */
14
14
 
15
- const GlassTile = _ref => {
16
- let {
17
- href,
18
- id,
19
- mainIcon,
20
- open,
21
- secondaryIcon,
22
- subtitle,
23
- title,
24
- customContent,
25
- isLoading,
26
- isDisabled,
27
- disabledTaskLabel,
28
- onClick: glassTileClickHandler
29
- } = _ref;
15
+ const GlassTile = ({
16
+ href,
17
+ id,
18
+ mainIcon,
19
+ open,
20
+ secondaryIcon,
21
+ subtitle,
22
+ title,
23
+ customContent,
24
+ isLoading,
25
+ isDisabled,
26
+ disabledTaskLabel,
27
+ onClick: glassTileClickHandler
28
+ }) => {
30
29
  const prefix = usePrefix();
31
30
  const blockClass = `${prefix}--animated-header__glass-tile`;
32
31
  const body = /*#__PURE__*/React.createElement(GlassTileBody, {
@@ -9,16 +9,15 @@ import React from 'react';
9
9
  import { usePrefix } from '../../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
10
10
  import { SkeletonPlaceholder } from '@carbon/react';
11
11
 
12
- const GlassTileBody = _ref => {
13
- let {
14
- mainIcon: MainIcon,
15
- open,
16
- secondaryIcon: SecondaryIcon,
17
- subtitle,
18
- title,
19
- customContent,
20
- isLoading
21
- } = _ref;
12
+ const GlassTileBody = ({
13
+ mainIcon: MainIcon,
14
+ open,
15
+ secondaryIcon: SecondaryIcon,
16
+ subtitle,
17
+ title,
18
+ customContent,
19
+ isLoading
20
+ }) => {
22
21
  const prefix = usePrefix();
23
22
  const blockClass = `${prefix}--animated-header__glass-tile`;
24
23
  const collapsed = `${blockClass}--collapsed`;
@@ -9,12 +9,11 @@ import { SkeletonPlaceholder, Dropdown } from '@carbon/react';
9
9
  import { usePrefix } from '../../node_modules/@carbon-labs/utilities/es/usePrefix.js';
10
10
  import React, { useMemo } from 'react';
11
11
 
12
- const WorkspaceSelector = _ref => {
13
- let {
14
- workspaceSelectorConfig,
15
- userName,
16
- isLoading
17
- } = _ref;
12
+ const WorkspaceSelector = ({
13
+ workspaceSelectorConfig,
14
+ userName,
15
+ isLoading
16
+ }) => {
18
17
  const {
19
18
  className: dropdownCustomClass,
20
19
  onChange: dropdownCustomOnChange,
@@ -12,35 +12,34 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var PropTypes = require('prop-types');
13
13
  var React = require('react');
14
14
  var react = require('@carbon/react');
15
+ var iconsReact = require('@carbon/icons-react');
15
16
  var lottie = require('../../_virtual/lottie.js');
16
17
  var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
17
18
  require('@carbon/react/icons');
18
19
  var BaseTile = require('../Tiles/BaseTile/BaseTile.js');
19
20
  var TasksController = require('../TasksController/TasksController.js');
20
21
  var WorkspaceSelector = require('../WorkspaceSelector/WorkspaceSelector.js');
21
- var bucket3 = require('../../node_modules/@carbon/icons-react/es/generated/bucket-3.js');
22
22
 
23
23
  /** Animated Header */
24
24
 
25
- const AnimatedHeader = _ref => {
26
- let {
27
- allTileGroups,
28
- selectedTileGroup,
29
- setSelectedTileGroup,
30
- description,
31
- headerAnimation,
32
- headerStatic,
33
- productName = '[Product name]',
34
- userName,
35
- welcomeText,
36
- tasksControllerConfig,
37
- workspaceSelectorConfig,
38
- isLoading,
39
- disabledTaskLabel,
40
- expandButtonLabel = 'Expand',
41
- collapseButtonLabel = 'Collapse',
42
- tileClickHandler
43
- } = _ref;
25
+ const AnimatedHeader = ({
26
+ allTileGroups,
27
+ selectedTileGroup,
28
+ setSelectedTileGroup,
29
+ description,
30
+ headerAnimation,
31
+ headerStatic,
32
+ productName = '[Product name]',
33
+ userName,
34
+ welcomeText,
35
+ tasksControllerConfig,
36
+ workspaceSelectorConfig,
37
+ isLoading,
38
+ disabledTaskLabel,
39
+ expandButtonLabel = 'Expand',
40
+ collapseButtonLabel = 'Collapse',
41
+ tileClickHandler
42
+ }) => {
44
43
  const prefix = usePrefix.usePrefix();
45
44
  const blockClass = `${prefix}--animated-header`;
46
45
  const animationContainer = React.useRef(null);
@@ -178,7 +177,7 @@ const AnimatedHeader = _ref => {
178
177
  }, /*#__PURE__*/React.createElement(react.Button, {
179
178
  id: `${blockClass}__button-collapse`,
180
179
  kind: "ghost",
181
- renderIcon: open ? bucket3.ChevronUp : bucket3.ChevronDown,
180
+ renderIcon: open ? iconsReact.ChevronUp : iconsReact.ChevronDown,
182
181
  onClick: handleButtonCollapseClick
183
182
  }, open ? collapseButtonLabel : expandButtonLabel))));
184
183
  };
@@ -14,14 +14,13 @@ var react = require('@carbon/react');
14
14
  var React = require('react');
15
15
  var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
16
16
 
17
- const TasksController = _ref => {
18
- let {
19
- tasksControllerConfig,
20
- isLoading,
21
- allTileGroups,
22
- selectedTileGroup,
23
- setSelectedTileGroup
24
- } = _ref;
17
+ const TasksController = ({
18
+ tasksControllerConfig,
19
+ isLoading,
20
+ allTileGroups,
21
+ selectedTileGroup,
22
+ setSelectedTileGroup
23
+ }) => {
25
24
  const {
26
25
  className: buttonCustomClass,
27
26
  ...buttonOverrideProps
@@ -16,19 +16,18 @@ var _AILabel, _Send;
16
16
 
17
17
  /** Primary UI component for user interaction */
18
18
 
19
- const AIPromptTile = _ref => {
20
- let {
21
- href,
22
- id,
23
- mainIcon: MainIcon,
24
- open,
25
- productName,
26
- title,
27
- isLoading,
28
- isDisabled,
29
- disabledTaskLabel,
30
- onClick
31
- } = _ref;
19
+ const AIPromptTile = ({
20
+ href,
21
+ id,
22
+ mainIcon: MainIcon,
23
+ open,
24
+ productName,
25
+ title,
26
+ isLoading,
27
+ isDisabled,
28
+ disabledTaskLabel,
29
+ onClick
30
+ }) => {
32
31
  const prefix = usePrefix.usePrefix();
33
32
  const blockClass = `${prefix}--animated-header__ai-prompt-tile`;
34
33
  const collapsed = `${blockClass}--collapsed`;
@@ -14,21 +14,20 @@ var GlassTileBody = require('./GlassTileBody.js');
14
14
 
15
15
  /** Primary UI component for user interaction */
16
16
 
17
- const GlassTile = _ref => {
18
- let {
19
- href,
20
- id,
21
- mainIcon,
22
- open,
23
- secondaryIcon,
24
- subtitle,
25
- title,
26
- customContent,
27
- isLoading,
28
- isDisabled,
29
- disabledTaskLabel,
30
- onClick: glassTileClickHandler
31
- } = _ref;
17
+ const GlassTile = ({
18
+ href,
19
+ id,
20
+ mainIcon,
21
+ open,
22
+ secondaryIcon,
23
+ subtitle,
24
+ title,
25
+ customContent,
26
+ isLoading,
27
+ isDisabled,
28
+ disabledTaskLabel,
29
+ onClick: glassTileClickHandler
30
+ }) => {
32
31
  const prefix = usePrefix.usePrefix();
33
32
  const blockClass = `${prefix}--animated-header__glass-tile`;
34
33
  const body = /*#__PURE__*/React.createElement(GlassTileBody.GlassTileBody, {
@@ -11,16 +11,15 @@ var React = require('react');
11
11
  var usePrefix = require('../../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
12
12
  var react = require('@carbon/react');
13
13
 
14
- const GlassTileBody = _ref => {
15
- let {
16
- mainIcon: MainIcon,
17
- open,
18
- secondaryIcon: SecondaryIcon,
19
- subtitle,
20
- title,
21
- customContent,
22
- isLoading
23
- } = _ref;
14
+ const GlassTileBody = ({
15
+ mainIcon: MainIcon,
16
+ open,
17
+ secondaryIcon: SecondaryIcon,
18
+ subtitle,
19
+ title,
20
+ customContent,
21
+ isLoading
22
+ }) => {
24
23
  const prefix = usePrefix.usePrefix();
25
24
  const blockClass = `${prefix}--animated-header__glass-tile`;
26
25
  const collapsed = `${blockClass}--collapsed`;
@@ -13,12 +13,11 @@ var react = require('@carbon/react');
13
13
  var usePrefix = require('../../node_modules/@carbon-labs/utilities/es/usePrefix.js');
14
14
  var React = require('react');
15
15
 
16
- const WorkspaceSelector = _ref => {
17
- let {
18
- workspaceSelectorConfig,
19
- userName,
20
- isLoading
21
- } = _ref;
16
+ const WorkspaceSelector = ({
17
+ workspaceSelectorConfig,
18
+ userName,
19
+ isLoading
20
+ }) => {
22
21
  const {
23
22
  className: dropdownCustomClass,
24
23
  onChange: dropdownCustomOnChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-animated-header",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "scripts": {
35
35
  "build": "node ../../../tasks/build.js",
36
- "clean": "rm -rf {es,lib,scss}",
36
+ "clean": "rimraf es lib scss",
37
37
  "postinstall": "ibmtelemetry --config=telemetry.yml",
38
38
  "telemetry:config": "npx -y @ibm/telemetry-js-config-generator generate --id 40597fb8-d0ed-45fb-a95a-5b1751e22c36 --endpoint https://www-api.ibm.com/ibm-telemetry/v1/metrics --files ./components/**/*.(tsx|js|jsx)"
39
39
  },
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@carbon-labs/utilities": "canary"
47
47
  },
48
- "gitHead": "e6f4e6a5ce706a8be19dc22f663839a34b85f02b"
48
+ "gitHead": "9a7e0911865b850569e3832039d1860ffebd2533"
49
49
  }
@@ -1,71 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2024
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import { getAttributes } from '../node_modules/@carbon/icon-helpers/es/index.js';
9
- import PropTypes from 'prop-types';
10
- import React from 'react';
11
-
12
- /**
13
- * Copyright IBM Corp. 2019, 2023
14
- *
15
- * This source code is licensed under the Apache-2.0 license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */
18
- const Icon = /*#__PURE__*/React.forwardRef(function Icon(_ref, ref) {
19
- let {
20
- className,
21
- children,
22
- tabIndex,
23
- xmlns = 'http://www.w3.org/2000/svg',
24
- preserveAspectRatio = 'xMidYMid meet',
25
- ...rest
26
- } = _ref;
27
- const {
28
- tabindex,
29
- ...attrs
30
- } = getAttributes({
31
- ...rest,
32
- tabindex: tabIndex
33
- });
34
- const props = attrs;
35
- if (className) {
36
- props.className = className;
37
- }
38
- if (tabindex !== undefined && tabindex !== null) {
39
- if (typeof tabindex === 'number') {
40
- props.tabIndex = tabindex;
41
- } else {
42
- props.tabIndex = Number(tabIndex);
43
- }
44
- }
45
- if (ref) {
46
- props.ref = ref;
47
- }
48
- if (xmlns) {
49
- props.xmlns = xmlns;
50
- }
51
- if (preserveAspectRatio) {
52
- props.preserveAspectRatio = preserveAspectRatio;
53
- }
54
- return /*#__PURE__*/React.createElement('svg', props, children);
55
- });
56
- Icon.displayName = 'Icon';
57
- Icon.propTypes = {
58
- 'aria-hidden': PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['true', 'false'])]),
59
- 'aria-label': PropTypes.string,
60
- 'aria-labelledby': PropTypes.string,
61
- children: PropTypes.node,
62
- className: PropTypes.string,
63
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
64
- preserveAspectRatio: PropTypes.string,
65
- tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
66
- viewBox: PropTypes.string,
67
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
68
- xmlns: PropTypes.string
69
- };
70
-
71
- export { Icon as default };