@fluentui/react-card 9.0.0-beta.1 → 9.0.0-beta.12
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/CHANGELOG.json +640 -1
- package/CHANGELOG.md +158 -2
- package/README.md +3 -1
- package/Spec.md +523 -0
- package/assets/Card.png +0 -0
- package/assets/CardHeader.png +0 -0
- package/assets/CardPreview.png +0 -0
- package/assets/context-interaction-keyboard.png +0 -0
- package/assets/context-interaction-mouse.png +0 -0
- package/assets/context-narrator.png +0 -0
- package/assets/disabled-narrator.png +0 -0
- package/assets/disabled.png +0 -0
- package/assets/interactive-interaction-keyboard.png +0 -0
- package/assets/interactive-interaction-mouse.png +0 -0
- package/assets/interactive-narrator.png +0 -0
- package/assets/non-interactive-interaction-keyboard.png +0 -0
- package/assets/non-interactive-interaction-mouse.png +0 -0
- package/assets/non-interactive-narrator.png +0 -0
- package/assets/non-interactive-selectable-interaction-keyboard.png +0 -0
- package/assets/non-interactive-selectable-interaction-mouse.png +0 -0
- package/assets/selectable-interaction-keyboard.png +0 -0
- package/assets/selectable-interaction-mouse.png +0 -0
- package/assets/selectable-narrator.png +0 -0
- package/dist/react-card.d.ts +72 -127
- package/lib/Card.js.map +1 -1
- package/lib/CardFooter.js.map +1 -1
- package/lib/CardHeader.js.map +1 -1
- package/lib/CardPreview.js.map +1 -1
- package/lib/components/Card/Card.d.ts +1 -1
- package/lib/components/Card/Card.js +8 -8
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.d.ts +9 -18
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Card/renderCard.d.ts +1 -1
- package/lib/components/Card/renderCard.js +8 -8
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.d.ts +3 -4
- package/lib/components/Card/useCard.js +23 -11
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.d.ts +8 -2
- package/lib/components/Card/useCardStyles.js +138 -25
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.js +7 -7
- package/lib/components/CardFooter/CardFooter.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.d.ts +8 -23
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib/components/CardFooter/index.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.d.ts +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +9 -9
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.d.ts +4 -9
- package/lib/components/CardFooter/useCardFooter.js +18 -17
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +8 -2
- package/lib/components/CardFooter/useCardFooterStyles.js +18 -8
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.js +7 -7
- package/lib/components/CardHeader/CardHeader.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.d.ts +12 -39
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib/components/CardHeader/index.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.d.ts +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +13 -9
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.d.ts +4 -9
- package/lib/components/CardHeader/useCardHeader.js +35 -33
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +8 -2
- package/lib/components/CardHeader/useCardHeaderStyles.js +35 -9
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.js +7 -7
- package/lib/components/CardPreview/CardPreview.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.d.ts +8 -23
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib/components/CardPreview/index.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.d.ts +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +9 -9
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.d.ts +4 -9
- package/lib/components/CardPreview/useCardPreview.js +18 -20
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +8 -2
- package/lib/components/CardPreview/useCardPreviewStyles.js +16 -11
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.d.ts +8 -4
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Card.js +1 -1
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js +1 -1
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js +1 -1
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js +1 -1
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.d.ts +1 -1
- package/lib-commonjs/components/Card/Card.js +9 -9
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.d.ts +9 -18
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/index.js +1 -1
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.d.ts +1 -1
- package/lib-commonjs/components/Card/renderCard.js +11 -12
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.d.ts +3 -4
- package/lib-commonjs/components/Card/useCard.js +26 -13
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.d.ts +8 -2
- package/lib-commonjs/components/Card/useCardStyles.js +143 -28
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +8 -8
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +8 -23
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js +1 -1
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +12 -14
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +4 -9
- package/lib-commonjs/components/CardFooter/useCardFooter.js +21 -20
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +8 -2
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +21 -11
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +8 -8
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +12 -39
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js +1 -1
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +16 -14
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +4 -9
- package/lib-commonjs/components/CardHeader/useCardHeader.js +38 -37
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +8 -2
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +38 -12
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +8 -8
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +8 -23
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js +1 -1
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +12 -14
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +4 -9
- package/lib-commonjs/components/CardPreview/useCardPreview.js +21 -23
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +8 -2
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +19 -14
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +8 -4
- package/lib-commonjs/index.js +153 -5
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +19 -22
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -11
- package/lib/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -22
- package/lib-commonjs/common/isConformant.js.map +0 -1
@@ -1,16 +1,20 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
|
-
import {
|
4
|
-
import { cardHeaderShorthandPropsCompat } from './useCardHeader';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
5
3
|
/**
|
6
4
|
* Render the final JSX of CardHeader
|
7
5
|
*/
|
8
6
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
7
|
+
export const renderCardHeader_unstable = state => {
|
8
|
+
const {
|
9
|
+
slots,
|
10
|
+
slotProps
|
11
|
+
} = getSlots(state);
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
13
|
+
}, /*#__PURE__*/React.createElement(slots.image, { ...slotProps.image
|
14
|
+
}), slots.content && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
15
|
+
}, /*#__PURE__*/React.createElement(slots.header, { ...slotProps.header
|
16
|
+
}), /*#__PURE__*/React.createElement(slots.description, { ...slotProps.description
|
17
|
+
})), slots.action && /*#__PURE__*/React.createElement(slots.action, { ...slotProps.action
|
18
|
+
}));
|
15
19
|
};
|
16
20
|
//# sourceMappingURL=renderCardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardHeader/renderCardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAkB,KAAlB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CADF,EAEG,KAAK,CAAC,OAAN,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;AAAf,GAAb,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,WAAP,EAAkB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAlB,CAFF,CAHJ,EAQG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;AAAf,GAAb,CARnB,CADF;AAYD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardHeaderSlots, CardHeaderState } from './CardHeader.types';\n\n/**\n * Render the final JSX of CardHeader\n */\nexport const renderCardHeader_unstable = (state: CardHeaderState) => {\n const { slots, slotProps } = getSlots<CardHeaderSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.image {...slotProps.image} />\n {slots.content && (\n <slots.content {...slotProps.content}>\n <slots.header {...slotProps.header} />\n <slots.description {...slotProps.description} />\n </slots.content>\n )}\n {slots.action && <slots.action {...slotProps.action} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,17 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { CardHeaderProps,
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in CardHeaderShorthandProps
|
5
|
-
*/
|
6
|
-
export declare const cardHeaderShorthandPropsCompat: CardHeaderShorthandProps[];
|
2
|
+
import type { CardHeaderProps, CardHeaderState } from './CardHeader.types';
|
7
3
|
/**
|
8
4
|
* Create the state required to render CardHeader.
|
9
5
|
*
|
10
|
-
* The returned state can be modified with hooks such as
|
11
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
7
|
+
* before being passed to renderCardHeader_unstable.
|
12
8
|
*
|
13
9
|
* @param props - props from this instance of CardHeader
|
14
10
|
* @param ref - reference to root HTMLElement of CardHeader
|
15
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
16
11
|
*/
|
17
|
-
export declare const
|
12
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React.Ref<HTMLElement>) => CardHeaderState;
|
@@ -1,44 +1,46 @@
|
|
1
|
-
import
|
2
|
-
import { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in CardHeaderShorthandProps
|
5
|
-
*/
|
6
|
-
|
7
|
-
export var cardHeaderShorthandPropsCompat = ['image', 'content', 'header', 'description', 'action'];
|
8
|
-
var mergeProps = /*#__PURE__*/makeMergeProps({
|
9
|
-
deepMerge: cardHeaderShorthandPropsCompat
|
10
|
-
});
|
1
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
11
2
|
/**
|
12
3
|
* Create the state required to render CardHeader.
|
13
4
|
*
|
14
|
-
* The returned state can be modified with hooks such as
|
15
|
-
* before being passed to
|
5
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
6
|
+
* before being passed to renderCardHeader_unstable.
|
16
7
|
*
|
17
8
|
* @param props - props from this instance of CardHeader
|
18
9
|
* @param ref - reference to root HTMLElement of CardHeader
|
19
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
20
10
|
*/
|
21
11
|
|
22
|
-
export
|
23
|
-
|
24
|
-
image
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
as: 'div'
|
12
|
+
export const useCardHeader_unstable = (props, ref) => {
|
13
|
+
const {
|
14
|
+
image,
|
15
|
+
content,
|
16
|
+
header,
|
17
|
+
description,
|
18
|
+
action
|
19
|
+
} = props;
|
20
|
+
return {
|
21
|
+
components: {
|
22
|
+
root: 'div',
|
23
|
+
image: 'div',
|
24
|
+
content: 'div',
|
25
|
+
header: 'span',
|
26
|
+
description: 'span',
|
27
|
+
action: 'div'
|
39
28
|
},
|
40
|
-
|
41
|
-
|
42
|
-
|
29
|
+
root: getNativeElementProps('div', {
|
30
|
+
ref,
|
31
|
+
...props
|
32
|
+
}),
|
33
|
+
image: resolveShorthand(image, {
|
34
|
+
required: true
|
35
|
+
}),
|
36
|
+
content: resolveShorthand(content || {}),
|
37
|
+
header: resolveShorthand(header, {
|
38
|
+
required: true
|
39
|
+
}),
|
40
|
+
description: resolveShorthand(description, {
|
41
|
+
required: true
|
42
|
+
}),
|
43
|
+
action: resolveShorthand(action)
|
44
|
+
};
|
43
45
|
};
|
44
46
|
//# sourceMappingURL=useCardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardHeader/useCardHeader.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAAyE;AAC7G,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA,OAAT;AAAkB,IAAA,MAAlB;AAA0B,IAAA,WAA1B;AAAuC,IAAA;AAAvC,MAAkD,KAAxD;AAEA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,KAAK,EAAE,KAFG;AAGV,MAAA,OAAO,EAAE,KAHC;AAIV,MAAA,MAAM,EAAE,MAJE;AAKV,MAAA,WAAW,EAAE,MALH;AAMV,MAAA,MAAM,EAAE;AANE,KADP;AAUL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,SAAG;AAF8B,KAAR,CAVtB;AAcL,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAC7B,MAAA,QAAQ,EAAE;AADmB,KAAR,CAdlB;AAiBL,IAAA,OAAO,EAAE,gBAAgB,CAAC,OAAO,IAAI,EAAZ,CAjBpB;AAkBL,IAAA,MAAM,EAAE,gBAAgB,CAAC,MAAD,EAAS;AAC/B,MAAA,QAAQ,EAAE;AADqB,KAAT,CAlBnB;AAqBL,IAAA,WAAW,EAAE,gBAAgB,CAAC,WAAD,EAAc;AACzC,MAAA,QAAQ,EAAE;AAD+B,KAAd,CArBxB;AAwBL,IAAA,MAAM,EAAE,gBAAgB,CAAC,MAAD;AAxBnB,GAAP;AA0BD,CA7BM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { CardHeaderProps, CardHeaderState } from './CardHeader.types';\n\n/**\n * Create the state required to render CardHeader.\n *\n * The returned state can be modified with hooks such as useCardHeaderStyles_unstable,\n * before being passed to renderCardHeader_unstable.\n *\n * @param props - props from this instance of CardHeader\n * @param ref - reference to root HTMLElement of CardHeader\n */\nexport const useCardHeader_unstable = (props: CardHeaderProps, ref: React.Ref<HTMLElement>): CardHeaderState => {\n const { image, content, header, description, action } = props;\n\n return {\n components: {\n root: 'div',\n image: 'div',\n content: 'div',\n header: 'span',\n description: 'span',\n action: 'div',\n },\n\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n image: resolveShorthand(image, {\n required: true,\n }),\n content: resolveShorthand(content || {}),\n header: resolveShorthand(header, {\n required: true,\n }),\n description: resolveShorthand(description, {\n required: true,\n }),\n action: resolveShorthand(action),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,11 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
+
import type { CardHeaderSlots, CardHeaderState } from './CardHeader.types';
|
3
|
+
/**
|
4
|
+
* @deprecated Use `cardHeaderClassNames.root` instead.
|
5
|
+
*/
|
6
|
+
export declare const cardHeaderClassName = "fui-CardHeader";
|
7
|
+
export declare const cardHeaderClassNames: SlotClassNames<CardHeaderSlots>;
|
2
8
|
/**
|
3
9
|
* Apply styling to the CardHeader slots based on the state
|
4
10
|
*/
|
5
|
-
export declare const
|
11
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
@@ -1,14 +1,28 @@
|
|
1
|
-
import { __styles, mergeClasses } from '@
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
|
+
/**
|
3
|
+
* @deprecated Use `cardHeaderClassNames.root` instead.
|
4
|
+
*/
|
5
|
+
|
6
|
+
export const cardHeaderClassName = 'fui-CardHeader';
|
7
|
+
export const cardHeaderClassNames = {
|
8
|
+
root: 'fui-CardHeader',
|
9
|
+
image: 'fui-CardHeader__image',
|
10
|
+
content: 'fui-CardHeader__content',
|
11
|
+
header: 'fui-CardHeader__header',
|
12
|
+
description: 'fui-CardHeader__description',
|
13
|
+
action: 'fui-CardHeader__action'
|
14
|
+
};
|
2
15
|
/**
|
3
16
|
* Styles for the root slot
|
4
17
|
*/
|
5
18
|
|
6
|
-
|
19
|
+
const useStyles = /*#__PURE__*/__styles({
|
7
20
|
"root": {
|
8
21
|
"mc9l5x": "f22iagw",
|
9
22
|
"Beiy3e4": "f1063pyq",
|
10
23
|
"Bt984gj": "f122n59",
|
11
|
-
"
|
24
|
+
"i8kkvl": "f4akndk",
|
25
|
+
"Belr9w4": "fe5j3v",
|
12
26
|
"Bqenvij": "f1d2rq10"
|
13
27
|
},
|
14
28
|
"image": {
|
@@ -31,23 +45,35 @@ var useStyles = /*#__PURE__*/__styles({
|
|
31
45
|
"Bn3e79g": "f1con4nn"
|
32
46
|
}
|
33
47
|
}, {
|
34
|
-
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".
|
48
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".f1d2rq10{height:32px;}", ".f17fgpbq{min-width:24px;}", ".f1pha7fy{min-height:24px;}", ".f44c6la{max-width:32px;}", ".f17bzqcb{max-height:32px;}", ".fgn7ydb>*{min-width:inherit;}", ".f1jevvm1>*{min-height:inherit;}", ".fqihwjc>*{max-width:100%;}", ".f6x1sus>*{max-height:100%;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".fwk23hs{height:inherit;}", ".f1con4nn>*{height:50%;}"]
|
35
49
|
});
|
36
50
|
/**
|
37
51
|
* Apply styling to the CardHeader slots based on the state
|
38
52
|
*/
|
39
53
|
|
40
54
|
|
41
|
-
export
|
42
|
-
|
43
|
-
state.className = mergeClasses(styles.root, state.className);
|
55
|
+
export const useCardHeaderStyles_unstable = state => {
|
56
|
+
const styles = useStyles();
|
57
|
+
state.root.className = mergeClasses(cardHeaderClassNames.root, styles.root, state.root.className);
|
44
58
|
|
45
59
|
if (state.image) {
|
46
|
-
state.image.className = mergeClasses(styles.image, state.image.className);
|
60
|
+
state.image.className = mergeClasses(cardHeaderClassNames.image, styles.image, state.image.className);
|
47
61
|
}
|
48
62
|
|
49
63
|
if (state.content) {
|
50
|
-
state.content.className = mergeClasses(styles.textContainer, state.content.className);
|
64
|
+
state.content.className = mergeClasses(cardHeaderClassNames.content, styles.textContainer, state.content.className);
|
65
|
+
}
|
66
|
+
|
67
|
+
if (state.header) {
|
68
|
+
state.header.className = mergeClasses(cardHeaderClassNames.header, state.header.className);
|
69
|
+
}
|
70
|
+
|
71
|
+
if (state.description) {
|
72
|
+
state.description.className = mergeClasses(cardHeaderClassNames.description, state.description.className);
|
73
|
+
}
|
74
|
+
|
75
|
+
if (state.action) {
|
76
|
+
state.action.className = mergeClasses(cardHeaderClassNames.action, state.action.className);
|
51
77
|
}
|
52
78
|
|
53
79
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardHeader/useCardHeaderStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,gBAA5B;AACP,OAAO,MAAM,oBAAoB,GAAoC;AACnE,EAAA,IAAI,EAAE,gBAD6D;AAEnE,EAAA,KAAK,EAAE,uBAF4D;AAGnE,EAAA,OAAO,EAAE,yBAH0D;AAInE,EAAA,MAAM,EAAE,wBAJ2D;AAKnE,EAAA,WAAW,EAAE,6BALsD;AAMnE,EAAA,MAAM,EAAE;AAN2D,CAA9D;AASP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqCA;;AAEG;;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;AACtF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAoB,CAAC,IAAtB,EAA4B,MAAM,CAAC,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAnC;;AAEA,MAAI,KAAK,CAAC,KAAV,EAAiB;AACf,IAAA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,YAAY,CAAC,oBAAoB,CAAC,KAAtB,EAA6B,MAAM,CAAC,KAApC,EAA2C,KAAK,CAAC,KAAN,CAAY,SAAvD,CAApC;AACD;;AAED,MAAI,KAAK,CAAC,OAAV,EAAmB;AACjB,IAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CAAC,oBAAoB,CAAC,OAAtB,EAA+B,MAAM,CAAC,aAAtC,EAAqD,KAAK,CAAC,OAAN,CAAc,SAAnE,CAAtC;AACD;;AAED,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,IAAA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,oBAAoB,CAAC,MAAtB,EAA8B,KAAK,CAAC,MAAN,CAAa,SAA3C,CAArC;AACD;;AAED,MAAI,KAAK,CAAC,WAAV,EAAuB;AACrB,IAAA,KAAK,CAAC,WAAN,CAAkB,SAAlB,GAA8B,YAAY,CAAC,oBAAoB,CAAC,WAAtB,EAAmC,KAAK,CAAC,WAAN,CAAkB,SAArD,CAA1C;AACD;;AAED,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,IAAA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,oBAAoB,CAAC,MAAtB,EAA8B,KAAK,CAAC,MAAN,CAAa,SAA3C,CAArC;AACD;;AAED,SAAO,KAAP;AACD,CAzBM","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { CardHeaderSlots, CardHeaderState } from './CardHeader.types';\n\n/**\n * @deprecated Use `cardHeaderClassNames.root` instead.\n */\nexport const cardHeaderClassName = 'fui-CardHeader';\nexport const cardHeaderClassNames: SlotClassNames<CardHeaderSlots> = {\n root: 'fui-CardHeader',\n image: 'fui-CardHeader__image',\n content: 'fui-CardHeader__content',\n header: 'fui-CardHeader__header',\n description: 'fui-CardHeader__description',\n action: 'fui-CardHeader__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n ...shorthands.gap('12px'),\n height: '32px',\n },\n image: {\n minWidth: '24px',\n minHeight: '24px',\n maxWidth: '32px',\n maxHeight: '32px',\n\n display: 'flex',\n alignItems: 'center',\n\n '> *': {\n minWidth: 'inherit',\n minHeight: 'inherit',\n maxWidth: '100%',\n maxHeight: '100%',\n },\n },\n\n textContainer: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n height: 'inherit',\n\n '> *': {\n height: '50%',\n },\n },\n});\n\n/**\n * Apply styling to the CardHeader slots based on the state\n */\nexport const useCardHeaderStyles_unstable = (state: CardHeaderState): CardHeaderState => {\n const styles = useStyles();\n state.root.className = mergeClasses(cardHeaderClassNames.root, styles.root, state.root.className);\n\n if (state.image) {\n state.image.className = mergeClasses(cardHeaderClassNames.image, styles.image, state.image.className);\n }\n\n if (state.content) {\n state.content.className = mergeClasses(cardHeaderClassNames.content, styles.textContainer, state.content.className);\n }\n\n if (state.header) {\n state.header.className = mergeClasses(cardHeaderClassNames.header, state.header.className);\n }\n\n if (state.description) {\n state.description.className = mergeClasses(cardHeaderClassNames.description, state.description.className);\n }\n\n if (state.action) {\n state.action.className = mergeClasses(cardHeaderClassNames.action, state.action.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
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
|
*/
|
8
8
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
return
|
9
|
+
export const CardPreview = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useCardPreview_unstable(props, ref);
|
11
|
+
useCardPreviewStyles_unstable(state);
|
12
|
+
return renderCardPreview_unstable(state);
|
13
13
|
});
|
14
14
|
CardPreview.displayName = 'CardPreview';
|
15
15
|
//# sourceMappingURL=CardPreview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardPreview/CardPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AAIA;;AAEG;;AACH,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAChG,QAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,EAAQ,GAAR,CAArC;AAEA,EAAA,6BAA6B,CAAC,KAAD,CAA7B;AACA,SAAO,0BAA0B,CAAC,KAAD,CAAjC;AACD,CALiE,CAA3D;AAOP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { useCardPreview_unstable } from './useCardPreview';\nimport { renderCardPreview_unstable } from './renderCardPreview';\nimport { useCardPreviewStyles_unstable } from './useCardPreviewStyles';\nimport type { CardPreviewProps } from './CardPreview.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Component to render image previews of documents or articles in a Card component.\n */\nexport const CardPreview: ForwardRefComponent<CardPreviewProps> = React.forwardRef((props, ref) => {\n const state = useCardPreview_unstable(props, ref);\n\n useCardPreviewStyles_unstable(state);\n return renderCardPreview_unstable(state);\n});\n\nCardPreview.displayName = 'CardPreview';\n"],"sourceRoot":"../src/"}
|
@@ -1,28 +1,13 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
export declare type CardPreviewSlots = {
|
3
|
+
root: Slot<'div'>;
|
4
|
+
logo?: Slot<'div'>;
|
5
|
+
};
|
3
6
|
/**
|
4
|
-
* CardPreview
|
7
|
+
* CardPreview props
|
5
8
|
*/
|
6
|
-
export
|
7
|
-
/**
|
8
|
-
* Image slot
|
9
|
-
*/
|
10
|
-
logo?: ShorthandPropsCompat<React.ImgHTMLAttributes<HTMLImageElement>>;
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* Names of the shorthand properties in CardPreviewProps
|
14
|
-
*/
|
15
|
-
export declare type CardPreviewShorthandProps = 'logo';
|
16
|
-
/**
|
17
|
-
* Names of CardPreviewProps that have a default value in useCardPreview
|
18
|
-
*/
|
19
|
-
export declare type CardPreviewDefaultedProps = never;
|
9
|
+
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
20
10
|
/**
|
21
11
|
* State used in rendering CardPreview
|
22
12
|
*/
|
23
|
-
export
|
24
|
-
/**
|
25
|
-
* Ref to the root element
|
26
|
-
*/
|
27
|
-
ref: React.Ref<HTMLElement>;
|
28
|
-
}
|
13
|
+
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardPreview.types.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"CardPreview.types.js","sourceRoot":"../src/","sources":["components/CardPreview/CardPreview.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardPreviewSlots = {\n root: Slot<'div'>;\n logo?: Slot<'div'>;\n};\n\n/**\n * CardPreview props\n */\nexport type CardPreviewProps = ComponentProps<CardPreviewSlots>;\n\n/**\n * State used in rendering CardPreview\n */\nexport type CardPreviewState = ComponentState<CardPreviewSlots>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CardPreview/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './CardPreview';\nexport * from './CardPreview.types';\nexport * from './renderCardPreview';\nexport * from './useCardPreview';\nexport * from './useCardPreviewStyles';\n"]}
|
@@ -2,4 +2,4 @@ import type { CardPreviewState } from './CardPreview.types';
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of CardPreview
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
|
-
import {
|
4
|
-
import { cardPreviewShorthandPropsCompat } from './useCardPreview';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
5
3
|
/**
|
6
4
|
* Render the final JSX of CardPreview
|
7
5
|
*/
|
8
6
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
7
|
+
export const renderCardPreview_unstable = state => {
|
8
|
+
const {
|
9
|
+
slots,
|
10
|
+
slotProps
|
11
|
+
} = getSlots(state);
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
13
|
+
}, slotProps.root.children, slots.logo && /*#__PURE__*/React.createElement(slots.logo, { ...slotProps.logo
|
14
|
+
}));
|
15
15
|
};
|
16
16
|
//# sourceMappingURL=renderCardPreview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardPreview/renderCardPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;AACpE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAmB,KAAnB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardPreviewSlots, CardPreviewState } from './CardPreview.types';\n\n/**\n * Render the final JSX of CardPreview\n */\nexport const renderCardPreview_unstable = (state: CardPreviewState) => {\n const { slots, slotProps } = getSlots<CardPreviewSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slotProps.root.children}\n {slots.logo && <slots.logo {...slotProps.logo} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,17 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { CardPreviewProps,
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in CardPreviewShorthandProps
|
5
|
-
*/
|
6
|
-
export declare const cardPreviewShorthandPropsCompat: CardPreviewShorthandProps[];
|
2
|
+
import type { CardPreviewProps, CardPreviewState } from './CardPreview.types';
|
7
3
|
/**
|
8
4
|
* Create the state required to render CardPreview.
|
9
5
|
*
|
10
|
-
* The returned state can be modified with hooks such as
|
11
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
7
|
+
* before being passed to renderCardPreview_unstable.
|
12
8
|
*
|
13
9
|
* @param props - props from this instance of CardPreview
|
14
10
|
* @param ref - reference to root HTMLElement of CardPreview
|
15
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
16
11
|
*/
|
17
|
-
export declare const
|
12
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React.Ref<HTMLElement>) => CardPreviewState;
|
@@ -1,30 +1,28 @@
|
|
1
|
-
import {
|
2
|
-
/**
|
3
|
-
* Array of all shorthand properties listed in CardPreviewShorthandProps
|
4
|
-
*/
|
5
|
-
|
6
|
-
export var cardPreviewShorthandPropsCompat = ['logo'];
|
7
|
-
var mergeProps = /*#__PURE__*/makeMergeProps({
|
8
|
-
deepMerge: cardPreviewShorthandPropsCompat
|
9
|
-
});
|
1
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
10
2
|
/**
|
11
3
|
* Create the state required to render CardPreview.
|
12
4
|
*
|
13
|
-
* The returned state can be modified with hooks such as
|
14
|
-
* before being passed to
|
5
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
6
|
+
* before being passed to renderCardPreview_unstable.
|
15
7
|
*
|
16
8
|
* @param props - props from this instance of CardPreview
|
17
9
|
* @param ref - reference to root HTMLElement of CardPreview
|
18
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
19
10
|
*/
|
20
11
|
|
21
|
-
export
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
12
|
+
export const useCardPreview_unstable = (props, ref) => {
|
13
|
+
const {
|
14
|
+
logo
|
15
|
+
} = props;
|
16
|
+
return {
|
17
|
+
components: {
|
18
|
+
root: 'div',
|
19
|
+
logo: 'div'
|
20
|
+
},
|
21
|
+
root: getNativeElementProps('div', {
|
22
|
+
ref,
|
23
|
+
...props
|
24
|
+
}),
|
25
|
+
logo: resolveShorthand(logo)
|
26
|
+
};
|
29
27
|
};
|
30
28
|
//# sourceMappingURL=useCardPreview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardPreview/useCardPreview.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;AAChH,QAAM;AAAE,IAAA;AAAF,MAAW,KAAjB;AACA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KADP;AAML,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,SAAG;AAF8B,KAAR,CANtB;AAUL,IAAA,IAAI,EAAE,gBAAgB,CAAC,IAAD;AAVjB,GAAP;AAYD,CAdM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { CardPreviewProps, CardPreviewState } from './CardPreview.types';\n\n/**\n * Create the state required to render CardPreview.\n *\n * The returned state can be modified with hooks such as useCardPreviewStyles_unstable,\n * before being passed to renderCardPreview_unstable.\n *\n * @param props - props from this instance of CardPreview\n * @param ref - reference to root HTMLElement of CardPreview\n */\nexport const useCardPreview_unstable = (props: CardPreviewProps, ref: React.Ref<HTMLElement>): CardPreviewState => {\n const { logo } = props;\n return {\n components: {\n root: 'div',\n logo: 'div',\n },\n\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n logo: resolveShorthand(logo),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,11 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
+
import type { CardPreviewSlots, CardPreviewState } from './CardPreview.types';
|
3
|
+
/**
|
4
|
+
* @deprecated Use `cardPreviewClassNames.root` instead.
|
5
|
+
*/
|
6
|
+
export declare const cardPreviewClassName = "fui-CardPreview";
|
7
|
+
export declare const cardPreviewClassNames: SlotClassNames<CardPreviewSlots>;
|
2
8
|
/**
|
3
9
|
* Apply styling to the CardPreview slots based on the state
|
4
10
|
*/
|
5
|
-
export declare const
|
11
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
@@ -1,15 +1,20 @@
|
|
1
|
-
import { __styles, mergeClasses } from '@
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
2
|
+
/**
|
3
|
+
* @deprecated Use `cardPreviewClassNames.root` instead.
|
4
|
+
*/
|
5
|
+
|
6
|
+
export const cardPreviewClassName = 'fui-CardPreview';
|
7
|
+
export const cardPreviewClassNames = {
|
8
|
+
root: 'fui-CardPreview',
|
9
|
+
logo: 'fui-CardPreview__logo'
|
10
|
+
};
|
2
11
|
/**
|
3
12
|
* Styles for the root slot
|
4
13
|
*/
|
5
14
|
|
6
|
-
|
15
|
+
const useStyles = /*#__PURE__*/__styles({
|
7
16
|
"root": {
|
8
17
|
"qhf8xq": "f10pi13n",
|
9
|
-
"B6of3ja": "f1hu3pq6",
|
10
|
-
"t21cq0": ["f8nhgx1", "f16yxz7i"],
|
11
|
-
"jrapky": "f19f4twv",
|
12
|
-
"Frg6f3": ["f16yxz7i", "f8nhgx1"],
|
13
18
|
"Bb0eobv": "floiv14",
|
14
19
|
"m1g0b5": "f1r7p6p5"
|
15
20
|
},
|
@@ -21,19 +26,19 @@ var useStyles = /*#__PURE__*/__styles({
|
|
21
26
|
"Bqenvij": "f1d2rq10"
|
22
27
|
}
|
23
28
|
}, {
|
24
|
-
"d": [".f10pi13n{position:relative;}", ".
|
29
|
+
"d": [".f10pi13n{position:relative;}", ".floiv14>*{display:block;}", ".f1r7p6p5>*{width:100%;}", ".f1euv43f{position:absolute;}", ".f1gcvs1y{bottom:12px;}", ".f1t6tvco{left:12px;}", ".ffrfxm3{right:12px;}", ".f1szoe96{width:32px;}", ".f1d2rq10{height:32px;}"]
|
25
30
|
});
|
26
31
|
/**
|
27
32
|
* Apply styling to the CardPreview slots based on the state
|
28
33
|
*/
|
29
34
|
|
30
35
|
|
31
|
-
export
|
32
|
-
|
33
|
-
state.className = mergeClasses(
|
36
|
+
export const useCardPreviewStyles_unstable = state => {
|
37
|
+
const styles = useStyles();
|
38
|
+
state.root.className = mergeClasses(cardPreviewClassNames.root, styles.root, state.root.className);
|
34
39
|
|
35
40
|
if (state.logo) {
|
36
|
-
state.logo.className = mergeClasses(styles.logo, state.logo.className);
|
41
|
+
state.logo.className = mergeClasses(cardPreviewClassNames.logo, styles.logo, state.logo.className);
|
37
42
|
}
|
38
43
|
|
39
44
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardPreview/useCardPreviewStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,QAAyC,gBAAzC;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAG,iBAA7B;AACP,OAAO,MAAM,qBAAqB,GAAqC;AACrE,EAAA,IAAI,EAAE,iBAD+D;AAErE,EAAA,IAAI,EAAE;AAF+D,CAAhE;AAKP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAmBA;;AAEG;;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;AACzF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,qBAAqB,CAAC,IAAvB,EAA6B,MAAM,CAAC,IAApC,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAnC;;AAEA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,qBAAqB,CAAC,IAAvB,EAA6B,MAAM,CAAC,IAApC,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAnC;AACD;;AAED,SAAO,KAAP;AACD,CATM","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { CardPreviewSlots, CardPreviewState } from './CardPreview.types';\n\n/**\n * @deprecated Use `cardPreviewClassNames.root` instead.\n */\nexport const cardPreviewClassName = 'fui-CardPreview';\nexport const cardPreviewClassNames: SlotClassNames<CardPreviewSlots> = {\n root: 'fui-CardPreview',\n logo: 'fui-CardPreview__logo',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n\n '> *': {\n display: 'block',\n width: '100%',\n },\n },\n\n logo: {\n position: 'absolute',\n bottom: '12px',\n left: '12px',\n width: '32px',\n height: '32px',\n },\n});\n\n/**\n * Apply styling to the CardPreview slots based on the state\n */\nexport const useCardPreviewStyles_unstable = (state: CardPreviewState): CardPreviewState => {\n const styles = useStyles();\n state.root.className = mergeClasses(cardPreviewClassNames.root, styles.root, state.root.className);\n\n if (state.logo) {\n state.logo.className = mergeClasses(cardPreviewClassNames.logo, styles.logo, state.logo.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export { Card, cardClassName, cardClassNames, renderCard_unstable, useCardStyles_unstable, useCard_unstable, } from './Card';
|
2
|
+
export type { CardCommons, CardProps, CardSlots, CardState } from './Card';
|
3
|
+
export { CardFooter, cardFooterClassName, cardFooterClassNames, renderCardFooter_unstable, useCardFooterStyles_unstable, useCardFooter_unstable, } from './CardFooter';
|
4
|
+
export type { CardFooterProps, CardFooterSlots, CardFooterState } from './CardFooter';
|
5
|
+
export { CardHeader, cardHeaderClassName, cardHeaderClassNames, renderCardHeader_unstable, useCardHeaderStyles_unstable, useCardHeader_unstable, } from './CardHeader';
|
6
|
+
export type { CardHeaderProps, CardHeaderSlots, CardHeaderState } from './CardHeader';
|
7
|
+
export { CardPreview, cardPreviewClassName, cardPreviewClassNames, renderCardPreview_unstable, useCardPreviewStyles_unstable, useCardPreview_unstable, } from './CardPreview';
|
8
|
+
export type { CardPreviewProps, CardPreviewSlots, CardPreviewState } from './CardPreview';
|
package/lib/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
/* eslint-disable deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851*/
|
2
|
+
export { Card, cardClassName, cardClassNames, renderCard_unstable, useCardStyles_unstable, useCard_unstable } from './Card';
|
3
|
+
export { CardFooter, cardFooterClassName, cardFooterClassNames, renderCardFooter_unstable, useCardFooterStyles_unstable, useCardFooter_unstable } from './CardFooter';
|
4
|
+
export { CardHeader, cardHeaderClassName, cardHeaderClassNames, renderCardHeader_unstable, useCardHeaderStyles_unstable, useCardHeader_unstable } from './CardHeader';
|
5
|
+
export { CardPreview, cardPreviewClassName, cardPreviewClassNames, renderCardPreview_unstable, useCardPreviewStyles_unstable, useCardPreview_unstable } from './CardPreview';
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA;AAEA,SACE,IADF,EAEE,aAFF,EAGE,cAHF,EAIE,mBAJF,EAKE,sBALF,EAME,gBANF,QAOO,QAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,WADF,EAEE,oBAFF,EAGE,qBAHF,EAIE,0BAJF,EAKE,6BALF,EAME,uBANF,QAOO,eAPP","sourcesContent":["/* eslint-disable deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851*/\n\nexport {\n Card,\n cardClassName,\n cardClassNames,\n renderCard_unstable,\n useCardStyles_unstable,\n useCard_unstable,\n} from './Card';\nexport type { CardCommons, CardProps, CardSlots, CardState } from './Card';\nexport {\n CardFooter,\n cardFooterClassName,\n cardFooterClassNames,\n renderCardFooter_unstable,\n useCardFooterStyles_unstable,\n useCardFooter_unstable,\n} from './CardFooter';\nexport type { CardFooterProps, CardFooterSlots, CardFooterState } from './CardFooter';\nexport {\n CardHeader,\n cardHeaderClassName,\n cardHeaderClassNames,\n renderCardHeader_unstable,\n useCardHeaderStyles_unstable,\n useCardHeader_unstable,\n} from './CardHeader';\nexport type { CardHeaderProps, CardHeaderSlots, CardHeaderState } from './CardHeader';\nexport {\n CardPreview,\n cardPreviewClassName,\n cardPreviewClassNames,\n renderCardPreview_unstable,\n useCardPreviewStyles_unstable,\n useCardPreview_unstable,\n} from './CardPreview';\nexport type { CardPreviewProps, CardPreviewSlots, CardPreviewState } from './CardPreview';\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/Card.js
CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/Card/index"), exports);
|
10
10
|
//# sourceMappingURL=Card.js.map
|
package/lib-commonjs/Card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["Card.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Card/index';\n"],"sourceRoot":"../src/"}
|