@khanacademy/wonder-blocks-link
Advanced tools
Comparing version 3.1.4 to 3.2.0
@@ -7,2 +7,3 @@ // @flow | ||
import type {AriaProps, StyleType} from "@khanacademy/wonder-blocks-core"; | ||
import type {Typography} from "@khanacademy/wonder-blocks-typography"; | ||
import LinkCore from "./link-core.js"; | ||
@@ -14,5 +15,5 @@ | ||
/** | ||
* Text to appear on the link. | ||
* Text to appear on the link. It can be a plain text or a Typography element. | ||
*/ | ||
children: string, | ||
children: string | React.Element<Typography>, | ||
@@ -19,0 +20,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
Link example: | ||
### Example: Link | ||
@@ -22,1 +22,16 @@ ```js | ||
``` | ||
### Example: Link with Typography element | ||
You can also use a Typography element instead of just plain text. | ||
```js | ||
const {HeadingSmall} = require("@khanacademy/wonder-blocks-typography"); | ||
const {View} = require("@khanacademy/wonder-blocks-core"); | ||
<View> | ||
<Link href="#nonexistent-link"> | ||
<HeadingSmall>Heading inside a Link element</HeadingSmall> | ||
</Link> | ||
</View> | ||
``` |
@@ -57,2 +57,16 @@ // This file is auto-generated by gen-snapshot-tests.js | ||
}); | ||
it("example 2", () => { | ||
const {HeadingSmall} = require("@khanacademy/wonder-blocks-typography"); | ||
const {View} = require("@khanacademy/wonder-blocks-core"); | ||
const example = ( | ||
<View> | ||
<Link href="#nonexistent-link"> | ||
<HeadingSmall>Heading inside a Link element</HeadingSmall> | ||
</Link> | ||
</View> | ||
); | ||
const tree = renderer.create(example).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
{ | ||
"name": "@khanacademy/wonder-blocks-link", | ||
"version": "3.1.4", | ||
"version": "3.2.0", | ||
"design": "v1", | ||
@@ -18,4 +18,4 @@ "publishConfig": { | ||
"dependencies": { | ||
"@khanacademy/wonder-blocks-color": "^1.1.4", | ||
"@khanacademy/wonder-blocks-core": "^2.3.0" | ||
"@khanacademy/wonder-blocks-color": "^1.1.5", | ||
"@khanacademy/wonder-blocks-core": "^2.3.1" | ||
}, | ||
@@ -22,0 +22,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68351
1102