-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add TimePicker to docsite It had a react-example but wasn't added to the public docsite. * Add TimePicker to docsite api generator. * Added TimePicker control best practices docs * add @docCategory tag to TimePicker This enables proper API generation in public-docsite-resources. * change files Co-authored-by: James Wu <[email protected]>
- Loading branch information
1 parent
14e5b74
commit 7380b15
Showing
12 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ module.exports = { | |
'TeachingBubble', | ||
'Text', | ||
'TextField', | ||
'TimePicker', | ||
'Toggle', | ||
'Tooltip', | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
apps/public-docsite-resources/src/components/pages/TimePickerPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
import { DemoPage } from '../DemoPage'; | ||
|
||
import { TimePickerPageProps } from '@fluentui/react-examples/lib/react/TimePicker/TimePicker.doc'; | ||
|
||
export const TimePickerPage = (props: { isHeaderVisible: boolean }) => ( | ||
<DemoPage | ||
jsonDocs={require('../../../dist/api/react/TimePicker.page.json')} | ||
{...{ ...TimePickerPageProps, ...props }} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
apps/public-docsite/src/pages/Controls/TimePickerPage/TimePickerPage.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { TFabricPlatformPageProps } from '../../../interfaces/Platforms'; | ||
import { TimePickerPageProps as ExternalProps } from '@fluentui/react-examples/lib/react/TimePicker/TimePicker.doc'; | ||
|
||
export const TimePickerPageProps: TFabricPlatformPageProps = { | ||
web: { | ||
...(ExternalProps as any), | ||
}, | ||
}; |
7 changes: 7 additions & 0 deletions
7
apps/public-docsite/src/pages/Controls/TimePickerPage/TimePickerPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react'; | ||
import { ControlsAreaPage, IControlsPageProps } from '../ControlsAreaPage'; | ||
import { TimePickerPageProps } from './TimePickerPage.doc'; | ||
|
||
export const TimePickerPage: React.FunctionComponent<IControlsPageProps> = props => { | ||
return <ControlsAreaPage {...props} {...TimePickerPageProps[props.platform]} />; | ||
}; |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-d7ed3976-3c18-467f-affb-9928fd9ec770.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "docs: add @docCategory documentation comment to TimePicker", | ||
"packageName": "@fluentui/react", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/react-examples/src/react/TimePicker/TimePicker.doc.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
|
||
import { IDocPageProps } from '@fluentui/react/lib/common/DocPage.types'; | ||
|
||
import { TimePickerBasicExample } from './TimePicker.Example'; | ||
const TimePickerExampleCode = require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.Example.tsx') as string; | ||
|
||
export const TimePickerPageProps: IDocPageProps = { | ||
title: 'TimePicker', | ||
componentName: 'TimePicker', | ||
componentUrl: 'https://github.com/microsoft/fluentui/tree/master/packages/react/src/components/TimePicker', | ||
examples: [ | ||
{ | ||
title: 'TimePicker basic', | ||
code: TimePickerExampleCode, | ||
view: <TimePickerBasicExample />, | ||
}, | ||
], | ||
overview: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/docs/TimePickerOverview.md'), | ||
bestPractices: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/docs/TimePickerBestPractices.md'), | ||
isHeaderVisible: true, | ||
isFeedbackVisible: true, | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/react-examples/src/react/TimePicker/docs/TimePickerBestPractices.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### Layout | ||
|
||
- Time pickers can be coupled with the date picker control. The selected date object returned by the date picker can be supplied to the time picker via time picker's `defaultValue` prop. The time picker should be horizontally aligned next to the date picker if these two controls are used together. | ||
|
||
### Content | ||
|
||
- By default, the time picker dropdown list displays time options in 30 minute increments over a 24-hour time range using 24-hour formatting (hh:mm). | ||
- The time increment between each dropdown option can be modified using the `increments` prop. | ||
- The overall time range the dropdown options span can be modified using the `timeRange` prop. | ||
- Each dropdown option can display seconds using the `showSeconds` prop. | ||
- Each dropdown option can display time in 12-hour format (hh:mm AM/PM) using the `useHour12` prop. |
1 change: 1 addition & 0 deletions
1
packages/react-examples/src/react/TimePicker/docs/TimePickerOverview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`TimePicker` offers a control that’s optimized for selecting a time from a drop-down list or using free-form input to enter a custom time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters