|
1 | 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. |
2 | 2 |
|
3 | | -/** |
4 | | - * @file Spinner.stories.tsx |
5 | | - * @input Spinner, React state, and theme fixtures |
6 | | - * @output Spinner examples and a repeatable conditional-announcement scenario |
7 | | - * @position Storybook visual and assistive-technology verification surface |
8 | | - */ |
9 | | - |
10 | | -import {StrictMode, useState, type CSSProperties} from 'react'; |
| 3 | +import type {CSSProperties} from 'react'; |
11 | 4 | import type {Meta, StoryObj} from '@storybook/react'; |
12 | 5 | import {Spinner} from '@astryxdesign/core/Spinner'; |
13 | | -import {Button} from '@astryxdesign/core/Button'; |
14 | 6 | import {Text} from '@astryxdesign/core/Text'; |
15 | 7 | import {HStack, VStack} from '@astryxdesign/core/Layout'; |
16 | 8 | import {Theme, defineTheme} from '@astryxdesign/core/theme'; |
@@ -57,31 +49,6 @@ export const Default: Story = { |
57 | 49 | }, |
58 | 50 | }; |
59 | 51 |
|
60 | | -export const ConditionalAppearance: Story = { |
61 | | - render: function ConditionalAppearance() { |
62 | | - const [isLoading, setIsLoading] = useState(false); |
63 | | - const [renderCount, setRenderCount] = useState(0); |
64 | | - return ( |
65 | | - <StrictMode> |
66 | | - <VStack gap={4}> |
67 | | - <HStack gap={2}> |
68 | | - <Button |
69 | | - label={isLoading ? 'Finish loading' : 'Start loading'} |
70 | | - onClick={() => setIsLoading(value => !value)} |
71 | | - /> |
72 | | - <Button |
73 | | - label="Rerender" |
74 | | - onClick={() => setRenderCount(value => value + 1)} |
75 | | - /> |
76 | | - </HStack> |
77 | | - <Text>Rerenders: {renderCount}</Text> |
78 | | - {isLoading && <Spinner label="Loading results" />} |
79 | | - </VStack> |
80 | | - </StrictMode> |
81 | | - ); |
82 | | - }, |
83 | | -}; |
84 | | - |
85 | 52 | export const Sizes: Story = { |
86 | 53 | render: () => ( |
87 | 54 | <HStack gap={4} vAlign="center"> |
|
0 commit comments