Skip to content

feat(S2): S2 ListView#8878

Merged
reidbarber merged 86 commits intomainfrom
s2-listview
Feb 28, 2026
Merged

feat(S2): S2 ListView#8878
reidbarber merged 86 commits intomainfrom
s2-listview

Conversation

@snowystinger
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

# Conflicts:
#	packages/@react-spectrum/s2/src/TreeView.tsx
#	packages/@react-spectrum/s2/src/index.ts
@rspbot
Copy link

rspbot commented Sep 17, 2025

@rspbot
Copy link

rspbot commented Sep 18, 2025

@rspbot
Copy link

rspbot commented Sep 18, 2025

@rspbot
Copy link

rspbot commented Sep 18, 2025

@rspbot
Copy link

rspbot commented Sep 19, 2025

@rspbot
Copy link

rspbot commented Oct 2, 2025

@rspbot
Copy link

rspbot commented Oct 2, 2025

@rspbot
Copy link

rspbot commented Oct 21, 2025

@rspbot
Copy link

rspbot commented Oct 21, 2025

@rspbot
Copy link

rspbot commented Oct 22, 2025

@rspbot
Copy link

rspbot commented Oct 22, 2025

@rspbot
Copy link

rspbot commented Oct 23, 2025

@rspbot
Copy link

rspbot commented Oct 23, 2025

@rspbot
Copy link

rspbot commented Feb 26, 2026

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

things look good to me in the docs/storybook, holding off on approval until we decide on what to do about the new RAC render props for the gridlist item

@rspbot
Copy link

rspbot commented Feb 27, 2026

isFirstItem: 'default'
},
borderBottomStartRadius: {
isLastItem: 'default'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really supposed to be rounded? It looks a bit weird IMO. Also the border width seems thicker for some reason

Image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should only be set if the last item is flush with the bottom of the container or the container scrolls


export interface GridListItemRenderProps extends ItemRenderProps {}
export interface GridListItemRenderProps extends ItemRenderProps {
item: Node<unknown>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to just add the id and not the full node, to match Table.

Also can you add JSDoc comments to these?

@rspbot
Copy link

rspbot commented Feb 27, 2026

@rspbot
Copy link

rspbot commented Feb 28, 2026

@rspbot
Copy link

rspbot commented Feb 28, 2026

@rspbot
Copy link

rspbot commented Feb 28, 2026

## API Changes

react-aria-components

/react-aria-components:GridListItemRenderProps

 GridListItemRenderProps {
   allowsDragging?: boolean
+  id?: Key
   isDisabled: boolean
   isDragging?: boolean
   isDropTarget?: boolean
   isFocusVisible: boolean
   isFocused: boolean
   isHovered: boolean
   isPressed: boolean
   isSelected: boolean
   selectionBehavior: SelectionBehavior
   selectionMode: SelectionMode
+  state: ListState<unknown>
 }

@react-spectrum/s2

/@react-spectrum/s2:ListView

+ListView <T extends {}> {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  autoFocus?: boolean | FocusStrategy
+  children: ReactNode | ({}) => ReactNode
+  defaultSelectedKeys?: 'all' | Iterable<Key>
+  dependencies?: ReadonlyArray<any>
+  disabledBehavior?: DisabledBehavior = "all"
+  disabledKeys?: Iterable<Key>
+  disallowEmptySelection?: boolean
+  disallowTypeAhead?: boolean = false
+  escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
+  hideLinkOutIcon?: boolean
+  id?: string
+  isQuiet?: boolean
+  items?: Iterable<T>
+  loadingState?: LoadingState
+  onAction?: (Key) => void
+  onLoadMore?: () => void
+  onSelectionChange?: (Selection) => void
+  overflowMode?: 'wrap' | 'truncate' = 'truncate'
+  renderActionBar?: ('all' | Set<Key>) => ReactElement
+  renderEmptyState?: (GridListRenderProps) => ReactNode
+  selectedKeys?: 'all' | Iterable<Key>
+  selectionMode?: SelectionMode
+  selectionStyle?: 'highlight' | 'checkbox' = 'checkbox'
+  shouldSelectOnPressUp?: boolean
+  slot?: string | null
+  styles?: StylesPropWithHeight
+}

/@react-spectrum/s2:ListViewContext

+ListViewContext {
+  UNTYPED
+}

/@react-spectrum/s2:ListViewItem

+ListViewItem {
+  children: ReactNode
+  download?: boolean | string
+  hasChildItems?: boolean
+  href?: Href
+  hrefLang?: string
+  id?: Key
+  isDisabled?: boolean
+  onAction?: () => void
+  onHoverChange?: (boolean) => void
+  onHoverEnd?: (HoverEvent) => void
+  onHoverStart?: (HoverEvent) => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  ping?: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  rel?: string
+  routerOptions?: RouterOptions
+  target?: HTMLAttributeAnchorTarget
+  textValue?: string
+  value?: T
+}

/@react-spectrum/s2:ListViewProps

+ListViewProps <T> {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  autoFocus?: boolean | FocusStrategy
+  children: ReactNode | (T) => ReactNode
+  defaultSelectedKeys?: 'all' | Iterable<Key>
+  dependencies?: ReadonlyArray<any>
+  disabledBehavior?: DisabledBehavior = "all"
+  disabledKeys?: Iterable<Key>
+  disallowEmptySelection?: boolean
+  disallowTypeAhead?: boolean = false
+  escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
+  hideLinkOutIcon?: boolean
+  id?: string
+  isQuiet?: boolean
+  items?: Iterable<T>
+  loadingState?: LoadingState
+  onAction?: (Key) => void
+  onLoadMore?: () => void
+  onSelectionChange?: (Selection) => void
+  overflowMode?: 'wrap' | 'truncate' = 'truncate'
+  renderActionBar?: ('all' | Set<Key>) => ReactElement
+  renderEmptyState?: (GridListRenderProps) => ReactNode
+  selectedKeys?: 'all' | Iterable<Key>
+  selectionMode?: SelectionMode
+  selectionStyle?: 'highlight' | 'checkbox' = 'checkbox'
+  shouldSelectOnPressUp?: boolean
+  slot?: string | null
+  styles?: StylesPropWithHeight
+}

/@react-spectrum/s2:ListViewItemProps

+ListViewItemProps {
+  children: ReactNode
+  download?: boolean | string
+  hasChildItems?: boolean
+  href?: Href
+  hrefLang?: string
+  id?: Key
+  isDisabled?: boolean
+  onAction?: () => void
+  onHoverChange?: (boolean) => void
+  onHoverEnd?: (HoverEvent) => void
+  onHoverStart?: (HoverEvent) => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  ping?: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  rel?: string
+  routerOptions?: RouterOptions
+  target?: HTMLAttributeAnchorTarget
+  textValue?: string
+  value?: T
+}

@reidbarber reidbarber enabled auto-merge February 28, 2026 00:40
@LFDanLu
Copy link
Member

LFDanLu commented Feb 28, 2026

https://www.chromatic.com/test?appId=5f0dd5ad2b5fc10022a2e320&id=69a23bcc996709ab539d4db6, looks like there is something up with storybook for some stories, digging. Don't think it is from changes in this PR

@LFDanLu
Copy link
Member

LFDanLu commented Feb 28, 2026

think it should be fixed with #9712, I'll approve this for now

@reidbarber reidbarber added this pull request to the merge queue Feb 28, 2026
Merged via the queue into main with commit a9fccbd Feb 28, 2026
30 of 31 checks passed
@reidbarber reidbarber deleted the s2-listview branch February 28, 2026 01:33
pioug pushed a commit to pioug/react-spectrum that referenced this pull request Feb 28, 2026
…aseline-tracker

* origin/main:
  feat(S2): S2 ListView (adobe#8878)
  refactor: Centralize expandedKeys logic in TreeCollection (adobe#9711)
  chore: Warn if user has interactive elements in their custom Picker value (adobe#9710)
  feat: S2 unavailable menu item (adobe#9657)
  fix: Ensure that opening a submenu via enter/space moves focus to first item in submenu (adobe#9691)
  fix: prevent docs crash by making template elements always append children into .content (adobe#9703)
  docs(RAC): Add TreeSection docs (adobe#9699)
  docs(S2): add Typography search view (adobe#9524)
  docs(S2): fix clipping in Picker custom value AvatarGroup example (adobe#9702)
  fix: patch additional methods so React doesnt break with template elements (adobe#9385)
  tentative fix (adobe#9635)
  docs(S2): fix icon import clipboard content to add underscore for icons starting with number (adobe#9698)
  feat(S2): add ActionBar support to TreeView (adobe#9695)
  fix: combobox interactoutside (adobe#9646)
  fix: skip native Date fast path when local timezone is overridden via setLocalTimeZone (adobe#9678)
  chore: update storybook to 9 (adobe#8634)
  docs: improve custom render value S2 Picker example (adobe#9682)

# Conflicts:
#	yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants