@dxc-technology/halstack-react 10.0.0 → 10.1.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.
@@ -490,6 +490,14 @@ declare const HalstackContext: React.Context<DeepPartial<{
490
490
  level5LineHeight: string;
491
491
  level5LetterSpacing: string;
492
492
  };
493
+ image: {
494
+ captionFontColor: string;
495
+ captionFontFamily: string;
496
+ captionFontSize: string;
497
+ captionFontStyle: string;
498
+ captionFontWeight: string;
499
+ captionLineHeight: string;
500
+ };
493
501
  link: {
494
502
  fontColor: string;
495
503
  fontFamily: string;
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ <p align="center">
2
+ <a href="https://developer.dxc.com/halstack/">
3
+ <img src="website/screens/common/images/halstack_logo.svg" alt="Halstack Design System logo" />
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">Halstack Design System</h1>
8
+
9
+ Halstack is an Open Source Design System built and maintained by DXC Technology with the purpose of providing all the necessary tools for designing and implementing accessible, intuitive and consistent User Experiences with React.
10
+
11
+ ## How to start
12
+
13
+ You can start using Halstack right now:
14
+
15
+ ```bash
16
+ npm i @dxc-technology/halstack-react
17
+ ```
18
+
19
+ ### Usage
20
+
21
+ ```jsx
22
+ import React from "react";
23
+ import { DxcButton, DxcTextInput } from "@dxc-technology/halstack-react";
24
+
25
+ const App = () => (
26
+ <>
27
+ <DxcTextInput label="Enter your name" />
28
+ <DxcButton label="Submit" type="submit" />
29
+ </>
30
+ );
31
+ ```
32
+
33
+ ## Where to start
34
+
35
+ Learn everything you need to know about Halstack principles and components on the [official documentation site](https://developer.dxc.com/halstack/).
36
+
37
+ ## Contributing
38
+
39
+ Any feedback is always welcome in Halstack!
40
+
41
+ Before opening a new issue, pull request or discussion, please read carefully and respect our [contribution guidelines](https://github.com/dxc-technology/halstack-react/wiki/Contributing).
42
+
43
+ ## Thanks
44
+
45
+ <a href="https://www.chromatic.com/"><img src="https://user-images.githubusercontent.com/321738/84662277-e3db4f80-af1b-11ea-88f5-91d67a5e59f6.png" width="153" height="30" alt="Chromatic" /></a>
46
+
47
+ Thanks to [Chromatic](https://www.chromatic.com/) for providing the visual testing platform that helps us review UI changes and catch visual regressions.
@@ -488,6 +488,14 @@ export declare const componentTokens: {
488
488
  level5LineHeight: string;
489
489
  level5LetterSpacing: string;
490
490
  };
491
+ image: {
492
+ captionFontColor: string;
493
+ captionFontFamily: string;
494
+ captionFontSize: string;
495
+ captionFontStyle: string;
496
+ captionFontWeight: string;
497
+ captionLineHeight: string;
498
+ };
491
499
  link: {
492
500
  fontColor: string;
493
501
  fontFamily: string;
@@ -499,6 +499,14 @@ var componentTokens = {
499
499
  level5LineHeight: _coreTokens["default"].type_leading_normal,
500
500
  level5LetterSpacing: _coreTokens["default"].type_spacing_wide_01
501
501
  },
502
+ image: {
503
+ captionFontColor: _coreTokens["default"].color_grey_900,
504
+ captionFontFamily: _coreTokens["default"].type_sans,
505
+ captionFontSize: _coreTokens["default"].type_scale_02,
506
+ captionFontStyle: _coreTokens["default"].type_normal,
507
+ captionFontWeight: _coreTokens["default"].type_regular,
508
+ captionLineHeight: _coreTokens["default"].type_leading_normal
509
+ },
502
510
  link: {
503
511
  fontColor: _coreTokens["default"].color_blue_800,
504
512
  fontFamily: _coreTokens["default"].inherit,
@@ -29,16 +29,17 @@ const social = [
29
29
  title: "Linkedin",
30
30
  },
31
31
  {
32
- href: "https://twitter.com/dxctechnology",
32
+ href: "https://x.com/dxctechnology",
33
33
  logo: (
34
- <svg viewBox="0 0 248 204" fill="currentColor">
34
+ <svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
35
+ <rect width="256" height="256" rx="40" fill="white" />
35
36
  <path
36
- fill="#1d9bf0"
37
- d="M221.95 51.29c.15 2.17.15 4.34.15 6.53 0 66.73-50.8 143.69-143.69 143.69v-.04c-27.44.04-54.31-7.82-77.41-22.64 3.99.48 8 .72 12.02.73 22.74.02 44.83-7.61 62.72-21.66-21.61-.41-40.56-14.5-47.18-35.07 7.57 1.46 15.37 1.16 22.8-.87-23.56-4.76-40.51-25.46-40.51-49.5v-.64c7.02 3.91 14.88 6.08 22.92 6.32C11.58 63.31 4.74 33.79 18.14 10.71c25.64 31.55 63.47 50.73 104.08 52.76-4.07-17.54 1.49-35.92 14.61-48.25 20.34-19.12 52.33-18.14 71.45 2.19 11.31-2.23 22.15-6.38 32.07-12.26-3.77 11.69-11.66 21.62-22.2 27.93 10.01-1.18 19.79-3.86 29-7.95-6.78 10.16-15.32 19.01-25.2 26.16z"
37
+ d="M140.192 118.205L187.848 64H176.556L135.158 111.056L102.117 64H64L113.975 135.163L64 192H75.2914L118.982 142.296L153.883 192H192L140.192 118.205ZM124.722 135.787L119.65 128.697L79.3634 72.3294H96.7094L129.232 117.837L134.282 124.927L176.551 184.076H159.205L124.722 135.787Z"
38
+ fill="#0F1419"
38
39
  />
39
40
  </svg>
40
41
  ),
41
- title: "Twitter",
42
+ title: "X",
42
43
  },
43
44
  {
44
45
  href: "https://www.facebook.com/DXCTechnology/",
@@ -75,8 +76,8 @@ const bottom = [
75
76
  text: "Linkedin",
76
77
  },
77
78
  {
78
- href: "https://twitter.com/dxctechnology",
79
- text: "Twitter",
79
+ href: "https://x.com/dxctechnology",
80
+ text: "X",
80
81
  },
81
82
  {
82
83
  href: "https://www.facebook.com/DXCTechnology/",
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import ImagePropsType from "./types";
3
+ declare const DxcImage: ({ alt, caption, lazyLoading, src, srcSet, sizes, width, height, objectFit, objectPosition, onLoad, onError, }: ImagePropsType) => JSX.Element;
4
+ export default DxcImage;
package/image/Image.js ADDED
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports["default"] = void 0;
11
+
12
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
17
+
18
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
19
+
20
+ var _BaseTypography = _interopRequireDefault(require("../utils/BaseTypography"));
21
+
22
+ var _templateObject;
23
+
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ var CaptionWrapper = function CaptionWrapper(_ref) {
29
+ var condition = _ref.condition,
30
+ wrapper = _ref.wrapper,
31
+ children = _ref.children;
32
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
33
+ };
34
+
35
+ var DxcImage = function DxcImage(_ref2) {
36
+ var alt = _ref2.alt,
37
+ caption = _ref2.caption,
38
+ _ref2$lazyLoading = _ref2.lazyLoading,
39
+ lazyLoading = _ref2$lazyLoading === void 0 ? false : _ref2$lazyLoading,
40
+ src = _ref2.src,
41
+ srcSet = _ref2.srcSet,
42
+ sizes = _ref2.sizes,
43
+ width = _ref2.width,
44
+ height = _ref2.height,
45
+ objectFit = _ref2.objectFit,
46
+ objectPosition = _ref2.objectPosition,
47
+ onLoad = _ref2.onLoad,
48
+ onError = _ref2.onError;
49
+ var colorsTheme = (0, _useTheme["default"])();
50
+ return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
51
+ theme: colorsTheme.image
52
+ }, /*#__PURE__*/_react["default"].createElement(CaptionWrapper, {
53
+ condition: caption != undefined,
54
+ wrapper: function wrapper(children) {
55
+ return /*#__PURE__*/_react["default"].createElement(Figure, null, children, /*#__PURE__*/_react["default"].createElement(_BaseTypography["default"], {
56
+ as: "figcaption",
57
+ color: colorsTheme.image.captionFontColor,
58
+ fontFamily: colorsTheme.image.captionFontFamily,
59
+ fontSize: colorsTheme.image.captionFontSize,
60
+ fontStyle: colorsTheme.image.captionFontStyle,
61
+ fontWeight: colorsTheme.image.captionFontWeight,
62
+ lineHeight: colorsTheme.image.captionLineHeight
63
+ }, caption));
64
+ }
65
+ }, /*#__PURE__*/_react["default"].createElement("img", {
66
+ alt: alt,
67
+ loading: lazyLoading ? "lazy" : undefined,
68
+ onLoad: onLoad,
69
+ onError: onError,
70
+ src: src,
71
+ srcSet: srcSet,
72
+ sizes: sizes,
73
+ style: {
74
+ objectFit: objectFit,
75
+ objectPosition: objectPosition,
76
+ width: width,
77
+ height: height
78
+ }
79
+ })));
80
+ };
81
+
82
+ var Figure = _styledComponents["default"].figure(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n width: fit-content;\n margin: 0;\n padding: 0;\n"])));
83
+
84
+ var _default = DxcImage;
85
+ exports["default"] = _default;
@@ -0,0 +1,127 @@
1
+ import React from "react";
2
+ import DxcImage from "./Image";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+ import { DxcFlex, DxcInset, DxcParagraph } from "../main";
6
+
7
+ export default {
8
+ title: "Image",
9
+ component: DxcImage,
10
+ };
11
+
12
+ export const Chromatic = () => (
13
+ <>
14
+ <Title title="Image component" theme="light" level={2} />
15
+ <ExampleContainer>
16
+ <Title title="Simple image" theme="light" level={4} />
17
+ <DxcImage
18
+ alt="Example image"
19
+ width="100%"
20
+ src="https://images.ctfassets.net/hrltx12pl8hq/5596z2BCR9KmT1KeRBrOQa/4070fd4e2f1a13f71c2c46afeb18e41c/shutterstock_451077043-hero1.jpg"
21
+ />
22
+ </ExampleContainer>
23
+ <ExampleContainer>
24
+ <Title title="Image with text" theme="light" level={4} />
25
+ <DxcParagraph>
26
+ Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
27
+ arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
28
+ lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh tristique
29
+ porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue diam in dui
30
+ morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo nisi. Vel mus
31
+ ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit augue. In fermentum
32
+ metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae. Commodo sagittis
33
+ volutpat id lorem.
34
+ </DxcParagraph>
35
+ <DxcInset top="2rem" bottom="2rem">
36
+ <DxcImage
37
+ alt="Ratatouille is a great movie"
38
+ caption="Ratatouille with a smile on his face."
39
+ src="https://hips.hearstapps.com/es.h-cdn.co/fotoes/images/cinefilia/por-que-ratatouille-nos-sigue-enamorando-10-anos-despues/136444706-1-esl-ES/Por-que-Ratatouille-nos-sigue-enamorando-10-anos-despues.jpg"
40
+ />
41
+ </DxcInset>
42
+ <DxcParagraph>
43
+ Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
44
+ arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
45
+ lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh tristique
46
+ porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue diam in dui
47
+ morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo nisi. Vel mus
48
+ ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit augue. In fermentum
49
+ metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae. Commodo sagittis
50
+ volutpat id lorem.
51
+ </DxcParagraph>
52
+ </ExampleContainer>
53
+ <ExampleContainer>
54
+ <Title title="Example image" theme="light" level={4} />
55
+ <DxcFlex gap="1rem">
56
+ <DxcImage
57
+ alt="Camera pic"
58
+ caption="Picture of a camera and the sunset."
59
+ width="500px"
60
+ src="https://assets.entrepreneur.com/content/3x2/2000/20191009140007-GettyImages-1053962188.jpeg"
61
+ />
62
+ <DxcParagraph>
63
+ Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
64
+ arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
65
+ lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
66
+ tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
67
+ diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
68
+ nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
69
+ augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
70
+ Commodo sagittis volutpat id lorem. Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis
71
+ volutpat urna. Hendrerit aliquet et arcu purus. Sodales elementum sollicitudin consequat elementum tortor.
72
+ Lectus eget cursus ut ac pharetra lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus
73
+ vitae vitae aenean arcu. Nibh tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh
74
+ est sed. Netus venenatis congue diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu
75
+ nec fringilla enim purus ut justo nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper
76
+ nullam sit sagittis hendrerit augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed
77
+ enim in sed vel nec ut vitae. Commodo sagittis volutpat id lorem.
78
+ </DxcParagraph>
79
+ </DxcFlex>
80
+ </ExampleContainer>
81
+ <ExampleContainer>
82
+ <Title title="Object position" theme="light" level={4} />
83
+ <DxcImage
84
+ alt="Moon pic"
85
+ caption="Picture of the moon."
86
+ width="250px"
87
+ src="https://interactive-examples.mdn.mozilla.net/media/examples/moon.jpg"
88
+ objectPosition="right top"
89
+ objectFit="none"
90
+ />
91
+ </ExampleContainer>
92
+ <ExampleContainer>
93
+ <Title title="Object fit: contain" theme="light" level={4} />
94
+ <div style={{ display: "flex", width: "fit-content", border: "1px solid #000", padding: "0.5rem" }}>
95
+ <DxcImage
96
+ alt="Dog pic"
97
+ src="https://cc-prod.scene7.com/is/image/CCProdAuthor/What-is-Stock-Photography_P1_mobile?$pjpeg$&jpegSize=200&wid=720"
98
+ width="200px"
99
+ height="200px"
100
+ objectFit="contain"
101
+ caption="Pretty dog."
102
+ />
103
+ </div>
104
+ </ExampleContainer>
105
+ <ExampleContainer>
106
+ <Title title="Object fit: cover" theme="light" level={4} />
107
+ <div style={{ width: "75%", height: "300px" }}>
108
+ <DxcImage
109
+ alt="Spaceship pic"
110
+ src="https://media.istockphoto.com/id/1344443930/es/foto/lanzamiento-de-cohetes-del-transbordador-espacial-en-el-cielo-y-nubes-al-espacio-exterior.jpg?s=612x612&w=0&k=20&c=CO2A96GnnWvJsgZuj9WfYCVIBVzicnQDfnzwD1nomN0="
111
+ objectFit="cover"
112
+ width="50%"
113
+ height="100%"
114
+ objectPosition="0px 0px"
115
+ />
116
+ <DxcImage
117
+ alt="Spaceship pic"
118
+ src="https://media.istockphoto.com/id/1344443930/es/foto/lanzamiento-de-cohetes-del-transbordador-espacial-en-el-cielo-y-nubes-al-espacio-exterior.jpg?s=612x612&w=0&k=20&c=CO2A96GnnWvJsgZuj9WfYCVIBVzicnQDfnzwD1nomN0="
119
+ objectFit="cover"
120
+ width="50%"
121
+ height="100%"
122
+ objectPosition="0px 0px"
123
+ />
124
+ </div>
125
+ </ExampleContainer>
126
+ </>
127
+ );
@@ -0,0 +1,72 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ /**
4
+ * Alternative text description displayed when the specified image is not loaded.
5
+ *
6
+ * See MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt
7
+ * See W3C alt decision tree: https://www.w3.org/WAI/tutorials/images/decision-tree/
8
+ */
9
+ alt: string;
10
+ /**
11
+ * Image legend with a descriptive purpose. It is placed below the image and is complementary to the alt attribute,
12
+ * which is required regardless of the presence of the caption or not.
13
+ */
14
+ caption?: string;
15
+ /**
16
+ * If true, the image will be loaded only when it is visible on the screen (lazy loading).
17
+ * Otherwise and by default, the image will be loaded as soon as the component is mounted (eager loading).
18
+ */
19
+ lazyLoading?: boolean;
20
+ /**
21
+ * URL of the image. This prop is required and must be valid.
22
+ */
23
+ src: string;
24
+ /**
25
+ * List of one or more strings separated by commas indicating a set of possible images for the user agent to use.
26
+ *
27
+ * See MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset
28
+ */
29
+ srcSet?: string;
30
+ /**
31
+ * One or more strings separated by commas, indicating a set of source sizes.
32
+ * If the srcSet attribute is absent or contains no values with a width descriptor,
33
+ * then this attribute has no effect.
34
+ *
35
+ * See MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes
36
+ */
37
+ sizes?: string;
38
+ /**
39
+ * Sets the rendered width of the image.
40
+ */
41
+ width?: string;
42
+ /**
43
+ * Sets the rendered height of the image.
44
+ */
45
+ height?: string;
46
+ /**
47
+ * Sets the object-fit CSS property.
48
+ *
49
+ * See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
50
+ */
51
+ objectFit?: "contain" | "cover" | "fill" | "none" | "scale-down";
52
+ /**
53
+ * Sets the object-position CSS property.
54
+ *
55
+ * See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/object-position
56
+ */
57
+ objectPosition?: string;
58
+ /**
59
+ * This function will be called when the image is loaded.
60
+ */
61
+ onLoad?: React.ReactEventHandler<HTMLImageElement>;
62
+ /**
63
+ * This function will be called when the image fails to load.
64
+ */
65
+ onError?: React.ReactEventHandler<HTMLImageElement>;
66
+ };
67
+ export declare type CaptionWrapperProps = {
68
+ condition: boolean;
69
+ wrapper: (children: React.ReactNode) => JSX.Element;
70
+ children: React.ReactNode;
71
+ };
72
+ export default Props;
@@ -25,7 +25,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
25
25
 
26
26
  var _variables = require("../common/variables");
27
27
 
28
- var _Icons = require("./Icons");
28
+ var _Icons = _interopRequireDefault(require("./Icons"));
29
29
 
30
30
  var _SidenavContext = require("./SidenavContext");
31
31
 
@@ -57,23 +57,23 @@ var defaultFooter = function defaultFooter() {
57
57
  href: "https://www.linkedin.com/company/dxctechnology",
58
58
  text: "Linkedin"
59
59
  }, {
60
- href: "https://twitter.com/dxctechnology",
61
- text: "Twitter"
60
+ href: "https://x.com/dxctechnology",
61
+ text: "X"
62
62
  }, {
63
63
  href: "https://www.facebook.com/DXCTechnology/",
64
64
  text: "Facebook"
65
65
  }],
66
66
  socialLinks: [{
67
67
  href: "https://www.linkedin.com/company/dxctechnology",
68
- logo: _Icons.linkedinLogo,
68
+ logo: _Icons["default"].linkedinLogo,
69
69
  title: "Linkedin"
70
70
  }, {
71
- href: "https://twitter.com/dxctechnology",
72
- logo: _Icons.twitterLogo,
73
- title: "Twitter"
71
+ href: "https://x.com/dxctechnology",
72
+ logo: _Icons["default"].xLogo,
73
+ title: "X"
74
74
  }, {
75
75
  href: "https://www.facebook.com/DXCTechnology/",
76
- logo: _Icons.facebookLogo,
76
+ logo: _Icons["default"].facebookLogo,
77
77
  title: "Facebook"
78
78
  }]
79
79
  });
@@ -122,7 +122,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
122
122
  });
123
123
  };
124
124
 
125
- (0, _react.useLayoutEffect)(function () {
125
+ (0, _react.useEffect)(function () {
126
126
  handleResize();
127
127
  window.addEventListener("resize", handleResize);
128
128
  return function () {
@@ -140,7 +140,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
140
140
  onClick: handleSidenavVisibility,
141
141
  "aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
142
142
  title: translatedLabels.applicationLayout.visibilityToggleTitle
143
- }, _Icons.hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
143
+ }, _Icons["default"].hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
144
144
  value: setIsSidenavVisibleResponsive
145
145
  }, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main), footerContent)));
146
146
  };
@@ -155,7 +155,7 @@ var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_tem
155
155
 
156
156
  var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 4px 16px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
157
157
 
158
- var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 12px 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: #000;\n cursor: pointer;\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
158
+ var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 12px 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: #000;\n cursor: pointer;\n\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
159
159
 
160
160
  var BodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
161
161
 
@@ -4,7 +4,7 @@ import Title from "../../.storybook/components/Title";
4
4
  import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
5
5
 
6
6
  export default {
7
- title: "Application Layout ",
7
+ title: "Application Layout",
8
8
  component: DxcApplicationLayout,
9
9
  parameters: {
10
10
  viewport: {
package/layout/Icons.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const facebookLogo: JSX.Element;
3
- export declare const twitterLogo: JSX.Element;
4
- export declare const linkedinLogo: JSX.Element;
5
- export declare const hamburgerIcon: JSX.Element;
2
+ declare const layoutIcons: {
3
+ facebookLogo: JSX.Element;
4
+ xLogo: JSX.Element;
5
+ linkedinLogo: JSX.Element;
6
+ hamburgerIcon: JSX.Element;
7
+ };
8
+ export default layoutIcons;
package/layout/Icons.js CHANGED
@@ -5,62 +5,58 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.twitterLogo = exports.linkedinLogo = exports.hamburgerIcon = exports.facebookLogo = void 0;
8
+ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var facebookLogo = /*#__PURE__*/_react["default"].createElement("svg", {
13
- version: "1.1",
14
- id: "Capa_1",
15
- x: "0px",
16
- y: "0px",
17
- width: "438.536px",
18
- height: "438.536px",
19
- viewBox: "0 0 438.536 438.536",
20
- fill: "#FFFFFF"
21
- }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
22
- d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402 c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401 c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
23
- })));
24
-
25
- exports.facebookLogo = facebookLogo;
26
-
27
- var twitterLogo = /*#__PURE__*/_react["default"].createElement("svg", {
28
- version: "1.1",
29
- id: "Capa_1",
30
- x: "0px",
31
- y: "0px",
32
- width: "438.536px",
33
- height: "438.536px",
34
- viewBox: "0 0 438.536 438.536",
35
- fill: "#FFFFFF"
36
- }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
37
- d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M335.471,168.735c0.191,1.713,0.288,4.278,0.288,7.71 c0,15.989-2.334,32.025-6.995,48.104c-4.661,16.087-11.8,31.504-21.416,46.254c-9.606,14.749-21.074,27.791-34.396,39.115 c-13.325,11.32-29.311,20.365-47.968,27.117c-18.648,6.762-38.637,10.143-59.953,10.143c-33.116,0-63.76-8.952-91.931-26.836 c4.568,0.568,9.329,0.855,14.275,0.855c27.6,0,52.439-8.565,74.519-25.7c-12.941-0.185-24.506-4.179-34.688-11.991 c-10.185-7.803-17.273-17.699-21.271-29.691c4.947,0.76,8.658,1.137,11.132,1.137c4.187,0,9.042-0.76,14.56-2.279 c-13.894-2.669-25.598-9.562-35.115-20.697c-9.519-11.136-14.277-23.84-14.277-38.114v-0.571 c10.085,4.755,19.602,7.229,28.549,7.422c-17.321-11.613-25.981-28.265-25.981-49.963c0-10.66,2.758-20.747,8.278-30.264 c15.035,18.464,33.311,33.213,54.816,44.252c21.507,11.038,44.54,17.227,69.092,18.558c-0.95-3.616-1.427-8.186-1.427-13.704 c0-16.562,5.853-30.692,17.56-42.399c11.703-11.706,25.837-17.561,42.394-17.561c17.515,0,32.079,6.283,43.688,18.846 c13.134-2.474,25.892-7.33,38.26-14.56c-4.757,14.652-13.613,25.788-26.55,33.402c12.368-1.716,23.88-4.95,34.537-9.708 C357.458,149.793,347.462,160.166,335.471,168.735z"
38
- })));
39
-
40
- exports.twitterLogo = twitterLogo;
41
-
42
- var linkedinLogo = /*#__PURE__*/_react["default"].createElement("svg", {
43
- version: "1.1",
44
- id: "Capa_1",
45
- x: "0px",
46
- y: "0px",
47
- width: "438.536px",
48
- height: "438.536px",
49
- viewBox: "0 0 438.536 438.536",
50
- fill: "#FFFFFF"
51
- }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
52
- d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332 c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41 c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708 c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92 c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991 c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974 c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64 H370.873z"
53
- })));
54
-
55
- exports.linkedinLogo = linkedinLogo;
56
-
57
- var hamburgerIcon = /*#__PURE__*/_react["default"].createElement("svg", {
58
- xmlns: "http://www.w3.org/2000/svg",
59
- height: "24",
60
- width: "24",
61
- viewBox: "0 0 24 24"
62
- }, /*#__PURE__*/_react["default"].createElement("path", {
63
- d: "M3 18V16H21V18ZM3 13V11H21V13ZM3 8V6H21V8Z"
64
- }));
65
-
66
- exports.hamburgerIcon = hamburgerIcon;
12
+ var layoutIcons = {
13
+ facebookLogo: /*#__PURE__*/_react["default"].createElement("svg", {
14
+ version: "1.1",
15
+ id: "Capa_1",
16
+ x: "0px",
17
+ y: "0px",
18
+ width: "438.536px",
19
+ height: "438.536px",
20
+ viewBox: "0 0 438.536 438.536",
21
+ fill: "#FFFFFF"
22
+ }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
23
+ d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402 c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401 c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
24
+ }))),
25
+ xLogo: /*#__PURE__*/_react["default"].createElement("svg", {
26
+ width: "256",
27
+ height: "256",
28
+ viewBox: "0 0 256 256",
29
+ fill: "none",
30
+ xmlns: "http://www.w3.org/2000/svg"
31
+ }, /*#__PURE__*/_react["default"].createElement("rect", {
32
+ width: "256",
33
+ height: "256",
34
+ rx: "40",
35
+ fill: "white"
36
+ }), /*#__PURE__*/_react["default"].createElement("path", {
37
+ d: "M140.192 118.205L187.848 64H176.556L135.158 111.056L102.117 64H64L113.975 135.163L64 192H75.2914L118.982 142.296L153.883 192H192L140.192 118.205ZM124.722 135.787L119.65 128.697L79.3634 72.3294H96.7094L129.232 117.837L134.282 124.927L176.551 184.076H159.205L124.722 135.787Z",
38
+ fill: "#0F1419"
39
+ })),
40
+ linkedinLogo: /*#__PURE__*/_react["default"].createElement("svg", {
41
+ version: "1.1",
42
+ id: "Capa_1",
43
+ x: "0px",
44
+ y: "0px",
45
+ width: "438.536px",
46
+ height: "438.536px",
47
+ viewBox: "0 0 438.536 438.536",
48
+ fill: "#FFFFFF"
49
+ }, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
50
+ d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332 c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41 c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708 c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92 c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991 c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974 c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64 H370.873z"
51
+ }))),
52
+ hamburgerIcon: /*#__PURE__*/_react["default"].createElement("svg", {
53
+ xmlns: "http://www.w3.org/2000/svg",
54
+ height: "24",
55
+ width: "24",
56
+ viewBox: "0 0 24 24"
57
+ }, /*#__PURE__*/_react["default"].createElement("path", {
58
+ d: "M3 18V16H21V18ZM3 13V11H21V13ZM3 8V6H21V8Z"
59
+ }))
60
+ };
61
+ var _default = layoutIcons;
62
+ exports["default"] = _default;