From f67bb846dcbb4cb63b7ba2514e56185e113b62e9 Mon Sep 17 00:00:00 2001 From: Daniel Lu Date: Wed, 18 Jan 2023 14:48:38 -0800 Subject: [PATCH 1/2] Revert "Add ActionBar examples to TableView and ListView docs (#3777)" This reverts commit 767a617062267a115fc18b80a815487c2d6f8587. --- .../@react-spectrum/list/docs/ListView.mdx | 52 -------------- .../@react-spectrum/table/docs/TableView.mdx | 69 ------------------- 2 files changed, 121 deletions(-) diff --git a/packages/@react-spectrum/list/docs/ListView.mdx b/packages/@react-spectrum/list/docs/ListView.mdx index 4073cd41253..84c39fd67f5 100644 --- a/packages/@react-spectrum/list/docs/ListView.mdx +++ b/packages/@react-spectrum/list/docs/ListView.mdx @@ -30,9 +30,6 @@ import {Image} from '@react-spectrum/image'; import Info from '@spectrum-icons/workflow/Info'; import {Item, ListView} from '@react-spectrum/list'; import {Link} from '@react-spectrum/link'; -import Copy from '@spectrum-icons/workflow/Copy'; -import Edit from '@spectrum-icons/workflow/Edit'; -import Delete from '@spectrum-icons/workflow/Delete'; ``` --- @@ -366,55 +363,6 @@ This behavior is slightly different in the highlight selection style, where sing ``` - -### Action bar - -An [Action bar](ActionBar.html) can be used when a user needs to perform actions on one or more items at the same time. - -```tsx example keepIndividualImports -import {ActionBar, ActionBarContainer, Item} from '@react-spectrum/actionbar'; - -function Example() { - let items = [ - {key: 0, name: 'Adobe Photoshop'}, - {key: 1, name: 'Adobe Illustrator'}, - {key: 2, name: 'Adobe XD'} - ]; - - let [selectedKeys, setSelectedKeys] = React.useState(new Set([0])); - - return ( - - - {(item) => ( - - {item.name} - - )} - - alert(`Action: ${key}`)} - onClearSelection={() => setSelectedKeys(new Set([]))}> - - - Edit - - - - Copy - - - - Delete - - - - ); -} -``` - ## Drag and drop To enable drag and drop in a ListView, you must provide the drag and drop hooks sourced from to the ListView's `dragAndDropHooks` prop. diff --git a/packages/@react-spectrum/table/docs/TableView.mdx b/packages/@react-spectrum/table/docs/TableView.mdx index d62dea8f120..ad2591b2064 100644 --- a/packages/@react-spectrum/table/docs/TableView.mdx +++ b/packages/@react-spectrum/table/docs/TableView.mdx @@ -21,10 +21,6 @@ import {ActionButton} from '@react-spectrum/button'; import Add from '@spectrum-icons/workflow/Add'; import {Cell, Column, Row, TableView, TableBody, TableHeader} from '@react-spectrum/table'; import {Flex} from '@react-spectrum/layout'; -import Copy from '@spectrum-icons/workflow/Copy'; -import Edit from '@spectrum-icons/workflow/Edit'; -import Delete from '@spectrum-icons/workflow/Delete'; -import {Text} from '@react-spectrum/text'; ``` --- @@ -504,71 +500,6 @@ This behavior is slightly different in the highlight selection style, where sing ``` -### Action bar - -An [Action bar](ActionBar.html) can be used when a user needs to perform actions on one or more rows at the same time. - -```tsx example keepIndividualImports -import {ActionBar, ActionBarContainer, Item} from '@react-spectrum/actionbar'; - -function Example() { - let columns = [ - {name: 'Name', uid: 'name'}, - {name: 'Type', uid: 'type'}, - {name: 'Level', uid: 'level'} - ]; - - let rows = [ - {id: 1, name: 'Charizard', type: 'Fire, Flying', level: '67'}, - {id: 2, name: 'Blastoise', type: 'Water', level: '56'}, - {id: 3, name: 'Venusaur', type: 'Grass, Poison', level: '83'}, - {id: 4, name: 'Pikachu', type: 'Electric', level: '100'} - ]; - - let [selectedKeys, setSelectedKeys] = React.useState(new Set([1])); - - return ( - - - - {column => {column.name}} - - - {item => ( - - {key => {item[key]}} - - )} - - - setSelectedKeys(new Set())} - onAction={(key) => alert(`Action: ${key}`)}> - - - Edit - - - - Copy - - - - Delete - - - - ); -} -``` - ## Sorting TableView supports sorting its data when a column header is pressed. To designate that a Column should support sorting, provide it with From 32508a2a2e1e692ae7605b1f6a028f38e83cb8b7 Mon Sep 17 00:00:00 2001 From: Daniel Lu Date: Wed, 18 Jan 2023 14:48:42 -0800 Subject: [PATCH 2/2] Revert "release actionbar docs (#3927)" This reverts commit 29fbecfbbabd81a6919e49b33aa78331c6f35abb. --- packages/@react-spectrum/actionbar/docs/ActionBar.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@react-spectrum/actionbar/docs/ActionBar.mdx b/packages/@react-spectrum/actionbar/docs/ActionBar.mdx index d81e8eb7ff5..2862bbfddb6 100644 --- a/packages/@react-spectrum/actionbar/docs/ActionBar.mdx +++ b/packages/@react-spectrum/actionbar/docs/ActionBar.mdx @@ -29,6 +29,7 @@ import {TableView, TableHeader, TableBody, Row, Column, Cell} from '@react-spect --- category: Toolbars keywords: [actionbar, selection, actions, collections, toolbar] +after_version: 3.1.0 --- # ActionBar