@fluentui/react-card 0.0.0-nightly-20220302-0405.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/CHANGELOG.json +1477 -0
- package/CHANGELOG.md +463 -0
- package/LICENSE +15 -0
- package/README.md +13 -0
- 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/ai_deck_template.png +0 -0
- package/assets/avatar_elvia.svg +9 -0
- package/assets/avatar_mauricio.svg +9 -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/doc_template.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/powerpoint_logo.svg +9 -0
- package/assets/sales_template.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/assets/word_logo.svg +9 -0
- package/dist/react-card.d.ts +186 -0
- package/lib/Card.d.ts +1 -0
- package/lib/Card.js +2 -0
- package/lib/Card.js.map +1 -0
- package/lib/CardFooter.d.ts +1 -0
- package/lib/CardFooter.js +2 -0
- package/lib/CardFooter.js.map +1 -0
- package/lib/CardHeader.d.ts +1 -0
- package/lib/CardHeader.js +2 -0
- package/lib/CardHeader.js.map +1 -0
- package/lib/CardPreview.d.ts +1 -0
- package/lib/CardPreview.js +2 -0
- package/lib/CardPreview.js.map +1 -0
- package/lib/components/Card/Card.d.ts +6 -0
- package/lib/components/Card/Card.js +15 -0
- package/lib/components/Card/Card.js.map +1 -0
- package/lib/components/Card/Card.types.d.ts +15 -0
- package/lib/components/Card/Card.types.js +2 -0
- package/lib/components/Card/Card.types.js.map +1 -0
- package/lib/components/Card/index.d.ts +5 -0
- package/lib/components/Card/index.js +6 -0
- package/lib/components/Card/index.js.map +1 -0
- package/lib/components/Card/renderCard.d.ts +5 -0
- package/lib/components/Card/renderCard.js +15 -0
- package/lib/components/Card/renderCard.js.map +1 -0
- package/lib/components/Card/useCard.d.ts +12 -0
- package/lib/components/Card/useCard.js +33 -0
- package/lib/components/Card/useCard.js.map +1 -0
- package/lib/components/Card/useCardStyles.d.ts +6 -0
- package/lib/components/Card/useCardStyles.js +150 -0
- package/lib/components/Card/useCardStyles.js.map +1 -0
- package/lib/components/CardFooter/CardFooter.d.ts +6 -0
- package/lib/components/CardFooter/CardFooter.js +15 -0
- package/lib/components/CardFooter/CardFooter.js.map +1 -0
- package/lib/components/CardFooter/CardFooter.types.d.ts +13 -0
- package/lib/components/CardFooter/CardFooter.types.js +2 -0
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -0
- package/lib/components/CardFooter/index.d.ts +5 -0
- package/lib/components/CardFooter/index.js +6 -0
- package/lib/components/CardFooter/index.js.map +1 -0
- package/lib/components/CardFooter/renderCardFooter.d.ts +5 -0
- package/lib/components/CardFooter/renderCardFooter.js +16 -0
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -0
- package/lib/components/CardFooter/useCardFooter.d.ts +12 -0
- package/lib/components/CardFooter/useCardFooter.js +28 -0
- package/lib/components/CardFooter/useCardFooter.js.map +1 -0
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +6 -0
- package/lib/components/CardFooter/useCardFooterStyles.js +35 -0
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -0
- package/lib/components/CardHeader/CardHeader.d.ts +6 -0
- package/lib/components/CardHeader/CardHeader.js +15 -0
- package/lib/components/CardHeader/CardHeader.js.map +1 -0
- package/lib/components/CardHeader/CardHeader.types.d.ts +17 -0
- package/lib/components/CardHeader/CardHeader.types.js +2 -0
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -0
- package/lib/components/CardHeader/index.d.ts +5 -0
- package/lib/components/CardHeader/index.js +6 -0
- package/lib/components/CardHeader/index.js.map +1 -0
- package/lib/components/CardHeader/renderCardHeader.d.ts +5 -0
- package/lib/components/CardHeader/renderCardHeader.js +20 -0
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -0
- package/lib/components/CardHeader/useCardHeader.d.ts +12 -0
- package/lib/components/CardHeader/useCardHeader.js +47 -0
- package/lib/components/CardHeader/useCardHeader.js.map +1 -0
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +6 -0
- package/lib/components/CardHeader/useCardHeaderStyles.js +57 -0
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -0
- package/lib/components/CardPreview/CardPreview.d.ts +6 -0
- package/lib/components/CardPreview/CardPreview.js +15 -0
- package/lib/components/CardPreview/CardPreview.js.map +1 -0
- package/lib/components/CardPreview/CardPreview.types.d.ts +13 -0
- package/lib/components/CardPreview/CardPreview.types.js +2 -0
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -0
- package/lib/components/CardPreview/index.d.ts +5 -0
- package/lib/components/CardPreview/index.js +6 -0
- package/lib/components/CardPreview/index.js.map +1 -0
- package/lib/components/CardPreview/renderCardPreview.d.ts +5 -0
- package/lib/components/CardPreview/renderCardPreview.js +16 -0
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -0
- package/lib/components/CardPreview/useCardPreview.d.ts +12 -0
- package/lib/components/CardPreview/useCardPreview.js +28 -0
- package/lib/components/CardPreview/useCardPreview.js.map +1 -0
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +6 -0
- package/lib/components/CardPreview/useCardPreviewStyles.js +38 -0
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/tsdoc-metadata.json +11 -0
- package/lib-commonjs/Card.d.ts +1 -0
- package/lib-commonjs/Card.js +10 -0
- package/lib-commonjs/Card.js.map +1 -0
- package/lib-commonjs/CardFooter.d.ts +1 -0
- package/lib-commonjs/CardFooter.js +10 -0
- package/lib-commonjs/CardFooter.js.map +1 -0
- package/lib-commonjs/CardHeader.d.ts +1 -0
- package/lib-commonjs/CardHeader.js +10 -0
- package/lib-commonjs/CardHeader.js.map +1 -0
- package/lib-commonjs/CardPreview.d.ts +1 -0
- package/lib-commonjs/CardPreview.js +10 -0
- package/lib-commonjs/CardPreview.js.map +1 -0
- package/lib-commonjs/components/Card/Card.d.ts +6 -0
- package/lib-commonjs/components/Card/Card.js +26 -0
- package/lib-commonjs/components/Card/Card.js.map +1 -0
- package/lib-commonjs/components/Card/Card.types.d.ts +15 -0
- package/lib-commonjs/components/Card/Card.types.js +6 -0
- package/lib-commonjs/components/Card/Card.types.js.map +1 -0
- package/lib-commonjs/components/Card/index.d.ts +5 -0
- package/lib-commonjs/components/Card/index.js +18 -0
- package/lib-commonjs/components/Card/index.js.map +1 -0
- package/lib-commonjs/components/Card/renderCard.d.ts +5 -0
- package/lib-commonjs/components/Card/renderCard.js +26 -0
- package/lib-commonjs/components/Card/renderCard.js.map +1 -0
- package/lib-commonjs/components/Card/useCard.d.ts +12 -0
- package/lib-commonjs/components/Card/useCard.js +44 -0
- package/lib-commonjs/components/Card/useCard.js.map +1 -0
- package/lib-commonjs/components/Card/useCardStyles.d.ts +6 -0
- package/lib-commonjs/components/Card/useCardStyles.js +162 -0
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -0
- package/lib-commonjs/components/CardFooter/CardFooter.d.ts +6 -0
- package/lib-commonjs/components/CardFooter/CardFooter.js +26 -0
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -0
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +13 -0
- package/lib-commonjs/components/CardFooter/CardFooter.types.js +6 -0
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -0
- package/lib-commonjs/components/CardFooter/index.d.ts +5 -0
- package/lib-commonjs/components/CardFooter/index.js +18 -0
- package/lib-commonjs/components/CardFooter/index.js.map +1 -0
- package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +5 -0
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +27 -0
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -0
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +12 -0
- package/lib-commonjs/components/CardFooter/useCardFooter.js +38 -0
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -0
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +6 -0
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +45 -0
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -0
- package/lib-commonjs/components/CardHeader/CardHeader.d.ts +6 -0
- package/lib-commonjs/components/CardHeader/CardHeader.js +26 -0
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -0
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +17 -0
- package/lib-commonjs/components/CardHeader/CardHeader.types.js +6 -0
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -0
- package/lib-commonjs/components/CardHeader/index.d.ts +5 -0
- package/lib-commonjs/components/CardHeader/index.js +18 -0
- package/lib-commonjs/components/CardHeader/index.js.map +1 -0
- package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +5 -0
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +31 -0
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -0
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +12 -0
- package/lib-commonjs/components/CardHeader/useCardHeader.js +58 -0
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -0
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +6 -0
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +67 -0
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -0
- package/lib-commonjs/components/CardPreview/CardPreview.d.ts +6 -0
- package/lib-commonjs/components/CardPreview/CardPreview.js +26 -0
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -0
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +13 -0
- package/lib-commonjs/components/CardPreview/CardPreview.types.js +6 -0
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -0
- package/lib-commonjs/components/CardPreview/index.d.ts +5 -0
- package/lib-commonjs/components/CardPreview/index.js +18 -0
- package/lib-commonjs/components/CardPreview/index.js.map +1 -0
- package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +5 -0
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +27 -0
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -0
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +12 -0
- package/lib-commonjs/components/CardPreview/useCardPreview.js +38 -0
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -0
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +6 -0
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +48 -0
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -0
- package/lib-commonjs/index.d.ts +4 -0
- package/lib-commonjs/index.js +16 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +67 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/Card/useCardStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,oBAAT,QAAqC,sBAArC;AAGA,OAAO,MAAM,aAAa,GAAG,UAAtB;AAEP;;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;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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoGA;;AAEG;;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;AACpE,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,QAAM,WAAW,GACf,KAAK,CAAC,IAAN,CAAW,OAAX,IACA,KAAK,CAAC,IAAN,CAAW,SADX,IAEA,KAAK,CAAC,IAAN,CAAW,WAFX,IAGA,KAAK,CAAC,IAAN,CAAW,WAHX,IAIA,KAAK,CAAC,IAAN,CAAW,aAJX,IAKA,KAAK,CAAC,IAAN,CAAW,YALX,IAMA,KAAK,CAAC,IAAN,CAAW,UAPb;AASA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,aADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,UAAN,KAAqB,QAArB,IAAiC,MAAM,CAAC,MAHP,EAIjC,KAAK,CAAC,UAAN,KAAqB,oBAArB,IAA6C,MAAM,CAAC,iBAJnB,EAKjC,KAAK,CAAC,UAAN,KAAqB,SAArB,IAAkC,MAAM,CAAC,OALR,EAMjC,KAAK,CAAC,UAAN,KAAqB,QAArB,IAAiC,MAAM,CAAC,MANP,EAOjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,QAApC,IAAgD,MAAM,CAAC,iBAPtB,EAQjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,oBAApC,IAA4D,MAAM,CAAC,4BARlC,EASjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,SAApC,IAAiD,MAAM,CAAC,kBATvB,EAUjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,QAApC,IAAgD,MAAM,CAAC,iBAVtB,EAWjC,KAAK,CAAC,IAAN,CAAW,SAXsB,CAAnC;AAcA,SAAO,KAAP;AACD,CA3BM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { cardPreviewClassName } from '../CardPreview/index';\nimport type { CardState } from './Card.types';\n\nexport const cardClassName = 'fui-Card';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'block',\n ...shorthands.overflow('hidden'),\n\n color: tokens.colorNeutralForeground1,\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n // Size: medium\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n [`> *:not(.${cardPreviewClassName})`]: {\n // Size: medium\n ...shorthands.margin('12px'),\n },\n },\n\n filledInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n filled: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n },\n filledAlternativeInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Hover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground2Pressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n },\n outlineInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n boxShadow: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n boxShadow: 'none',\n },\n subtleInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: 'none',\n },\n});\n\n/**\n * Apply styling to the Card slots based on the state\n */\nexport const useCardStyles_unstable = (state: CardState): CardState => {\n const styles = useStyles();\n\n const interactive =\n state.root.onClick ||\n state.root.onMouseUp ||\n state.root.onMouseDown ||\n state.root.onPointerUp ||\n state.root.onPointerDown ||\n state.root.onTouchStart ||\n state.root.onTouchEnd;\n\n state.root.className = mergeClasses(\n cardClassName,\n styles.root,\n state.appearance === 'filled' && styles.filled,\n state.appearance === 'filled-alternative' && styles.filledAlternative,\n state.appearance === 'outline' && styles.outline,\n state.appearance === 'subtle' && styles.subtle,\n interactive && state.appearance === 'filled' && styles.filledInteractive,\n interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive,\n interactive && state.appearance === 'outline' && styles.outlineInteractive,\n interactive && state.appearance === 'subtle' && styles.subtleInteractive,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CardFooterProps } from './CardFooter.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Component to render Button actions in a Card component.
|
5
|
+
*/
|
6
|
+
export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCardFooter_unstable } from './useCardFooter';
|
3
|
+
import { renderCardFooter_unstable } from './renderCardFooter';
|
4
|
+
import { useCardFooterStyles_unstable } from './useCardFooterStyles';
|
5
|
+
/**
|
6
|
+
* Component to render Button actions in a Card component.
|
7
|
+
*/
|
8
|
+
|
9
|
+
export const CardFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useCardFooter_unstable(props, ref);
|
11
|
+
useCardFooterStyles_unstable(state);
|
12
|
+
return renderCardFooter_unstable(state);
|
13
|
+
});
|
14
|
+
CardFooter.displayName = 'CardFooter';
|
15
|
+
//# sourceMappingURL=CardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardFooter/CardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AACA,SAAO,yBAAyB,CAAC,KAAD,CAAhC;AACD,CAL+D,CAAzD;AAOP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useCardFooter_unstable } from './useCardFooter';\nimport { renderCardFooter_unstable } from './renderCardFooter';\nimport { useCardFooterStyles_unstable } from './useCardFooterStyles';\nimport type { CardFooterProps } from './CardFooter.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Component to render Button actions in a Card component.\n */\nexport const CardFooter: ForwardRefComponent<CardFooterProps> = React.forwardRef((props, ref) => {\n const state = useCardFooter_unstable(props, ref);\n\n useCardFooterStyles_unstable(state);\n return renderCardFooter_unstable(state);\n});\n\nCardFooter.displayName = 'CardFooter';\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
export declare type CardFooterSlots = {
|
3
|
+
root: Slot<'div'>;
|
4
|
+
action?: Slot<'div'>;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* CardFooter props
|
8
|
+
*/
|
9
|
+
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
10
|
+
/**
|
11
|
+
* State used in rendering CardFooter
|
12
|
+
*/
|
13
|
+
export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardFooter.types.js","sourceRoot":"../src/","sources":["components/CardFooter/CardFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardFooterSlots = {\n root: Slot<'div'>;\n action?: Slot<'div'>;\n};\n\n/**\n * CardFooter props\n */\nexport type CardFooterProps = ComponentProps<CardFooterSlots>;\n\n/**\n * State used in rendering CardFooter\n */\nexport type CardFooterState = ComponentState<CardFooterSlots>;\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CardFooter/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './CardFooter';\nexport * from './CardFooter.types';\nexport * from './renderCardFooter';\nexport * from './useCardFooter';\nexport * from './useCardFooterStyles';\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Render the final JSX of CardFooter
|
5
|
+
*/
|
6
|
+
|
7
|
+
export const renderCardFooter_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.action && /*#__PURE__*/React.createElement(slots.action, { ...slotProps.action
|
14
|
+
}));
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=renderCardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardFooter/renderCardFooter.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,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;AAAf,GAAb,CAFnB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardFooterSlots, CardFooterState } from './CardFooter.types';\n\n/**\n * Render the final JSX of CardFooter\n */\nexport const renderCardFooter_unstable = (state: CardFooterState) => {\n const { slots, slotProps } = getSlots<CardFooterSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slotProps.root.children}\n {slots.action && <slots.action {...slotProps.action} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { CardFooterProps, CardFooterState } from './CardFooter.types';
|
3
|
+
/**
|
4
|
+
* Create the state required to render CardFooter.
|
5
|
+
*
|
6
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
7
|
+
* before being passed to renderCardFooter_unstable.
|
8
|
+
*
|
9
|
+
* @param props - props from this instance of CardFooter
|
10
|
+
* @param ref - reference to root HTMLElement of CardFooter
|
11
|
+
*/
|
12
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React.Ref<HTMLElement>) => CardFooterState;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
2
|
+
/**
|
3
|
+
* Create the state required to render CardFooter.
|
4
|
+
*
|
5
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
6
|
+
* before being passed to renderCardFooter_unstable.
|
7
|
+
*
|
8
|
+
* @param props - props from this instance of CardFooter
|
9
|
+
* @param ref - reference to root HTMLElement of CardFooter
|
10
|
+
*/
|
11
|
+
|
12
|
+
export const useCardFooter_unstable = (props, ref) => {
|
13
|
+
const {
|
14
|
+
action
|
15
|
+
} = props;
|
16
|
+
return {
|
17
|
+
components: {
|
18
|
+
root: 'div',
|
19
|
+
action: 'div'
|
20
|
+
},
|
21
|
+
root: getNativeElementProps('div', {
|
22
|
+
ref,
|
23
|
+
...props
|
24
|
+
}),
|
25
|
+
action: resolveShorthand(action)
|
26
|
+
};
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=useCardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardFooter/useCardFooter.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;AAAF,MAAa,KAAnB;AAEA,SAAO;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,MAAM,EAAE;AAFE,KADP;AAML,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,SAAG;AAF8B,KAAR,CANtB;AAUL,IAAA,MAAM,EAAE,gBAAgB,CAAC,MAAD;AAVnB,GAAP;AAYD,CAfM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { CardFooterProps, CardFooterState } from './CardFooter.types';\n\n/**\n * Create the state required to render CardFooter.\n *\n * The returned state can be modified with hooks such as useCardFooterStyles_unstable,\n * before being passed to renderCardFooter_unstable.\n *\n * @param props - props from this instance of CardFooter\n * @param ref - reference to root HTMLElement of CardFooter\n */\nexport const useCardFooter_unstable = (props: CardFooterProps, ref: React.Ref<HTMLElement>): CardFooterState => {\n const { action } = props;\n\n return {\n components: {\n root: 'div',\n action: 'div',\n },\n\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n action: resolveShorthand(action),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CardFooterState } from './CardFooter.types';
|
2
|
+
export declare const cardFooterClassName = "fui-CardFooter";
|
3
|
+
/**
|
4
|
+
* Apply styling to the CardFooter slots based on the state
|
5
|
+
*/
|
6
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
|
+
export const cardFooterClassName = 'fui-CardFooter';
|
3
|
+
/**
|
4
|
+
* Styles for the root slot
|
5
|
+
*/
|
6
|
+
|
7
|
+
const useStyles = /*#__PURE__*/__styles({
|
8
|
+
"root": {
|
9
|
+
"mc9l5x": "f22iagw",
|
10
|
+
"Beiy3e4": "f1063pyq",
|
11
|
+
"i8kkvl": "f4akndk",
|
12
|
+
"Belr9w4": "fe5j3v"
|
13
|
+
},
|
14
|
+
"action": {
|
15
|
+
"Frg6f3": ["fcgxt0o", "f1ujusj6"]
|
16
|
+
}
|
17
|
+
}, {
|
18
|
+
"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;}", ".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}"]
|
19
|
+
});
|
20
|
+
/**
|
21
|
+
* Apply styling to the CardFooter slots based on the state
|
22
|
+
*/
|
23
|
+
|
24
|
+
|
25
|
+
export const useCardFooterStyles_unstable = state => {
|
26
|
+
const styles = useStyles();
|
27
|
+
state.root.className = mergeClasses(cardFooterClassName, styles.root, state.root.className);
|
28
|
+
|
29
|
+
if (state.action) {
|
30
|
+
state.action.className = mergeClasses(styles.action, state.action.className);
|
31
|
+
}
|
32
|
+
|
33
|
+
return state;
|
34
|
+
};
|
35
|
+
//# sourceMappingURL=useCardFooterStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardFooter/useCardFooterStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,mBAAmB,GAAG,gBAA5B;AAEP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;AAEG;;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;AACtF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,mBAAD,EAAsB,MAAM,CAAC,IAA7B,EAAmC,KAAK,CAAC,IAAN,CAAW,SAA9C,CAAnC;;AAEA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,IAAA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,MAAM,CAAC,MAAR,EAAgB,KAAK,CAAC,MAAN,CAAa,SAA7B,CAArC;AACD;;AAED,SAAO,KAAP;AACD,CATM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { CardFooterState } from './CardFooter.types';\n\nexport const cardFooterClassName = 'fui-CardFooter';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'row',\n ...shorthands.gap('12px'),\n },\n action: {\n marginLeft: 'auto',\n },\n});\n\n/**\n * Apply styling to the CardFooter slots based on the state\n */\nexport const useCardFooterStyles_unstable = (state: CardFooterState): CardFooterState => {\n const styles = useStyles();\n state.root.className = mergeClasses(cardFooterClassName, styles.root, state.root.className);\n\n if (state.action) {\n state.action.className = mergeClasses(styles.action, state.action.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CardHeaderProps } from './CardHeader.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Component to render an image, text and an action in a Card component.
|
5
|
+
*/
|
6
|
+
export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
|
@@ -0,0 +1,15 @@
|
|
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
|
+
/**
|
6
|
+
* Component to render an image, text and an action in a Card component.
|
7
|
+
*/
|
8
|
+
|
9
|
+
export const CardHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useCardHeader_unstable(props, ref);
|
11
|
+
useCardHeaderStyles_unstable(state);
|
12
|
+
return renderCardHeader_unstable(state);
|
13
|
+
});
|
14
|
+
CardHeader.displayName = 'CardHeader';
|
15
|
+
//# sourceMappingURL=CardHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardHeader/CardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AACA,SAAO,yBAAyB,CAAC,KAAD,CAAhC;AACD,CAL+D,CAAzD;AAOP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useCardHeader_unstable } from './useCardHeader';\nimport { renderCardHeader_unstable } from './renderCardHeader';\nimport { useCardHeaderStyles_unstable } from './useCardHeaderStyles';\nimport type { CardHeaderProps } from './CardHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Component to render an image, text and an action in a Card component.\n */\nexport const CardHeader: ForwardRefComponent<CardHeaderProps> = React.forwardRef((props, ref) => {\n const state = useCardHeader_unstable(props, ref);\n\n useCardHeaderStyles_unstable(state);\n return renderCardHeader_unstable(state);\n});\n\nCardHeader.displayName = 'CardHeader';\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
export declare type CardHeaderSlots = {
|
3
|
+
root: Slot<'div'>;
|
4
|
+
image: Slot<'div'>;
|
5
|
+
content?: Slot<'div'>;
|
6
|
+
header: Slot<'span'>;
|
7
|
+
description: Slot<'span'>;
|
8
|
+
action?: Slot<'div'>;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* CardHeader props
|
12
|
+
*/
|
13
|
+
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
14
|
+
/**
|
15
|
+
* State used in rendering CardHeader
|
16
|
+
*/
|
17
|
+
export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardHeader.types.js","sourceRoot":"../src/","sources":["components/CardHeader/CardHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardHeaderSlots = {\n root: Slot<'div'>;\n image: Slot<'div'>;\n content?: Slot<'div'>;\n header: Slot<'span'>;\n description: Slot<'span'>;\n action?: Slot<'div'>;\n};\n\n/**\n * CardHeader props\n */\nexport type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;\n\n/**\n * State used in rendering CardHeader\n */\nexport type CardHeaderState = ComponentState<CardHeaderSlots>;\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CardHeader/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './CardHeader';\nexport * from './CardHeader.types';\nexport * from './renderCardHeader';\nexport * from './useCardHeader';\nexport * from './useCardHeaderStyles';\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Render the final JSX of CardHeader
|
5
|
+
*/
|
6
|
+
|
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
|
+
}));
|
19
|
+
};
|
20
|
+
//# sourceMappingURL=renderCardHeader.js.map
|
@@ -0,0 +1 @@
|
|
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/"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { CardHeaderProps, CardHeaderState } from './CardHeader.types';
|
3
|
+
/**
|
4
|
+
* Create the state required to render CardHeader.
|
5
|
+
*
|
6
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
7
|
+
* before being passed to renderCardHeader_unstable.
|
8
|
+
*
|
9
|
+
* @param props - props from this instance of CardHeader
|
10
|
+
* @param ref - reference to root HTMLElement of CardHeader
|
11
|
+
*/
|
12
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React.Ref<HTMLElement>) => CardHeaderState;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Create the state required to render CardHeader.
|
5
|
+
*
|
6
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
7
|
+
* before being passed to renderCardHeader_unstable.
|
8
|
+
*
|
9
|
+
* @param props - props from this instance of CardHeader
|
10
|
+
* @param ref - reference to root HTMLElement of CardHeader
|
11
|
+
*/
|
12
|
+
|
13
|
+
export const useCardHeader_unstable = (props, ref) => {
|
14
|
+
const {
|
15
|
+
image,
|
16
|
+
content,
|
17
|
+
header,
|
18
|
+
description,
|
19
|
+
action
|
20
|
+
} = props;
|
21
|
+
return {
|
22
|
+
components: {
|
23
|
+
root: 'div',
|
24
|
+
image: 'div',
|
25
|
+
content: 'div',
|
26
|
+
header: React.Fragment,
|
27
|
+
description: React.Fragment,
|
28
|
+
action: 'div'
|
29
|
+
},
|
30
|
+
root: getNativeElementProps('div', {
|
31
|
+
ref,
|
32
|
+
...props
|
33
|
+
}),
|
34
|
+
image: resolveShorthand(image, {
|
35
|
+
required: true
|
36
|
+
}),
|
37
|
+
content: resolveShorthand(content || {}),
|
38
|
+
header: resolveShorthand(header, {
|
39
|
+
required: true
|
40
|
+
}),
|
41
|
+
description: resolveShorthand(description, {
|
42
|
+
required: true
|
43
|
+
}),
|
44
|
+
action: resolveShorthand(action)
|
45
|
+
};
|
46
|
+
};
|
47
|
+
//# sourceMappingURL=useCardHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardHeader/useCardHeader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;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,KAAK,CAAC,QAJJ;AAKV,MAAA,WAAW,EAAE,KAAK,CAAC,QALT;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: React.Fragment,\n description: React.Fragment,\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/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CardHeaderState } from './CardHeader.types';
|
2
|
+
export declare const cardHeaderClassName = "fui-CardHeader";
|
3
|
+
/**
|
4
|
+
* Apply styling to the CardHeader slots based on the state
|
5
|
+
*/
|
6
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
|
+
export const cardHeaderClassName = 'fui-CardHeader';
|
3
|
+
/**
|
4
|
+
* Styles for the root slot
|
5
|
+
*/
|
6
|
+
|
7
|
+
const useStyles = /*#__PURE__*/__styles({
|
8
|
+
"root": {
|
9
|
+
"mc9l5x": "f22iagw",
|
10
|
+
"Beiy3e4": "f1063pyq",
|
11
|
+
"Bt984gj": "f122n59",
|
12
|
+
"i8kkvl": "f4akndk",
|
13
|
+
"Belr9w4": "fe5j3v",
|
14
|
+
"Bqenvij": "f1d2rq10"
|
15
|
+
},
|
16
|
+
"image": {
|
17
|
+
"Bf4jedk": "f17fgpbq",
|
18
|
+
"sshi5w": "f1pha7fy",
|
19
|
+
"B2u0y6b": "f44c6la",
|
20
|
+
"Bxyxcbc": "f17bzqcb",
|
21
|
+
"mc9l5x": "f22iagw",
|
22
|
+
"Bt984gj": "f122n59",
|
23
|
+
"uw7vt1": "fgn7ydb",
|
24
|
+
"Dzuj6k": "f1jevvm1",
|
25
|
+
"zsb7ef": "fqihwjc",
|
26
|
+
"f2epyl": "f6x1sus"
|
27
|
+
},
|
28
|
+
"textContainer": {
|
29
|
+
"mc9l5x": "f22iagw",
|
30
|
+
"Beiy3e4": "f1vx9l62",
|
31
|
+
"Bh6795r": "fqerorx",
|
32
|
+
"Bqenvij": "fwk23hs",
|
33
|
+
"Bn3e79g": "f1con4nn"
|
34
|
+
}
|
35
|
+
}, {
|
36
|
+
"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%;}"]
|
37
|
+
});
|
38
|
+
/**
|
39
|
+
* Apply styling to the CardHeader slots based on the state
|
40
|
+
*/
|
41
|
+
|
42
|
+
|
43
|
+
export const useCardHeaderStyles_unstable = state => {
|
44
|
+
const styles = useStyles();
|
45
|
+
state.root.className = mergeClasses(cardHeaderClassName, styles.root, state.root.className);
|
46
|
+
|
47
|
+
if (state.image) {
|
48
|
+
state.image.className = mergeClasses(styles.image, state.image.className);
|
49
|
+
}
|
50
|
+
|
51
|
+
if (state.content) {
|
52
|
+
state.content.className = mergeClasses(styles.textContainer, state.content.className);
|
53
|
+
}
|
54
|
+
|
55
|
+
return state;
|
56
|
+
};
|
57
|
+
//# sourceMappingURL=useCardHeaderStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/CardHeader/useCardHeaderStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,mBAAmB,GAAG,gBAA5B;AAEP;;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,mBAAD,EAAsB,MAAM,CAAC,IAA7B,EAAmC,KAAK,CAAC,IAAN,CAAW,SAA9C,CAAnC;;AAEA,MAAI,KAAK,CAAC,KAAV,EAAiB;AACf,IAAA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,YAAY,CAAC,MAAM,CAAC,KAAR,EAAe,KAAK,CAAC,KAAN,CAAY,SAA3B,CAApC;AACD;;AAED,MAAI,KAAK,CAAC,OAAV,EAAmB;AACjB,IAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CAAC,MAAM,CAAC,aAAR,EAAuB,KAAK,CAAC,OAAN,CAAc,SAArC,CAAtC;AACD;;AAED,SAAO,KAAP;AACD,CAbM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { CardHeaderState } from './CardHeader.types';\n\nexport const cardHeaderClassName = 'fui-CardHeader';\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(cardHeaderClassName, styles.root, state.root.className);\n\n if (state.image) {\n state.image.className = mergeClasses(styles.image, state.image.className);\n }\n\n if (state.content) {\n state.content.className = mergeClasses(styles.textContainer, state.content.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CardPreviewProps } from './CardPreview.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Component to render image previews of documents or articles in a Card component.
|
5
|
+
*/
|
6
|
+
export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
|
@@ -0,0 +1,15 @@
|
|
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
|
+
/**
|
6
|
+
* Component to render image previews of documents or articles in a Card component.
|
7
|
+
*/
|
8
|
+
|
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
|
+
});
|
14
|
+
CardPreview.displayName = 'CardPreview';
|
15
|
+
//# sourceMappingURL=CardPreview.js.map
|
@@ -0,0 +1 @@
|
|
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/"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
export declare type CardPreviewSlots = {
|
3
|
+
root: Slot<'div'>;
|
4
|
+
logo?: Slot<'div'>;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* CardPreview props
|
8
|
+
*/
|
9
|
+
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
10
|
+
/**
|
11
|
+
* State used in rendering CardPreview
|
12
|
+
*/
|
13
|
+
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
@@ -0,0 +1 @@
|
|
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"]}
|
@@ -0,0 +1 @@
|
|
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"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* Render the final JSX of CardPreview
|
5
|
+
*/
|
6
|
+
|
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
|
+
};
|
16
|
+
//# sourceMappingURL=renderCardPreview.js.map
|
@@ -0,0 +1 @@
|
|
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/"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { CardPreviewProps, CardPreviewState } from './CardPreview.types';
|
3
|
+
/**
|
4
|
+
* Create the state required to render CardPreview.
|
5
|
+
*
|
6
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
7
|
+
* before being passed to renderCardPreview_unstable.
|
8
|
+
*
|
9
|
+
* @param props - props from this instance of CardPreview
|
10
|
+
* @param ref - reference to root HTMLElement of CardPreview
|
11
|
+
*/
|
12
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React.Ref<HTMLElement>) => CardPreviewState;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
2
|
+
/**
|
3
|
+
* Create the state required to render CardPreview.
|
4
|
+
*
|
5
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
6
|
+
* before being passed to renderCardPreview_unstable.
|
7
|
+
*
|
8
|
+
* @param props - props from this instance of CardPreview
|
9
|
+
* @param ref - reference to root HTMLElement of CardPreview
|
10
|
+
*/
|
11
|
+
|
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
|
+
};
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=useCardPreview.js.map
|