@fluentui/react-card 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.1
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.
- package/.swcrc +2 -11
- package/CHANGELOG.json +72 -15
- package/CHANGELOG.md +26 -10
- package/lib/Card.js +1 -1
- package/lib/CardFooter.js +1 -1
- package/lib/CardHeader.js +1 -1
- package/lib/CardPreview.js +1 -1
- package/lib/components/Card/Card.js +6 -6
- package/lib/components/Card/Card.types.js +1 -1
- package/lib/components/Card/CardContext.js +3 -2
- package/lib/components/Card/CardContext.js.map +1 -1
- package/lib/components/Card/index.js +6 -6
- package/lib/components/Card/renderCard.js +3 -3
- package/lib/components/Card/useCard.js +20 -20
- package/lib/components/Card/useCardSelectable.js +10 -10
- package/lib/components/Card/useCardSelectable.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +14 -14
- package/lib/components/CardFooter/CardFooter.js +5 -5
- package/lib/components/CardFooter/index.js +5 -5
- package/lib/components/CardFooter/renderCardFooter.js +2 -2
- package/lib/components/CardFooter/useCardFooter.js +5 -5
- package/lib/components/CardFooter/useCardFooterStyles.js +3 -3
- package/lib/components/CardHeader/CardHeader.js +5 -5
- package/lib/components/CardHeader/index.js +5 -5
- package/lib/components/CardHeader/renderCardHeader.js +2 -2
- package/lib/components/CardHeader/useCardHeader.js +10 -10
- package/lib/components/CardHeader/useCardHeaderStyles.js +7 -7
- package/lib/components/CardPreview/CardPreview.js +5 -5
- package/lib/components/CardPreview/index.js +5 -5
- package/lib/components/CardPreview/renderCardPreview.js +2 -2
- package/lib/components/CardPreview/useCardPreview.js +9 -9
- package/lib/components/CardPreview/useCardPreviewStyles.js +3 -3
- package/lib/index.js +5 -5
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.js +1 -1
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/CardContext.js +2 -1
- package/lib-commonjs/components/Card/CardContext.js.map +1 -1
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +22 -22
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardSelectable.js +6 -6
- package/lib-commonjs/components/Card/useCardSelectable.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +17 -17
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.js +3 -3
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +2 -2
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.js +6 -6
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +6 -6
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.js +5 -5
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +2 -2
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -7
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardHeader_unstable } from
|
3
|
-
import { renderCardHeader_unstable } from
|
4
|
-
import { useCardHeaderStyles_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCardHeader_unstable } from './useCardHeader';
|
3
|
+
import { renderCardHeader_unstable } from './renderCardHeader';
|
4
|
+
import { useCardHeaderStyles_unstable } from './useCardHeaderStyles';
|
5
5
|
/**
|
6
6
|
* Component to render an image, text and an action in a Card component.
|
7
7
|
*/
|
@@ -10,5 +10,5 @@ export const CardHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardHeaderStyles_unstable(state);
|
11
11
|
return renderCardHeader_unstable(state);
|
12
12
|
});
|
13
|
-
CardHeader.displayName =
|
13
|
+
CardHeader.displayName = 'CardHeader';
|
14
14
|
//# sourceMappingURL=CardHeader.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
1
|
+
export * from './CardHeader';
|
2
|
+
export * from './CardHeader.types';
|
3
|
+
export * from './renderCardHeader';
|
4
|
+
export * from './useCardHeader';
|
5
|
+
export * from './useCardHeaderStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getNativeElementProps, resolveShorthand, useId } from
|
3
|
-
import { useCardContext_unstable } from
|
4
|
-
import { cardHeaderClassNames } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
|
3
|
+
import { useCardContext_unstable } from '../Card/CardContext';
|
4
|
+
import { cardHeaderClassNames } from './useCardHeaderStyles';
|
5
5
|
/**
|
6
6
|
* Create the state required to render CardHeader.
|
7
7
|
*
|
@@ -36,13 +36,13 @@ export const useCardHeader_unstable = (props, ref) => {
|
|
36
36
|
}, [header, setReferenceId, generatedId]);
|
37
37
|
return {
|
38
38
|
components: {
|
39
|
-
root:
|
40
|
-
image:
|
41
|
-
header:
|
42
|
-
description:
|
43
|
-
action:
|
39
|
+
root: 'div',
|
40
|
+
image: 'div',
|
41
|
+
header: 'div',
|
42
|
+
description: 'div',
|
43
|
+
action: 'div'
|
44
44
|
},
|
45
|
-
root: getNativeElementProps(
|
45
|
+
root: getNativeElementProps('div', {
|
46
46
|
ref,
|
47
47
|
...props
|
48
48
|
}),
|
@@ -1,19 +1,19 @@
|
|
1
|
-
import { __styles, mergeClasses } from
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
2
2
|
/**
|
3
3
|
* Static CSS class names used internally for the component slots.
|
4
4
|
*/
|
5
5
|
export const cardHeaderClassNames = {
|
6
|
-
root:
|
7
|
-
image:
|
8
|
-
header:
|
9
|
-
description:
|
10
|
-
action:
|
6
|
+
root: 'fui-CardHeader',
|
7
|
+
image: 'fui-CardHeader__image',
|
8
|
+
header: 'fui-CardHeader__header',
|
9
|
+
description: 'fui-CardHeader__description',
|
10
|
+
action: 'fui-CardHeader__action'
|
11
11
|
};
|
12
12
|
/**
|
13
13
|
* CSS variable names used internally for uniform styling in CardHeader.
|
14
14
|
*/
|
15
15
|
export const cardHeaderCSSVars = {
|
16
|
-
cardHeaderGapVar:
|
16
|
+
cardHeaderGapVar: '--fui-CardHeader--gap'
|
17
17
|
};
|
18
18
|
const useStyles = /*#__PURE__*/__styles({
|
19
19
|
root: {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardPreview_unstable } from
|
3
|
-
import { renderCardPreview_unstable } from
|
4
|
-
import { useCardPreviewStyles_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCardPreview_unstable } from './useCardPreview';
|
3
|
+
import { renderCardPreview_unstable } from './renderCardPreview';
|
4
|
+
import { useCardPreviewStyles_unstable } from './useCardPreviewStyles';
|
5
5
|
/**
|
6
6
|
* Component to render image previews of documents or articles in a Card component.
|
7
7
|
*/
|
@@ -10,5 +10,5 @@ export const CardPreview = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardPreviewStyles_unstable(state);
|
11
11
|
return renderCardPreview_unstable(state);
|
12
12
|
});
|
13
|
-
CardPreview.displayName =
|
13
|
+
CardPreview.displayName = 'CardPreview';
|
14
14
|
//# sourceMappingURL=CardPreview.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
1
|
+
export * from './CardPreview';
|
2
|
+
export * from './CardPreview.types';
|
3
|
+
export * from './renderCardPreview';
|
4
|
+
export * from './useCardPreview';
|
5
|
+
export * from './useCardPreviewStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getNativeElementProps, resolveShorthand, useMergedRefs } from
|
3
|
-
import { useCardContext_unstable } from
|
4
|
-
import { cardPreviewClassNames } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, resolveShorthand, useMergedRefs } from '@fluentui/react-utilities';
|
3
|
+
import { useCardContext_unstable } from '../Card/CardContext';
|
4
|
+
import { cardPreviewClassNames } from './useCardPreviewStyles';
|
5
5
|
/**
|
6
6
|
* Create the state required to render CardPreview.
|
7
7
|
*
|
@@ -31,8 +31,8 @@ export const useCardPreview_unstable = (props, ref) => {
|
|
31
31
|
if (previewRef.current && previewRef.current.parentNode) {
|
32
32
|
const img = previewRef.current.parentNode.querySelector(`.${cardPreviewClassNames.root} > img`);
|
33
33
|
if (img) {
|
34
|
-
const ariaLabel = img.getAttribute(
|
35
|
-
const ariaDescribedby = img.getAttribute(
|
34
|
+
const ariaLabel = img.getAttribute('aria-label');
|
35
|
+
const ariaDescribedby = img.getAttribute('aria-describedby');
|
36
36
|
if (ariaDescribedby) {
|
37
37
|
setReferenceId(ariaDescribedby);
|
38
38
|
} else if (img.alt) {
|
@@ -45,10 +45,10 @@ export const useCardPreview_unstable = (props, ref) => {
|
|
45
45
|
}, [setReferenceLabel, referenceLabel, previewRef, referenceId, setReferenceId]);
|
46
46
|
return {
|
47
47
|
components: {
|
48
|
-
root:
|
49
|
-
logo:
|
48
|
+
root: 'div',
|
49
|
+
logo: 'div'
|
50
50
|
},
|
51
|
-
root: getNativeElementProps(
|
51
|
+
root: getNativeElementProps('div', {
|
52
52
|
ref: previewRef,
|
53
53
|
...props
|
54
54
|
}),
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { __styles, mergeClasses } from
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
2
2
|
/**
|
3
3
|
* Static CSS class names used internally for the component slots.
|
4
4
|
*/
|
5
5
|
export const cardPreviewClassNames = {
|
6
|
-
root:
|
7
|
-
logo:
|
6
|
+
root: 'fui-CardPreview',
|
7
|
+
logo: 'fui-CardPreview__logo'
|
8
8
|
};
|
9
9
|
const useStyles = /*#__PURE__*/__styles({
|
10
10
|
root: {
|
package/lib/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export { Card, cardClassNames, cardCSSVars, renderCard_unstable, useCardStyles_unstable, useCard_unstable } from
|
2
|
-
export { CardFooter, cardFooterClassNames, renderCardFooter_unstable, useCardFooterStyles_unstable, useCardFooter_unstable } from
|
3
|
-
export { CardHeader, cardHeaderClassNames, cardHeaderCSSVars, renderCardHeader_unstable, useCardHeaderStyles_unstable, useCardHeader_unstable } from
|
4
|
-
export { CardPreview, cardPreviewClassNames, renderCardPreview_unstable, useCardPreviewStyles_unstable, useCardPreview_unstable } from
|
5
|
-
export { CardProvider, useCardContext_unstable } from
|
1
|
+
export { Card, cardClassNames, cardCSSVars, renderCard_unstable, useCardStyles_unstable, useCard_unstable } from './Card';
|
2
|
+
export { CardFooter, cardFooterClassNames, renderCardFooter_unstable, useCardFooterStyles_unstable, useCardFooter_unstable } from './CardFooter';
|
3
|
+
export { CardHeader, cardHeaderClassNames, cardHeaderCSSVars, renderCardHeader_unstable, useCardHeaderStyles_unstable, useCardHeader_unstable } from './CardHeader';
|
4
|
+
export { CardPreview, cardPreviewClassNames, renderCardPreview_unstable, useCardPreviewStyles_unstable, useCardPreview_unstable } from './CardPreview';
|
5
|
+
export { CardProvider, useCardContext_unstable } from './Card';
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/lib-commonjs/Card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../lib/Card.js"],"sourcesContent":["export * from
|
1
|
+
{"version":3,"sources":["../lib/Card.js"],"sourcesContent":["export * from './components/Card/index';\n//# sourceMappingURL=Card.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,gCAAgC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../lib/CardFooter.js"],"sourcesContent":["export * from
|
1
|
+
{"version":3,"sources":["../lib/CardFooter.js"],"sourcesContent":["export * from './components/CardFooter/index';\n//# sourceMappingURL=CardFooter.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../lib/CardHeader.js"],"sourcesContent":["export * from
|
1
|
+
{"version":3,"sources":["../lib/CardHeader.js"],"sourcesContent":["export * from './components/CardHeader/index';\n//# sourceMappingURL=CardHeader.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../lib/CardPreview.js"],"sourcesContent":["export * from
|
1
|
+
{"version":3,"sources":["../lib/CardPreview.js"],"sourcesContent":["export * from './components/CardPreview/index';\n//# sourceMappingURL=CardPreview.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,uCAAuC"}
|
@@ -18,6 +18,6 @@ const Card = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
18
|
(0, _useCardStyles.useCardStyles_unstable)(state);
|
19
19
|
return (0, _renderCard.renderCard_unstable)(state, cardContextValue);
|
20
20
|
});
|
21
|
-
Card.displayName =
|
21
|
+
Card.displayName = 'Card'; //# sourceMappingURL=Card.js.map
|
22
22
|
|
23
23
|
//# sourceMappingURL=Card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/Card.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/Card.js"],"sourcesContent":["import * as React from 'react';\nimport { useCard_unstable } from './useCard';\nimport { renderCard_unstable } from './renderCard';\nimport { useCardStyles_unstable } from './useCardStyles';\nimport { useCardContextValue } from './useCardContextValue';\n/**\n * A card provides scaffolding for hosting actions and content for a single topic.\n */\nexport const Card = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useCard_unstable(props, ref);\n const cardContextValue = useCardContextValue(state);\n useCardStyles_unstable(state);\n return renderCard_unstable(state, cardContextValue);\n});\nCard.displayName = 'Card';\n//# sourceMappingURL=Card.js.map"],"names":["Card","React","forwardRef","props","ref","state","useCard_unstable","cardContextValue","useCardContextValue","useCardStyles_unstable","renderCard_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;yBACU;4BACG;+BACG;qCACH;AAI7B,MAAMA,OAAO,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAChE,MAAMC,QAAQC,IAAAA,yBAAgB,EAACH,OAAOC;IACtC,MAAMG,mBAAmBC,IAAAA,wCAAmB,EAACH;IAC7CI,IAAAA,qCAAsB,EAACJ;IACvB,OAAOK,IAAAA,+BAAmB,EAACL,OAAOE;AACpC;AACAP,KAAKW,WAAW,GAAG,QACnB,gCAAgC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/Card.types.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/Card.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Card.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,sCAAsC"}
|
@@ -27,6 +27,7 @@ const cardContextDefaultValue = {
|
|
27
27
|
}
|
28
28
|
};
|
29
29
|
const CardProvider = cardContext.Provider;
|
30
|
-
|
30
|
+
var _React_useContext;
|
31
|
+
const useCardContext_unstable = ()=>(_React_useContext = _react.useContext(cardContext)) !== null && _React_useContext !== void 0 ? _React_useContext : cardContextDefaultValue; //# sourceMappingURL=CardContext.js.map
|
31
32
|
|
32
33
|
//# sourceMappingURL=CardContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/CardContext.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/CardContext.js"],"sourcesContent":["import * as React from 'react';\nconst cardContext = /*#__PURE__*/React.createContext(undefined);\n/**\n * @internal\n */\nexport const cardContextDefaultValue = {\n selectableA11yProps: {\n referenceId: undefined,\n setReferenceId() {\n /* Noop */},\n referenceLabel: undefined,\n setReferenceLabel() {\n /* Noop */}\n }\n};\n/**\n * @internal\n */\nexport const CardProvider = cardContext.Provider;\nvar _React_useContext;\n/**\n * @internal\n */\nexport const useCardContext_unstable = () => (_React_useContext = React.useContext(cardContext)) !== null && _React_useContext !== void 0 ? _React_useContext : cardContextDefaultValue;\n//# sourceMappingURL=CardContext.js.map"],"names":["cardContextDefaultValue","CardProvider","useCardContext_unstable","cardContext","React","createContext","undefined","selectableA11yProps","referenceId","setReferenceId","referenceLabel","setReferenceLabel","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKaA,uBAAuB,MAAvBA;IAaAC,YAAY,MAAZA;IAKAC,uBAAuB,MAAvBA;;;6DAvBU;AACvB,MAAMC,cAAc,WAAW,GAAEC,OAAMC,aAAa,CAACC;AAI9C,MAAMN,0BAA0B;IACrCO,qBAAqB;QACnBC,aAAaF;QACbG,kBAAiB;QACf,QAAQ,GAAE;QACZC,gBAAgBJ;QAChBK,qBAAoB;QAClB,QAAQ,GAAE;IACd;AACF;AAIO,MAAMV,eAAeE,YAAYS,QAAQ;AAChD,IAAIC;AAIG,MAAMX,0BAA0B,IAAM,AAACW,CAAAA,oBAAoBT,OAAMU,UAAU,CAACX,YAAW,MAAO,IAAI,IAAIU,sBAAsB,KAAK,IAAIA,oBAAoBb,uBAAuB,EACvL,uCAAuC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/index.js"],"sourcesContent":["export * from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/index.js"],"sourcesContent":["export * from './Card';\nexport * from './Card.types';\nexport * from './CardContext';\nexport * from './renderCard';\nexport * from './useCard';\nexport * from './useCardStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/renderCard.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/renderCard.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { CardProvider } from './CardContext';\n/**\n * Render the final JSX of Card.\n */\nexport const renderCard_unstable = (state, cardContextValue) => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(CardProvider, {\n value: cardContextValue\n }, slots.checkbox ? /*#__PURE__*/React.createElement(slots.checkbox, slotProps.checkbox) : null, slots.floatingAction ? /*#__PURE__*/React.createElement(slots.floatingAction, slotProps.floatingAction) : null, slotProps.root.children));\n};\n//# sourceMappingURL=renderCard.js.map"],"names":["renderCard_unstable","state","cardContextValue","slots","slotProps","getSlots","React","createElement","root","CardProvider","value","checkbox","floatingAction","children"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;gCACE;6BACI;AAItB,MAAMA,sBAAsB,CAACC,OAAOC,mBAAqB;IAC9D,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACJ;IACb,OAAO,WAAW,GAAEK,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACE,yBAAY,EAAE;QACjHC,OAAOR;IACT,GAAGC,MAAMQ,QAAQ,GAAG,WAAW,GAAEL,OAAMC,aAAa,CAACJ,MAAMQ,QAAQ,EAAEP,UAAUO,QAAQ,IAAI,IAAI,EAAER,MAAMS,cAAc,GAAG,WAAW,GAAEN,OAAMC,aAAa,CAACJ,MAAMS,cAAc,EAAER,UAAUQ,cAAc,IAAI,IAAI,EAAER,UAAUI,IAAI,CAACK,QAAQ;AAC1O,GACA,sCAAsC"}
|
@@ -14,9 +14,9 @@ const _useCardSelectable = require("./useCardSelectable");
|
|
14
14
|
const _cardContext = require("./CardContext");
|
15
15
|
const focusMap = {
|
16
16
|
off: undefined,
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
'no-tab': 'limited-trap-focus',
|
18
|
+
'tab-exit': 'limited',
|
19
|
+
'tab-only': 'unlimited'
|
20
20
|
};
|
21
21
|
/**
|
22
22
|
* Create the state for interactive cards.
|
@@ -25,21 +25,21 @@ const focusMap = {
|
|
25
25
|
* and control focus properties based on that.
|
26
26
|
*
|
27
27
|
* @param props - props from this instance of Card
|
28
|
-
*/ const useCardInteractive = ({ focusMode =
|
28
|
+
*/ const useCardInteractive = ({ focusMode ='off' , ...props })=>{
|
29
29
|
const interactive = [
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
30
|
+
'onClick',
|
31
|
+
'onDoubleClick',
|
32
|
+
'onMouseUp',
|
33
|
+
'onMouseDown',
|
34
|
+
'onPointerUp',
|
35
|
+
'onPointerDown',
|
36
|
+
'onTouchStart',
|
37
|
+
'onTouchEnd',
|
38
|
+
'onDragStart',
|
39
|
+
'onDragEnd'
|
40
40
|
].some((prop)=>props[prop]);
|
41
41
|
const groupperAttrs = (0, _reactTabster.useFocusableGroup)({
|
42
|
-
tabBehavior: focusMap[interactive ?
|
42
|
+
tabBehavior: focusMap[interactive ? 'no-tab' : focusMode]
|
43
43
|
});
|
44
44
|
const interactiveFocusAttributes = {
|
45
45
|
...groupperAttrs,
|
@@ -47,11 +47,11 @@ const focusMap = {
|
|
47
47
|
};
|
48
48
|
return {
|
49
49
|
interactive,
|
50
|
-
focusAttributes: focusMode ===
|
50
|
+
focusAttributes: focusMode === 'off' ? null : interactiveFocusAttributes
|
51
51
|
};
|
52
52
|
};
|
53
53
|
const useCard_unstable = (props, ref)=>{
|
54
|
-
const { appearance =
|
54
|
+
const { appearance ='filled' , orientation ='vertical' , size ='medium' } = props;
|
55
55
|
const [referenceId, setReferenceId] = _react.useState(_cardContext.cardContextDefaultValue.selectableA11yProps.referenceId);
|
56
56
|
const [referenceLabel, setReferenceLabel] = _react.useState(_cardContext.cardContextDefaultValue.selectableA11yProps.referenceId);
|
57
57
|
const cardBaseRef = (0, _reactTabster.useFocusWithin)();
|
@@ -76,13 +76,13 @@ const useCard_unstable = (props, ref)=>{
|
|
76
76
|
setReferenceLabel
|
77
77
|
},
|
78
78
|
components: {
|
79
|
-
root:
|
80
|
-
floatingAction:
|
81
|
-
checkbox:
|
79
|
+
root: 'div',
|
80
|
+
floatingAction: 'div',
|
81
|
+
checkbox: 'input'
|
82
82
|
},
|
83
|
-
root: (0, _reactUtilities.getNativeElementProps)(
|
83
|
+
root: (0, _reactUtilities.getNativeElementProps)('div', {
|
84
84
|
ref: cardRef,
|
85
|
-
role:
|
85
|
+
role: 'group',
|
86
86
|
...focusAttributes,
|
87
87
|
...props,
|
88
88
|
...selectableCardProps
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/useCard.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/useCard.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusableGroup, useFocusWithin } from '@fluentui/react-tabster';\nimport { useCardSelectable } from './useCardSelectable';\nimport { cardContextDefaultValue } from './CardContext';\nconst focusMap = {\n off: undefined,\n 'no-tab': 'limited-trap-focus',\n 'tab-exit': 'limited',\n 'tab-only': 'unlimited'\n};\n/**\n * Create the state for interactive cards.\n *\n * This internal hook defines if the card is interactive\n * and control focus properties based on that.\n *\n * @param props - props from this instance of Card\n */\nconst useCardInteractive = ({\n focusMode = 'off',\n ...props\n}) => {\n const interactive = ['onClick', 'onDoubleClick', 'onMouseUp', 'onMouseDown', 'onPointerUp', 'onPointerDown', 'onTouchStart', 'onTouchEnd', 'onDragStart', 'onDragEnd'].some(prop => props[prop]);\n const groupperAttrs = useFocusableGroup({\n tabBehavior: focusMap[interactive ? 'no-tab' : focusMode]\n });\n const interactiveFocusAttributes = {\n ...groupperAttrs,\n tabIndex: 0\n };\n return {\n interactive,\n focusAttributes: focusMode === 'off' ? null : interactiveFocusAttributes\n };\n};\n/**\n * Create the state required to render Card.\n *\n * The returned state can be modified with hooks such as useCardStyles_unstable,\n * before being passed to renderCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param ref - reference to the root element of Card\n */\nexport const useCard_unstable = (props, ref) => {\n const {\n appearance = 'filled',\n orientation = 'vertical',\n size = 'medium'\n } = props;\n const [referenceId, setReferenceId] = React.useState(cardContextDefaultValue.selectableA11yProps.referenceId);\n const [referenceLabel, setReferenceLabel] = React.useState(cardContextDefaultValue.selectableA11yProps.referenceId);\n const cardBaseRef = useFocusWithin();\n const {\n selectable,\n selected,\n selectableCardProps,\n selectFocused,\n checkboxSlot,\n floatingActionSlot\n } = useCardSelectable(props, {\n referenceId,\n referenceLabel\n }, cardBaseRef);\n const cardRef = useMergedRefs(cardBaseRef, ref);\n const {\n interactive,\n focusAttributes\n } = useCardInteractive(props);\n return {\n appearance,\n orientation,\n size,\n interactive,\n selectable,\n selectFocused,\n selected,\n selectableA11yProps: {\n setReferenceId,\n referenceId,\n referenceLabel,\n setReferenceLabel\n },\n components: {\n root: 'div',\n floatingAction: 'div',\n checkbox: 'input'\n },\n root: getNativeElementProps('div', {\n ref: cardRef,\n role: 'group',\n ...focusAttributes,\n ...props,\n ...selectableCardProps\n }),\n floatingAction: floatingActionSlot,\n checkbox: checkboxSlot\n };\n};\n//# sourceMappingURL=useCard.js.map"],"names":["useCard_unstable","focusMap","off","undefined","useCardInteractive","focusMode","props","interactive","some","prop","groupperAttrs","useFocusableGroup","tabBehavior","interactiveFocusAttributes","tabIndex","focusAttributes","ref","appearance","orientation","size","referenceId","setReferenceId","React","useState","cardContextDefaultValue","selectableA11yProps","referenceLabel","setReferenceLabel","cardBaseRef","useFocusWithin","selectable","selected","selectableCardProps","selectFocused","checkboxSlot","floatingActionSlot","useCardSelectable","cardRef","useMergedRefs","components","root","floatingAction","checkbox","getNativeElementProps","role"],"mappings":";;;;+BA6CaA;;aAAAA;;;6DA7CU;gCAC8B;8BACH;mCAChB;6BACM;AACxC,MAAMC,WAAW;IACfC,KAAKC;IACL,UAAU;IACV,YAAY;IACZ,YAAY;AACd;AACA;;;;;;;CAOC,GACD,MAAMC,qBAAqB,CAAC,EAC1BC,WAAY,MAAK,EACjB,GAAGC,OACJ,GAAK;IACJ,MAAMC,cAAc;QAAC;QAAW;QAAiB;QAAa;QAAe;QAAe;QAAiB;QAAgB;QAAc;QAAe;KAAY,CAACC,IAAI,CAACC,CAAAA,OAAQH,KAAK,CAACG,KAAK;IAC/L,MAAMC,gBAAgBC,IAAAA,+BAAiB,EAAC;QACtCC,aAAaX,QAAQ,CAACM,cAAc,WAAWF,SAAS,CAAC;IAC3D;IACA,MAAMQ,6BAA6B;QACjC,GAAGH,aAAa;QAChBI,UAAU;IACZ;IACA,OAAO;QACLP;QACAQ,iBAAiBV,cAAc,QAAQ,IAAI,GAAGQ,0BAA0B;IAC1E;AACF;AAUO,MAAMb,mBAAmB,CAACM,OAAOU,MAAQ;IAC9C,MAAM,EACJC,YAAa,SAAQ,EACrBC,aAAc,WAAU,EACxBC,MAAO,SAAQ,EAChB,GAAGb;IACJ,MAAM,CAACc,aAAaC,eAAe,GAAGC,OAAMC,QAAQ,CAACC,oCAAuB,CAACC,mBAAmB,CAACL,WAAW;IAC5G,MAAM,CAACM,gBAAgBC,kBAAkB,GAAGL,OAAMC,QAAQ,CAACC,oCAAuB,CAACC,mBAAmB,CAACL,WAAW;IAClH,MAAMQ,cAAcC,IAAAA,4BAAc;IAClC,MAAM,EACJC,WAAU,EACVC,SAAQ,EACRC,oBAAmB,EACnBC,cAAa,EACbC,aAAY,EACZC,mBAAkB,EACnB,GAAGC,IAAAA,oCAAiB,EAAC9B,OAAO;QAC3Bc;QACAM;IACF,GAAGE;IACH,MAAMS,UAAUC,IAAAA,6BAAa,EAACV,aAAaZ;IAC3C,MAAM,EACJT,YAAW,EACXQ,gBAAe,EAChB,GAAGX,mBAAmBE;IACvB,OAAO;QACLW;QACAC;QACAC;QACAZ;QACAuB;QACAG;QACAF;QACAN,qBAAqB;YACnBJ;YACAD;YACAM;YACAC;QACF;QACAY,YAAY;YACVC,MAAM;YACNC,gBAAgB;YAChBC,UAAU;QACZ;QACAF,MAAMG,IAAAA,qCAAqB,EAAC,OAAO;YACjC3B,KAAKqB;YACLO,MAAM;YACN,GAAG7B,eAAe;YAClB,GAAGT,KAAK;YACR,GAAG0B,mBAAmB;QACxB;QACAS,gBAAgBN;QAChBO,UAAUR;IACZ;AACF,GACA,mCAAmC"}
|
@@ -19,7 +19,7 @@ const useCardSelectable = (props, { referenceLabel , referenceId }, cardRef)=>{
|
|
19
19
|
selected,
|
20
20
|
defaultSelected,
|
21
21
|
onSelectionChange
|
22
|
-
].some((prop)=>typeof prop !==
|
22
|
+
].some((prop)=>typeof prop !== 'undefined');
|
23
23
|
const [isCardSelected, setIsCardSelected] = _react.useState(false);
|
24
24
|
const [isSelectFocused, setIsSelectFocused] = _react.useState(false);
|
25
25
|
const shouldRestrictTriggerAction = _react.useCallback((event)=>{
|
@@ -29,7 +29,7 @@ const useCardSelectable = (props, { referenceLabel , referenceId }, cardRef)=>{
|
|
29
29
|
const focusableElements = findAllFocusable(cardRef.current);
|
30
30
|
const target = event.target;
|
31
31
|
const isElementInFocusableGroup = focusableElements.some((element)=>element.contains(target));
|
32
|
-
const isCheckboxSlot = checkboxRef
|
32
|
+
const isCheckboxSlot = (checkboxRef === null || checkboxRef === void 0 ? void 0 : checkboxRef.current) === target;
|
33
33
|
return isElementInFocusableGroup && !isCheckboxSlot;
|
34
34
|
}, [
|
35
35
|
cardRef,
|
@@ -67,14 +67,14 @@ const useCardSelectable = (props, { referenceLabel , referenceId }, cardRef)=>{
|
|
67
67
|
}
|
68
68
|
const selectableCheckboxProps = {};
|
69
69
|
if (referenceId) {
|
70
|
-
selectableCheckboxProps[
|
70
|
+
selectableCheckboxProps['aria-labelledby'] = referenceId;
|
71
71
|
} else if (referenceLabel) {
|
72
|
-
selectableCheckboxProps[
|
72
|
+
selectableCheckboxProps['aria-label'] = referenceLabel;
|
73
73
|
}
|
74
74
|
return (0, _reactUtilities.resolveShorthand)(checkbox, {
|
75
75
|
defaultProps: {
|
76
76
|
ref: checkboxRef,
|
77
|
-
type:
|
77
|
+
type: 'checkbox',
|
78
78
|
checked: isCardSelected,
|
79
79
|
onChange: (event)=>onChangeHandler(event),
|
80
80
|
onFocus: ()=>setIsSelectFocused(true),
|
@@ -118,7 +118,7 @@ const useCardSelectable = (props, { referenceLabel , referenceId }, cardRef)=>{
|
|
118
118
|
onKeyDown,
|
119
119
|
onKeyDownHandler
|
120
120
|
]);
|
121
|
-
_react.useEffect(()=>setIsCardSelected(Boolean(defaultSelected
|
121
|
+
_react.useEffect(()=>setIsCardSelected(Boolean(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : selected)), [
|
122
122
|
defaultSelected,
|
123
123
|
selected,
|
124
124
|
setIsCardSelected
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Card/useCardSelectable.js"],"sourcesContent":["import * as React from
|
1
|
+
{"version":3,"sources":["../../../lib/components/Card/useCardSelectable.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { useFocusFinders } from '@fluentui/react-tabster';\n/**\n * @internal\n *\n * Create the state related to selectable cards.\n *\n * This internal hook controls all the logic for selectable cards and is\n * intended to be used alongside with useCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param a11yProps - accessibility props shared between elements of the card\n * @param ref - reference to the root element of Card\n */\nexport const useCardSelectable = (props, {\n referenceLabel,\n referenceId\n}, cardRef) => {\n const {\n checkbox = {},\n selected,\n defaultSelected,\n onSelectionChange,\n floatingAction,\n onClick,\n onKeyDown\n } = props;\n const {\n findAllFocusable\n } = useFocusFinders();\n const checkboxRef = React.useRef(null);\n const isSelectable = [selected, defaultSelected, onSelectionChange].some(prop => typeof prop !== 'undefined');\n const [isCardSelected, setIsCardSelected] = React.useState(false);\n const [isSelectFocused, setIsSelectFocused] = React.useState(false);\n const shouldRestrictTriggerAction = React.useCallback(event => {\n if (!cardRef.current) {\n return false;\n }\n const focusableElements = findAllFocusable(cardRef.current);\n const target = event.target;\n const isElementInFocusableGroup = focusableElements.some(element => element.contains(target));\n const isCheckboxSlot = (checkboxRef === null || checkboxRef === void 0 ? void 0 : checkboxRef.current) === target;\n return isElementInFocusableGroup && !isCheckboxSlot;\n }, [cardRef, findAllFocusable]);\n const onChangeHandler = React.useCallback(event => {\n if (shouldRestrictTriggerAction(event)) {\n return;\n }\n const newCheckedValue = !isCardSelected;\n setIsCardSelected(newCheckedValue);\n if (onSelectionChange) {\n onSelectionChange(event, {\n selected: newCheckedValue\n });\n }\n }, [onSelectionChange, isCardSelected, shouldRestrictTriggerAction]);\n const onKeyDownHandler = React.useCallback(event => {\n if ([Enter].includes(event.key)) {\n event.preventDefault();\n onChangeHandler(event);\n }\n }, [onChangeHandler]);\n const checkboxSlot = React.useMemo(() => {\n if (!isSelectable || floatingAction) {\n return;\n }\n const selectableCheckboxProps = {};\n if (referenceId) {\n selectableCheckboxProps['aria-labelledby'] = referenceId;\n } else if (referenceLabel) {\n selectableCheckboxProps['aria-label'] = referenceLabel;\n }\n return resolveShorthand(checkbox, {\n defaultProps: {\n ref: checkboxRef,\n type: 'checkbox',\n checked: isCardSelected,\n onChange: event => onChangeHandler(event),\n onFocus: () => setIsSelectFocused(true),\n onBlur: () => setIsSelectFocused(false),\n ...selectableCheckboxProps\n }\n });\n }, [checkbox, floatingAction, isCardSelected, isSelectable, onChangeHandler, referenceId, referenceLabel]);\n const floatingActionSlot = React.useMemo(() => {\n if (!floatingAction) {\n return;\n }\n return resolveShorthand(floatingAction, {\n defaultProps: {\n ref: checkboxRef\n }\n });\n }, [floatingAction]);\n const selectableCardProps = React.useMemo(() => {\n if (!isSelectable) {\n return null;\n }\n return {\n onClick: mergeCallbacks(onClick, onChangeHandler),\n onKeyDown: mergeCallbacks(onKeyDown, onKeyDownHandler)\n };\n }, [isSelectable, onChangeHandler, onClick, onKeyDown, onKeyDownHandler]);\n React.useEffect(() => setIsCardSelected(Boolean(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : selected)), [defaultSelected, selected, setIsCardSelected]);\n return {\n selected: isCardSelected,\n selectable: isSelectable,\n selectFocused: isSelectFocused,\n selectableCardProps,\n checkboxSlot,\n floatingActionSlot\n };\n};\n//# sourceMappingURL=useCardSelectable.js.map"],"names":["useCardSelectable","props","referenceLabel","referenceId","cardRef","checkbox","selected","defaultSelected","onSelectionChange","floatingAction","onClick","onKeyDown","findAllFocusable","useFocusFinders","checkboxRef","React","useRef","isSelectable","some","prop","isCardSelected","setIsCardSelected","useState","isSelectFocused","setIsSelectFocused","shouldRestrictTriggerAction","useCallback","event","current","focusableElements","target","isElementInFocusableGroup","element","contains","isCheckboxSlot","onChangeHandler","newCheckedValue","onKeyDownHandler","Enter","includes","key","preventDefault","checkboxSlot","useMemo","selectableCheckboxProps","resolveShorthand","defaultProps","ref","type","checked","onChange","onFocus","onBlur","floatingActionSlot","selectableCardProps","mergeCallbacks","useEffect","Boolean","selectable","selectFocused"],"mappings":"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"}
|
@@ -16,13 +16,13 @@ _export(exports, {
|
|
16
16
|
const _react = require("@griffel/react");
|
17
17
|
const _reactTheme = require("@fluentui/react-theme");
|
18
18
|
const cardClassNames = {
|
19
|
-
root:
|
20
|
-
floatingAction:
|
21
|
-
checkbox:
|
19
|
+
root: 'fui-Card',
|
20
|
+
floatingAction: 'fui-Card__floatingAction',
|
21
|
+
checkbox: 'fui-Card__checkbox'
|
22
22
|
};
|
23
23
|
const cardCSSVars = {
|
24
|
-
cardSizeVar:
|
25
|
-
cardBorderRadiusVar:
|
24
|
+
cardSizeVar: '--fui-Card--size',
|
25
|
+
cardBorderRadiusVar: '--fui-Card--border-radius'
|
26
26
|
};
|
27
27
|
const focusOutlineStyle = {
|
28
28
|
outlineRadius: `var(${cardCSSVars.cardBorderRadiusVar})`,
|
@@ -547,7 +547,7 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
547
547
|
".f1n6gb5g::after{left:0;}",
|
548
548
|
".f15yvnhg::after{right:0;}",
|
549
549
|
".fo72kxq::after{bottom:0;}",
|
550
|
-
|
550
|
+
".f13zj6fq::after{content:\"\";}",
|
551
551
|
".f1nwj1ja::after{pointer-events:none;}",
|
552
552
|
".f8rth92::after{border-top-style:solid;}",
|
553
553
|
".flthirb::after{border-right-style:solid;}",
|
@@ -567,7 +567,7 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
567
567
|
".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}",
|
568
568
|
".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}",
|
569
569
|
".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}",
|
570
|
-
|
570
|
+
".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}",
|
571
571
|
".f14e48fq[data-fui-focus-visible]::after{position:absolute;}",
|
572
572
|
".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}",
|
573
573
|
".fd6o370[data-fui-focus-visible]::after{z-index:1;}",
|
@@ -595,7 +595,7 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
595
595
|
".f4ne723[data-fui-focus-within]:focus-within{border-right-color:transparent;}",
|
596
596
|
".fqqcjud[data-fui-focus-within]:focus-within{border-left-color:transparent;}",
|
597
597
|
".fh7aioi[data-fui-focus-within]:focus-within{border-bottom-color:transparent;}",
|
598
|
-
|
598
|
+
".ffht0p2[data-fui-focus-within]:focus-within::after{content:\"\";}",
|
599
599
|
".f1p0ul1q[data-fui-focus-within]:focus-within::after{position:absolute;}",
|
600
600
|
".f1c901ms[data-fui-focus-within]:focus-within::after{pointer-events:none;}",
|
601
601
|
".f1alokd7[data-fui-focus-within]:focus-within::after{z-index:1;}",
|
@@ -623,17 +623,17 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
623
623
|
".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}",
|
624
624
|
".fpfyeui>.fui-CardPreview{margin-top:calc(var(--fui-Card--size) * -1);}",
|
625
625
|
".fwi74qw>.fui-CardPreview{margin-bottom:calc(var(--fui-Card--size) * -1);}",
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
626
|
+
".ffcmwrh>:not([aria-hidden=\"true\"]).fui-CardPreview:first-of-type{margin-left:calc(var(--fui-Card--size) * -1);}",
|
627
|
+
".f6ppoih>:not([aria-hidden=\"true\"]).fui-CardPreview:first-of-type{margin-right:calc(var(--fui-Card--size) * -1);}",
|
628
|
+
".f1dc9p14>:not([aria-hidden=\"true\"]).fui-CardPreview:last-of-type{margin-right:calc(var(--fui-Card--size) * -1);}",
|
629
|
+
".fd933vt>:not([aria-hidden=\"true\"]).fui-CardPreview:last-of-type{margin-left:calc(var(--fui-Card--size) * -1);}",
|
630
630
|
".f18esqgw>.fui-CardHeader:last-of-type,.f18esqgw>.fui-CardFooter:last-of-type{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}",
|
631
631
|
".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}",
|
632
632
|
".fobhde4>.fui-CardPreview{margin-left:calc(var(--fui-Card--size) * -1);}",
|
633
633
|
".fx5r7kn>.fui-CardPreview{margin-right:calc(var(--fui-Card--size) * -1);}",
|
634
|
-
|
634
|
+
".f19chtn8>:not([aria-hidden=\"true\"]).fui-CardPreview:first-of-type{margin-top:calc(var(--fui-Card--size) * -1);}",
|
635
635
|
".fuvs6re>.fui-Card__floatingAction+.fui-CardPreview{margin-top:calc(var(--fui-Card--size) * -1);}",
|
636
|
-
|
636
|
+
".fy4glsf>:not([aria-hidden=\"true\"]).fui-CardPreview:last-of-type{margin-bottom:calc(var(--fui-Card--size) * -1);}",
|
637
637
|
".f1pi9uxy{--fui-Card--size:8px;}",
|
638
638
|
".f1h1zgly{--fui-Card--border-radius:var(--borderRadiusSmall);}",
|
639
639
|
".frsmuga{--fui-Card--size:12px;}",
|
@@ -719,19 +719,19 @@ const useCardStyles_unstable = (state)=>{
|
|
719
719
|
};
|
720
720
|
const appearanceMap = {
|
721
721
|
filled: styles.filled,
|
722
|
-
|
722
|
+
'filled-alternative': styles.filledAlternative,
|
723
723
|
outline: styles.outline,
|
724
724
|
subtle: styles.subtle
|
725
725
|
};
|
726
726
|
const selectedMap = {
|
727
727
|
filled: styles.filledInteractiveSelected,
|
728
|
-
|
728
|
+
'filled-alternative': styles.filledAlternativeInteractiveSelected,
|
729
729
|
outline: styles.outlineInteractiveSelected,
|
730
730
|
subtle: styles.subtleInteractiveSelected
|
731
731
|
};
|
732
732
|
const interactiveMap = {
|
733
733
|
filled: styles.filledInteractive,
|
734
|
-
|
734
|
+
'filled-alternative': styles.filledAlternativeInteractive,
|
735
735
|
outline: styles.outlineInteractive,
|
736
736
|
subtle: styles.subtleInteractive
|
737
737
|
};
|