@react-spectrum/card 3.0.0-alpha.30 → 3.0.0-alpha.32

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.
Files changed (229) hide show
  1. package/dist/BaseLayout.main.js +218 -0
  2. package/dist/BaseLayout.main.js.map +1 -0
  3. package/dist/BaseLayout.mjs +213 -0
  4. package/dist/BaseLayout.module.js +213 -0
  5. package/dist/BaseLayout.module.js.map +1 -0
  6. package/dist/Card.main.js +51 -0
  7. package/dist/Card.main.js.map +1 -0
  8. package/dist/Card.mjs +42 -0
  9. package/dist/Card.module.js +42 -0
  10. package/dist/Card.module.js.map +1 -0
  11. package/dist/CardBase.main.js +205 -0
  12. package/dist/CardBase.main.js.map +1 -0
  13. package/dist/CardBase.mjs +200 -0
  14. package/dist/CardBase.module.js +200 -0
  15. package/dist/CardBase.module.js.map +1 -0
  16. package/dist/CardView.main.js +232 -0
  17. package/dist/CardView.main.js.map +1 -0
  18. package/dist/CardView.mjs +227 -0
  19. package/dist/CardView.module.js +227 -0
  20. package/dist/CardView.module.js.map +1 -0
  21. package/dist/CardViewContext.main.js +31 -0
  22. package/dist/CardViewContext.main.js.map +1 -0
  23. package/dist/CardViewContext.mjs +21 -0
  24. package/dist/CardViewContext.module.js +21 -0
  25. package/dist/CardViewContext.module.js.map +1 -0
  26. package/dist/GalleryLayout.main.js +229 -0
  27. package/dist/GalleryLayout.main.js.map +1 -0
  28. package/dist/GalleryLayout.mjs +224 -0
  29. package/dist/GalleryLayout.module.js +224 -0
  30. package/dist/GalleryLayout.module.js.map +1 -0
  31. package/dist/GridLayout.main.js +198 -0
  32. package/dist/GridLayout.main.js.map +1 -0
  33. package/dist/GridLayout.mjs +193 -0
  34. package/dist/GridLayout.module.js +193 -0
  35. package/dist/GridLayout.module.js.map +1 -0
  36. package/dist/WaterfallLayout.main.js +181 -0
  37. package/dist/WaterfallLayout.main.js.map +1 -0
  38. package/dist/WaterfallLayout.mjs +176 -0
  39. package/dist/WaterfallLayout.module.js +176 -0
  40. package/dist/WaterfallLayout.module.js.map +1 -0
  41. package/dist/ar-AE.main.js +7 -0
  42. package/dist/ar-AE.main.js.map +1 -0
  43. package/dist/ar-AE.mjs +9 -0
  44. package/dist/ar-AE.module.js +9 -0
  45. package/dist/ar-AE.module.js.map +1 -0
  46. package/dist/bg-BG.main.js +7 -0
  47. package/dist/bg-BG.main.js.map +1 -0
  48. package/dist/bg-BG.mjs +9 -0
  49. package/dist/bg-BG.module.js +9 -0
  50. package/dist/bg-BG.module.js.map +1 -0
  51. package/dist/card_vars_css.main.js +116 -0
  52. package/dist/card_vars_css.main.js.map +1 -0
  53. package/dist/card_vars_css.mjs +118 -0
  54. package/dist/card_vars_css.module.js +118 -0
  55. package/dist/card_vars_css.module.js.map +1 -0
  56. package/dist/cs-CZ.main.js +7 -0
  57. package/dist/cs-CZ.main.js.map +1 -0
  58. package/dist/cs-CZ.mjs +9 -0
  59. package/dist/cs-CZ.module.js +9 -0
  60. package/dist/cs-CZ.module.js.map +1 -0
  61. package/dist/da-DK.main.js +7 -0
  62. package/dist/da-DK.main.js.map +1 -0
  63. package/dist/da-DK.mjs +9 -0
  64. package/dist/da-DK.module.js +9 -0
  65. package/dist/da-DK.module.js.map +1 -0
  66. package/dist/de-DE.main.js +7 -0
  67. package/dist/de-DE.main.js.map +1 -0
  68. package/dist/de-DE.mjs +9 -0
  69. package/dist/de-DE.module.js +9 -0
  70. package/dist/de-DE.module.js.map +1 -0
  71. package/dist/el-GR.main.js +7 -0
  72. package/dist/el-GR.main.js.map +1 -0
  73. package/dist/el-GR.mjs +9 -0
  74. package/dist/el-GR.module.js +9 -0
  75. package/dist/el-GR.module.js.map +1 -0
  76. package/dist/en-US.main.js +7 -0
  77. package/dist/en-US.main.js.map +1 -0
  78. package/dist/en-US.mjs +9 -0
  79. package/dist/en-US.module.js +9 -0
  80. package/dist/en-US.module.js.map +1 -0
  81. package/dist/es-ES.main.js +7 -0
  82. package/dist/es-ES.main.js.map +1 -0
  83. package/dist/es-ES.mjs +9 -0
  84. package/dist/es-ES.module.js +9 -0
  85. package/dist/es-ES.module.js.map +1 -0
  86. package/dist/et-EE.main.js +7 -0
  87. package/dist/et-EE.main.js.map +1 -0
  88. package/dist/et-EE.mjs +9 -0
  89. package/dist/et-EE.module.js +9 -0
  90. package/dist/et-EE.module.js.map +1 -0
  91. package/dist/fi-FI.main.js +7 -0
  92. package/dist/fi-FI.main.js.map +1 -0
  93. package/dist/fi-FI.mjs +9 -0
  94. package/dist/fi-FI.module.js +9 -0
  95. package/dist/fi-FI.module.js.map +1 -0
  96. package/dist/fr-FR.main.js +7 -0
  97. package/dist/fr-FR.main.js.map +1 -0
  98. package/dist/fr-FR.mjs +9 -0
  99. package/dist/fr-FR.module.js +9 -0
  100. package/dist/fr-FR.module.js.map +1 -0
  101. package/dist/he-IL.main.js +7 -0
  102. package/dist/he-IL.main.js.map +1 -0
  103. package/dist/he-IL.mjs +9 -0
  104. package/dist/he-IL.module.js +9 -0
  105. package/dist/he-IL.module.js.map +1 -0
  106. package/dist/hr-HR.main.js +7 -0
  107. package/dist/hr-HR.main.js.map +1 -0
  108. package/dist/hr-HR.mjs +9 -0
  109. package/dist/hr-HR.module.js +9 -0
  110. package/dist/hr-HR.module.js.map +1 -0
  111. package/dist/hu-HU.main.js +7 -0
  112. package/dist/hu-HU.main.js.map +1 -0
  113. package/dist/hu-HU.mjs +9 -0
  114. package/dist/hu-HU.module.js +9 -0
  115. package/dist/hu-HU.module.js.map +1 -0
  116. package/dist/import.mjs +5 -1628
  117. package/dist/intlStrings.main.js +108 -0
  118. package/dist/intlStrings.main.js.map +1 -0
  119. package/dist/intlStrings.mjs +110 -0
  120. package/dist/intlStrings.module.js +110 -0
  121. package/dist/intlStrings.module.js.map +1 -0
  122. package/dist/it-IT.main.js +7 -0
  123. package/dist/it-IT.main.js.map +1 -0
  124. package/dist/it-IT.mjs +9 -0
  125. package/dist/it-IT.module.js +9 -0
  126. package/dist/it-IT.module.js.map +1 -0
  127. package/dist/ja-JP.main.js +7 -0
  128. package/dist/ja-JP.main.js.map +1 -0
  129. package/dist/ja-JP.mjs +9 -0
  130. package/dist/ja-JP.module.js +9 -0
  131. package/dist/ja-JP.module.js.map +1 -0
  132. package/dist/ko-KR.main.js +7 -0
  133. package/dist/ko-KR.main.js.map +1 -0
  134. package/dist/ko-KR.mjs +9 -0
  135. package/dist/ko-KR.module.js +9 -0
  136. package/dist/ko-KR.module.js.map +1 -0
  137. package/dist/lt-LT.main.js +7 -0
  138. package/dist/lt-LT.main.js.map +1 -0
  139. package/dist/lt-LT.mjs +9 -0
  140. package/dist/lt-LT.module.js +9 -0
  141. package/dist/lt-LT.module.js.map +1 -0
  142. package/dist/lv-LV.main.js +7 -0
  143. package/dist/lv-LV.main.js.map +1 -0
  144. package/dist/lv-LV.mjs +9 -0
  145. package/dist/lv-LV.module.js +9 -0
  146. package/dist/lv-LV.module.js.map +1 -0
  147. package/dist/main.js +10 -1629
  148. package/dist/main.js.map +1 -1
  149. package/dist/module.js +5 -1628
  150. package/dist/module.js.map +1 -1
  151. package/dist/nb-NO.main.js +7 -0
  152. package/dist/nb-NO.main.js.map +1 -0
  153. package/dist/nb-NO.mjs +9 -0
  154. package/dist/nb-NO.module.js +9 -0
  155. package/dist/nb-NO.module.js.map +1 -0
  156. package/dist/nl-NL.main.js +7 -0
  157. package/dist/nl-NL.main.js.map +1 -0
  158. package/dist/nl-NL.mjs +9 -0
  159. package/dist/nl-NL.module.js +9 -0
  160. package/dist/nl-NL.module.js.map +1 -0
  161. package/dist/pl-PL.main.js +7 -0
  162. package/dist/pl-PL.main.js.map +1 -0
  163. package/dist/pl-PL.mjs +9 -0
  164. package/dist/pl-PL.module.js +9 -0
  165. package/dist/pl-PL.module.js.map +1 -0
  166. package/dist/pt-BR.main.js +7 -0
  167. package/dist/pt-BR.main.js.map +1 -0
  168. package/dist/pt-BR.mjs +9 -0
  169. package/dist/pt-BR.module.js +9 -0
  170. package/dist/pt-BR.module.js.map +1 -0
  171. package/dist/pt-PT.main.js +7 -0
  172. package/dist/pt-PT.main.js.map +1 -0
  173. package/dist/pt-PT.mjs +9 -0
  174. package/dist/pt-PT.module.js +9 -0
  175. package/dist/pt-PT.module.js.map +1 -0
  176. package/dist/ro-RO.main.js +7 -0
  177. package/dist/ro-RO.main.js.map +1 -0
  178. package/dist/ro-RO.mjs +9 -0
  179. package/dist/ro-RO.module.js +9 -0
  180. package/dist/ro-RO.module.js.map +1 -0
  181. package/dist/ru-RU.main.js +7 -0
  182. package/dist/ru-RU.main.js.map +1 -0
  183. package/dist/ru-RU.mjs +9 -0
  184. package/dist/ru-RU.module.js +9 -0
  185. package/dist/ru-RU.module.js.map +1 -0
  186. package/dist/sk-SK.main.js +7 -0
  187. package/dist/sk-SK.main.js.map +1 -0
  188. package/dist/sk-SK.mjs +9 -0
  189. package/dist/sk-SK.module.js +9 -0
  190. package/dist/sk-SK.module.js.map +1 -0
  191. package/dist/sl-SI.main.js +7 -0
  192. package/dist/sl-SI.main.js.map +1 -0
  193. package/dist/sl-SI.mjs +9 -0
  194. package/dist/sl-SI.module.js +9 -0
  195. package/dist/sl-SI.module.js.map +1 -0
  196. package/dist/sr-SP.main.js +7 -0
  197. package/dist/sr-SP.main.js.map +1 -0
  198. package/dist/sr-SP.mjs +9 -0
  199. package/dist/sr-SP.module.js +9 -0
  200. package/dist/sr-SP.module.js.map +1 -0
  201. package/dist/sv-SE.main.js +7 -0
  202. package/dist/sv-SE.main.js.map +1 -0
  203. package/dist/sv-SE.mjs +9 -0
  204. package/dist/sv-SE.module.js +9 -0
  205. package/dist/sv-SE.module.js.map +1 -0
  206. package/dist/tr-TR.main.js +7 -0
  207. package/dist/tr-TR.main.js.map +1 -0
  208. package/dist/tr-TR.mjs +9 -0
  209. package/dist/tr-TR.module.js +9 -0
  210. package/dist/tr-TR.module.js.map +1 -0
  211. package/dist/uk-UA.main.js +7 -0
  212. package/dist/uk-UA.main.js.map +1 -0
  213. package/dist/uk-UA.mjs +9 -0
  214. package/dist/uk-UA.module.js +9 -0
  215. package/dist/uk-UA.module.js.map +1 -0
  216. package/dist/vars.e5a6cd16.css +1671 -0
  217. package/dist/vars.e5a6cd16.css.map +1 -0
  218. package/dist/zh-CN.main.js +7 -0
  219. package/dist/zh-CN.main.js.map +1 -0
  220. package/dist/zh-CN.mjs +9 -0
  221. package/dist/zh-CN.module.js +9 -0
  222. package/dist/zh-CN.module.js.map +1 -0
  223. package/dist/zh-TW.main.js +7 -0
  224. package/dist/zh-TW.main.js.map +1 -0
  225. package/dist/zh-TW.mjs +9 -0
  226. package/dist/zh-TW.module.js +9 -0
  227. package/dist/zh-TW.module.js.map +1 -0
  228. package/package.json +18 -18
  229. package/dist/main.css +0 -1
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD,SAAS,+BAA2B,KAA+B,EAAE,GAA2B;IAC9F,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,wCAAU;IACxB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,WACF,OAAO,oBACP,gBAAgB,UAChB,MAAM,gBACN,YAAY,cACZ,UAAU,mBACV,kBAAkB,YACnB,GAAG;IAEJ,IAAI,WAAW,CAAA,GAAA,gCAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,YAAY,iBAAiB,aAAa,iBAAiB;IAC/D,IAAI,iBAAiB,CAAA,GAAA,oBAAM,EAAE,IAAM,OAAO,WAAW,aAAa,IAAI,OAAO;sBAAC;6BAAU;mBAAiB;QAAK,KAAK,QAAQ;QAAC;QAAQ;QAAU;QAAiB;KAAM;IACrK,IAAI,aAAa,eAAe,UAAU;IAE1C,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW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AG;qBAC5D,0DAAC,CAAA,GAAA,kCAAO;QACN,KAAK;QACL,cAAc;QACd,SAAS;QACT,aAAa;QACb,MAAM;QACN,QAAQ;OACP,KAAK,QAAQ;AAItB;AAEA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/card/src/CardView.tsx"],"sourcesContent":["/*\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 */\n\nimport {CardBase} from './CardBase';\nimport {CardViewContext, useCardViewContext} from './CardViewContext';\nimport {classNames, useDOMRef, useStyleProps, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {DOMRef, DOMRefValue, Node} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ReactElement, ReactNode, useCallback, useMemo, useRef} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport {SpectrumCardViewProps} from '@react-types/card';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useGrid, useGridCell, useGridRow} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer, VirtualizerItem} from '@react-aria/virtualizer';\n\nfunction CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {\n isQuiet,\n renderEmptyState,\n layout,\n loadingState,\n onLoadMore,\n cardOrientation = 'vertical'\n } = props;\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let cardViewLayout = useMemo(() => typeof layout === 'function' ? new layout({collator, cardOrientation, scale}) : layout, [layout, collator, cardOrientation, scale]);\n let layoutType = cardViewLayout.layoutType;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/card');\n let {direction} = useLocale();\n let {collection} = useListState(props);\n\n let gridCollection = useMemo(() => new GridCollection<T>({\n columnCount: 1,\n items: [...collection].map(item => ({\n // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys\n ...item,\n hasChildNodes: true,\n childNodes: [{\n key: `cell-${item.key}`,\n type: 'cell',\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue,\n hasChildNodes: false,\n childNodes: []\n }]\n }))\n }), [collection]);\n\n let state = useGridState({\n ...props,\n selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,\n collection: gridCollection,\n focusMode: 'cell'\n });\n\n cardViewLayout.collection = gridCollection;\n cardViewLayout.disabledKeys = state.disabledKeys;\n cardViewLayout.isLoading = isLoading;\n cardViewLayout.direction = direction;\n\n let {gridProps} = useGrid({\n ...props,\n isVirtualized: true,\n keyboardDelegate: cardViewLayout\n }, state, domRef);\n\n type View = ReusableView<Node<T>, ReactNode>;\n let renderWrapper = (parent: View, reusableView: View) => (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\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 let margin = cardViewLayout.margin || 0;\n let virtualizer = cardViewLayout.virtualizer;\n let scrollToItem = useCallback((key) => {\n virtualizer && virtualizer.scrollToItem(key, {\n duration: 0,\n offsetY: margin\n });\n }, [margin, virtualizer]);\n\n // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted\n return (\n <CardViewContext.Provider value={{state, isQuiet, layout: cardViewLayout, cardOrientation}}>\n <Virtualizer\n {...gridProps}\n {...styleProps}\n className={classNames(styles, 'spectrum-CardView')}\n ref={domRef}\n focusedKey={focusedKey}\n scrollDirection=\"vertical\"\n layout={cardViewLayout}\n collection={gridCollection}\n isLoading={isLoading}\n onLoadMore={onLoadMore}\n renderWrapper={renderWrapper}\n transitionDuration={isLoading ? 160 : 220}\n scrollToItem={scrollToItem}>\n {(type, item) => {\n if (type === 'item') {\n return (\n <InternalCard item={item} />\n );\n } else if (type === 'loader') {\n return (\n <CenteredWrapper>\n <ProgressCircle\n isIndeterminate\n aria-label={state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')} />\n </CenteredWrapper>\n );\n } else if (type === 'placeholder') {\n let emptyState = renderEmptyState ? renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <CenteredWrapper>\n {emptyState}\n </CenteredWrapper>\n );\n }\n }}\n </Virtualizer>\n </CardViewContext.Provider>\n\n );\n}\n\nfunction CenteredWrapper({children}) {\n let {state} = useCardViewContext();\n return (\n <div\n role=\"row\"\n aria-rowindex={state.collection.size + 1}\n className={classNames(styles, 'spectrum-CardView-centeredWrapper')}>\n <div role=\"gridcell\">\n {children}\n </div>\n </div>\n );\n}\n\nfunction InternalCard(props) {\n let {\n item\n } = props;\n let cellNode = [...item.childNodes][0];\n let {state, cardOrientation, isQuiet, layout} = useCardViewContext();\n\n let layoutType = layout.layoutType;\n let rowRef = useRef();\n let cellRef = useRef<DOMRefValue<HTMLDivElement>>();\n let unwrappedRef = useUnwrapDOMRef(cellRef);\n\n let {rowProps: gridRowProps} = useGridRow({\n node: item,\n isVirtualized: true\n }, state, rowRef);\n\n let {gridCellProps} = useGridCell({\n node: cellNode,\n focusMode: 'cell'\n }, state, unwrappedRef);\n\n // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode=\"none\" CardView.\n let allowsInteraction = state.selectionManager.selectionMode !== 'none';\n let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);\n\n let onKeyDown = (e) => {\n if (e.key === ' ' && isDisabled) {\n e.preventDefault();\n }\n };\n\n let rowProps = mergeProps(\n gridRowProps,\n {onKeyDown}\n );\n\n if (layoutType === 'grid' || layoutType === 'gallery') {\n isQuiet = true;\n }\n\n if (layoutType !== 'grid') {\n cardOrientation = 'vertical';\n }\n\n // We don't want to focus the checkbox (or any other focusable elements) within the Card\n // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between\n // the cards in the CardView is handled by useGrid => useSelectableCollection instead.\n delete gridCellProps.onKeyDownCapture;\n return (\n <div {...rowProps} ref={rowRef} className={classNames(styles, 'spectrum-CardView-row')}>\n <CardBase\n ref={cellRef}\n articleProps={gridCellProps}\n isQuiet={isQuiet}\n orientation={cardOrientation}\n item={item}\n layout={layoutType}>\n {item.rendered}\n </CardBase>\n </div>\n );\n}\n\n/**\n * TODO: Add description of component here.\n */\nconst _CardView = React.forwardRef(CardView) as <T>(props: SpectrumCardViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_CardView as CardView};\n"],"names":[],"version":3,"file":"CardView.main.js.map"}
@@ -0,0 +1,227 @@
1
+ import {CardBase as $643dd8fa80926f94$export$7a6ccaf429ad93a8} from "./CardBase.mjs";
2
+ import {CardViewContext as $8d180a244893de14$export$64992ac69f286e5c, useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.mjs";
3
+ import $iOsT7$intlStringsmodulejs from "./intlStrings.mjs";
4
+ import "./vars.e5a6cd16.css";
5
+ import $iOsT7$card_vars_cssmodulejs from "./card_vars_css.mjs";
6
+ import {useStyleProps as $iOsT7$useStyleProps, useDOMRef as $iOsT7$useDOMRef, classNames as $iOsT7$classNames, useUnwrapDOMRef as $iOsT7$useUnwrapDOMRef} from "@react-spectrum/utils";
7
+ import {GridCollection as $iOsT7$GridCollection, useGridState as $iOsT7$useGridState} from "@react-stately/grid";
8
+ import {mergeProps as $iOsT7$mergeProps} from "@react-aria/utils";
9
+ import {ProgressCircle as $iOsT7$ProgressCircle} from "@react-spectrum/progress";
10
+ import $iOsT7$react, {useMemo as $iOsT7$useMemo, useCallback as $iOsT7$useCallback, useRef as $iOsT7$useRef} from "react";
11
+ import {useCollator as $iOsT7$useCollator, useLocalizedStringFormatter as $iOsT7$useLocalizedStringFormatter, useLocale as $iOsT7$useLocale} from "@react-aria/i18n";
12
+ import {useGrid as $iOsT7$useGrid, useGridRow as $iOsT7$useGridRow, useGridCell as $iOsT7$useGridCell} from "@react-aria/grid";
13
+ import {useListState as $iOsT7$useListState} from "@react-stately/list";
14
+ import {useProvider as $iOsT7$useProvider} from "@react-spectrum/provider";
15
+ import {VirtualizerItem as $iOsT7$VirtualizerItem, Virtualizer as $iOsT7$Virtualizer} from "@react-aria/virtualizer";
16
+
17
+
18
+ function $parcel$interopDefault(a) {
19
+ return a && a.__esModule ? a.default : a;
20
+ }
21
+ /*
22
+ * Copyright 2021 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ function $81a52da995c19652$var$CardView(props, ref) {
46
+ let { scale: scale } = (0, $iOsT7$useProvider)();
47
+ let { styleProps: styleProps } = (0, $iOsT7$useStyleProps)(props);
48
+ let domRef = (0, $iOsT7$useDOMRef)(ref);
49
+ let { isQuiet: isQuiet, renderEmptyState: renderEmptyState, layout: layout, loadingState: loadingState, onLoadMore: onLoadMore, cardOrientation: cardOrientation = "vertical" } = props;
50
+ let collator = (0, $iOsT7$useCollator)({
51
+ usage: "search",
52
+ sensitivity: "base"
53
+ });
54
+ let isLoading = loadingState === "loading" || loadingState === "loadingMore";
55
+ let cardViewLayout = (0, $iOsT7$useMemo)(()=>typeof layout === "function" ? new layout({
56
+ collator: collator,
57
+ cardOrientation: cardOrientation,
58
+ scale: scale
59
+ }) : layout, [
60
+ layout,
61
+ collator,
62
+ cardOrientation,
63
+ scale
64
+ ]);
65
+ let layoutType = cardViewLayout.layoutType;
66
+ let stringFormatter = (0, $iOsT7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iOsT7$intlStringsmodulejs))), "@react-spectrum/card");
67
+ let { direction: direction } = (0, $iOsT7$useLocale)();
68
+ let { collection: collection } = (0, $iOsT7$useListState)(props);
69
+ let gridCollection = (0, $iOsT7$useMemo)(()=>new (0, $iOsT7$GridCollection)({
70
+ columnCount: 1,
71
+ items: [
72
+ ...collection
73
+ ].map((item)=>({
74
+ // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys
75
+ ...item,
76
+ hasChildNodes: true,
77
+ childNodes: [
78
+ {
79
+ key: `cell-${item.key}`,
80
+ type: "cell",
81
+ value: null,
82
+ level: 0,
83
+ rendered: null,
84
+ textValue: item.textValue,
85
+ hasChildNodes: false,
86
+ childNodes: []
87
+ }
88
+ ]
89
+ }))
90
+ }), [
91
+ collection
92
+ ]);
93
+ let state = (0, $iOsT7$useGridState)({
94
+ ...props,
95
+ selectionMode: cardOrientation === "horizontal" && layoutType === "grid" ? "none" : props.selectionMode,
96
+ collection: gridCollection,
97
+ focusMode: "cell"
98
+ });
99
+ cardViewLayout.collection = gridCollection;
100
+ cardViewLayout.disabledKeys = state.disabledKeys;
101
+ cardViewLayout.isLoading = isLoading;
102
+ cardViewLayout.direction = direction;
103
+ let { gridProps: gridProps } = (0, $iOsT7$useGrid)({
104
+ ...props,
105
+ isVirtualized: true,
106
+ keyboardDelegate: cardViewLayout
107
+ }, state, domRef);
108
+ let renderWrapper = (parent, reusableView)=>/*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$VirtualizerItem), {
109
+ key: reusableView.key,
110
+ layoutInfo: reusableView.layoutInfo,
111
+ virtualizer: reusableView.virtualizer,
112
+ parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
113
+ }, reusableView.rendered);
114
+ let focusedKey = state.selectionManager.focusedKey;
115
+ let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
116
+ if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
117
+ let margin = cardViewLayout.margin || 0;
118
+ let virtualizer = cardViewLayout.virtualizer;
119
+ let scrollToItem = (0, $iOsT7$useCallback)((key)=>{
120
+ virtualizer && virtualizer.scrollToItem(key, {
121
+ duration: 0,
122
+ offsetY: margin
123
+ });
124
+ }, [
125
+ margin,
126
+ virtualizer
127
+ ]);
128
+ // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
129
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $8d180a244893de14$export$64992ac69f286e5c).Provider, {
130
+ value: {
131
+ state: state,
132
+ isQuiet: isQuiet,
133
+ layout: cardViewLayout,
134
+ cardOrientation: cardOrientation
135
+ }
136
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$Virtualizer), {
137
+ ...gridProps,
138
+ ...styleProps,
139
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView"),
140
+ ref: domRef,
141
+ focusedKey: focusedKey,
142
+ scrollDirection: "vertical",
143
+ layout: cardViewLayout,
144
+ collection: gridCollection,
145
+ isLoading: isLoading,
146
+ onLoadMore: onLoadMore,
147
+ renderWrapper: renderWrapper,
148
+ transitionDuration: isLoading ? 160 : 220,
149
+ scrollToItem: scrollToItem
150
+ }, (type, item)=>{
151
+ if (type === "item") return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$InternalCard, {
152
+ item: item
153
+ });
154
+ else if (type === "loader") return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$CenteredWrapper, null, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$ProgressCircle), {
155
+ isIndeterminate: true,
156
+ "aria-label": state.collection.size > 0 ? stringFormatter.format("loadingMore") : stringFormatter.format("loading")
157
+ }));
158
+ else if (type === "placeholder") {
159
+ let emptyState = renderEmptyState ? renderEmptyState() : null;
160
+ if (emptyState == null) return null;
161
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$CenteredWrapper, null, emptyState);
162
+ }
163
+ }));
164
+ }
165
+ function $81a52da995c19652$var$CenteredWrapper({ children: children }) {
166
+ let { state: state } = (0, $8d180a244893de14$export$fea0b38586ec8f13)();
167
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
168
+ role: "row",
169
+ "aria-rowindex": state.collection.size + 1,
170
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView-centeredWrapper")
171
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
172
+ role: "gridcell"
173
+ }, children));
174
+ }
175
+ function $81a52da995c19652$var$InternalCard(props) {
176
+ let { item: item } = props;
177
+ let cellNode = [
178
+ ...item.childNodes
179
+ ][0];
180
+ let { state: state, cardOrientation: cardOrientation, isQuiet: isQuiet, layout: layout } = (0, $8d180a244893de14$export$fea0b38586ec8f13)();
181
+ let layoutType = layout.layoutType;
182
+ let rowRef = (0, $iOsT7$useRef)();
183
+ let cellRef = (0, $iOsT7$useRef)();
184
+ let unwrappedRef = (0, $iOsT7$useUnwrapDOMRef)(cellRef);
185
+ let { rowProps: gridRowProps } = (0, $iOsT7$useGridRow)({
186
+ node: item,
187
+ isVirtualized: true
188
+ }, state, rowRef);
189
+ let { gridCellProps: gridCellProps } = (0, $iOsT7$useGridCell)({
190
+ node: cellNode,
191
+ focusMode: "cell"
192
+ }, state, unwrappedRef);
193
+ // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode="none" CardView.
194
+ let allowsInteraction = state.selectionManager.selectionMode !== "none";
195
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
196
+ let onKeyDown = (e)=>{
197
+ if (e.key === " " && isDisabled) e.preventDefault();
198
+ };
199
+ let rowProps = (0, $iOsT7$mergeProps)(gridRowProps, {
200
+ onKeyDown: onKeyDown
201
+ });
202
+ if (layoutType === "grid" || layoutType === "gallery") isQuiet = true;
203
+ if (layoutType !== "grid") cardOrientation = "vertical";
204
+ // We don't want to focus the checkbox (or any other focusable elements) within the Card
205
+ // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between
206
+ // the cards in the CardView is handled by useGrid => useSelectableCollection instead.
207
+ delete gridCellProps.onKeyDownCapture;
208
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
209
+ ...rowProps,
210
+ ref: rowRef,
211
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView-row")
212
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $643dd8fa80926f94$export$7a6ccaf429ad93a8), {
213
+ ref: cellRef,
214
+ articleProps: gridCellProps,
215
+ isQuiet: isQuiet,
216
+ orientation: cardOrientation,
217
+ item: item,
218
+ layout: layoutType
219
+ }, item.rendered));
220
+ }
221
+ /**
222
+ * TODO: Add description of component here.
223
+ */ const $81a52da995c19652$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $iOsT7$react).forwardRef($81a52da995c19652$var$CardView);
224
+
225
+
226
+ export {$81a52da995c19652$export$7e52c821f7b6f422 as CardView};
227
+ //# sourceMappingURL=CardView.mjs.map
@@ -0,0 +1,227 @@
1
+ import {CardBase as $643dd8fa80926f94$export$7a6ccaf429ad93a8} from "./CardBase.module.js";
2
+ import {CardViewContext as $8d180a244893de14$export$64992ac69f286e5c, useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.module.js";
3
+ import $iOsT7$intlStringsmodulejs from "./intlStrings.module.js";
4
+ import "./vars.e5a6cd16.css";
5
+ import $iOsT7$card_vars_cssmodulejs from "./card_vars_css.module.js";
6
+ import {useStyleProps as $iOsT7$useStyleProps, useDOMRef as $iOsT7$useDOMRef, classNames as $iOsT7$classNames, useUnwrapDOMRef as $iOsT7$useUnwrapDOMRef} from "@react-spectrum/utils";
7
+ import {GridCollection as $iOsT7$GridCollection, useGridState as $iOsT7$useGridState} from "@react-stately/grid";
8
+ import {mergeProps as $iOsT7$mergeProps} from "@react-aria/utils";
9
+ import {ProgressCircle as $iOsT7$ProgressCircle} from "@react-spectrum/progress";
10
+ import $iOsT7$react, {useMemo as $iOsT7$useMemo, useCallback as $iOsT7$useCallback, useRef as $iOsT7$useRef} from "react";
11
+ import {useCollator as $iOsT7$useCollator, useLocalizedStringFormatter as $iOsT7$useLocalizedStringFormatter, useLocale as $iOsT7$useLocale} from "@react-aria/i18n";
12
+ import {useGrid as $iOsT7$useGrid, useGridRow as $iOsT7$useGridRow, useGridCell as $iOsT7$useGridCell} from "@react-aria/grid";
13
+ import {useListState as $iOsT7$useListState} from "@react-stately/list";
14
+ import {useProvider as $iOsT7$useProvider} from "@react-spectrum/provider";
15
+ import {VirtualizerItem as $iOsT7$VirtualizerItem, Virtualizer as $iOsT7$Virtualizer} from "@react-aria/virtualizer";
16
+
17
+
18
+ function $parcel$interopDefault(a) {
19
+ return a && a.__esModule ? a.default : a;
20
+ }
21
+ /*
22
+ * Copyright 2021 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ function $81a52da995c19652$var$CardView(props, ref) {
46
+ let { scale: scale } = (0, $iOsT7$useProvider)();
47
+ let { styleProps: styleProps } = (0, $iOsT7$useStyleProps)(props);
48
+ let domRef = (0, $iOsT7$useDOMRef)(ref);
49
+ let { isQuiet: isQuiet, renderEmptyState: renderEmptyState, layout: layout, loadingState: loadingState, onLoadMore: onLoadMore, cardOrientation: cardOrientation = "vertical" } = props;
50
+ let collator = (0, $iOsT7$useCollator)({
51
+ usage: "search",
52
+ sensitivity: "base"
53
+ });
54
+ let isLoading = loadingState === "loading" || loadingState === "loadingMore";
55
+ let cardViewLayout = (0, $iOsT7$useMemo)(()=>typeof layout === "function" ? new layout({
56
+ collator: collator,
57
+ cardOrientation: cardOrientation,
58
+ scale: scale
59
+ }) : layout, [
60
+ layout,
61
+ collator,
62
+ cardOrientation,
63
+ scale
64
+ ]);
65
+ let layoutType = cardViewLayout.layoutType;
66
+ let stringFormatter = (0, $iOsT7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iOsT7$intlStringsmodulejs))), "@react-spectrum/card");
67
+ let { direction: direction } = (0, $iOsT7$useLocale)();
68
+ let { collection: collection } = (0, $iOsT7$useListState)(props);
69
+ let gridCollection = (0, $iOsT7$useMemo)(()=>new (0, $iOsT7$GridCollection)({
70
+ columnCount: 1,
71
+ items: [
72
+ ...collection
73
+ ].map((item)=>({
74
+ // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys
75
+ ...item,
76
+ hasChildNodes: true,
77
+ childNodes: [
78
+ {
79
+ key: `cell-${item.key}`,
80
+ type: "cell",
81
+ value: null,
82
+ level: 0,
83
+ rendered: null,
84
+ textValue: item.textValue,
85
+ hasChildNodes: false,
86
+ childNodes: []
87
+ }
88
+ ]
89
+ }))
90
+ }), [
91
+ collection
92
+ ]);
93
+ let state = (0, $iOsT7$useGridState)({
94
+ ...props,
95
+ selectionMode: cardOrientation === "horizontal" && layoutType === "grid" ? "none" : props.selectionMode,
96
+ collection: gridCollection,
97
+ focusMode: "cell"
98
+ });
99
+ cardViewLayout.collection = gridCollection;
100
+ cardViewLayout.disabledKeys = state.disabledKeys;
101
+ cardViewLayout.isLoading = isLoading;
102
+ cardViewLayout.direction = direction;
103
+ let { gridProps: gridProps } = (0, $iOsT7$useGrid)({
104
+ ...props,
105
+ isVirtualized: true,
106
+ keyboardDelegate: cardViewLayout
107
+ }, state, domRef);
108
+ let renderWrapper = (parent, reusableView)=>/*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$VirtualizerItem), {
109
+ key: reusableView.key,
110
+ layoutInfo: reusableView.layoutInfo,
111
+ virtualizer: reusableView.virtualizer,
112
+ parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
113
+ }, reusableView.rendered);
114
+ let focusedKey = state.selectionManager.focusedKey;
115
+ let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
116
+ if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
117
+ let margin = cardViewLayout.margin || 0;
118
+ let virtualizer = cardViewLayout.virtualizer;
119
+ let scrollToItem = (0, $iOsT7$useCallback)((key)=>{
120
+ virtualizer && virtualizer.scrollToItem(key, {
121
+ duration: 0,
122
+ offsetY: margin
123
+ });
124
+ }, [
125
+ margin,
126
+ virtualizer
127
+ ]);
128
+ // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
129
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $8d180a244893de14$export$64992ac69f286e5c).Provider, {
130
+ value: {
131
+ state: state,
132
+ isQuiet: isQuiet,
133
+ layout: cardViewLayout,
134
+ cardOrientation: cardOrientation
135
+ }
136
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$Virtualizer), {
137
+ ...gridProps,
138
+ ...styleProps,
139
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView"),
140
+ ref: domRef,
141
+ focusedKey: focusedKey,
142
+ scrollDirection: "vertical",
143
+ layout: cardViewLayout,
144
+ collection: gridCollection,
145
+ isLoading: isLoading,
146
+ onLoadMore: onLoadMore,
147
+ renderWrapper: renderWrapper,
148
+ transitionDuration: isLoading ? 160 : 220,
149
+ scrollToItem: scrollToItem
150
+ }, (type, item)=>{
151
+ if (type === "item") return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$InternalCard, {
152
+ item: item
153
+ });
154
+ else if (type === "loader") return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$CenteredWrapper, null, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $iOsT7$ProgressCircle), {
155
+ isIndeterminate: true,
156
+ "aria-label": state.collection.size > 0 ? stringFormatter.format("loadingMore") : stringFormatter.format("loading")
157
+ }));
158
+ else if (type === "placeholder") {
159
+ let emptyState = renderEmptyState ? renderEmptyState() : null;
160
+ if (emptyState == null) return null;
161
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement($81a52da995c19652$var$CenteredWrapper, null, emptyState);
162
+ }
163
+ }));
164
+ }
165
+ function $81a52da995c19652$var$CenteredWrapper({ children: children }) {
166
+ let { state: state } = (0, $8d180a244893de14$export$fea0b38586ec8f13)();
167
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
168
+ role: "row",
169
+ "aria-rowindex": state.collection.size + 1,
170
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView-centeredWrapper")
171
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
172
+ role: "gridcell"
173
+ }, children));
174
+ }
175
+ function $81a52da995c19652$var$InternalCard(props) {
176
+ let { item: item } = props;
177
+ let cellNode = [
178
+ ...item.childNodes
179
+ ][0];
180
+ let { state: state, cardOrientation: cardOrientation, isQuiet: isQuiet, layout: layout } = (0, $8d180a244893de14$export$fea0b38586ec8f13)();
181
+ let layoutType = layout.layoutType;
182
+ let rowRef = (0, $iOsT7$useRef)();
183
+ let cellRef = (0, $iOsT7$useRef)();
184
+ let unwrappedRef = (0, $iOsT7$useUnwrapDOMRef)(cellRef);
185
+ let { rowProps: gridRowProps } = (0, $iOsT7$useGridRow)({
186
+ node: item,
187
+ isVirtualized: true
188
+ }, state, rowRef);
189
+ let { gridCellProps: gridCellProps } = (0, $iOsT7$useGridCell)({
190
+ node: cellNode,
191
+ focusMode: "cell"
192
+ }, state, unwrappedRef);
193
+ // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode="none" CardView.
194
+ let allowsInteraction = state.selectionManager.selectionMode !== "none";
195
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
196
+ let onKeyDown = (e)=>{
197
+ if (e.key === " " && isDisabled) e.preventDefault();
198
+ };
199
+ let rowProps = (0, $iOsT7$mergeProps)(gridRowProps, {
200
+ onKeyDown: onKeyDown
201
+ });
202
+ if (layoutType === "grid" || layoutType === "gallery") isQuiet = true;
203
+ if (layoutType !== "grid") cardOrientation = "vertical";
204
+ // We don't want to focus the checkbox (or any other focusable elements) within the Card
205
+ // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between
206
+ // the cards in the CardView is handled by useGrid => useSelectableCollection instead.
207
+ delete gridCellProps.onKeyDownCapture;
208
+ return /*#__PURE__*/ (0, $iOsT7$react).createElement("div", {
209
+ ...rowProps,
210
+ ref: rowRef,
211
+ className: (0, $iOsT7$classNames)((0, ($parcel$interopDefault($iOsT7$card_vars_cssmodulejs))), "spectrum-CardView-row")
212
+ }, /*#__PURE__*/ (0, $iOsT7$react).createElement((0, $643dd8fa80926f94$export$7a6ccaf429ad93a8), {
213
+ ref: cellRef,
214
+ articleProps: gridCellProps,
215
+ isQuiet: isQuiet,
216
+ orientation: cardOrientation,
217
+ item: item,
218
+ layout: layoutType
219
+ }, item.rendered));
220
+ }
221
+ /**
222
+ * TODO: Add description of component here.
223
+ */ const $81a52da995c19652$export$7e52c821f7b6f422 = /*#__PURE__*/ (0, $iOsT7$react).forwardRef($81a52da995c19652$var$CardView);
224
+
225
+
226
+ export {$81a52da995c19652$export$7e52c821f7b6f422 as CardView};
227
+ //# sourceMappingURL=CardView.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD,SAAS,+BAA2B,KAA+B,EAAE,GAA2B;IAC9F,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,WACF,OAAO,oBACP,gBAAgB,UAChB,MAAM,gBACN,YAAY,cACZ,UAAU,mBACV,kBAAkB,YACnB,GAAG;IAEJ,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,YAAY,iBAAiB,aAAa,iBAAiB;IAC/D,IAAI,iBAAiB,CAAA,GAAA,cAAM,EAAE,IAAM,OAAO,WAAW,aAAa,IAAI,OAAO;sBAAC;6BAAU;mBAAiB;QAAK,KAAK,QAAQ;QAAC;QAAQ;QAAU;QAAiB;KAAM;IACrK,IAAI,aAAa,eAAe,UAAU;IAE1C,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI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A,GAAA,yCAAO;QACN,KAAK;QACL,cAAc;QACd,SAAS;QACT,aAAa;QACb,MAAM;QACN,QAAQ;OACP,KAAK,QAAQ;AAItB;AAEA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/card/src/CardView.tsx"],"sourcesContent":["/*\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 */\n\nimport {CardBase} from './CardBase';\nimport {CardViewContext, useCardViewContext} from './CardViewContext';\nimport {classNames, useDOMRef, useStyleProps, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {DOMRef, DOMRefValue, Node} from '@react-types/shared';\nimport {GridCollection, useGridState} from '@react-stately/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ReactElement, ReactNode, useCallback, useMemo, useRef} from 'react';\nimport {ReusableView} from '@react-stately/virtualizer';\nimport {SpectrumCardViewProps} from '@react-types/card';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useGrid, useGridCell, useGridRow} from '@react-aria/grid';\nimport {useListState} from '@react-stately/list';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer, VirtualizerItem} from '@react-aria/virtualizer';\n\nfunction CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let {\n isQuiet,\n renderEmptyState,\n layout,\n loadingState,\n onLoadMore,\n cardOrientation = 'vertical'\n } = props;\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let cardViewLayout = useMemo(() => typeof layout === 'function' ? new layout({collator, cardOrientation, scale}) : layout, [layout, collator, cardOrientation, scale]);\n let layoutType = cardViewLayout.layoutType;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/card');\n let {direction} = useLocale();\n let {collection} = useListState(props);\n\n let gridCollection = useMemo(() => new GridCollection<T>({\n columnCount: 1,\n items: [...collection].map(item => ({\n // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys\n ...item,\n hasChildNodes: true,\n childNodes: [{\n key: `cell-${item.key}`,\n type: 'cell',\n value: null,\n level: 0,\n rendered: null,\n textValue: item.textValue,\n hasChildNodes: false,\n childNodes: []\n }]\n }))\n }), [collection]);\n\n let state = useGridState({\n ...props,\n selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,\n collection: gridCollection,\n focusMode: 'cell'\n });\n\n cardViewLayout.collection = gridCollection;\n cardViewLayout.disabledKeys = state.disabledKeys;\n cardViewLayout.isLoading = isLoading;\n cardViewLayout.direction = direction;\n\n let {gridProps} = useGrid({\n ...props,\n isVirtualized: true,\n keyboardDelegate: cardViewLayout\n }, state, domRef);\n\n type View = ReusableView<Node<T>, ReactNode>;\n let renderWrapper = (parent: View, reusableView: View) => (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\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 let margin = cardViewLayout.margin || 0;\n let virtualizer = cardViewLayout.virtualizer;\n let scrollToItem = useCallback((key) => {\n virtualizer && virtualizer.scrollToItem(key, {\n duration: 0,\n offsetY: margin\n });\n }, [margin, virtualizer]);\n\n // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted\n return (\n <CardViewContext.Provider value={{state, isQuiet, layout: cardViewLayout, cardOrientation}}>\n <Virtualizer\n {...gridProps}\n {...styleProps}\n className={classNames(styles, 'spectrum-CardView')}\n ref={domRef}\n focusedKey={focusedKey}\n scrollDirection=\"vertical\"\n layout={cardViewLayout}\n collection={gridCollection}\n isLoading={isLoading}\n onLoadMore={onLoadMore}\n renderWrapper={renderWrapper}\n transitionDuration={isLoading ? 160 : 220}\n scrollToItem={scrollToItem}>\n {(type, item) => {\n if (type === 'item') {\n return (\n <InternalCard item={item} />\n );\n } else if (type === 'loader') {\n return (\n <CenteredWrapper>\n <ProgressCircle\n isIndeterminate\n aria-label={state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')} />\n </CenteredWrapper>\n );\n } else if (type === 'placeholder') {\n let emptyState = renderEmptyState ? renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <CenteredWrapper>\n {emptyState}\n </CenteredWrapper>\n );\n }\n }}\n </Virtualizer>\n </CardViewContext.Provider>\n\n );\n}\n\nfunction CenteredWrapper({children}) {\n let {state} = useCardViewContext();\n return (\n <div\n role=\"row\"\n aria-rowindex={state.collection.size + 1}\n className={classNames(styles, 'spectrum-CardView-centeredWrapper')}>\n <div role=\"gridcell\">\n {children}\n </div>\n </div>\n );\n}\n\nfunction InternalCard(props) {\n let {\n item\n } = props;\n let cellNode = [...item.childNodes][0];\n let {state, cardOrientation, isQuiet, layout} = useCardViewContext();\n\n let layoutType = layout.layoutType;\n let rowRef = useRef();\n let cellRef = useRef<DOMRefValue<HTMLDivElement>>();\n let unwrappedRef = useUnwrapDOMRef(cellRef);\n\n let {rowProps: gridRowProps} = useGridRow({\n node: item,\n isVirtualized: true\n }, state, rowRef);\n\n let {gridCellProps} = useGridCell({\n node: cellNode,\n focusMode: 'cell'\n }, state, unwrappedRef);\n\n // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode=\"none\" CardView.\n let allowsInteraction = state.selectionManager.selectionMode !== 'none';\n let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);\n\n let onKeyDown = (e) => {\n if (e.key === ' ' && isDisabled) {\n e.preventDefault();\n }\n };\n\n let rowProps = mergeProps(\n gridRowProps,\n {onKeyDown}\n );\n\n if (layoutType === 'grid' || layoutType === 'gallery') {\n isQuiet = true;\n }\n\n if (layoutType !== 'grid') {\n cardOrientation = 'vertical';\n }\n\n // We don't want to focus the checkbox (or any other focusable elements) within the Card\n // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between\n // the cards in the CardView is handled by useGrid => useSelectableCollection instead.\n delete gridCellProps.onKeyDownCapture;\n return (\n <div {...rowProps} ref={rowRef} className={classNames(styles, 'spectrum-CardView-row')}>\n <CardBase\n ref={cellRef}\n articleProps={gridCellProps}\n isQuiet={isQuiet}\n orientation={cardOrientation}\n item={item}\n layout={layoutType}>\n {item.rendered}\n </CardBase>\n </div>\n );\n}\n\n/**\n * TODO: Add description of component here.\n */\nconst _CardView = React.forwardRef(CardView) as <T>(props: SpectrumCardViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_CardView as CardView};\n"],"names":[],"version":3,"file":"CardView.module.js.map"}
@@ -0,0 +1,31 @@
1
+ var $g0nMI$react = require("react");
2
+
3
+
4
+ function $parcel$interopDefault(a) {
5
+ return a && a.__esModule ? a.default : a;
6
+ }
7
+
8
+ function $parcel$export(e, n, v, s) {
9
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
+ }
11
+
12
+ $parcel$export(module.exports, "CardViewContext", () => $e57ab98cef2f01a5$export$64992ac69f286e5c);
13
+ $parcel$export(module.exports, "useCardViewContext", () => $e57ab98cef2f01a5$export$fea0b38586ec8f13);
14
+ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */
25
+ const $e57ab98cef2f01a5$export$64992ac69f286e5c = /*#__PURE__*/ (0, ($parcel$interopDefault($g0nMI$react))).createContext(null);
26
+ function $e57ab98cef2f01a5$export$fea0b38586ec8f13() {
27
+ return (0, $g0nMI$react.useContext)($e57ab98cef2f01a5$export$64992ac69f286e5c);
28
+ }
29
+
30
+
31
+ //# sourceMappingURL=CardViewContext.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,MAAM,0DAAkB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAC;AAE5C,SAAS;IACd,OAAO,CAAA,GAAA,uBAAS,EAAE;AACpB","sources":["packages/@react-spectrum/card/src/CardViewContext.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport React, {useContext} from 'react';\n\nexport const CardViewContext = React.createContext(null);\n\nexport function useCardViewContext() {\n return useContext(CardViewContext);\n}\n"],"names":[],"version":3,"file":"CardViewContext.main.js.map"}
@@ -0,0 +1,21 @@
1
+ import $ip66o$react, {useContext as $ip66o$useContext} from "react";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ const $8d180a244893de14$export$64992ac69f286e5c = /*#__PURE__*/ (0, $ip66o$react).createContext(null);
15
+ function $8d180a244893de14$export$fea0b38586ec8f13() {
16
+ return (0, $ip66o$useContext)($8d180a244893de14$export$64992ac69f286e5c);
17
+ }
18
+
19
+
20
+ export {$8d180a244893de14$export$64992ac69f286e5c as CardViewContext, $8d180a244893de14$export$fea0b38586ec8f13 as useCardViewContext};
21
+ //# sourceMappingURL=CardViewContext.mjs.map
@@ -0,0 +1,21 @@
1
+ import $ip66o$react, {useContext as $ip66o$useContext} from "react";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ const $8d180a244893de14$export$64992ac69f286e5c = /*#__PURE__*/ (0, $ip66o$react).createContext(null);
15
+ function $8d180a244893de14$export$fea0b38586ec8f13() {
16
+ return (0, $ip66o$useContext)($8d180a244893de14$export$64992ac69f286e5c);
17
+ }
18
+
19
+
20
+ export {$8d180a244893de14$export$64992ac69f286e5c as CardViewContext, $8d180a244893de14$export$fea0b38586ec8f13 as useCardViewContext};
21
+ //# sourceMappingURL=CardViewContext.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,MAAM,0DAAkB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAC;AAE5C,SAAS;IACd,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB","sources":["packages/@react-spectrum/card/src/CardViewContext.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport React, {useContext} from 'react';\n\nexport const CardViewContext = React.createContext(null);\n\nexport function useCardViewContext() {\n return useContext(CardViewContext);\n}\n"],"names":[],"version":3,"file":"CardViewContext.module.js.map"}