Skip to content

Commit e81f01c

Browse files
authored
feat: add pivot msft component (#1385)
* started work on Pivot * more pivot work * started work on Pivot component * more work on pivot * updated pivot control * removed data from schema * more pivot work * added canUseDom * more updates * add: pivot component * fixed spelling error * fixed test description * addressed PR comments * moved to dom re renderings to be based on state * implemented new focus state * updated render props to match new schema layout * addressed PR comments * updated styling values * missing dependency reoved unsused refrences * moved export of Managed Classes * removed clas name debugging * code clean up and refactoring * addressed more PR comments * changed extension of prop file * adressed className naming
1 parent 0b94bbe commit e81f01c

File tree

21 files changed

+967
-1
lines changed

21 files changed

+967
-1
lines changed

packages/fast-components-class-name-contracts-msft/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export * from "./heading";
1111
export * from "./managed-classes";
1212
export * from "./metatext";
1313
export * from "./paragraph";
14+
export * from "./pivot";
1415
export * from "./progress";
1516
export * from "./subheading";
1617
export * from "./text-action";
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* The class name contract for the pivot component
3+
*/
4+
export interface PivotClassNameContract {
5+
/**
6+
* The root of the pivot component
7+
*/
8+
pivot?: string;
9+
10+
/**
11+
* The active pivot indicator
12+
*/
13+
pivot_activeIndicator?: string;
14+
15+
/**
16+
* The collection of pivot items
17+
*/
18+
pivot_tabList?: string;
19+
20+
/**
21+
* The pivot item
22+
*/
23+
pivot_tab?: string;
24+
25+
/**
26+
* The active pivot item
27+
*/
28+
pivot_tab__active?: string;
29+
30+
/**
31+
* The pivot tab content
32+
*/
33+
pivot_tabContent?: string;
34+
35+
/**
36+
* The collection of tab panels
37+
*/
38+
pivot_tabPanels?: string;
39+
40+
/**
41+
* The previous panel animation
42+
*/
43+
pivot_tabPanels__animatePrevious?: string;
44+
45+
/**
46+
* The next tab panel animation
47+
*/
48+
pivot_tabPanels__animateNext?: string;
49+
50+
/**
51+
* The tab panel
52+
*/
53+
pivot_tabPanel?: string;
54+
55+
/**
56+
* The hidden tab panel
57+
*/
58+
pivot_tabPanel__hidden?: string;
59+
60+
/**
61+
* The tab panel content
62+
*/
63+
pivot_tabPanelContent?: string;
64+
}

packages/fast-components-react-msft/app/app.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import reactSVGElementExamples from "./components/svg-svg-element-child-option";
3636
import carouselHeroContentExamples from "./components/carousel-hero-content-child-options";
3737
import carouselDarkImageContentExamples from "./components/carousel-dark-image-content-child-options";
3838
import carouselLightImageContentExamples from "./components/carousel-light-image-content-child-options";
39+
import pivotItemContentExamples from "./components/pivot-item-content-child-options";
40+
import pivotItemTabExamples from "./components/pivot-item-tab-child-options";
3941
import { Label } from "../src/label";
4042

4143
/* tslint:disable-next-line */
@@ -47,6 +49,8 @@ const formChildOptions: FormChildOption[] = [
4749
carouselHeroContentExamples,
4850
carouselDarkImageContentExamples,
4951
carouselLightImageContentExamples,
52+
pivotItemContentExamples,
53+
pivotItemTabExamples,
5054
].concat(formChildFromExamplesFactory(examples));
5155

5256
const formPlugins: Array<Plugin<PluginProps>> = [
@@ -58,6 +62,8 @@ const formPlugins: Array<Plugin<PluginProps>> = [
5862
"@microsoft/fast-components-react-msft/button/beforeContent",
5963
"@microsoft/fast-components-react-msft/button/afterContent",
6064
"@microsoft/fast-components-react-msft/carousel/items/content",
65+
"@microsoft/fast-components-react-msft/pivot/items/content",
66+
"@microsoft/fast-components-react-msft/pivot/items/tab",
6167
"@microsoft/fast-components-react-msft/text-action/beforeGlyph",
6268
"@microsoft/fast-components-react-msft/text-action/afterGlyph",
6369
],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PivotItemContentSchema from "./pivot-item-content.schema.json";
2+
import PivotItemContent from "./pivot-item-content";
3+
export default {
4+
name: "Pivot item content",
5+
schema: PivotItemContentSchema,
6+
component: PivotItemContent,
7+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://json-schema.org/schema#",
3+
"title": "Pivot Item Content",
4+
"description": "A pivot item content component's schema definition.",
5+
"id": "pivot-item-content",
6+
"type": "object",
7+
"properties": {},
8+
"reactProperties": {
9+
"children": {
10+
"title": "Children",
11+
"type": "children",
12+
"defaults": [
13+
"text"
14+
]
15+
}
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from "react";
2+
3+
export interface PivotItemContentProps {
4+
className?: string;
5+
children?: React.ReactNode;
6+
}
7+
8+
/**
9+
* A stand-in a mock pivot content
10+
*/
11+
export default class PivotItemContent extends React.Component<PivotItemContentProps, {}> {
12+
public render(): React.ReactNode {
13+
return <div className={this.props.className}>{this.props.children}</div>;
14+
}
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PivotItemTabSchema from "./pivot-item-tab.schema.json";
2+
import PivotItemTab from "./pivot-item-tab";
3+
export default {
4+
name: "Pivot item tab",
5+
schema: PivotItemTabSchema,
6+
component: PivotItemTab,
7+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://json-schema.org/schema#",
3+
"title": "Pivot Item Tab",
4+
"description": "A pivot item tab component's schema definition.",
5+
"id": "pivot-item-tab",
6+
"type": "object",
7+
"properties": {},
8+
"reactProperties": {
9+
"children": {
10+
"title": "Children",
11+
"type": "children",
12+
"defaults": [
13+
"text"
14+
]
15+
}
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from "react";
2+
3+
export interface PivotItemTabProps {
4+
className?: string;
5+
children?: React.ReactNode;
6+
}
7+
8+
/**
9+
* A stand-in a mock pivot tab
10+
*/
11+
export default class PivotItemTab extends React.Component<PivotItemTabProps, {}> {
12+
public render(): React.ReactNode {
13+
return <div className={this.props.className}>{this.props.children}</div>;
14+
}
15+
}

packages/fast-components-react-msft/app/examples.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export { NumberFieldExamples };
6464
import ParagraphExamples from "../src/paragraph/examples.data";
6565
export { ParagraphExamples };
6666

67+
import PivotExamples from "../src/pivot/examples.data";
68+
export { PivotExamples };
69+
6770
import ProgressExamples from "../src/progress/examples.data";
6871
export { ProgressExamples };
6972

0 commit comments

Comments
 (0)