Skip to content

Commit b0e0862

Browse files
lloydafmartimalekMartí Maleksemantic-release-botNikolai Lopin
authored
Issue 10 add prop documentation (#276)
* Merge main (#270) * docs: remove the experimental label for table (#255) * fix: display semantic colors in table and allow to filter them (#258) * fix: display semantic colors in table and allow to filter them * refactor: improve performance of SemanticColorsTable * fix: trim table filter input Co-authored-by: Martí Malek <[email protected]> * chore(release): 1.25.2 [skip ci] ### [1.25.2](v1.25.1...v1.25.2) (2022-07-11) ### Bug Fixes * display semantic colors in table and allow to filter them ([#258](#258)) ([2e83e76](2e83e76)) * update codeowners removes Rafa from the list 😢 * style(popover): expose padding prop for Popover component (#262) Co-authored-by: Ján Hamara <[email protected]> * fix: expose padding prop and adjust z-index for Popover component (#263) * style(popover): expose padding prop for Popover component * fix: update zIndex on Popover content container Co-authored-by: Ján Hamara <[email protected]> * chore(release): 1.25.3 [skip ci] ### [1.25.3](v1.25.2...v1.25.3) (2022-07-21) ### Bug Fixes * expose padding prop and adjust z-index for Popover component ([#263](#263)) ([da0e80b](da0e80b)) * Expand PhoneInput API (#261) Exposes properties to reach lower-level components of the `PhoneInput` Co-authored-by: martimalek <[email protected]> * 1.26.0 * 1.26.1 Co-authored-by: martimalek <[email protected]> Co-authored-by: Martí Malek <[email protected]> Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> Co-authored-by: Jan Hamara <[email protected]> Co-authored-by: Ján Hamara <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> * docs(headline): update props table * improvement: adding props table for filepicker * docs(pagination): update props table * docs(select): update props table * Issue 10 add prop documentation (#271) * docs(tabbar): update props table * improvement: props table for datepicker * improvement: adding props table to Tooltip * improvement: adding PropsTable to Toggle * improvement: adding propstable for Textarea * merging main with the prop branch (#277) * docs: remove the experimental label for table (#255) * fix: display semantic colors in table and allow to filter them (#258) * fix: display semantic colors in table and allow to filter them * refactor: improve performance of SemanticColorsTable * fix: trim table filter input Co-authored-by: Martí Malek <[email protected]> * chore(release): 1.25.2 [skip ci] ### [1.25.2](v1.25.1...v1.25.2) (2022-07-11) ### Bug Fixes * display semantic colors in table and allow to filter them ([#258](#258)) ([2e83e76](2e83e76)) * update codeowners removes Rafa from the list 😢 * style(popover): expose padding prop for Popover component (#262) Co-authored-by: Ján Hamara <[email protected]> * fix: expose padding prop and adjust z-index for Popover component (#263) * style(popover): expose padding prop for Popover component * fix: update zIndex on Popover content container Co-authored-by: Ján Hamara <[email protected]> * chore(release): 1.25.3 [skip ci] ### [1.25.3](v1.25.2...v1.25.3) (2022-07-21) ### Bug Fixes * expose padding prop and adjust z-index for Popover component ([#263](#263)) ([da0e80b](da0e80b)) * Expand PhoneInput API (#261) Exposes properties to reach lower-level components of the `PhoneInput` Co-authored-by: martimalek <[email protected]> * 1.26.0 * 1.26.1 Co-authored-by: martimalek <[email protected]> Co-authored-by: Martí Malek <[email protected]> Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> Co-authored-by: Jan Hamara <[email protected]> Co-authored-by: Ján Hamara <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> * docs(props-table): add props table to Table docs (#275) * docs: remove the experimental label for table (#255) * fix: display semantic colors in table and allow to filter them (#258) * fix: display semantic colors in table and allow to filter them * refactor: improve performance of SemanticColorsTable * fix: trim table filter input Co-authored-by: Martí Malek <[email protected]> * chore(release): 1.25.2 [skip ci] ### [1.25.2](v1.25.1...v1.25.2) (2022-07-11) ### Bug Fixes * display semantic colors in table and allow to filter them ([#258](#258)) ([2e83e76](2e83e76)) * update codeowners removes Rafa from the list 😢 * style(popover): expose padding prop for Popover component (#262) Co-authored-by: Ján Hamara <[email protected]> * fix: expose padding prop and adjust z-index for Popover component (#263) * style(popover): expose padding prop for Popover component * fix: update zIndex on Popover content container Co-authored-by: Ján Hamara <[email protected]> * chore(release): 1.25.3 [skip ci] ### [1.25.3](v1.25.2...v1.25.3) (2022-07-21) ### Bug Fixes * expose padding prop and adjust z-index for Popover component ([#263](#263)) ([da0e80b](da0e80b)) * Expand PhoneInput API (#261) Exposes properties to reach lower-level components of the `PhoneInput` Co-authored-by: martimalek <[email protected]> * 1.26.0 * 1.26.1 * docs(props-table): add props table to Table docs * chore: update package-lock.json Co-authored-by: Lloyd Francis <[email protected]> Co-authored-by: martimalek <[email protected]> Co-authored-by: Martí Malek <[email protected]> Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> Co-authored-by: Jan Hamara <[email protected]> Co-authored-by: Ján Hamara <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> * docs(table): remove unused tables * docs(datepicker): add links to styled-system props * docs(textarea): add semicolons * docs(toggle): add classname and styled-system props to the documentation * docs(select): change import order * docs(filepicker): add styled-system props link * docs(headline): add styled-system props link * docs(helpertext): add styled-system props link * docs(link): add styled-system props link * docs(tag): add styled-system props link Co-authored-by: martimalek <[email protected]> Co-authored-by: Martí Malek <[email protected]> Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> Co-authored-by: Jan Hamara <[email protected]> Co-authored-by: Ján Hamara <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]> Co-authored-by: dani-walnut <[email protected]> Co-authored-by: Artur Miglio <[email protected]>
1 parent 5f9fc8e commit b0e0862

30 files changed

+722
-36
lines changed

package-lock.json

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Datepicker/DatepickerRangeInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ interface DatepickerRangeInputProps extends MarginProps, WidthProps {
105105
*/
106106
label?: string;
107107
/**
108-
* Function that used when datepicker closes without selected date.
108+
* Function that is used when datepicker closes without selected date.
109109
*/
110110
onClose?: () => void;
111111
/**
112112
* Set the value for the date
113113
*/
114114
value?: DateRange;
115115
/**
116-
* Function that used when datepicker selects new date.
116+
* Function that is used when datepicker selects new date.
117117
*/
118118
onChange?: (change: DateRange) => void;
119119
/**

src/components/Datepicker/DatepickerSingleInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ interface DatepickerSingleInputProps extends MarginProps, WidthProps {
2323
*/
2424
label?: string;
2525
/**
26-
* Function that used when datepicker closes without selected date.
26+
* Function that is used when datepicker closes without selected date.
2727
*/
2828
onClose?: () => void;
2929
/**
30-
* Function that used when datepicker selects new date.
30+
* Function that is used when datepicker selects new date.
3131
*/
3232
onChange?: (date?: Date) => void;
3333
/**

src/components/Datepicker/docs/Datepicker.mdx

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ route: /components/date-picker
55
---
66

77
import { Playground } from 'docz';
8+
import { StyledSystemLinks } from '../../../docs/StyledSystemLinks';
89
import { DatepickerRangeInput as DateRangePicker } from '../DatepickerRangeInput';
910
import { DatepickerSingleInput as DatePicker } from '../DatepickerSingleInput';
1011
import { ControlledDatepickerSingleInput } from './ControlledDatepickerSingleInput';
1112
import { ControlledDatepickerRangeInput } from './ControlledDatepickerRangeInput';
1213
import { DatepickerOnModal } from './DatepickerOnModal';
14+
import { DatepickerSingleInputPropsTable } from './DatepickerSingleInputPropsTable';
15+
import { DatepickerRangeInputPropsTable } from './DatepickerRangeInputPropsTable';
1316

1417
# Datepicker
1518

@@ -19,15 +22,19 @@ import { DatepickerOnModal } from './DatepickerOnModal';
1922

2023
### Single datepicker props
2124

22-
<Props of={DatePicker} />
25+
<DatepickerSingleInputPropsTable />
26+
<br />
27+
<StyledSystemLinks component="DatePicker" supportedProps={['margin', 'width']} />
2328

2429
## Range
2530

2631
<ControlledDatepickerRangeInput label="Date Range" />
2732

2833
### Range datepicker props
2934

30-
<Props of={DateRangePicker} />
35+
<DatepickerRangeInputPropsTable />
36+
<br />
37+
<StyledSystemLinks component="DateRangePicker" supportedProps={['margin', 'width']} />
3138

3239
## Datepicker on Modal
3340

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import React, { FC } from 'react';
2+
3+
import { PropsTable } from '../../../docs/PropsTable';
4+
5+
export const DatepickerRangeInputPropsTable: FC = () => {
6+
const props = [
7+
{
8+
name: 'startPlaceholder',
9+
type: 'string',
10+
description: 'Placeholder for start date.'
11+
},
12+
{
13+
name: 'endPlaceholder',
14+
type: 'string',
15+
description: 'Placeholder for end date.'
16+
},
17+
{
18+
name: 'label',
19+
type: 'string',
20+
description: 'Label for the input.'
21+
},
22+
{
23+
name: 'onClose',
24+
type: 'Function => void',
25+
description: 'Function that is used when datepicker closes without selected date.'
26+
},
27+
{
28+
name: 'value',
29+
type: 'DateRange (interface containing startDate and endDate properties)',
30+
description: 'Set the value for the date.'
31+
},
32+
{
33+
name: 'onChange',
34+
type: 'Function (change: DateRange) => void',
35+
description: 'Function that is used when datepicker selects new date.'
36+
},
37+
{
38+
name: 'minDate',
39+
type: 'Date',
40+
description: 'Minimal date to select from.'
41+
},
42+
{
43+
name: 'maxDate',
44+
type: 'Date',
45+
description: 'Maximum date to select from.'
46+
},
47+
{
48+
name: 'firstDayOfWeek',
49+
type: 'FirstDayOfWeek (number from 0-6)',
50+
description: 'Accepts a number for first day of the week from 0 (Sunday) to 6 (Saturday).',
51+
defaultValue: '1'
52+
},
53+
{
54+
name: 'isDateBlocked',
55+
type: 'Function => boolean',
56+
description: 'Function that runs for each date and returns boolean whether date is disabled or not.',
57+
defaultValue: '() => false'
58+
},
59+
{
60+
name: 'placement',
61+
type: "'left' | 'right' | 'center'",
62+
description: 'Used to align the datepicker in relation to input.',
63+
defaultValue: 'left'
64+
},
65+
{
66+
name: 'displayFormat',
67+
type: 'string',
68+
description: 'String to format dates.',
69+
defaultValue: 'dd/MM/yyyy'
70+
},
71+
{
72+
name: 'locale',
73+
type: 'string',
74+
description: 'String to define the locale in ISO-639-1.',
75+
defaultValue: 'en-US'
76+
},
77+
{
78+
name: 'errorHandler',
79+
type: '(Function => void) | string',
80+
description: 'Text to be shown if error filling the input or fn to be trigger as a callback when error.'
81+
},
82+
{
83+
name: 'startInputId',
84+
type: 'string',
85+
description: 'The id to be assigned to the start date input.'
86+
},
87+
{
88+
name: 'endInputId',
89+
type: 'string',
90+
description: 'The id to be assigned to the end date input.'
91+
},
92+
{
93+
name: 'variant',
94+
type: "'compact' | 'normal'",
95+
description: "Determines the variant, 'compact' displays only a single month",
96+
defaultValue: "'normal'"
97+
},
98+
{
99+
name: 'disabled',
100+
type: 'boolean',
101+
description: 'Determines whether the datePicker is disabled or not.'
102+
}
103+
];
104+
return <PropsTable props={props} />;
105+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import React, { FC } from 'react';
2+
3+
import { PropsTable } from '../../../docs/PropsTable';
4+
5+
export const DatepickerSingleInputPropsTable: FC = () => {
6+
const props = [
7+
{
8+
name: 'placeholder',
9+
type: 'string',
10+
description: 'Placeholder for the input.'
11+
},
12+
{
13+
name: 'label',
14+
type: 'string',
15+
description: 'Label for the input.'
16+
},
17+
{
18+
name: 'onClose',
19+
type: 'Function => void',
20+
description: 'Function that is used when datepicker closes without selected date.'
21+
},
22+
{
23+
name: 'onChange',
24+
type: 'Function => void',
25+
description: 'Function that is used when datepicker selects new date.'
26+
},
27+
{
28+
name: 'minDate',
29+
type: 'Date',
30+
description: 'Minimal date to select from.'
31+
},
32+
{
33+
name: 'maxDate',
34+
type: 'Date',
35+
description: 'Maximum date to select from.'
36+
},
37+
{
38+
name: 'firstDayOfWeek',
39+
type: 'FirstDayOfWeek (number from 0-6)',
40+
description: 'Accepts a number for first day of the week from 0 (Sunday) to 6 (Saturday).',
41+
defaultValue: '1'
42+
},
43+
{
44+
name: 'isDateBlocked',
45+
type: 'Function => boolean',
46+
description: 'Function that runs for each date and returns boolean whether date is disabled or not.',
47+
defaultValue: '() => false'
48+
},
49+
{
50+
name: 'displayFormat',
51+
type: 'string',
52+
description: 'String to format dates.',
53+
defaultValue: 'dd/MM/yyyy'
54+
},
55+
{
56+
name: 'locale',
57+
type: 'string',
58+
description: 'String to define the locale in ISO-639-1.',
59+
defaultValue: 'en-US'
60+
},
61+
{
62+
name: 'value',
63+
type: 'Date',
64+
description: 'Set the value of the input.'
65+
},
66+
{
67+
name: 'errorHandler',
68+
type: '(Function => void) | string',
69+
description: 'Text to be shown if error filling the input or fn to be trigger as a callback when error.'
70+
},
71+
{
72+
name: 'inputId',
73+
type: 'string',
74+
description: 'The id to be assigned to the input field.'
75+
},
76+
{
77+
name: 'disabled',
78+
type: 'boolean',
79+
description: 'Determines whether the datePicker is disabled or not.'
80+
}
81+
];
82+
return <PropsTable props={props} />;
83+
};

src/components/FilePicker/FilePicker.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface FilePickerProps extends MarginProps, ComponentPropsWithoutRef<'input'>
3636
*/
3737
buttonText: string;
3838
/**
39-
* Weather or not the component should render a error state
39+
* Whether or not the component should render an error state
4040
*/
4141
error?: boolean;
4242
/**

src/components/FilePicker/docs/FilePicker.mdx

+9
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ route: /components/file-picker
55
---
66

77
import { Playground } from 'docz';
8+
import { StyledSystemLinks } from '../../../docs/StyledSystemLinks';
89
import { FilePicker, Button, Box } from '../'
910
import { ControlledErrorFilePicker } from './ControlledErrorFilePicker'
11+
import { FilePickerPropsTable } from './FilePickerPropsTable';
12+
1013

1114
# FilePicker
1215

1316
This component it’s a trigger opening the native file uploader.
1417
This component uses default Web input type file check [Mozilla Input Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file)
1518
if you need to know more about the supported attributes and values
1619

20+
## Properties
21+
22+
<FilePickerPropsTable />
23+
<br />
24+
<StyledSystemLinks component="FilePicker" supportedProps={['margin']} />
25+
1726
## Appearance
1827
- **File title**: This provides a clear description of what the user should upload. If long, takes as many lines as needed extending the height of the component.
1928
- **Button label**: Describes the main action, it works better when short
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React, { FC } from 'react';
2+
3+
import { PropsTable } from '../../../docs/PropsTable';
4+
5+
export const FilePickerPropsTable: FC = () => {
6+
const props = [
7+
{
8+
name: 'name',
9+
type: 'string',
10+
description: 'Sets the name property of input element in the DOM.'
11+
},
12+
{
13+
name: 'accept',
14+
type: 'string',
15+
description: 'One or more unique file type identifiers describing file types to allow.'
16+
},
17+
{
18+
name: 'capture',
19+
type: 'string',
20+
description: 'What source to use for capturing image or video data.'
21+
},
22+
{
23+
name: 'label',
24+
type: 'string',
25+
description: 'Text to provide a clear description of what the user should upload.'
26+
},
27+
{
28+
name: 'buttonText',
29+
type: 'string',
30+
description:
31+
'Text to display within component button, it describes the main action, it works better when short.'
32+
},
33+
{
34+
name: 'error',
35+
type: 'boolean',
36+
description: 'Whether or not the component should render an error state.'
37+
},
38+
{
39+
name: 'onFileChange',
40+
type: 'Function => void',
41+
description: 'Callback to be used when the input receives a new file.'
42+
}
43+
];
44+
return <PropsTable props={props} />;
45+
};

0 commit comments

Comments
 (0)