Rename gauge props to GaugeProps and export
Signed-off-by: James Turley <jamesturley@gocardless.com>
This commit is contained in:
@@ -100,7 +100,7 @@ export type BottomLinkProps = {
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Breadcrumbs(props: Props_21): JSX.Element;
|
||||
export function Breadcrumbs(props: Props_20): JSX.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
export type BreadcrumbsClickableTextClassKey = 'root';
|
||||
@@ -157,7 +157,7 @@ export interface CodeSnippetProps {
|
||||
// Warning: (ae-missing-release-tag) "Content" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Content(props: PropsWithChildren<Props_14>): JSX.Element;
|
||||
export function Content(props: PropsWithChildren<Props_13>): JSX.Element;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "ContentHeaderProps" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
@@ -368,10 +368,10 @@ export function FeatureCalloutCircular(
|
||||
// @public (undocumented)
|
||||
export type FiltersContainerClassKey = 'root' | 'title';
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-forgotten-export) The symbol "GaugeProps" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Gauge(props: Props_11): JSX.Element;
|
||||
export function Gauge(props: GaugeProps): JSX.Element;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
@@ -393,7 +393,7 @@ export function GroupIcon(props: IconComponentProps): JSX.Element;
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Header(props: PropsWithChildren<Props_15>): JSX.Element;
|
||||
export function Header(props: PropsWithChildren<Props_14>): JSX.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
export type HeaderClassKey =
|
||||
@@ -484,7 +484,7 @@ export type IconLinkVerticalProps = {
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function InfoCard(props: Props_16): JSX.Element;
|
||||
export function InfoCard(props: Props_15): JSX.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
export type InfoCardClassKey =
|
||||
@@ -565,7 +565,7 @@ export type LifecycleClassKey = 'alpha' | 'beta';
|
||||
// Warning: (ae-missing-release-tag) "LinearGauge" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function LinearGauge(props: Props_12): JSX.Element | null;
|
||||
export function LinearGauge(props: Props_11): JSX.Element | null;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "LinkType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
@@ -666,7 +666,7 @@ export type OverflowTooltipClassKey = 'container';
|
||||
// Warning: (ae-missing-release-tag) "Page" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Page(props: PropsWithChildren<Props_17>): JSX.Element;
|
||||
export function Page(props: PropsWithChildren<Props_16>): JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "PageClassKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
@@ -771,7 +771,7 @@ export type SelectInputBaseClassKey = 'root' | 'input';
|
||||
// Warning: (ae-missing-release-tag) "Sidebar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function Sidebar(props: PropsWithChildren<Props_18>): JSX.Element;
|
||||
export function Sidebar(props: PropsWithChildren<Props_17>): JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "SIDEBAR_INTRO_LOCAL_STORAGE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
@@ -1961,7 +1961,7 @@ export const SidebarSpacer: React_2.ComponentType<
|
||||
// Warning: (ae-missing-release-tag) "SignInPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function SignInPage(props: Props_19): JSX.Element;
|
||||
export function SignInPage(props: Props_18): JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "SignInPageClassKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
@@ -2050,7 +2050,7 @@ export function StatusWarning(props: PropsWithChildren<{}>): JSX.Element;
|
||||
// Warning: (ae-missing-release-tag) "StructuredMetadataTable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function StructuredMetadataTable(props: Props_13): JSX.Element;
|
||||
export function StructuredMetadataTable(props: Props_12): JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "StructuredMetadataTableListClassKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
@@ -2132,7 +2132,7 @@ export type TabBarClassKey = 'indicator' | 'flexContainer' | 'root';
|
||||
// Warning: (ae-missing-release-tag) "TabbedCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export function TabbedCard(props: PropsWithChildren<Props_20>): JSX.Element;
|
||||
export function TabbedCard(props: PropsWithChildren<Props_19>): JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "TabbedCardClassKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
||||
@@ -46,7 +46,7 @@ const useStyles = makeStyles<BackstageTheme>(
|
||||
{ name: 'BackstageGauge' },
|
||||
);
|
||||
|
||||
type Props = {
|
||||
export type GaugeProps = {
|
||||
value: number;
|
||||
fractional?: boolean;
|
||||
inverse?: boolean;
|
||||
@@ -66,7 +66,7 @@ export type GetColor = (
|
||||
args: GetColorArgs,
|
||||
) => string | BackstageTheme['palette']['error'];
|
||||
|
||||
const defaultProps = {
|
||||
const defaultGaugeProps = {
|
||||
fractional: true,
|
||||
inverse: false,
|
||||
unit: '%',
|
||||
@@ -83,7 +83,7 @@ export const getProgressColor: GetColor = ({
|
||||
return '#ddd';
|
||||
}
|
||||
|
||||
const actualMax = max ? max : defaultProps.max;
|
||||
const actualMax = max ? max : defaultGaugeProps.max;
|
||||
const actualValue = inverse ? actualMax - value : value;
|
||||
|
||||
if (actualValue < actualMax / 3) {
|
||||
@@ -96,12 +96,12 @@ export const getProgressColor: GetColor = ({
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export function Gauge(props: Props) {
|
||||
export function Gauge(props: GaugeProps) {
|
||||
const { getColor = getProgressColor } = props;
|
||||
const classes = useStyles(props);
|
||||
const { palette } = useTheme<BackstageTheme>();
|
||||
const { value, fractional, inverse, unit, max } = {
|
||||
...defaultProps,
|
||||
...defaultGaugeProps,
|
||||
...props,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user