Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Props table design #1715

Merged
merged 38 commits into from Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
89b11a8
Updated Props table in Image and Checkbox
GomezIvann Oct 10, 2023
9467b2a
Accordion and Accordion Group props table updated
GomezIvann Oct 10, 2023
c1e088d
Alert and App Layout props table updated
GomezIvann Oct 10, 2023
0accca8
New Props table for Bleed, Box, Bulleted & Button
GomezIvann Oct 16, 2023
c553aee
New props Table included for the Card component
GomezIvann Oct 16, 2023
ad63a62
New Props table for the Chip, Date Input & Dialog
GomezIvann Oct 17, 2023
5e15868
File Input, Flex and Footer with new Props table
GomezIvann Oct 17, 2023
4e4dead
New props table for Grid, Header, Heading & Inset
GomezIvann Oct 18, 2023
cf77362
New props table for Link, Nav Tabs & Number Input
GomezIvann Oct 18, 2023
95fbf80
New props table for Paginator, Paragraph & Password Input
GomezIvann Oct 18, 2023
73b016b
New Props table for Progress Bar, QuickNav, Radio Group & Resultset T…
GomezIvann Oct 18, 2023
7638a81
Updated Props table in Image and Checkbox
GomezIvann Oct 10, 2023
2bd7745
Accordion and Accordion Group props table updated
GomezIvann Oct 10, 2023
509c6f6
Alert and App Layout props table updated
GomezIvann Oct 10, 2023
7410cb6
New Props table for Bleed, Box, Bulleted & Button
GomezIvann Oct 16, 2023
0a2eeb0
New props Table included for the Card component
GomezIvann Oct 16, 2023
0c838fe
New Props table for the Chip, Date Input & Dialog
GomezIvann Oct 17, 2023
2158c1d
File Input, Flex and Footer with new Props table
GomezIvann Oct 17, 2023
7447474
New props table for Grid, Header, Heading & Inset
GomezIvann Oct 18, 2023
f785029
New props table for Link, Nav Tabs & Number Input
GomezIvann Oct 18, 2023
0fa2126
New props table for Paginator, Paragraph & Password Input
GomezIvann Oct 18, 2023
37e4115
New Props table for Progress Bar, QuickNav, Radio Group & Resultset T…
GomezIvann Oct 18, 2023
091f755
Merge branch 'gomezivann/new-props-table' of https://github.com/dxc-t…
GomezIvann Oct 18, 2023
5df300e
New props table for Select, Sidenav, Slider & Spinner
GomezIvann Oct 19, 2023
db07cd4
New props table Switch, Table, Tabs & Tag
GomezIvann Oct 19, 2023
b739b1a
New Props table for Text Input & Textarea
GomezIvann Oct 19, 2023
ed56cd9
New Props table for Toggle Group & Typography
GomezIvann Oct 19, 2023
d8ef0b8
New props table for Wizard
GomezIvann Oct 20, 2023
8f90a1b
Small updates to some tables
GomezIvann Oct 20, 2023
72b131f
Alert code page fixed
GomezIvann Oct 23, 2023
dd44f54
Fixes based on feedback
GomezIvann Oct 24, 2023
7d9f9cf
Grid code page updated based on feedback
GomezIvann Oct 24, 2023
10b3853
Adding Code tag to some pages
GomezIvann Oct 27, 2023
b85cd33
More Code tag updates
GomezIvann Oct 27, 2023
fc5a952
More updated code pages
GomezIvann Oct 27, 2023
4e8798e
Small fix in Tabs Code page
GomezIvann Oct 30, 2023
e4165a1
Updating Paginator prop description based on feedback
GomezIvann Oct 30, 2023
31f4919
Merge branch 'master' into gomezivann/new-props-table
raquelarrojo Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/src/accordion/Accordion.stories.tsx
@@ -1,6 +1,5 @@
import React from "react";
import DxcAccordion from "./Accordion";
import DxcHeading from "../heading/Heading";
import DxcTextInput from "../text-input/TextInput";
import DxcButton from "../button/Button";
import Title from "../../.storybook/components/Title";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/accordion/types.ts
Expand Up @@ -50,7 +50,7 @@ type Props = {
*/
margin?: Space | Margin;
/**
* Value of the tabindex.
* Value of the tabindex attribute.
*/
tabIndex?: number;
};
Expand Down
10 changes: 5 additions & 5 deletions lib/src/alert/types.ts
Expand Up @@ -13,11 +13,11 @@ type Props = {
type?: "info" | "confirm" | "warning" | "error";
/**
* Uses on of the available alert modes:
* 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
* 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
* There is no overlay layer. Position should be decided by the user.
* 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
* 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
* The onClose function will be executed when the X button or the overlay is clicked. d
* The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
* The user has the responsibility of hiding the modal in the onClose function, otherwise the modal will remain visible.
*/
mode?: "inline" | "modal";
/**
Expand All @@ -33,7 +33,7 @@ type Props = {
*/
children?: React.ReactNode;
/**
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
*/
margin?: Space | Margin;
Expand All @@ -42,7 +42,7 @@ type Props = {
*/
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
/**
* Tabindex value given to the close button.
* Value of the tabindex attribute applied to the close button.
*/
tabIndex?: number;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/src/card/types.ts
Expand Up @@ -47,15 +47,15 @@ type Props = {
*/
margin?: Space | Size;
/**
* Value of the tabindex given when there is an href.
* Value of the tabindex attribute applied when the component is clickable.
*/
tabIndex?: number;
/**
* Determines whether or not the component should have an outline.
*/
outlined?: boolean;
/**
* Custom content that will be placed in the card component.
* Custom content that will be placed inside the component.
*/
children?: React.ReactNode;
};
Expand Down
40 changes: 20 additions & 20 deletions lib/src/date-input/types.ts
Expand Up @@ -9,14 +9,6 @@ type Margin = {
};

type Props = {
/**
* Text to be placed above the date.
*/
label?: string;
/**
* Name attribute of the input element.
*/
name?: string;
/**
* Initial value of the input element, only when it is uncontrolled.
*/
Expand All @@ -26,9 +18,13 @@ type Props = {
*/
value?: string;
/**
* 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.
* Text to be placed above the date input.
*/
format?: string;
label?: string;
/**
* Name attribute of the input element.
*/
name?: string;
/**
* Helper text to be placed above the date.
*/
Expand All @@ -37,6 +33,10 @@ type Props = {
* If true, the date format will appear as placeholder in the field.
*/
placeholder?: boolean;
/**
* 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.
*/
format?: string;
/**
* If true, the date input will have an action to clear the entered value.
*/
Expand All @@ -46,18 +46,18 @@ type Props = {
*/
disabled?: boolean;
/**
* If true, the component will not be mutable, meaning the user can not edit the control.
* The date picker cannot be opened either. In addition, the clear action will not be displayed
* even if the flag is set to true.
*/
readOnly?: boolean;
/**
* If true, the date will be optional, showing '(Optional)'
* If true, the date will be optional, showing the text '(Optional)'
* next to the label. Otherwise, the field will be considered required and an error will be
* passed as a parameter to the OnBlur and onChange functions when it has
* not been filled.
*/
optional?: boolean;
/**
* If true, the component will not be mutable, meaning the user can not edit the control.
* The date picker cannot be opened either. In addition, the clear action will not be displayed
* even if the flag is set to true.
*/
readOnly?: boolean;
/**
* This function will be called when the user types within the input
* element of the component. An object including the string value, the
Expand Down Expand Up @@ -127,15 +127,15 @@ export type CalendarPropsType = {
*/
innerDate: Dayjs;
/**
* Function called when the date showned needs to be updated
* Function called when the showed date needs to be updated.
*/
onInnerDateChange: (date: Dayjs) => void;
/**
* Function called when a date is selected.
*/
onDaySelect: (date: Dayjs) => void;
/**
* Current date
* Current date.
*/
today: Dayjs;
};
Expand All @@ -150,7 +150,7 @@ export type YearPickerPropsType = {
*/
onYearSelect: (year: number) => void;
/**
* Current date
* Current date.
*/
today: Dayjs;
};
Expand Down
29 changes: 17 additions & 12 deletions lib/src/dialog/types.ts
@@ -1,31 +1,36 @@
type Props = {
/**
* If true, the close 'x' button will be visible.
* If true, the close button will be visible.
*/
isCloseVisible?: boolean;
/**
* This function will be called when the user clicks the close 'x' button.
* The responsibility of hiding the modal lies with the user.
* This function will be called when the user clicks the close button.
* The responsibility of hiding the dialog lies with the user.
*/
onCloseClick?: () => void;
/**
* This function will be called when the user clicks on the background of the modal.
* The responsibility of hiding the dialog lies with the user.
*/
onBackgroundClick?: () => void;
/**
* If true, the dialog will be displayed over a darker background that covers the content behind.
*/
overlay?: boolean;
/**
* This function will be called when the user clicks background of the modal.
* The responsibility of hiding the modal lies with the user.
* Area within the dialog that can be used to render custom content.
* We strongly encourage users to not change the
* tabindex of the inner components or elements. This
* can lead to unpredictable behaviour for keyboard users, affecting
* the order of focus and focus locking within the dialog.
*/
onBackgroundClick?: () => void;
children: React.ReactNode;
/**
* Value of the tabindex given to the close 'x' button.
* Value of the tabindex applied to the close button.
* Note that values greater than 0 are strongly discouraged. It can
* lead to unexpected behaviours with the focus within the dialog.
*/
tabIndex?: number;
/**
* The area inside the dialog. This area can be used to render
* custom content.
*/
children: React.ReactNode;
};

export default Props;
16 changes: 8 additions & 8 deletions lib/src/dropdown/types.ts
Expand Up @@ -52,14 +52,18 @@ type Props = {
*/
caretHidden?: boolean;
/**
* This function will be called every time the selection changes.
* The value of the selected option will be passed as a parameter.
* If true, the component will be disabled.
*/
onSelectOption: (value: string) => void;
disabled?: boolean;
/**
* If true, the options are showed when the dropdown is hover.
*/
expandOnHover?: boolean;
/**
* This function will be called every time the selection changes.
* The value of the selected option will be passed as a parameter.
*/
onSelectOption: (value: string) => void;
/**
* Size of the margin to be applied to the component.
* You can pass an object with 'top', 'bottom', 'left' and 'right'
Expand All @@ -71,13 +75,9 @@ type Props = {
*/
size?: Size;
/**
* Value of the tabindex.
* Value of the tabindex attribute.
*/
tabIndex?: number;
/**
* If true, the component will be disabled.
*/
disabled?: boolean;
};

export type DropdownMenuProps = {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/flex/types.ts
@@ -1,5 +1,5 @@
type Spaces = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
type Gap = { rowGap: Spaces; columnGap?: Spaces } | { rowGap?: Spaces; columnGap?: Spaces } | Spaces;
type Gap = { rowGap: Spaces; columnGap?: Spaces } | { rowGap?: Spaces; columnGap: Spaces } | Spaces;

type CommonProps = {
/**
Expand Down
14 changes: 7 additions & 7 deletions lib/src/footer/types.ts
Expand Up @@ -44,24 +44,24 @@ type FooterPropsType = {
* the bottom part of the footer.
*/
bottomLinks?: BottomLink[];
/**
* The text that will be displayed as copyright disclaimer.
*/
copyright?: string;
/**
* The center section of the footer. Can be used to render custom
* content in this area.
*/
children?: React.ReactNode;
/**
* The text that will be displayed as copyright disclaimer.
* Size of the top margin to be applied to the footer.
*/
copyright?: string;
margin?: Space | Size;
/**
* Value of the tabindex for all interactuable elements, except those
* Value of the tabindex for all interactive elements, except those
* inside the custom area.
*/
tabIndex?: number;
/**
* Size of the top margin to be applied to the footer.
*/
margin?: Space | Size;
};

export default FooterPropsType;
11 changes: 4 additions & 7 deletions lib/src/header/types.ts
@@ -1,8 +1,6 @@
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";

type Props = {
/**
* Wether a contrast line should appear at the bottom of the header.
* Whether a contrast line should appear at the bottom of the header.
*/
underlined?: boolean;
/**
Expand All @@ -21,12 +19,11 @@ type Props = {
*/
onClick?: () => void;
/**
* Size of the bottom margin to be applied to the header
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* Size of the bottom margin to be applied to the header.
*/
margin?: Space;
margin?: "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
/**
* Value of the tabindex for all interactuable elements, except those inside the
* Value of the tabindex for all interactive elements, except those inside the
* custom area.
*/
tabIndex?: number;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/heading/types.ts
Expand Up @@ -17,14 +17,14 @@ type Props = {
* Heading text.
*/
text: string;
/**
* Specifies the html tag of the heading.
*/
as?: "h1" | "h2" | "h3" | "h4" | "h5";
/**
* Modifies the default weight of the heading.
*/
weight?: "light" | "normal" | "bold";
/**
* Specifies the HTML tag of the heading.
*/
as?: "h1" | "h2" | "h3" | "h4" | "h5";
/**
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
Expand Down
20 changes: 10 additions & 10 deletions lib/src/link/types.ts
Expand Up @@ -8,14 +8,18 @@ type Margin = {
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;

export type LinkProps = {
/**
* If true, the link is disabled.
*/
disabled?: boolean;
/**
* If true, the color is inherited from parent.
*/
inheritColor?: boolean;
/**
* If true, the link is disabled.
* Element or path used as the icon that will be placed next to the link text.
*/
disabled?: boolean;
icon?: string | SVG;
/**
* Indicates the position of the icon in the component.
*/
Expand All @@ -33,6 +37,10 @@ export type LinkProps = {
* function will be called when the user clicks the link.
*/
onClick?: () => void;
/**
* Text of the link.
*/
children: string;
/**
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
Expand All @@ -42,12 +50,4 @@ export type LinkProps = {
* Value of the tabindex.
*/
tabIndex?: number;
/**
* Content of the link.
*/
children: string;
/**
* Element or path used as the icon that will be placed next to the link text.
*/
icon?: string | SVG;
};