@dxc-technology/halstack-react 9.0.1 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HalstackContext.d.ts +2 -2
- package/HalstackContext.js +2 -2
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +2 -14
- package/accordion/Accordion.stories.tsx +3 -101
- package/accordion/types.d.ts +0 -12
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +21 -42
- package/accordion-group/AccordionGroup.stories.tsx +77 -76
- package/accordion-group/AccordionGroup.test.js +6 -16
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +0 -12
- package/alert/Alert.js +1 -3
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.d.ts +1 -1
- package/box/Box.js +5 -22
- package/box/Box.stories.tsx +25 -53
- package/box/types.d.ts +0 -12
- package/bulleted-list/BulletedList.js +4 -2
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +31 -4
- package/button/Button.d.ts +1 -1
- package/button/Button.js +45 -55
- package/button/Button.stories.tsx +4 -4
- package/button/Button.test.js +11 -0
- package/button/types.d.ts +4 -0
- package/card/Card.d.ts +1 -1
- package/card/Card.js +18 -35
- package/card/Card.stories.tsx +0 -29
- package/card/types.d.ts +1 -7
- package/chip/Chip.js +23 -36
- package/chip/Chip.stories.tsx +25 -17
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/variables.d.ts +1 -144
- package/common/variables.js +952 -1095
- package/date-input/Calendar.js +2 -2
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +4 -22
- package/dialog/Dialog.stories.tsx +52 -176
- package/dialog/types.d.ts +0 -13
- package/dropdown/DropdownMenu.js +5 -1
- package/file-input/FileItem.js +2 -2
- package/file-input/types.d.ts +1 -1
- package/flex/Flex.js +4 -2
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +70 -5
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +43 -61
- package/footer/Footer.stories.tsx +12 -89
- package/footer/Footer.test.js +3 -1
- package/footer/types.d.ts +10 -12
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -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 +1 -1
- package/header/Header.js +3 -30
- package/header/Header.stories.tsx +7 -71
- package/header/types.d.ts +0 -14
- package/inset/Inset.stories.tsx +2 -1
- package/layout/ApplicationLayout.d.ts +4 -4
- package/layout/ApplicationLayout.js +7 -4
- package/layout/types.d.ts +2 -3
- package/link/Link.js +1 -1
- package/main.d.ts +2 -1
- package/main.js +8 -0
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +7 -10
- package/nav-tabs/NavTabs.stories.tsx +14 -0
- package/nav-tabs/Tab.js +22 -26
- package/nav-tabs/types.d.ts +8 -9
- package/package.json +1 -1
- package/paginator/Paginator.js +1 -1
- package/paginator/Paginator.test.js +13 -0
- package/radio-group/Radio.js +10 -10
- package/radio-group/RadioGroup.js +8 -10
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +65 -93
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/types.d.ts +21 -18
- package/tabs/Tab.js +1 -2
- package/tabs/Tabs.js +10 -14
- package/text-input/TextInput.js +1 -1
- package/text-input/TextInput.stories.tsx +1 -1
- package/textarea/Textarea.js +0 -1
- package/textarea/Textarea.test.js +1 -3
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/useTheme.d.ts +1 -1
- package/utils/FocusLock.js +3 -4
- package/card/ice-cream.jpg +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import DxcGrid from "./Grid";
|
|
6
|
+
import DxcInset from "../inset/Inset";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Grid",
|
|
10
|
+
component: DxcGrid,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Chromatic = () => (
|
|
14
|
+
<>
|
|
15
|
+
<Title title="Default" level={4} />
|
|
16
|
+
<ExampleContainer>
|
|
17
|
+
<DxcGrid>
|
|
18
|
+
<ColoredContainer />
|
|
19
|
+
<ColoredContainer />
|
|
20
|
+
<ColoredContainer />
|
|
21
|
+
</DxcGrid>
|
|
22
|
+
</ExampleContainer>
|
|
23
|
+
<Title title="Place items" level={4} />
|
|
24
|
+
<ExampleContainer>
|
|
25
|
+
<DxcGrid templateRows={["200px"]} placeItems="center">
|
|
26
|
+
<ColoredContainer height="50px" width="50px" />
|
|
27
|
+
</DxcGrid>
|
|
28
|
+
<DxcGrid placeItems={{ justifyItems: "end" }}>
|
|
29
|
+
<ColoredContainer />
|
|
30
|
+
<ColoredContainer />
|
|
31
|
+
<ColoredContainer />
|
|
32
|
+
</DxcGrid>
|
|
33
|
+
<DxcGrid templateRows={["repeat(3, 100px)"]} placeItems={{ alignItems: "end", justifyItems: "center" }}>
|
|
34
|
+
<ColoredContainer height="50px" width="50px" />
|
|
35
|
+
<ColoredContainer height="50px" width="50px" />
|
|
36
|
+
<ColoredContainer height="50px" width="50px" />
|
|
37
|
+
</DxcGrid>
|
|
38
|
+
</ExampleContainer>
|
|
39
|
+
<Title title="Place content" level={4} />
|
|
40
|
+
<Container height="200px">
|
|
41
|
+
<DxcGrid placeContent="center">
|
|
42
|
+
<ColoredContainer height="50px" width="50px" />
|
|
43
|
+
<ColoredContainer height="50px" width="50px" />
|
|
44
|
+
</DxcGrid>
|
|
45
|
+
</Container>
|
|
46
|
+
<Container height="200px">
|
|
47
|
+
<DxcGrid placeContent={{ alignContent: "center" }}>
|
|
48
|
+
<ColoredContainer height="50px" width="50px" />
|
|
49
|
+
</DxcGrid>
|
|
50
|
+
</Container>
|
|
51
|
+
<Container height="200px">
|
|
52
|
+
<DxcGrid placeContent={{ alignContent: "center", justifyContent: "end" }}>
|
|
53
|
+
<ColoredContainer height="50px" width="50px" />
|
|
54
|
+
</DxcGrid>
|
|
55
|
+
</Container>
|
|
56
|
+
<Title title="Place self" level={4} />
|
|
57
|
+
<ExampleContainer>
|
|
58
|
+
<DxcGrid templateRows={["repeat(3, 100px)"]}>
|
|
59
|
+
<DxcGrid.Item placeSelf="center">
|
|
60
|
+
<ColoredContainer height="50px" width="50px" />
|
|
61
|
+
</DxcGrid.Item>
|
|
62
|
+
<DxcGrid.Item placeSelf={{ alignSelf: "end" }}>
|
|
63
|
+
<ColoredContainer height="40px" width="40px" />
|
|
64
|
+
<ColoredContainer height="30px" width="30px" />
|
|
65
|
+
</DxcGrid.Item>
|
|
66
|
+
<DxcGrid.Item placeSelf={{ alignSelf: "center", justifySelf: "end" }}>
|
|
67
|
+
<ColoredContainer height="50px" width="50px" />
|
|
68
|
+
</DxcGrid.Item>
|
|
69
|
+
</DxcGrid>
|
|
70
|
+
</ExampleContainer>
|
|
71
|
+
<Title title="Halstack layout using template areas" level={4} />
|
|
72
|
+
<ExampleContainer>
|
|
73
|
+
<DxcGrid
|
|
74
|
+
templateColumns={["repeat(4, 1fr)"]}
|
|
75
|
+
templateRows={["40px", "200px", "60px"]}
|
|
76
|
+
templateAreas={["header header header header", "sidenav main main main", "sidenav footer footer footer"]}
|
|
77
|
+
gap={{ rowGap: "0.5rem", columnGap: "1rem" }}
|
|
78
|
+
>
|
|
79
|
+
<DxcGrid.Item areaName="header" as="header">
|
|
80
|
+
<ColoredContainer height="100%" />
|
|
81
|
+
</DxcGrid.Item>
|
|
82
|
+
<DxcGrid.Item areaName="main" as="main">
|
|
83
|
+
<ColoredContainer height="100%" />
|
|
84
|
+
</DxcGrid.Item>
|
|
85
|
+
<DxcGrid.Item areaName="sidenav" as="nav">
|
|
86
|
+
<ColoredContainer height="100%" />
|
|
87
|
+
</DxcGrid.Item>
|
|
88
|
+
<DxcGrid.Item areaName="footer" as="footer">
|
|
89
|
+
<ColoredContainer height="100%" />
|
|
90
|
+
</DxcGrid.Item>
|
|
91
|
+
</DxcGrid>
|
|
92
|
+
</ExampleContainer>
|
|
93
|
+
<Title title="Template rows and columns with flexible sizes" level={4} />
|
|
94
|
+
<ExampleContainer>
|
|
95
|
+
<DxcGrid templateColumns={["1fr", "1fr", "1fr"]} templateRows={["1fr", "3fr", "1fr"]} gap="0.5rem">
|
|
96
|
+
<DxcGrid.Item column={{ start: 1, end: -1 }}>
|
|
97
|
+
<ColoredContainer color="yellow" height="100%">
|
|
98
|
+
Header
|
|
99
|
+
</ColoredContainer>
|
|
100
|
+
</DxcGrid.Item>
|
|
101
|
+
<DxcGrid.Item column={1}>
|
|
102
|
+
<ColoredContainer color="lightcyan" height="100%">
|
|
103
|
+
Sidenav
|
|
104
|
+
</ColoredContainer>
|
|
105
|
+
</DxcGrid.Item>
|
|
106
|
+
<DxcGrid
|
|
107
|
+
column={{ start: 2, end: -1 }}
|
|
108
|
+
templateRows={["repeat(4, 1fr)"]}
|
|
109
|
+
templateColumns={["repeat(2, 1fr)"]}
|
|
110
|
+
gap="1rem"
|
|
111
|
+
>
|
|
112
|
+
<ColoredContainer />
|
|
113
|
+
<ColoredContainer />
|
|
114
|
+
<ColoredContainer />
|
|
115
|
+
<ColoredContainer />
|
|
116
|
+
<ColoredContainer />
|
|
117
|
+
<ColoredContainer />
|
|
118
|
+
<ColoredContainer />
|
|
119
|
+
<ColoredContainer />
|
|
120
|
+
</DxcGrid>
|
|
121
|
+
<DxcGrid.Item column={{ start: 1, end: -1 }}>
|
|
122
|
+
<ColoredContainer color="black" height="100%">
|
|
123
|
+
Footer
|
|
124
|
+
</ColoredContainer>
|
|
125
|
+
</DxcGrid.Item>
|
|
126
|
+
</DxcGrid>
|
|
127
|
+
</ExampleContainer>
|
|
128
|
+
<Title title="Overlapping" level={4} />
|
|
129
|
+
<DxcInset bottom="2rem">
|
|
130
|
+
<ExampleContainer>
|
|
131
|
+
<DxcGrid templateRows={["50px", "50px"]}>
|
|
132
|
+
<ColoredContainer color="yellow" height="100px">
|
|
133
|
+
1
|
|
134
|
+
</ColoredContainer>
|
|
135
|
+
<ColoredContainer color="transparent" height="100px">
|
|
136
|
+
2
|
|
137
|
+
</ColoredContainer>
|
|
138
|
+
</DxcGrid>
|
|
139
|
+
</ExampleContainer>
|
|
140
|
+
</DxcInset>
|
|
141
|
+
<Title title="Implicit rows and columns" level={4} />
|
|
142
|
+
<ExampleContainer>
|
|
143
|
+
<DxcGrid templateColumns={["50px"]} templateRows={["50px", "50px"]} autoRows="50px" autoColumns="50px">
|
|
144
|
+
<DxcGrid.Item>
|
|
145
|
+
<ColoredContainer height="50px">1</ColoredContainer>
|
|
146
|
+
</DxcGrid.Item>
|
|
147
|
+
<DxcGrid.Item row={2}>
|
|
148
|
+
<ColoredContainer height="50px">3</ColoredContainer>
|
|
149
|
+
</DxcGrid.Item>
|
|
150
|
+
<DxcGrid.Item row={6} column={1}>
|
|
151
|
+
<ColoredContainer height="50px">5</ColoredContainer>
|
|
152
|
+
</DxcGrid.Item>
|
|
153
|
+
<DxcGrid.Item row={3}>
|
|
154
|
+
<ColoredContainer height="50px">4</ColoredContainer>
|
|
155
|
+
</DxcGrid.Item>
|
|
156
|
+
<DxcGrid.Item row={{ start: 1, end: 2 }} column={{ start: 5, end: "span 2" }}>
|
|
157
|
+
<ColoredContainer height="50px">2</ColoredContainer>
|
|
158
|
+
</DxcGrid.Item>
|
|
159
|
+
</DxcGrid>
|
|
160
|
+
</ExampleContainer>
|
|
161
|
+
<Title title="Autoflow 'row' (default)" level={4} />
|
|
162
|
+
<ExampleContainer>
|
|
163
|
+
<DxcGrid templateColumns={["repeat(5, 1fr)"]} templateRows={["1fr", "1fr"]} autoFlow="row" autoColumns="1fr">
|
|
164
|
+
<DxcGrid.Item row={{ start: 1, end: "span 2" }} column={1}>
|
|
165
|
+
<ColoredContainer height="100%">1</ColoredContainer>
|
|
166
|
+
</DxcGrid.Item>
|
|
167
|
+
<ColoredContainer color="lightyellow">2</ColoredContainer>
|
|
168
|
+
<ColoredContainer color="lightcyan">3</ColoredContainer>
|
|
169
|
+
<ColoredContainer color="lightgreen">4</ColoredContainer>
|
|
170
|
+
<DxcGrid.Item row={{ start: 1, end: -1 }} column={-2}>
|
|
171
|
+
<ColoredContainer color="lightpink" height="100%">
|
|
172
|
+
5
|
|
173
|
+
</ColoredContainer>
|
|
174
|
+
</DxcGrid.Item>
|
|
175
|
+
</DxcGrid>
|
|
176
|
+
</ExampleContainer>
|
|
177
|
+
<Title title="Autoflow 'column'" level={4} />
|
|
178
|
+
<ExampleContainer>
|
|
179
|
+
<DxcGrid templateColumns={["repeat(5, 1fr)"]} templateRows={["1fr", "1fr"]} autoFlow="column" autoColumns="1fr">
|
|
180
|
+
<DxcGrid.Item row={{ start: 1, end: -1 }} column={1}>
|
|
181
|
+
<ColoredContainer height="100%">1</ColoredContainer>
|
|
182
|
+
</DxcGrid.Item>
|
|
183
|
+
<ColoredContainer color="lightyellow">2</ColoredContainer>
|
|
184
|
+
<ColoredContainer color="lightcyan">3</ColoredContainer>
|
|
185
|
+
<ColoredContainer color="lightgreen">4</ColoredContainer>
|
|
186
|
+
<DxcGrid.Item row={{ start: 1, end: -1 }} column={-2}>
|
|
187
|
+
<ColoredContainer color="lightpink" height="100%">
|
|
188
|
+
5
|
|
189
|
+
</ColoredContainer>
|
|
190
|
+
</DxcGrid.Item>
|
|
191
|
+
</DxcGrid>
|
|
192
|
+
</ExampleContainer>
|
|
193
|
+
</>
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
const Container = styled.div<{ height?: string }>`
|
|
197
|
+
display: grid;
|
|
198
|
+
overflow: auto;
|
|
199
|
+
margin: 2.5rem;
|
|
200
|
+
${({ height }) => height && `height: ${height}`};
|
|
201
|
+
`;
|
|
202
|
+
|
|
203
|
+
const ColoredContainer = styled.div<{ color?: string; width?: string; height?: string }>`
|
|
204
|
+
box-sizing: border-box;
|
|
205
|
+
display: flex;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
align-items: center;
|
|
208
|
+
background-color: ${({ color }) => color ?? "#e5d5f6"};
|
|
209
|
+
padding: 1rem;
|
|
210
|
+
border: 1px solid #a46ede;
|
|
211
|
+
border-radius: 0.5rem;
|
|
212
|
+
font-family: Open Sans, sans-serif;
|
|
213
|
+
font-size: 1.5rem;
|
|
214
|
+
font-weight: bold;
|
|
215
|
+
color: #a46ede;
|
|
216
|
+
|
|
217
|
+
${({ width }) => width && `width: ${width}`};
|
|
218
|
+
${({ height }) => height && `height: ${height}`};
|
|
219
|
+
`;
|
package/grid/types.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Spaces = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
3
|
+
declare type Gap = {
|
|
4
|
+
rowGap: Spaces;
|
|
5
|
+
columnGap?: Spaces;
|
|
6
|
+
} | {
|
|
7
|
+
rowGap?: Spaces;
|
|
8
|
+
columnGap: Spaces;
|
|
9
|
+
} | Spaces;
|
|
10
|
+
declare type GridCell = {
|
|
11
|
+
start: number | string;
|
|
12
|
+
end: number | string;
|
|
13
|
+
};
|
|
14
|
+
declare type PlaceSelfValues = "auto" | "start" | "end" | "center" | "stretch" | "baseline";
|
|
15
|
+
declare type PlaceContentValues = "normal" | "start" | "end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly" | "baseline";
|
|
16
|
+
declare type PlaceItemsValues = "normal" | "start" | "end" | "center" | "stretch" | "baseline";
|
|
17
|
+
declare type PlaceObject<Type, Suffix extends string> = {
|
|
18
|
+
[Property in keyof Type as `${string & Property}${Capitalize<string & Suffix>}`]: Type[Property];
|
|
19
|
+
};
|
|
20
|
+
declare type PlaceGeneric<PlaceValues, Element extends string> = PlaceObject<{
|
|
21
|
+
justify?: PlaceValues;
|
|
22
|
+
align: PlaceValues;
|
|
23
|
+
}, Element> | PlaceObject<{
|
|
24
|
+
justify: PlaceValues;
|
|
25
|
+
align?: PlaceValues;
|
|
26
|
+
}, Element> | PlaceValues;
|
|
27
|
+
export declare type GridItemProps = {
|
|
28
|
+
/**
|
|
29
|
+
* Sets the name of an item so that it can be referenced by a template created with the grid-template-areas property.
|
|
30
|
+
*/
|
|
31
|
+
areaName?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Sets the grid-column CSS property.
|
|
34
|
+
*
|
|
35
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column
|
|
36
|
+
*/
|
|
37
|
+
column?: number | string | GridCell;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the grid-row CSS property.
|
|
40
|
+
*
|
|
41
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row
|
|
42
|
+
*/
|
|
43
|
+
row?: number | string | GridCell;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the place-self CSS property.
|
|
46
|
+
*
|
|
47
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/place-self
|
|
48
|
+
*/
|
|
49
|
+
placeSelf?: PlaceGeneric<PlaceSelfValues, "self">;
|
|
50
|
+
/**
|
|
51
|
+
* Sets a custom HTML tag.
|
|
52
|
+
*/
|
|
53
|
+
as?: keyof HTMLElementTagNameMap;
|
|
54
|
+
/**
|
|
55
|
+
* Custom content inside the grid container.
|
|
56
|
+
*/
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
};
|
|
59
|
+
declare type Props = GridItemProps & {
|
|
60
|
+
/**
|
|
61
|
+
* Sets the grid-auto-columns CSS property.
|
|
62
|
+
*
|
|
63
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns
|
|
64
|
+
*/
|
|
65
|
+
autoColumns?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Sets the grid-auto-flow CSS property.
|
|
68
|
+
*
|
|
69
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow
|
|
70
|
+
*/
|
|
71
|
+
autoFlow?: "row" | "column" | "row dense" | "column dense";
|
|
72
|
+
/**
|
|
73
|
+
* Sets the grid-auto-rows CSS property.
|
|
74
|
+
*
|
|
75
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows
|
|
76
|
+
*/
|
|
77
|
+
autoRows?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the gap CSS property.
|
|
80
|
+
*
|
|
81
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/gap
|
|
82
|
+
*/
|
|
83
|
+
gap?: Spaces | Gap;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the place-content CSS property.
|
|
86
|
+
*
|
|
87
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/place-content
|
|
88
|
+
*/
|
|
89
|
+
placeContent?: PlaceGeneric<PlaceContentValues, "content">;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the place-items CSS property.
|
|
92
|
+
*
|
|
93
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/place-items
|
|
94
|
+
*/
|
|
95
|
+
placeItems?: PlaceGeneric<PlaceItemsValues, "items">;
|
|
96
|
+
/**
|
|
97
|
+
* Sets the grid-template-areas CSS property.
|
|
98
|
+
*
|
|
99
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas
|
|
100
|
+
*/
|
|
101
|
+
templateAreas?: string[];
|
|
102
|
+
/**
|
|
103
|
+
* Sets the grid-template-columns CSS property.
|
|
104
|
+
*
|
|
105
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns
|
|
106
|
+
*/
|
|
107
|
+
templateColumns?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* Sets the grid-template-rows CSS property.
|
|
110
|
+
*
|
|
111
|
+
* See MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows
|
|
112
|
+
*/
|
|
113
|
+
templateRows?: string[];
|
|
114
|
+
};
|
|
115
|
+
export default Props;
|
package/grid/types.js
ADDED
package/header/Header.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcDropdown from "../dropdown/Dropdown";
|
|
3
3
|
import HeaderPropsType from "./types";
|
|
4
4
|
declare const DxcHeader: {
|
|
5
|
-
({ underlined, content, responsiveContent, onClick, margin,
|
|
5
|
+
({ underlined, content, responsiveContent, onClick, margin, tabIndex, }: HeaderPropsType): JSX.Element;
|
|
6
6
|
Dropdown: (props: React.ComponentProps<typeof DxcDropdown>) => JSX.Element;
|
|
7
7
|
};
|
|
8
8
|
export default DxcHeader;
|
package/header/Header.js
CHANGED
|
@@ -72,13 +72,11 @@ var Content = function Content(_ref) {
|
|
|
72
72
|
var isResponsive = _ref.isResponsive,
|
|
73
73
|
responsiveContent = _ref.responsiveContent,
|
|
74
74
|
handleMenu = _ref.handleMenu,
|
|
75
|
-
padding = _ref.padding,
|
|
76
75
|
content = _ref.content;
|
|
77
76
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
78
77
|
return isResponsive ? /*#__PURE__*/_react["default"].createElement(MenuContent, {
|
|
79
78
|
backgroundType: backgroundType
|
|
80
79
|
}, responsiveContent(handleMenu)) : /*#__PURE__*/_react["default"].createElement(ContentContainer, {
|
|
81
|
-
padding: padding,
|
|
82
80
|
backgroundType: backgroundType
|
|
83
81
|
}, content);
|
|
84
82
|
};
|
|
@@ -90,7 +88,6 @@ var DxcHeader = function DxcHeader(_ref2) {
|
|
|
90
88
|
responsiveContent = _ref2.responsiveContent,
|
|
91
89
|
onClick = _ref2.onClick,
|
|
92
90
|
margin = _ref2.margin,
|
|
93
|
-
padding = _ref2.padding,
|
|
94
91
|
_ref2$tabIndex = _ref2.tabIndex,
|
|
95
92
|
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
96
93
|
var colorsTheme = (0, _useTheme["default"])();
|
|
@@ -145,9 +142,7 @@ var DxcHeader = function DxcHeader(_ref2) {
|
|
|
145
142
|
tabIndex: onClick ? tabIndex : -1,
|
|
146
143
|
interactuable: onClick ? true : false,
|
|
147
144
|
onClick: onClick
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, headerLogo)), isResponsive && responsiveContent && /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(ChildContainer, {
|
|
149
|
-
padding: padding
|
|
150
|
-
}, /*#__PURE__*/_react["default"].createElement(HamburguerTrigger, {
|
|
145
|
+
}, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, headerLogo)), isResponsive && responsiveContent && /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(ChildContainer, null, /*#__PURE__*/_react["default"].createElement(HamburguerTrigger, {
|
|
151
146
|
tabIndex: tabIndex,
|
|
152
147
|
onClick: handleMenu
|
|
153
148
|
}, hamburgerIcon, translatedLabels.header.hamburguerTitle)), /*#__PURE__*/_react["default"].createElement(ResponsiveMenu, {
|
|
@@ -163,7 +158,6 @@ var DxcHeader = function DxcHeader(_ref2) {
|
|
|
163
158
|
isResponsive: isResponsive,
|
|
164
159
|
responsiveContent: responsiveContent,
|
|
165
160
|
handleMenu: handleMenu,
|
|
166
|
-
padding: padding,
|
|
167
161
|
content: content
|
|
168
162
|
}))), /*#__PURE__*/_react["default"].createElement(Overlay, {
|
|
169
163
|
onClick: handleMenu,
|
|
@@ -174,7 +168,6 @@ var DxcHeader = function DxcHeader(_ref2) {
|
|
|
174
168
|
isResponsive: isResponsive,
|
|
175
169
|
responsiveContent: responsiveContent,
|
|
176
170
|
handleMenu: handleMenu,
|
|
177
|
-
padding: padding,
|
|
178
171
|
content: content
|
|
179
172
|
}))));
|
|
180
173
|
};
|
|
@@ -209,29 +202,9 @@ var LogoContainer = _styledComponents["default"].div(_templateObject5 || (_templ
|
|
|
209
202
|
return props.theme.logoWidth;
|
|
210
203
|
});
|
|
211
204
|
|
|
212
|
-
var ChildContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-grow: 1;\n width: calc(100% - 186px);\n
|
|
213
|
-
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
214
|
-
}, function (props) {
|
|
215
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
216
|
-
}, function (props) {
|
|
217
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
|
|
218
|
-
}, function (props) {
|
|
219
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
|
|
220
|
-
}, function (props) {
|
|
221
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
222
|
-
});
|
|
205
|
+
var ChildContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-grow: 1;\n width: calc(100% - 186px);\n"])));
|
|
223
206
|
|
|
224
|
-
var ContentContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n flex-grow: 1;\n justify-content: flex-end;\n width: calc(100% - 186px);\n
|
|
225
|
-
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
226
|
-
}, function (props) {
|
|
227
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
228
|
-
}, function (props) {
|
|
229
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
|
|
230
|
-
}, function (props) {
|
|
231
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
|
|
232
|
-
}, function (props) {
|
|
233
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
234
|
-
}, function (props) {
|
|
207
|
+
var ContentContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n flex-grow: 1;\n justify-content: flex-end;\n width: calc(100% - 186px);\n color: ", ";\n"])), function (props) {
|
|
235
208
|
return props.backgroundType === "dark" ? props.theme.contentColorOnDark : props.theme.contentColor;
|
|
236
209
|
});
|
|
237
210
|
|
|
@@ -42,46 +42,9 @@ const opinionatedTheme = {
|
|
|
42
42
|
fontColor: "#000000",
|
|
43
43
|
menuBaseColor: "#ffffff",
|
|
44
44
|
hamburguerColor: "#000000",
|
|
45
|
-
logo:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<g id="g12">
|
|
49
|
-
<path
|
|
50
|
-
id="path14"
|
|
51
|
-
d="M91.613-28.177v2.514H90.231V-28.15l-2.415-3.82h1.616l1.5,2.532,1.526-2.532h1.571ZM83.9-25.555A3.15,3.15,0,0,1,80.6-28.8v-.018a3.231,3.231,0,0,1,3.294-3.262,3.442,3.442,0,0,1,2.469.865l-.87,1.054a2.311,2.311,0,0,0-1.643-.64,1.891,1.891,0,0,0-1.8,1.964v.018a1.886,1.886,0,0,0,1.9,2,2.2,2.2,0,0,0,1.3-.378v-.9H83.858v-1.2h2.729v2.738A4.071,4.071,0,0,1,83.9-25.555Zm-6.416-3.261a1.913,1.913,0,0,0-1.9-1.982A1.883,1.883,0,0,0,73.7-28.835v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,77.486-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018A3.255,3.255,0,0,1,75.6-32.078a3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,75.583-25.555Zm-9.173-.108V-31.97h1.382v5.045h3.133v1.261Zm-3.433-3.153a1.913,1.913,0,0,0-1.9-1.982,1.883,1.883,0,0,0-1.886,1.964v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,62.978-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018a3.255,3.255,0,0,1,3.348-3.262,3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,61.075-25.555Zm-6.508-.108-3.043-4.009v4.009H50.159V-31.97h1.275l2.944,3.883V-31.97h1.364v6.306Zm-8.246,0v-2.531h-2.55v2.531H42.389V-31.97h1.382v2.5h2.55v-2.5H47.7v6.306Zm-8.432.108A3.178,3.178,0,0,1,34.666-28.8v-.018a3.2,3.2,0,0,1,3.276-3.262,3.237,3.237,0,0,1,2.478.973l-.88,1.018a2.315,2.315,0,0,0-1.606-.712,1.866,1.866,0,0,0-1.822,1.964v.018a1.87,1.87,0,0,0,1.822,1.982,2.265,2.265,0,0,0,1.651-.739l.88.891A3.206,3.206,0,0,1,37.889-25.555Zm-9.805-.108V-31.97h4.739v1.235H29.458v1.279h2.962v1.234H29.458V-26.9h3.411v1.234ZM24.322-30.69v5.027H22.939V-30.69H21.028v-1.28h5.206v1.28H24.322"
|
|
52
|
-
transform="translate(-21.028 65.555)"
|
|
53
|
-
fill="#100f0d"
|
|
54
|
-
/>
|
|
55
|
-
<path
|
|
56
|
-
id="path16"
|
|
57
|
-
d="M75.836-76.712a8.975,8.975,0,0,1,2.246-3.9,8.393,8.393,0,0,1,6.058-2.457h9.824v-5.67H84.139a14.611,14.611,0,0,0-10.232,4.221,14.509,14.509,0,0,0-3.076,4.536,11.913,11.913,0,0,0-.973,3.271Zm0,4.325a8.978,8.978,0,0,0,2.246,3.9,8.394,8.394,0,0,0,6.058,2.457h9.824v5.67H84.139A14.611,14.611,0,0,1,73.907-64.58a14.506,14.506,0,0,1-3.076-4.536,11.91,11.91,0,0,1-.973-3.271ZM57.522-69.832l-7.5,9.473H42.581L53.818-74.55,42.581-88.739H50.02l7.5,9.472,7.5-9.472h7.439L61.225-74.55l11.237,14.19H65.023Zm-12.336-6.88a11.935,11.935,0,0,0-.973-3.271,14.515,14.515,0,0,0-3.076-4.536A14.612,14.612,0,0,0,30.9-88.739H21.081v5.67H30.9a8.394,8.394,0,0,1,6.058,2.457,8.978,8.978,0,0,1,2.246,3.9Zm0,4.325a11.932,11.932,0,0,1-.973,3.271,14.511,14.511,0,0,1-3.076,4.536A14.611,14.611,0,0,1,30.9-60.359H21.081v-5.67H30.9a8.4,8.4,0,0,0,6.058-2.457,8.981,8.981,0,0,0,2.246-3.9h5.978"
|
|
58
|
-
transform="translate(-21.049 88.739)"
|
|
59
|
-
fill="#5f249f"
|
|
60
|
-
/>
|
|
61
|
-
</g>
|
|
62
|
-
</g>
|
|
63
|
-
</svg>
|
|
64
|
-
),
|
|
65
|
-
logoResponsive: (
|
|
66
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="73" height="40" viewBox="0 0 73 40">
|
|
67
|
-
<g id="g10" transform="translate(0)">
|
|
68
|
-
<g id="g12">
|
|
69
|
-
<path
|
|
70
|
-
id="path14"
|
|
71
|
-
d="M91.613-28.177v2.514H90.231V-28.15l-2.415-3.82h1.616l1.5,2.532,1.526-2.532h1.571ZM83.9-25.555A3.15,3.15,0,0,1,80.6-28.8v-.018a3.231,3.231,0,0,1,3.294-3.262,3.442,3.442,0,0,1,2.469.865l-.87,1.054a2.311,2.311,0,0,0-1.643-.64,1.891,1.891,0,0,0-1.8,1.964v.018a1.886,1.886,0,0,0,1.9,2,2.2,2.2,0,0,0,1.3-.378v-.9H83.858v-1.2h2.729v2.738A4.071,4.071,0,0,1,83.9-25.555Zm-6.416-3.261a1.913,1.913,0,0,0-1.9-1.982A1.883,1.883,0,0,0,73.7-28.835v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,77.486-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018A3.255,3.255,0,0,1,75.6-32.078a3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,75.583-25.555Zm-9.173-.108V-31.97h1.382v5.045h3.133v1.261Zm-3.433-3.153a1.913,1.913,0,0,0-1.9-1.982,1.883,1.883,0,0,0-1.886,1.964v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,62.978-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018a3.255,3.255,0,0,1,3.348-3.262,3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,61.075-25.555Zm-6.508-.108-3.043-4.009v4.009H50.159V-31.97h1.275l2.944,3.883V-31.97h1.364v6.306Zm-8.246,0v-2.531h-2.55v2.531H42.389V-31.97h1.382v2.5h2.55v-2.5H47.7v6.306Zm-8.432.108A3.178,3.178,0,0,1,34.666-28.8v-.018a3.2,3.2,0,0,1,3.276-3.262,3.237,3.237,0,0,1,2.478.973l-.88,1.018a2.315,2.315,0,0,0-1.606-.712,1.866,1.866,0,0,0-1.822,1.964v.018a1.87,1.87,0,0,0,1.822,1.982,2.265,2.265,0,0,0,1.651-.739l.88.891A3.206,3.206,0,0,1,37.889-25.555Zm-9.805-.108V-31.97h4.739v1.235H29.458v1.279h2.962v1.234H29.458V-26.9h3.411v1.234ZM24.322-30.69v5.027H22.939V-30.69H21.028v-1.28h5.206v1.28H24.322"
|
|
72
|
-
transform="translate(-21.028 65.555)"
|
|
73
|
-
fill="#100f0d"
|
|
74
|
-
/>
|
|
75
|
-
<path
|
|
76
|
-
id="path16"
|
|
77
|
-
d="M75.836-76.712a8.975,8.975,0,0,1,2.246-3.9,8.393,8.393,0,0,1,6.058-2.457h9.824v-5.67H84.139a14.611,14.611,0,0,0-10.232,4.221,14.509,14.509,0,0,0-3.076,4.536,11.913,11.913,0,0,0-.973,3.271Zm0,4.325a8.978,8.978,0,0,0,2.246,3.9,8.394,8.394,0,0,0,6.058,2.457h9.824v5.67H84.139A14.611,14.611,0,0,1,73.907-64.58a14.506,14.506,0,0,1-3.076-4.536,11.91,11.91,0,0,1-.973-3.271ZM57.522-69.832l-7.5,9.473H42.581L53.818-74.55,42.581-88.739H50.02l7.5,9.472,7.5-9.472h7.439L61.225-74.55l11.237,14.19H65.023Zm-12.336-6.88a11.935,11.935,0,0,0-.973-3.271,14.515,14.515,0,0,0-3.076-4.536A14.612,14.612,0,0,0,30.9-88.739H21.081v5.67H30.9a8.394,8.394,0,0,1,6.058,2.457,8.978,8.978,0,0,1,2.246,3.9Zm0,4.325a11.932,11.932,0,0,1-.973,3.271,14.511,14.511,0,0,1-3.076,4.536A14.611,14.611,0,0,1,30.9-60.359H21.081v-5.67H30.9a8.4,8.4,0,0,0,6.058-2.457,8.981,8.981,0,0,0,2.246-3.9h5.978"
|
|
78
|
-
transform="translate(-21.049 88.739)"
|
|
79
|
-
fill="#5f249f"
|
|
80
|
-
/>
|
|
81
|
-
</g>
|
|
82
|
-
</g>
|
|
83
|
-
</svg>
|
|
84
|
-
),
|
|
45
|
+
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/2021_Facebook_icon.svg/2048px-2021_Facebook_icon.svg.png",
|
|
46
|
+
logoResponsive:
|
|
47
|
+
"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/2021_Facebook_icon.svg/2048px-2021_Facebook_icon.svg.png",
|
|
85
48
|
contentColor: "#000000",
|
|
86
49
|
overlayColor: "#000000b3",
|
|
87
50
|
},
|
|
@@ -149,35 +112,6 @@ export const Chromatic = () => (
|
|
|
149
112
|
<DxcHeader underlined margin="xxlarge" />
|
|
150
113
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras felis.</p>
|
|
151
114
|
</ExampleContainer>
|
|
152
|
-
<Title title="Paddings" theme="light" level={2} />
|
|
153
|
-
<ExampleContainer>
|
|
154
|
-
<Title title="Xxsmall padding" theme="light" level={4} />
|
|
155
|
-
<DxcHeader underlined padding="xxsmall" />
|
|
156
|
-
</ExampleContainer>
|
|
157
|
-
<ExampleContainer>
|
|
158
|
-
<Title title="Xsmall padding" theme="light" level={4} />
|
|
159
|
-
<DxcHeader underlined padding="xsmall" />
|
|
160
|
-
</ExampleContainer>
|
|
161
|
-
<ExampleContainer>
|
|
162
|
-
<Title title="Small padding" theme="light" level={4} />
|
|
163
|
-
<DxcHeader underlined padding="small" />
|
|
164
|
-
</ExampleContainer>
|
|
165
|
-
<ExampleContainer>
|
|
166
|
-
<Title title="Medium padding" theme="light" level={4} />
|
|
167
|
-
<DxcHeader underlined padding="medium" />
|
|
168
|
-
</ExampleContainer>
|
|
169
|
-
<ExampleContainer>
|
|
170
|
-
<Title title="Large padding" theme="light" level={4} />
|
|
171
|
-
<DxcHeader underlined padding="large" />
|
|
172
|
-
</ExampleContainer>
|
|
173
|
-
<ExampleContainer>
|
|
174
|
-
<Title title="Xlarge padding" theme="light" level={4} />
|
|
175
|
-
<DxcHeader underlined padding="xlarge" />
|
|
176
|
-
</ExampleContainer>
|
|
177
|
-
<ExampleContainer>
|
|
178
|
-
<Title title="Xxlarge padding" theme="light" level={4} />
|
|
179
|
-
<DxcHeader underlined padding="xxlarge" />
|
|
180
|
-
</ExampleContainer>
|
|
181
115
|
<Title title="Opinionated theme" theme="light" level={2} />
|
|
182
116
|
<ExampleContainer>
|
|
183
117
|
<HalstackProvider theme={opinionatedTheme}>
|
|
@@ -200,8 +134,10 @@ export const ResponsiveHeader = () => (
|
|
|
200
134
|
<ExampleContainer>
|
|
201
135
|
<Title title="Responsive" theme="light" level={4} />
|
|
202
136
|
<DxcHeader
|
|
203
|
-
content={<DxcHeader.Dropdown options={options} label="Default Dropdown" />}
|
|
204
|
-
responsiveContent={(closeHandler) =>
|
|
137
|
+
content={<DxcHeader.Dropdown options={options} label="Default Dropdown" onSelectOption={() => {}} />}
|
|
138
|
+
responsiveContent={(closeHandler) => (
|
|
139
|
+
<DxcHeader.Dropdown options={options} label="Default Dropdown" onSelectOption={() => {}} />
|
|
140
|
+
)}
|
|
205
141
|
underlined
|
|
206
142
|
/>
|
|
207
143
|
</ExampleContainer>
|
package/header/types.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
declare type Padding = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
3
|
declare type Props = {
|
|
10
4
|
/**
|
|
11
5
|
* Wether a contrast line should appear at the bottom of the header.
|
|
@@ -31,14 +25,6 @@ declare type Props = {
|
|
|
31
25
|
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
32
26
|
*/
|
|
33
27
|
margin?: Space;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
36
|
-
* Size of the padding to be applied to the custom area of the component
|
|
37
|
-
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
38
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
|
|
39
|
-
* order to specify different padding sizes.
|
|
40
|
-
*/
|
|
41
|
-
padding?: Space | Padding;
|
|
42
28
|
/**
|
|
43
29
|
* Value of the tabindex for all interactuable elements, except those inside the
|
|
44
30
|
* custom area.
|
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
|
`;
|
|
@@ -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,
|
|
6
|
+
({ underlined, content, responsiveContent, onClick, margin, tabIndex, }: import("../header/types").default): JSX.Element;
|
|
7
7
|
Dropdown: (props: import("../dropdown/types").default) => 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, }: 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
|
};
|
|
@@ -65,13 +65,16 @@ var defaultFooter = function defaultFooter() {
|
|
|
65
65
|
}],
|
|
66
66
|
socialLinks: [{
|
|
67
67
|
href: "https://www.linkedin.com/company/dxctechnology",
|
|
68
|
-
logo: _Icons.linkedinLogo
|
|
68
|
+
logo: _Icons.linkedinLogo,
|
|
69
|
+
title: "Linkedin"
|
|
69
70
|
}, {
|
|
70
71
|
href: "https://twitter.com/dxctechnology",
|
|
71
|
-
logo: _Icons.twitterLogo
|
|
72
|
+
logo: _Icons.twitterLogo,
|
|
73
|
+
title: "Twitter"
|
|
72
74
|
}, {
|
|
73
75
|
href: "https://www.facebook.com/DXCTechnology/",
|
|
74
|
-
logo: _Icons.facebookLogo
|
|
76
|
+
logo: _Icons.facebookLogo,
|
|
77
|
+
title: "Facebook"
|
|
75
78
|
}]
|
|
76
79
|
});
|
|
77
80
|
};
|
|
@@ -160,7 +163,7 @@ var SidenavContainer = _styledComponents["default"].div(_templateObject6 || (_te
|
|
|
160
163
|
|
|
161
164
|
var MainContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
|
|
162
165
|
|
|
163
|
-
var MainContentContainer = _styledComponents["default"].
|
|
166
|
+
var MainContentContainer = _styledComponents["default"].main(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n background-color: #fff;\n"])));
|
|
164
167
|
|
|
165
168
|
DxcApplicationLayout.Header = _Header["default"];
|
|
166
169
|
DxcApplicationLayout.Main = Main;
|
package/layout/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType;
|
|
3
2
|
export declare type AppLayoutMainPropsType = {
|
|
4
3
|
/**
|
|
5
4
|
* Everything between the tags will be displayed as the content of the main part of the application.
|
|
@@ -35,8 +34,8 @@ declare type AppLayoutPropsType = {
|
|
|
35
34
|
*/
|
|
36
35
|
footer?: React.ReactNode;
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
37
|
+
* Use the DxcApplicationLayout.Main provided to render main content.
|
|
39
38
|
*/
|
|
40
|
-
children: React.ReactElement<
|
|
39
|
+
children: React.ReactElement<AppLayoutMainPropsType>;
|
|
41
40
|
};
|
|
42
41
|
export default AppLayoutPropsType;
|