-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * 🌟 Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
- Loading branch information
Showing
37 changed files
with
973 additions
and
694 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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2015 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the terms of the LICENSE file distributed with this project. | ||
*/ | ||
|
||
import * as React from "react"; | ||
|
||
export const Logo: React.SFC = () => ( | ||
<svg width="65" height="76" xmlns="http://www.w3.org/2000/svg"> | ||
<g fillRule="nonzero"> | ||
<path d="M28.795 2.421l2.177-1.254a4 4 0 0 1 4.039.027l28.032 16.643A4 4 0 0 1 65 21.277v33.446a4 4 0 0 1-1.958 3.44l-28.03 16.644a4 4 0 0 1-4.039.027L2.004 58.154A4 4 0 0 1 0 54.687V21.313a4 4 0 0 1 2.004-3.467l26.79-15.425zm3.175.48l-.499-.867v-1h3.742L32.01 2.878a2.008 2.008 0 0 0-.04.023zM3.002 19.58A2 2 0 0 0 2 21.313v33.374a2 2 0 0 0 1.002 1.733l28.97 16.68a2 2 0 0 0 2.018-.013l28.03-16.644a2 2 0 0 0 .98-1.72V21.277a2 2 0 0 0-.979-1.72L33.99 2.914a2 2 0 0 0-1.98-.036L3.003 19.58z" /> | ||
<path d="M34.512 19.74L49 28.435v20.132l-15.984 9.59-.506-.284-14.98-8.427A3 3 0 0 1 16 46.83V28.415l15.497-8.717a3 3 0 0 1 3.015.043zM47 29.567l-13.518-8.11a1 1 0 0 0-1.005-.015L18 29.585V46.83a1 1 0 0 0 .51.871l14.474 8.143L47 47.434V29.566z" /> | ||
<path d="M.396 21.602l.97-1.749 26.238 14.545-.97 1.749z" /> | ||
<path d="M23.396 34.602l.97-1.749 26.238 14.545-.97 1.749z" /> | ||
<path d="M33 20l-16 9v19l16-9V20zm30 0l-16 9v20l16-9V20z" /> | ||
<path d="M63 39l-16 9v19l16-9z" /> | ||
<path d="M49 47l-16 9v19l16-9z" /> | ||
</g> | ||
</svg> | ||
); |
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,103 @@ | ||
/* | ||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the terms of the LICENSE file distributed with this project. | ||
*/ | ||
|
||
import { | ||
Classes, | ||
Hotkey, | ||
Hotkeys, | ||
HotkeysTarget, | ||
Icon, | ||
Menu, | ||
MenuItem, | ||
NavbarHeading, | ||
Popover, | ||
Position, | ||
Tag, | ||
} from "@blueprintjs/core"; | ||
import { IPackageInfo } from "@blueprintjs/docs-data"; | ||
import { NavButton } from "@blueprintjs/docs-theme"; | ||
import classNames from "classnames"; | ||
import * as React from "react"; | ||
import { Logo } from "./logo"; | ||
|
||
export interface INavHeaderProps { | ||
onToggleDark: (useDark: boolean) => void; | ||
useDarkTheme: boolean; | ||
versions: IPackageInfo[]; | ||
} | ||
|
||
@HotkeysTarget | ||
export class NavHeader extends React.PureComponent<INavHeaderProps, {}> { | ||
public render() { | ||
const { useDarkTheme } = this.props; | ||
return ( | ||
<> | ||
<div className="docs-nav-title"> | ||
<a className="docs-logo" href="/"> | ||
<Logo /> | ||
</a> | ||
<div> | ||
<NavbarHeading className="docs-heading"> | ||
<span>Blueprint</span> {this.renderVersionsMenu()} | ||
</NavbarHeading> | ||
<a className={Classes.TEXT_MUTED} href="https://github.com/palantir/blueprint" target="_blank"> | ||
<small>View on GitHub</small> | ||
</a> | ||
</div> | ||
</div> | ||
<div className="docs-nav-divider" /> | ||
<NavButton | ||
icon={useDarkTheme ? "flash" : "moon"} | ||
hotkey="shift + d" | ||
text={useDarkTheme ? "Light theme" : "Dark theme"} | ||
onClick={this.handleDarkSwitchChange} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
public renderHotkeys() { | ||
return ( | ||
<Hotkeys> | ||
<Hotkey | ||
global={true} | ||
combo="shift + d" | ||
label="Toggle dark theme" | ||
onKeyDown={this.handleDarkSwitchChange} | ||
/> | ||
</Hotkeys> | ||
); | ||
} | ||
|
||
private renderVersionsMenu() { | ||
const { versions } = this.props; | ||
if (versions.length === 1) { | ||
return ( | ||
<div className="pt-text-muted" key="_versions"> | ||
v{versions[0].version} | ||
</div> | ||
); | ||
} | ||
|
||
const match = /docs\/v([0-9]+)/.exec(location.href); | ||
// default to latest release if we can't find a major version in the URL | ||
const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; | ||
const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); | ||
const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; | ||
|
||
return ( | ||
<Popover content={menu} position={Position.BOTTOM} key="_versions"> | ||
<Tag className={classNames(Classes.INTERACTIVE, Classes.MINIMAL, Classes.ROUND)}> | ||
v{currentRelease.split(".", 1)} <Icon icon="caret-down" /> | ||
</Tag> | ||
</Popover> | ||
); | ||
} | ||
|
||
private handleDarkSwitchChange = () => { | ||
this.props.onToggleDark(!this.props.useDarkTheme); | ||
}; | ||
} |
Oops, something went wrong.
aa7c736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2.0] docs site redesign! (#2243)
Preview: documentation | landing | table