|
| 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 {action} from '@storybook/addon-actions'; |
| 14 | +import type {Meta, StoryObj} from '@storybook/react'; |
| 15 | +import PaperAirplane from '../spectrum-illustrations/linear/Paperairplane'; |
| 16 | +import React from 'react'; |
| 17 | +import {SelectBox, SelectBoxGroup, Text} from '../src'; |
| 18 | +import Server from '../spectrum-illustrations/linear/Server'; |
| 19 | + |
| 20 | +const meta: Meta<typeof SelectBoxGroup> = { |
| 21 | + component: SelectBoxGroup, |
| 22 | + parameters: { |
| 23 | + chromaticProvider: {disableAnimations: true} |
| 24 | + }, |
| 25 | + title: 'S2 Chromatic/SelectBoxGroup' |
| 26 | +}; |
| 27 | + |
| 28 | +export default meta; |
| 29 | +type Story = StoryObj<typeof SelectBoxGroup>; |
| 30 | + |
| 31 | +export const VerticalOrientation: Story = { |
| 32 | + render: () => ( |
| 33 | + <div style={{width: 600}}> |
| 34 | + <SelectBoxGroup |
| 35 | + orientation="vertical" |
| 36 | + onSelectionChange={action('onSelectionChange')}> |
| 37 | + <SelectBox value="text-only"> |
| 38 | + <Text slot="label">V: Text Only</Text> |
| 39 | + </SelectBox> |
| 40 | + <SelectBox value="illustration-text"> |
| 41 | + <Server /> |
| 42 | + <Text slot="label">V: Illustration + Text</Text> |
| 43 | + </SelectBox> |
| 44 | + <SelectBox value="illustration-desc"> |
| 45 | + <PaperAirplane /> |
| 46 | + </SelectBox> |
| 47 | + </SelectBoxGroup> |
| 48 | + </div> |
| 49 | + ) |
| 50 | +}; |
| 51 | + |
| 52 | +export const HorizontalOrientation: Story = { |
| 53 | + render: () => ( |
| 54 | + <div style={{width: 800}}> |
| 55 | + <SelectBoxGroup |
| 56 | + orientation="horizontal" |
| 57 | + onSelectionChange={action('onSelectionChange')}> |
| 58 | + <SelectBox value="text-only"> |
| 59 | + <Text slot="label">Title Only</Text> |
| 60 | + </SelectBox> |
| 61 | + <SelectBox value="illustration-text"> |
| 62 | + <Server /> |
| 63 | + <Text slot="label">Illustration + Title</Text> |
| 64 | + </SelectBox> |
| 65 | + <SelectBox value="text-desc"> |
| 66 | + <Text slot="label">Title + Description</Text> |
| 67 | + <Text slot="description">Additional description</Text> |
| 68 | + </SelectBox> |
| 69 | + <SelectBox value="h-all"> |
| 70 | + <Server /> |
| 71 | + <Text slot="label">Illustration + Title + Description</Text> |
| 72 | + <Text slot="description">Full horizontal layout with all elements</Text> |
| 73 | + </SelectBox> |
| 74 | + </SelectBoxGroup> |
| 75 | + </div> |
| 76 | + ) |
| 77 | +}; |
0 commit comments