@dxc-technology/halstack-react 0.0.0-b92e300 → 0.0.0-b9523dd
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/accordion/types.d.ts +1 -1
- package/accordion-group/types.d.ts +1 -1
- package/box/Box.stories.jsx +132 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -12
- package/button/Button.stories.tsx +1 -1
- package/button/types.d.ts +10 -10
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +4 -23
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +7 -40
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +4 -35
- package/footer/Footer.stories.jsx +151 -0
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +26 -28
- package/header/Icons.js +2 -27
- package/header/types.d.ts +45 -0
- package/header/types.js +5 -0
- package/number-input/NumberInput.stories.jsx +115 -0
- package/package.json +1 -1
- package/paginator/Paginator.stories.tsx +63 -0
- package/password-input/PasswordInput.stories.jsx +1 -1
- package/progress-bar/ProgressBar.js +1 -1
- package/radio/Radio.stories.tsx +192 -0
- package/select/index.d.ts +2 -2
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +6 -23
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +5 -53
- package/tabs/types.d.ts +71 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.js +17 -11
- package/tag/Tag.stories.jsx +145 -0
- package/text-input/index.d.ts +2 -2
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/spinner/index.d.ts +0 -17
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import DxcTag from "./Tag";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Tag",
|
|
9
|
+
component: DxcTag,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const icon = () => {
|
|
13
|
+
return (
|
|
14
|
+
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
15
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
16
|
+
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
const largeIcon = () => {
|
|
21
|
+
return (
|
|
22
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
|
|
23
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
24
|
+
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
|
|
25
|
+
</svg>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Chromatic = () => (
|
|
30
|
+
<>
|
|
31
|
+
<ExampleContainer>
|
|
32
|
+
<Title title="Without label" theme="light" level={4} />
|
|
33
|
+
<DxcTag />
|
|
34
|
+
</ExampleContainer>
|
|
35
|
+
<ExampleContainer>
|
|
36
|
+
<Title title="With icon" theme="light" level={4} />
|
|
37
|
+
<DxcTag icon={icon} />
|
|
38
|
+
</ExampleContainer>
|
|
39
|
+
<ExampleContainer>
|
|
40
|
+
<Title title="With large icon" theme="light" level={4} />
|
|
41
|
+
<DxcTag icon={largeIcon} />
|
|
42
|
+
</ExampleContainer>
|
|
43
|
+
<ExampleContainer>
|
|
44
|
+
<Title title="With label" theme="light" level={4} />
|
|
45
|
+
<DxcTag label="Tag" />
|
|
46
|
+
</ExampleContainer>
|
|
47
|
+
<ExampleContainer>
|
|
48
|
+
<Title title="With label and icon" theme="light" level={4} />
|
|
49
|
+
<DxcTag label="Tag" icon={icon} />
|
|
50
|
+
</ExampleContainer>
|
|
51
|
+
<ExampleContainer>
|
|
52
|
+
<Title title="With right icon" theme="light" level={4} />
|
|
53
|
+
<DxcTag label="Tag" icon={icon} labelPosition="before" />
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<ExampleContainer>
|
|
56
|
+
<Title title="Icon background color" theme="light" level={4} />
|
|
57
|
+
<DxcTag label="Tag" icon={icon} iconBgColor="#fabada" />
|
|
58
|
+
</ExampleContainer>
|
|
59
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
60
|
+
<Title title="With link focused" theme="light" level={4} />
|
|
61
|
+
<DxcTag icon={icon} label="Tag" linkHref="https://www.dxc.com" />
|
|
62
|
+
</ExampleContainer>
|
|
63
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
64
|
+
<Title title="With action focused" theme="light" level={4} />
|
|
65
|
+
<DxcTag
|
|
66
|
+
icon={icon}
|
|
67
|
+
label="Tag"
|
|
68
|
+
onClick={() => {
|
|
69
|
+
console.log("click");
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
</ExampleContainer>
|
|
73
|
+
<Title title="Margins" theme="light" level={2} />
|
|
74
|
+
<ExampleContainer>
|
|
75
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
76
|
+
<DxcTag label="Xxsmall" margin="xxsmall" />
|
|
77
|
+
</ExampleContainer>
|
|
78
|
+
<ExampleContainer>
|
|
79
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
80
|
+
<DxcTag label="Xsmall" margin="xsmall" />
|
|
81
|
+
</ExampleContainer>
|
|
82
|
+
<ExampleContainer>
|
|
83
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
84
|
+
<DxcTag label="Small" margin="small" />
|
|
85
|
+
</ExampleContainer>
|
|
86
|
+
<ExampleContainer>
|
|
87
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
88
|
+
<DxcTag label="Medium" margin="medium" />
|
|
89
|
+
</ExampleContainer>
|
|
90
|
+
<ExampleContainer>
|
|
91
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
92
|
+
<DxcTag label="Large" margin="large" />
|
|
93
|
+
</ExampleContainer>
|
|
94
|
+
<ExampleContainer>
|
|
95
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
96
|
+
<DxcTag label="Xlarge" margin="xlarge" />
|
|
97
|
+
</ExampleContainer>
|
|
98
|
+
<ExampleContainer>
|
|
99
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
100
|
+
<DxcTag label="Xxlarge" margin="xxlarge" />
|
|
101
|
+
</ExampleContainer>
|
|
102
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
103
|
+
<ExampleContainer>
|
|
104
|
+
<Title title="Small size" theme="light" level={4} />
|
|
105
|
+
<DxcTag label="Small" size="small" />
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<ExampleContainer>
|
|
108
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
109
|
+
<DxcTag label="Medium size medium s" size="medium" />
|
|
110
|
+
</ExampleContainer>
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Medium size with ellipsis" theme="light" level={4} />
|
|
113
|
+
<DxcTag label="Medium size medium si medium" size="medium" />
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Large size" theme="light" level={4} />
|
|
117
|
+
<DxcTag label="Large size large size large size large size large size" size="large" />
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer>
|
|
120
|
+
<Title title="Large size with ellipsis" theme="light" level={4} />
|
|
121
|
+
<DxcTag label="Large size large size large size large size large size large size" size="large" />
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="FillParent size" theme="light" level={4} />
|
|
125
|
+
<DxcTag label="FillParent" size="fillParent" />
|
|
126
|
+
</ExampleContainer>
|
|
127
|
+
<ExampleContainer>
|
|
128
|
+
<Title title="FitContent size" theme="light" level={4} />
|
|
129
|
+
<DxcTag label="FitContent" size="fitContent" />
|
|
130
|
+
</ExampleContainer>
|
|
131
|
+
</>
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const LinkTag = () => (
|
|
135
|
+
<ExampleContainer>
|
|
136
|
+
<Title title="Hover link tag" theme="light" level={4} />
|
|
137
|
+
<DxcTag label="Tag" icon={icon} linkHref="https://www.dxc.com" />
|
|
138
|
+
</ExampleContainer>
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
export const HoverLinkTag = LinkTag.bind({});
|
|
142
|
+
HoverLinkTag.play = async ({ canvasElement }) => {
|
|
143
|
+
const canvas = within(canvasElement);
|
|
144
|
+
await userEvent.hover(canvas.getByText("Tag"));
|
|
145
|
+
};
|
package/text-input/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
type SVG =
|
|
9
|
+
type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
10
10
|
type Action = {
|
|
11
11
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
-
icon: SVG;
|
|
12
|
+
icon: string | SVG;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
type Props = {
|
package/dialog/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Padding = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
isCloseVisible?: boolean;
|
|
11
|
-
onCloseClick?: void;
|
|
12
|
-
overlay?: boolean;
|
|
13
|
-
onBackgroundClick?: void;
|
|
14
|
-
padding?: Padding,
|
|
15
|
-
tabIndex?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default function DxcDialog(props: Props): JSX.Element;
|
package/dropdown/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
options?: any;
|
|
12
|
-
optionsIconPosition?: "before" | "after";
|
|
13
|
-
icon?: any;
|
|
14
|
-
iconSrc?: string;
|
|
15
|
-
iconPosition?: "before" | "after";
|
|
16
|
-
label?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
caretHidden?: boolean;
|
|
19
|
-
onSelectOption?: void;
|
|
20
|
-
expandOnHover?: boolean;
|
|
21
|
-
margin?: Space | Margin;
|
|
22
|
-
size?: Size;
|
|
23
|
-
tabIndex?: number;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default function DxcDropdown(props: Props): JSX.Element;
|
package/footer/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
type Padding = {
|
|
9
|
-
top?: Space;
|
|
10
|
-
bottom?: Space;
|
|
11
|
-
left?: Space;
|
|
12
|
-
right?: Space;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type Props = {
|
|
16
|
-
socialLinks?: any;
|
|
17
|
-
bottomLinks?: any;
|
|
18
|
-
copyright?: string;
|
|
19
|
-
padding?: Space | Padding;
|
|
20
|
-
margin?: Space | Margin;
|
|
21
|
-
tabIndex?: number;
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function DxcFooter(props: Props): JSX.Element;
|
package/header/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
type Padding = {
|
|
9
|
-
top?: Space;
|
|
10
|
-
bottom?: Space;
|
|
11
|
-
left?: Space;
|
|
12
|
-
right?: Space;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type Props = {
|
|
16
|
-
underlined?: boolean;
|
|
17
|
-
onClick?: void;
|
|
18
|
-
content?: any;
|
|
19
|
-
responsiveContent?: any;
|
|
20
|
-
margin?: Space | Margin;
|
|
21
|
-
padding?: Space | Padding;
|
|
22
|
-
tabIndex?: number;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function DxcHeader(props: Props): JSX.Element;
|
package/spinner/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
label?: string;
|
|
11
|
-
value?: number;
|
|
12
|
-
showValue?: boolean;
|
|
13
|
-
mode?: "large" | "small" | "overlay";
|
|
14
|
-
margin?: Space | Margin;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default function DxcSpinner(props: Props): JSX.Element;
|
package/table/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
margin?: Space | Margin;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default function DxcTable(props: Props): JSX.Element;
|
package/tabs/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
activeTabIndex?: number;
|
|
11
|
-
tabs?: any;
|
|
12
|
-
onTabClick?: void;
|
|
13
|
-
onTabHover?: void;
|
|
14
|
-
iconPosition?: "top" | "left";
|
|
15
|
-
margin?: Space | Margin;
|
|
16
|
-
tabIndex?: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default function DxcTabs(props: Props): JSX.Element;
|