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

feat: add hypertext component #210

Merged
merged 27 commits into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added hypertext references in react-msft and styles-msft
  • Loading branch information
marjonlynch committed Apr 13, 2018
commit ab9456964fd35b518adc622d7ec7ac58f9945d8e
4 changes: 4 additions & 0 deletions packages/fast-components-react-base/app/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ export {ButtonExamples};

import HypertextExamples from "../src/hypertext/examples.data";
export {HypertextExamples};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing :)

<<<<<<< HEAD
>>>>>>> renamed all to hypertext from hyperlink
=======

>>>>>>> added hypertext references in react-msft and styles-msft
3 changes: 3 additions & 0 deletions packages/fast-components-react-msft/app/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ export { ToggleExamples };

import TypographyExamples from "../src/typography/examples.data";
export { TypographyExamples };

import HypertextExamples from "../src/hypertext/examples.data";
export {HypertextExamples};
14 changes: 14 additions & 0 deletions packages/fast-components-react-msft/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ import Site, {
} from "@microsoft/fast-development-site-react";
import * as examples from "./examples";

<<<<<<< HEAD
=======
const items: ICategoryProps[] = [
{
name: "Fast Components",
items: [
examples.ButtonExamples,
examples.DividerExamples
examples.HypertextExamples
]
}
];

>>>>>>> added hypertext references in react-msft and styles-msft
/**
* Create the root node
*/
Expand Down
16 changes: 16 additions & 0 deletions packages/fast-components-react-msft/src/hypertext/examples.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {ICategoryItemProps} from "@microsoft/fast-development-site-react";
import {IGenericExample} from "../examples";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want to do a rebase and replace IGenericExample with ISnapshots.... Little bit of a refactor, unfortunately.

import {IManagedClasses} from "@microsoft/fast-jss-manager-react";
import Hypertext from "./index";
import {IHypertextProps} from "@microsoft/fast-components-react-base";

export default {
name: "hypertext",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add an example that does not include an href?

component: Hypertext,
data: [
{
href: "https://msdn.microsoft.com",
children: "Hyper text"
}
]
} as IGenericExample<IHypertextProps>;
6 changes: 6 additions & 0 deletions packages/fast-components-react-msft/src/hypertext/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from "react";
import { Hypertext, IFoundationProps, IHypertextClassNameContract, IHypertextProps } from "@microsoft/fast-components-react-base";
import manageJss from "@microsoft/fast-jss-manager-react";
import {HypertextStyles} from "@microsoft/fast-components-styles-msft";

export default manageJss(HypertextStyles)(Hypertext);
3 changes: 3 additions & 0 deletions packages/fast-components-react-msft/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ export {Image};

import Toggle from "./toggle";
export { Toggle };

import Hypertext from "./hypertext";
export { Hypertext };
16 changes: 16 additions & 0 deletions packages/fast-components-styles-msft/src/hypertext/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {IDesignSystem} from "../design-system";
import {ComponentStyles} from "@microsoft/fast-jss-manager";
import {IHypertextClassNameContract} from "@microsoft/fast-components-class-name-contracts";

const styles: ComponentStyles<IHypertextClassNameContract, IDesignSystem> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if you, kham, and Jeff want to jump on a session to do one of these.

hypertext: {
color: (config: IDesignSystem): string => {
return config.foregroundColor;
},
backgroundColor: (config: IDesignSystem): string => {
return config.brandColor;
}
},
};

export default styles;
3 changes: 3 additions & 0 deletions packages/fast-components-styles-msft/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import ButtonStyles from "./button";
export { ButtonStyles };

import HypertextStyles from "./hypertext";
export {HypertextStyles};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not barking from a tslint standpoint, but can you follow the convention of including spaces on export statements?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I knew about that just missed this one. Doh!


/**
* Export design system defaults and typings
*/
Expand Down