@react-spectrum/card 3.0.0-alpha.45 → 3.0.0-alpha.47

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,4 +1,4 @@
1
- require("./card.370c5606.css");
1
+ require("./card.4d5d6544.css");
2
2
  var $71570f0038472fa2$exports = require("./card_vars_css.main.js");
3
3
  var $e57ab98cef2f01a5$exports = require("./CardViewContext.main.js");
4
4
  var $1rjnI$reactspectrumcheckbox = require("@react-spectrum/checkbox");
@@ -44,7 +44,9 @@ const $7888205ff7de382f$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, ($parcel$int
44
44
  let context = (0, $e57ab98cef2f01a5$exports.useCardViewContext)() || {}; // we can call again here, won't change from Card.tsx
45
45
  let { state: state } = context;
46
46
  let manager = state === null || state === void 0 ? void 0 : state.selectionManager;
47
- let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {}, item: item, layout: layout, children: children } = props;
47
+ let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {
48
+ role: 'article'
49
+ }, item: item, layout: layout, children: children } = props;
48
50
  let key = item === null || item === void 0 ? void 0 : item.key;
49
51
  let isSelected = manager === null || manager === void 0 ? void 0 : manager.isSelected(key);
50
52
  let isDisabled = state === null || state === void 0 ? void 0 : state.disabledKeys.has(key);
@@ -137,7 +139,7 @@ const $7888205ff7de382f$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, ($parcel$int
137
139
  ]);
138
140
  return /*#__PURE__*/ (0, ($parcel$interopDefault($1rjnI$react))).createElement((0, $1rjnI$reactariafocus.FocusRing), {
139
141
  focusRingClass: (0, $1rjnI$reactspectrumutils.classNames)((0, ($parcel$interopDefault($71570f0038472fa2$exports))), 'focus-ring')
140
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($1rjnI$react))).createElement("article", {
142
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1rjnI$react))).createElement("div", {
141
143
  ...styleProps,
142
144
  ...(0, $1rjnI$reactariautils.mergeProps)(cardProps, focusWithinProps, hoverProps, (0, $1rjnI$reactariautils.filterDOMProps)(props), articleProps),
143
145
  ref: domRef,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd;;;;;;;;;;CAUC;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAAuB,EAAE,GAA2B;IAC/H,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,UAAU,CAAA,GAAA,4CAAiB,OAAO,CAAC,GAAG,qDAAqD;IAC/F,IAAI,SAAC,KAAK,EAAC,GAAG;IACd,IAAI,UAAU,kBAAA,4BAAA,MAAO,gBAAgB;IACrC,IAAI,WACF,OAAO,eACP,cAAc,0BACd,eAAe,CAAC,SAChB,IAAI,UACJ,MAAM,YACN,QAAQ,EACT,GAAG;IAEJ,IAAI,MAAM,iBAAA,2BAAA,KAAM,GAAG;IACnB,IAAI,aAAa,oBAAA,8BAAA,QAAS,UAAU,CAAC;IACrC,IAAI,aAAa,kBAAA,4BAAA,MAAO,YAAY,CAAC,GAAG,CAAC;IACzC,IAAI,WAAW,IAAM,oBAAA,8BAAA,QAAS,MAAM,CAAC;IAErC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,YAAY,EAAC,GAAG,8BAAQ;IACpD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,mBAAK,EAAkB;IACrC,IAAI,cAAc,CAAA,GAAA,mBAAK,EAAE;IAEzB,qFAAqF;IACrF,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAAC,YAAY,YAAY,aAAa,CAAA,oBAAA,8BAAA,QAAS,aAAa,MAAK,UAAU;IAA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,4BAA4B,CAAC;YAC7B,cAAc;YACd,cAAc;YACd,eAAe;YACf,4BAA4B,WAAW;YACvC,0BAA0B,WAAW;YACrC,uBAAuB,WAAW;YAClC,2BAA2B,WAAW,eAAe,WAAW,aAAa,WAAW;QAC1F,GAAG,WAAW,SAAS;qBACvB,0DAAC;QAAI,KAAK;QAAS,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAC9C,WAAW,QAAQ,aAAa,KAAK,wBACpC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC,CAAA,GAAA,qCAAO;QACN,KAAK;QACL,YAAY;QACZ,qBAAA;QACA,YAAY;QACZ,UAAU;QACV,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,cAAA;QACA,cAAW;uBAGjB,0DAAC,CAAA,GAAA,sCAAW;QAAE,OAAO;OAClB,yBAEH,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAK7C;AAWA,SAAS,8BAAQ,KAAsB;IACrC,IAAI,UAAU,CAAA,GAAA,+BAAQ;IACtB,IAAI,gBAAgB,CAAA,GAAA,+BAAQ;IAC5B,IAAI,aAAa,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;YAC9B,IAAI;QACN,CAAA,GAAI;QAAC;KAAQ;IACb,IAAI,eAAe,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;YAChC,IAAI;QACN,CAAA,GAAI;QAAC;KAAc;IAEnB,OAAO;QACL,WAAW;YACT,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;YACxB,mBAAmB;YACnB,oBAAoB;YACpB,UAAU;QACZ;oBACA;sBACA;IACF;AACF","sources":["packages/@react-spectrum/card/src/CardBase.tsx"],"sourcesContent":["// @ts-nocheck\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 */\n\nimport {AriaCardProps, SpectrumCardProps} from '@react-types/card';\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport {classNames, SlotProvider, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useLayoutEffect, useResizeObserver, useSlotId} from '@react-aria/utils';\nimport {FocusRing, getFocusableTreeWalker} from '@react-aria/focus';\nimport React, {HTMLAttributes, useCallback, useMemo, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCardViewContext} from './CardViewContext';\nimport {useFocusWithin, useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\n\ninterface CardBaseProps<T> extends SpectrumCardProps {\n articleProps?: HTMLAttributes<HTMLElement>,\n item?: Node<T>\n}\n\n/**\n * TODO: Add description of component here.\n */\nexport const CardBase = React.forwardRef(function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let context = useCardViewContext() || {}; // we can call again here, won't change from Card.tsx\n let {state} = context;\n let manager = state?.selectionManager;\n let {\n isQuiet,\n orientation = 'vertical',\n articleProps = {},\n item,\n layout,\n children\n } = props;\n\n let key = item?.key;\n let isSelected = manager?.isSelected(key);\n let isDisabled = state?.disabledKeys.has(key);\n let onChange = () => manager?.select(key);\n\n let {styleProps} = useStyleProps(props);\n let {cardProps, titleProps, contentProps} = useCard(props);\n let domRef = useDOMRef(ref);\n let gridRef = useRef<HTMLDivElement>(undefined);\n let checkboxRef = useRef(null);\n\n // cards are only interactive if there is a selection manager and it allows selection\n let {hoverProps, isHovered} = useHover({isDisabled: manager === undefined || manager?.selectionMode === 'none' || isDisabled});\n let [isFocused, setIsFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setIsFocused,\n isDisabled\n });\n\n // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default\n let hasPreviewImage = useHasChild(`.${styles['spectrum-Card-image']}`, gridRef);\n let hasPreviewIllustration = useHasChild(`.${styles['spectrum-Card-illustration']}`, gridRef);\n let hasPreview = hasPreviewImage || hasPreviewIllustration;\n\n // this is for horizontal cards\n let [height, setHeight] = useState(NaN);\n let updateHeight = useCallback(() => {\n if (orientation !== 'horizontal') {\n return;\n }\n\n let cardHeight = gridRef.current.getBoundingClientRect().height;\n setHeight(cardHeight);\n }, [orientation, gridRef, setHeight]);\n useResizeObserver({ref: gridRef, onResize: updateHeight});\n\n let aspectRatioEnforce = undefined;\n if (orientation === 'horizontal' && !isNaN(height)) {\n aspectRatioEnforce = {\n height: `${height}px`,\n width: `${height}px`\n };\n }\n\n let slots = useMemo(() => ({\n image: {UNSAFE_className: classNames(styles, 'spectrum-Card-image'), objectFit: orientation === 'horizontal' ? 'cover' : 'contain', alt: '', ...aspectRatioEnforce},\n illustration: {UNSAFE_className: classNames(styles, 'spectrum-Card-illustration'), ...aspectRatioEnforce},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Card-avatar'), size: 'avatar-size-400'},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Card-heading'), ...titleProps},\n content: {UNSAFE_className: classNames(styles, 'spectrum-Card-content'), ...contentProps},\n detail: {UNSAFE_className: classNames(styles, 'spectrum-Card-detail')}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [titleProps, contentProps, height, isQuiet, orientation]);\n\n useLayoutEffect(() => {\n if (gridRef?.current) {\n let walker = getFocusableTreeWalker(gridRef.current);\n let nextNode = walker.nextNode();\n while (nextNode != null) {\n if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {\n console.warn('Card does not support focusable elements, please contact the team regarding your use case.');\n break;\n }\n nextNode = walker.nextNode();\n }\n }\n }, [children]);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <article\n {...styleProps}\n {...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}\n ref={domRef}\n className={classNames(styles, 'spectrum-Card', {\n 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--horizontal': orientation === 'horizontal',\n 'spectrum-Card--noPreview': !hasPreview,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'is-selected': isSelected,\n 'spectrum-Card--waterfall': layout === 'waterfall',\n 'spectrum-Card--gallery': layout === 'gallery',\n 'spectrum-Card--grid': layout === 'grid',\n 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'\n }, styleProps.className)}>\n <div ref={gridRef} className={classNames(styles, 'spectrum-Card-grid')}>\n {manager && manager.selectionMode !== 'none' && (\n <div className={classNames(styles, 'spectrum-Card-checkboxWrapper')}>\n <Checkbox\n ref={checkboxRef}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isSelected={isSelected}\n onChange={onChange}\n UNSAFE_className={classNames(styles, 'spectrum-Card-checkbox')}\n isEmphasized\n aria-label=\"select\" />\n </div>\n )}\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Card-decoration')} />\n </div>\n </article>\n </FocusRing>\n );\n});\n\ninterface AriaCardOptions extends AriaCardProps {\n}\n\ninterface CardAria {\n cardProps: HTMLAttributes<HTMLDivElement>,\n titleProps: HTMLAttributes<HTMLDivElement>,\n contentProps: HTMLAttributes<HTMLDivElement>\n}\n\nfunction useCard(props: AriaCardOptions): CardAria {\n let titleId = useSlotId();\n let descriptionId = useSlotId();\n let titleProps = useMemo(() => ({\n id: titleId\n }), [titleId]);\n let contentProps = useMemo(() => ({\n id: descriptionId\n }), [descriptionId]);\n\n return {\n cardProps: {\n ...filterDOMProps(props),\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n tabIndex: 0\n },\n titleProps,\n contentProps\n };\n}\n"],"names":[],"version":3,"file":"CardBase.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd;;;;;;;;;;CAUC;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAAuB,EAAE,GAA2B;IAC/H,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,UAAU,CAAA,GAAA,4CAAiB,OAAO,CAAC,GAAG,qDAAqD;IAC/F,IAAI,SAAC,KAAK,EAAC,GAAG;IACd,IAAI,UAAU,kBAAA,4BAAA,MAAO,gBAAgB;IACrC,IAAI,WACF,OAAO,eACP,cAAc,0BACd,eAAe;QAAC,MAAM;IAAS,SAC/B,IAAI,UACJ,MAAM,YACN,QAAQ,EACT,GAAG;IAEJ,IAAI,MAAM,iBAAA,2BAAA,KAAM,GAAG;IACnB,IAAI,aAAa,oBAAA,8BAAA,QAAS,UAAU,CAAC;IACrC,IAAI,aAAa,kBAAA,4BAAA,MAAO,YAAY,CAAC,GAAG,CAAC;IACzC,IAAI,WAAW,IAAM,oBAAA,8BAAA,QAAS,MAAM,CAAC;IAErC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,YAAY,EAAC,GAAG,8BAAQ;IACpD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,mBAAK,EAAkB;IACrC,IAAI,cAAc,CAAA,GAAA,mBAAK,EAAE;IAEzB,qFAAqF;IACrF,IAAI,cAAC,UAAU,aAAE,SAAS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;IACF;AACF","sources":["packages/@react-spectrum/card/src/CardBase.tsx"],"sourcesContent":["// @ts-nocheck\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 */\n\nimport {AriaCardProps, SpectrumCardProps} from '@react-types/card';\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport {classNames, SlotProvider, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useLayoutEffect, useResizeObserver, useSlotId} from '@react-aria/utils';\nimport {FocusRing, getFocusableTreeWalker} from '@react-aria/focus';\nimport React, {HTMLAttributes, useCallback, useMemo, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCardViewContext} from './CardViewContext';\nimport {useFocusWithin, useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\n\ninterface CardBaseProps<T> extends SpectrumCardProps {\n articleProps?: HTMLAttributes<HTMLElement>,\n item?: Node<T>\n}\n\n/**\n * TODO: Add description of component here.\n */\nexport const CardBase = React.forwardRef(function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let context = useCardViewContext() || {}; // we can call again here, won't change from Card.tsx\n let {state} = context;\n let manager = state?.selectionManager;\n let {\n isQuiet,\n orientation = 'vertical',\n articleProps = {role: 'article'},\n item,\n layout,\n children\n } = props;\n\n let key = item?.key;\n let isSelected = manager?.isSelected(key);\n let isDisabled = state?.disabledKeys.has(key);\n let onChange = () => manager?.select(key);\n\n let {styleProps} = useStyleProps(props);\n let {cardProps, titleProps, contentProps} = useCard(props);\n let domRef = useDOMRef(ref);\n let gridRef = useRef<HTMLDivElement>(undefined);\n let checkboxRef = useRef(null);\n\n // cards are only interactive if there is a selection manager and it allows selection\n let {hoverProps, isHovered} = useHover({isDisabled: manager === undefined || manager?.selectionMode === 'none' || isDisabled});\n let [isFocused, setIsFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setIsFocused,\n isDisabled\n });\n\n // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default\n let hasPreviewImage = useHasChild(`.${styles['spectrum-Card-image']}`, gridRef);\n let hasPreviewIllustration = useHasChild(`.${styles['spectrum-Card-illustration']}`, gridRef);\n let hasPreview = hasPreviewImage || hasPreviewIllustration;\n\n // this is for horizontal cards\n let [height, setHeight] = useState(NaN);\n let updateHeight = useCallback(() => {\n if (orientation !== 'horizontal') {\n return;\n }\n\n let cardHeight = gridRef.current.getBoundingClientRect().height;\n setHeight(cardHeight);\n }, [orientation, gridRef, setHeight]);\n useResizeObserver({ref: gridRef, onResize: updateHeight});\n\n let aspectRatioEnforce = undefined;\n if (orientation === 'horizontal' && !isNaN(height)) {\n aspectRatioEnforce = {\n height: `${height}px`,\n width: `${height}px`\n };\n }\n\n let slots = useMemo(() => ({\n image: {UNSAFE_className: classNames(styles, 'spectrum-Card-image'), objectFit: orientation === 'horizontal' ? 'cover' : 'contain', alt: '', ...aspectRatioEnforce},\n illustration: {UNSAFE_className: classNames(styles, 'spectrum-Card-illustration'), ...aspectRatioEnforce},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Card-avatar'), size: 'avatar-size-400'},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Card-heading'), ...titleProps},\n content: {UNSAFE_className: classNames(styles, 'spectrum-Card-content'), ...contentProps},\n detail: {UNSAFE_className: classNames(styles, 'spectrum-Card-detail')}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [titleProps, contentProps, height, isQuiet, orientation]);\n\n useLayoutEffect(() => {\n if (gridRef?.current) {\n let walker = getFocusableTreeWalker(gridRef.current);\n let nextNode = walker.nextNode();\n while (nextNode != null) {\n if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {\n console.warn('Card does not support focusable elements, please contact the team regarding your use case.');\n break;\n }\n nextNode = walker.nextNode();\n }\n }\n }, [children]);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...styleProps}\n {...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}\n ref={domRef}\n className={classNames(styles, 'spectrum-Card', {\n 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--horizontal': orientation === 'horizontal',\n 'spectrum-Card--noPreview': !hasPreview,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'is-selected': isSelected,\n 'spectrum-Card--waterfall': layout === 'waterfall',\n 'spectrum-Card--gallery': layout === 'gallery',\n 'spectrum-Card--grid': layout === 'grid',\n 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'\n }, styleProps.className)}>\n <div ref={gridRef} className={classNames(styles, 'spectrum-Card-grid')}>\n {manager && manager.selectionMode !== 'none' && (\n <div className={classNames(styles, 'spectrum-Card-checkboxWrapper')}>\n <Checkbox\n ref={checkboxRef}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isSelected={isSelected}\n onChange={onChange}\n UNSAFE_className={classNames(styles, 'spectrum-Card-checkbox')}\n isEmphasized\n aria-label=\"select\" />\n </div>\n )}\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Card-decoration')} />\n </div>\n </div>\n </FocusRing>\n );\n});\n\ninterface AriaCardOptions extends AriaCardProps {\n}\n\ninterface CardAria {\n cardProps: HTMLAttributes<HTMLDivElement>,\n titleProps: HTMLAttributes<HTMLDivElement>,\n contentProps: HTMLAttributes<HTMLDivElement>\n}\n\nfunction useCard(props: AriaCardOptions): CardAria {\n let titleId = useSlotId();\n let descriptionId = useSlotId();\n let titleProps = useMemo(() => ({\n id: titleId\n }), [titleId]);\n let contentProps = useMemo(() => ({\n id: descriptionId\n }), [descriptionId]);\n\n return {\n cardProps: {\n ...filterDOMProps(props),\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n tabIndex: 0\n },\n titleProps,\n contentProps\n };\n}\n"],"names":[],"version":3,"file":"CardBase.main.js.map"}
package/dist/CardBase.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./card.370c5606.css";
1
+ import "./card.4d5d6544.css";
2
2
  import $8eFIe$card_vars_cssmodulejs from "./card_vars_css.mjs";
3
3
  import {useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.mjs";
4
4
  import {Checkbox as $8eFIe$Checkbox} from "@react-spectrum/checkbox";
@@ -38,7 +38,9 @@ const $643dd8fa80926f94$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, $8eFIe$react
38
38
  let context = (0, $8d180a244893de14$export$fea0b38586ec8f13)() || {}; // we can call again here, won't change from Card.tsx
39
39
  let { state: state } = context;
40
40
  let manager = state === null || state === void 0 ? void 0 : state.selectionManager;
41
- let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {}, item: item, layout: layout, children: children } = props;
41
+ let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {
42
+ role: 'article'
43
+ }, item: item, layout: layout, children: children } = props;
42
44
  let key = item === null || item === void 0 ? void 0 : item.key;
43
45
  let isSelected = manager === null || manager === void 0 ? void 0 : manager.isSelected(key);
44
46
  let isDisabled = state === null || state === void 0 ? void 0 : state.disabledKeys.has(key);
@@ -131,7 +133,7 @@ const $643dd8fa80926f94$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, $8eFIe$react
131
133
  ]);
132
134
  return /*#__PURE__*/ (0, $8eFIe$react).createElement((0, $8eFIe$FocusRing), {
133
135
  focusRingClass: (0, $8eFIe$classNames)((0, ($parcel$interopDefault($8eFIe$card_vars_cssmodulejs))), 'focus-ring')
134
- }, /*#__PURE__*/ (0, $8eFIe$react).createElement("article", {
136
+ }, /*#__PURE__*/ (0, $8eFIe$react).createElement("div", {
135
137
  ...styleProps,
136
138
  ...(0, $8eFIe$mergeProps)(cardProps, focusWithinProps, hoverProps, (0, $8eFIe$filterDOMProps)(props), articleProps),
137
139
  ref: domRef,
@@ -1,4 +1,4 @@
1
- import "./card.370c5606.css";
1
+ import "./card.4d5d6544.css";
2
2
  import $8eFIe$card_vars_cssmodulejs from "./card_vars_css.module.js";
3
3
  import {useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.module.js";
4
4
  import {Checkbox as $8eFIe$Checkbox} from "@react-spectrum/checkbox";
@@ -38,7 +38,9 @@ const $643dd8fa80926f94$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, $8eFIe$react
38
38
  let context = (0, $8d180a244893de14$export$fea0b38586ec8f13)() || {}; // we can call again here, won't change from Card.tsx
39
39
  let { state: state } = context;
40
40
  let manager = state === null || state === void 0 ? void 0 : state.selectionManager;
41
- let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {}, item: item, layout: layout, children: children } = props;
41
+ let { isQuiet: isQuiet, orientation: orientation = 'vertical', articleProps: articleProps = {
42
+ role: 'article'
43
+ }, item: item, layout: layout, children: children } = props;
42
44
  let key = item === null || item === void 0 ? void 0 : item.key;
43
45
  let isSelected = manager === null || manager === void 0 ? void 0 : manager.isSelected(key);
44
46
  let isDisabled = state === null || state === void 0 ? void 0 : state.disabledKeys.has(key);
@@ -131,7 +133,7 @@ const $643dd8fa80926f94$export$7a6ccaf429ad93a8 = /*#__PURE__*/ (0, $8eFIe$react
131
133
  ]);
132
134
  return /*#__PURE__*/ (0, $8eFIe$react).createElement((0, $8eFIe$FocusRing), {
133
135
  focusRingClass: (0, $8eFIe$classNames)((0, ($parcel$interopDefault($8eFIe$card_vars_cssmodulejs))), 'focus-ring')
134
- }, /*#__PURE__*/ (0, $8eFIe$react).createElement("article", {
136
+ }, /*#__PURE__*/ (0, $8eFIe$react).createElement("div", {
135
137
  ...styleProps,
136
138
  ...(0, $8eFIe$mergeProps)(cardProps, focusWithinProps, hoverProps, (0, $8eFIe$filterDOMProps)(props), articleProps),
137
139
  ref: domRef,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA,cAAc;AACd;;;;;;;;;;CAUC;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAAuB,EAAE,GAA2B;IAC/H,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,UAAU,CAAA,GAAA,yCAAiB,OAAO,CAAC,GAAG,qDAAqD;IAC/F,IAAI,SAAC,KAAK,EAAC,GAAG;IACd,IAAI,UAAU,kBAAA,4BAAA,MAAO,gBAAgB;IACrC,IAAI,WACF,OAAO,eACP,cAAc,0BACd,eAAe,CAAC,SAChB,IAAI,UACJ,MAAM,YACN,QAAQ,EACT,GAAG;IAEJ,IAAI,MAAM,iBAAA,2BAAA,KAAM,GAAG;IACnB,IAAI,aAAa,oBAAA,8BAAA,QAAS,UAAU,CAAC;IACrC,IAAI,aAAa,kBAAA,4BAAA,MAAO,YAAY,CAAC,GAAG,CAAC;IACzC,IAAI,WAAW,IAAM,oBAAA,8BAAA,QAAS,MAAM,CAAC;IAErC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,YAAY,EAAC,GAAG,8BAAQ;IACpD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAkB;IACrC,IAAI,cAAc,CAAA,GAAA,aAAK,EAAE;IAEzB,qFAA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;YACpB,UAAU;QACZ;oBACA;sBACA;IACF;AACF","sources":["packages/@react-spectrum/card/src/CardBase.tsx"],"sourcesContent":["// @ts-nocheck\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 */\n\nimport {AriaCardProps, SpectrumCardProps} from '@react-types/card';\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport {classNames, SlotProvider, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useLayoutEffect, useResizeObserver, useSlotId} from '@react-aria/utils';\nimport {FocusRing, getFocusableTreeWalker} from '@react-aria/focus';\nimport React, {HTMLAttributes, useCallback, useMemo, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCardViewContext} from './CardViewContext';\nimport {useFocusWithin, useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\n\ninterface CardBaseProps<T> extends SpectrumCardProps {\n articleProps?: HTMLAttributes<HTMLElement>,\n item?: Node<T>\n}\n\n/**\n * TODO: Add description of component here.\n */\nexport const CardBase = React.forwardRef(function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let context = useCardViewContext() || {}; // we can call again here, won't change from Card.tsx\n let {state} = context;\n let manager = state?.selectionManager;\n let {\n isQuiet,\n orientation = 'vertical',\n articleProps = {},\n item,\n layout,\n children\n } = props;\n\n let key = item?.key;\n let isSelected = manager?.isSelected(key);\n let isDisabled = state?.disabledKeys.has(key);\n let onChange = () => manager?.select(key);\n\n let {styleProps} = useStyleProps(props);\n let {cardProps, titleProps, contentProps} = useCard(props);\n let domRef = useDOMRef(ref);\n let gridRef = useRef<HTMLDivElement>(undefined);\n let checkboxRef = useRef(null);\n\n // cards are only interactive if there is a selection manager and it allows selection\n let {hoverProps, isHovered} = useHover({isDisabled: manager === undefined || manager?.selectionMode === 'none' || isDisabled});\n let [isFocused, setIsFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setIsFocused,\n isDisabled\n });\n\n // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default\n let hasPreviewImage = useHasChild(`.${styles['spectrum-Card-image']}`, gridRef);\n let hasPreviewIllustration = useHasChild(`.${styles['spectrum-Card-illustration']}`, gridRef);\n let hasPreview = hasPreviewImage || hasPreviewIllustration;\n\n // this is for horizontal cards\n let [height, setHeight] = useState(NaN);\n let updateHeight = useCallback(() => {\n if (orientation !== 'horizontal') {\n return;\n }\n\n let cardHeight = gridRef.current.getBoundingClientRect().height;\n setHeight(cardHeight);\n }, [orientation, gridRef, setHeight]);\n useResizeObserver({ref: gridRef, onResize: updateHeight});\n\n let aspectRatioEnforce = undefined;\n if (orientation === 'horizontal' && !isNaN(height)) {\n aspectRatioEnforce = {\n height: `${height}px`,\n width: `${height}px`\n };\n }\n\n let slots = useMemo(() => ({\n image: {UNSAFE_className: classNames(styles, 'spectrum-Card-image'), objectFit: orientation === 'horizontal' ? 'cover' : 'contain', alt: '', ...aspectRatioEnforce},\n illustration: {UNSAFE_className: classNames(styles, 'spectrum-Card-illustration'), ...aspectRatioEnforce},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Card-avatar'), size: 'avatar-size-400'},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Card-heading'), ...titleProps},\n content: {UNSAFE_className: classNames(styles, 'spectrum-Card-content'), ...contentProps},\n detail: {UNSAFE_className: classNames(styles, 'spectrum-Card-detail')}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [titleProps, contentProps, height, isQuiet, orientation]);\n\n useLayoutEffect(() => {\n if (gridRef?.current) {\n let walker = getFocusableTreeWalker(gridRef.current);\n let nextNode = walker.nextNode();\n while (nextNode != null) {\n if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {\n console.warn('Card does not support focusable elements, please contact the team regarding your use case.');\n break;\n }\n nextNode = walker.nextNode();\n }\n }\n }, [children]);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <article\n {...styleProps}\n {...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}\n ref={domRef}\n className={classNames(styles, 'spectrum-Card', {\n 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--horizontal': orientation === 'horizontal',\n 'spectrum-Card--noPreview': !hasPreview,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'is-selected': isSelected,\n 'spectrum-Card--waterfall': layout === 'waterfall',\n 'spectrum-Card--gallery': layout === 'gallery',\n 'spectrum-Card--grid': layout === 'grid',\n 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'\n }, styleProps.className)}>\n <div ref={gridRef} className={classNames(styles, 'spectrum-Card-grid')}>\n {manager && manager.selectionMode !== 'none' && (\n <div className={classNames(styles, 'spectrum-Card-checkboxWrapper')}>\n <Checkbox\n ref={checkboxRef}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isSelected={isSelected}\n onChange={onChange}\n UNSAFE_className={classNames(styles, 'spectrum-Card-checkbox')}\n isEmphasized\n aria-label=\"select\" />\n </div>\n )}\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Card-decoration')} />\n </div>\n </article>\n </FocusRing>\n );\n});\n\ninterface AriaCardOptions extends AriaCardProps {\n}\n\ninterface CardAria {\n cardProps: HTMLAttributes<HTMLDivElement>,\n titleProps: HTMLAttributes<HTMLDivElement>,\n contentProps: HTMLAttributes<HTMLDivElement>\n}\n\nfunction useCard(props: AriaCardOptions): CardAria {\n let titleId = useSlotId();\n let descriptionId = useSlotId();\n let titleProps = useMemo(() => ({\n id: titleId\n }), [titleId]);\n let contentProps = useMemo(() => ({\n id: descriptionId\n }), [descriptionId]);\n\n return {\n cardProps: {\n ...filterDOMProps(props),\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n tabIndex: 0\n },\n titleProps,\n contentProps\n };\n}\n"],"names":[],"version":3,"file":"CardBase.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA,cAAc;AACd;;;;;;;;;;CAUC;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAAuB,EAAE,GAA2B;IAC/H,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,UAAU,CAAA,GAAA,yCAAiB,OAAO,CAAC,GAAG,qDAAqD;IAC/F,IAAI,SAAC,KAAK,EAAC,GAAG;IACd,IAAI,UAAU,kBAAA,4BAAA,MAAO,gBAAgB;IACrC,IAAI,WACF,OAAO,eACP,cAAc,0BACd,eAAe;QAAC,MAAM;IAAS,SAC/B,IAAI,UACJ,MAAM,YACN,QAAQ,EACT,GAAG;IAEJ,IAAI,MAAM,iBAAA,2BAAA,KAAM,GAAG;IACnB,IAAI,aAAa,oBAAA,8BAAA,QAAS,UAAU,CAAC;IACrC,IAAI,aAAa,kBAAA,4BAAA,MAAO,YAAY,CAAC,GAAG,CAAC;IACzC,IAAI,WAAW,IAAM,oBAAA,8BAAA,QAAS,MAAM,CAAC;IAErC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,YAAY,EAAC,GAAG,8BAAQ;IACpD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,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EnB,OAAO;QACL,WAAW;YACT,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;YACxB,mBAAmB;YACnB,oBAAoB;YACpB,UAAU;QACZ;oBACA;sBACA;IACF;AACF","sources":["packages/@react-spectrum/card/src/CardBase.tsx"],"sourcesContent":["// @ts-nocheck\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 */\n\nimport {AriaCardProps, SpectrumCardProps} from '@react-types/card';\nimport {Checkbox} from '@react-spectrum/checkbox';\nimport {classNames, SlotProvider, useDOMRef, useHasChild, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, Node} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useLayoutEffect, useResizeObserver, useSlotId} from '@react-aria/utils';\nimport {FocusRing, getFocusableTreeWalker} from '@react-aria/focus';\nimport React, {HTMLAttributes, useCallback, useMemo, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/card/vars.css';\nimport {useCardViewContext} from './CardViewContext';\nimport {useFocusWithin, useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\n\ninterface CardBaseProps<T> extends SpectrumCardProps {\n articleProps?: HTMLAttributes<HTMLElement>,\n item?: Node<T>\n}\n\n/**\n * TODO: Add description of component here.\n */\nexport const CardBase = React.forwardRef(function CardBase<T extends object>(props: CardBaseProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let context = useCardViewContext() || {}; // we can call again here, won't change from Card.tsx\n let {state} = context;\n let manager = state?.selectionManager;\n let {\n isQuiet,\n orientation = 'vertical',\n articleProps = {role: 'article'},\n item,\n layout,\n children\n } = props;\n\n let key = item?.key;\n let isSelected = manager?.isSelected(key);\n let isDisabled = state?.disabledKeys.has(key);\n let onChange = () => manager?.select(key);\n\n let {styleProps} = useStyleProps(props);\n let {cardProps, titleProps, contentProps} = useCard(props);\n let domRef = useDOMRef(ref);\n let gridRef = useRef<HTMLDivElement>(undefined);\n let checkboxRef = useRef(null);\n\n // cards are only interactive if there is a selection manager and it allows selection\n let {hoverProps, isHovered} = useHover({isDisabled: manager === undefined || manager?.selectionMode === 'none' || isDisabled});\n let [isFocused, setIsFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setIsFocused,\n isDisabled\n });\n\n // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default\n let hasPreviewImage = useHasChild(`.${styles['spectrum-Card-image']}`, gridRef);\n let hasPreviewIllustration = useHasChild(`.${styles['spectrum-Card-illustration']}`, gridRef);\n let hasPreview = hasPreviewImage || hasPreviewIllustration;\n\n // this is for horizontal cards\n let [height, setHeight] = useState(NaN);\n let updateHeight = useCallback(() => {\n if (orientation !== 'horizontal') {\n return;\n }\n\n let cardHeight = gridRef.current.getBoundingClientRect().height;\n setHeight(cardHeight);\n }, [orientation, gridRef, setHeight]);\n useResizeObserver({ref: gridRef, onResize: updateHeight});\n\n let aspectRatioEnforce = undefined;\n if (orientation === 'horizontal' && !isNaN(height)) {\n aspectRatioEnforce = {\n height: `${height}px`,\n width: `${height}px`\n };\n }\n\n let slots = useMemo(() => ({\n image: {UNSAFE_className: classNames(styles, 'spectrum-Card-image'), objectFit: orientation === 'horizontal' ? 'cover' : 'contain', alt: '', ...aspectRatioEnforce},\n illustration: {UNSAFE_className: classNames(styles, 'spectrum-Card-illustration'), ...aspectRatioEnforce},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Card-avatar'), size: 'avatar-size-400'},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Card-heading'), ...titleProps},\n content: {UNSAFE_className: classNames(styles, 'spectrum-Card-content'), ...contentProps},\n detail: {UNSAFE_className: classNames(styles, 'spectrum-Card-detail')}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [titleProps, contentProps, height, isQuiet, orientation]);\n\n useLayoutEffect(() => {\n if (gridRef?.current) {\n let walker = getFocusableTreeWalker(gridRef.current);\n let nextNode = walker.nextNode();\n while (nextNode != null) {\n if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {\n console.warn('Card does not support focusable elements, please contact the team regarding your use case.');\n break;\n }\n nextNode = walker.nextNode();\n }\n }\n }, [children]);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...styleProps}\n {...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}\n ref={domRef}\n className={classNames(styles, 'spectrum-Card', {\n 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',\n 'spectrum-Card--horizontal': orientation === 'horizontal',\n 'spectrum-Card--noPreview': !hasPreview,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'is-selected': isSelected,\n 'spectrum-Card--waterfall': layout === 'waterfall',\n 'spectrum-Card--gallery': layout === 'gallery',\n 'spectrum-Card--grid': layout === 'grid',\n 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'\n }, styleProps.className)}>\n <div ref={gridRef} className={classNames(styles, 'spectrum-Card-grid')}>\n {manager && manager.selectionMode !== 'none' && (\n <div className={classNames(styles, 'spectrum-Card-checkboxWrapper')}>\n <Checkbox\n ref={checkboxRef}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isSelected={isSelected}\n onChange={onChange}\n UNSAFE_className={classNames(styles, 'spectrum-Card-checkbox')}\n isEmphasized\n aria-label=\"select\" />\n </div>\n )}\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Card-decoration')} />\n </div>\n </div>\n </FocusRing>\n );\n});\n\ninterface AriaCardOptions extends AriaCardProps {\n}\n\ninterface CardAria {\n cardProps: HTMLAttributes<HTMLDivElement>,\n titleProps: HTMLAttributes<HTMLDivElement>,\n contentProps: HTMLAttributes<HTMLDivElement>\n}\n\nfunction useCard(props: AriaCardOptions): CardAria {\n let titleId = useSlotId();\n let descriptionId = useSlotId();\n let titleProps = useMemo(() => ({\n id: titleId\n }), [titleId]);\n let contentProps = useMemo(() => ({\n id: descriptionId\n }), [descriptionId]);\n\n return {\n cardProps: {\n ...filterDOMProps(props),\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n tabIndex: 0\n },\n titleProps,\n contentProps\n };\n}\n"],"names":[],"version":3,"file":"CardBase.module.js.map"}
@@ -1,7 +1,7 @@
1
1
  var $7888205ff7de382f$exports = require("./CardBase.main.js");
2
2
  var $e57ab98cef2f01a5$exports = require("./CardViewContext.main.js");
3
3
  var $85c597beff94758b$exports = require("./intlStrings.main.js");
4
- require("./card.370c5606.css");
4
+ require("./card.4d5d6544.css");
5
5
  var $71570f0038472fa2$exports = require("./card_vars_css.main.js");
6
6
  var $kFdxB$reactspectrumutils = require("@react-spectrum/utils");
7
7
  var $kFdxB$reactstatelygrid = require("@react-stately/grid");
package/dist/CardView.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {CardBase as $643dd8fa80926f94$export$7a6ccaf429ad93a8} from "./CardBase.mjs";
2
2
  import {CardViewContext as $8d180a244893de14$export$64992ac69f286e5c, useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.mjs";
3
3
  import $iOsT7$intlStringsmodulejs from "./intlStrings.mjs";
4
- import "./card.370c5606.css";
4
+ import "./card.4d5d6544.css";
5
5
  import $iOsT7$card_vars_cssmodulejs from "./card_vars_css.mjs";
6
6
  import {useStyleProps as $iOsT7$useStyleProps, useDOMRef as $iOsT7$useDOMRef, classNames as $iOsT7$classNames, useUnwrapDOMRef as $iOsT7$useUnwrapDOMRef} from "@react-spectrum/utils";
7
7
  import {GridCollection as $iOsT7$GridCollection, useGridState as $iOsT7$useGridState} from "@react-stately/grid";
@@ -1,7 +1,7 @@
1
1
  import {CardBase as $643dd8fa80926f94$export$7a6ccaf429ad93a8} from "./CardBase.module.js";
2
2
  import {CardViewContext as $8d180a244893de14$export$64992ac69f286e5c, useCardViewContext as $8d180a244893de14$export$fea0b38586ec8f13} from "./CardViewContext.module.js";
3
3
  import $iOsT7$intlStringsmodulejs from "./intlStrings.module.js";
4
- import "./card.370c5606.css";
4
+ import "./card.4d5d6544.css";
5
5
  import $iOsT7$card_vars_cssmodulejs from "./card_vars_css.module.js";
6
6
  import {useStyleProps as $iOsT7$useStyleProps, useDOMRef as $iOsT7$useDOMRef, classNames as $iOsT7$classNames, useUnwrapDOMRef as $iOsT7$useUnwrapDOMRef} from "@react-spectrum/utils";
7
7
  import {GridCollection as $iOsT7$GridCollection, useGridState as $iOsT7$useGridState} from "@react-stately/grid";
@@ -183,13 +183,6 @@
183
183
  display: none;
184
184
  }
185
185
 
186
- .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--default {
187
- border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
188
- border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
189
- border-style: solid;
190
- position: relative;
191
- }
192
-
193
186
  .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--default .NOE1la_spectrum-Card-checkboxWrapper {
194
187
  z-index: 3;
195
188
  }
@@ -199,6 +192,13 @@
199
192
  pointer-events: none;
200
193
  }
201
194
 
195
+ .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--default {
196
+ border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
197
+ border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
198
+ border-style: solid;
199
+ position: relative;
200
+ }
201
+
202
202
  .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--default:before {
203
203
  content: " ";
204
204
  border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
@@ -404,13 +404,6 @@
404
404
  margin-block-end: 5px;
405
405
  }
406
406
 
407
- .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--default {
408
- border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
409
- border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
410
- border-style: solid;
411
- position: relative;
412
- }
413
-
414
407
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--default .NOE1la_spectrum-Card-checkboxWrapper {
415
408
  z-index: 3;
416
409
  }
@@ -420,6 +413,13 @@
420
413
  pointer-events: none;
421
414
  }
422
415
 
416
+ .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--default {
417
+ border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
418
+ border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
419
+ border-style: solid;
420
+ position: relative;
421
+ }
422
+
423
423
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--default:before {
424
424
  content: " ";
425
425
  border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
@@ -628,13 +628,6 @@
628
628
  margin-block-end: 5px;
629
629
  }
630
630
 
631
- .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--default {
632
- border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
633
- border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
634
- border-style: solid;
635
- position: relative;
636
- }
637
-
638
631
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--default .NOE1la_spectrum-Card-checkboxWrapper {
639
632
  z-index: 3;
640
633
  }
@@ -644,6 +637,13 @@
644
637
  pointer-events: none;
645
638
  }
646
639
 
640
+ .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--default {
641
+ border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
642
+ border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
643
+ border-style: solid;
644
+ position: relative;
645
+ }
646
+
647
647
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--default:before {
648
648
  content: " ";
649
649
  border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
@@ -850,10 +850,6 @@
850
850
  margin-block-end: 5px;
851
851
  }
852
852
 
853
- .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--isQuiet {
854
- min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
855
- }
856
-
857
853
  .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-checkboxWrapper {
858
854
  z-index: 3;
859
855
  }
@@ -866,6 +862,10 @@
866
862
  z-index: 2;
867
863
  }
868
864
 
865
+ .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--isQuiet {
866
+ min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
867
+ }
868
+
869
869
  .NOE1la_spectrum-Card--waterfall.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-grid {
870
870
  grid-template-columns: minmax(0, auto) minmax(var(--spectrum-global-dimension-size-500), 1fr) minmax(0, auto);
871
871
  grid-template-rows: minmax(var(--spectrum-card-coverphoto-height, var(--spectrum-global-dimension-size-1700)), 1fr) var(--spectrum-card-quiet-body-header-margin-top, var(--spectrum-global-dimension-size-175)) minmax(var(--spectrum-actionbutton-height, var(--spectrum-alias-single-line-height)), auto) auto;
@@ -929,10 +929,6 @@
929
929
  margin-block-end: 5px;
930
930
  }
931
931
 
932
- .NOE1la_spectrum-Card--gallery.NOE1la_spectrum-Card--isQuiet {
933
- min-inline-size: 0;
934
- }
935
-
936
932
  .NOE1la_spectrum-Card--gallery.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-checkboxWrapper {
937
933
  z-index: 3;
938
934
  }
@@ -945,6 +941,10 @@
945
941
  z-index: 2;
946
942
  }
947
943
 
944
+ .NOE1la_spectrum-Card--gallery.NOE1la_spectrum-Card--isQuiet {
945
+ min-inline-size: 0;
946
+ }
947
+
948
948
  .NOE1la_spectrum-Card--gallery.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-grid {
949
949
  grid-template-columns: minmax(0, auto) minmax(var(--spectrum-global-dimension-size-500), 1fr) minmax(0, auto);
950
950
  grid-template-rows: 1fr var(--spectrum-card-quiet-body-header-margin-top, var(--spectrum-global-dimension-size-175)) var(--spectrum-actionbutton-height, var(--spectrum-alias-single-line-height)) var(--spectrum-alias-single-line-height, var(--spectrum-global-dimension-size-400));
@@ -1028,10 +1028,6 @@
1028
1028
  margin-block-end: 5px;
1029
1029
  }
1030
1030
 
1031
- .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--isQuiet {
1032
- min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
1033
- }
1034
-
1035
1031
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-checkboxWrapper {
1036
1032
  z-index: 3;
1037
1033
  }
@@ -1044,6 +1040,10 @@
1044
1040
  z-index: 2;
1045
1041
  }
1046
1042
 
1043
+ .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--isQuiet {
1044
+ min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
1045
+ }
1046
+
1047
1047
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-grid {
1048
1048
  grid-template-columns: minmax(0, auto) minmax(var(--spectrum-global-dimension-size-500), 1fr) minmax(0, auto);
1049
1049
  grid-template-rows: auto var(--spectrum-card-quiet-body-header-margin-top, var(--spectrum-global-dimension-size-175)) minmax(var(--spectrum-actionbutton-height, var(--spectrum-alias-single-line-height)), auto) var(--spectrum-alias-single-line-height, var(--spectrum-global-dimension-size-400)) 1fr;
@@ -1119,10 +1119,6 @@
1119
1119
  margin-block-end: 5px;
1120
1120
  }
1121
1121
 
1122
- .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--isQuiet {
1123
- min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
1124
- }
1125
-
1126
1122
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-checkboxWrapper {
1127
1123
  z-index: 3;
1128
1124
  }
@@ -1135,6 +1131,10 @@
1135
1131
  z-index: 2;
1136
1132
  }
1137
1133
 
1134
+ .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--isQuiet {
1135
+ min-inline-size: var(--spectrum-card-quiet-min-size, var(--spectrum-global-dimension-size-1700));
1136
+ }
1137
+
1138
1138
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--isQuiet .NOE1la_spectrum-Card-grid {
1139
1139
  grid-template-columns: minmax(0, auto) minmax(var(--spectrum-global-dimension-size-500), 1fr) minmax(0, auto);
1140
1140
  grid-template-rows: auto var(--spectrum-card-quiet-body-header-margin-top, var(--spectrum-global-dimension-size-175)) minmax(var(--spectrum-actionbutton-height, var(--spectrum-alias-single-line-height)), auto) auto var(--spectrum-card-body-padding-bottom, var(--spectrum-global-dimension-size-250));
@@ -1206,16 +1206,16 @@
1206
1206
  margin-block-end: 5px;
1207
1207
  }
1208
1208
 
1209
+ .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-grid:after {
1210
+ z-index: 2;
1211
+ }
1212
+
1209
1213
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal {
1210
1214
  border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
1211
1215
  border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
1212
1216
  border-style: solid;
1213
1217
  }
1214
1218
 
1215
- .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-grid:after {
1216
- z-index: 2;
1217
- }
1218
-
1219
1219
  .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal.NOE1la_is-focused .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal.NOE1la_is-selected .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--grid.NOE1la_spectrum-Card--horizontal.NOE1la_is-hovered .NOE1la_spectrum-Card-checkboxWrapper {
1220
1220
  display: none;
1221
1221
  }
@@ -1324,16 +1324,16 @@
1324
1324
  overflow: hidden;
1325
1325
  }
1326
1326
 
1327
+ .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-grid:after {
1328
+ z-index: 2;
1329
+ }
1330
+
1327
1331
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal {
1328
1332
  border-width: var(--spectrum-card-border-size, var(--spectrum-alias-border-size-thin));
1329
1333
  border-radius: var(--spectrum-card-border-radius, var(--spectrum-alias-border-radius-regular));
1330
1334
  border-style: solid;
1331
1335
  }
1332
1336
 
1333
- .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-grid:after {
1334
- z-index: 2;
1335
- }
1336
-
1337
1337
  .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal.NOE1la_is-focused .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal.NOE1la_is-selected .NOE1la_spectrum-Card-checkboxWrapper, .NOE1la_spectrum-Card--noLayout.NOE1la_spectrum-Card--horizontal.NOE1la_is-hovered .NOE1la_spectrum-Card-checkboxWrapper {
1338
1338
  display: none;
1339
1339
  }
@@ -1668,4 +1668,4 @@
1668
1668
  .NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-image, .NOE1la_spectrum-Card--horizontal .NOE1la_spectrum-Card-illustration {
1669
1669
  border-inline-end-color: var(--spectrum-card-coverphoto-border-color, var(--spectrum-global-color-gray-200));
1670
1670
  }
1671
- /*# sourceMappingURL=card.370c5606.css.map */
1671
+ /*# sourceMappingURL=card.4d5d6544.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAwFJ;;;;;;;;;;AASE;;;;AAIA;;;;AAGA;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAUA;;;;AAaE;;;;;;AASJ;;;;AAKE;;;;AAMF;;;;AAEE;;;;;AAMF;;;;AAEE;;;;;AAMF;;;;;AAKA;;;;;AAKA;;;;;AAKA;;;;;;AAMA;;;;AASE;;;;AAGA;;;;;AAIS;;;;;;;AAKT;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAUA;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAUA;;;;;;;;;;;;AAaE;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAUF;;;;;;;;;;AAWE;;;;AAKF;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAeA;;;;;AAKA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMA;;;;;;;;AAOA;;;;;;;AAMA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AwBF;;;;;;AAQF;;;;;AAGE;;;;AAGI;;;;AASA;;;;AASJ;;;;AAGI;;;;AASJ;;;;AAGI;;;;AAMJ;;;;AAGI;;;;AAMJ;;;;AAGI;;;;;AAKF;;;;AAGI;;;;;AASJ;;;;;AAMF","sources":["packages/@adobe/spectrum-css-temp/components/card/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"card.4d5d6544.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/card",
3
- "version": "3.0.0-alpha.45",
3
+ "version": "3.0.0-alpha.47",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -40,22 +40,22 @@
40
40
  "url": "https://github.com/adobe/react-spectrum"
41
41
  },
42
42
  "dependencies": {
43
- "@react-aria/focus": "^3.20.5",
44
- "@react-aria/grid": "^3.14.2",
45
- "@react-aria/i18n": "^3.12.10",
46
- "@react-aria/interactions": "^3.25.3",
47
- "@react-aria/utils": "^3.29.1",
48
- "@react-aria/virtualizer": "^4.1.7",
49
- "@react-spectrum/checkbox": "^3.9.18",
50
- "@react-spectrum/progress": "^3.7.17",
51
- "@react-spectrum/utils": "^3.12.6",
52
- "@react-stately/collections": "^3.12.5",
53
- "@react-stately/grid": "^3.11.3",
54
- "@react-stately/list": "^3.12.3",
55
- "@react-stately/virtualizer": "^4.4.1",
56
- "@react-types/card": "3.0.0-alpha.37",
57
- "@react-types/provider": "^3.8.10",
58
- "@react-types/shared": "^3.30.0",
43
+ "@react-aria/focus": "^3.21.1",
44
+ "@react-aria/grid": "^3.14.4",
45
+ "@react-aria/i18n": "^3.12.12",
46
+ "@react-aria/interactions": "^3.25.5",
47
+ "@react-aria/utils": "^3.30.1",
48
+ "@react-aria/virtualizer": "^4.1.9",
49
+ "@react-spectrum/checkbox": "^3.10.1",
50
+ "@react-spectrum/progress": "^3.7.19",
51
+ "@react-spectrum/utils": "^3.12.8",
52
+ "@react-stately/collections": "^3.12.7",
53
+ "@react-stately/grid": "^3.11.5",
54
+ "@react-stately/list": "^3.13.0",
55
+ "@react-stately/virtualizer": "^4.4.3",
56
+ "@react-types/card": "3.0.0-alpha.39",
57
+ "@react-types/provider": "^3.8.12",
58
+ "@react-types/shared": "^3.32.0",
59
59
  "@swc/helpers": "^0.5.0"
60
60
  },
61
61
  "devDependencies": {
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "a063122082d2b372e4846b58c85ae69ec73887ff"
72
+ "gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
73
73
  }
package/src/CardBase.tsx CHANGED
@@ -39,7 +39,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
39
39
  let {
40
40
  isQuiet,
41
41
  orientation = 'vertical',
42
- articleProps = {},
42
+ articleProps = {role: 'article'},
43
43
  item,
44
44
  layout,
45
45
  children
@@ -115,7 +115,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
115
115
 
116
116
  return (
117
117
  <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>
118
- <article
118
+ <div
119
119
  {...styleProps}
120
120
  {...mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps)}
121
121
  ref={domRef}
@@ -151,7 +151,7 @@ export const CardBase = React.forwardRef(function CardBase<T extends object>(pro
151
151
  </SlotProvider>
152
152
  <div className={classNames(styles, 'spectrum-Card-decoration')} />
153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;;;;;;;;;AAcA;;;;;;;;AASF;;;;;;AAWA;;;;;;;AAOA;;;;AAGA;;;;;AAIA;;;;;;;;AAOA;;;;AAgBF;;;;;;AACE;;;;AAMA;;;;AAWA;;;;;;;;;;AAUE;;;;;;;;AASF;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAkBA;;;;;AAMA;;;;AAGA;;;;;;;;AAOA;;;;AAIA;;;;;;;;;AAaF;;;;;;AACE;;;;AAMA;;;;AAWA;;;;;;;;;;;;AAYE;;;;;;;;AAgBF;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAkBA;;;;;AAMA;;;;AAGA;;;;;;;;AAOA;;;;AAIA;;;;;;;;;AAeF;;;;AAGE;;;;;;;;AAOA;;;;;AAoBA;;;;;;AAMC;;;;AAID;;;;AAcF;;;;AAIA;;;;AAiBA;;;;;AAIE;;;;AAEE;;;;AAOA;;;;AAQF;;;;AAEE;;;;AAQF;;;;AAEE;;;;AAKF;;;;AAEE;;;;AAKF;;;;AAEE;;;;;AAIA;;;;AAEE;;;;;AAMJ;;;;AAGA;;;;;AAME;;;;;AAMF;;;;AAcA;;;;AASF;;;;;AAKM;;;;;AAUA;;;;AAsBA;;;;AAgBA;;;;AAME;;;;AAQJ;;;;;AAwBF;;;;;;AAQF;;;;;AAGE;;;;AAGI;;;;AASA;;;;AASJ;;;;AAGI;;;;AASJ;;;;AAGI;;;;AAMJ;;;;AAGI;;;;AAMJ;;;;AAGI;;;;;AAKF;;;;AAGI;;;;;AASJ;;;;;AAMF","sources":["packages/@adobe/spectrum-css-temp/components/card/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"card.370c5606.css.map"}