diff --git a/packages/@adobe/spectrum-css-temp/components/table/skin.css b/packages/@adobe/spectrum-css-temp/components/table/skin.css index 0b2252d85fe..ade329d6aba 100644 --- a/packages/@adobe/spectrum-css-temp/components/table/skin.css +++ b/packages/@adobe/spectrum-css-temp/components/table/skin.css @@ -180,6 +180,10 @@ tbody.spectrum-Table-body { background-color: var(--spectrum-table-row-background-color-down); } + &.is-disabled .spectrum-Table-cell.is-disabled { + color: var(--spectrum-alias-text-color-disabled); + } + /* Alternative to border on rows. Using box shadow since they don't take room unlike border which would cause wiggles * in the highlight case and displace the sticky indicator. Also allows for a nicer bottom curved border to match the container, * the bottom border curved corners were cut off when using borders. diff --git a/packages/@react-spectrum/table/src/TableViewWrapper.tsx b/packages/@react-spectrum/table/src/TableViewWrapper.tsx index 5385a6488c2..1dda249c33b 100644 --- a/packages/@react-spectrum/table/src/TableViewWrapper.tsx +++ b/packages/@react-spectrum/table/src/TableViewWrapper.tsx @@ -10,7 +10,7 @@ * governing permissions and limitations under the License. */ -import type {AriaLabelingProps, DOMProps, DOMRef, Key, SpectrumSelectionProps, StyleProps} from '@react-types/shared'; +import type {AriaLabelingProps, DisabledBehavior, DOMProps, DOMRef, Key, SpectrumSelectionProps, StyleProps} from '@react-types/shared'; import type {ColumnSize, TableProps} from '@react-types/table'; import type {DragAndDropHooks} from '@react-spectrum/dnd'; import React, {JSX, ReactElement} from 'react'; @@ -33,6 +33,11 @@ export interface SpectrumTableProps extends TableProps, SpectrumSelectionP isQuiet?: boolean, /** Sets what the TableView should render when there is no content to display. */ renderEmptyState?: () => JSX.Element, + /** + * Whether `disabledKeys` applies to all interactions, or only selection. + * @default "selection" + */ + disabledBehavior?: DisabledBehavior, /** Handler that is called when a user performs an action on a row. */ onAction?: (key: Key) => void, /** diff --git a/packages/@react-spectrum/table/stories/Table.stories.tsx b/packages/@react-spectrum/table/stories/Table.stories.tsx index f3bdc80f13f..33fc1db14f4 100644 --- a/packages/@react-spectrum/table/stories/Table.stories.tsx +++ b/packages/@react-spectrum/table/stories/Table.stories.tsx @@ -117,6 +117,10 @@ export default { }, disallowEmptySelection: { control: 'boolean' + }, + disabledBehavior: { + control: 'select', + options: ['all', 'selection'] } } } as ComponentMeta;