@fluentui/react-card 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.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 +15 -15
- package/CHANGELOG.md +10 -10
- package/lib/Card.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/CardFooter.js +1 -1
- package/lib/CardFooter.js.map +1 -1
- package/lib/CardHeader.js +1 -1
- package/lib/CardHeader.js.map +1 -1
- package/lib/CardPreview.js +1 -1
- package/lib/CardPreview.js.map +1 -1
- package/lib/components/Card/Card.js +6 -6
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.js +1 -1
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/CardContext.js +9 -4
- package/lib/components/Card/CardContext.js.map +1 -1
- package/lib/components/Card/index.js +6 -6
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Card/renderCard.js +11 -5
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.js +20 -20
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardContextValue.js.map +1 -1
- package/lib/components/Card/useCardSelectable.js +10 -10
- package/lib/components/Card/useCardSelectable.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +14 -14
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.js +5 -5
- package/lib/components/CardFooter/CardFooter.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib/components/CardFooter/index.js +5 -5
- package/lib/components/CardFooter/index.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +7 -3
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.js +4 -5
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +3 -3
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.js +5 -5
- package/lib/components/CardHeader/CardHeader.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib/components/CardHeader/index.js +5 -5
- package/lib/components/CardHeader/index.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +13 -3
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.js +10 -10
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +7 -7
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.js +5 -5
- package/lib/components/CardPreview/CardPreview.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib/components/CardPreview/index.js +5 -5
- package/lib/components/CardPreview/index.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +7 -3
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.js +9 -9
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +3 -3
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Card.js +4 -5
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js +4 -5
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js +4 -5
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js +4 -5
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.js +17 -18
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.js +2 -5
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/CardContext.js +30 -26
- package/lib-commonjs/components/Card/CardContext.js.map +1 -1
- package/lib-commonjs/components/Card/index.js +9 -10
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js +25 -16
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +94 -81
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardContextValue.js +11 -11
- package/lib-commonjs/components/Card/useCardContextValue.js.map +1 -1
- package/lib-commonjs/components/Card/useCardSelectable.js +117 -130
- package/lib-commonjs/components/Card/useCardSelectable.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +336 -738
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +15 -16
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.types.js +2 -3
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js +8 -9
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +20 -13
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.js +30 -23
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +33 -45
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +15 -16
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.types.js +2 -3
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js +8 -9
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +26 -13
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.js +64 -50
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +67 -88
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +15 -16
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.types.js +2 -3
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js +8 -9
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +20 -13
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.js +60 -51
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +37 -53
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js +153 -40
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -9
- package/.swcrc +0 -39
@@ -1,23 +1,23 @@
|
|
1
|
-
import { shorthands, __styles, mergeClasses } from
|
2
|
-
import { tokens } from
|
3
|
-
import { createFocusOutlineStyle } from
|
4
|
-
import { cardPreviewClassNames } from
|
5
|
-
import { cardHeaderClassNames } from
|
6
|
-
import { cardFooterClassNames } from
|
1
|
+
import { shorthands, __styles, mergeClasses } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
3
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
4
|
+
import { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';
|
5
|
+
import { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';
|
6
|
+
import { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';
|
7
7
|
/**
|
8
8
|
* Static CSS class names used internally for the component slots.
|
9
9
|
*/
|
10
10
|
export const cardClassNames = {
|
11
|
-
root:
|
12
|
-
floatingAction:
|
13
|
-
checkbox:
|
11
|
+
root: 'fui-Card',
|
12
|
+
floatingAction: 'fui-Card__floatingAction',
|
13
|
+
checkbox: 'fui-Card__checkbox'
|
14
14
|
};
|
15
15
|
/**
|
16
16
|
* CSS variable names used internally for uniform styling in Card.
|
17
17
|
*/
|
18
18
|
export const cardCSSVars = {
|
19
|
-
cardSizeVar:
|
20
|
-
cardBorderRadiusVar:
|
19
|
+
cardSizeVar: '--fui-Card--size',
|
20
|
+
cardBorderRadiusVar: '--fui-Card--border-radius'
|
21
21
|
};
|
22
22
|
const focusOutlineStyle = {
|
23
23
|
outlineRadius: `var(${cardCSSVars.cardBorderRadiusVar})`,
|
@@ -311,19 +311,19 @@ export const useCardStyles_unstable = state => {
|
|
311
311
|
};
|
312
312
|
const appearanceMap = {
|
313
313
|
filled: styles.filled,
|
314
|
-
|
314
|
+
'filled-alternative': styles.filledAlternative,
|
315
315
|
outline: styles.outline,
|
316
316
|
subtle: styles.subtle
|
317
317
|
};
|
318
318
|
const selectedMap = {
|
319
319
|
filled: styles.filledInteractiveSelected,
|
320
|
-
|
320
|
+
'filled-alternative': styles.filledAlternativeInteractiveSelected,
|
321
321
|
outline: styles.outlineInteractiveSelected,
|
322
322
|
subtle: styles.subtleInteractiveSelected
|
323
323
|
};
|
324
324
|
const interactiveMap = {
|
325
325
|
filled: styles.filledInteractive,
|
326
|
-
|
326
|
+
'filled-alternative': styles.filledAlternativeInteractive,
|
327
327
|
outline: styles.outlineInteractive,
|
328
328
|
subtle: styles.subtleInteractive
|
329
329
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["shorthands","__styles","mergeClasses","tokens","createFocusOutlineStyle","cardPreviewClassNames","cardHeaderClassNames","cardFooterClassNames","cardClassNames","root","floatingAction","checkbox","cardCSSVars","cardSizeVar","cardBorderRadiusVar","focusOutlineStyle","outlineRadius","outlineWidth","strokeWidthThick","useStyles","B68tc82","Bmxbyg5","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","z8tnut","z189sj","Byoj8tv","uwmqm3","i8kkvl","Belr9w4","mc9l5x","qhf8xq","B7ck84d","sj55zd","E3zdtr","bn5sak","Eqx8gd","B1piin3","By385i5","Bsft5z2","B80jsxd","Bm2nyyq","Barhvk9","Bw17bha","vfts7","xrcqlc","Ihftqj","Bcgy8vk","Bhxzhr1","B3778ie","d9w3h3","Bl18szs","B4j8arr","B2jhnfs","wiictr","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","selectableFocused","Bssx7fj","uh7if5","clntm0","Dlk2r6","B2j2mmj","wigs8","pbfy6t","B0v4ure","ghq09","B24cy0v","Bwckmig","Bvwlmkc","Bbgo44z","Bil7v7r","skfxo0","jo1ztg","Ba3ybja","az1dzo","vppk2z","B6352mv","nr063g","Blmvk6g","Bsiemmq","B98u21t","B2pnrqr","Bhhzhcn","Bec0n69","B29w5g4","orientationHorizontal","Beiy3e4","Bt984gj","Bnoktp0","Idhjb2","ihgzqh","Bgp6ld0","Bbucpmy","orientationVertical","Bt4kzjz","B1ou843","y1433z","B7egwnw","B49b4xf","sizeSmall","B7balbw","B1h88n7","sizeMedium","sizeLarge","filled","De3pzq","E5pizo","B0n5ga8","s924m2","B1q35kw","Gp14am","filledInteractive","Bceei9c","Jwef8y","Bvxd0ez","ecr2s2","filledInteractiveSelected","filledAlternative","filledAlternativeInteractive","filledAlternativeInteractiveSelected","outline","outlineInteractive","Be0v6ae","B5kxglz","B3pwyw6","Bymgtzf","dmfk","B4ofi8","jgq6uv","Baxewws","outlineInteractiveSelected","subtle","subtleInteractive","subtleInteractiveSelected","select","Bhzewxz","j35jbq","Bj3rh1h","hiddenCheckbox","a9b677","Bqenvij","Bh84pgu","Bgl5zvf","Huce71","d","f","i","h","a","useCardStyles_unstable","state","styles","orientationMap","horizontal","vertical","sizeMap","small","medium","large","appearanceMap","selectedMap","interactiveMap","className","orientation","size","appearance","interactive","selectable","selected","selectFocused"],"sources":["../../../src/components/Card/useCardStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nimport { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';\nimport { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';\nimport { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';\nimport type { CardSlots, CardState } from './Card.types';\n\n/**\n * Static CSS class names used internally for the component slots.\n */\nexport const cardClassNames: SlotClassNames<CardSlots> = {\n root: 'fui-Card',\n floatingAction: 'fui-Card__floatingAction',\n checkbox: 'fui-Card__checkbox',\n};\n\n/**\n * CSS variable names used internally for uniform styling in Card.\n */\nexport const cardCSSVars = {\n cardSizeVar: '--fui-Card--size',\n cardBorderRadiusVar: '--fui-Card--border-radius',\n};\n\nconst focusOutlineStyle = {\n outlineRadius: `var(${cardCSSVars.cardBorderRadiusVar})`,\n outlineWidth: tokens.strokeWidthThick,\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.overflow('hidden'),\n ...shorthands.borderRadius(`var(${cardCSSVars.cardBorderRadiusVar})`),\n ...shorthands.padding(`var(${cardCSSVars.cardSizeVar})`),\n ...shorthands.gap(`var(${cardCSSVars.cardSizeVar})`),\n\n display: 'flex',\n position: 'relative',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n\n // Border setting using after pseudo element to allow CardPreview to render behind it.\n '::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n content: '\"\"',\n pointerEvents: 'none',\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n ...shorthands.borderRadius(`var(${cardCSSVars.cardBorderRadiusVar})`),\n },\n\n // Prevents CardHeader and CardFooter from shrinking.\n [`> .${cardHeaderClassNames.root}, > .${cardFooterClassNames.root}`]: {\n flexShrink: 0,\n },\n // Allows non-card components to grow to fill the available space.\n [`> :not(.${cardPreviewClassNames.root}):not(.${cardHeaderClassNames.root}):not(.${cardFooterClassNames.root})`]: {\n flexGrow: 1,\n },\n\n ...createFocusOutlineStyle({\n style: focusOutlineStyle,\n selector: 'focus',\n }),\n },\n\n selectableFocused: createFocusOutlineStyle({\n style: focusOutlineStyle,\n selector: 'focus-within',\n }),\n\n orientationHorizontal: {\n flexDirection: 'row',\n alignItems: 'center',\n\n // Remove vertical padding to keep CardPreview content flush with Card's borders.\n [`> .${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n marginBottom: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on horizontal cards, the left padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:first-of-type`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the last element.\n // Since this is on horizontal cards, the right padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:last-of-type`]: {\n marginRight: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // If the last child is a CardHeader or CardFooter, allow it to grow to fill the available space.\n [`> .${cardHeaderClassNames.root}:last-of-type, > .${cardFooterClassNames.root}:last-of-type`]: {\n flexGrow: 1,\n },\n },\n orientationVertical: {\n flexDirection: 'column',\n\n // Remove lateral padding to keep CardPreview content flush with Card's borders.\n [`> .${cardPreviewClassNames.root}`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n marginRight: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on vertical cards, the top padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:first-of-type`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n [`> .${cardClassNames.floatingAction} + .${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on vertical cards, the bottom padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:last-of-type`]: {\n marginBottom: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n },\n\n sizeSmall: {\n [cardCSSVars.cardSizeVar]: '8px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusSmall,\n },\n sizeMedium: {\n [cardCSSVars.cardSizeVar]: '12px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusMedium,\n },\n sizeLarge: {\n [cardCSSVars.cardSizeVar]: '16px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusLarge,\n },\n\n filled: {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n filledInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n },\n },\n filledInteractiveSelected: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n },\n },\n\n filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n filledAlternativeInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground2Pressed,\n },\n },\n filledAlternativeInteractiveSelected: {\n backgroundColor: tokens.colorNeutralBackground2Selected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Selected,\n },\n },\n\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n },\n outlineInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n },\n outlineInteractiveSelected: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n },\n },\n\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n subtleInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n subtleInteractiveSelected: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n },\n\n select: {\n position: 'absolute',\n top: '4px',\n right: '4px',\n zIndex: 1,\n },\n\n hiddenCheckbox: {\n ...shorthands.overflow('hidden'),\n width: '1px',\n height: '1px',\n position: 'absolute',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\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 orientationMap = {\n horizontal: styles.orientationHorizontal,\n vertical: styles.orientationVertical,\n };\n\n const sizeMap = {\n small: styles.sizeSmall,\n medium: styles.sizeMedium,\n large: styles.sizeLarge,\n };\n\n const appearanceMap = {\n filled: styles.filled,\n 'filled-alternative': styles.filledAlternative,\n outline: styles.outline,\n subtle: styles.subtle,\n };\n\n const selectedMap = {\n filled: styles.filledInteractiveSelected,\n 'filled-alternative': styles.filledAlternativeInteractiveSelected,\n outline: styles.outlineInteractiveSelected,\n subtle: styles.subtleInteractiveSelected,\n };\n const interactiveMap = {\n filled: styles.filledInteractive,\n 'filled-alternative': styles.filledAlternativeInteractive,\n outline: styles.outlineInteractive,\n subtle: styles.subtleInteractive,\n };\n\n state.root.className = mergeClasses(\n cardClassNames.root,\n styles.root,\n orientationMap[state.orientation],\n sizeMap[state.size],\n appearanceMap[state.appearance],\n (state.interactive || state.selectable) && interactiveMap[state.appearance],\n state.selected && selectedMap[state.appearance],\n state.selectFocused && styles.selectableFocused,\n state.root.className,\n );\n\n if (state.floatingAction) {\n state.floatingAction.className = mergeClasses(\n cardClassNames.floatingAction,\n styles.select,\n state.floatingAction.className,\n );\n }\n\n if (state.checkbox) {\n state.checkbox.className = mergeClasses(cardClassNames.checkbox, styles.hiddenCheckbox, state.checkbox.className);\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,MAAM,QAAQ;AAEvB,SAASC,uBAAuB,QAAQ;AAExC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AAGrC;;;AAGA,OAAO,MAAMC,cAAA,GAA4C;EACvDC,IAAA,EAAM;EACNC,cAAA,EAAgB;EAChBC,QAAA,EAAU;AACZ;AAEA;;;AAGA,OAAO,MAAMC,WAAA,GAAc;EACzBC,WAAA,EAAa;EACbC,mBAAA,EAAqB;AACvB;AAEA,MAAMC,iBAAA,GAAoB;EACxBC,aAAA,EAAgB,OAAMJ,WAAA,CAAYE,mBAAoB,GAAE;EACxDG,YAAA,EAAcd,MAAA,CAAOe;AACvB;AAEA,MAAMC,SAAA,gBAAYlB,QAAA;EAAAQ,IAAA;IAAAW,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,O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Ac,CAACuL,SAAS,GAAG/L,YAAA,CAC/BM,cAAA,CAAeE,cAAc,EAC7B4K,MAAA,CAAOjB,MAAM,EACbgB,KAAA,CAAM3K,cAAc,CAACuL,SAAS;EAElC;EAEA,IAAIZ,KAAA,CAAM1K,QAAQ,EAAE;IAClB0K,KAAA,CAAM1K,QAAQ,CAACsL,SAAS,GAAG/L,YAAA,CAAaM,cAAA,CAAeG,QAAQ,EAAE2K,MAAA,CAAOb,cAAc,EAAEY,KAAA,CAAM1K,QAAQ,CAACsL,SAAS;EAClH;EAEA,OAAOZ,KAAA;AACT"}
|
1
|
+
{"version":3,"names":["shorthands","__styles","mergeClasses","tokens","createFocusOutlineStyle","cardPreviewClassNames","cardHeaderClassNames","cardFooterClassNames","cardClassNames","root","floatingAction","checkbox","cardCSSVars","cardSizeVar","cardBorderRadiusVar","focusOutlineStyle","outlineRadius","outlineWidth","strokeWidthThick","useStyles","B68tc82","Bmxbyg5","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","z8tnut","z189sj","Byoj8tv","uwmqm3","i8kkvl","Belr9w4","mc9l5x","qhf8xq","B7ck84d","sj55zd","E3zdtr","bn5sak","Eqx8gd","B1piin3","By385i5","Bsft5z2","B80jsxd","Bm2nyyq","Barhvk9","Bw17bha","vfts7","xrcqlc","Ihftqj","Bcgy8vk","Bhxzhr1","B3778ie","d9w3h3","Bl18szs","B4j8arr","B2jhnfs","wiictr","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","selectableFocused","Bssx7fj","uh7if5","clntm0","Dlk2r6","B2j2mmj","wigs8","pbfy6t","B0v4ure","ghq09","B24cy0v","Bwckmig","Bvwlmkc","Bbgo44z","Bil7v7r","skfxo0","jo1ztg","Ba3ybja","az1dzo","vppk2z","B6352mv","nr063g","Blmvk6g","Bsiemmq","B98u21t","B2pnrqr","Bhhzhcn","Bec0n69","B29w5g4","orientationHorizontal","Beiy3e4","Bt984gj","Bnoktp0","Idhjb2","ihgzqh","Bgp6ld0","Bbucpmy","orientationVertical","Bt4kzjz","B1ou843","y1433z","B7egwnw","B49b4xf","sizeSmall","B7balbw","B1h88n7","sizeMedium","sizeLarge","filled","De3pzq","E5pizo","B0n5ga8","s924m2","B1q35kw","Gp14am","filledInteractive","Bceei9c","Jwef8y","Bvxd0ez","ecr2s2","filledInteractiveSelected","filledAlternative","filledAlternativeInteractive","filledAlternativeInteractiveSelected","outline","outlineInteractive","Be0v6ae","B5kxglz","B3pwyw6","Bymgtzf","dmfk","B4ofi8","jgq6uv","Baxewws","outlineInteractiveSelected","subtle","subtleInteractive","subtleInteractiveSelected","select","Bhzewxz","j35jbq","Bj3rh1h","hiddenCheckbox","a9b677","Bqenvij","Bh84pgu","Bgl5zvf","Huce71","d","f","i","h","a","useCardStyles_unstable","state","styles","orientationMap","horizontal","vertical","sizeMap","small","medium","large","appearanceMap","selectedMap","interactiveMap","className","orientation","size","appearance","interactive","selectable","selected","selectFocused"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/Card/useCardStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nimport { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';\nimport { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';\nimport { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';\nimport type { CardSlots, CardState } from './Card.types';\n\n/**\n * Static CSS class names used internally for the component slots.\n */\nexport const cardClassNames: SlotClassNames<CardSlots> = {\n root: 'fui-Card',\n floatingAction: 'fui-Card__floatingAction',\n checkbox: 'fui-Card__checkbox',\n};\n\n/**\n * CSS variable names used internally for uniform styling in Card.\n */\nexport const cardCSSVars = {\n cardSizeVar: '--fui-Card--size',\n cardBorderRadiusVar: '--fui-Card--border-radius',\n};\n\nconst focusOutlineStyle = {\n outlineRadius: `var(${cardCSSVars.cardBorderRadiusVar})`,\n outlineWidth: tokens.strokeWidthThick,\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.overflow('hidden'),\n ...shorthands.borderRadius(`var(${cardCSSVars.cardBorderRadiusVar})`),\n ...shorthands.padding(`var(${cardCSSVars.cardSizeVar})`),\n ...shorthands.gap(`var(${cardCSSVars.cardSizeVar})`),\n\n display: 'flex',\n position: 'relative',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n\n // Border setting using after pseudo element to allow CardPreview to render behind it.\n '::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n content: '\"\"',\n pointerEvents: 'none',\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n ...shorthands.borderRadius(`var(${cardCSSVars.cardBorderRadiusVar})`),\n },\n\n // Prevents CardHeader and CardFooter from shrinking.\n [`> .${cardHeaderClassNames.root}, > .${cardFooterClassNames.root}`]: {\n flexShrink: 0,\n },\n // Allows non-card components to grow to fill the available space.\n [`> :not(.${cardPreviewClassNames.root}):not(.${cardHeaderClassNames.root}):not(.${cardFooterClassNames.root})`]: {\n flexGrow: 1,\n },\n\n ...createFocusOutlineStyle({\n style: focusOutlineStyle,\n selector: 'focus',\n }),\n },\n\n selectableFocused: createFocusOutlineStyle({\n style: focusOutlineStyle,\n selector: 'focus-within',\n }),\n\n orientationHorizontal: {\n flexDirection: 'row',\n alignItems: 'center',\n\n // Remove vertical padding to keep CardPreview content flush with Card's borders.\n [`> .${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n marginBottom: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on horizontal cards, the left padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:first-of-type`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the last element.\n // Since this is on horizontal cards, the right padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:last-of-type`]: {\n marginRight: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // If the last child is a CardHeader or CardFooter, allow it to grow to fill the available space.\n [`> .${cardHeaderClassNames.root}:last-of-type, > .${cardFooterClassNames.root}:last-of-type`]: {\n flexGrow: 1,\n },\n },\n orientationVertical: {\n flexDirection: 'column',\n\n // Remove lateral padding to keep CardPreview content flush with Card's borders.\n [`> .${cardPreviewClassNames.root}`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n marginRight: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on vertical cards, the top padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:first-of-type`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n [`> .${cardClassNames.floatingAction} + .${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n\n // Due to Tabster's \"Groupper\" focus functionality, hidden elements are injected before and after Card's content.\n // As such, the code below targets a CardPreview, when it's the first element.\n // Since this is on vertical cards, the bottom padding is removed to keep the content flush with the border.\n [`> :not([aria-hidden=\"true\"]).${cardPreviewClassNames.root}:last-of-type`]: {\n marginBottom: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n },\n\n sizeSmall: {\n [cardCSSVars.cardSizeVar]: '8px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusSmall,\n },\n sizeMedium: {\n [cardCSSVars.cardSizeVar]: '12px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusMedium,\n },\n sizeLarge: {\n [cardCSSVars.cardSizeVar]: '16px',\n [cardCSSVars.cardBorderRadiusVar]: tokens.borderRadiusLarge,\n },\n\n filled: {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n filledInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n },\n },\n filledInteractiveSelected: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n },\n },\n\n filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n filledAlternativeInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground2Pressed,\n },\n },\n filledAlternativeInteractiveSelected: {\n backgroundColor: tokens.colorNeutralBackground2Selected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Selected,\n },\n },\n\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n },\n outlineInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n },\n outlineInteractiveSelected: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n },\n },\n\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n subtleInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n subtleInteractiveSelected: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n },\n\n select: {\n position: 'absolute',\n top: '4px',\n right: '4px',\n zIndex: 1,\n },\n\n hiddenCheckbox: {\n ...shorthands.overflow('hidden'),\n width: '1px',\n height: '1px',\n position: 'absolute',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\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 orientationMap = {\n horizontal: styles.orientationHorizontal,\n vertical: styles.orientationVertical,\n };\n\n const sizeMap = {\n small: styles.sizeSmall,\n medium: styles.sizeMedium,\n large: styles.sizeLarge,\n };\n\n const appearanceMap = {\n filled: styles.filled,\n 'filled-alternative': styles.filledAlternative,\n outline: styles.outline,\n subtle: styles.subtle,\n };\n\n const selectedMap = {\n filled: styles.filledInteractiveSelected,\n 'filled-alternative': styles.filledAlternativeInteractiveSelected,\n outline: styles.outlineInteractiveSelected,\n subtle: styles.subtleInteractiveSelected,\n };\n const interactiveMap = {\n filled: styles.filledInteractive,\n 'filled-alternative': styles.filledAlternativeInteractive,\n outline: styles.outlineInteractive,\n subtle: styles.subtleInteractive,\n };\n\n state.root.className = mergeClasses(\n cardClassNames.root,\n styles.root,\n orientationMap[state.orientation],\n sizeMap[state.size],\n appearanceMap[state.appearance],\n (state.interactive || state.selectable) && interactiveMap[state.appearance],\n state.selected && selectedMap[state.appearance],\n state.selectFocused && styles.selectableFocused,\n state.root.className,\n );\n\n if (state.floatingAction) {\n state.floatingAction.className = mergeClasses(\n cardClassNames.floatingAction,\n styles.select,\n state.floatingAction.className,\n );\n }\n\n if (state.checkbox) {\n state.checkbox.className = mergeClasses(cardClassNames.checkbox, styles.hiddenCheckbox, state.checkbox.className);\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;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GAChB;EAEDkB,KAAK,CAAC5K,IAAI,CAACwL,SAAS,GAAG/L,YAAY,CACjCM,cAAc,CAACC,IAAI,EACnB6K,MAAM,CAAC7K,IAAI,EACX8K,cAAc,CAACF,KAAK,CAACa,WAAW,CAAC,EACjCR,OAAO,CAACL,KAAK,CAACc,IAAI,CAAC,EACnBL,aAAa,CAACT,KAAK,CAACe,UAAU,CAAC,EAC/B,CAACf,KAAK,CAACgB,WAAW,IAAIhB,KAAK,CAACiB,UAAU,KAAKN,cAAc,CAACX,KAAK,CAACe,UAAU,CAAC,EAC3Ef,KAAK,CAACkB,QAAQ,IAAIR,WAAW,CAACV,KAAK,CAACe,UAAU,CAAC,EAC/Cf,KAAK,CAACmB,aAAa,IAAIlB,MAAM,CAAC/F,iBAAiB,EAC/C8F,KAAK,CAAC5K,IAAI,CAACwL,SAAS,CACrB;EAED,IAAIZ,KAAK,CAAC3K,cAAc,EAAE;IACxB2K,KAAK,CAAC3K,cAAc,CAACuL,SAAS,GAAG/L,YAAY,CAC3CM,cAAc,CAACE,cAAc,EAC7B4K,MAAM,CAACjB,MAAM,EACbgB,KAAK,CAAC3K,cAAc,CAACuL,SAAS,CAC/B;;EAGH,IAAIZ,KAAK,CAAC1K,QAAQ,EAAE;IAClB0K,KAAK,CAAC1K,QAAQ,CAACsL,SAAS,GAAG/L,YAAY,CAACM,cAAc,CAACG,QAAQ,EAAE2K,MAAM,CAACb,cAAc,EAAEY,KAAK,CAAC1K,QAAQ,CAACsL,SAAS,CAAC;;EAGnH,OAAOZ,KAAK;AACd,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardFooter_unstable } from
|
3
|
-
import { renderCardFooter_unstable } from
|
4
|
-
import { useCardFooterStyles_unstable } from
|
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
5
|
/**
|
6
6
|
* Component to render Button actions in a Card component.
|
7
7
|
*/
|
@@ -10,5 +10,5 @@ export const CardFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardFooterStyles_unstable(state);
|
11
11
|
return renderCardFooter_unstable(state);
|
12
12
|
});
|
13
|
-
CardFooter.displayName =
|
13
|
+
CardFooter.displayName = 'CardFooter';
|
14
14
|
//# sourceMappingURL=CardFooter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useCardFooter_unstable","renderCardFooter_unstable","useCardFooterStyles_unstable","CardFooter","forwardRef","props","ref","state","displayName"],"sources":["
|
1
|
+
{"version":3,"names":["React","useCardFooter_unstable","renderCardFooter_unstable","useCardFooterStyles_unstable","CardFooter","forwardRef","props","ref","state","displayName"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/CardFooter.tsx"],"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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,4BAA4B,QAAQ,uBAAuB;AAIpE;;;AAGA,OAAO,MAAMC,UAAU,gBAAyCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGP,sBAAsB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEhDJ,4BAA4B,CAACK,KAAK,CAAC;EACnC,OAAON,yBAAyB,CAACM,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFJ,UAAU,CAACK,WAAW,GAAG,YAAY"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"file":"CardFooter.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/CardFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Slots available in the CardFooter component.\n */\nexport type CardFooterSlots = {\n /**\n * Root element of the component.\n */\n root: Slot<'div'>;\n\n /**\n * Container that renders on the far end of the footer, used for action buttons.\n */\n action?: Slot<'div'>;\n};\n\n/**\n * CardFooter component props.\n */\nexport type CardFooterProps = ComponentProps<CardFooterSlots>;\n\n/**\n * State used in rendering CardFooter.\n */\nexport type CardFooterState = ComponentState<CardFooterSlots>;\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
1
|
+
export * from './CardFooter';
|
2
|
+
export * from './CardFooter.types';
|
3
|
+
export * from './renderCardFooter';
|
4
|
+
export * from './useCardFooter';
|
5
|
+
export * from './useCardFooterStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/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"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Render the final JSX of CardFooter.
|
5
5
|
*/
|
@@ -8,6 +8,10 @@ export const renderCardFooter_unstable = state => {
|
|
8
8
|
slots,
|
9
9
|
slotProps
|
10
10
|
} = getSlots(state);
|
11
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
12
|
+
...slotProps.root
|
13
|
+
}, slotProps.root.children, slots.action && /*#__PURE__*/React.createElement(slots.action, {
|
14
|
+
...slotProps.action
|
15
|
+
}));
|
12
16
|
};
|
13
17
|
//# sourceMappingURL=renderCardFooter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderCardFooter_unstable","state","slots","slotProps","createElement","root","children","action"],"sources":["
|
1
|
+
{"version":3,"names":["React","getSlots","renderCardFooter_unstable","state","slots","slotProps","createElement","root","children","action"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/renderCardFooter.tsx"],"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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAkBE,KAAK,CAAC;EAE7D,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAC3BF,SAAS,CAACE,IAAI,CAACC,QAAQ,EACvBJ,KAAK,CAACK,MAAM,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,EAAI,CAC5C;AAEjB,CAAC"}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import { getNativeElementProps, resolveShorthand } from "@fluentui/react-utilities";
|
1
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
2
|
/**
|
4
3
|
* Create the state required to render CardFooter.
|
5
4
|
*
|
@@ -15,10 +14,10 @@ export const useCardFooter_unstable = (props, ref) => {
|
|
15
14
|
} = props;
|
16
15
|
return {
|
17
16
|
components: {
|
18
|
-
root:
|
19
|
-
action:
|
17
|
+
root: 'div',
|
18
|
+
action: 'div'
|
20
19
|
},
|
21
|
-
root: getNativeElementProps(
|
20
|
+
root: getNativeElementProps('div', {
|
22
21
|
ref,
|
23
22
|
...props
|
24
23
|
}),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getNativeElementProps","resolveShorthand","useCardFooter_unstable","props","ref","action","components","root"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/useCardFooter.ts"],"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"],"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGnF;;;;;;;;;AASA,OAAO,MAAMC,sBAAsB,GAAGA,CAACC,KAAsB,EAAEC,GAA2B,KAAqB;EAC7G,MAAM;IAAEC;EAAM,CAAE,GAAGF,KAAK;EAExB,OAAO;IACLG,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXF,MAAM,EAAE;KACT;IAEDE,IAAI,EAAEP,qBAAqB,CAAC,KAAK,EAAE;MACjCI,GAAG;MACH,GAAGD;KACJ,CAAC;IACFE,MAAM,EAAEJ,gBAAgB,CAACI,MAAM;GAChC;AACH,CAAC"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { __styles, mergeClasses, shorthands } from
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
2
|
/**
|
3
3
|
* Static CSS class names used internally for the component slots.
|
4
4
|
*/
|
5
5
|
export const cardFooterClassNames = {
|
6
|
-
root:
|
7
|
-
action:
|
6
|
+
root: 'fui-CardFooter',
|
7
|
+
action: 'fui-CardFooter__action'
|
8
8
|
};
|
9
9
|
const useStyles = /*#__PURE__*/__styles({
|
10
10
|
root: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","cardFooterClassNames","root","action","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","Frg6f3","d","useCardFooterStyles_unstable","state","styles","className"],"sources":["
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","cardFooterClassNames","root","action","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","Frg6f3","d","useCardFooterStyles_unstable","state","styles","className"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/useCardFooterStyles.ts"],"sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { CardFooterSlots, CardFooterState } from './CardFooter.types';\n\n/**\n * Static CSS class names used internally for the component slots.\n */\nexport const cardFooterClassNames: SlotClassNames<CardFooterSlots> = {\n root: 'fui-CardFooter',\n action: 'fui-CardFooter__action',\n};\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(cardFooterClassNames.root, styles.root, state.root.className);\n\n if (state.action) {\n state.action.className = mergeClasses(cardFooterClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"mappings":"AACA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE;;;AAGA,OAAO,MAAMC,oBAAoB,GAAoC;EACnEC,IAAI,EAAE,gBAAgB;EACtBC,MAAM,EAAE;CACT;AAED,MAAMC,SAAS,gBAAGN,QAAA;EAAAI,IAAA;IAAAG,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAL,MAAA;IAAAM,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAShB;AAEF;;;AAGA,OAAO,MAAMC,4BAA4B,GAAIC,KAAsB,IAAqB;EACtF,MAAMC,MAAM,GAAGT,SAAS,EAAE;EAC1BQ,KAAK,CAACV,IAAI,CAACY,SAAS,GAAGf,YAAY,CAACE,oBAAoB,CAACC,IAAI,EAAEW,MAAM,CAACX,IAAI,EAAEU,KAAK,CAACV,IAAI,CAACY,SAAS,CAAC;EAEjG,IAAIF,KAAK,CAACT,MAAM,EAAE;IAChBS,KAAK,CAACT,MAAM,CAACW,SAAS,GAAGf,YAAY,CAACE,oBAAoB,CAACE,MAAM,EAAEU,MAAM,CAACV,MAAM,EAAES,KAAK,CAACT,MAAM,CAACW,SAAS,CAAC;;EAG3G,OAAOF,KAAK;AACd,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardHeader_unstable } from
|
3
|
-
import { renderCardHeader_unstable } from
|
4
|
-
import { useCardHeaderStyles_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCardHeader_unstable } from './useCardHeader';
|
3
|
+
import { renderCardHeader_unstable } from './renderCardHeader';
|
4
|
+
import { useCardHeaderStyles_unstable } from './useCardHeaderStyles';
|
5
5
|
/**
|
6
6
|
* Component to render an image, text and an action in a Card component.
|
7
7
|
*/
|
@@ -10,5 +10,5 @@ export const CardHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardHeaderStyles_unstable(state);
|
11
11
|
return renderCardHeader_unstable(state);
|
12
12
|
});
|
13
|
-
CardHeader.displayName =
|
13
|
+
CardHeader.displayName = 'CardHeader';
|
14
14
|
//# sourceMappingURL=CardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useCardHeader_unstable","renderCardHeader_unstable","useCardHeaderStyles_unstable","CardHeader","forwardRef","props","ref","state","displayName"],"sources":["
|
1
|
+
{"version":3,"names":["React","useCardHeader_unstable","renderCardHeader_unstable","useCardHeaderStyles_unstable","CardHeader","forwardRef","props","ref","state","displayName"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/CardHeader.tsx"],"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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,4BAA4B,QAAQ,uBAAuB;AAIpE;;;AAGA,OAAO,MAAMC,UAAU,gBAAyCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGP,sBAAsB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEhDJ,4BAA4B,CAACK,KAAK,CAAC;EACnC,OAAON,yBAAyB,CAACM,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFJ,UAAU,CAACK,WAAW,GAAG,YAAY"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"file":"CardHeader.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/CardHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Slots available in the CardHeader component.\n */\nexport type CardHeaderSlots = {\n /**\n * Root element of the component.\n */\n root: Slot<'div'>;\n\n /**\n * Element used to render an image or avatar related to the card.\n */\n image: Slot<'div', 'img'>;\n\n /**\n * Element used to render the main header title.\n */\n header: Slot<'div'>;\n\n /**\n * Element used to render short descriptions related to the title.\n */\n description: Slot<'div'>;\n\n /**\n * Container that renders on the far end of the footer, used for action buttons.\n */\n action?: Slot<'div'>;\n};\n\n/**\n * CardHeader component props.\n */\nexport type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;\n\n/**\n * State used in rendering CardHeader.\n */\nexport type CardHeaderState = ComponentState<CardHeaderSlots>;\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
1
|
+
export * from './CardHeader';
|
2
|
+
export * from './CardHeader.types';
|
3
|
+
export * from './renderCardHeader';
|
4
|
+
export * from './useCardHeader';
|
5
|
+
export * from './useCardHeaderStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/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"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Render the final JSX of CardHeader.
|
5
5
|
*/
|
@@ -8,6 +8,16 @@ export const renderCardHeader_unstable = state => {
|
|
8
8
|
slots,
|
9
9
|
slotProps
|
10
10
|
} = getSlots(state);
|
11
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
12
|
+
...slotProps.root
|
13
|
+
}, slots.image && /*#__PURE__*/React.createElement(slots.image, {
|
14
|
+
...slotProps.image
|
15
|
+
}), /*#__PURE__*/React.createElement(slots.header, {
|
16
|
+
...slotProps.header
|
17
|
+
}), slots.description && /*#__PURE__*/React.createElement(slots.description, {
|
18
|
+
...slotProps.description
|
19
|
+
}), slots.action && /*#__PURE__*/React.createElement(slots.action, {
|
20
|
+
...slotProps.action
|
21
|
+
}));
|
12
22
|
};
|
13
23
|
//# sourceMappingURL=renderCardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderCardHeader_unstable","state","slots","slotProps","createElement","root","image","header","description","action"],"sources":["
|
1
|
+
{"version":3,"names":["React","getSlots","renderCardHeader_unstable","state","slots","slotProps","createElement","root","image","header","description","action"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/renderCardHeader.tsx"],"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 && <slots.image {...slotProps.image} />}\n <slots.header {...slotProps.header} />\n {slots.description && <slots.description {...slotProps.description} />}\n {slots.action && <slots.action {...slotProps.action} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAkBE,KAAK,CAAC;EAE7D,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAC3BH,KAAK,CAACI,KAAK,iBAAIR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,KAAK;IAAA,GAAKH,SAAS,CAACG;EAAK,EAAI,eACpDR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,EAAI,EACrCL,KAAK,CAACM,WAAW,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACM,WAAW;IAAA,GAAKL,SAAS,CAACK;EAAW,EAAI,EACrEN,KAAK,CAACO,MAAM,iBAAIX,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACO,MAAM;IAAA,GAAKN,SAAS,CAACM;EAAM,EAAI,CAC5C;AAEjB,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getNativeElementProps, resolveShorthand, useId } from
|
3
|
-
import { useCardContext_unstable } from
|
4
|
-
import { cardHeaderClassNames } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
|
3
|
+
import { useCardContext_unstable } from '../Card/CardContext';
|
4
|
+
import { cardHeaderClassNames } from './useCardHeaderStyles';
|
5
5
|
/**
|
6
6
|
* Create the state required to render CardHeader.
|
7
7
|
*
|
@@ -36,13 +36,13 @@ export const useCardHeader_unstable = (props, ref) => {
|
|
36
36
|
}, [header, setReferenceId, generatedId]);
|
37
37
|
return {
|
38
38
|
components: {
|
39
|
-
root:
|
40
|
-
image:
|
41
|
-
header:
|
42
|
-
description:
|
43
|
-
action:
|
39
|
+
root: 'div',
|
40
|
+
image: 'div',
|
41
|
+
header: 'div',
|
42
|
+
description: 'div',
|
43
|
+
action: 'div'
|
44
44
|
},
|
45
|
-
root: getNativeElementProps(
|
45
|
+
root: getNativeElementProps('div', {
|
46
46
|
ref,
|
47
47
|
...props
|
48
48
|
}),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","getNativeElementProps","resolveShorthand","useId","useCardContext_unstable","cardHeaderClassNames","useCardHeader_unstable","props","ref","image","header","description","action","selectableA11yProps","referenceId","setReferenceId","headerRef","useRef","generatedId","useEffect","current","id","components","root","required","defaultProps"],"sources":["
|
1
|
+
{"version":3,"names":["React","getNativeElementProps","resolveShorthand","useId","useCardContext_unstable","cardHeaderClassNames","useCardHeader_unstable","props","ref","image","header","description","action","selectableA11yProps","referenceId","setReferenceId","headerRef","useRef","generatedId","useEffect","current","id","components","root","required","defaultProps"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/useCardHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { CardHeaderProps, CardHeaderState } from './CardHeader.types';\nimport { useCardContext_unstable } from '../Card/CardContext';\nimport { cardHeaderClassNames } from './useCardHeaderStyles';\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, header, description, action } = props;\n\n const {\n selectableA11yProps: { referenceId, setReferenceId },\n } = useCardContext_unstable();\n const headerRef = React.useRef<HTMLDivElement>(null);\n\n const generatedId = useId(cardHeaderClassNames.header, referenceId);\n\n React.useEffect(() => {\n if (header && headerRef.current) {\n const { id } = headerRef.current;\n\n setReferenceId(id ? id : generatedId);\n }\n }, [header, setReferenceId, generatedId]);\n\n return {\n components: {\n root: 'div',\n image: 'div',\n header: 'div',\n description: 'div',\n action: 'div',\n },\n\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n image: resolveShorthand(image),\n header: resolveShorthand(header, {\n required: true,\n defaultProps: {\n ref: headerRef,\n id: referenceId,\n },\n }),\n description: resolveShorthand(description),\n action: resolveShorthand(action),\n };\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AAE1F,SAASC,uBAAuB,QAAQ,qBAAqB;AAC7D,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D;;;;;;;;;AASA,OAAO,MAAMC,sBAAsB,GAAGA,CAACC,KAAsB,EAAEC,GAA2B,KAAqB;EAC7G,MAAM;IAAEC,KAAK;IAAEC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SS class names used internally for the component slots.
|
4
4
|
*/
|
5
5
|
export const cardHeaderClassNames = {
|
6
|
-
root:
|
7
|
-
image:
|
8
|
-
header:
|
9
|
-
description:
|
10
|
-
action:
|
6
|
+
root: 'fui-CardHeader',
|
7
|
+
image: 'fui-CardHeader__image',
|
8
|
+
header: 'fui-CardHeader__header',
|
9
|
+
description: 'fui-CardHeader__description',
|
10
|
+
action: 'fui-CardHeader__action'
|
11
11
|
};
|
12
12
|
/**
|
13
13
|
* CSS variable names used internally for uniform styling in CardHeader.
|
14
14
|
*/
|
15
15
|
export const cardHeaderCSSVars = {
|
16
|
-
cardHeaderGapVar:
|
16
|
+
cardHeaderGapVar: '--fui-CardHeader--gap'
|
17
17
|
};
|
18
18
|
const useStyles = /*#__PURE__*/__styles({
|
19
19
|
root: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","cardHeaderClassNames","root","image","header","description","action","cardHeaderCSSVars","cardHeaderGapVar","useStyles","Bkc6ea2","mc9l5x","t4k1zu","v29qe6","Bt984gj","t21cq0","Br312pm","Ijaq50","Frg6f3","d","useCardHeaderStyles_unstable","state","styles","className"],"sources":["
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","cardHeaderClassNames","root","image","header","description","action","cardHeaderCSSVars","cardHeaderGapVar","useStyles","Bkc6ea2","mc9l5x","t4k1zu","v29qe6","Bt984gj","t21cq0","Br312pm","Ijaq50","Frg6f3","d","useCardHeaderStyles_unstable","state","styles","className"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/useCardHeaderStyles.ts"],"sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { CardHeaderSlots, CardHeaderState } from './CardHeader.types';\n\n/**\n * Static CSS class names used internally for the component slots.\n */\nexport const cardHeaderClassNames: SlotClassNames<CardHeaderSlots> = {\n root: 'fui-CardHeader',\n image: 'fui-CardHeader__image',\n header: 'fui-CardHeader__header',\n description: 'fui-CardHeader__description',\n action: 'fui-CardHeader__action',\n};\n\n/**\n * CSS variable names used internally for uniform styling in CardHeader.\n */\nexport const cardHeaderCSSVars = {\n cardHeaderGapVar: '--fui-CardHeader--gap',\n};\n\nconst useStyles = makeStyles({\n root: {\n [cardHeaderCSSVars.cardHeaderGapVar]: '12px',\n display: 'grid',\n gridAutoColumns: 'min-content 1fr min-content',\n gridAutoRows: '1fr min-content',\n alignItems: 'center',\n },\n image: {\n display: 'inline-flex',\n marginRight: `var(${cardHeaderCSSVars.cardHeaderGapVar})`,\n gridColumnStart: '1',\n gridRowStart: 'span 2',\n },\n header: {\n gridColumnStart: '2',\n gridRowStart: '1',\n },\n description: {\n gridColumnStart: '2',\n gridRowStart: '2',\n },\n action: {\n marginLeft: `var(${cardHeaderCSSVars.cardHeaderGapVar})`,\n gridColumnStart: '3',\n gridRowStart: 'span 2',\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.header) {\n state.header.className = mergeClasses(cardHeaderClassNames.header, styles.header, state.header.className);\n }\n\n if (state.description) {\n state.description.className = mergeClasses(\n cardHeaderClassNames.description,\n styles.description,\n state.description.className,\n );\n }\n\n if (state.action) {\n state.action.className = mergeClasses(cardHeaderClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"mappings":"AACA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AAGzD;;;AAGA,OAAO,MAAMC,oBAAoB,GAAoC;EACnEC,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,uBAAuB;EAC9BC,MAAM,EAAE,wBAAwB;EAChCC,WAAW,EAAE,6BAA6B;EAC1CC,MAAM,EAAE;CACT;AAED;;;AA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W,EAClBgB,KAAK,CAAChB,WAAW,CAACkB,SAAS,CAC5B;;EAGH,IAAIF,KAAK,CAACf,MAAM,EAAE;IAChBe,KAAK,CAACf,MAAM,CAACiB,SAAS,GAAGvB,YAAY,CAACC,oBAAoB,CAACK,MAAM,EAAEgB,MAAM,CAAChB,MAAM,EAAEe,KAAK,CAACf,MAAM,CAACiB,SAAS,CAAC;;EAG3G,OAAOF,KAAK;AACd,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardPreview_unstable } from
|
3
|
-
import { renderCardPreview_unstable } from
|
4
|
-
import { useCardPreviewStyles_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCardPreview_unstable } from './useCardPreview';
|
3
|
+
import { renderCardPreview_unstable } from './renderCardPreview';
|
4
|
+
import { useCardPreviewStyles_unstable } from './useCardPreviewStyles';
|
5
5
|
/**
|
6
6
|
* Component to render image previews of documents or articles in a Card component.
|
7
7
|
*/
|
@@ -10,5 +10,5 @@ export const CardPreview = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardPreviewStyles_unstable(state);
|
11
11
|
return renderCardPreview_unstable(state);
|
12
12
|
});
|
13
|
-
CardPreview.displayName =
|
13
|
+
CardPreview.displayName = 'CardPreview';
|
14
14
|
//# sourceMappingURL=CardPreview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useCardPreview_unstable","renderCardPreview_unstable","useCardPreviewStyles_unstable","CardPreview","forwardRef","props","ref","state","displayName"],"sources":["
|
1
|
+
{"version":3,"names":["React","useCardPreview_unstable","renderCardPreview_unstable","useCardPreviewStyles_unstable","CardPreview","forwardRef","props","ref","state","displayName"],"sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardPreview/CardPreview.tsx"],"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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AAItE;;;AAGA,OAAO,MAAMC,WAAW,gBAA0CJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGP,uBAAuB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEjDJ,6BAA6B,CAACK,KAAK,CAAC;EACpC,OAAON,0BAA0B,CAACM,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFJ,WAAW,CAACK,WAAW,GAAG,aAAa"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"file":"CardPreview.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardPreview/CardPreview.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Slots available in the Card component.\n */\nexport type CardPreviewSlots = {\n /**\n * Root element of the component.\n */\n root: Slot<'div'>;\n\n /**\n * Container that holds a logo related to the image preview provided.\n */\n logo?: Slot<'div', 'img'>;\n};\n\n/**\n * CardPreview component props.\n */\nexport type CardPreviewProps = ComponentProps<CardPreviewSlots>;\n\n/**\n * State used in rendering CardPreview.\n */\nexport type CardPreviewState = ComponentState<CardPreviewSlots>;\n"]}
|