|
| 1 | +/* |
| 2 | + * Copyright 2025 Adobe. All rights reserved. |
| 3 | + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. You may obtain a copy |
| 5 | + * of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under |
| 8 | + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS |
| 9 | + * OF ANY KIND, either express or implied. See the License for the specific language |
| 10 | + * governing permissions and limitations under the License. |
| 11 | + */ |
| 12 | + |
| 13 | +import type {Meta, StoryObj} from '@storybook/react'; |
| 14 | +import {NotificationBadge} from '../src/NotificationBadge'; |
| 15 | +import {StaticColorDecorator} from '../stories/utils'; |
| 16 | + |
| 17 | +const meta: Meta<typeof NotificationBadge> = { |
| 18 | + component: NotificationBadge, |
| 19 | + parameters: { |
| 20 | + chromaticProvider: {disableAnimations: true} |
| 21 | + }, |
| 22 | + decorators: [StaticColorDecorator], |
| 23 | + title: 'S2 Chromatic/NotificationBadge' |
| 24 | +}; |
| 25 | + |
| 26 | +export default meta; |
| 27 | + |
| 28 | +type Story = StoryObj<typeof NotificationBadge>; |
| 29 | +export const Example: Story = { |
| 30 | + render: (args) => { |
| 31 | + return ( |
| 32 | + <div style={{display: 'flex', flexWrap: 'wrap', gap: 8, maxWidth: '600px'}}> |
| 33 | + <NotificationBadge {...args} /> |
| 34 | + <NotificationBadge {...args} value={1} /> |
| 35 | + <NotificationBadge {...args} value={24} /> |
| 36 | + <NotificationBadge {...args} value={100} /> |
| 37 | + </div> |
| 38 | + ); |
| 39 | + } |
| 40 | +}; |
0 commit comments