|
11 | 11 | */
|
12 | 12 |
|
13 | 13 | import {action} from '@storybook/addon-actions';
|
14 |
| -import {Button, Calendar, CalendarCell, CalendarGrid, Cell, Checkbox, Column, ColumnResizer, DateField, DateInput, DatePicker, DateRangePicker, DateSegment, Dialog, DialogTrigger, DropZone, FileTrigger, Group, Header, Heading, Input, Keyboard, Label, Link, ListBox, ListBoxItem, ListBoxProps, Menu, MenuItem, MenuTrigger, Modal, ModalOverlay, NumberField, OverlayArrow, Popover, Radio, RadioGroup, RangeCalendar, ResizableTableContainer, Row, SearchField, Section, Select, SelectValue, Separator, Slider, SliderOutput, SliderThumb, SliderTrack, Switch, Tab, Table, TableBody, TableHeader, TabList, TabPanel, Tabs, TabsProps, Tag, TagGroup, TagList, Text, TextField, TimeField, ToggleButton, Toolbar, Tooltip, TooltipTrigger, useDragAndDrop} from 'react-aria-components'; |
| 14 | +import {Button, Calendar, CalendarCell, CalendarGrid, Cell, Checkbox, Column, ColumnResizer, DateField, DateInput, DatePicker, DateRangePicker, DateSegment, Dialog, DialogTrigger, DropZone, FileTrigger, Group, Header, Heading, Input, Keyboard, Label, Link, ListBox, ListBoxItem, ListBoxProps, Menu, MenuItem, MenuTrigger, Modal, ModalOverlay, NumberField, OverlayArrow, Popover, Radio, RadioGroup, RangeCalendar, ResizableTableContainer, Row, SearchField, Section, Select, SelectValue, Separator, Slider, SliderOutput, SliderThumb, SliderTrack, Switch, Table, TableBody, TableHeader, Tag, TagGroup, TagList, Text, TextField, TimeField, ToggleButton, Toolbar, Tooltip, TooltipTrigger, useDragAndDrop} from 'react-aria-components'; |
15 | 15 | import {classNames} from '@react-spectrum/utils';
|
16 | 16 | import clsx from 'clsx';
|
17 | 17 | import {FocusRing, isTextDropItem, mergeProps, useButton, useClipboard, useDrag} from 'react-aria';
|
18 | 18 | import {MyListBoxItem} from './utils';
|
19 |
| -import React, {useRef, useState} from 'react'; |
20 |
| -import {RouterProvider} from '@react-aria/utils'; |
| 19 | +import React, {useRef} from 'react'; |
21 | 20 | import styles from '../example/index.css';
|
22 | 21 | import {useListData} from 'react-stately';
|
23 | 22 |
|
@@ -466,68 +465,6 @@ export const ModalExample = () => (
|
466 | 465 | </DialogTrigger>
|
467 | 466 | );
|
468 | 467 |
|
469 |
| -export const TabsExample = () => { |
470 |
| - let [url, setUrl] = useState('/FoR'); |
471 |
| - |
472 |
| - return ( |
473 |
| - <RouterProvider navigate={setUrl}> |
474 |
| - <Tabs selectedKey={url}> |
475 |
| - <TabList aria-label="History of Ancient Rome" style={{display: 'flex', gap: 8}}> |
476 |
| - <CustomTab id="/FoR" href="/FoR">Founding of Rome</CustomTab> |
477 |
| - <CustomTab id="/MaR" href="/MaR">Monarchy and Republic</CustomTab> |
478 |
| - <CustomTab id="/Emp" href="/Emp">Empire</CustomTab> |
479 |
| - </TabList> |
480 |
| - <TabPanel id="/FoR"> |
481 |
| - Arma virumque cano, Troiae qui primus ab oris. |
482 |
| - </TabPanel> |
483 |
| - <TabPanel id="/MaR"> |
484 |
| - Senatus Populusque Romanus. |
485 |
| - </TabPanel> |
486 |
| - <TabPanel id="/Emp"> |
487 |
| - Alea jacta est. |
488 |
| - </TabPanel> |
489 |
| - </Tabs> |
490 |
| - </RouterProvider> |
491 |
| - ); |
492 |
| -}; |
493 |
| - |
494 |
| -// Has error with invalid aria-controls, bug documented here: https://github.com/adobe/react-spectrum/issues/4781#issuecomment-1641057070 |
495 |
| -export const TabsRenderProps = () => { |
496 |
| - const [tabOrientation, setTabOrientation] = useState<TabsProps['orientation']>('vertical'); |
497 |
| - |
498 |
| - return ( |
499 |
| - <div style={{display: 'flex', flexDirection: 'row', gap: 8}}> |
500 |
| - <Button onPress={() => setTabOrientation((current) => current === 'vertical' ? 'horizontal' : 'vertical')}> |
501 |
| - Change Orientation |
502 |
| - </Button> |
503 |
| - <Tabs orientation={tabOrientation}> |
504 |
| - {({orientation}) => ( |
505 |
| - <div> |
506 |
| - <div style={{display: 'flex', flexDirection: orientation === 'vertical' ? 'row' : 'column', gap: 8}}> |
507 |
| - <TabList |
508 |
| - aria-label="History of Ancient Rome" |
509 |
| - style={{display: 'flex', flexDirection: orientation === 'vertical' ? 'column' : 'row', gap: 8}}> |
510 |
| - <CustomTab id="FoR">Founding of Rome</CustomTab> |
511 |
| - <CustomTab id="MaR">Monarchy and Republic</CustomTab> |
512 |
| - <CustomTab id="Emp">Empire</CustomTab> |
513 |
| - </TabList> |
514 |
| - <TabPanel id="FoR"> |
515 |
| - Arma virumque cano, Troiae qui primus ab oris. |
516 |
| - </TabPanel> |
517 |
| - <TabPanel id="MaR"> |
518 |
| - Senatus Populusque Romanus. |
519 |
| - </TabPanel> |
520 |
| - <TabPanel id="Emp"> |
521 |
| - Alea jacta est. |
522 |
| - </TabPanel> |
523 |
| - </div> |
524 |
| - </div> |
525 |
| - )} |
526 |
| - </Tabs> |
527 |
| - </div> |
528 |
| - ); |
529 |
| -}; |
530 |
| - |
531 | 468 | const ReorderableTable = ({initialItems}: {initialItems: {id: string, name: string}[]}) => {
|
532 | 469 | let list = useListData({initialItems});
|
533 | 470 |
|
@@ -764,16 +701,6 @@ function CustomThumb({index, children}) {
|
764 | 701 | );
|
765 | 702 | }
|
766 | 703 |
|
767 |
| -function CustomTab(props) { |
768 |
| - return ( |
769 |
| - <Tab |
770 |
| - {...props} |
771 |
| - style={({isSelected}) => ({ |
772 |
| - borderBottom: '2px solid ' + (isSelected ? 'slateblue' : 'transparent') |
773 |
| - })} /> |
774 |
| - ); |
775 |
| -} |
776 |
| - |
777 | 704 | function Draggable() {
|
778 | 705 | let buttonRef = useRef(null);
|
779 | 706 | let {dragProps, isDragging} = useDrag({
|
|
0 commit comments