@fluentui/react-card 9.0.0-rc.1 → 9.0.0
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 +61 -1
- package/CHANGELOG.md +25 -2
- package/README.md +2 -2
- package/lib-amd/Card.js +6 -0
- package/lib-amd/Card.js.map +1 -0
- package/lib-amd/CardFooter.js +6 -0
- package/lib-amd/CardFooter.js.map +1 -0
- package/lib-amd/CardHeader.js +6 -0
- package/lib-amd/CardHeader.js.map +1 -0
- package/lib-amd/CardPreview.js +6 -0
- package/lib-amd/CardPreview.js.map +1 -0
- package/lib-amd/components/Card/Card.js +16 -0
- package/lib-amd/components/Card/Card.js.map +1 -0
- package/lib-amd/components/Card/Card.types.js +5 -0
- package/lib-amd/components/Card/Card.types.js.map +1 -0
- package/lib-amd/components/Card/CardContext.js +31 -0
- package/lib-amd/components/Card/CardContext.js.map +1 -0
- package/lib-amd/components/Card/index.js +11 -0
- package/lib-amd/components/Card/index.js.map +1 -0
- package/lib-amd/components/Card/renderCard.js +18 -0
- package/lib-amd/components/Card/renderCard.js.map +1 -0
- package/lib-amd/components/Card/useCard.js +85 -0
- package/lib-amd/components/Card/useCard.js.map +1 -0
- package/lib-amd/components/Card/useCardContextValue.js +11 -0
- package/lib-amd/components/Card/useCardContextValue.js.map +1 -0
- package/lib-amd/components/Card/useCardSelectable.js +97 -0
- package/lib-amd/components/Card/useCardSelectable.js.map +1 -0
- package/lib-amd/components/Card/useCardStyles.js +253 -0
- package/lib-amd/components/Card/useCardStyles.js.map +1 -0
- package/lib-amd/components/CardFooter/CardFooter.js +15 -0
- package/lib-amd/components/CardFooter/CardFooter.js.map +1 -0
- package/lib-amd/components/CardFooter/CardFooter.types.js +5 -0
- package/lib-amd/components/CardFooter/CardFooter.types.js.map +1 -0
- package/lib-amd/components/CardFooter/index.js +10 -0
- package/lib-amd/components/CardFooter/index.js.map +1 -0
- package/lib-amd/components/CardFooter/renderCardFooter.js +16 -0
- package/lib-amd/components/CardFooter/renderCardFooter.js.map +1 -0
- package/lib-amd/components/CardFooter/useCardFooter.js +27 -0
- package/lib-amd/components/CardFooter/useCardFooter.js.map +1 -0
- package/lib-amd/components/CardFooter/useCardFooterStyles.js +31 -0
- package/lib-amd/components/CardFooter/useCardFooterStyles.js.map +1 -0
- package/lib-amd/components/CardHeader/CardHeader.js +15 -0
- package/lib-amd/components/CardHeader/CardHeader.js.map +1 -0
- package/lib-amd/components/CardHeader/CardHeader.types.js +5 -0
- package/lib-amd/components/CardHeader/CardHeader.types.js.map +1 -0
- package/lib-amd/components/CardHeader/index.js +10 -0
- package/lib-amd/components/CardHeader/index.js.map +1 -0
- package/lib-amd/components/CardHeader/renderCardHeader.js +18 -0
- package/lib-amd/components/CardHeader/renderCardHeader.js.map +1 -0
- package/lib-amd/components/CardHeader/useCardHeader.js +48 -0
- package/lib-amd/components/CardHeader/useCardHeader.js.map +1 -0
- package/lib-amd/components/CardHeader/useCardHeaderStyles.js +72 -0
- package/lib-amd/components/CardHeader/useCardHeaderStyles.js.map +1 -0
- package/lib-amd/components/CardPreview/CardPreview.js +15 -0
- package/lib-amd/components/CardPreview/CardPreview.js.map +1 -0
- package/lib-amd/components/CardPreview/CardPreview.types.js +5 -0
- package/lib-amd/components/CardPreview/CardPreview.types.js.map +1 -0
- package/lib-amd/components/CardPreview/index.js +10 -0
- package/lib-amd/components/CardPreview/index.js.map +1 -0
- package/lib-amd/components/CardPreview/renderCardPreview.js +16 -0
- package/lib-amd/components/CardPreview/renderCardPreview.js.map +1 -0
- package/lib-amd/components/CardPreview/useCardPreview.js +50 -0
- package/lib-amd/components/CardPreview/useCardPreview.js.map +1 -0
- package/lib-amd/components/CardPreview/useCardPreviewStyles.js +44 -0
- package/lib-amd/components/CardPreview/useCardPreviewStyles.js.map +1 -0
- package/lib-amd/index.js +30 -0
- package/lib-amd/index.js.map +1 -0
- package/package.json +5 -7
@@ -0,0 +1,253 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "@fluentui/react-tabster", "../CardPreview/useCardPreviewStyles", "../CardHeader/useCardHeaderStyles", "../CardFooter/useCardFooterStyles"], function (require, exports, tslib_1, react_1, react_theme_1, react_tabster_1, useCardPreviewStyles_1, useCardHeaderStyles_1, useCardFooterStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
var _a, _b, _c, _d, _e, _f;
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
+
exports.useCardStyles_unstable = exports.cardCSSVars = exports.cardClassNames = void 0;
|
6
|
+
/**
|
7
|
+
* Static CSS class names used internally for the component slots.
|
8
|
+
*/
|
9
|
+
exports.cardClassNames = {
|
10
|
+
root: 'fui-Card',
|
11
|
+
floatingAction: 'fui-Card__floatingAction',
|
12
|
+
checkbox: 'fui-Card__checkbox',
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* CSS variable names used internally for uniform styling in Card.
|
16
|
+
*/
|
17
|
+
exports.cardCSSVars = {
|
18
|
+
cardSizeVar: '--fui-Card--size',
|
19
|
+
cardBorderRadiusVar: '--fui-Card--border-radius',
|
20
|
+
};
|
21
|
+
var focusOutlineStyle = {
|
22
|
+
outlineRadius: "var(" + exports.cardCSSVars.cardBorderRadiusVar + ")",
|
23
|
+
outlineWidth: react_theme_1.tokens.strokeWidthThick,
|
24
|
+
};
|
25
|
+
var useStyles = react_1.makeStyles({
|
26
|
+
root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.overflow('hidden')), react_1.shorthands.borderRadius("var(" + exports.cardCSSVars.cardBorderRadiusVar + ")")), react_1.shorthands.padding("var(" + exports.cardCSSVars.cardSizeVar + ")")), react_1.shorthands.gap("var(" + exports.cardCSSVars.cardSizeVar + ")")), (_a = { display: 'flex', position: 'relative', boxSizing: 'border-box', color: react_theme_1.tokens.colorNeutralForeground1,
|
27
|
+
// Border setting using after pseudo element to allow CardPreview to render behind it.
|
28
|
+
'::after': tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, content: '""', pointerEvents: 'none' }, react_1.shorthands.borderStyle('solid')), react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThin)), react_1.shorthands.borderRadius("var(" + exports.cardCSSVars.cardBorderRadiusVar + ")")) }, _a["> ." + useCardHeaderStyles_1.cardHeaderClassNames.root + ", > ." + useCardFooterStyles_1.cardFooterClassNames.root] = {
|
29
|
+
flexShrink: 0,
|
30
|
+
}, _a["> :not(." + useCardPreviewStyles_1.cardPreviewClassNames.root + "):not(." + useCardHeaderStyles_1.cardHeaderClassNames.root + "):not(." + useCardFooterStyles_1.cardFooterClassNames.root + ")"] = {
|
31
|
+
flexGrow: 1,
|
32
|
+
}, _a)), react_tabster_1.createFocusOutlineStyle({
|
33
|
+
style: focusOutlineStyle,
|
34
|
+
selector: 'focus',
|
35
|
+
})),
|
36
|
+
selectableFocused: react_tabster_1.createFocusOutlineStyle({
|
37
|
+
style: focusOutlineStyle,
|
38
|
+
selector: 'focus-within',
|
39
|
+
}),
|
40
|
+
orientationHorizontal: (_b = {
|
41
|
+
flexDirection: 'row',
|
42
|
+
alignItems: 'center'
|
43
|
+
},
|
44
|
+
// Remove vertical padding to keep CardPreview content flush with Card's borders.
|
45
|
+
_b["> ." + useCardPreviewStyles_1.cardPreviewClassNames.root] = {
|
46
|
+
marginTop: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
47
|
+
marginBottom: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
48
|
+
},
|
49
|
+
// Due to Tabster's "Groupper" focus functionality, hidden elements are injected before and after Card's content.
|
50
|
+
// As such, the code below targets a CardPreview, when it's the first element.
|
51
|
+
// Since this is on horizontal cards, the left padding is removed to keep the content flush with the border.
|
52
|
+
_b["> :not([aria-hidden=\"true\"])." + useCardPreviewStyles_1.cardPreviewClassNames.root + ":first-of-type"] = {
|
53
|
+
marginLeft: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
54
|
+
},
|
55
|
+
// Due to Tabster's "Groupper" focus functionality, hidden elements are injected before and after Card's content.
|
56
|
+
// As such, the code below targets a CardPreview, when it's the last element.
|
57
|
+
// Since this is on horizontal cards, the right padding is removed to keep the content flush with the border.
|
58
|
+
_b["> :not([aria-hidden=\"true\"])." + useCardPreviewStyles_1.cardPreviewClassNames.root + ":last-of-type"] = {
|
59
|
+
marginRight: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
60
|
+
},
|
61
|
+
// If the last child is a CardHeader or CardFooter, allow it to grow to fill the available space.
|
62
|
+
_b["> ." + useCardHeaderStyles_1.cardHeaderClassNames.root + ":last-of-type, > ." + useCardFooterStyles_1.cardFooterClassNames.root + ":last-of-type"] = {
|
63
|
+
flexGrow: 1,
|
64
|
+
},
|
65
|
+
_b),
|
66
|
+
orientationVertical: (_c = {
|
67
|
+
flexDirection: 'column'
|
68
|
+
},
|
69
|
+
// Remove lateral padding to keep CardPreview content flush with Card's borders.
|
70
|
+
_c["> ." + useCardPreviewStyles_1.cardPreviewClassNames.root] = {
|
71
|
+
marginLeft: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
72
|
+
marginRight: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
73
|
+
},
|
74
|
+
// Due to Tabster's "Groupper" focus functionality, hidden elements are injected before and after Card's content.
|
75
|
+
// As such, the code below targets a CardPreview, when it's the first element.
|
76
|
+
// Since this is on vertical cards, the top padding is removed to keep the content flush with the border.
|
77
|
+
_c["> :not([aria-hidden=\"true\"])." + useCardPreviewStyles_1.cardPreviewClassNames.root + ":first-of-type"] = {
|
78
|
+
marginTop: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
79
|
+
},
|
80
|
+
_c["> ." + exports.cardClassNames.floatingAction + " + ." + useCardPreviewStyles_1.cardPreviewClassNames.root] = {
|
81
|
+
marginTop: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
82
|
+
},
|
83
|
+
// Due to Tabster's "Groupper" focus functionality, hidden elements are injected before and after Card's content.
|
84
|
+
// As such, the code below targets a CardPreview, when it's the first element.
|
85
|
+
// Since this is on vertical cards, the bottom padding is removed to keep the content flush with the border.
|
86
|
+
_c["> :not([aria-hidden=\"true\"])." + useCardPreviewStyles_1.cardPreviewClassNames.root + ":last-of-type"] = {
|
87
|
+
marginBottom: "calc(var(" + exports.cardCSSVars.cardSizeVar + ") * -1)",
|
88
|
+
},
|
89
|
+
_c),
|
90
|
+
sizeSmall: (_d = {},
|
91
|
+
_d[exports.cardCSSVars.cardSizeVar] = '8px',
|
92
|
+
_d[exports.cardCSSVars.cardBorderRadiusVar] = react_theme_1.tokens.borderRadiusSmall,
|
93
|
+
_d),
|
94
|
+
sizeMedium: (_e = {},
|
95
|
+
_e[exports.cardCSSVars.cardSizeVar] = '12px',
|
96
|
+
_e[exports.cardCSSVars.cardBorderRadiusVar] = react_theme_1.tokens.borderRadiusMedium,
|
97
|
+
_e),
|
98
|
+
sizeLarge: (_f = {},
|
99
|
+
_f[exports.cardCSSVars.cardSizeVar] = '16px',
|
100
|
+
_f[exports.cardCSSVars.cardBorderRadiusVar] = react_theme_1.tokens.borderRadiusLarge,
|
101
|
+
_f),
|
102
|
+
filled: {
|
103
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
|
104
|
+
boxShadow: react_theme_1.tokens.shadow4,
|
105
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
106
|
+
},
|
107
|
+
filledInteractive: {
|
108
|
+
cursor: 'pointer',
|
109
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
|
110
|
+
boxShadow: react_theme_1.tokens.shadow4,
|
111
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
112
|
+
':hover': {
|
113
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Hover,
|
114
|
+
boxShadow: react_theme_1.tokens.shadow8,
|
115
|
+
},
|
116
|
+
':active': {
|
117
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Pressed,
|
118
|
+
},
|
119
|
+
},
|
120
|
+
filledInteractiveSelected: {
|
121
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Selected,
|
122
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
|
123
|
+
':hover': {
|
124
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Selected,
|
125
|
+
},
|
126
|
+
},
|
127
|
+
filledAlternative: {
|
128
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2,
|
129
|
+
boxShadow: react_theme_1.tokens.shadow4,
|
130
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
131
|
+
},
|
132
|
+
filledAlternativeInteractive: {
|
133
|
+
cursor: 'pointer',
|
134
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2,
|
135
|
+
boxShadow: react_theme_1.tokens.shadow4,
|
136
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
137
|
+
':hover': {
|
138
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2Hover,
|
139
|
+
boxShadow: react_theme_1.tokens.shadow8,
|
140
|
+
},
|
141
|
+
':active': {
|
142
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2Pressed,
|
143
|
+
},
|
144
|
+
},
|
145
|
+
filledAlternativeInteractiveSelected: {
|
146
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2Selected,
|
147
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
|
148
|
+
':hover': {
|
149
|
+
backgroundColor: react_theme_1.tokens.colorNeutralBackground2Selected,
|
150
|
+
},
|
151
|
+
},
|
152
|
+
outline: {
|
153
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
154
|
+
boxShadow: 'none',
|
155
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1)),
|
156
|
+
},
|
157
|
+
outlineInteractive: {
|
158
|
+
cursor: 'pointer',
|
159
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
160
|
+
boxShadow: 'none',
|
161
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1)),
|
162
|
+
':hover': {
|
163
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundHover,
|
164
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Hover)),
|
165
|
+
},
|
166
|
+
':active': {
|
167
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundPressed,
|
168
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Pressed)),
|
169
|
+
},
|
170
|
+
},
|
171
|
+
outlineInteractiveSelected: {
|
172
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundSelected,
|
173
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
|
174
|
+
':hover': {
|
175
|
+
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundSelected,
|
176
|
+
},
|
177
|
+
},
|
178
|
+
subtle: {
|
179
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackground,
|
180
|
+
boxShadow: 'none',
|
181
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
182
|
+
},
|
183
|
+
subtleInteractive: {
|
184
|
+
cursor: 'pointer',
|
185
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackground,
|
186
|
+
boxShadow: 'none',
|
187
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
|
188
|
+
':hover': {
|
189
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackgroundHover,
|
190
|
+
},
|
191
|
+
':active': {
|
192
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackgroundPressed,
|
193
|
+
},
|
194
|
+
},
|
195
|
+
subtleInteractiveSelected: {
|
196
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackgroundSelected,
|
197
|
+
'::after': tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
|
198
|
+
':hover': {
|
199
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackgroundSelected,
|
200
|
+
},
|
201
|
+
},
|
202
|
+
select: {
|
203
|
+
position: 'absolute',
|
204
|
+
top: '4px',
|
205
|
+
right: '4px',
|
206
|
+
zIndex: 1,
|
207
|
+
},
|
208
|
+
hiddenCheckbox: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.overflow('hidden')), { width: '1px', height: '1px', position: 'absolute', clip: 'rect(0 0 0 0)', clipPath: 'inset(50%)', whiteSpace: 'nowrap' }),
|
209
|
+
});
|
210
|
+
/**
|
211
|
+
* Apply styling to the Card slots based on the state.
|
212
|
+
*/
|
213
|
+
var useCardStyles_unstable = function (state) {
|
214
|
+
var styles = useStyles();
|
215
|
+
var orientationMap = {
|
216
|
+
horizontal: styles.orientationHorizontal,
|
217
|
+
vertical: styles.orientationVertical,
|
218
|
+
};
|
219
|
+
var sizeMap = {
|
220
|
+
small: styles.sizeSmall,
|
221
|
+
medium: styles.sizeMedium,
|
222
|
+
large: styles.sizeLarge,
|
223
|
+
};
|
224
|
+
var appearanceMap = {
|
225
|
+
filled: styles.filled,
|
226
|
+
'filled-alternative': styles.filledAlternative,
|
227
|
+
outline: styles.outline,
|
228
|
+
subtle: styles.subtle,
|
229
|
+
};
|
230
|
+
var selectedMap = {
|
231
|
+
filled: styles.filledInteractiveSelected,
|
232
|
+
'filled-alternative': styles.filledAlternativeInteractiveSelected,
|
233
|
+
outline: styles.outlineInteractiveSelected,
|
234
|
+
subtle: styles.subtleInteractiveSelected,
|
235
|
+
};
|
236
|
+
var interactiveMap = {
|
237
|
+
filled: styles.filledInteractive,
|
238
|
+
'filled-alternative': styles.filledAlternativeInteractive,
|
239
|
+
outline: styles.outlineInteractive,
|
240
|
+
subtle: styles.subtleInteractive,
|
241
|
+
};
|
242
|
+
state.root.className = react_1.mergeClasses(exports.cardClassNames.root, styles.root, orientationMap[state.orientation], sizeMap[state.size], appearanceMap[state.appearance], (state.interactive || state.selectable) && interactiveMap[state.appearance], state.selected && selectedMap[state.appearance], state.selectFocused && styles.selectableFocused, state.root.className);
|
243
|
+
if (state.floatingAction) {
|
244
|
+
state.floatingAction.className = react_1.mergeClasses(exports.cardClassNames.floatingAction, styles.select, state.floatingAction.className);
|
245
|
+
}
|
246
|
+
if (state.checkbox) {
|
247
|
+
state.checkbox.className = react_1.mergeClasses(exports.cardClassNames.checkbox, styles.hiddenCheckbox, state.checkbox.className);
|
248
|
+
}
|
249
|
+
return state;
|
250
|
+
};
|
251
|
+
exports.useCardStyles_unstable = useCardStyles_unstable;
|
252
|
+
});
|
253
|
+
//# sourceMappingURL=useCardStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCardStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/Card/useCardStyles.ts"],"names":[],"mappings":";;;;;IAUA;;OAEG;IACU,QAAA,cAAc,GAA8B;QACvD,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,0BAA0B;QAC1C,QAAQ,EAAE,oBAAoB;KAC/B,CAAC;IAEF;;OAEG;IACU,QAAA,WAAW,GAAG;QACzB,WAAW,EAAE,kBAAkB;QAC/B,mBAAmB,EAAE,2BAA2B;KACjD,CAAC;IAEF,IAAM,iBA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ACjC,sBAAc,CAAC,IAAI,EACnB,MAAM,CAAC,IAAI,EACX,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,EACjC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EACnB,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,EAC/B,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,EAC3E,KAAK,CAAC,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,EAC/C,KAAK,CAAC,aAAa,IAAI,MAAM,CAAC,iBAAiB,EAC/C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,IAAI,KAAK,CAAC,cAAc,EAAE;YACxB,KAAK,CAAC,cAAc,CAAC,SAAS,GAAG,oBAAY,CAC3C,sBAAc,CAAC,cAAc,EAC7B,MAAM,CAAC,MAAM,EACb,KAAK,CAAC,cAAc,CAAC,SAAS,CAC/B,CAAC;SACH;QAED,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,oBAAY,CAAC,sBAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACnH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA3DW,QAAA,sBAAsB,0BA2DjC","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"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "react", "./useCardFooter", "./renderCardFooter", "./useCardFooterStyles"], function (require, exports, React, useCardFooter_1, renderCardFooter_1, useCardFooterStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.CardFooter = void 0;
|
5
|
+
/**
|
6
|
+
* Component to render Button actions in a Card component.
|
7
|
+
*/
|
8
|
+
exports.CardFooter = React.forwardRef(function (props, ref) {
|
9
|
+
var state = useCardFooter_1.useCardFooter_unstable(props, ref);
|
10
|
+
useCardFooterStyles_1.useCardFooterStyles_unstable(state);
|
11
|
+
return renderCardFooter_1.renderCardFooter_unstable(state);
|
12
|
+
});
|
13
|
+
exports.CardFooter.displayName = 'CardFooter';
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=CardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardFooter.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/CardFooter.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,UAAU,GAAyC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC1F,IAAM,KAAK,GAAG,sCAAsB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjD,kDAA4B,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,4CAAyB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","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"]}
|
@@ -0,0 +1 @@
|
|
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"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./CardFooter", "./CardFooter.types", "./renderCardFooter", "./useCardFooter", "./useCardFooterStyles"], function (require, exports, tslib_1, CardFooter_1, CardFooter_types_1, renderCardFooter_1, useCardFooter_1, useCardFooterStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(CardFooter_1, exports);
|
5
|
+
tslib_1.__exportStar(CardFooter_types_1, exports);
|
6
|
+
tslib_1.__exportStar(renderCardFooter_1, exports);
|
7
|
+
tslib_1.__exportStar(useCardFooter_1, exports);
|
8
|
+
tslib_1.__exportStar(useCardFooterStyles_1, exports);
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC;IACnC,kDAAmC;IACnC,+CAAgC;IAChC,qDAAsC","sourcesContent":["export * from './CardFooter';\nexport * from './CardFooter.types';\nexport * from './renderCardFooter';\nexport * from './useCardFooter';\nexport * from './useCardFooterStyles';\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderCardFooter_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Render the final JSX of CardFooter.
|
7
|
+
*/
|
8
|
+
var renderCardFooter_unstable = function (state) {
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
+
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
11
|
+
slotProps.root.children,
|
12
|
+
slots.action && React.createElement(slots.action, tslib_1.__assign({}, slotProps.action))));
|
13
|
+
};
|
14
|
+
exports.renderCardFooter_unstable = renderCardFooter_unstable;
|
15
|
+
});
|
16
|
+
//# sourceMappingURL=renderCardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderCardFooter.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/renderCardFooter.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAsB;QACxD,IAAA,KAAuB,0BAAQ,CAAkB,KAAK,CAAC,EAArD,KAAK,WAAA,EAAE,SAAS,eAAqC,CAAC;QAE9D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,SAAS,CAAC,IAAI,CAAC,QAAQ;YACvB,KAAK,CAAC,MAAM,IAAI,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI,CAC5C,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,yBAAyB,6BASpC","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"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useCardFooter_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Create the state required to render CardFooter.
|
7
|
+
*
|
8
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
9
|
+
* before being passed to renderCardFooter_unstable.
|
10
|
+
*
|
11
|
+
* @param props - props from this instance of CardFooter
|
12
|
+
* @param ref - reference to root HTMLElement of CardFooter
|
13
|
+
*/
|
14
|
+
var useCardFooter_unstable = function (props, ref) {
|
15
|
+
var action = props.action;
|
16
|
+
return {
|
17
|
+
components: {
|
18
|
+
root: 'div',
|
19
|
+
action: 'div',
|
20
|
+
},
|
21
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
|
22
|
+
action: react_utilities_1.resolveShorthand(action),
|
23
|
+
};
|
24
|
+
};
|
25
|
+
exports.useCardFooter_unstable = useCardFooter_unstable;
|
26
|
+
});
|
27
|
+
//# sourceMappingURL=useCardFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCardFooter.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/useCardFooter.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAsB,EAAE,GAA2B;QAChF,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;QAEzB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,KAAK;aACd;YAED,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,MAAM,EAAE,kCAAgB,CAAC,MAAM,CAAC;SACjC,CAAC;IACJ,CAAC,CAAC;IAfW,QAAA,sBAAsB,0BAejC","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"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react"], function (require, exports, tslib_1, react_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useCardFooterStyles_unstable = exports.cardFooterClassNames = void 0;
|
5
|
+
/**
|
6
|
+
* Static CSS class names used internally for the component slots.
|
7
|
+
*/
|
8
|
+
exports.cardFooterClassNames = {
|
9
|
+
root: 'fui-CardFooter',
|
10
|
+
action: 'fui-CardFooter__action',
|
11
|
+
};
|
12
|
+
var useStyles = react_1.makeStyles({
|
13
|
+
root: tslib_1.__assign({ display: 'flex', flexDirection: 'row' }, react_1.shorthands.gap('12px')),
|
14
|
+
action: {
|
15
|
+
marginLeft: 'auto',
|
16
|
+
},
|
17
|
+
});
|
18
|
+
/**
|
19
|
+
* Apply styling to the CardFooter slots based on the state.
|
20
|
+
*/
|
21
|
+
var useCardFooterStyles_unstable = function (state) {
|
22
|
+
var styles = useStyles();
|
23
|
+
state.root.className = react_1.mergeClasses(exports.cardFooterClassNames.root, styles.root, state.root.className);
|
24
|
+
if (state.action) {
|
25
|
+
state.action.className = react_1.mergeClasses(exports.cardFooterClassNames.action, styles.action, state.action.className);
|
26
|
+
}
|
27
|
+
return state;
|
28
|
+
};
|
29
|
+
exports.useCardFooterStyles_unstable = useCardFooterStyles_unstable;
|
30
|
+
});
|
31
|
+
//# sourceMappingURL=useCardFooterStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCardFooterStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardFooter/useCardFooterStyles.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACU,QAAA,oBAAoB,GAAoC;QACnE,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,wBAAwB;KACjC,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,qBACF,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,KAAK,IACjB,kBAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAC1B;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;SACnB;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAsB;QACjE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,4BAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAElG,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,oBAAY,CAAC,4BAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAC3G;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IATW,QAAA,4BAA4B,gCASvC","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"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "react", "./useCardHeader", "./renderCardHeader", "./useCardHeaderStyles"], function (require, exports, React, useCardHeader_1, renderCardHeader_1, useCardHeaderStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.CardHeader = void 0;
|
5
|
+
/**
|
6
|
+
* Component to render an image, text and an action in a Card component.
|
7
|
+
*/
|
8
|
+
exports.CardHeader = React.forwardRef(function (props, ref) {
|
9
|
+
var state = useCardHeader_1.useCardHeader_unstable(props, ref);
|
10
|
+
useCardHeaderStyles_1.useCardHeaderStyles_unstable(state);
|
11
|
+
return renderCardHeader_1.renderCardHeader_unstable(state);
|
12
|
+
});
|
13
|
+
exports.CardHeader.displayName = 'CardHeader';
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=CardHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/CardHeader.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,UAAU,GAAyC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC1F,IAAM,KAAK,GAAG,sCAAsB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEjD,kDAA4B,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,4CAAyB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","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"]}
|
@@ -0,0 +1 @@
|
|
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"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./CardHeader", "./CardHeader.types", "./renderCardHeader", "./useCardHeader", "./useCardHeaderStyles"], function (require, exports, tslib_1, CardHeader_1, CardHeader_types_1, renderCardHeader_1, useCardHeader_1, useCardHeaderStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(CardHeader_1, exports);
|
5
|
+
tslib_1.__exportStar(CardHeader_types_1, exports);
|
6
|
+
tslib_1.__exportStar(renderCardHeader_1, exports);
|
7
|
+
tslib_1.__exportStar(useCardHeader_1, exports);
|
8
|
+
tslib_1.__exportStar(useCardHeaderStyles_1, exports);
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC;IACnC,kDAAmC;IACnC,+CAAgC;IAChC,qDAAsC","sourcesContent":["export * from './CardHeader';\nexport * from './CardHeader.types';\nexport * from './renderCardHeader';\nexport * from './useCardHeader';\nexport * from './useCardHeaderStyles';\n"]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderCardHeader_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Render the final JSX of CardHeader.
|
7
|
+
*/
|
8
|
+
var renderCardHeader_unstable = function (state) {
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
+
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
11
|
+
slots.image && React.createElement(slots.image, tslib_1.__assign({}, slotProps.image)),
|
12
|
+
React.createElement(slots.header, tslib_1.__assign({}, slotProps.header)),
|
13
|
+
slots.description && React.createElement(slots.description, tslib_1.__assign({}, slotProps.description)),
|
14
|
+
slots.action && React.createElement(slots.action, tslib_1.__assign({}, slotProps.action))));
|
15
|
+
};
|
16
|
+
exports.renderCardHeader_unstable = renderCardHeader_unstable;
|
17
|
+
});
|
18
|
+
//# sourceMappingURL=renderCardHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderCardHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/renderCardHeader.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAsB;QACxD,IAAA,KAAuB,0BAAQ,CAAkB,KAAK,CAAC,EAArD,KAAK,WAAA,EAAE,SAAS,eAAqC,CAAC;QAE9D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,KAAK,IAAI,oBAAC,KAAK,CAAC,KAAK,uBAAK,SAAS,CAAC,KAAK,EAAI;YACpD,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACrC,KAAK,CAAC,WAAW,IAAI,oBAAC,KAAK,CAAC,WAAW,uBAAK,SAAS,CAAC,WAAW,EAAI;YACrE,KAAK,CAAC,MAAM,IAAI,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI,CAC5C,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,yBAAyB,6BAWpC","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"]}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../Card/CardContext", "./useCardHeaderStyles"], function (require, exports, tslib_1, React, react_utilities_1, CardContext_1, useCardHeaderStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useCardHeader_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Create the state required to render CardHeader.
|
7
|
+
*
|
8
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
9
|
+
* before being passed to renderCardHeader_unstable.
|
10
|
+
*
|
11
|
+
* @param props - props from this instance of CardHeader
|
12
|
+
* @param ref - reference to root HTMLElement of CardHeader
|
13
|
+
*/
|
14
|
+
var useCardHeader_unstable = function (props, ref) {
|
15
|
+
var image = props.image, header = props.header, description = props.description, action = props.action;
|
16
|
+
var _a = CardContext_1.useCardContext_unstable().selectableA11yProps, referenceId = _a.referenceId, setReferenceId = _a.setReferenceId;
|
17
|
+
var headerRef = React.useRef(null);
|
18
|
+
var generatedId = react_utilities_1.useId(useCardHeaderStyles_1.cardHeaderClassNames.header, referenceId);
|
19
|
+
React.useEffect(function () {
|
20
|
+
if (header && headerRef.current) {
|
21
|
+
var id = headerRef.current.id;
|
22
|
+
setReferenceId(id ? id : generatedId);
|
23
|
+
}
|
24
|
+
}, [header, setReferenceId, generatedId]);
|
25
|
+
return {
|
26
|
+
components: {
|
27
|
+
root: 'div',
|
28
|
+
image: 'div',
|
29
|
+
header: 'div',
|
30
|
+
description: 'div',
|
31
|
+
action: 'div',
|
32
|
+
},
|
33
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
|
34
|
+
image: react_utilities_1.resolveShorthand(image),
|
35
|
+
header: react_utilities_1.resolveShorthand(header, {
|
36
|
+
required: true,
|
37
|
+
defaultProps: {
|
38
|
+
ref: headerRef,
|
39
|
+
id: referenceId,
|
40
|
+
},
|
41
|
+
}),
|
42
|
+
description: react_utilities_1.resolveShorthand(description),
|
43
|
+
action: react_utilities_1.resolveShorthand(action),
|
44
|
+
};
|
45
|
+
};
|
46
|
+
exports.useCardHeader_unstable = useCardHeader_unstable;
|
47
|
+
});
|
48
|
+
//# sourceMappingURL=useCardHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCardHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-card/src/components/CardHeader/useCardHeader.ts"],"names":[],"mappings":";;;;IAMA;;;;;;;;OAQG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAsB,EAAE,GAA2B;QAChF,IAAA,KAAK,GAAkC,KAAK,MAAvC,EAAE,MAAM,GAA0B,KAAK,OAA/B,EAAE,WAAW,GAAa,KAAK,YAAlB,EAAE,MAAM,GAAK,KAAK,OAAV,CAAW;QAGnD,IAAA,KACE,qCAAuB,EAAE,oBADyB,EAA7B,WAAW,iBAAA,EAAE,cAAc,oBAAE,CACxB;QAC9B,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;QAErD,IAAM,WAAW,GAAG,uBAAK,CAAC,0CAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAEpE,KAAK,CAAC,SAAS,CAAC;YACd,IAAI,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE;gBACvB,IAAA,EAAE,GAAK,SAAS,CAAC,OAAO,GAAtB,CAAuB;gBAEjC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;aACvC;QACH,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;QAE1C,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,KAAK;gBACb,WAAW,EAAE,KAAK;gBAClB,MAAM,EAAE,KAAK;aACd;YAED,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,KAAK,EAAE,kCAAgB,CAAC,KAAK,CAAC;YAC9B,MAAM,EAAE,kCAAgB,CAAC,MAAM,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE;oBACZ,GAAG,EAAE,SAAS;oBACd,EAAE,EAAE,WAAW;iBAChB;aACF,CAAC;YACF,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC;YAC1C,MAAM,EAAE,kCAAgB,CAAC,MAAM,CAAC;SACjC,CAAC;IACJ,CAAC,CAAC;IA1CW,QAAA,sBAAsB,0BA0CjC","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"]}
|