From d1d9ae0e6b5a0e3246521d817f3cd58fced9af1f Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Fri, 31 Mar 2017 13:06:11 -0700 Subject: [PATCH] [DM] update docs files and links (#927) * markdownify Text and DateRangeInput docs * fix all the links i could find --- packages/core/src/components/_index.scss | 1 - packages/core/src/components/alert/alert.md | 4 +- .../src/components/breadcrumbs/breadcrumbs.md | 8 ++-- packages/core/src/components/button/button.md | 4 +- .../core/src/components/collapse/collapse.md | 2 +- .../collapsible-list/collapsible-list.md | 4 +- packages/core/src/components/components.md | 1 + .../components/context-menu/context-menu.md | 14 +++--- packages/core/src/components/dialog/dialog.md | 16 +++---- .../components/editable-text/editable-text.md | 11 ++--- .../core/src/components/forms/checkbox.md | 2 +- .../core/src/components/forms/form-group.md | 4 +- .../core/src/components/forms/input-group.md | 14 +++--- packages/core/src/components/forms/input.md | 6 +-- .../src/components/forms/numeric-input.md | 4 +- packages/core/src/components/forms/radio.md | 2 +- packages/core/src/components/forms/select.md | 4 +- packages/core/src/components/forms/switch.md | 4 +- packages/core/src/components/menu/menu.md | 20 ++++----- .../non-ideal-state/non-ideal-state.md | 4 +- .../core/src/components/overlay/overlay.md | 6 +-- .../core/src/components/popover/popover.md | 12 ++--- packages/core/src/components/portal/portal.md | 6 +-- .../src/components/progress/progress-bar.md | 4 +- .../core/src/components/spinner/spinner.md | 6 +-- packages/core/src/components/tabs/tabs.md | 12 ++--- packages/core/src/components/tabs2/tabs2.md | 7 +-- packages/core/src/components/tag/tag.md | 2 +- .../components/text/{_text.scss => text.md} | 19 ++------ packages/core/src/components/toast/toast.md | 10 ++--- .../core/src/components/tooltip/tooltip.md | 8 ++-- packages/core/src/components/tree/tree.md | 6 +-- packages/core/src/docs/colors.md | 4 +- packages/core/src/docs/variables.md | 2 +- packages/datetime/src/_daterangeinput.scss | 45 ------------------- packages/datetime/src/blueprint-datetime.scss | 1 - packages/datetime/src/dateinput.md | 6 +-- packages/datetime/src/datepicker.md | 2 +- packages/datetime/src/daterangeinput.md | 28 ++++++++++++ packages/datetime/src/daterangepicker.md | 2 +- packages/datetime/src/datetimepicker.md | 6 +-- packages/datetime/src/index.md | 13 +++--- packages/datetime/src/timepicker.md | 2 +- packages/docs-site/src/blueprint.md | 2 +- packages/table/README.md | 2 +- packages/table/src/docs.md | 2 +- 46 files changed, 158 insertions(+), 186 deletions(-) rename packages/core/src/components/text/{_text.scss => text.md} (53%) delete mode 100644 packages/datetime/src/_daterangeinput.scss create mode 100644 packages/datetime/src/daterangeinput.md diff --git a/packages/core/src/components/_index.scss b/packages/core/src/components/_index.scss index 5e0259225b..994565cac0 100644 --- a/packages/core/src/components/_index.scss +++ b/packages/core/src/components/_index.scss @@ -19,7 +19,6 @@ @import "navbar/navbar"; @import "non-ideal-state/non-ideal-state"; @import "overlay/overlay"; -@import "text/text"; @import "popover/popover"; @import "portal/portal"; @import "progress/progress-bar"; diff --git a/packages/core/src/components/alert/alert.md b/packages/core/src/components/alert/alert.md index c51e51cddd..8795b3d3fd 100644 --- a/packages/core/src/components/alert/alert.md +++ b/packages/core/src/components/alert/alert.md @@ -3,7 +3,7 @@ Alerts notify users of important information and force them to acknowledge the alert content before continuing. -Although similar to [dialogs](#components.dialog), alerts are more restrictive and should only be +Although similar to [dialogs](#core/components/dialog), alerts are more restrictive and should only be used for important informations. The user can only exit the alert by clicking one of the confirmation buttons—clicking the overlay or pressing the `esc` key will not close the alert. @@ -16,6 +16,6 @@ to show the type of the alert. @## JavaScript API The `Alert` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). @interface IAlertProps diff --git a/packages/core/src/components/breadcrumbs/breadcrumbs.md b/packages/core/src/components/breadcrumbs/breadcrumbs.md index 3160a6e6f4..f7fee97bec 100644 --- a/packages/core/src/components/breadcrumbs/breadcrumbs.md +++ b/packages/core/src/components/breadcrumbs/breadcrumbs.md @@ -15,18 +15,18 @@ user to that resource. * Mark the final breadcrumb `.pt-breadcrumb-current` for an emphasized appearance. * The `.pt-breadcrumbs-collapsed` button-like element can be used as the target for a dropdown menu containing breadcrumbs that are collapsed due to layout constraints. -* When adding another element (such as a [tooltip](#components.tooltip) or -[popover](#components.popover)) to a breadcrumb, wrap it around the contents of the `li`. +* When adding another element (such as a [tooltip](#core/components/tooltip) or +[popover](#core/components/popover)) to a breadcrumb, wrap it around the contents of the `li`. @css pt-breadcrumbs @## JavaScript API The `Breadcrumb` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). The component renders an `a.pt-breadcrumb`. You are responsible for constructing -the `ul.pt-breadcrumbs` list. [`CollapsibleList`](#components.collapsiblelist) +the `ul.pt-breadcrumbs` list. [`CollapsibleList`](#core/components/collapsiblelist) works nicely with this component because its props are a subset of `IMenuItemProps`. @interface IBreadcrumbProps diff --git a/packages/core/src/components/button/button.md b/packages/core/src/components/button/button.md index 5527ccd1c6..d6634f79d3 100644 --- a/packages/core/src/components/button/button.md +++ b/packages/core/src/components/button/button.md @@ -47,10 +47,10 @@ Note that minimal buttons are _not supported_ in button groups at this time. @## JavaScript API The `Button` and `AnchorButton` components are available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). Button components render buttons with Blueprint classes and attributes. -See the [Buttons CSS docs](#components.button.css) for styling options. +See the [Buttons CSS docs](#core/components/button.css-api) for styling options. You can provide your own props to these components as if they were regular JSX HTML elements. If you provide a `className` prop, the class names you provide will be added alongside of the default diff --git a/packages/core/src/components/collapse/collapse.md b/packages/core/src/components/collapse/collapse.md index a5328a25db..77b3679dd8 100644 --- a/packages/core/src/components/collapse/collapse.md +++ b/packages/core/src/components/collapse/collapse.md @@ -9,7 +9,7 @@ that can be expanded and collapsed. @## JavaScript API The `Collapse` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). Any content should be a child of the `Collapse` element. Content must be in the document flow (e.g. `position: absolute;` wouldn't work, as the parent element would inherit a height of 0). diff --git a/packages/core/src/components/collapsible-list/collapsible-list.md b/packages/core/src/components/collapsible-list/collapsible-list.md index 88f88d95a2..8b76bcf6fd 100644 --- a/packages/core/src/components/collapsible-list/collapsible-list.md +++ b/packages/core/src/components/collapsible-list/collapsible-list.md @@ -10,11 +10,11 @@ props from the `MenuItem` children. @## JavaScript API The `CollapsibleList` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). Children of the `CollapsibleList` component _must_ be `MenuItem`s so they can be easily rendered in the dropdown. Define a `renderVisibleItem` callback to customize the appearance of visible -items using their [`IMenuItemProps`](#components.menu.js.menu-item). +items using their [`IMenuItemProps`](#core/components/menu.menu-item). @interface ICollapsibleListProps diff --git a/packages/core/src/components/components.md b/packages/core/src/components/components.md index 1e82970c22..0ed89ce463 100644 --- a/packages/core/src/components/components.md +++ b/packages/core/src/components/components.md @@ -27,6 +27,7 @@ @page tabs @page tabs2 @page tag +@page text @page toast @page tooltip @page tree diff --git a/packages/core/src/components/context-menu/context-menu.md b/packages/core/src/components/context-menu/context-menu.md index 963541675e..8615d567e1 100644 --- a/packages/core/src/components/context-menu/context-menu.md +++ b/packages/core/src/components/context-menu/context-menu.md @@ -4,23 +4,23 @@ Context menus present the user with a custom list of actions upon right-click. You can create context menus in either of the following ways: -- by adding the `@ContextMenuTarget` [decorator](#components.context-menu.decorator) to a React -component that implements `renderContextMenu(): JSX.Element`. -- via the [imperative](#components.context-menu.js) `ContextMenu.show` and `ContextMenu.hide` API -methods, ideal for non-React-based applications. +- by adding the `@ContextMenuTarget` [decorator](#core/components/context-menu.javascript-api--decorator) + to a React component that implements `renderContextMenu(): JSX.Element`. +- via the [imperative](#core/components/context-menu.javascript-api--imperative) `ContextMenu.show` + and `ContextMenu.hide` API methods, ideal for non-React-based applications. @reactExample ContextMenuExample @## JavaScript API: decorator The `ContextMenuTarget` decorator is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). The `@ContextMenuTarget` [class decorator][ts-decorator] can be applied to any `React.Component` class that meets the following requirements: - It defines an instance method called `renderContextMenu()` that returns a single `JSX.Element` -(most likely a [`Menu`](#components.menu)). +(most likely a [`Menu`](#core/components/menu)). - Its root element supports the `"contextmenu"` event and the `onContextMenu` prop. This is always true if the decorated class uses an intrinsic element, such as `
`, as its @@ -66,7 +66,7 @@ class RightClickMe extends React.Component<{}, {}> { @## JavaScript API: imperative The `ContextMenu` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). The imperative API provides a single static `ContextMenu` object, enforcing the principle that only one context menu can be open at a time. diff --git a/packages/core/src/components/dialog/dialog.md b/packages/core/src/components/dialog/dialog.md index 8a1bd6a456..9f293a5e41 100644 --- a/packages/core/src/components/dialog/dialog.md +++ b/packages/core/src/components/dialog/dialog.md @@ -3,18 +3,18 @@ Dialogs present content overlaid over other parts of the UI.
-
Terminology note
-The term "modal" is sometimes used to mean "dialog," but this is a misnomer. -_Modal_ is an adjective that describes parts of a UI. -An element is considered modal if it -[blocks interaction with the rest of the application](https://en.wikipedia.org/wiki/Modal_window). -We use the term "dialog" to avoid confusion with the adjective. +
Terminology note
+ The term "modal" is sometimes used to mean "dialog," but this is a misnomer. + _Modal_ is an adjective that describes parts of a UI. + An element is considered modal if it + [blocks interaction with the rest of the application](https://en.wikipedia.org/wiki/Modal_window). + We use the term "dialog" to avoid confusion with the adjective.
@## JavaScript API The `Dialog` component is available in the __@blueprintjs/core__ package. -Make sure to review the [general usage docs for JS components](#components.usage). +Make sure to review the [general usage docs for JS components](#blueprint.usage). There are two ways to render dialogs: @@ -72,7 +72,7 @@ class DialogExample extends React.Component<{}, IDialogExampleState> { @## CSS API You can create dialogs manually using the HTML markup and `pt-dialog-*` classes below. -However, you should use the dialog [JavaScript APIs](#components.dialog.js) whenever possible, +However, you should use the dialog [JavaScript APIs](#core/components/dialog.javascript-api) whenever possible, as they automatically generate some of this markup. More examples of dialog content are shown below. diff --git a/packages/core/src/components/editable-text/editable-text.md b/packages/core/src/components/editable-text/editable-text.md index e6a8b78e89..ff600175d5 100644 --- a/packages/core/src/components/editable-text/editable-text.md +++ b/packages/core/src/components/editable-text/editable-text.md @@ -6,9 +6,10 @@ focuses it. The text input inherits all font styling from its ancestors, making the transition between reading and editing text seamless. -You might use this component for inline renaming, or for an [editable multiline -description](#components.editable.multiline). You should not use `EditableText` when a static -always-editable `` or `