@dxc-technology/halstack-react 9.0.0 → 9.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.
- package/BackgroundColorContext.d.ts +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1332 -5
- package/HalstackContext.js +59 -67
- package/accordion/Accordion.js +6 -11
- package/accordion/Accordion.stories.tsx +1 -1
- package/accordion/Accordion.test.js +1 -1
- package/accordion/types.d.ts +3 -3
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.test.js +1 -1
- package/accordion-group/types.d.ts +2 -2
- package/alert/Alert.js +3 -5
- package/alert/Alert.test.js +1 -1
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.js +2 -2
- package/box/Box.test.js +1 -1
- package/button/Button.js +2 -3
- package/button/Button.stories.tsx +1 -1
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.js +12 -13
- package/card/Card.stories.tsx +12 -13
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.js +3 -3
- package/checkbox/Checkbox.test.js +1 -1
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.js +2 -4
- package/chip/Chip.test.js +3 -5
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1625 -0
- package/common/variables.js +2 -2
- package/dialog/Dialog.js +1 -1
- package/dialog/Dialog.test.js +24 -24
- package/dialog/types.d.ts +2 -2
- package/dropdown/Dropdown.js +2 -2
- package/dropdown/Dropdown.test.js +3 -2
- package/dropdown/DropdownMenuItem.js +0 -2
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.js +1 -2
- package/file-input/FileInput.test.js +1 -1
- package/flex/Flex.stories.tsx +19 -24
- package/footer/Footer.js +6 -8
- package/footer/Footer.test.js +14 -26
- 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 +3 -2
- package/header/Header.js +3 -3
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +2 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +1 -1
- package/inset/Inset.stories.tsx +1 -0
- package/layout/ApplicationLayout.d.ts +3 -3
- package/layout/ApplicationLayout.js +1 -1
- package/layout/types.d.ts +2 -3
- package/link/Link.js +2 -2
- package/link/Link.test.js +2 -4
- package/link/types.d.ts +2 -2
- package/main.d.ts +2 -1
- package/main.js +8 -0
- package/nav-tabs/NavTabs.test.js +1 -1
- package/nav-tabs/Tab.js +7 -7
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.js +1 -3
- package/paginator/Paginator.test.js +27 -37
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +1 -1
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.test.js +1 -1
- package/progress-bar/types.d.ts +4 -3
- package/radio-group/RadioGroup.test.js +1 -1
- package/resultsetTable/ResultsetTable.js +2 -2
- package/resultsetTable/ResultsetTable.test.js +1 -1
- package/resultsetTable/types.d.ts +3 -3
- package/select/Select.js +13 -11
- package/select/Select.test.js +59 -59
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +50 -76
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/types.d.ts +21 -18
- package/slider/Slider.js +2 -3
- package/slider/Slider.test.js +1 -1
- package/slider/types.d.ts +2 -2
- package/spinner/Spinner.js +15 -21
- package/spinner/Spinner.stories.jsx +28 -28
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.js +2 -2
- package/switch/Switch.test.js +1 -1
- package/switch/types.d.ts +2 -2
- package/table/Table.js +2 -2
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +9 -10
- package/tabs/Tabs.js +11 -17
- package/tabs/Tabs.test.js +4 -5
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.js +7 -9
- package/tag/Tag.test.js +1 -1
- package/text-input/Suggestion.js +2 -2
- package/text-input/TextInput.js +3 -3
- package/text-input/TextInput.test.js +1 -2
- package/textarea/Textarea.js +3 -4
- package/textarea/Textarea.test.js +2 -4
- package/toggle-group/ToggleGroup.js +7 -4
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +14 -113
- package/typography/Typography.stories.tsx +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +1 -1
- package/useTranslatedLabels.d.ts +84 -1
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.js +1 -1
- package/wizard/Wizard.js +2 -2
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +5 -6
|
@@ -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.GridItem placeSelf="center">
|
|
60
|
+
<ColoredContainer height="50px" width="50px" />
|
|
61
|
+
</DxcGrid.GridItem>
|
|
62
|
+
<DxcGrid.GridItem placeSelf={{ alignSelf: "end" }}>
|
|
63
|
+
<ColoredContainer height="40px" width="40px" />
|
|
64
|
+
<ColoredContainer height="30px" width="30px" />
|
|
65
|
+
</DxcGrid.GridItem>
|
|
66
|
+
<DxcGrid.GridItem placeSelf={{ alignSelf: "center", justifySelf: "end" }}>
|
|
67
|
+
<ColoredContainer height="50px" width="50px" />
|
|
68
|
+
</DxcGrid.GridItem>
|
|
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.GridItem areaName="header" as="header">
|
|
80
|
+
<ColoredContainer height="100%" />
|
|
81
|
+
</DxcGrid.GridItem>
|
|
82
|
+
<DxcGrid.GridItem areaName="main" as="main">
|
|
83
|
+
<ColoredContainer height="100%" />
|
|
84
|
+
</DxcGrid.GridItem>
|
|
85
|
+
<DxcGrid.GridItem areaName="sidenav" as="nav">
|
|
86
|
+
<ColoredContainer height="100%" />
|
|
87
|
+
</DxcGrid.GridItem>
|
|
88
|
+
<DxcGrid.GridItem areaName="footer" as="footer">
|
|
89
|
+
<ColoredContainer height="100%" />
|
|
90
|
+
</DxcGrid.GridItem>
|
|
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.GridItem column={{ start: 1, end: -1 }}>
|
|
97
|
+
<ColoredContainer color="yellow" height="100%">
|
|
98
|
+
Header
|
|
99
|
+
</ColoredContainer>
|
|
100
|
+
</DxcGrid.GridItem>
|
|
101
|
+
<DxcGrid.GridItem column={1}>
|
|
102
|
+
<ColoredContainer color="lightcyan" height="100%">
|
|
103
|
+
Sidenav
|
|
104
|
+
</ColoredContainer>
|
|
105
|
+
</DxcGrid.GridItem>
|
|
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.GridItem column={{ start: 1, end: -1 }}>
|
|
122
|
+
<ColoredContainer color="black" height="100%">
|
|
123
|
+
Footer
|
|
124
|
+
</ColoredContainer>
|
|
125
|
+
</DxcGrid.GridItem>
|
|
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.GridItem>
|
|
145
|
+
<ColoredContainer height="50px">1</ColoredContainer>
|
|
146
|
+
</DxcGrid.GridItem>
|
|
147
|
+
<DxcGrid.GridItem row={2}>
|
|
148
|
+
<ColoredContainer height="50px">3</ColoredContainer>
|
|
149
|
+
</DxcGrid.GridItem>
|
|
150
|
+
<DxcGrid.GridItem row={6} column={1}>
|
|
151
|
+
<ColoredContainer height="50px">5</ColoredContainer>
|
|
152
|
+
</DxcGrid.GridItem>
|
|
153
|
+
<DxcGrid.GridItem row={3}>
|
|
154
|
+
<ColoredContainer height="50px">4</ColoredContainer>
|
|
155
|
+
</DxcGrid.GridItem>
|
|
156
|
+
<DxcGrid.GridItem row={{ start: 1, end: 2 }} column={{ start: 5, end: "span 2" }}>
|
|
157
|
+
<ColoredContainer height="50px">2</ColoredContainer>
|
|
158
|
+
</DxcGrid.GridItem>
|
|
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.GridItem row={{ start: 1, end: "span 2" }} column={1}>
|
|
165
|
+
<ColoredContainer height="100%">1</ColoredContainer>
|
|
166
|
+
</DxcGrid.GridItem>
|
|
167
|
+
<ColoredContainer color="lightyellow">2</ColoredContainer>
|
|
168
|
+
<ColoredContainer color="lightcyan">3</ColoredContainer>
|
|
169
|
+
<ColoredContainer color="lightgreen">4</ColoredContainer>
|
|
170
|
+
<DxcGrid.GridItem row={{ start: 1, end: -1 }} column={-2}>
|
|
171
|
+
<ColoredContainer color="lightpink" height="100%">
|
|
172
|
+
5
|
|
173
|
+
</ColoredContainer>
|
|
174
|
+
</DxcGrid.GridItem>
|
|
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.GridItem row={{ start: 1, end: -1 }} column={1}>
|
|
181
|
+
<ColoredContainer height="100%">1</ColoredContainer>
|
|
182
|
+
</DxcGrid.GridItem>
|
|
183
|
+
<ColoredContainer color="lightyellow">2</ColoredContainer>
|
|
184
|
+
<ColoredContainer color="lightcyan">3</ColoredContainer>
|
|
185
|
+
<ColoredContainer color="lightgreen">4</ColoredContainer>
|
|
186
|
+
<DxcGrid.GridItem row={{ start: 1, end: -1 }} column={-2}>
|
|
187
|
+
<ColoredContainer color="lightpink" height="100%">
|
|
188
|
+
5
|
|
189
|
+
</ColoredContainer>
|
|
190
|
+
</DxcGrid.GridItem>
|
|
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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcDropdown from "../dropdown/Dropdown";
|
|
2
3
|
import HeaderPropsType from "./types";
|
|
3
4
|
declare const DxcHeader: {
|
|
4
5
|
({ underlined, content, responsiveContent, onClick, margin, padding, tabIndex, }: HeaderPropsType): JSX.Element;
|
|
5
|
-
Dropdown: (props:
|
|
6
|
+
Dropdown: (props: React.ComponentProps<typeof DxcDropdown>) => JSX.Element;
|
|
6
7
|
};
|
|
7
8
|
export default DxcHeader;
|
package/header/Header.js
CHANGED
|
@@ -23,7 +23,7 @@ var _Dropdown = _interopRequireDefault(require("../dropdown/Dropdown"));
|
|
|
23
23
|
|
|
24
24
|
var _Icons = require("./Icons");
|
|
25
25
|
|
|
26
|
-
var _variables = require("../common/variables
|
|
26
|
+
var _variables = require("../common/variables");
|
|
27
27
|
|
|
28
28
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
29
|
|
|
@@ -257,7 +257,7 @@ var HamburguerTrigger = _styledComponents["default"].button(_templateObject8 ||
|
|
|
257
257
|
|
|
258
258
|
var MainContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-grow: 1;\n"])));
|
|
259
259
|
|
|
260
|
-
var ResponsiveMenu = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n position: fixed;\n top: 0;\n right: 0;\n z-index: ", ";\n\n @media (max-width: ", "rem) and (min-width: ", "rem) {\n
|
|
260
|
+
var ResponsiveMenu = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n position: fixed;\n top: 0;\n right: 0;\n z-index: ", ";\n\n @media (max-width: ", "rem) and (min-width: ", "rem) {\n width: ", ";\n }\n\n @media (not((max-width: ", "rem) and (min-width: ", "rem))) {\n width: ", ";\n }\n\n height: 100vh;\n padding: 20px;\n transform: ", ";\n opacity: ", ";\n transition-property: transform, opacity;\n transition-duration: 0.6s;\n transition-timing-function: ease-in-out;\n box-sizing: border-box;\n"])), function (props) {
|
|
261
261
|
return props.theme.menuBackgroundColor;
|
|
262
262
|
}, function (props) {
|
|
263
263
|
return props.theme.menuZindex;
|
|
@@ -287,7 +287,7 @@ var MenuContent = _styledComponents["default"].div(_templateObject14 || (_templa
|
|
|
287
287
|
return props.backgroundType === "dark" ? props.theme.contentColorOnDark : props.theme.contentColor;
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
var Overlay = _styledComponents["default"].div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: ", ";\n opacity: ", " !important;\n visibility: ", ";\n opacity: ", ";\n\n @media (max-width: ", "rem) {\n
|
|
290
|
+
var Overlay = _styledComponents["default"].div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: ", ";\n opacity: ", " !important;\n visibility: ", ";\n opacity: ", ";\n\n @media (max-width: ", "rem) {\n display: none;\n }\n\n transition: opacity 0.2s 0.2s ease-in-out;\n z-index: ", ";\n"])), function (props) {
|
|
291
291
|
return props.theme.overlayColor;
|
|
292
292
|
}, function (props) {
|
|
293
293
|
return props.theme.overlayOpacity;
|
package/header/Header.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Header = _interopRequireDefault(require("./Header"));
|
|
9
|
+
var _Header = _interopRequireDefault(require("./Header.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Header component tests", function () {
|
|
12
12
|
beforeAll(function () {
|
|
@@ -68,7 +68,7 @@ describe("Header component tests", function () {
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
71
|
-
responsiveContent: function responsiveContent(
|
|
71
|
+
responsiveContent: function responsiveContent() {
|
|
72
72
|
return /*#__PURE__*/_react["default"].createElement("p", null, "header-child-text");
|
|
73
73
|
}
|
|
74
74
|
})),
|
package/header/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Padding = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
package/heading/Heading.js
CHANGED
|
@@ -17,7 +17,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
20
|
-
var _variables = require("../common/variables
|
|
20
|
+
var _variables = require("../common/variables");
|
|
21
21
|
|
|
22
22
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
package/heading/Heading.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Heading = _interopRequireDefault(require("./Heading"));
|
|
9
|
+
var _Heading = _interopRequireDefault(require("./Heading.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Heading component tests", function () {
|
|
12
12
|
test("Heading renders with default level", function () {
|
package/inset/Inset.stories.tsx
CHANGED
|
@@ -4,14 +4,14 @@ declare const DxcApplicationLayout: {
|
|
|
4
4
|
({ visibilityToggleLabel, header, sidenav, footer, children, }: AppLayoutPropsType): JSX.Element;
|
|
5
5
|
Header: {
|
|
6
6
|
({ underlined, content, responsiveContent, onClick, margin, padding, tabIndex, }: import("../header/types").default): JSX.Element;
|
|
7
|
-
Dropdown: (props:
|
|
7
|
+
Dropdown: (props: import("../dropdown/types").default) => JSX.Element;
|
|
8
8
|
};
|
|
9
9
|
Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
|
|
10
10
|
Footer: ({ socialLinks, bottomLinks, copyright, children, padding, 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
|
};
|
|
@@ -23,7 +23,7 @@ var _Sidenav = _interopRequireDefault(require("../sidenav/Sidenav"));
|
|
|
23
23
|
|
|
24
24
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
25
25
|
|
|
26
|
-
var _variables = require("../common/variables
|
|
26
|
+
var _variables = require("../common/variables");
|
|
27
27
|
|
|
28
28
|
var _Icons = require("./Icons");
|
|
29
29
|
|
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;
|
package/link/Link.js
CHANGED
|
@@ -21,7 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
|
-
var _variables = require("../common/variables
|
|
24
|
+
var _variables = require("../common/variables");
|
|
25
25
|
|
|
26
26
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
27
27
|
|
|
@@ -82,7 +82,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
82
82
|
})));
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n
|
|
85
|
+
var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n ", "\n ", "\n color: ", ";\n ", "\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
86
86
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
87
87
|
}, function (props) {
|
|
88
88
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
package/link/Link.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Link = _interopRequireDefault(require("./Link"));
|
|
9
|
+
var _Link = _interopRequireDefault(require("./Link.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Link component tests", function () {
|
|
12
12
|
test("Link renders with correct text", function () {
|
|
@@ -33,9 +33,7 @@ describe("Link component tests", function () {
|
|
|
33
33
|
expect(getByText("Link").hasAttribute("href")).toBeFalsy();
|
|
34
34
|
|
|
35
35
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
36
|
-
onClick: function onClick() {
|
|
37
|
-
return console.log("Andorra");
|
|
38
|
-
},
|
|
36
|
+
onClick: function onClick() {},
|
|
39
37
|
disabled: true
|
|
40
38
|
}, "LinkButton")),
|
|
41
39
|
getByTextLinkButton = _render4.getByText;
|
package/link/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
package/main.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import DxcFlex from "./flex/Flex";
|
|
|
39
39
|
import DxcTypography from "./typography/Typography";
|
|
40
40
|
import DxcParagraph from "./paragraph/Paragraph";
|
|
41
41
|
import DxcBulletedList from "./bulleted-list/BulletedList";
|
|
42
|
+
import DxcGrid from "./grid/Grid";
|
|
42
43
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
43
44
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
44
|
-
export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, };
|
|
45
|
+
export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, DxcGrid, };
|
package/main.js
CHANGED
|
@@ -115,6 +115,12 @@ Object.defineProperty(exports, "DxcFlex", {
|
|
|
115
115
|
return _Flex["default"];
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
+
Object.defineProperty(exports, "DxcGrid", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function get() {
|
|
121
|
+
return _Grid["default"];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
118
124
|
Object.defineProperty(exports, "DxcHeading", {
|
|
119
125
|
enumerable: true,
|
|
120
126
|
get: function get() {
|
|
@@ -360,6 +366,8 @@ var _Paragraph = _interopRequireDefault(require("./paragraph/Paragraph"));
|
|
|
360
366
|
|
|
361
367
|
var _BulletedList = _interopRequireDefault(require("./bulleted-list/BulletedList"));
|
|
362
368
|
|
|
369
|
+
var _Grid = _interopRequireDefault(require("./grid/Grid"));
|
|
370
|
+
|
|
363
371
|
var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
|
|
364
372
|
|
|
365
373
|
var _BackgroundColorContext = require("./BackgroundColorContext");
|
package/nav-tabs/NavTabs.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _NavTabs = _interopRequireDefault(require("./NavTabs"));
|
|
9
|
+
var _NavTabs = _interopRequireDefault(require("./NavTabs.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Tabs component tests", function () {
|
|
12
12
|
test("Tabs render with correct labels and attributes", function () {
|
package/nav-tabs/Tab.js
CHANGED
|
@@ -23,7 +23,7 @@ var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
|
23
23
|
|
|
24
24
|
var _NavTabs = require("./NavTabs");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _BaseTypography = _interopRequireDefault(require("../utils/BaseTypography"));
|
|
27
27
|
|
|
28
28
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
29
|
|
|
@@ -99,7 +99,7 @@ var DxcTab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, _ref2) {
|
|
|
99
99
|
iconPosition: iconPosition
|
|
100
100
|
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
101
101
|
src: icon
|
|
102
|
-
}) : icon), /*#__PURE__*/_react["default"].createElement(LabelContainer, null, /*#__PURE__*/_react["default"].createElement(
|
|
102
|
+
}) : icon), /*#__PURE__*/_react["default"].createElement(LabelContainer, null, /*#__PURE__*/_react["default"].createElement(_BaseTypography["default"], {
|
|
103
103
|
color: disabled ? colorsTheme.navTabs.disabledFontColor : active ? colorsTheme.navTabs.selectedFontColor : colorsTheme.navTabs.unselectedFontColor,
|
|
104
104
|
fontFamily: colorsTheme.navTabs.fontFamily,
|
|
105
105
|
fontSize: colorsTheme.navTabs.fontSize,
|
|
@@ -109,7 +109,7 @@ var DxcTab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, _ref2) {
|
|
|
109
109
|
letterSpacing: "0.025em",
|
|
110
110
|
lineHeight: "1.715em"
|
|
111
111
|
}, children), notificationNumber && /*#__PURE__*/_react["default"].createElement(BadgeContainer, null, /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
|
|
112
|
-
notificationText: notificationNumber > 99 ? "+99" : notificationNumber,
|
|
112
|
+
notificationText: typeof notificationNumber === "number" && notificationNumber > 99 ? "+99" : notificationNumber,
|
|
113
113
|
disabled: disabled
|
|
114
114
|
})))));
|
|
115
115
|
});
|
|
@@ -124,16 +124,16 @@ var TabContainer = _styledComponents["default"].div(_templateObject || (_templat
|
|
|
124
124
|
return props.theme.disabledIconColor;
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
var Tab = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: center;\n align-items: center;\n
|
|
127
|
+
var Tab = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: center;\n align-items: center;\n height: ", ";\n min-width: 164px;\n margin: 0.5rem;\n padding: 0.375rem;\n border-radius: 4px;\n background: ", ";\n text-decoration-color: transparent;\n cursor: ", ";\n\n ", "\n"])), function (props) {
|
|
128
128
|
return props.hasIcon && props.iconPosition === "top" ? "column" : "row";
|
|
129
129
|
}, function (props) {
|
|
130
|
-
return props.
|
|
130
|
+
return props.hasIcon && props.iconPosition === "top" ? "66px" : "32px";
|
|
131
131
|
}, function (props) {
|
|
132
132
|
return props.active ? props.theme.selectedBackgroundColor : props.theme.unselectedBackgroundColor;
|
|
133
133
|
}, function (props) {
|
|
134
|
-
return props.
|
|
134
|
+
return props.disabled ? "not-allowed" : "pointer";
|
|
135
135
|
}, function (props) {
|
|
136
|
-
return !props.disabled && ":hover {\n
|
|
136
|
+
return !props.disabled && "\n :hover {\n background: ".concat(props.theme.hoverBackgroundColor, ";\n }\n :focus {\n outline: 2px solid ").concat(props.theme.focusOutline, ";\n }\n :active {\n background: ").concat(props.theme.pressedBackgroundColor, ";\n outline: 2px solid #33aaff};\n }\n ");
|
|
137
137
|
});
|
|
138
138
|
|
|
139
139
|
var TabIconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-bottom: ", ";\n margin-right: ", ";\n\n img,\n svg {\n height: 24px;\n width: 24px;\n }\n"])), function (props) {
|
|
@@ -8,7 +8,7 @@ var _react2 = require("@testing-library/react");
|
|
|
8
8
|
|
|
9
9
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
10
10
|
|
|
11
|
-
var _NumberInput = _interopRequireDefault(require("./NumberInput"));
|
|
11
|
+
var _NumberInput = _interopRequireDefault(require("./NumberInput.tsx"));
|
|
12
12
|
|
|
13
13
|
describe("Number input component tests", function () {
|
|
14
14
|
test("Number input renders with label", function () {
|