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

[docs-theme] fix: export DocsExampleProps type alias #6201

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as React from "react";

import { Callout, Code, H5, Intent, Switch } from "@blueprintjs/core";
import { Example, handleBooleanChange, IDocsExampleProps } from "@blueprintjs/docs-theme";
import { DocsExampleProps, Example, handleBooleanChange } from "@blueprintjs/docs-theme";
import { IconName } from "@blueprintjs/icons";

import { IconSelect } from "./common/iconSelect";
Expand All @@ -29,7 +29,7 @@ interface CalloutExampleState {
showHeader: boolean;
}

export class CalloutExample extends React.PureComponent<IDocsExampleProps, CalloutExampleState> {
export class CalloutExample extends React.PureComponent<DocsExampleProps, CalloutExampleState> {
public state: CalloutExampleState = { showHeader: true };

private handleHeaderChange = handleBooleanChange((showHeader: boolean) => this.setState({ showHeader }));
Expand Down
9 changes: 6 additions & 3 deletions packages/docs-theme/src/components/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ export interface ExampleProps<T = {}> extends Props {
data?: T;
}

/** @deprecated use DocsExampleProps */
export type IDocsExampleProps = DocsExampleProps;

/**
* Props supported by the `Example` component.
* Additional props will be spread to the root `<div>` element.
*/
export interface IDocsExampleProps extends ExampleProps {
export interface DocsExampleProps extends ExampleProps {
children?: React.ReactNode;

/**
Expand Down Expand Up @@ -107,8 +110,8 @@ export interface IDocsExampleProps extends ExampleProps {
* }
* ```
*/
export class Example extends React.PureComponent<IDocsExampleProps> {
public static defaultProps: Partial<IDocsExampleProps> = {
export class Example extends React.PureComponent<DocsExampleProps> {
public static defaultProps: Partial<DocsExampleProps> = {
forceUpdate: true,
showOptionsBelowExample: false,
};
Expand Down