New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@primer/blueprints

Package Overview
Dependencies
Maintainers
5
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@primer/blueprints - npm Package Compare versions

Comparing version 0.0.0-50692a4 to 0.0.0-5804f5b

src/PageLink.js

18

dist/index.esm.js

@@ -809,3 +809,3 @@ import React, { useEffect, useState } from 'react';

/**
* The NodeLink component takes an `href` and optional `children`.
* The PageLink component takes an `href` and optional `children`.
* If no `children` are provided, we look up the "node" of the corresponding

@@ -822,11 +822,11 @@ * page in the tree (the one whose `path` matches the given `href`) and use

*
* The following instance of NodeLink should render a link to "/foo/bar" with
* The following instance of PageLink should render a link to "/foo/bar" with
* "Foo Bar" as its text:
*
* ```jsx
* <NodeLink href="/foo/bar" />
* <PageLink href="/foo/bar" />
* ```
*/
function NodeLink(props) {
function PageLink(props) {
var href = props.href,

@@ -845,3 +845,3 @@ content = props.children;

}
NodeLink.displayName = "NodeLink";
PageLink.displayName = "PageLink";

@@ -853,3 +853,3 @@ var NavLink = withRouter(function (_ref) {

return React.createElement(Box, rest, React.createElement(NodeLink, _extends({
return React.createElement(Box, rest, React.createElement(PageLink, _extends({
href: href,

@@ -895,3 +895,3 @@ color: router.pathname === href ? 'black' : undefined,

/**
* A <Section.Link> is really just a <NodeLink> that's bold when its `href`
* A <Section.Link> is really just a <PageLink> that's bold when its `href`
* matches the current path, wrapped in a <Box> for whitespace.

@@ -904,3 +904,3 @@ */

return React.createElement(Box, rest, React.createElement(NodeLink, _extends({
return React.createElement(Box, rest, React.createElement(PageLink, _extends({
href: href

@@ -1132,2 +1132,2 @@ }, rest, {

export { ClipboardCopy, CodeExample, Contributors, Frame, Header, Link$1 as Link, NavLink, NavList, NodeLink, Outline, PackageHeader, RouteMatch, Router, Section, SideNav, StatusLabel, CommonStyles, CommonScripts, config, assetPrefix, assetPath, getAssetPath, requirePage, pathMap, pageTree, rootPage, sortCompare, nodeSort, addPath };
export { ClipboardCopy, CodeExample, Contributors, Frame, Header, Link$1 as Link, NavLink, NavList, Outline, PackageHeader, PageLink, RouteMatch, Router, Section, SideNav, StatusLabel, CommonStyles, CommonScripts, config, assetPrefix, assetPath, getAssetPath, requirePage, pathMap, pageTree, rootPage, sortCompare, nodeSort, addPath };

@@ -810,3 +810,3 @@ (function (global, factory) {

/**
* The NodeLink component takes an `href` and optional `children`.
* The PageLink component takes an `href` and optional `children`.
* If no `children` are provided, we look up the "node" of the corresponding

@@ -823,11 +823,11 @@ * page in the tree (the one whose `path` matches the given `href`) and use

*
* The following instance of NodeLink should render a link to "/foo/bar" with
* The following instance of PageLink should render a link to "/foo/bar" with
* "Foo Bar" as its text:
*
* ```jsx
* <NodeLink href="/foo/bar" />
* <PageLink href="/foo/bar" />
* ```
*/
function NodeLink(props) {
function PageLink(props) {
var href = props.href,

@@ -846,3 +846,3 @@ content = props.children;

}
NodeLink.displayName = "NodeLink";
PageLink.displayName = "PageLink";

@@ -854,3 +854,3 @@ var NavLink = router.withRouter(function (_ref) {

return React__default.createElement(components.Box, rest, React__default.createElement(NodeLink, _extends({
return React__default.createElement(components.Box, rest, React__default.createElement(PageLink, _extends({
href: href,

@@ -896,3 +896,3 @@ color: router$$1.pathname === href ? 'black' : undefined,

/**
* A <Section.Link> is really just a <NodeLink> that's bold when its `href`
* A <Section.Link> is really just a <PageLink> that's bold when its `href`
* matches the current path, wrapped in a <Box> for whitespace.

@@ -905,3 +905,3 @@ */

return React__default.createElement(components.Box, rest, React__default.createElement(NodeLink, _extends({
return React__default.createElement(components.Box, rest, React__default.createElement(PageLink, _extends({
href: href

@@ -1141,5 +1141,5 @@ }, rest, {

exports.NavList = NavList;
exports.NodeLink = NodeLink;
exports.Outline = Outline;
exports.PackageHeader = PackageHeader;
exports.PageLink = PageLink;
exports.RouteMatch = RouteMatch;

@@ -1146,0 +1146,0 @@ exports.Router = Router;

{
"name": "@primer/blueprints",
"version": "0.0.0-50692a4",
"version": "0.0.0-5804f5b",
"description": "Components for GitHub Documentation Sites",

@@ -5,0 +5,0 @@ "main": "dist/index.umd.js",

@@ -9,5 +9,5 @@ export {default as ClipboardCopy} from './ClipboardCopy'

export {default as NavList} from './NavList'
export {default as NodeLink} from './NodeLink'
export {default as Outline} from './Outline'
export {default as PackageHeader} from './PackageHeader'
export {default as PageLink} from './PageLink'
export {default as RouteMatch} from './RouteMatch'

@@ -14,0 +14,0 @@ export {default as Router} from './Router'

import React from 'react'
import {withRouter} from 'next/router'
import {Box} from '@primer/components'
import NodeLink from './NodeLink'
import PageLink from './PageLink'

@@ -9,3 +9,3 @@ const NavLink = withRouter(({href, router, ...rest}) => {

<Box {...rest}>
<NodeLink href={href} color={router.pathname === href ? 'black' : undefined} fontSize={1} {...rest} />
<PageLink href={href} color={router.pathname === href ? 'black' : undefined} fontSize={1} {...rest} />
</Box>

@@ -12,0 +12,0 @@ )

@@ -5,3 +5,3 @@ import React from 'react'

import NavList from './NavList'
import NodeLink from './NodeLink'
import PageLink from './PageLink'
import {addPath} from './utils'

@@ -32,3 +32,3 @@

/**
* A <Section.Link> is really just a <NodeLink> that's bold when its `href`
* A <Section.Link> is really just a <PageLink> that's bold when its `href`
* matches the current path, wrapped in a <Box> for whitespace.

@@ -38,3 +38,3 @@ */

<Box {...rest}>
<NodeLink href={href} {...rest} fontSize={2} fontWeight={router.pathname.startsWith(href) ? 'bold' : null} />
<PageLink href={href} {...rest} fontSize={2} fontWeight={router.pathname.startsWith(href) ? 'bold' : null} />
</Box>

@@ -41,0 +41,0 @@ ))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc