Skip to content

Commit b7a7d72

Browse files
authored
Merge pull request #1715 from dxc-technology/gomezivann/new-props-table
New Props table design
2 parents 86fdd0e + 31f4919 commit b7a7d72

File tree

78 files changed

+3867
-1870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3867
-1870
lines changed

lib/src/accordion/Accordion.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import DxcAccordion from "./Accordion";
3-
import DxcHeading from "../heading/Heading";
43
import DxcTextInput from "../text-input/TextInput";
54
import DxcButton from "../button/Button";
65
import Title from "../../.storybook/components/Title";

lib/src/accordion/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Props = {
5050
*/
5151
margin?: Space | Margin;
5252
/**
53-
* Value of the tabindex.
53+
* Value of the tabindex attribute.
5454
*/
5555
tabIndex?: number;
5656
};

lib/src/alert/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ type Props = {
1313
type?: "info" | "confirm" | "warning" | "error";
1414
/**
1515
* Uses on of the available alert modes:
16-
* 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
16+
* 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
1717
* There is no overlay layer. Position should be decided by the user.
18-
* 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
18+
* 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
1919
* The onClose function will be executed when the X button or the overlay is clicked. d
20-
* The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
20+
* The user has the responsibility of hiding the modal in the onClose function, otherwise the modal will remain visible.
2121
*/
2222
mode?: "inline" | "modal";
2323
/**
@@ -33,7 +33,7 @@ type Props = {
3333
*/
3434
children?: React.ReactNode;
3535
/**
36-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
36+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
3737
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
3838
*/
3939
margin?: Space | Margin;
@@ -42,7 +42,7 @@ type Props = {
4242
*/
4343
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
4444
/**
45-
* Tabindex value given to the close button.
45+
* Value of the tabindex attribute applied to the close button.
4646
*/
4747
tabIndex?: number;
4848
};

lib/src/card/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ type Props = {
4747
*/
4848
margin?: Space | Size;
4949
/**
50-
* Value of the tabindex given when there is an href.
50+
* Value of the tabindex attribute applied when the component is clickable.
5151
*/
5252
tabIndex?: number;
5353
/**
5454
* Determines whether or not the component should have an outline.
5555
*/
5656
outlined?: boolean;
5757
/**
58-
* Custom content that will be placed in the card component.
58+
* Custom content that will be placed inside the component.
5959
*/
6060
children?: React.ReactNode;
6161
};

lib/src/date-input/types.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ type Margin = {
99
};
1010

1111
type Props = {
12-
/**
13-
* Text to be placed above the date.
14-
*/
15-
label?: string;
16-
/**
17-
* Name attribute of the input element.
18-
*/
19-
name?: string;
2012
/**
2113
* Initial value of the input element, only when it is uncontrolled.
2214
*/
@@ -26,9 +18,13 @@ type Props = {
2618
*/
2719
value?: string;
2820
/**
29-
* The format in which the date value will be displayed. User must use this format when editing the value or it will be considered as an invalid date.
21+
* Text to be placed above the date input.
3022
*/
31-
format?: string;
23+
label?: string;
24+
/**
25+
* Name attribute of the input element.
26+
*/
27+
name?: string;
3228
/**
3329
* Helper text to be placed above the date.
3430
*/
@@ -37,6 +33,10 @@ type Props = {
3733
* If true, the date format will appear as placeholder in the field.
3834
*/
3935
placeholder?: boolean;
36+
/**
37+
* The format in which the date value will be displayed. User must use this format when editing the value or it will be considered as an invalid date.
38+
*/
39+
format?: string;
4040
/**
4141
* If true, the date input will have an action to clear the entered value.
4242
*/
@@ -46,18 +46,18 @@ type Props = {
4646
*/
4747
disabled?: boolean;
4848
/**
49-
* If true, the component will not be mutable, meaning the user can not edit the control.
50-
* The date picker cannot be opened either. In addition, the clear action will not be displayed
51-
* even if the flag is set to true.
52-
*/
53-
readOnly?: boolean;
54-
/**
55-
* If true, the date will be optional, showing '(Optional)'
49+
* If true, the date will be optional, showing the text '(Optional)'
5650
* next to the label. Otherwise, the field will be considered required and an error will be
5751
* passed as a parameter to the OnBlur and onChange functions when it has
5852
* not been filled.
5953
*/
6054
optional?: boolean;
55+
/**
56+
* If true, the component will not be mutable, meaning the user can not edit the control.
57+
* The date picker cannot be opened either. In addition, the clear action will not be displayed
58+
* even if the flag is set to true.
59+
*/
60+
readOnly?: boolean;
6161
/**
6262
* This function will be called when the user types within the input
6363
* element of the component. An object including the string value, the
@@ -127,15 +127,15 @@ export type CalendarPropsType = {
127127
*/
128128
innerDate: Dayjs;
129129
/**
130-
* Function called when the date showned needs to be updated
130+
* Function called when the showed date needs to be updated.
131131
*/
132132
onInnerDateChange: (date: Dayjs) => void;
133133
/**
134134
* Function called when a date is selected.
135135
*/
136136
onDaySelect: (date: Dayjs) => void;
137137
/**
138-
* Current date
138+
* Current date.
139139
*/
140140
today: Dayjs;
141141
};
@@ -150,7 +150,7 @@ export type YearPickerPropsType = {
150150
*/
151151
onYearSelect: (year: number) => void;
152152
/**
153-
* Current date
153+
* Current date.
154154
*/
155155
today: Dayjs;
156156
};

lib/src/dialog/types.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
type Props = {
22
/**
3-
* If true, the close 'x' button will be visible.
3+
* If true, the close button will be visible.
44
*/
55
isCloseVisible?: boolean;
66
/**
7-
* This function will be called when the user clicks the close 'x' button.
8-
* The responsibility of hiding the modal lies with the user.
7+
* This function will be called when the user clicks the close button.
8+
* The responsibility of hiding the dialog lies with the user.
99
*/
1010
onCloseClick?: () => void;
11+
/**
12+
* This function will be called when the user clicks on the background of the modal.
13+
* The responsibility of hiding the dialog lies with the user.
14+
*/
15+
onBackgroundClick?: () => void;
1116
/**
1217
* If true, the dialog will be displayed over a darker background that covers the content behind.
1318
*/
1419
overlay?: boolean;
1520
/**
16-
* This function will be called when the user clicks background of the modal.
17-
* The responsibility of hiding the modal lies with the user.
21+
* Area within the dialog that can be used to render custom content.
22+
* We strongly encourage users to not change the
23+
* tabindex of the inner components or elements. This
24+
* can lead to unpredictable behaviour for keyboard users, affecting
25+
* the order of focus and focus locking within the dialog.
1826
*/
19-
onBackgroundClick?: () => void;
27+
children: React.ReactNode;
2028
/**
21-
* Value of the tabindex given to the close 'x' button.
29+
* Value of the tabindex applied to the close button.
30+
* Note that values greater than 0 are strongly discouraged. It can
31+
* lead to unexpected behaviours with the focus within the dialog.
2232
*/
2333
tabIndex?: number;
24-
/**
25-
* The area inside the dialog. This area can be used to render
26-
* custom content.
27-
*/
28-
children: React.ReactNode;
2934
};
3035

3136
export default Props;

lib/src/dropdown/types.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ type Props = {
5252
*/
5353
caretHidden?: boolean;
5454
/**
55-
* This function will be called every time the selection changes.
56-
* The value of the selected option will be passed as a parameter.
55+
* If true, the component will be disabled.
5756
*/
58-
onSelectOption: (value: string) => void;
57+
disabled?: boolean;
5958
/**
6059
* If true, the options are showed when the dropdown is hover.
6160
*/
6261
expandOnHover?: boolean;
62+
/**
63+
* This function will be called every time the selection changes.
64+
* The value of the selected option will be passed as a parameter.
65+
*/
66+
onSelectOption: (value: string) => void;
6367
/**
6468
* Size of the margin to be applied to the component.
6569
* You can pass an object with 'top', 'bottom', 'left' and 'right'
@@ -71,13 +75,9 @@ type Props = {
7175
*/
7276
size?: Size;
7377
/**
74-
* Value of the tabindex.
78+
* Value of the tabindex attribute.
7579
*/
7680
tabIndex?: number;
77-
/**
78-
* If true, the component will be disabled.
79-
*/
80-
disabled?: boolean;
8181
};
8282

8383
export type DropdownMenuProps = {

lib/src/flex/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type Spaces = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
2-
type Gap = { rowGap: Spaces; columnGap?: Spaces } | { rowGap?: Spaces; columnGap?: Spaces } | Spaces;
2+
type Gap = { rowGap: Spaces; columnGap?: Spaces } | { rowGap?: Spaces; columnGap: Spaces } | Spaces;
33

44
type CommonProps = {
55
/**

lib/src/footer/types.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,24 @@ type FooterPropsType = {
4444
* the bottom part of the footer.
4545
*/
4646
bottomLinks?: BottomLink[];
47+
/**
48+
* The text that will be displayed as copyright disclaimer.
49+
*/
50+
copyright?: string;
4751
/**
4852
* The center section of the footer. Can be used to render custom
4953
* content in this area.
5054
*/
5155
children?: React.ReactNode;
5256
/**
53-
* The text that will be displayed as copyright disclaimer.
57+
* Size of the top margin to be applied to the footer.
5458
*/
55-
copyright?: string;
59+
margin?: Space | Size;
5660
/**
57-
* Value of the tabindex for all interactuable elements, except those
61+
* Value of the tabindex for all interactive elements, except those
5862
* inside the custom area.
5963
*/
6064
tabIndex?: number;
61-
/**
62-
* Size of the top margin to be applied to the footer.
63-
*/
64-
margin?: Space | Size;
6565
};
6666

6767
export default FooterPropsType;

lib/src/header/types.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2-
31
type Props = {
42
/**
5-
* Wether a contrast line should appear at the bottom of the header.
3+
* Whether a contrast line should appear at the bottom of the header.
64
*/
75
underlined?: boolean;
86
/**
@@ -21,12 +19,11 @@ type Props = {
2119
*/
2220
onClick?: () => void;
2321
/**
24-
* Size of the bottom margin to be applied to the header
25-
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
22+
* Size of the bottom margin to be applied to the header.
2623
*/
27-
margin?: Space;
24+
margin?: "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2825
/**
29-
* Value of the tabindex for all interactuable elements, except those inside the
26+
* Value of the tabindex for all interactive elements, except those inside the
3027
* custom area.
3128
*/
3229
tabIndex?: number;

0 commit comments

Comments
 (0)