@dxc-technology/halstack-react 0.0.0-b41d935 → 0.0.0-b4aec06
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/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +5 -22
- package/HalstackContext.d.ts +1243 -6
- package/HalstackContext.js +126 -111
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +42 -118
- package/accordion/Accordion.stories.tsx +85 -139
- package/accordion/Accordion.test.js +19 -34
- package/accordion/types.d.ts +6 -18
- package/accordion-group/AccordionGroup.d.ts +2 -2
- package/accordion-group/AccordionGroup.js +29 -77
- package/accordion-group/AccordionGroup.stories.tsx +78 -77
- package/accordion-group/AccordionGroup.test.js +44 -72
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +7 -19
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/alert/Alert.js +31 -124
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +29 -46
- package/alert/types.d.ts +5 -5
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -43
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/bleed/Bleed.js +13 -21
- package/bleed/Bleed.stories.tsx +1 -0
- package/bleed/types.d.ts +2 -2
- package/box/Box.d.ts +1 -1
- package/box/Box.js +18 -59
- package/box/Box.stories.tsx +38 -51
- package/box/Box.test.js +2 -7
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +19 -53
- package/bulleted-list/BulletedList.stories.tsx +8 -93
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +71 -106
- package/button/Button.stories.tsx +144 -101
- package/button/Button.test.js +20 -17
- package/button/types.d.ts +9 -5
- package/card/Card.d.ts +1 -1
- package/card/Card.js +48 -89
- package/card/Card.stories.tsx +12 -42
- package/card/Card.test.js +11 -22
- package/card/types.d.ts +6 -12
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +90 -124
- package/checkbox/Checkbox.stories.tsx +68 -54
- package/checkbox/Checkbox.test.js +108 -64
- package/checkbox/types.d.ts +11 -3
- package/chip/Chip.js +39 -79
- package/chip/Chip.stories.tsx +121 -26
- package/chip/Chip.test.js +16 -31
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +6 -12
- package/common/variables.d.ts +1395 -0
- package/common/variables.js +914 -1156
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/contextual-menu/ContextualMenu.d.ts +7 -0
- package/contextual-menu/ContextualMenu.js +71 -0
- package/contextual-menu/ContextualMenu.stories.tsx +182 -0
- package/contextual-menu/ContextualMenu.test.js +71 -0
- package/contextual-menu/MenuItemAction.d.ts +4 -0
- package/contextual-menu/MenuItemAction.js +46 -0
- package/contextual-menu/types.d.ts +22 -0
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +214 -0
- package/date-input/DateInput.js +150 -299
- package/date-input/DateInput.stories.tsx +203 -56
- package/date-input/DateInput.test.js +700 -371
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +115 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +58 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +100 -0
- package/date-input/types.d.ts +72 -15
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +61 -119
- package/dialog/Dialog.stories.tsx +310 -212
- package/dialog/Dialog.test.js +269 -32
- package/dialog/types.d.ts +18 -26
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.js +84 -153
- package/dropdown/Dropdown.stories.tsx +209 -94
- package/dropdown/Dropdown.test.js +409 -400
- package/dropdown/DropdownMenu.js +20 -37
- package/dropdown/DropdownMenuItem.js +15 -37
- package/dropdown/types.d.ts +20 -24
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +193 -262
- package/file-input/FileInput.stories.tsx +86 -3
- package/file-input/FileInput.test.js +356 -395
- package/file-input/FileItem.js +15 -41
- package/file-input/types.d.ts +13 -9
- package/flex/Flex.js +27 -39
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +74 -9
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +70 -117
- package/footer/Footer.stories.tsx +55 -21
- package/footer/Footer.test.js +33 -57
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +66 -7
- package/footer/types.d.ts +25 -27
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +4 -3
- package/header/Header.js +48 -133
- package/header/Header.stories.tsx +115 -36
- package/header/Header.test.js +13 -26
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +2 -7
- package/header/types.d.ts +7 -22
- package/heading/Heading.js +10 -32
- package/heading/Heading.test.js +71 -88
- package/heading/types.d.ts +7 -7
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +129 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.js +13 -21
- package/inset/Inset.stories.tsx +2 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- package/layout/ApplicationLayout.js +30 -67
- package/layout/ApplicationLayout.stories.tsx +1 -1
- package/layout/Icons.d.ts +8 -5
- package/layout/Icons.js +51 -59
- package/layout/types.d.ts +5 -6
- package/link/Link.js +25 -46
- package/link/Link.stories.tsx +60 -0
- package/link/Link.test.js +24 -44
- package/link/types.d.ts +14 -14
- package/main.d.ts +10 -5
- package/main.js +47 -59
- package/nav-tabs/NavTabs.d.ts +7 -0
- package/{tabs-nav → nav-tabs}/NavTabs.js +25 -57
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +115 -9
- package/{tabs-nav → nav-tabs}/NavTabs.test.js +39 -45
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +118 -0
- package/{tabs-nav → nav-tabs}/types.d.ts +14 -15
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.js +46 -36
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +860 -414
- package/number-input/NumberInputContext.d.ts +3 -4
- package/number-input/NumberInputContext.js +3 -14
- package/number-input/types.d.ts +17 -5
- package/package.json +37 -40
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +21 -47
- package/paginator/Paginator.js +22 -58
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +252 -225
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +6 -22
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.js +57 -126
- package/password-input/PasswordInput.stories.tsx +1 -33
- package/password-input/PasswordInput.test.js +158 -141
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +23 -55
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +36 -3
- package/progress-bar/ProgressBar.test.js +36 -53
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.js +4 -27
- package/quick-nav/QuickNav.stories.tsx +15 -1
- package/quick-nav/types.d.ts +10 -10
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +31 -63
- package/radio-group/RadioGroup.js +45 -93
- package/radio-group/RadioGroup.stories.tsx +131 -18
- package/radio-group/RadioGroup.test.js +505 -471
- package/radio-group/types.d.ts +8 -8
- package/resultset-table/Icons.d.ts +7 -0
- package/resultset-table/Icons.js +47 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/resultset-table/ResultsetTable.js +170 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +156 -30
- package/resultset-table/ResultsetTable.test.js +381 -0
- package/{resultsetTable → resultset-table}/types.d.ts +44 -11
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +7 -7
- package/select/Icons.js +1 -5
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +17 -72
- package/select/Option.js +27 -50
- package/select/Select.js +120 -175
- package/select/Select.stories.tsx +497 -153
- package/select/Select.test.js +1974 -1837
- package/select/types.d.ts +16 -17
- package/sidenav/Icons.d.ts +7 -0
- package/{text-input → sidenav}/Icons.js +10 -23
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +83 -154
- package/sidenav/Sidenav.stories.tsx +165 -63
- package/sidenav/Sidenav.test.js +3 -10
- package/{layout → sidenav}/SidenavContext.d.ts +1 -1
- package/{layout → sidenav}/SidenavContext.js +3 -9
- package/sidenav/types.d.ts +31 -28
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +77 -134
- package/slider/Slider.test.js +108 -104
- package/slider/types.d.ts +7 -3
- package/spinner/Spinner.js +31 -75
- package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +53 -27
- package/spinner/Spinner.test.js +26 -35
- package/spinner/types.d.ts +3 -3
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +56 -103
- package/switch/Switch.stories.tsx +33 -34
- package/switch/Switch.test.js +52 -97
- package/switch/types.d.ts +8 -3
- package/table/DropdownTheme.js +62 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +78 -35
- package/table/Table.stories.tsx +651 -0
- package/table/Table.test.js +95 -8
- package/table/types.d.ts +34 -6
- package/tabs/Tab.js +26 -45
- package/tabs/Tabs.js +62 -145
- package/tabs/Tabs.stories.tsx +46 -6
- package/tabs/Tabs.test.js +66 -123
- package/tabs/types.d.ts +19 -19
- package/tag/Tag.js +28 -60
- package/tag/Tag.stories.tsx +14 -1
- package/tag/Tag.test.js +20 -31
- package/tag/types.d.ts +7 -7
- package/text-input/Suggestion.js +35 -25
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +19 -67
- package/text-input/TextInput.js +223 -333
- package/text-input/TextInput.stories.tsx +139 -155
- package/text-input/TextInput.test.js +1389 -1404
- package/text-input/types.d.ts +25 -17
- package/textarea/Textarea.js +70 -113
- package/textarea/Textarea.stories.tsx +174 -0
- package/textarea/Textarea.test.js +152 -183
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +92 -106
- package/toggle-group/ToggleGroup.stories.tsx +49 -4
- package/toggle-group/ToggleGroup.test.js +69 -88
- package/toggle-group/types.d.ts +26 -17
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +15 -123
- package/typography/Typography.stories.tsx +1 -1
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +1147 -1
- package/useTheme.js +2 -9
- package/useTranslatedLabels.d.ts +84 -1
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +94 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +124 -0
- package/wizard/Wizard.js +16 -51
- package/wizard/Wizard.stories.tsx +20 -0
- package/wizard/Wizard.test.js +54 -81
- package/wizard/types.d.ts +9 -10
- package/card/ice-cream.jpg +0 -0
- package/common/OpenSans.css +0 -81
- package/common/RequiredComponent.js +0 -32
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/number-input/numberInputContextTypes.d.ts +0 -19
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/resultsetTable/ResultsetTable.js +0 -252
- package/resultsetTable/ResultsetTable.test.js +0 -348
- package/slider/Slider.stories.tsx +0 -183
- package/table/Table.stories.jsx +0 -277
- package/tabs-nav/NavTabs.d.ts +0 -8
- package/tabs-nav/Tab.js +0 -130
- package/text-input/Icons.d.ts +0 -8
- package/textarea/Textarea.stories.jsx +0 -157
- /package/{resultsetTable → action-icon}/types.js +0 -0
- /package/{tabs-nav → container}/types.js +0 -0
- /package/{number-input/numberInputContextTypes.js → contextual-menu/types.js} +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
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 from "../flex/Flex";
|
|
6
|
+
import DxcInset from "../inset/Inset";
|
|
7
|
+
import DxcParagraph from "../paragraph/Paragraph";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Image",
|
|
11
|
+
component: DxcImage,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const Chromatic = () => (
|
|
15
|
+
<>
|
|
16
|
+
<Title title="Image component" theme="light" level={2} />
|
|
17
|
+
<ExampleContainer>
|
|
18
|
+
<Title title="Simple image" theme="light" level={4} />
|
|
19
|
+
<DxcImage
|
|
20
|
+
alt="Example image"
|
|
21
|
+
width="100%"
|
|
22
|
+
src="https://images.ctfassets.net/hrltx12pl8hq/5596z2BCR9KmT1KeRBrOQa/4070fd4e2f1a13f71c2c46afeb18e41c/shutterstock_451077043-hero1.jpg"
|
|
23
|
+
/>
|
|
24
|
+
</ExampleContainer>
|
|
25
|
+
<ExampleContainer>
|
|
26
|
+
<Title title="Image with text" theme="light" level={4} />
|
|
27
|
+
<DxcParagraph>
|
|
28
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
29
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
30
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh tristique
|
|
31
|
+
porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue diam in dui
|
|
32
|
+
morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo nisi. Vel mus
|
|
33
|
+
ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit augue. In fermentum
|
|
34
|
+
metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae. Commodo sagittis
|
|
35
|
+
volutpat id lorem.
|
|
36
|
+
</DxcParagraph>
|
|
37
|
+
<DxcInset top="2rem" bottom="2rem">
|
|
38
|
+
<DxcImage
|
|
39
|
+
alt="Ratatouille is a great movie"
|
|
40
|
+
caption="Ratatouille with a smile on his face."
|
|
41
|
+
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"
|
|
42
|
+
/>
|
|
43
|
+
</DxcInset>
|
|
44
|
+
<DxcParagraph>
|
|
45
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
46
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
47
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh tristique
|
|
48
|
+
porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue diam in dui
|
|
49
|
+
morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo nisi. Vel mus
|
|
50
|
+
ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit augue. In fermentum
|
|
51
|
+
metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae. Commodo sagittis
|
|
52
|
+
volutpat id lorem.
|
|
53
|
+
</DxcParagraph>
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<ExampleContainer>
|
|
56
|
+
<Title title="Example image" theme="light" level={4} />
|
|
57
|
+
<DxcFlex gap="1rem">
|
|
58
|
+
<DxcImage
|
|
59
|
+
alt="Camera pic"
|
|
60
|
+
caption="Picture of a camera and the sunset."
|
|
61
|
+
width="500px"
|
|
62
|
+
src="https://assets.entrepreneur.com/content/3x2/2000/20191009140007-GettyImages-1053962188.jpeg"
|
|
63
|
+
/>
|
|
64
|
+
<DxcParagraph>
|
|
65
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
66
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
67
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
68
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
69
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
70
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
71
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
72
|
+
Commodo sagittis volutpat id lorem. Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis
|
|
73
|
+
volutpat urna. Hendrerit aliquet et arcu purus. Sodales elementum sollicitudin consequat elementum tortor.
|
|
74
|
+
Lectus eget cursus ut ac pharetra lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus
|
|
75
|
+
vitae vitae aenean arcu. Nibh tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh
|
|
76
|
+
est sed. Netus venenatis congue diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu
|
|
77
|
+
nec fringilla enim purus ut justo nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper
|
|
78
|
+
nullam sit sagittis hendrerit augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed
|
|
79
|
+
enim in sed vel nec ut vitae. Commodo sagittis volutpat id lorem.
|
|
80
|
+
</DxcParagraph>
|
|
81
|
+
</DxcFlex>
|
|
82
|
+
</ExampleContainer>
|
|
83
|
+
<ExampleContainer>
|
|
84
|
+
<Title title="Object position" theme="light" level={4} />
|
|
85
|
+
<DxcImage
|
|
86
|
+
alt="Moon pic"
|
|
87
|
+
caption="Picture of the moon."
|
|
88
|
+
width="250px"
|
|
89
|
+
src="https://interactive-examples.mdn.mozilla.net/media/examples/moon.jpg"
|
|
90
|
+
objectPosition="right top"
|
|
91
|
+
objectFit="none"
|
|
92
|
+
/>
|
|
93
|
+
</ExampleContainer>
|
|
94
|
+
<ExampleContainer>
|
|
95
|
+
<Title title="Object fit: contain" theme="light" level={4} />
|
|
96
|
+
<div style={{ display: "flex", width: "fit-content", border: "1px solid #000", padding: "0.5rem" }}>
|
|
97
|
+
<DxcImage
|
|
98
|
+
alt="Dog pic"
|
|
99
|
+
src="https://cc-prod.scene7.com/is/image/CCProdAuthor/What-is-Stock-Photography_P1_mobile?$pjpeg$&jpegSize=200&wid=720"
|
|
100
|
+
width="200px"
|
|
101
|
+
height="200px"
|
|
102
|
+
objectFit="contain"
|
|
103
|
+
caption="Pretty dog."
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<ExampleContainer>
|
|
108
|
+
<Title title="Object fit: cover" theme="light" level={4} />
|
|
109
|
+
<div style={{ width: "75%", height: "300px" }}>
|
|
110
|
+
<DxcImage
|
|
111
|
+
alt="Spaceship pic"
|
|
112
|
+
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="
|
|
113
|
+
objectFit="cover"
|
|
114
|
+
width="50%"
|
|
115
|
+
height="100%"
|
|
116
|
+
objectPosition="0px 0px"
|
|
117
|
+
/>
|
|
118
|
+
<DxcImage
|
|
119
|
+
alt="Spaceship pic"
|
|
120
|
+
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="
|
|
121
|
+
objectFit="cover"
|
|
122
|
+
width="50%"
|
|
123
|
+
height="100%"
|
|
124
|
+
objectPosition="0px 0px"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
</ExampleContainer>
|
|
128
|
+
</>
|
|
129
|
+
);
|
package/image/types.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
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 type CaptionWrapperProps = {
|
|
68
|
+
condition: boolean;
|
|
69
|
+
wrapper: (children: React.ReactNode) => JSX.Element;
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
};
|
|
72
|
+
export default Props;
|
package/image/types.js
ADDED
package/inset/Inset.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = Inset;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _templateObject;
|
|
17
|
-
|
|
18
12
|
function Inset(_ref) {
|
|
19
13
|
var space = _ref.space,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
horizontal = _ref.horizontal,
|
|
15
|
+
vertical = _ref.vertical,
|
|
16
|
+
top = _ref.top,
|
|
17
|
+
right = _ref.right,
|
|
18
|
+
bottom = _ref.bottom,
|
|
19
|
+
left = _ref.left,
|
|
20
|
+
children = _ref.children;
|
|
27
21
|
return /*#__PURE__*/_react["default"].createElement(StyledInset, {
|
|
28
22
|
space: space,
|
|
29
23
|
horizontal: horizontal,
|
|
@@ -34,18 +28,16 @@ function Inset(_ref) {
|
|
|
34
28
|
left: left
|
|
35
29
|
}, children);
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
function getSpacingValue(spacingName) {
|
|
39
32
|
return spacingName ? spacingName : "0rem";
|
|
40
33
|
}
|
|
41
|
-
|
|
42
34
|
var StyledInset = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
|
|
43
35
|
var space = _ref2.space,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
horizontal = _ref2.horizontal,
|
|
37
|
+
vertical = _ref2.vertical,
|
|
38
|
+
top = _ref2.top,
|
|
39
|
+
right = _ref2.right,
|
|
40
|
+
bottom = _ref2.bottom,
|
|
41
|
+
left = _ref2.left;
|
|
50
42
|
return "\n padding: ".concat(getSpacingValue(top || vertical || space), " ").concat(getSpacingValue(right || horizontal || space), "\n ").concat(getSpacingValue(bottom || vertical || space), " ").concat(getSpacingValue(left || horizontal || space), ";\n");
|
|
51
43
|
});
|
package/inset/Inset.stories.tsx
CHANGED
|
@@ -205,7 +205,7 @@ export const Chromatic = () => (
|
|
|
205
205
|
</Container>
|
|
206
206
|
<Title title="Inside a flex column" level={4} />
|
|
207
207
|
<Container>
|
|
208
|
-
<DxcFlex direction="column" gap="
|
|
208
|
+
<DxcFlex direction="column" gap="1rem">
|
|
209
209
|
<Placeholder></Placeholder>
|
|
210
210
|
<DxcInset top="0.25rem" right="1.5rem" bottom="2rem" left="4rem">
|
|
211
211
|
<Placeholder></Placeholder>
|
|
@@ -225,5 +225,6 @@ const Placeholder = styled.div`
|
|
|
225
225
|
min-height: 40px;
|
|
226
226
|
min-width: 120px;
|
|
227
227
|
border: 1px solid #a46ede;
|
|
228
|
+
border-radius: 0.5rem;
|
|
228
229
|
background-color: #e5d5f6;
|
|
229
230
|
`;
|
package/inset/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Spacing = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
3
|
+
type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Applies the spacing scale to all sides.
|
|
6
6
|
*/
|
|
@@ -3,15 +3,15 @@ import AppLayoutPropsType, { AppLayoutMainPropsType } from "./types";
|
|
|
3
3
|
declare const DxcApplicationLayout: {
|
|
4
4
|
({ visibilityToggleLabel, header, sidenav, footer, children, }: AppLayoutPropsType): JSX.Element;
|
|
5
5
|
Header: {
|
|
6
|
-
({ underlined, content, responsiveContent, onClick, margin,
|
|
7
|
-
Dropdown: (props:
|
|
6
|
+
({ underlined, content, responsiveContent, onClick, margin, tabIndex, }: import("../header/types").default): JSX.Element;
|
|
7
|
+
Dropdown: (props: import("../dropdown/types").default) => React.JSX.Element;
|
|
8
8
|
};
|
|
9
9
|
Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
|
|
10
|
-
Footer: ({ socialLinks, bottomLinks, copyright, children,
|
|
10
|
+
Footer: ({ socialLinks, bottomLinks, copyright, children, margin, tabIndex, mode, }: import("../footer/types").default) => JSX.Element;
|
|
11
11
|
SideNav: {
|
|
12
|
-
({
|
|
12
|
+
({ title, children }: import("../sidenav/types").default): JSX.Element;
|
|
13
13
|
Section: ({ children }: import("../sidenav/types").SidenavSectionPropsType) => JSX.Element;
|
|
14
|
-
Group: ({
|
|
14
|
+
Group: ({ title, collapsable, icon, children }: import("../sidenav/types").SidenavGroupPropsType) => JSX.Element;
|
|
15
15
|
Link: React.ForwardRefExoticComponent<import("../sidenav/types").SidenavLinkPropsType & React.RefAttributes<HTMLAnchorElement>>;
|
|
16
16
|
Title: ({ children }: import("../sidenav/types").SidenavTitlePropsType) => JSX.Element;
|
|
17
17
|
};
|
|
@@ -1,55 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
12
|
var _Header = _interopRequireDefault(require("../header/Header"));
|
|
19
|
-
|
|
20
13
|
var _Footer = _interopRequireDefault(require("../footer/Footer"));
|
|
21
|
-
|
|
22
14
|
var _Sidenav = _interopRequireDefault(require("../sidenav/Sidenav"));
|
|
23
|
-
|
|
24
15
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var _Icons = require("./Icons");
|
|
29
|
-
|
|
30
|
-
var _SidenavContext = require("./SidenavContext");
|
|
31
|
-
|
|
16
|
+
var _variables = require("../common/variables");
|
|
17
|
+
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
18
|
+
var _SidenavContext = require("../sidenav/SidenavContext");
|
|
32
19
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
33
|
-
|
|
34
20
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
40
23
|
var year = new Date().getFullYear();
|
|
41
|
-
|
|
42
24
|
var Main = function Main(_ref) {
|
|
43
25
|
var children = _ref.children;
|
|
44
26
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
45
27
|
};
|
|
46
|
-
|
|
47
28
|
var defaultHeader = function defaultHeader() {
|
|
48
29
|
return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
49
30
|
underlined: true
|
|
50
31
|
});
|
|
51
32
|
};
|
|
52
|
-
|
|
53
33
|
var defaultFooter = function defaultFooter() {
|
|
54
34
|
return /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
55
35
|
copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
|
|
@@ -57,69 +37,62 @@ var defaultFooter = function defaultFooter() {
|
|
|
57
37
|
href: "https://www.linkedin.com/company/dxctechnology",
|
|
58
38
|
text: "Linkedin"
|
|
59
39
|
}, {
|
|
60
|
-
href: "https://
|
|
61
|
-
text: "
|
|
40
|
+
href: "https://x.com/dxctechnology",
|
|
41
|
+
text: "X"
|
|
62
42
|
}, {
|
|
63
43
|
href: "https://www.facebook.com/DXCTechnology/",
|
|
64
44
|
text: "Facebook"
|
|
65
45
|
}],
|
|
66
46
|
socialLinks: [{
|
|
67
47
|
href: "https://www.linkedin.com/company/dxctechnology",
|
|
68
|
-
logo: _Icons.linkedinLogo
|
|
48
|
+
logo: _Icons["default"].linkedinLogo,
|
|
49
|
+
title: "Linkedin"
|
|
69
50
|
}, {
|
|
70
|
-
href: "https://
|
|
71
|
-
logo: _Icons.
|
|
51
|
+
href: "https://x.com/dxctechnology",
|
|
52
|
+
logo: _Icons["default"].xLogo,
|
|
53
|
+
title: "X"
|
|
72
54
|
}, {
|
|
73
55
|
href: "https://www.facebook.com/DXCTechnology/",
|
|
74
|
-
logo: _Icons.facebookLogo
|
|
56
|
+
logo: _Icons["default"].facebookLogo,
|
|
57
|
+
title: "Facebook"
|
|
75
58
|
}]
|
|
76
59
|
});
|
|
77
60
|
};
|
|
78
|
-
|
|
79
61
|
var childTypeExists = function childTypeExists(children, childType) {
|
|
80
62
|
return children.find(function (child) {
|
|
81
63
|
return (child === null || child === void 0 ? void 0 : child.type) === childType;
|
|
82
64
|
});
|
|
83
65
|
};
|
|
84
|
-
|
|
85
66
|
var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
|
|
86
67
|
var _ref2$visibilityToggl = _ref2.visibilityToggleLabel,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
visibilityToggleLabel = _ref2$visibilityToggl === void 0 ? "" : _ref2$visibilityToggl,
|
|
69
|
+
header = _ref2.header,
|
|
70
|
+
sidenav = _ref2.sidenav,
|
|
71
|
+
footer = _ref2.footer,
|
|
72
|
+
children = _ref2.children;
|
|
93
73
|
var _useState = (0, _react.useState)(false),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
74
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
75
|
+
isSidenavVisibleResponsive = _useState2[0],
|
|
76
|
+
setIsSidenavVisibleResponsive = _useState2[1];
|
|
98
77
|
var _useState3 = (0, _react.useState)(false),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
78
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
79
|
+
isResponsive = _useState4[0],
|
|
80
|
+
setIsResponsive = _useState4[1];
|
|
103
81
|
var ref = (0, _react.useRef)(null);
|
|
104
82
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
105
|
-
|
|
106
83
|
var childrenArray = _react["default"].Children.toArray(children);
|
|
107
|
-
|
|
108
84
|
var headerContent = header || defaultHeader();
|
|
109
85
|
var footerContent = footer || defaultFooter();
|
|
110
86
|
var main = childTypeExists(childrenArray, Main);
|
|
111
|
-
|
|
112
87
|
var handleResize = function handleResize() {
|
|
113
88
|
setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches);
|
|
114
89
|
};
|
|
115
|
-
|
|
116
90
|
var handleSidenavVisibility = function handleSidenavVisibility() {
|
|
117
91
|
setIsSidenavVisibleResponsive(function (isSidenavVisibleResponsive) {
|
|
118
92
|
return !isSidenavVisibleResponsive;
|
|
119
93
|
});
|
|
120
94
|
};
|
|
121
|
-
|
|
122
|
-
(0, _react.useLayoutEffect)(function () {
|
|
95
|
+
(0, _react.useEffect)(function () {
|
|
123
96
|
handleResize();
|
|
124
97
|
window.addEventListener("resize", handleResize);
|
|
125
98
|
return function () {
|
|
@@ -137,35 +110,25 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
|
|
|
137
110
|
onClick: handleSidenavVisibility,
|
|
138
111
|
"aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
|
|
139
112
|
title: translatedLabels.applicationLayout.visibilityToggleTitle
|
|
140
|
-
}, _Icons.hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
|
|
113
|
+
}, _Icons["default"].hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
|
|
141
114
|
value: setIsSidenavVisibleResponsive
|
|
142
115
|
}, 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)));
|
|
143
116
|
};
|
|
144
|
-
|
|
145
117
|
var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n\n @media (max-width: ", "rem) {\n ", ";\n ", "\n }\n"])), _variables.responsiveSizes.medium, function (props) {
|
|
146
118
|
return props.hasSidenav && "top: 116px";
|
|
147
119
|
}, function (props) {
|
|
148
120
|
return props.isSidenavVisible && "overflow: hidden;";
|
|
149
121
|
});
|
|
150
|
-
|
|
151
122
|
var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"])));
|
|
152
|
-
|
|
153
123
|
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"])));
|
|
154
|
-
|
|
155
|
-
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"])));
|
|
156
|
-
|
|
124
|
+
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"])));
|
|
157
125
|
var BodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
|
|
158
|
-
|
|
159
126
|
var SidenavContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n position: sticky;\n top: 64px;\n display: flex;\n height: calc(100vh - 64px);\n z-index: 1;\n\n @media (max-width: ", "rem) {\n position: absolute;\n top: 0px;\n height: 100%;\n }\n"])), _variables.responsiveSizes.medium);
|
|
160
|
-
|
|
161
127
|
var MainContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
|
|
162
|
-
|
|
163
|
-
var MainContentContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n"])));
|
|
164
|
-
|
|
128
|
+
var MainContentContainer = _styledComponents["default"].main(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n background-color: #fff;\n"])));
|
|
165
129
|
DxcApplicationLayout.Header = _Header["default"];
|
|
166
130
|
DxcApplicationLayout.Main = Main;
|
|
167
131
|
DxcApplicationLayout.Footer = _Footer["default"];
|
|
168
132
|
DxcApplicationLayout.SideNav = _Sidenav["default"];
|
|
169
133
|
DxcApplicationLayout.useResponsiveSidenavVisibility = _SidenavContext.useResponsiveSidenavVisibility;
|
|
170
|
-
var _default = DxcApplicationLayout;
|
|
171
|
-
exports["default"] = _default;
|
|
134
|
+
var _default = exports["default"] = DxcApplicationLayout;
|
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const layoutIcons: {
|
|
3
|
+
facebookLogo: React.JSX.Element;
|
|
4
|
+
xLogo: React.JSX.Element;
|
|
5
|
+
linkedinLogo: React.JSX.Element;
|
|
6
|
+
hamburgerIcon: React.JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export default layoutIcons;
|