@fluentui/react-card 0.0.0-nightly-20220603-0421.1 → 0.0.0-nightly-20220608-0420.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 +35 -5
- package/CHANGELOG.md +10 -5
- package/assets/logo.svg +9 -0
- package/dist/index.d.ts +89 -18
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/renderCard.js +1 -1
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.js +2 -0
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +30 -8
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +1 -1
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +5 -4
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +1 -1
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +5 -4
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +1 -1
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +9 -7
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js +1 -1
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +2 -0
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +32 -8
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +5 -4
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +5 -4
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +9 -7
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
@@ -2,16 +2,46 @@
|
|
2
2
|
"name": "@fluentui/react-card",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-card_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Wed, 08 Jun 2022 04:32:03 GMT",
|
6
|
+
"tag": "@fluentui/react-card_v0.0.0-nightly-20220608-0420.1",
|
7
|
+
"version": "0.0.0-nightly-20220608-0420.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
|
+
{
|
11
|
+
"author": "39736248+andrefcdias@users.noreply.github.com",
|
12
|
+
"package": "@fluentui/react-card",
|
13
|
+
"commit": "06030b7cbf61b157df4b2a203a456aca6380ea6b",
|
14
|
+
"comment": "feat: add `orientation` prop"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "39736248+andrefcdias@users.noreply.github.com",
|
18
|
+
"package": "@fluentui/react-card",
|
19
|
+
"commit": "0a35ab4703e21e5f6763b17ed33a48ad3ae4409b",
|
20
|
+
"comment": "chore: add basic API documentation"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-card",
|
25
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220608-0420.1",
|
26
|
+
"commit": "60b10ac54e8953147582e39ccf022ad0044d1733"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-card",
|
31
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20220608-0420.1",
|
32
|
+
"commit": "60b10ac54e8953147582e39ccf022ad0044d1733"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-card",
|
37
|
+
"comment": "Bump @fluentui/react-text to v0.0.0-nightly-20220608-0420.1",
|
38
|
+
"commit": "60b10ac54e8953147582e39ccf022ad0044d1733"
|
39
|
+
},
|
10
40
|
{
|
11
41
|
"author": "beachball",
|
12
42
|
"package": "@fluentui/react-card",
|
13
|
-
"comment": "Bump @fluentui/react-button to v0.0.0-nightly-
|
14
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-button to v0.0.0-nightly-20220608-0420.1",
|
44
|
+
"commit": "60b10ac54e8953147582e39ccf022ad0044d1733"
|
15
45
|
}
|
16
46
|
]
|
17
47
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,17 +1,22 @@
|
|
1
1
|
# Change Log - @fluentui/react-card
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 08 Jun 2022 04:32:03 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20220608-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-card_v0.0.0-nightly-20220608-0420.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-card_v9.0.0-beta.18..@fluentui/react-card_v0.0.0-nightly-
|
9
|
+
Wed, 08 Jun 2022 04:32:03 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-card_v9.0.0-beta.18..@fluentui/react-card_v0.0.0-nightly-20220608-0420.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
-
|
14
|
+
- feat: add `orientation` prop ([PR #23037](https://github.com/microsoft/fluentui/pull/23037) by 39736248+andrefcdias@users.noreply.github.com)
|
15
|
+
- chore: add basic API documentation ([PR #23410](https://github.com/microsoft/fluentui/pull/23410) by 39736248+andrefcdias@users.noreply.github.com)
|
16
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20220608-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/60b10ac54e8953147582e39ccf022ad0044d1733) by beachball)
|
17
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20220608-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/60b10ac54e8953147582e39ccf022ad0044d1733) by beachball)
|
18
|
+
- Bump @fluentui/react-text to v0.0.0-nightly-20220608-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/60b10ac54e8953147582e39ccf022ad0044d1733) by beachball)
|
19
|
+
- Bump @fluentui/react-button to v0.0.0-nightly-20220608-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/60b10ac54e8953147582e39ccf022ad0044d1733) by beachball)
|
15
20
|
|
16
21
|
## [9.0.0-beta.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-card_v9.0.0-beta.18)
|
17
22
|
|
package/assets/logo.svg
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<svg width="192" height="192" viewBox="0 0 192 192" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2
|
+
<rect width="192" height="192" fill="url(#pattern0)"/>
|
3
|
+
<defs>
|
4
|
+
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
5
|
+
<use xlink:href="#image0_8855_1044" transform="scale(0.00520833)"/>
|
6
|
+
</pattern>
|
7
|
+
<image id="image0_8855_1044" width="192" height="192" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzhSURBVHgB7d1djFVXGQbg77QUcIbMUBjK0DD8VKBMoWUKagq1iZRGINYE2qRAvFCMEPFCsHAjqRjAqIlQ4aZEMAUTDYVEaSJxwEoglgIXrWAYZAQjdQZhbG1liNQxodmud5/Z9TCdnzPnnL1+9vc+yelQ4AKG9e71fWuvvXauo6MjEiKdoruESDEGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBItSFCpXn3Pcnt2SfSeklkwniRujqJGqflf9z4oFAYcnxJXmlyL2wVabva+y9WVcVBiAMxfRoD4a+IM0Cp+hr88MEH8cyQw+wACIQJQjRnlvlqwjBmtJAfGIBS4ep+8VJxvxeB+MM5yZlPDGUSAvHEPJGJDULusAQq1T9ND/D97fHXstSZ2WD2LIkWPsWZwb6IASiHubLHIeivHBoM9A0LF7BMsocBKBtCsOdnIm+dk4r67FxTIs1lA50uBqBScrtNCE6ekoozJVK09GkR9AtUaQxAJaUWAkCvgMZ56RdZHlUOA1BpqYYggfKIQagEBiANVkIADEK5GIC0WAsBMAilYgDSZDUE6BGe6A4CFYsBSFWl7xMUg6tGg8EApM5FCGB2k0Rfeo5lUf8YACsqtW2iFGY2YFnUJwbAGpchQFn07fWcDT6OAbDKlEFxCLA71AXOBj0xANZdvCS5H2wXZzgbFIr4TLBtjdPyzakrKMXWb5TcoV8L8aF4NxYuyG97dunQYXOfYl/8bLNmDIArmAXwVJlLJ0/nyzHFIWAAHIrWrsnfwXWpuySSo8dEIwbApaoqiTauz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vluMQGAZtXBvEAZ17fC748+M+hEyfuQwmWEGPOp5XuUzgecCkWo8F4h0YwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDUGgFRjAEg1BoBUYwBINQaAVGMASDW82Y2vSCKtov8B9vsf8IxA1OsAAAAASUVORK5CYII="/>
|
8
|
+
</defs>
|
9
|
+
</svg>
|
package/dist/index.d.ts
CHANGED
@@ -10,8 +10,14 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
10
10
|
*/
|
11
11
|
export declare const Card: ForwardRefComponent<CardProps>;
|
12
12
|
|
13
|
+
/**
|
14
|
+
* Static CSS class names used internally for the component slots.
|
15
|
+
*/
|
13
16
|
export declare const cardClassNames: SlotClassNames<CardSlots>;
|
14
17
|
|
18
|
+
/**
|
19
|
+
* CSS variable names used internally for uniform styling in Card.
|
20
|
+
*/
|
15
21
|
export declare const cardCSSVars: {
|
16
22
|
cardSizeVar: string;
|
17
23
|
};
|
@@ -21,20 +27,32 @@ export declare const cardCSSVars: {
|
|
21
27
|
*/
|
22
28
|
export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
|
23
29
|
|
30
|
+
/**
|
31
|
+
* Static CSS class names used internally for the component slots.
|
32
|
+
*/
|
24
33
|
export declare const cardFooterClassNames: SlotClassNames<CardFooterSlots>;
|
25
34
|
|
26
35
|
/**
|
27
|
-
* CardFooter props
|
36
|
+
* CardFooter component props.
|
28
37
|
*/
|
29
38
|
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
30
39
|
|
40
|
+
/**
|
41
|
+
* Slots available in the CardFooter component.
|
42
|
+
*/
|
31
43
|
export declare type CardFooterSlots = {
|
44
|
+
/**
|
45
|
+
* Root element of the component.
|
46
|
+
*/
|
32
47
|
root: Slot<'div'>;
|
48
|
+
/**
|
49
|
+
* Container that renders on the far end of the footer, used for action buttons.
|
50
|
+
*/
|
33
51
|
action?: Slot<'div'>;
|
34
52
|
};
|
35
53
|
|
36
54
|
/**
|
37
|
-
* State used in rendering CardFooter
|
55
|
+
* State used in rendering CardFooter.
|
38
56
|
*/
|
39
57
|
export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
40
58
|
|
@@ -43,24 +61,48 @@ export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
|
43
61
|
*/
|
44
62
|
export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
|
45
63
|
|
64
|
+
/**
|
65
|
+
* Static CSS class names used internally for the component slots.
|
66
|
+
*/
|
46
67
|
export declare const cardHeaderClassNames: SlotClassNames<CardHeaderSlots>;
|
47
68
|
|
48
69
|
/**
|
49
|
-
* CardHeader props
|
70
|
+
* CardHeader component props.
|
50
71
|
*/
|
51
72
|
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
52
73
|
|
74
|
+
/**
|
75
|
+
* Slots available in the CardHeader component.
|
76
|
+
*/
|
53
77
|
export declare type CardHeaderSlots = {
|
78
|
+
/**
|
79
|
+
* Root element of the component.
|
80
|
+
*/
|
54
81
|
root: Slot<'div'>;
|
82
|
+
/**
|
83
|
+
* Element used to render an image or avatar related to the card.
|
84
|
+
*/
|
55
85
|
image: Slot<'div'>;
|
86
|
+
/**
|
87
|
+
* Parent container of the header and description slots.
|
88
|
+
*/
|
56
89
|
content?: Slot<'div'>;
|
90
|
+
/**
|
91
|
+
* Element used to render the main header title.
|
92
|
+
*/
|
57
93
|
header: Slot<'span'>;
|
94
|
+
/**
|
95
|
+
* Element used to render short descriptions related to the title.
|
96
|
+
*/
|
58
97
|
description: Slot<'span'>;
|
98
|
+
/**
|
99
|
+
* Container that renders on the far end of the footer, used for action buttons.
|
100
|
+
*/
|
59
101
|
action?: Slot<'div'>;
|
60
102
|
};
|
61
103
|
|
62
104
|
/**
|
63
|
-
* State used in rendering CardHeader
|
105
|
+
* State used in rendering CardHeader.
|
64
106
|
*/
|
65
107
|
export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
66
108
|
|
@@ -69,25 +111,37 @@ export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
|
69
111
|
*/
|
70
112
|
export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
|
71
113
|
|
114
|
+
/**
|
115
|
+
* Static CSS class names used internally for the component slots.
|
116
|
+
*/
|
72
117
|
export declare const cardPreviewClassNames: SlotClassNames<CardPreviewSlots>;
|
73
118
|
|
74
119
|
/**
|
75
|
-
* CardPreview props
|
120
|
+
* CardPreview component props.
|
76
121
|
*/
|
77
122
|
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
78
123
|
|
124
|
+
/**
|
125
|
+
* Slots available in the Card component.
|
126
|
+
*/
|
79
127
|
export declare type CardPreviewSlots = {
|
128
|
+
/**
|
129
|
+
* Root element of the component.
|
130
|
+
*/
|
80
131
|
root: Slot<'div'>;
|
132
|
+
/**
|
133
|
+
* Container that holds a logo related to the image preview provided.
|
134
|
+
*/
|
81
135
|
logo?: Slot<'div'>;
|
82
136
|
};
|
83
137
|
|
84
138
|
/**
|
85
|
-
* State used in rendering CardPreview
|
139
|
+
* State used in rendering CardPreview.
|
86
140
|
*/
|
87
141
|
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
88
142
|
|
89
143
|
/**
|
90
|
-
* Card
|
144
|
+
* Card component props.
|
91
145
|
*/
|
92
146
|
export declare type CardProps = ComponentProps<CardSlots> & {
|
93
147
|
appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
@@ -109,38 +163,55 @@ export declare type CardProps = ComponentProps<CardSlots> & {
|
|
109
163
|
* This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus
|
110
164
|
* after the last inner element.
|
111
165
|
*
|
112
|
-
* @
|
166
|
+
* @default 'off'
|
113
167
|
*/
|
114
168
|
focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';
|
169
|
+
/**
|
170
|
+
* Defines the orientation of the card.
|
171
|
+
*
|
172
|
+
* @default 'vertical'
|
173
|
+
*/
|
174
|
+
orientation?: 'horizontal' | 'vertical';
|
175
|
+
/**
|
176
|
+
* Controls the card's border radius and padding between inner elements.
|
177
|
+
*
|
178
|
+
* @default 'medium'
|
179
|
+
*/
|
115
180
|
size?: 'small' | 'medium' | 'large';
|
116
181
|
};
|
117
182
|
|
183
|
+
/**
|
184
|
+
* Slots available in the Card component.
|
185
|
+
*/
|
118
186
|
export declare type CardSlots = {
|
187
|
+
/**
|
188
|
+
* Root element of the component.
|
189
|
+
*/
|
119
190
|
root: Slot<'div'>;
|
120
191
|
};
|
121
192
|
|
122
193
|
/**
|
123
|
-
* State used in rendering Card
|
194
|
+
* State used in rendering Card.
|
124
195
|
*/
|
125
|
-
export declare type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance' | 'size'>>;
|
196
|
+
export declare type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'>>;
|
126
197
|
|
127
198
|
/**
|
128
|
-
* Render the final JSX of Card
|
199
|
+
* Render the final JSX of Card.
|
129
200
|
*/
|
130
201
|
export declare const renderCard_unstable: (state: CardState) => JSX.Element;
|
131
202
|
|
132
203
|
/**
|
133
|
-
* Render the final JSX of CardFooter
|
204
|
+
* Render the final JSX of CardFooter.
|
134
205
|
*/
|
135
206
|
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
136
207
|
|
137
208
|
/**
|
138
|
-
* Render the final JSX of CardHeader
|
209
|
+
* Render the final JSX of CardHeader.
|
139
210
|
*/
|
140
211
|
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
141
212
|
|
142
213
|
/**
|
143
|
-
* Render the final JSX of CardPreview
|
214
|
+
* Render the final JSX of CardPreview.
|
144
215
|
*/
|
145
216
|
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
146
217
|
|
@@ -167,7 +238,7 @@ export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLE
|
|
167
238
|
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
168
239
|
|
169
240
|
/**
|
170
|
-
* Apply styling to the CardFooter slots based on the state
|
241
|
+
* Apply styling to the CardFooter slots based on the state.
|
171
242
|
*/
|
172
243
|
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
173
244
|
|
@@ -183,7 +254,7 @@ export declare const useCardFooterStyles_unstable: (state: CardFooterState) => C
|
|
183
254
|
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
184
255
|
|
185
256
|
/**
|
186
|
-
* Apply styling to the CardHeader slots based on the state
|
257
|
+
* Apply styling to the CardHeader slots based on the state.
|
187
258
|
*/
|
188
259
|
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
189
260
|
|
@@ -199,12 +270,12 @@ export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => C
|
|
199
270
|
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
200
271
|
|
201
272
|
/**
|
202
|
-
* Apply styling to the CardPreview slots based on the state
|
273
|
+
* Apply styling to the CardPreview slots based on the state.
|
203
274
|
*/
|
204
275
|
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
205
276
|
|
206
277
|
/**
|
207
|
-
* Apply styling to the Card slots based on the state
|
278
|
+
* Apply styling to the Card slots based on the state.
|
208
279
|
*/
|
209
280
|
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
210
281
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.types.js","sourceRoot":"../src/","sources":["components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * Card
|
1
|
+
{"version":3,"file":"Card.types.js","sourceRoot":"../src/","sources":["components/Card/Card.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 CardSlots = {\n /**\n * Root element of the component.\n */\n root: Slot<'div'>;\n};\n\n/**\n * Card component props.\n */\nexport type CardProps = ComponentProps<CardSlots> & {\n appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';\n\n /**\n * Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.\n *\n * `off`\n * The card will not focusable.\n *\n * `no-tab`\n * This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when\n * pressing the Escape key.\n *\n * `tab-exit`\n * This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing\n * the Tab key on the last inner element.\n *\n * `tab-only`\n * This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus\n * after the last inner element.\n *\n * @default 'off'\n */\n focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';\n\n /**\n * Defines the orientation of the card.\n *\n * @default 'vertical'\n */\n orientation?: 'horizontal' | 'vertical';\n\n /**\n * Controls the card's border radius and padding between inner elements.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering Card.\n */\nexport type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'>>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Card/renderCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAY,KAAZ,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardSlots, CardState } from './Card.types';\n\n/**\n * Render the final JSX of Card
|
1
|
+
{"version":3,"sources":["components/Card/renderCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAI,KAAD,IAAqB;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAY,KAAZ,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardSlots, CardState } from './Card.types';\n\n/**\n * Render the final JSX of Card.\n */\nexport const renderCard_unstable = (state: CardState) => {\n const { slots, slotProps } = getSlots<CardSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
|
@@ -14,6 +14,7 @@ export const useCard_unstable = (props, ref) => {
|
|
14
14
|
const {
|
15
15
|
appearance = 'filled',
|
16
16
|
focusMode = 'off',
|
17
|
+
orientation = 'vertical',
|
17
18
|
size = 'medium'
|
18
19
|
} = props;
|
19
20
|
const focusMap = {
|
@@ -31,6 +32,7 @@ export const useCard_unstable = (props, ref) => {
|
|
31
32
|
} : null;
|
32
33
|
return {
|
33
34
|
appearance,
|
35
|
+
orientation,
|
34
36
|
size,
|
35
37
|
components: {
|
36
38
|
root: 'div'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Card/useCard.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,iBAAT,QAAkC,yBAAlC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,gBAAgB,GAAG,CAAC,KAAD,EAAmB,GAAnB,KAA6D;EAC3F,MAAM;IAAE,UAAU,GAAG,QAAf;IAAyB,SAAS,GAAG,KAArC;IAA4C,IAAI,GAAG;
|
1
|
+
{"version":3,"sources":["components/Card/useCard.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,iBAAT,QAAkC,yBAAlC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,gBAAgB,GAAG,CAAC,KAAD,EAAmB,GAAnB,KAA6D;EAC3F,MAAM;IAAE,UAAU,GAAG,QAAf;IAAyB,SAAS,GAAG,KAArC;IAA4C,WAAW,GAAG,UAA1D;IAAsE,IAAI,GAAG;EAA7E,IAA0F,KAAhG;EAEA,MAAM,QAAQ,GAAG;IACf,GAAG,EAAE,SADU;IAEf,UAAU,oBAFK;IAGf,YAAY,SAHG;IAIf,YAAY;EAJG,CAAjB;EAOA,MAAM,aAAa,GAAG,iBAAiB,CAAC;IACtC,WAAW,EAAE,QAAQ,CAAC,SAAD;EADiB,CAAD,CAAvC;EAIA,MAAM,UAAU,GAAG,SAAS,KAAK,KAAd,GAAsB;IAAE,QAAQ,EAAE,CAAZ;IAAe,GAAG;EAAlB,CAAtB,GAA0D,IAA7E;EAEA,OAAO;IACL,UADK;IAEL,WAFK;IAGL,IAHK;IAKL,UAAU,EAAE;MAAE,IAAI,EAAE;IAAR,CALP;IAML,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAN,IAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,IAAI,EAAE,OAFuC;MAG7C,GAAG,UAH0C;MAI7C,GAAG;IAJ0C,CAApB;EANtB,CAAP;AAaD,CA7BM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { CardProps, CardState } from './Card.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Card.\n *\n * The returned state can be modified with hooks such as useCardStyles_unstable,\n * before being passed to renderCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param ref - reference to root HTMLElement of Card\n */\nexport const useCard_unstable = (props: CardProps, ref: React.Ref<HTMLElement>): CardState => {\n const { appearance = 'filled', focusMode = 'off', orientation = 'vertical', size = 'medium' } = props;\n\n const focusMap = {\n off: undefined,\n 'no-tab': 'limited-trap-focus',\n 'tab-exit': 'limited',\n 'tab-only': 'unlimited',\n } as const;\n\n const groupperAttrs = useFocusableGroup({\n tabBehavior: focusMap[focusMode],\n });\n\n const focusAttrs = focusMode !== 'off' ? { tabIndex: 0, ...groupperAttrs } : null;\n\n return {\n appearance,\n orientation,\n size,\n\n components: { root: 'div' },\n root: getNativeElementProps(props.as || 'div', {\n ref,\n role: 'group',\n ...focusAttrs,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,20 +1,26 @@
|
|
1
1
|
import { shorthands, __styles, mergeClasses } from '@griffel/react';
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
3
|
-
import { cardPreviewClassNames } from '../CardPreview/
|
3
|
+
import { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';
|
4
|
+
import { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';
|
5
|
+
import { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';
|
6
|
+
/**
|
7
|
+
* Static CSS class names used internally for the component slots.
|
8
|
+
*/
|
9
|
+
|
4
10
|
export const cardClassNames = {
|
5
11
|
root: 'fui-Card'
|
6
12
|
};
|
13
|
+
/**
|
14
|
+
* CSS variable names used internally for uniform styling in Card.
|
15
|
+
*/
|
16
|
+
|
7
17
|
export const cardCSSVars = {
|
8
18
|
cardSizeVar: '--fui-Card--size'
|
9
19
|
};
|
10
|
-
/**
|
11
|
-
* Styles for the root slot
|
12
|
-
*/
|
13
20
|
|
14
21
|
const useStyles = /*#__PURE__*/__styles({
|
15
22
|
"root": {
|
16
23
|
"mc9l5x": "f22iagw",
|
17
|
-
"Beiy3e4": "f1vx9l62",
|
18
24
|
"qhf8xq": "f10pi13n",
|
19
25
|
"B68tc82": "f1p9o1ba",
|
20
26
|
"Bmxbyg5": "f1sil6mw",
|
@@ -40,6 +46,18 @@ const useStyles = /*#__PURE__*/__styles({
|
|
40
46
|
"uwmqm3": ["f1k04kkk", "f10m5gbb"],
|
41
47
|
"i8kkvl": "fxsr4vj",
|
42
48
|
"Belr9w4": "fcvsdzp",
|
49
|
+
"B2jhnfs": "f16v3d5c",
|
50
|
+
"wiictr": "f1su8t2g"
|
51
|
+
},
|
52
|
+
"orientationHorizontal": {
|
53
|
+
"Beiy3e4": "f1063pyq",
|
54
|
+
"Bt984gj": "f122n59",
|
55
|
+
"Bnoktp0": "fpfyeui",
|
56
|
+
"Idhjb2": "fwi74qw",
|
57
|
+
"Bsdbyht": ["f1yfsbdm", "f1vk4t4a"]
|
58
|
+
},
|
59
|
+
"orientationVertical": {
|
60
|
+
"Beiy3e4": "f1vx9l62",
|
43
61
|
"Bt4kzjz": ["fobhde4", "fx5r7kn"],
|
44
62
|
"B1ou843": ["fx5r7kn", "fobhde4"],
|
45
63
|
"ydhu1d": "frl7skw"
|
@@ -162,24 +180,28 @@ const useStyles = /*#__PURE__*/__styles({
|
|
162
180
|
"Gp14am": ["fzybk4o", "fpgykix"]
|
163
181
|
}
|
164
182
|
}, {
|
165
|
-
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".
|
183
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f10pi13n{position:relative;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1mdlcz9::after{position:absolute;}", ".frwkxtg::after{top:0;}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right:0;}", ".fo72kxq::after{bottom:0;}", ".f13zj6fq::after{content:\"\";}", ".f1nwj1ja::after{pointer-events:none;}", ".f8rth92::after{border-top-style:solid;}", ".flthirb::after{border-right-style:solid;}", ".ftkbnf5::after{border-left-style:solid;}", ".f1lh990p::after{border-bottom-style:solid;}", ".f6czdpx::after{border-top-width:var(--strokeWidthThin);}", ".f13hvwk3::after{border-right-width:var(--strokeWidthThin);}", ".f1en4csx::after{border-left-width:var(--strokeWidthThin);}", ".f1i1u9k0::after{border-bottom-width:var(--strokeWidthThin);}", ".f1lplnzb{padding-top:var(--fui-Card--size);}", ".f10m5gbb{padding-right:var(--fui-Card--size);}", ".f1k04kkk{padding-left:var(--fui-Card--size);}", ".fhftqfp{padding-bottom:var(--fui-Card--size);}", ".fxsr4vj{-webkit-column-gap:var(--fui-Card--size);column-gap:var(--fui-Card--size);}", ".fcvsdzp{row-gap:var(--fui-Card--size);}", ".f16v3d5c>.fui-CardHeader,.f16v3d5c>.fui-CardFooter{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f1su8t2g>:not(.fui-CardPreview):not(.fui-CardHeader):not(.fui-CardFooter){-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fpfyeui>.fui-CardPreview{margin-top:calc(var(--fui-Card--size) * -1);}", ".fwi74qw>.fui-CardPreview{margin-bottom:calc(var(--fui-Card--size) * -1);}", ".f1yfsbdm>:not([aria-hidden=\"true\"]):first-of-type.fui-CardPreview{margin-left:calc(var(--fui-Card--size) * -1);}", ".f1vk4t4a>:not([aria-hidden=\"true\"]):first-of-type.fui-CardPreview{margin-right:calc(var(--fui-Card--size) * -1);}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".fobhde4>.fui-CardPreview{margin-left:calc(var(--fui-Card--size) * -1);}", ".fx5r7kn>.fui-CardPreview{margin-right:calc(var(--fui-Card--size) * -1);}", ".frl7skw>:not([aria-hidden=\"true\"]):first-of-type.fui-CardPreview{margin-top:calc(var(--fui-Card--size) * -1);}", ".f1pi9uxy{--fui-Card--size:8px;}", ".f1g3puop{border-bottom-right-radius:var(--borderRadiusSmall);}", ".fi2rrw2{border-bottom-left-radius:var(--borderRadiusSmall);}", ".f1rstyi9{border-top-right-radius:var(--borderRadiusSmall);}", ".f1s4nn1u{border-top-left-radius:var(--borderRadiusSmall);}", ".frsmuga{--fui-Card--size:12px;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1qua4xo{--fui-Card--size:16px;}", ".f1ldthgs{border-bottom-right-radius:var(--borderRadiusLarge);}", ".frrelxk{border-bottom-left-radius:var(--borderRadiusLarge);}", ".fobrfso{border-top-right-radius:var(--borderRadiusLarge);}", ".ffisxpw{border-top-left-radius:var(--borderRadiusLarge);}", ".f1k6fduh{cursor:pointer;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1whvlc6{box-shadow:var(--shadow4);}", ".f16gxe2i::after{border-top-color:var(--colorTransparentStroke);}", ".fpgykix::after{border-right-color:var(--colorTransparentStroke);}", ".fzybk4o::after{border-left-color:var(--colorTransparentStroke);}", ".f1osi826::after{border-bottom-color:var(--colorTransparentStroke);}", ".f1dmdbja{background-color:var(--colorNeutralBackground2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1couhl3{box-shadow:none;}", ".ft83z1f::after{border-top-color:var(--colorNeutralStroke1);}", ".f1g4150c::after{border-right-color:var(--colorNeutralStroke1);}", ".f192dr6e::after{border-left-color:var(--colorNeutralStroke1);}", ".f1qnawh6::after{border-bottom-color:var(--colorNeutralStroke1);}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"],
|
166
184
|
"h": [".ftr40te:hover::after{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fcsoo7g:hover::after{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f1rl4q8i:hover::after{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fbb4roj:hover::after{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".f1m145df:hover{box-shadow:var(--shadow8);}", ".f1uvynv3:hover{background-color:var(--colorNeutralBackground2Hover);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f1llr77y:hover::after{border-top-color:var(--colorNeutralStroke1Hover);}", ".fzk0khw:hover::after{border-right-color:var(--colorNeutralStroke1Hover);}", ".fjj8tog:hover::after{border-left-color:var(--colorNeutralStroke1Hover);}", ".fb1u8ub:hover::after{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
167
185
|
"a": [".fd4vwcp:active::after{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f1crelnc:active::after{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fup9tr0:active::after{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f12d33p4:active::after{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".f1yhgkbh:active{background-color:var(--colorNeutralBackground2Pressed);}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f1uohb70:active::after{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1jm7v1n:active::after{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1bus3rq:active::after{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f1fbu7rr:active::after{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
168
186
|
});
|
169
187
|
/**
|
170
|
-
* Apply styling to the Card slots based on the state
|
188
|
+
* Apply styling to the Card slots based on the state.
|
171
189
|
*/
|
172
190
|
|
173
191
|
|
174
192
|
export const useCardStyles_unstable = state => {
|
175
193
|
const styles = useStyles();
|
194
|
+
const orientationMap = {
|
195
|
+
horizontal: styles.orientationHorizontal,
|
196
|
+
vertical: styles.orientationVertical
|
197
|
+
};
|
176
198
|
const sizeMap = {
|
177
199
|
small: styles.sizeSmall,
|
178
200
|
medium: styles.sizeMedium,
|
179
201
|
large: styles.sizeLarge
|
180
202
|
};
|
181
203
|
const interactive = state.root.onClick || state.root.onMouseUp || state.root.onMouseDown || state.root.onPointerUp || state.root.onPointerDown || state.root.onTouchStart || state.root.onTouchEnd;
|
182
|
-
state.root.className = mergeClasses(cardClassNames.root, styles.root, sizeMap[state.size], state.appearance === 'filled' && styles.filled, state.appearance === 'filled-alternative' && styles.filledAlternative, state.appearance === 'outline' && styles.outline, state.appearance === 'subtle' && styles.subtle, interactive && state.appearance === 'filled' && styles.filledInteractive, interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive, interactive && state.appearance === 'outline' && styles.outlineInteractive, interactive && state.appearance === 'subtle' && styles.subtleInteractive, interactive && state.appearance !== 'outline' && styles.interactiveNoOutline, state.root.className);
|
204
|
+
state.root.className = mergeClasses(cardClassNames.root, styles.root, orientationMap[state.orientation], sizeMap[state.size], state.appearance === 'filled' && styles.filled, state.appearance === 'filled-alternative' && styles.filledAlternative, state.appearance === 'outline' && styles.outline, state.appearance === 'subtle' && styles.subtle, interactive && state.appearance === 'filled' && styles.filledInteractive, interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive, interactive && state.appearance === 'outline' && styles.outlineInteractive, interactive && state.appearance === 'subtle' && styles.subtleInteractive, interactive && state.appearance !== 'outline' && styles.interactiveNoOutline, state.root.className);
|
183
205
|
return state;
|
184
206
|
};
|
185
207
|
//# sourceMappingURL=useCardStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources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W,IAAI,KAAK,CAAC,UAAN,KAAqB,SAApC,IAAiD,MAAM,CAAC,oBAZvB,EAajC,KAAK,CAAC,IAAN,CAAW,SAbsB,CAAnC;EAgBA,OAAO,KAAP;AACD,CAnCM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { cardPreviewClassNames } from '../CardPreview/index';\nimport type { CardSlots, CardState } from './Card.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const cardClassNames: SlotClassNames<CardSlots> = {\n root: 'fui-Card',\n};\nexport const cardCSSVars = {\n cardSizeVar: '--fui-Card--size',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n color: tokens.colorNeutralForeground1,\n\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 },\n\n ...shorthands.padding(`var(${cardCSSVars.cardSizeVar})`),\n ...shorthands.gap(`var(${cardCSSVars.cardSizeVar})`),\n\n [`> .${cardPreviewClassNames.root}`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n marginRight: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n [`> :not([aria-hidden=\"true\"]):first-of-type.${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n },\n\n sizeSmall: {\n [cardCSSVars.cardSizeVar]: '8px',\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n },\n sizeMedium: {\n [cardCSSVars.cardSizeVar]: '12px',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n sizeLarge: {\n [cardCSSVars.cardSizeVar]: '16px',\n ...shorthands.borderRadius(tokens.borderRadiusLarge),\n },\n\n interactiveNoOutline: {\n ':hover::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n ':active::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\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 filled: {\n backgroundColor: tokens.colorNeutralBackground1,\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 filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\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 outline: {\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\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 subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\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 sizeMap = {\n small: styles.sizeSmall,\n medium: styles.sizeMedium,\n large: styles.sizeLarge,\n } as const;\n\n const interactive =\n state.root.onClick ||\n state.root.onMouseUp ||\n state.root.onMouseDown ||\n state.root.onPointerUp ||\n state.root.onPointerDown ||\n state.root.onTouchStart ||\n state.root.onTouchEnd;\n\n state.root.className = mergeClasses(\n cardClassNames.root,\n styles.root,\n sizeMap[state.size],\n state.appearance === 'filled' && styles.filled,\n state.appearance === 'filled-alternative' && styles.filledAlternative,\n state.appearance === 'outline' && styles.outline,\n state.appearance === 'subtle' && styles.subtle,\n interactive && state.appearance === 'filled' && styles.filledInteractive,\n interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive,\n interactive && state.appearance === 'outline' && styles.outlineInteractive,\n interactive && state.appearance === 'subtle' && styles.subtleInteractive,\n interactive && state.appearance !== 'outline' && styles.interactiveNoOutline,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
1
|
+
{"version":3,"sources":["components/Card/useCardStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,qBAAT,QAAsC,qCAAtC;AACA,SAAS,oBAA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N,KAAqB,SAApC,IAAiD,MAAM,CAAC,kBAXvB,EAYjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,QAApC,IAAgD,MAAM,CAAC,iBAZtB,EAajC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,SAApC,IAAiD,MAAM,CAAC,oBAbvB,EAcjC,KAAK,CAAC,IAAN,CAAW,SAdsB,CAAnC;EAiBA,OAAO,KAAP;AACD,CAzCM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';\nimport { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';\nimport { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';\nimport type { CardSlots, CardState } from './Card.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * Static CSS class names used internally for the component slots.\n */\nexport const cardClassNames: SlotClassNames<CardSlots> = {\n root: 'fui-Card',\n};\n\n/**\n * CSS variable names used internally for uniform styling in Card.\n */\nexport const cardCSSVars = {\n cardSizeVar: '--fui-Card--size',\n};\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n position: 'relative',\n ...shorthands.overflow('hidden'),\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 },\n\n ...shorthands.padding(`var(${cardCSSVars.cardSizeVar})`),\n ...shorthands.gap(`var(${cardCSSVars.cardSizeVar})`),\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\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\"]):first-of-type.${cardPreviewClassNames.root}`]: {\n marginLeft: `calc(var(${cardCSSVars.cardSizeVar}) * -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 // 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\"]):first-of-type.${cardPreviewClassNames.root}`]: {\n marginTop: `calc(var(${cardCSSVars.cardSizeVar}) * -1)`,\n },\n },\n\n sizeSmall: {\n [cardCSSVars.cardSizeVar]: '8px',\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n },\n sizeMedium: {\n [cardCSSVars.cardSizeVar]: '12px',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n sizeLarge: {\n [cardCSSVars.cardSizeVar]: '16px',\n ...shorthands.borderRadius(tokens.borderRadiusLarge),\n },\n\n interactiveNoOutline: {\n ':hover::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n ':active::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\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 filled: {\n backgroundColor: tokens.colorNeutralBackground1,\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 filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\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 outline: {\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\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 subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\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 } as const;\n\n const sizeMap = {\n small: styles.sizeSmall,\n medium: styles.sizeMedium,\n large: styles.sizeLarge,\n } as const;\n\n const interactive =\n state.root.onClick ||\n state.root.onMouseUp ||\n state.root.onMouseDown ||\n state.root.onPointerUp ||\n state.root.onPointerDown ||\n state.root.onTouchStart ||\n state.root.onTouchEnd;\n\n state.root.className = mergeClasses(\n cardClassNames.root,\n styles.root,\n orientationMap[state.orientation],\n sizeMap[state.size],\n state.appearance === 'filled' && styles.filled,\n state.appearance === 'filled-alternative' && styles.filledAlternative,\n state.appearance === 'outline' && styles.outline,\n state.appearance === 'subtle' && styles.subtle,\n interactive && state.appearance === 'filled' && styles.filledInteractive,\n interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive,\n interactive && state.appearance === 'outline' && styles.outlineInteractive,\n interactive && state.appearance === 'subtle' && styles.subtleInteractive,\n interactive && state.appearance !== 'outline' && styles.interactiveNoOutline,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardFooter.types.js","sourceRoot":"../src/","sources":["components/CardFooter/CardFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardFooterSlots = {\n root: Slot<'div'>;\n action?: Slot<'div'>;\n};\n\n/**\n * CardFooter props
|
1
|
+
{"version":3,"file":"CardFooter.types.js","sourceRoot":"../src/","sources":["components/CardFooter/CardFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\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 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/CardFooter/renderCardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;EAClE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAkB,KAAlB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFnB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardFooterSlots, CardFooterState } from './CardFooter.types';\n\n/**\n * Render the final JSX of CardFooter
|
1
|
+
{"version":3,"sources":["components/CardFooter/renderCardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;EAClE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAkB,KAAlB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFnB,CADF;AAMD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardFooterSlots, CardFooterState } from './CardFooter.types';\n\n/**\n * Render the final JSX of CardFooter.\n */\nexport const renderCardFooter_unstable = (state: CardFooterState) => {\n const { slots, slotProps } = getSlots<CardFooterSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slotProps.root.children}\n {slots.action && <slots.action {...slotProps.action} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
|
+
/**
|
3
|
+
* Static CSS class names used internally for the component slots.
|
4
|
+
*/
|
5
|
+
|
2
6
|
export const cardFooterClassNames = {
|
3
7
|
root: 'fui-CardFooter',
|
4
8
|
action: 'fui-CardFooter__action'
|
5
9
|
};
|
6
|
-
/**
|
7
|
-
* Styles for the root slot
|
8
|
-
*/
|
9
10
|
|
10
11
|
const useStyles = /*#__PURE__*/__styles({
|
11
12
|
"root": {
|
@@ -21,7 +22,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
21
22
|
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}"]
|
22
23
|
});
|
23
24
|
/**
|
24
|
-
* Apply styling to the CardFooter slots based on the state
|
25
|
+
* Apply styling to the CardFooter slots based on the state.
|
25
26
|
*/
|
26
27
|
|
27
28
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/CardFooter/useCardFooterStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,oBAAoB,GAAoC;EACnE,IAAI,EAAE,gBAD6D;EAEnE,MAAM,EAAE;AAF2D,CAA9D
|
1
|
+
{"version":3,"sources":["components/CardFooter/useCardFooterStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAoC;EACnE,IAAI,EAAE,gBAD6D;EAEnE,MAAM,EAAE;AAF2D,CAA9D;;AAKP,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAWA;;AAEG;;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;EACtF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,oBAAoB,CAAC,IAAtB,EAA4B,MAAM,CAAC,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAnC;;EAEA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,oBAAoB,CAAC,MAAtB,EAA8B,MAAM,CAAC,MAArC,EAA6C,KAAK,CAAC,MAAN,CAAa,SAA1D,CAArC;EACD;;EAED,OAAO,KAAP;AACD,CATM","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"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardHeader.types.js","sourceRoot":"../src/","sources":["components/CardHeader/CardHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardHeaderSlots = {\n root: Slot<'div'>;\n image: Slot<'div'>;\n content?: Slot<'div'>;\n header: Slot<'span'>;\n description: Slot<'span'>;\n action?: Slot<'div'>;\n};\n\n/**\n * CardHeader props
|
1
|
+
{"version":3,"file":"CardHeader.types.js","sourceRoot":"../src/","sources":["components/CardHeader/CardHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\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'>;\n\n /**\n * Parent container of the header and description slots.\n */\n content?: Slot<'div'>;\n\n /**\n * Element used to render the main header title.\n */\n header: Slot<'span'>;\n\n /**\n * Element used to render short descriptions related to the title.\n */\n description: Slot<'span'>;\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"]}
|