Upgrade Storybook
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
8c966dfbd8
commit
502ea174ab
328 changed files with 10863 additions and 12432 deletions
|
@ -2,8 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import { select } from '@storybook/addon-knobs';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { Meta } from '@storybook/react';
|
||||
import type { PropsType } from './DialogUpdate';
|
||||
import { DialogUpdate } from './DialogUpdate';
|
||||
import { DialogType } from '../types/Dialogs';
|
||||
import { WidthBreakpoint } from './_util';
|
||||
|
@ -29,15 +30,13 @@ const defaultProps = {
|
|||
|
||||
export default {
|
||||
title: 'Components/DialogUpdate',
|
||||
};
|
||||
argTypes: {},
|
||||
args: {},
|
||||
} satisfies Meta<PropsType>;
|
||||
|
||||
export function KnobsPlayground(): JSX.Element {
|
||||
const containerWidthBreakpoint = select(
|
||||
'containerWidthBreakpoint',
|
||||
WidthBreakpoint,
|
||||
WidthBreakpoint.Wide
|
||||
);
|
||||
const dialogType = select('dialogType', DialogType, DialogType.AutoUpdate);
|
||||
const containerWidthBreakpoint = WidthBreakpoint.Wide;
|
||||
const dialogType = DialogType.AutoUpdate;
|
||||
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={containerWidthBreakpoint}>
|
||||
|
@ -64,10 +63,6 @@ export function UpdateWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
UpdateWide.story = {
|
||||
name: 'Update (Wide)',
|
||||
};
|
||||
|
||||
export function DownloadedWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -81,10 +76,6 @@ export function DownloadedWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadedWide.story = {
|
||||
name: 'Downloaded (Wide)',
|
||||
};
|
||||
|
||||
export function DownloadReadyWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -99,10 +90,6 @@ export function DownloadReadyWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadReadyWide.story = {
|
||||
name: 'DownloadReady (Wide)',
|
||||
};
|
||||
|
||||
export function FullDownloadReadyWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -117,10 +104,6 @@ export function FullDownloadReadyWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
FullDownloadReadyWide.story = {
|
||||
name: 'FullDownloadReady (Wide)',
|
||||
};
|
||||
|
||||
export function DownloadingWide(): JSX.Element {
|
||||
const [downloadedSize, setDownloadedSize] = React.useState(0);
|
||||
|
||||
|
@ -153,10 +136,6 @@ export function DownloadingWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadingWide.story = {
|
||||
name: 'Downloading (Wide)',
|
||||
};
|
||||
|
||||
export function CannotUpdateWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -170,10 +149,6 @@ export function CannotUpdateWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateWide.story = {
|
||||
name: 'Cannot_Update (Wide)',
|
||||
};
|
||||
|
||||
export function CannotUpdateBetaWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -187,10 +162,6 @@ export function CannotUpdateBetaWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateBetaWide.story = {
|
||||
name: 'Cannot_Update_Beta (Wide)',
|
||||
};
|
||||
|
||||
export function CannotUpdateRequireManualWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -204,10 +175,6 @@ export function CannotUpdateRequireManualWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateRequireManualWide.story = {
|
||||
name: 'Cannot_Update_Require_Manual (Wide)',
|
||||
};
|
||||
|
||||
export function CannotUpdateRequireManualBetaWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -221,10 +188,6 @@ export function CannotUpdateRequireManualBetaWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateRequireManualBetaWide.story = {
|
||||
name: 'Cannot_Update_Require_Manual_Beta (Wide)',
|
||||
};
|
||||
|
||||
export function MacOSReadOnlyWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -238,10 +201,6 @@ export function MacOSReadOnlyWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
MacOSReadOnlyWide.story = {
|
||||
name: 'MacOS_Read_Only (Wide)',
|
||||
};
|
||||
|
||||
export function UnsupportedOSWide(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Wide}>
|
||||
|
@ -255,10 +214,6 @@ export function UnsupportedOSWide(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
UnsupportedOSWide.story = {
|
||||
name: 'UnsupportedOS (Wide)',
|
||||
};
|
||||
|
||||
export function UpdateNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -272,10 +227,6 @@ export function UpdateNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
UpdateNarrow.story = {
|
||||
name: 'Update (Narrow)',
|
||||
};
|
||||
|
||||
export function DownloadedNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -289,10 +240,6 @@ export function DownloadedNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadedNarrow.story = {
|
||||
name: 'Downloaded (Narrow)',
|
||||
};
|
||||
|
||||
export function DownloadReadyNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -307,10 +254,6 @@ export function DownloadReadyNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadReadyNarrow.story = {
|
||||
name: 'DownloadReady (Narrow)',
|
||||
};
|
||||
|
||||
export function FullDownloadReadyNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -325,10 +268,6 @@ export function FullDownloadReadyNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
FullDownloadReadyNarrow.story = {
|
||||
name: 'FullDownloadReady (Narrow)',
|
||||
};
|
||||
|
||||
export function DownloadingNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -342,10 +281,6 @@ export function DownloadingNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
DownloadingNarrow.story = {
|
||||
name: 'Downloading (Narrow)',
|
||||
};
|
||||
|
||||
export function CannotUpdateNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -359,10 +294,6 @@ export function CannotUpdateNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateNarrow.story = {
|
||||
name: 'Cannot Update (Narrow)',
|
||||
};
|
||||
|
||||
export function CannotUpdateBetaNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -376,10 +307,6 @@ export function CannotUpdateBetaNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateBetaNarrow.story = {
|
||||
name: 'Cannot Update Beta (Narrow)',
|
||||
};
|
||||
|
||||
export function CannotUpdateRequireManualNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -393,10 +320,6 @@ export function CannotUpdateRequireManualNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateRequireManualNarrow.story = {
|
||||
name: 'Cannot_Update_Require_Manual (Narrow)',
|
||||
};
|
||||
|
||||
export function CannotUpdateRequireManualBetaNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -410,10 +333,6 @@ export function CannotUpdateRequireManualBetaNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
CannotUpdateRequireManualBetaNarrow.story = {
|
||||
name: 'Cannot_Update_Require_Manual_Beta (Narrow)',
|
||||
};
|
||||
|
||||
export function MacOSReadOnlyNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -427,10 +346,6 @@ export function MacOSReadOnlyNarrow(): JSX.Element {
|
|||
);
|
||||
}
|
||||
|
||||
MacOSReadOnlyNarrow.story = {
|
||||
name: 'MacOS_Read_Only (Narrow)',
|
||||
};
|
||||
|
||||
export function UnsupportedOSNarrow(): JSX.Element {
|
||||
return (
|
||||
<FakeLeftPaneContainer containerWidthBreakpoint={WidthBreakpoint.Narrow}>
|
||||
|
@ -443,7 +358,3 @@ export function UnsupportedOSNarrow(): JSX.Element {
|
|||
</FakeLeftPaneContainer>
|
||||
);
|
||||
}
|
||||
|
||||
UnsupportedOSNarrow.story = {
|
||||
name: 'UnsupportedOS (Narrow)',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue