@react-spectrum/list 3.0.0-alpha.2 → 3.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,2CAAiB;AACf,6BAA2B,gCADZ;AAEf,iCAA+B,oCAFhB;AAGf,gBAAc,mBAHC;AAIf,gBAAc,mBAJC;AAKf,gBAAc,mBALC;AAMf,6CAA2C;AAN5B,CAAjB;;;ACAA,2CAAiBG,IAAI,CAACC,KAAL,CAAW,0EAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,wEAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,uEAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,uEAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,+DAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,0EAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,8DAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,+DAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,oEAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,iEAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,kFAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,2DAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,mEAAX,CAAjB;;;ACAA,uCAAiBD,IAAI,CAACC,KAAL,C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,CAAiB+B,IAAjB,GAAwB,CAFzC;AAGE,IAAA,SAAS,EAAEhD,UAAU,oDAAa,yCAAb;AAHvB,kBAIE;AAAK,IAAA,IAAI,EAAC;AAAV,KACGoD,QADH,CAJF,CADF;AAUD;;OAED,MAAMC,QAAS,gBAAGlD,MAAK,CAACmD,UAAN,CAAiBnC,6CAAjB,CAAlB","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-spectrum/list/src/listview.css","./packages/@react-spectrum/list/intl/ar-AE.json","./packages/@react-spectrum/list/intl/bg-BG.json","./packages/@react-spectrum/list/intl/cs-CZ.json","./packages/@react-spectrum/list/intl/da-DK.json","./packages/@react-spectrum/list/intl/de-DE.json","./packages/@react-spectrum/list/intl/el-GR.json","./packages/@react-spectrum/list/intl/en-US.json","./packages/@react-spectrum/list/intl/es-ES.json","./packages/@react-spectrum/list/intl/et-EE.json","./packages/@react-spectrum/list/intl/fi-FI.json","./packages/@react-spectrum/list/intl/fr-FR.json","./packages/@react-spectrum/list/intl/he-IL.json","./packages/@react-spectrum/list/intl/hr-HR.json","./packages/@react-spectrum/list/intl/hu-HU.json","./packages/@react-spectrum/list/intl/it-IT.json","./packages/@react-spectrum/list/intl/ja-JP.json","./packages/@react-spectrum/list/intl/ko-KR.json","./packages/@react-spectrum/list/intl/lt-LT.json","./packages/@react-spectrum/list/intl/lv-LV.json","./packages/@react-spectrum/list/intl/nb-NO.json","./packages/@react-spectrum/list/intl/nl-NL.json","./packages/@react-spectrum/list/intl/pl-PL.json","./packages/@react-spectrum/list/intl/pt-BR.json","./packages/@react-spectrum/list/intl/pt-PT.json","./packages/@react-spectrum/list/intl/ro-RO.json","./packages/@react-spectrum/list/intl/ru-RU.json","./packages/@react-spectrum/list/intl/sk-SK.json","./packages/@react-spectrum/list/intl/sl-SI.json","./packages/@react-spectrum/list/intl/sr-SP.json","./packages/@react-spectrum/list/intl/sv-SE.json","./packages/@react-spectrum/list/intl/tr-TR.json","./packages/@react-spectrum/list/intl/uk-UA.json","./packages/@react-spectrum/list/intl/zh-CN.json","./packages/@react-spectrum/list/intl/zh-TW.json","./packages/@react-spectrum/list/src/ListViewItem.tsx","./packages/@react-spectrum/list/src/ListView.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n",".react-spectrum-ListView {\n border-color: var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid));\n border-style: solid;\n position: relative;\n border-width: var(--spectrum-table-border-size, var(--spectrum-alias-border-size-thin));\n border-radius: var(--spectrum-table-border-radius, var(--spectrum-alias-border-radius-regular));\n overflow: auto;\n vertical-align: var(--spectrum-table-cell-vertical-alignment);\n border-collapse: separate;\n border-spacing: 0;\n transform: translate3d(0, 0, 0);\n padding: 0;\n background-color: var(--spectrum-table-background-color, var(--spectrum-global-color-gray-50));\n outline: 0;\n}\n\n.react-spectrum-ListViewItem {\n display: grid; /* TODO: define grid areas */\n border-bottom: 1px solid var(--spectrum-tabel-cell-border-color, var(--spectrum-global-color-gray-300));\n box-sizing: border-box;\n font-size: var(--spectrum-table-cell-text-size, var(--spectrum-alias-font-size-default));\n font-weight: var(--spectrum-table-cell-text-font-weight, var(--spectrum-global-font-weight-regular));\n line-height: calc(var(--spectrum-table-cell-text-size, var(--spectrum-alias-font-size-default)) * var(--spectrum-table-cell-text-line-height, var(--spectrum-alias-body-text-line-height)) - 1px);\n padding: var(--spectrum-global-dimension-size-125) var(--spectrum-table-cell-padding-x, var(--spectrum-global-dimension-size-200));\n transition: background-color var(--spectrum-global-animation-duration-100) ease-in-out;\n position: relative;\n background-color: var(--spectrum-table-background-color, var(--spectrum-global-color-gray-50));\n color: var(--spectrum-table-cell-text-color, var(--spectrum-alias-text-color));\n outline: 0;\n\n &.is-hovered,\n &.is-focused {\n background-color: var(--spectrum-table-row-background-color-hover);\n }\n\n &:focus-ring {\n background-color: var(--spectrum-table-row-background-color-hover);\n box-shadow: inset 0 0 0 2px var(--spectrum-table-cell-border-color-key-focus);\n border-radius: var(--spectrum-table-cell-border-radius-key-focus);\n }\n}\n\n.react-spectrum-ListView-centeredWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n","{\n \"loading\": \"جار التحميل...\",\n \"loadingMore\": \"جار تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser ...\",\n \"loadingMore\": \"Indlæser flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중\",\n \"loadingMore\": \"추가 로드 중\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje...\",\n \"loadingMore\": \"Nalaganje več vsebine...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"正在載入\",\n \"loadingMore\": \"正在載入更多…\"\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {classNames} from '@react-spectrum/utils';\nimport listStyles from './listview.css';\nimport {ListViewContext} from './ListView';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useRef} from 'react';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useGridCell, useGridRow} from '@react-aria/grid';\nimport {useHover} from '@react-aria/interactions';\n\n\nexport function ListViewItem(props) {\n let {\n item\n } = props;\n let {state} = useContext(ListViewContext);\n let ref = useRef<HTMLDivElement>();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({});\n let {rowProps} = useGridRow({\n node: item,\n isVirtualized: true\n }, state, ref);\n let {gridCellProps} = useGridCell({\n node: item,\n focusMode: 'cell'\n }, state, ref);\n const mergedProps = mergeProps(\n gridCellProps,\n hoverProps,\n focusWithinProps,\n focusProps\n );\n\n return (\n <div {...rowProps}>\n <div\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListViewItem',\n {\n 'is-focused': isFocusVisibleWithin,\n 'focus-ring': isFocusVisible,\n 'is-hovered': isHovered\n }\n )\n }\n ref={ref}\n {...mergedProps}>\n {item.rendered}\n </div>\n </div>\n );\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaLabelingProps, CollectionBase, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {GridKeyboardDelegate, useGrid} from '@react-aria/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState, useListState} from '@react-stately/list';\nimport listStyles from './listview.css';\nimport {ListViewItem} from './ListViewItem';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ReactElement, useContext, useMemo} from 'react';\nimport {useCollator, useLocale, useMessageFormatter} from '@react-aria/i18n';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer} from '@react-aria/virtualizer';\n\n\nexport const ListViewContext = React.createContext(null);\n\nexport function useListLayout<T>(state: ListState<T>) {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: scale === 'large' ? 48 : 32,\n padding: 0,\n collator\n })\n , [collator, scale]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n return layout;\n}\n\ninterface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps {\n isLoading?: boolean,\n renderEmptyState?: () => JSX.Element,\n transitionDuration?: number\n}\n\nfunction ListView<T extends object>(props: ListViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {\n transitionDuration = 0\n } = props;\n let domRef = useDOMRef(ref);\n let {collection} = useListState(props);\n let formatMessage = useMessageFormatter(intlMessages);\n\n let {styleProps} = useStyleProps(props);\n let {direction} = useLocale();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: 1,\n items: [...collection].map(item => ({\n type: 'item',\n childNodes: [{\n ...item,\n index: 0,\n type: 'cell'\n }]\n }))\n }), [collection]);\n let state = useGridState({\n ...props,\n collection: gridCollection\n });\n let layout = useListLayout(state);\n let keyboardDelegate = useMemo(() => new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n collator,\n focusMode: 'cell'\n }), [state, domRef, direction, collator]);\n let {gridProps} = useGrid({\n ...props,\n isVirtualized: true,\n keyboardDelegate\n }, state, domRef);\n\n // Sync loading state into the layout.\n layout.isLoading = props.isLoading;\n\n return (\n <ListViewContext.Provider value={{state, keyboardDelegate}}>\n <Virtualizer\n {...gridProps}\n {...styleProps}\n ref={domRef}\n focusedKey={state.selectionManager.focusedKey}\n sizeToFit=\"height\"\n scrollDirection=\"vertical\"\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListView',\n styleProps.className\n )\n }\n layout={layout}\n collection={collection}\n transitionDuration={transitionDuration}>\n {(type, item) => {\n if (type === 'item') {\n return (\n <ListViewItem item={item} />\n );\n } else if (type === 'loader') {\n return (\n <CenteredWrapper>\n <ProgressCircle\n isIndeterminate\n aria-label={state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')} />\n </CenteredWrapper>\n );\n } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <CenteredWrapper>\n {emptyState}\n </CenteredWrapper>\n );\n }\n\n }}\n </Virtualizer>\n </ListViewContext.Provider>\n );\n}\n\n\nfunction CenteredWrapper({children}) {\n let {state} = useContext(ListViewContext);\n return (\n <div\n role=\"row\"\n aria-rowindex={state.collection.size + 1}\n className={classNames(listStyles, 'react-spectrum-ListView-centeredWrapper')}>\n <div role=\"gridcell\">\n {children}\n </div>\n </div>\n );\n}\n\nconst _ListView = React.forwardRef(ListView) as <T>(props: ListViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListView as ListView};\n"],"names":["$parcel$interopDefault","a","__esModule","default","JSON","parse","ListViewItem","props","item","state","useContext","ref","useRef","isFocusVisible","isFocusVisibleWithin","focusProps","focusWithinProps","useFocusRing","within","hoverProps","isHovered","useHover","rowProps","useGridRow","node","isVirtualized","gridCellProps","useGridCell","focusMode","mergedProps","mergeProps","classNames","rendered","ListViewContext","React","createContext","useListLayout","scale","useProvider","collator","useCollator","usage","sensitivity","layout","useMemo","ListLayout","estimatedRowHeight","padding","collection","disabledKeys","ListView","transitionDuration","domRef","useDOMRef","useListState","formatMessage","useMessageFormatter","intlMessages","styleProps","useStyleProps","direction","useLocale","gridCollection","GridCollection","columnCount","items","map","type","childNodes","index","useGridState","keyboardDelegate","GridKeyboardDelegate","gridProps","useGrid","isLoading","selectionManager","focusedKey","className","size","emptyState","renderEmptyState","CenteredWrapper","children","_ListView","forwardRef"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAA4E;;;;ACAxG,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAwE;;;;ACApG,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAuE;;;;ACAnG,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAqE;;;;ACAjG,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAA+D;;;;ACA3F,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAA0E;;;;ACAtG,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAA8D;;;;ACA1F,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAA+D;;;;ACA3F,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAoE;;;;AC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AI,GAAG,CAAC;QACnF,CAAC;gDAEJ,CAAG;QAAC,IAAI,EAAC,CAAU;OACjB,QAAQ;AAIjB,CAAC;AAED,KAAK,CAAC,yCAAS,iBAAG,YAAK,CAAC,UAAU,CAAC,8BAAQ","sources":["packages/@react-spectrum/list/src/index.ts","packages/@react-spectrum/list/src/ListView.tsx","packages/@react-spectrum/list/intl/*.js","packages/@react-spectrum/list/intl/ar-AE.json","packages/@react-spectrum/list/intl/bg-BG.json","packages/@react-spectrum/list/intl/cs-CZ.json","packages/@react-spectrum/list/intl/da-DK.json","packages/@react-spectrum/list/intl/de-DE.json","packages/@react-spectrum/list/intl/el-GR.json","packages/@react-spectrum/list/intl/en-US.json","packages/@react-spectrum/list/intl/es-ES.json","packages/@react-spectrum/list/intl/et-EE.json","packages/@react-spectrum/list/intl/fi-FI.json","packages/@react-spectrum/list/intl/fr-FR.json","packages/@react-spectrum/list/intl/he-IL.json","packages/@react-spectrum/list/intl/hr-HR.json","packages/@react-spectrum/list/intl/hu-HU.json","packages/@react-spectrum/list/intl/it-IT.json","packages/@react-spectrum/list/intl/ja-JP.json","packages/@react-spectrum/list/intl/ko-KR.json","packages/@react-spectrum/list/intl/lt-LT.json","packages/@react-spectrum/list/intl/lv-LV.json","packages/@react-spectrum/list/intl/nb-NO.json","packages/@react-spectrum/list/intl/nl-NL.json","packages/@react-spectrum/list/intl/pl-PL.json","packages/@react-spectrum/list/intl/pt-BR.json","packages/@react-spectrum/list/intl/pt-PT.json","packages/@react-spectrum/list/intl/ro-RO.json","packages/@react-spectrum/list/intl/ru-RU.json","packages/@react-spectrum/list/intl/sk-SK.json","packages/@react-spectrum/list/intl/sl-SI.json","packages/@react-spectrum/list/intl/sr-SP.json","packages/@react-spectrum/list/intl/sv-SE.json","packages/@react-spectrum/list/intl/tr-TR.json","packages/@react-spectrum/list/intl/uk-UA.json","packages/@react-spectrum/list/intl/zh-CN.json","packages/@react-spectrum/list/intl/zh-TW.json","packages/@react-spectrum/list/src/listview.css","packages/@react-spectrum/list/src/ListViewItem.tsx"],"sourcesContent":["export {ListView} from './ListView';\nexport {Item} from '@react-stately/collections';\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaLabelingProps,\n AsyncLoadable,\n CollectionBase,\n DOMProps,\n DOMRef,\n LoadingState,\n MultipleSelection,\n SpectrumSelectionProps,\n StyleProps\n} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {GridCollection, useGridState} from '@react-stately/grid';\nimport {GridKeyboardDelegate, useGrid} from '@react-aria/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListLayout} from '@react-stately/layout';\nimport {ListState, useListState} from '@react-stately/list';\nimport listStyles from './listview.css';\nimport {ListViewItem} from './ListViewItem';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ReactElement, useContext, useMemo} from 'react';\nimport {useCollator, useLocale, useMessageFormatter} from '@react-aria/i18n';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer} from '@react-aria/virtualizer';\n\n\nexport const ListViewContext = React.createContext(null);\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32,\n large: 40\n },\n regular: {\n medium: 40,\n large: 50\n },\n spacious: {\n medium: 48,\n large: 60\n }\n};\n\nexport function useListLayout<T>(state: ListState<T>, density: ListViewProps<T>['density']) {\n let {scale} = useProvider();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let isEmpty = state.collection.size === 0;\n let layout = useMemo(() =>\n new ListLayout<T>({\n estimatedRowHeight: ROW_HEIGHTS[density][scale],\n padding: 0,\n collator,\n loaderHeight: isEmpty ? null : ROW_HEIGHTS[density][scale]\n })\n , [collator, scale, density, isEmpty]);\n\n layout.collection = state.collection;\n layout.disabledKeys = state.disabledKeys;\n return layout;\n}\n\ninterface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps, MultipleSelection, SpectrumSelectionProps, Omit<AsyncLoadable, 'isLoading'> {\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n isQuiet?: boolean,\n loadingState?: LoadingState,\n renderEmptyState?: () => JSX.Element,\n transitionDuration?: number,\n onAction?: (key: string) => void\n}\n\nfunction ListView<T extends object>(props: ListViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {\n density = 'regular',\n onLoadMore,\n loadingState,\n isQuiet,\n transitionDuration = 0,\n onAction\n } = props;\n let domRef = useDOMRef(ref);\n let {collection} = useListState(props);\n let formatMessage = useMessageFormatter(intlMessages);\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n\n let {styleProps} = useStyleProps(props);\n let {direction} = useLocale();\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let gridCollection = useMemo(() => new GridCollection({\n columnCount: 1,\n items: [...collection].map(item => ({\n ...item,\n hasChildNodes: true,\n childNodes: [{\n key: `cell-${item.key}`,\n type: 'cell',\n index: 0,\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue,\n hasChildNodes: false,\n childNodes: []\n }]\n }))\n }), [collection]);\n let state = useGridState({\n ...props,\n collection: gridCollection,\n focusMode: 'cell',\n selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'\n });\n let layout = useListLayout(state, props.density || 'regular');\n let keyboardDelegate = useMemo(() => new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: domRef,\n direction,\n collator,\n // Focus the ListView cell instead of the row so that focus doesn't change with left/right arrow keys when there aren't any\n // focusable children in the cell.\n focusMode: 'cell'\n }), [state, domRef, direction, collator]);\n let {gridProps} = useGrid({\n ...props,\n isVirtualized: true,\n keyboardDelegate\n }, state, domRef);\n\n // Sync loading state into the layout.\n layout.isLoading = isLoading;\n\n let focusedKey = state.selectionManager.focusedKey;\n let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);\n if (focusedItem?.parentKey != null) {\n focusedKey = focusedItem.parentKey;\n }\n\n return (\n <ListViewContext.Provider value={{state, keyboardDelegate}}>\n <Virtualizer\n {...gridProps}\n {...styleProps}\n isLoading={isLoading}\n onLoadMore={onLoadMore}\n ref={domRef}\n focusedKey={focusedKey}\n scrollDirection=\"vertical\"\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListView',\n `react-spectrum-ListView--${density}`,\n 'react-spectrum-ListView--emphasized',\n {\n 'react-spectrum-ListView--quiet': isQuiet\n },\n styleProps.className\n )\n }\n layout={layout}\n collection={gridCollection}\n transitionDuration={transitionDuration}>\n {(type, item) => {\n if (type === 'item') {\n return (\n <ListViewItem item={item} onAction={onAction} isEmphasized />\n );\n } else if (type === 'loader') {\n return (\n <CenteredWrapper>\n <ProgressCircle\n isIndeterminate\n aria-label={state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')} />\n </CenteredWrapper>\n );\n } else if (type === 'placeholder') {\n let emptyState = props.renderEmptyState ? props.renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <CenteredWrapper>\n {emptyState}\n </CenteredWrapper>\n );\n }\n\n }}\n </Virtualizer>\n </ListViewContext.Provider>\n );\n}\n\n\nfunction CenteredWrapper({children}) {\n let {state} = useContext(ListViewContext);\n return (\n <div\n role=\"row\"\n aria-rowindex={state.collection.size + 1}\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListView-centeredWrapper',\n {\n 'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0\n }\n )}>\n <div role=\"gridcell\">\n {children}\n </div>\n </div>\n );\n}\n\nconst _ListView = React.forwardRef(ListView) as <T>(props: ListViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListView as ListView};\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"loading\": \"جارٍ التحميل...\",\n \"loadingMore\": \"جارٍ تحميل المزيد...\"\n}\n","{\n \"loading\": \"Зареждане...\",\n \"loadingMore\": \"Зареждане на още...\"\n}\n","{\n \"loading\": \"Načítání...\",\n \"loadingMore\": \"Načítání dalších...\"\n}\n","{\n \"loading\": \"Indlæser...\",\n \"loadingMore\": \"Indlæser flere...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Mehr laden ...\"\n}\n","{\n \"loading\": \"Φόρτωση...\",\n \"loadingMore\": \"Φόρτωση περισσότερων...\"\n}\n","{\n \"loading\": \"Loading…\",\n \"loadingMore\": \"Loading more…\"\n}\n","{\n \"loading\": \"Cargando…\",\n \"loadingMore\": \"Cargando más…\"\n}\n","{\n \"loading\": \"Laadimine...\",\n \"loadingMore\": \"Laadi rohkem...\"\n}\n","{\n \"loading\": \"Ladataan…\",\n \"loadingMore\": \"Ladataan lisää…\"\n}\n","{\n \"loading\": \"Chargement...\",\n \"loadingMore\": \"Chargement supplémentaire...\"\n}\n","{\n \"loading\": \"טוען...\",\n \"loadingMore\": \"טוען עוד...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Betöltés folyamatban…\",\n \"loadingMore\": \"Továbbiak betöltése folyamatban…\"\n}\n","{\n \"loading\": \"Caricamento...\",\n \"loadingMore\": \"Caricamento altri...\"\n}\n","{\n \"loading\": \"読み込み中...\",\n \"loadingMore\": \"さらに読み込み中...\"\n}\n","{\n \"loading\": \"로드 중…\",\n \"loadingMore\": \"추가 로드 중…\"\n}\n","{\n \"loading\": \"Įkeliama...\",\n \"loadingMore\": \"Įkeliama daugiau...\"\n}\n","{\n \"loading\": \"Notiek ielāde...\",\n \"loadingMore\": \"Tiek ielādēts vēl...\"\n}\n","{\n \"loading\": \"Laster inn ...\",\n \"loadingMore\": \"Laster inn flere ...\"\n}\n","{\n \"loading\": \"Laden...\",\n \"loadingMore\": \"Meer laden...\"\n}\n","{\n \"loading\": \"Ładowanie...\",\n \"loadingMore\": \"Wczytywanie większej liczby...\"\n}\n","{\n \"loading\": \"Carregando...\",\n \"loadingMore\": \"Carregando mais...\"\n}\n","{\n \"loading\": \"A carregar...\",\n \"loadingMore\": \"A carregar mais...\"\n}\n","{\n \"loading\": \"Se încarcă...\",\n \"loadingMore\": \"Se încarcă mai multe...\"\n}\n","{\n \"loading\": \"Загрузка...\",\n \"loadingMore\": \"Дополнительная загрузка...\"\n}\n","{\n \"loading\": \"Načítava sa...\",\n \"loadingMore\": \"Načítava sa viac...\"\n}\n","{\n \"loading\": \"Nalaganje ...\",\n \"loadingMore\": \"Nalaganje več vsebine ...\"\n}\n","{\n \"loading\": \"Učitavam...\",\n \"loadingMore\": \"Učitavam još...\"\n}\n","{\n \"loading\": \"Läser in...\",\n \"loadingMore\": \"Läser in mer...\"\n}\n","{\n \"loading\": \"Yükleniyor...\",\n \"loadingMore\": \"Daha fazla yükleniyor...\"\n}\n","{\n \"loading\": \"Завантаження…\",\n \"loadingMore\": \"Завантаження інших об’єктів...\"\n}\n","{\n \"loading\": \"正在加载...\",\n \"loadingMore\": \"正在加载更多...\"\n}\n","{\n \"loading\": \"載入中…\",\n \"loadingMore\": \"正在載入更多…\"\n}\n","\n:root {\n --spectrum-listview-item-compact-padding-y: var(--spectrum-global-dimension-size-50);\n --spectrum-listview-item-regular-padding-y: var(--spectrum-global-dimension-size-75);\n --spectrum-listview-item-spacious-padding-y: var(--spectrum-global-dimension-size-100);\n --spectrum-listview-border-width: var(--spectrum-table-border-size, var(--spectrum-alias-border-size-thin));\n --spectrum-listview-border-radius: var(--spectrum-table-border-radius, var(--spectrum-alias-border-radius-regular));\n --spectrum-listview-item-start-end-border-radius: calc(var(--spectrum-listview-border-radius) - var(--spectrum-listview-border-width));\n}\n\n.react-spectrum-ListView {\n box-sizing: border-box;\n border-color: var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid));\n border-style: solid;\n position: relative;\n border-width: var(--spectrum-listview-border-width);\n border-radius: var(--spectrum-listview-border-radius);\n overflow: auto;\n vertical-align: var(--spectrum-table-cell-vertical-alignment);\n border-collapse: separate;\n border-spacing: 0;\n transform: translate3d(0, 0, 0);\n padding: 0;\n background-color: var(--spectrum-table-background-color, var(--spectrum-global-color-gray-50));\n outline: 0;\n\n [role=\"row\"] {\n outline: none;\n }\n}\n\n.react-spectrum-ListView--quiet {\n background-color: var(--spectrum-alias-background-color-transparent);\n border-width: 0;\n}\n\n.react-spectrum-ListViewItem {\n display: grid; /* TODO: define grid areas */\n border: 1px solid transparent;\n border-bottom-color: var(--spectrum-table-cell-border-color, var(--spectrum-global-color-gray-300));\n box-sizing: border-box;\n font-size: var(--spectrum-table-cell-text-size, var(--spectrum-alias-font-size-default));\n font-weight: var(--spectrum-table-cell-text-font-weight, var(--spectrum-global-font-weight-regular));\n line-height: calc(var(--spectrum-table-cell-text-size, var(--spectrum-alias-font-size-default)) * var(--spectrum-table-cell-text-line-height, var(--spectrum-alias-body-text-line-height)) - 1px);\n padding: var(--spectrum-listview-item-regular-padding-y) var(--spectrum-global-dimension-size-150);\n transition: background-color var(--spectrum-global-animation-duration-100) ease-in-out;\n position: relative;\n /*background-color: var(--spectrum-table-background-color, var(--spectrum-global-color-gray-50));*/\n color: var(--spectrum-table-cell-text-color, var(--spectrum-alias-text-color));\n outline: 0;\n min-height: var(--spectrum-global-dimension-size-500);\n\n .react-spectrum-ListView--emphasized & {\n &.is-selected {\n background-color: var(--spectrum-table-row-background-color-selected);\n border-color: var(--spectrum-global-color-blue-500);\n &.is-hovered,\n &.is-active {\n background-color: var(--spectrum-table-row-background-color-selected);\n }\n\n /* avoid double border for adjacent selected items */\n &.is-previous-selected {\n &:not(.is-focused) {\n border-top-color: transparent;\n }\n }\n }\n }\n\n &.is-hovered,\n &.is-focused {\n background-color: var(--spectrum-table-row-background-color-hover);\n }\n\n &:focus-ring {\n background-color: var(--spectrum-table-row-background-color-hover);\n box-shadow: inset 0 0 0 1px var(--spectrum-table-cell-border-color-key-focus);\n border-color: var(--spectrum-global-color-blue-500);\n }\n\n &.is-active {\n background-color: var(--spectrum-table-row-background-color-down);\n }\n\n &.is-selected {\n background-color: var(--spectrum-table-row-background-color-hover);\n\n &.is-hovered,\n &.is-active {\n background-color: var(--spectrum-table-row-background-color-hover);\n }\n }\n\n &.has-checkbox {\n /* have to eliminate vertical padding to allow proper vertical alignment */\n padding-top: 0px;\n padding-bottom: 0px;\n }\n\n .react-spectrum-ListViewItem-grid {\n display: grid;\n grid-template-columns: auto auto auto 1fr auto auto;\n grid-template-rows: 1fr auto;\n grid-template-areas:\n \"checkbox icon image content actions actionmenu chevron\"\n \"checkbox icon image description actions actionmenu chevron\"\n ;\n align-items: center;\n }\n\n .react-spectrum-ListViewItem-checkbox {\n grid-area: checkbox;\n align-items: center;\n justify-items: center;\n min-height: 0;\n height: 100%;\n > span {\n margin: 0;\n }\n }\n\n .react-spectrum-ListViewItem-icon,\n .react-spectrum-ListViewItem-image {\n grid-area: image;\n align-items: center;\n justify-items: center;\n padding-inline-end: var(--spectrum-global-dimension-size-100);\n }\n\n .react-spectrum-ListViewItem-image {\n border-radius: var(--spectrum-global-dimension-size-25);\n width: var(--spectrum-global-dimension-size-400);\n height: var(--spectrum-global-dimension-size-400);\n }\n\n .react-spectrum-ListViewItem-content,\n .react-spectrum-ListViewItem-description {\n flex-grow: 1;\n }\n\n .react-spectrum-ListViewItem-content {\n grid-area: content;\n }\n\n .react-spectrum-ListViewItem-description {\n grid-area: description;\n }\n\n .react-spectrum-ListViewItem-actions {\n grid-area: actions;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n .react-spectrum-ListViewItem-actionmenu {\n grid-area: actionmenu;\n }\n\n .react-spectrum-ListViewItem-parentIndicator {\n grid-area: chevron;\n padding-inline-start: var(--spectrum-global-dimension-size-75);\n }\n\n /* give first and last items border-radius to match listview container */\n div:first-child > div[role=\"row\"] > & {\n border-start-start-radius: var(--spectrum-listview-item-start-end-border-radius);\n border-start-end-radius: var(--spectrum-listview-item-start-end-border-radius);\n }\n div:last-child > div[role=\"row\"] > & {\n border-end-start-radius: var(--spectrum-listview-item-start-end-border-radius);\n border-end-end-radius: var(--spectrum-listview-item-start-end-border-radius);\n }\n}\n\n.react-spectrum-ListView--compact .react-spectrum-ListViewItem {\n padding-top: var(--spectrum-listview-item-compact-padding-y);\n padding-bottom: var(--spectrum-listview-item-compact-padding-y);\n min-height: var(--spectrum-global-dimension-size-400);\n}\n\n.react-spectrum-ListView--spacious .react-spectrum-ListViewItem {\n padding-top: var(--spectrum-listview-item-spacious-padding-y);\n padding-bottom: var(--spectrum-listview-item-spacious-padding-y);\n min-height: var(--spectrum-global-dimension-size-600);\n}\n\n.react-spectrum-ListView-centeredWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n &.react-spectrum-ListView-centeredWrapper--loadingMore {\n padding-top: var(--spectrum-global-dimension-size-50);\n }\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Grid} from '@react-spectrum/layout';\nimport listStyles from './listview.css';\nimport {ListViewContext} from './ListView';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useRef} from 'react';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useGridCell, useGridRow, useGridSelectionCheckbox} from '@react-aria/grid';\nimport {useHover, usePress} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\nexport function ListViewItem(props) {\n let {\n item,\n onAction,\n isEmphasized\n } = props;\n let cellNode = [...item.childNodes][0];\n let {state} = useContext(ListViewContext);\n let {direction} = useLocale();\n let rowRef = useRef<HTMLDivElement>();\n let cellRef = useRef<HTMLDivElement>();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {isFocusVisible, focusProps} = useFocusRing();\n let allowsInteraction = state.selectionManager.selectionMode !== 'none' || onAction;\n let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {pressProps, isPressed} = usePress({isDisabled});\n let {rowProps} = useGridRow({\n node: item,\n isVirtualized: true,\n onAction: onAction ? () => onAction(item.key) : undefined\n }, state, rowRef);\n let {gridCellProps} = useGridCell({\n node: cellNode,\n focusMode: 'cell'\n }, state, cellRef);\n const mergedProps = mergeProps(\n gridCellProps,\n hoverProps,\n focusWithinProps,\n focusProps\n );\n let {checkboxProps} = useGridSelectionCheckbox({...props, key: item.key}, state);\n\n let chevron = null;\n if (item.props.hasChildItems) {\n chevron = direction === 'ltr'\n ? (\n <ChevronRightMedium\n aria-hidden=\"true\"\n UNSAFE_className={listStyles['react-spectrum-ListViewItem-parentIndicator']} />\n )\n : (\n <ChevronLeftMedium\n aria-hidden=\"true\"\n UNSAFE_className={listStyles['react-spectrum-ListViewItem-parentIndicator']} />\n );\n }\n\n let showCheckbox = state.selectionManager.selectionMode !== 'none' && state.selectionManager.selectionBehavior === 'toggle';\n let isSelected = state.selectionManager.isSelected(item.key);\n return (\n <div\n {...mergeProps(rowProps, pressProps)}\n ref={rowRef}>\n <div\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListViewItem',\n {\n 'is-active': isPressed,\n 'is-focused': isFocusVisibleWithin,\n 'focus-ring': isFocusVisible,\n 'is-hovered': isHovered,\n 'is-selected': isSelected,\n 'is-previous-selected': state.selectionManager.isSelected(item.prevKey),\n 'react-spectrum-ListViewItem--highlightSelection': state.selectionManager.selectionBehavior === 'replace' && (isSelected || state.selectionManager.isSelected(item.nextKey))\n }\n )\n }\n ref={cellRef}\n {...mergedProps}>\n <Grid UNSAFE_className={listStyles['react-spectrum-ListViewItem-grid']}>\n {showCheckbox && (\n <Checkbox\n UNSAFE_className={listStyles['react-spectrum-ListViewItem-checkbox']}\n {...checkboxProps}\n isEmphasized={isEmphasized} />\n )}\n <SlotProvider\n slots={{\n content: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content']},\n text: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content']},\n description: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-description']},\n icon: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-icon'], size: 'M'},\n image: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-image']},\n link: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content'], isQuiet: true},\n actionButton: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'], isQuiet: true},\n actionGroup: {\n UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'],\n isQuiet: true,\n density: 'compact'\n },\n actionMenu: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-actionmenu'], isQuiet: true}\n }}>\n {typeof item.rendered === 'string' ? <Content>{item.rendered}</Content> : item.rendered}\n <ClearSlots>\n {chevron}\n </ClearSlots>\n </SlotProvider>\n </Grid>\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,13 +1,20 @@
1
- import { AriaLabelingProps, CollectionBase, DOMProps, StyleProps } from "@react-types/shared";
2
- import React from "react";
3
- interface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps {
4
- isLoading?: boolean;
1
+ import { AriaLabelingProps, AsyncLoadable, CollectionBase, DOMProps, DOMRef, LoadingState, MultipleSelection, SpectrumSelectionProps, StyleProps } from "@react-types/shared";
2
+ import { ReactElement } from "react";
3
+ interface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps, MultipleSelection, SpectrumSelectionProps, Omit<AsyncLoadable, 'isLoading'> {
4
+ /**
5
+ * Sets the amount of vertical padding within each cell.
6
+ * @default 'regular'
7
+ */
8
+ density?: 'compact' | 'regular' | 'spacious';
9
+ isQuiet?: boolean;
10
+ loadingState?: LoadingState;
5
11
  renderEmptyState?: () => JSX.Element;
6
12
  transitionDuration?: number;
13
+ onAction?: (key: string) => void;
7
14
  }
8
15
  export const ListView: <T>(props: ListViewProps<T> & {
9
- ref?: React.Ref<import("@react-types/shared").DOMRefValue<HTMLDivElement>>;
10
- }) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
16
+ ref?: DOMRef<HTMLDivElement>;
17
+ }) => ReactElement;
11
18
  export { Item } from '@react-stately/collections';
12
19
 
13
20
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":"A;A;AC8CA,wBAAwB,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU;IAC3F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,IAAI,OAAO,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAgHD,OAAA,MAAM;A;6MAAuH,CAAC;ACjK9H,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC","sources":["./packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/ListViewItem.tsx","./packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/ListView.tsx","./packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/index.ts"],"sourcesContent":[null,null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;ACyEA,wBAAwB,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;IACxK;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,IAAI,OAAO,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAoJD,OAAA,MAAM;UAA+E,OAAO,cAAc,CAAC;MAAM,YAAY,CAAC;ACvO9H,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/ListViewItem.tsx","packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/ListView.tsx","packages/@react-spectrum/list/src/packages/@react-spectrum/list/src/index.ts","packages/@react-spectrum/list/src/index.ts"],"sourcesContent":[null,null,null,"export {ListView} from './ListView';\nexport {Item} from '@react-stately/collections';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/list",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,30 +32,31 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/focus": "^3.4.1",
36
- "@react-aria/grid": "3.0.0-rc.0",
37
- "@react-aria/i18n": "^3.3.2",
38
- "@react-aria/interactions": "^3.5.1",
39
- "@react-aria/listbox": "^3.3.1",
40
- "@react-aria/separator": "^3.1.3",
41
- "@react-aria/utils": "^3.8.2",
42
- "@react-aria/virtualizer": "^3.3.4",
43
- "@react-spectrum/button": "^3.5.1",
44
- "@react-spectrum/layout": "^3.2.1",
45
- "@react-spectrum/listbox": "^3.5.1",
46
- "@react-spectrum/progress": "^3.1.3",
47
- "@react-spectrum/text": "^3.1.3",
48
- "@react-spectrum/textfield": "^3.1.7",
49
- "@react-spectrum/utils": "^3.6.2",
50
- "@react-spectrum/view": "^3.1.3",
51
- "@react-stately/collections": "^3.3.3",
52
- "@react-stately/grid": "3.0.0-rc.0",
53
- "@react-stately/layout": "^3.4.0",
54
- "@react-stately/list": "^3.3.0",
55
- "@react-stately/virtualizer": "^3.1.5",
56
- "@react-types/listbox": "^3.2.1",
57
- "@react-types/shared": "^3.8.0",
58
- "@spectrum-icons/ui": "^3.2.1"
35
+ "@react-aria/focus": "^3.5.1",
36
+ "@react-aria/grid": "^3.2.1",
37
+ "@react-aria/i18n": "^3.3.5",
38
+ "@react-aria/interactions": "^3.8.0",
39
+ "@react-aria/listbox": "^3.4.1",
40
+ "@react-aria/separator": "^3.1.4",
41
+ "@react-aria/utils": "^3.11.1",
42
+ "@react-aria/virtualizer": "^3.3.6",
43
+ "@react-spectrum/button": "^3.7.0",
44
+ "@react-spectrum/checkbox": "^3.3.0",
45
+ "@react-spectrum/layout": "^3.2.2",
46
+ "@react-spectrum/listbox": "^3.5.4",
47
+ "@react-spectrum/progress": "^3.1.4",
48
+ "@react-spectrum/text": "^3.1.4",
49
+ "@react-spectrum/textfield": "^3.3.1",
50
+ "@react-spectrum/utils": "^3.6.4",
51
+ "@react-spectrum/view": "^3.1.4",
52
+ "@react-stately/collections": "^3.3.5",
53
+ "@react-stately/grid": "^3.1.1",
54
+ "@react-stately/layout": "^3.4.3",
55
+ "@react-stately/list": "^3.4.2",
56
+ "@react-stately/virtualizer": "3.1.7-alpha.0",
57
+ "@react-types/listbox": "^3.2.2",
58
+ "@react-types/shared": "^3.11.0",
59
+ "@spectrum-icons/ui": "^3.2.2"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@adobe/spectrum-css-temp": "^3.0.0-alpha.1"
@@ -68,5 +69,5 @@
68
69
  "publishConfig": {
69
70
  "access": "public"
70
71
  },
71
- "gitHead": "9204e1b8cb61dac767e91087fb16203611dc67c5"
72
+ "gitHead": "54c2366c4f31bd4bf619126131cd583c12972acc"
72
73
  }
package/src/ListView.tsx CHANGED
@@ -9,7 +9,17 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import {AriaLabelingProps, CollectionBase, DOMProps, DOMRef, StyleProps} from '@react-types/shared';
12
+ import {
13
+ AriaLabelingProps,
14
+ AsyncLoadable,
15
+ CollectionBase,
16
+ DOMProps,
17
+ DOMRef,
18
+ LoadingState,
19
+ MultipleSelection,
20
+ SpectrumSelectionProps,
21
+ StyleProps
22
+ } from '@react-types/shared';
13
23
  import {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';
14
24
  import {GridCollection, useGridState} from '@react-stately/grid';
15
25
  import {GridKeyboardDelegate, useGrid} from '@react-aria/grid';
@@ -28,35 +38,65 @@ import {Virtualizer} from '@react-aria/virtualizer';
28
38
 
29
39
  export const ListViewContext = React.createContext(null);
30
40
 
31
- export function useListLayout<T>(state: ListState<T>) {
41
+ const ROW_HEIGHTS = {
42
+ compact: {
43
+ medium: 32,
44
+ large: 40
45
+ },
46
+ regular: {
47
+ medium: 40,
48
+ large: 50
49
+ },
50
+ spacious: {
51
+ medium: 48,
52
+ large: 60
53
+ }
54
+ };
55
+
56
+ export function useListLayout<T>(state: ListState<T>, density: ListViewProps<T>['density']) {
32
57
  let {scale} = useProvider();
33
58
  let collator = useCollator({usage: 'search', sensitivity: 'base'});
59
+ let isEmpty = state.collection.size === 0;
34
60
  let layout = useMemo(() =>
35
61
  new ListLayout<T>({
36
- estimatedRowHeight: scale === 'large' ? 48 : 32,
62
+ estimatedRowHeight: ROW_HEIGHTS[density][scale],
37
63
  padding: 0,
38
- collator
64
+ collator,
65
+ loaderHeight: isEmpty ? null : ROW_HEIGHTS[density][scale]
39
66
  })
40
- , [collator, scale]);
67
+ , [collator, scale, density, isEmpty]);
41
68
 
42
69
  layout.collection = state.collection;
43
70
  layout.disabledKeys = state.disabledKeys;
44
71
  return layout;
45
72
  }
46
73
 
47
- interface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps {
48
- isLoading?: boolean,
74
+ interface ListViewProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, StyleProps, MultipleSelection, SpectrumSelectionProps, Omit<AsyncLoadable, 'isLoading'> {
75
+ /**
76
+ * Sets the amount of vertical padding within each cell.
77
+ * @default 'regular'
78
+ */
79
+ density?: 'compact' | 'regular' | 'spacious',
80
+ isQuiet?: boolean,
81
+ loadingState?: LoadingState,
49
82
  renderEmptyState?: () => JSX.Element,
50
- transitionDuration?: number
83
+ transitionDuration?: number,
84
+ onAction?: (key: string) => void
51
85
  }
52
86
 
53
87
  function ListView<T extends object>(props: ListViewProps<T>, ref: DOMRef<HTMLDivElement>) {
54
88
  let {
55
- transitionDuration = 0
89
+ density = 'regular',
90
+ onLoadMore,
91
+ loadingState,
92
+ isQuiet,
93
+ transitionDuration = 0,
94
+ onAction
56
95
  } = props;
57
96
  let domRef = useDOMRef(ref);
58
97
  let {collection} = useListState(props);
59
98
  let formatMessage = useMessageFormatter(intlMessages);
99
+ let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
60
100
 
61
101
  let {styleProps} = useStyleProps(props);
62
102
  let {direction} = useLocale();
@@ -64,25 +104,36 @@ function ListView<T extends object>(props: ListViewProps<T>, ref: DOMRef<HTMLDiv
64
104
  let gridCollection = useMemo(() => new GridCollection({
65
105
  columnCount: 1,
66
106
  items: [...collection].map(item => ({
67
- type: 'item',
107
+ ...item,
108
+ hasChildNodes: true,
68
109
  childNodes: [{
69
- ...item,
110
+ key: `cell-${item.key}`,
111
+ type: 'cell',
70
112
  index: 0,
71
- type: 'cell'
113
+ value: null,
114
+ level: 0,
115
+ rendered: null,
116
+ textValue: item.textValue,
117
+ hasChildNodes: false,
118
+ childNodes: []
72
119
  }]
73
120
  }))
74
121
  }), [collection]);
75
122
  let state = useGridState({
76
123
  ...props,
77
- collection: gridCollection
124
+ collection: gridCollection,
125
+ focusMode: 'cell',
126
+ selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'
78
127
  });
79
- let layout = useListLayout(state);
128
+ let layout = useListLayout(state, props.density || 'regular');
80
129
  let keyboardDelegate = useMemo(() => new GridKeyboardDelegate({
81
130
  collection: state.collection,
82
131
  disabledKeys: state.disabledKeys,
83
132
  ref: domRef,
84
133
  direction,
85
134
  collator,
135
+ // Focus the ListView cell instead of the row so that focus doesn't change with left/right arrow keys when there aren't any
136
+ // focusable children in the cell.
86
137
  focusMode: 'cell'
87
138
  }), [state, domRef, direction, collator]);
88
139
  let {gridProps} = useGrid({
@@ -92,31 +143,43 @@ function ListView<T extends object>(props: ListViewProps<T>, ref: DOMRef<HTMLDiv
92
143
  }, state, domRef);
93
144
 
94
145
  // Sync loading state into the layout.
95
- layout.isLoading = props.isLoading;
146
+ layout.isLoading = isLoading;
147
+
148
+ let focusedKey = state.selectionManager.focusedKey;
149
+ let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
150
+ if (focusedItem?.parentKey != null) {
151
+ focusedKey = focusedItem.parentKey;
152
+ }
96
153
 
97
154
  return (
98
155
  <ListViewContext.Provider value={{state, keyboardDelegate}}>
99
156
  <Virtualizer
100
157
  {...gridProps}
101
158
  {...styleProps}
159
+ isLoading={isLoading}
160
+ onLoadMore={onLoadMore}
102
161
  ref={domRef}
103
- focusedKey={state.selectionManager.focusedKey}
104
- sizeToFit="height"
162
+ focusedKey={focusedKey}
105
163
  scrollDirection="vertical"
106
164
  className={
107
165
  classNames(
108
166
  listStyles,
109
167
  'react-spectrum-ListView',
168
+ `react-spectrum-ListView--${density}`,
169
+ 'react-spectrum-ListView--emphasized',
170
+ {
171
+ 'react-spectrum-ListView--quiet': isQuiet
172
+ },
110
173
  styleProps.className
111
174
  )
112
175
  }
113
176
  layout={layout}
114
- collection={collection}
177
+ collection={gridCollection}
115
178
  transitionDuration={transitionDuration}>
116
179
  {(type, item) => {
117
180
  if (type === 'item') {
118
181
  return (
119
- <ListViewItem item={item} />
182
+ <ListViewItem item={item} onAction={onAction} isEmphasized />
120
183
  );
121
184
  } else if (type === 'loader') {
122
185
  return (
@@ -152,7 +215,14 @@ function CenteredWrapper({children}) {
152
215
  <div
153
216
  role="row"
154
217
  aria-rowindex={state.collection.size + 1}
155
- className={classNames(listStyles, 'react-spectrum-ListView-centeredWrapper')}>
218
+ className={
219
+ classNames(
220
+ listStyles,
221
+ 'react-spectrum-ListView-centeredWrapper',
222
+ {
223
+ 'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0
224
+ }
225
+ )}>
156
226
  <div role="gridcell">
157
227
  {children}
158
228
  </div>
@@ -9,60 +9,126 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import {classNames} from '@react-spectrum/utils';
12
+ import {Checkbox} from '@react-spectrum/checkbox';
13
+ import ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';
14
+ import ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';
15
+ import {classNames, ClearSlots, SlotProvider} from '@react-spectrum/utils';
16
+ import {Content} from '@react-spectrum/view';
17
+ import {Grid} from '@react-spectrum/layout';
13
18
  import listStyles from './listview.css';
14
19
  import {ListViewContext} from './ListView';
15
20
  import {mergeProps} from '@react-aria/utils';
16
21
  import React, {useContext, useRef} from 'react';
17
22
  import {useFocusRing} from '@react-aria/focus';
18
- import {useGridCell, useGridRow} from '@react-aria/grid';
19
- import {useHover} from '@react-aria/interactions';
20
-
23
+ import {useGridCell, useGridRow, useGridSelectionCheckbox} from '@react-aria/grid';
24
+ import {useHover, usePress} from '@react-aria/interactions';
25
+ import {useLocale} from '@react-aria/i18n';
21
26
 
22
27
  export function ListViewItem(props) {
23
28
  let {
24
- item
29
+ item,
30
+ onAction,
31
+ isEmphasized
25
32
  } = props;
33
+ let cellNode = [...item.childNodes][0];
26
34
  let {state} = useContext(ListViewContext);
27
- let ref = useRef<HTMLDivElement>();
35
+ let {direction} = useLocale();
36
+ let rowRef = useRef<HTMLDivElement>();
37
+ let cellRef = useRef<HTMLDivElement>();
28
38
  let {
29
39
  isFocusVisible: isFocusVisibleWithin,
30
40
  focusProps: focusWithinProps
31
41
  } = useFocusRing({within: true});
32
42
  let {isFocusVisible, focusProps} = useFocusRing();
33
- let {hoverProps, isHovered} = useHover({});
43
+ let allowsInteraction = state.selectionManager.selectionMode !== 'none' || onAction;
44
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
45
+ let {hoverProps, isHovered} = useHover({isDisabled});
46
+ let {pressProps, isPressed} = usePress({isDisabled});
34
47
  let {rowProps} = useGridRow({
35
48
  node: item,
36
- isVirtualized: true
37
- }, state, ref);
49
+ isVirtualized: true,
50
+ onAction: onAction ? () => onAction(item.key) : undefined
51
+ }, state, rowRef);
38
52
  let {gridCellProps} = useGridCell({
39
- node: item,
53
+ node: cellNode,
40
54
  focusMode: 'cell'
41
- }, state, ref);
55
+ }, state, cellRef);
42
56
  const mergedProps = mergeProps(
43
57
  gridCellProps,
44
58
  hoverProps,
45
59
  focusWithinProps,
46
60
  focusProps
47
61
  );
62
+ let {checkboxProps} = useGridSelectionCheckbox({...props, key: item.key}, state);
63
+
64
+ let chevron = null;
65
+ if (item.props.hasChildItems) {
66
+ chevron = direction === 'ltr'
67
+ ? (
68
+ <ChevronRightMedium
69
+ aria-hidden="true"
70
+ UNSAFE_className={listStyles['react-spectrum-ListViewItem-parentIndicator']} />
71
+ )
72
+ : (
73
+ <ChevronLeftMedium
74
+ aria-hidden="true"
75
+ UNSAFE_className={listStyles['react-spectrum-ListViewItem-parentIndicator']} />
76
+ );
77
+ }
48
78
 
79
+ let showCheckbox = state.selectionManager.selectionMode !== 'none' && state.selectionManager.selectionBehavior === 'toggle';
80
+ let isSelected = state.selectionManager.isSelected(item.key);
49
81
  return (
50
- <div {...rowProps}>
82
+ <div
83
+ {...mergeProps(rowProps, pressProps)}
84
+ ref={rowRef}>
51
85
  <div
52
86
  className={
53
87
  classNames(
54
88
  listStyles,
55
89
  'react-spectrum-ListViewItem',
56
90
  {
91
+ 'is-active': isPressed,
57
92
  'is-focused': isFocusVisibleWithin,
58
93
  'focus-ring': isFocusVisible,
59
- 'is-hovered': isHovered
94
+ 'is-hovered': isHovered,
95
+ 'is-selected': isSelected,
96
+ 'is-previous-selected': state.selectionManager.isSelected(item.prevKey),
97
+ 'react-spectrum-ListViewItem--highlightSelection': state.selectionManager.selectionBehavior === 'replace' && (isSelected || state.selectionManager.isSelected(item.nextKey))
60
98
  }
61
99
  )
62
100
  }
63
- ref={ref}
101
+ ref={cellRef}
64
102
  {...mergedProps}>
65
- {item.rendered}
103
+ <Grid UNSAFE_className={listStyles['react-spectrum-ListViewItem-grid']}>
104
+ {showCheckbox && (
105
+ <Checkbox
106
+ UNSAFE_className={listStyles['react-spectrum-ListViewItem-checkbox']}
107
+ {...checkboxProps}
108
+ isEmphasized={isEmphasized} />
109
+ )}
110
+ <SlotProvider
111
+ slots={{
112
+ content: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content']},
113
+ text: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content']},
114
+ description: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-description']},
115
+ icon: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-icon'], size: 'M'},
116
+ image: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-image']},
117
+ link: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-content'], isQuiet: true},
118
+ actionButton: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'], isQuiet: true},
119
+ actionGroup: {
120
+ UNSAFE_className: listStyles['react-spectrum-ListViewItem-actions'],
121
+ isQuiet: true,
122
+ density: 'compact'
123
+ },
124
+ actionMenu: {UNSAFE_className: listStyles['react-spectrum-ListViewItem-actionmenu'], isQuiet: true}
125
+ }}>
126
+ {typeof item.rendered === 'string' ? <Content>{item.rendered}</Content> : item.rendered}
127
+ <ClearSlots>
128
+ {chevron}
129
+ </ClearSlots>
130
+ </SlotProvider>
131
+ </Grid>
66
132
  </div>
67
133
  </div>
68
134
  );