@fluentui/react-card 9.0.0-beta.4 → 9.0.0-beta.41

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.
Files changed (191) hide show
  1. package/CHANGELOG.json +1756 -9
  2. package/CHANGELOG.md +530 -40
  3. package/README.md +68 -4
  4. package/dist/index.d.ts +388 -0
  5. package/lib/Card.js.map +1 -1
  6. package/lib/CardFooter.js.map +1 -1
  7. package/lib/CardHeader.js.map +1 -1
  8. package/lib/CardPreview.js.map +1 -1
  9. package/lib/components/Card/Card.js +8 -7
  10. package/lib/components/Card/Card.js.map +1 -1
  11. package/lib/components/Card/Card.types.js.map +1 -1
  12. package/lib/components/Card/CardContext.js +29 -0
  13. package/lib/components/Card/CardContext.js.map +1 -0
  14. package/lib/components/Card/index.js +1 -0
  15. package/lib/components/Card/index.js.map +1 -1
  16. package/lib/components/Card/renderCard.js +12 -4
  17. package/lib/components/Card/renderCard.js.map +1 -1
  18. package/lib/components/Card/useCard.js +87 -15
  19. package/lib/components/Card/useCard.js.map +1 -1
  20. package/lib/components/Card/useCardContextValue.js +8 -0
  21. package/lib/components/Card/useCardContextValue.js.map +1 -0
  22. package/lib/components/Card/useCardSelectable.js +105 -0
  23. package/lib/components/Card/useCardSelectable.js.map +1 -0
  24. package/lib/components/Card/useCardStyles.js +326 -34
  25. package/lib/components/Card/useCardStyles.js.map +1 -1
  26. package/lib/components/CardFooter/CardFooter.js +6 -7
  27. package/lib/components/CardFooter/CardFooter.js.map +1 -1
  28. package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
  29. package/lib/components/CardFooter/index.js.map +1 -1
  30. package/lib/components/CardFooter/renderCardFooter.js +8 -6
  31. package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
  32. package/lib/components/CardFooter/useCardFooter.js +3 -9
  33. package/lib/components/CardFooter/useCardFooter.js.map +1 -1
  34. package/lib/components/CardFooter/useCardFooterStyles.js +18 -19
  35. package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
  36. package/lib/components/CardHeader/CardHeader.js +6 -7
  37. package/lib/components/CardHeader/CardHeader.js.map +1 -1
  38. package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
  39. package/lib/components/CardHeader/index.js.map +1 -1
  40. package/lib/components/CardHeader/renderCardHeader.js +14 -6
  41. package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
  42. package/lib/components/CardHeader/useCardHeader.js +31 -18
  43. package/lib/components/CardHeader/useCardHeader.js.map +1 -1
  44. package/lib/components/CardHeader/useCardHeaderStyles.js +51 -39
  45. package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
  46. package/lib/components/CardPreview/CardPreview.js +6 -7
  47. package/lib/components/CardPreview/CardPreview.js.map +1 -1
  48. package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
  49. package/lib/components/CardPreview/index.js.map +1 -1
  50. package/lib/components/CardPreview/renderCardPreview.js +8 -6
  51. package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
  52. package/lib/components/CardPreview/useCardPreview.js +36 -11
  53. package/lib/components/CardPreview/useCardPreview.js.map +1 -1
  54. package/lib/components/CardPreview/useCardPreviewStyles.js +22 -27
  55. package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
  56. package/lib/index.js +5 -4
  57. package/lib/index.js.map +1 -1
  58. package/lib-commonjs/Card.js +0 -2
  59. package/lib-commonjs/Card.js.map +1 -1
  60. package/lib-commonjs/CardFooter.js +0 -2
  61. package/lib-commonjs/CardFooter.js.map +1 -1
  62. package/lib-commonjs/CardHeader.js +0 -2
  63. package/lib-commonjs/CardHeader.js.map +1 -1
  64. package/lib-commonjs/CardPreview.js +0 -2
  65. package/lib-commonjs/CardPreview.js.map +1 -1
  66. package/lib-commonjs/components/Card/Card.js +5 -9
  67. package/lib-commonjs/components/Card/Card.js.map +1 -1
  68. package/lib-commonjs/components/Card/Card.types.js.map +1 -1
  69. package/lib-commonjs/components/Card/CardContext.js +36 -0
  70. package/lib-commonjs/components/Card/CardContext.js.map +1 -0
  71. package/lib-commonjs/components/Card/index.js +1 -6
  72. package/lib-commonjs/components/Card/index.js.map +1 -1
  73. package/lib-commonjs/components/Card/renderCard.js +14 -10
  74. package/lib-commonjs/components/Card/renderCard.js.map +1 -1
  75. package/lib-commonjs/components/Card/useCard.js +87 -19
  76. package/lib-commonjs/components/Card/useCard.js.map +1 -1
  77. package/lib-commonjs/components/Card/useCardContextValue.js +15 -0
  78. package/lib-commonjs/components/Card/useCardContextValue.js.map +1 -0
  79. package/lib-commonjs/components/Card/useCardSelectable.js +112 -0
  80. package/lib-commonjs/components/Card/useCardSelectable.js.map +1 -0
  81. package/lib-commonjs/components/Card/useCardStyles.js +329 -41
  82. package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
  83. package/lib-commonjs/components/CardFooter/CardFooter.js +3 -9
  84. package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
  85. package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -1
  86. package/lib-commonjs/components/CardFooter/index.js +0 -6
  87. package/lib-commonjs/components/CardFooter/index.js.map +1 -1
  88. package/lib-commonjs/components/CardFooter/renderCardFooter.js +10 -13
  89. package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
  90. package/lib-commonjs/components/CardFooter/useCardFooter.js +5 -14
  91. package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
  92. package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +21 -25
  93. package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
  94. package/lib-commonjs/components/CardHeader/CardHeader.js +3 -9
  95. package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
  96. package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -1
  97. package/lib-commonjs/components/CardHeader/index.js +0 -6
  98. package/lib-commonjs/components/CardHeader/index.js.map +1 -1
  99. package/lib-commonjs/components/CardHeader/renderCardHeader.js +16 -13
  100. package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
  101. package/lib-commonjs/components/CardHeader/useCardHeader.js +32 -23
  102. package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
  103. package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +54 -45
  104. package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
  105. package/lib-commonjs/components/CardPreview/CardPreview.js +3 -9
  106. package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
  107. package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -1
  108. package/lib-commonjs/components/CardPreview/index.js +0 -6
  109. package/lib-commonjs/components/CardPreview/index.js.map +1 -1
  110. package/lib-commonjs/components/CardPreview/renderCardPreview.js +10 -13
  111. package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
  112. package/lib-commonjs/components/CardPreview/useCardPreview.js +37 -15
  113. package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
  114. package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +25 -33
  115. package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
  116. package/lib-commonjs/index.js +150 -10
  117. package/lib-commonjs/index.js.map +1 -1
  118. package/package.json +30 -29
  119. package/assets/ai_deck_template.png +0 -0
  120. package/assets/avatar_elvia.svg +0 -9
  121. package/assets/avatar_mauricio.svg +0 -9
  122. package/assets/doc_template.png +0 -0
  123. package/assets/powerpoint_logo.svg +0 -9
  124. package/assets/sales_template.png +0 -0
  125. package/assets/word_logo.svg +0 -9
  126. package/dist/react-card.d.ts +0 -196
  127. package/lib/Card.d.ts +0 -1
  128. package/lib/CardFooter.d.ts +0 -1
  129. package/lib/CardHeader.d.ts +0 -1
  130. package/lib/CardPreview.d.ts +0 -1
  131. package/lib/common/isConformant.d.ts +0 -4
  132. package/lib/common/isConformant.js +0 -11
  133. package/lib/common/isConformant.js.map +0 -1
  134. package/lib/components/Card/Card.d.ts +0 -6
  135. package/lib/components/Card/Card.types.d.ts +0 -13
  136. package/lib/components/Card/index.d.ts +0 -5
  137. package/lib/components/Card/renderCard.d.ts +0 -5
  138. package/lib/components/Card/useCard.d.ts +0 -12
  139. package/lib/components/Card/useCardStyles.d.ts +0 -6
  140. package/lib/components/CardFooter/CardFooter.d.ts +0 -6
  141. package/lib/components/CardFooter/CardFooter.types.d.ts +0 -13
  142. package/lib/components/CardFooter/index.d.ts +0 -5
  143. package/lib/components/CardFooter/renderCardFooter.d.ts +0 -5
  144. package/lib/components/CardFooter/useCardFooter.d.ts +0 -16
  145. package/lib/components/CardFooter/useCardFooterStyles.d.ts +0 -6
  146. package/lib/components/CardHeader/CardHeader.d.ts +0 -6
  147. package/lib/components/CardHeader/CardHeader.types.d.ts +0 -17
  148. package/lib/components/CardHeader/index.d.ts +0 -5
  149. package/lib/components/CardHeader/renderCardHeader.d.ts +0 -5
  150. package/lib/components/CardHeader/useCardHeader.d.ts +0 -13
  151. package/lib/components/CardHeader/useCardHeaderStyles.d.ts +0 -6
  152. package/lib/components/CardPreview/CardPreview.d.ts +0 -6
  153. package/lib/components/CardPreview/CardPreview.types.d.ts +0 -13
  154. package/lib/components/CardPreview/index.d.ts +0 -5
  155. package/lib/components/CardPreview/renderCardPreview.d.ts +0 -5
  156. package/lib/components/CardPreview/useCardPreview.d.ts +0 -16
  157. package/lib/components/CardPreview/useCardPreviewStyles.d.ts +0 -6
  158. package/lib/index.d.ts +0 -4
  159. package/lib/tsdoc-metadata.json +0 -11
  160. package/lib-commonjs/Card.d.ts +0 -1
  161. package/lib-commonjs/CardFooter.d.ts +0 -1
  162. package/lib-commonjs/CardHeader.d.ts +0 -1
  163. package/lib-commonjs/CardPreview.d.ts +0 -1
  164. package/lib-commonjs/common/isConformant.d.ts +0 -4
  165. package/lib-commonjs/common/isConformant.js +0 -22
  166. package/lib-commonjs/common/isConformant.js.map +0 -1
  167. package/lib-commonjs/components/Card/Card.d.ts +0 -6
  168. package/lib-commonjs/components/Card/Card.types.d.ts +0 -13
  169. package/lib-commonjs/components/Card/index.d.ts +0 -5
  170. package/lib-commonjs/components/Card/renderCard.d.ts +0 -5
  171. package/lib-commonjs/components/Card/useCard.d.ts +0 -12
  172. package/lib-commonjs/components/Card/useCardStyles.d.ts +0 -6
  173. package/lib-commonjs/components/CardFooter/CardFooter.d.ts +0 -6
  174. package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +0 -13
  175. package/lib-commonjs/components/CardFooter/index.d.ts +0 -5
  176. package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +0 -5
  177. package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +0 -16
  178. package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +0 -6
  179. package/lib-commonjs/components/CardHeader/CardHeader.d.ts +0 -6
  180. package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +0 -17
  181. package/lib-commonjs/components/CardHeader/index.d.ts +0 -5
  182. package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +0 -5
  183. package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +0 -13
  184. package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +0 -6
  185. package/lib-commonjs/components/CardPreview/CardPreview.d.ts +0 -6
  186. package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +0 -13
  187. package/lib-commonjs/components/CardPreview/index.d.ts +0 -5
  188. package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +0 -5
  189. package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +0 -16
  190. package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +0 -6
  191. package/lib-commonjs/index.d.ts +0 -4
package/README.md CHANGED
@@ -1,11 +1,75 @@
1
- # @fluentui/react-card
1
+ # @fluentui/react-card [ALPHA]
2
2
 
3
- **React Card components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
3
+ **React Card components for [Fluent UI React](https://react.fluentui.dev)**
4
4
 
5
- These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
5
+ **⚠️ Please note that functionality is still being added to this package. Due to lockstep versioning, the version of this package is aligned with the others in _react-components_.**
6
+
7
+ These are not production-ready components and **should never be used in a product**. This space is useful for testing new components whose APIs might change before final release.
8
+
9
+ ## Usage
6
10
 
7
11
  To import React Card components:
8
12
 
9
13
  ```js
10
- import { ComponentName } from '@fluentui/react-card';
14
+ import { Card, CardPreview, CardHeader, CardFooter } from "@fluentui/react-components/unstable';
15
+ ```
16
+
17
+ Example Card usage:
18
+
19
+ ![example of a Card component in usage](./docs/assets/card-example.png)
20
+
21
+ ```jsx
22
+ import { Share16Regular, ArrowReply16Regular } from '@fluentui/react-icons';
23
+ import { Button, Body1, Caption1 } from '@fluentui/react-components';
24
+ import { Card, CardHeader, CardPreview, CardFooter } from '@fluentui/react-components/unstable';
25
+
26
+ const App = () => (
27
+ <>
28
+ <Card>
29
+ <CardHeader
30
+ image={
31
+ <img
32
+ src="https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/assets/avatar_elvia.svg"
33
+ alt="Face of a person"
34
+ />
35
+ }
36
+ header={
37
+ <Body1>
38
+ <b>Elvia Atkins</b> mentioned you
39
+ </Body1>
40
+ }
41
+ description={<Caption1>5h ago · About us - Overview</Caption1>}
42
+ />
43
+ <CardPreview
44
+ logo={
45
+ <img
46
+ src="https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/assets/word_logo.svg"
47
+ alt="Microsoft Word logo"
48
+ />
49
+ }
50
+ >
51
+ <img
52
+ src="https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card/assets/doc_template.png"
53
+ alt="Preview of a Word document"
54
+ />
55
+ </CardPreview>
56
+ <CardFooter>
57
+ <Button icon={<ArrowReply16Regular />}>Reply</Button>
58
+ <Button icon={<Share16Regular />}>Share</Button>
59
+ </CardFooter>
60
+ </Card>
61
+ </>
62
+ );
11
63
  ```
64
+
65
+ ## Specification
66
+
67
+ See the [Spec.md](./Spec.md) file for background information on the design/engineering decisions of the component.
68
+
69
+ ## API
70
+
71
+ For information about the components, please refer to the [API documentation](https://react.fluentui.dev/?path=/docs/preview-components-card--default).
72
+
73
+ ## Migration
74
+
75
+ For migration information, have a look at the [migration guide](./MIGRATION.md).
@@ -0,0 +1,388 @@
1
+ import type { ComponentProps } from '@fluentui/react-utilities';
2
+ import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
+ import * as React_2 from 'react';
5
+ import type { Slot } from '@fluentui/react-utilities';
6
+ import type { SlotClassNames } from '@fluentui/react-utilities';
7
+
8
+ /**
9
+ * A card provides scaffolding for hosting actions and content for a single topic.
10
+ */
11
+ export declare const Card: ForwardRefComponent<CardProps>;
12
+
13
+ /**
14
+ * Static CSS class names used internally for the component slots.
15
+ */
16
+ export declare const cardClassNames: SlotClassNames<CardSlots>;
17
+
18
+ /**
19
+ * Data shared between card components
20
+ */
21
+ export declare interface CardContextValue {
22
+ selectableA11yProps: {
23
+ referenceId?: string;
24
+ setReferenceId: (referenceId: string) => void;
25
+ referenceLabel?: string;
26
+ setReferenceLabel: (referenceLabel: string) => void;
27
+ };
28
+ }
29
+
30
+ /**
31
+ * CSS variable names used internally for uniform styling in Card.
32
+ */
33
+ export declare const cardCSSVars: {
34
+ cardSizeVar: string;
35
+ cardBorderRadiusVar: string;
36
+ };
37
+
38
+ /**
39
+ * Component to render Button actions in a Card component.
40
+ */
41
+ export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
42
+
43
+ /**
44
+ * Static CSS class names used internally for the component slots.
45
+ */
46
+ export declare const cardFooterClassNames: SlotClassNames<CardFooterSlots>;
47
+
48
+ /**
49
+ * CardFooter component props.
50
+ */
51
+ export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
52
+
53
+ /**
54
+ * Slots available in the CardFooter component.
55
+ */
56
+ export declare type CardFooterSlots = {
57
+ /**
58
+ * Root element of the component.
59
+ */
60
+ root: Slot<'div'>;
61
+ /**
62
+ * Container that renders on the far end of the footer, used for action buttons.
63
+ */
64
+ action?: Slot<'div'>;
65
+ };
66
+
67
+ /**
68
+ * State used in rendering CardFooter.
69
+ */
70
+ export declare type CardFooterState = ComponentState<CardFooterSlots>;
71
+
72
+ /**
73
+ * Component to render an image, text and an action in a Card component.
74
+ */
75
+ export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
76
+
77
+ /**
78
+ * Static CSS class names used internally for the component slots.
79
+ */
80
+ export declare const cardHeaderClassNames: SlotClassNames<CardHeaderSlots>;
81
+
82
+ /**
83
+ * CSS variable names used internally for uniform styling in CardHeader.
84
+ */
85
+ export declare const cardHeaderCSSVars: {
86
+ cardHeaderGapVar: string;
87
+ };
88
+
89
+ /**
90
+ * CardHeader component props.
91
+ */
92
+ export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
93
+
94
+ /**
95
+ * Slots available in the CardHeader component.
96
+ */
97
+ export declare type CardHeaderSlots = {
98
+ /**
99
+ * Root element of the component.
100
+ */
101
+ root: Slot<'div'>;
102
+ /**
103
+ * Element used to render an image or avatar related to the card.
104
+ */
105
+ image: Slot<'div', 'img'>;
106
+ /**
107
+ * Element used to render the main header title.
108
+ */
109
+ header: Slot<'div'>;
110
+ /**
111
+ * Element used to render short descriptions related to the title.
112
+ */
113
+ description: Slot<'div'>;
114
+ /**
115
+ * Container that renders on the far end of the footer, used for action buttons.
116
+ */
117
+ action?: Slot<'div'>;
118
+ };
119
+
120
+ /**
121
+ * State used in rendering CardHeader.
122
+ */
123
+ export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
124
+
125
+ /**
126
+ * Data sent from the selection events on a selectable card.
127
+ */
128
+ declare type CardOnSelectData = {
129
+ selected: boolean;
130
+ };
131
+
132
+ /**
133
+ * Card selected event type
134
+ *
135
+ * This event is fired when a selectable card changes its selection state.
136
+ */
137
+ export declare type CardOnSelectionChangeEvent = React_2.MouseEvent | React_2.KeyboardEvent | React_2.ChangeEvent;
138
+
139
+ /**
140
+ * Component to render image previews of documents or articles in a Card component.
141
+ */
142
+ export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
143
+
144
+ /**
145
+ * Static CSS class names used internally for the component slots.
146
+ */
147
+ export declare const cardPreviewClassNames: SlotClassNames<CardPreviewSlots>;
148
+
149
+ /**
150
+ * CardPreview component props.
151
+ */
152
+ export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
153
+
154
+ /**
155
+ * Slots available in the Card component.
156
+ */
157
+ export declare type CardPreviewSlots = {
158
+ /**
159
+ * Root element of the component.
160
+ */
161
+ root: Slot<'div'>;
162
+ /**
163
+ * Container that holds a logo related to the image preview provided.
164
+ */
165
+ logo?: Slot<'div', 'img'>;
166
+ };
167
+
168
+ /**
169
+ * State used in rendering CardPreview.
170
+ */
171
+ export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
172
+
173
+ /**
174
+ * Card component props.
175
+ */
176
+ export declare type CardProps = ComponentProps<CardSlots> & {
177
+ /**
178
+ * Sets the appearance of the card.
179
+ *
180
+ * `filled`
181
+ * The card will have a shadow, border and background color.
182
+ *
183
+ * `filled-alternative`
184
+ * This appearance is similar to `filled`, but the background color will be a little darker.
185
+ *
186
+ * `outline`
187
+ * This appearance is similar to `filled`, but the background color will be transparent and no shadow applied.
188
+ *
189
+ * `subtle`
190
+ * This appearance is similar to `filled-alternative`, but no border is applied.
191
+ *
192
+ * @default 'filled'
193
+ */
194
+ appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
195
+ /**
196
+ * Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.
197
+ *
198
+ * `off`
199
+ * The card will not focusable.
200
+ *
201
+ * `no-tab`
202
+ * This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when
203
+ * pressing the Escape key.
204
+ *
205
+ * `tab-exit`
206
+ * This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing
207
+ * the Tab key on the last inner element.
208
+ *
209
+ * `tab-only`
210
+ * This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus
211
+ * after the last inner element.
212
+ *
213
+ * @default 'off'
214
+ */
215
+ focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';
216
+ /**
217
+ * Defines the orientation of the card.
218
+ *
219
+ * @default 'vertical'
220
+ */
221
+ orientation?: 'horizontal' | 'vertical';
222
+ /**
223
+ * Controls the card's border radius and padding between inner elements.
224
+ *
225
+ * @default 'medium'
226
+ */
227
+ size?: 'small' | 'medium' | 'large';
228
+ /**
229
+ * Defines the controlled selected state of the card.
230
+ *
231
+ * @default false
232
+ */
233
+ selected?: boolean;
234
+ /**
235
+ * Defines whether the card is initially in a selected state when rendered.
236
+ *
237
+ * @default false
238
+ */
239
+ defaultSelected?: boolean;
240
+ /**
241
+ * Callback to be called when the selected state value changes.
242
+ */
243
+ onSelectionChange?: (event: CardOnSelectionChangeEvent, data: CardOnSelectData) => void;
244
+ };
245
+
246
+ /**
247
+ * @internal
248
+ */
249
+ export declare const CardProvider: React_2.Provider<CardContextValue | undefined>;
250
+
251
+ /**
252
+ * Slots available in the Card component.
253
+ */
254
+ export declare type CardSlots = {
255
+ /**
256
+ * Root element of the component.
257
+ */
258
+ root: Slot<'div'>;
259
+ /**
260
+ * Select element represents a checkbox.
261
+ */
262
+ floatingAction?: Slot<'div'>;
263
+ /**
264
+ * The internal checkbox element that renders when the card is selectable.
265
+ */
266
+ checkbox?: Slot<'input'>;
267
+ };
268
+
269
+ /**
270
+ * State used in rendering Card.
271
+ */
272
+ export declare type CardState = ComponentState<CardSlots> & CardContextValue & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'> & {
273
+ /**
274
+ * Represents a card that contains interactive events (MouseEvents) or is a button/a tag.
275
+ *
276
+ * @default false
277
+ */
278
+ interactive: boolean;
279
+ /**
280
+ * Represents a selectable card.
281
+ *
282
+ * @default false
283
+ */
284
+ selectable: boolean;
285
+ /**
286
+ * Defines whether the card is currently selected.
287
+ *
288
+ * @default false
289
+ */
290
+ selected: boolean;
291
+ /**
292
+ * Defines whether the card internal checkbox is currently focused.
293
+ *
294
+ * @default false
295
+ */
296
+ selectFocused: boolean;
297
+ }>;
298
+
299
+ /**
300
+ * Render the final JSX of Card.
301
+ */
302
+ export declare const renderCard_unstable: (state: CardState, cardContextValue: CardContextValue) => JSX.Element;
303
+
304
+ /**
305
+ * Render the final JSX of CardFooter.
306
+ */
307
+ export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
308
+
309
+ /**
310
+ * Render the final JSX of CardHeader.
311
+ */
312
+ export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
313
+
314
+ /**
315
+ * Render the final JSX of CardPreview.
316
+ */
317
+ export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
318
+
319
+ /**
320
+ * Create the state required to render Card.
321
+ *
322
+ * The returned state can be modified with hooks such as useCardStyles_unstable,
323
+ * before being passed to renderCard_unstable.
324
+ *
325
+ * @param props - props from this instance of Card
326
+ * @param ref - reference to the root element of Card
327
+ */
328
+ export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLDivElement>) => CardState;
329
+
330
+ /**
331
+ * @internal
332
+ */
333
+ export declare const useCardContext_unstable: () => CardContextValue;
334
+
335
+ /**
336
+ * Create the state required to render CardFooter.
337
+ *
338
+ * The returned state can be modified with hooks such as useCardFooterStyles_unstable,
339
+ * before being passed to renderCardFooter_unstable.
340
+ *
341
+ * @param props - props from this instance of CardFooter
342
+ * @param ref - reference to root HTMLElement of CardFooter
343
+ */
344
+ export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
345
+
346
+ /**
347
+ * Apply styling to the CardFooter slots based on the state.
348
+ */
349
+ export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
350
+
351
+ /**
352
+ * Create the state required to render CardHeader.
353
+ *
354
+ * The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
355
+ * before being passed to renderCardHeader_unstable.
356
+ *
357
+ * @param props - props from this instance of CardHeader
358
+ * @param ref - reference to root HTMLElement of CardHeader
359
+ */
360
+ export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
361
+
362
+ /**
363
+ * Apply styling to the CardHeader slots based on the state.
364
+ */
365
+ export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
366
+
367
+ /**
368
+ * Create the state required to render CardPreview.
369
+ *
370
+ * The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
371
+ * before being passed to renderCardPreview_unstable.
372
+ *
373
+ * @param props - props from this instance of CardPreview
374
+ * @param ref - reference to root HTMLElement of CardPreview
375
+ */
376
+ export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
377
+
378
+ /**
379
+ * Apply styling to the CardPreview slots based on the state.
380
+ */
381
+ export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
382
+
383
+ /**
384
+ * Apply styling to the Card slots based on the state.
385
+ */
386
+ export declare const useCardStyles_unstable: (state: CardState) => CardState;
387
+
388
+ export { }
package/lib/Card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sourceRoot":"","sources":["../src/Card.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"Card.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/Card.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Card/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CardFooter.js","sourceRoot":"","sources":["../src/CardFooter.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"CardFooter.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/CardFooter.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/CardFooter/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../src/CardHeader.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"CardHeader.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/CardHeader.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/CardHeader/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CardPreview.js","sourceRoot":"","sources":["../src/CardPreview.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"CardPreview.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/CardPreview.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/CardPreview/index';\n"]}
@@ -1,15 +1,16 @@
1
1
  import * as React from 'react';
2
- import { useCard } from './useCard';
3
- import { renderCard } from './renderCard';
4
- import { useCardStyles } from './useCardStyles';
2
+ import { useCard_unstable } from './useCard';
3
+ import { renderCard_unstable } from './renderCard';
4
+ import { useCardStyles_unstable } from './useCardStyles';
5
+ import { useCardContextValue } from './useCardContextValue';
5
6
  /**
6
7
  * A card provides scaffolding for hosting actions and content for a single topic.
7
8
  */
8
-
9
9
  export const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = useCard(props, ref);
11
- useCardStyles(state);
12
- return renderCard(state);
10
+ const state = useCard_unstable(props, ref);
11
+ const cardContextValue = useCardContextValue(state);
12
+ useCardStyles_unstable(state);
13
+ return renderCard_unstable(state, cardContextValue);
13
14
  });
14
15
  Card.displayName = 'Card';
15
16
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,OAAT,QAAwB,WAAxB;AACA,SAAS,UAAT,QAA2B,cAA3B;AACA,SAAS,aAAT,QAA8B,iBAA9B;AAIA;;AAEG;;AACH,OAAO,MAAM,IAAI,gBAAmC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClF,QAAM,KAAK,GAAG,OAAO,CAAC,KAAD,EAAQ,GAAR,CAArB;AAEA,EAAA,aAAa,CAAC,KAAD,CAAb;AACA,SAAO,UAAU,CAAC,KAAD,CAAjB;AACD,CALmD,CAA7C;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","sourceRoot":""}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,sBAAsB,QAAQ,iBAAiB;AAGxD,SAASC,mBAAmB,QAAQ,uBAAuB;AAE3D;;;AAGA,OAAO,MAAMC,IAAI,gBAAmCL,KAAK,CAACM,UAAU,CAAiB,CAACC,KAAK,EAAEC,GAAG,KAAI;EAClG,MAAMC,KAAK,GAAGR,gBAAgB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAC1C,MAAME,gBAAgB,GAAGN,mBAAmB,CAACK,KAAK,CAAC;EAEnDN,sBAAsB,CAACM,KAAK,CAAC;EAC7B,OAAOP,mBAAmB,CAACO,KAAK,EAAEC,gBAAgB,CAAC;AACrD,CAAC,CAAC;AAEFL,IAAI,CAACM,WAAW,GAAG,MAAM","names":["React","useCard_unstable","renderCard_unstable","useCardStyles_unstable","useCardContextValue","Card","forwardRef","props","ref","state","cardContextValue","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-card/src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCard_unstable } from './useCard';\nimport { renderCard_unstable } from './renderCard';\nimport { useCardStyles_unstable } from './useCardStyles';\nimport type { CardProps } from './Card.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCardContextValue } from './useCardContextValue';\n\n/**\n * A card provides scaffolding for hosting actions and content for a single topic.\n */\nexport const Card: ForwardRefComponent<CardProps> = React.forwardRef<HTMLDivElement>((props, ref) => {\n const state = useCard_unstable(props, ref);\n const cardContextValue = useCardContextValue(state);\n\n useCardStyles_unstable(state);\n return renderCard_unstable(state, cardContextValue);\n});\n\nCard.displayName = 'Card';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.js","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Card.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/components/Card/Card.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Card selected event type\n *\n * This event is fired when a selectable card changes its selection state.\n */\nexport type CardOnSelectionChangeEvent = React.MouseEvent | React.KeyboardEvent | React.ChangeEvent;\n\n/**\n * Data sent from the selection events on a selectable card.\n */\nexport type CardOnSelectData = {\n selected: boolean;\n};\n\n/**\n * Data shared between card components\n */\nexport interface CardContextValue {\n selectableA11yProps: {\n referenceId?: string;\n setReferenceId: (referenceId: string) => void;\n referenceLabel?: string;\n setReferenceLabel: (referenceLabel: string) => void;\n };\n}\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 * Select element represents a checkbox.\n */\n floatingAction?: Slot<'div'>;\n\n /**\n * The internal checkbox element that renders when the card is selectable.\n */\n checkbox?: Slot<'input'>;\n};\n\n/**\n * Card component props.\n */\nexport type CardProps = ComponentProps<CardSlots> & {\n /**\n * Sets the appearance of the card.\n *\n * `filled`\n * The card will have a shadow, border and background color.\n *\n * `filled-alternative`\n * This appearance is similar to `filled`, but the background color will be a little darker.\n *\n * `outline`\n * This appearance is similar to `filled`, but the background color will be transparent and no shadow applied.\n *\n * `subtle`\n * This appearance is similar to `filled-alternative`, but no border is applied.\n *\n * @default 'filled'\n */\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 * Defines the controlled selected state of the card.\n *\n * @default false\n */\n selected?: boolean;\n\n /**\n * Defines whether the card is initially in a selected state when rendered.\n *\n * @default false\n */\n defaultSelected?: boolean;\n\n /**\n * Callback to be called when the selected state value changes.\n */\n onSelectionChange?: (event: CardOnSelectionChangeEvent, data: CardOnSelectData) => void;\n};\n\n/**\n * State used in rendering Card.\n */\nexport type CardState = ComponentState<CardSlots> &\n CardContextValue &\n Required<\n Pick<CardProps, 'appearance' | 'orientation' | 'size'> & {\n /**\n * Represents a card that contains interactive events (MouseEvents) or is a button/a tag.\n *\n * @default false\n */\n interactive: boolean;\n\n /**\n * Represents a selectable card.\n *\n * @default false\n */\n selectable: boolean;\n\n /**\n * Defines whether the card is currently selected.\n *\n * @default false\n */\n selected: boolean;\n\n /**\n * Defines whether the card internal checkbox is currently focused.\n *\n * @default false\n */\n selectFocused: boolean;\n }\n >;\n"]}
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ const cardContext = /*#__PURE__*/React.createContext(undefined);
3
+ /**
4
+ * @internal
5
+ */
6
+ export const cardContextDefaultValue = {
7
+ selectableA11yProps: {
8
+ referenceId: undefined,
9
+ setReferenceId() {
10
+ /* Noop */
11
+ },
12
+ referenceLabel: undefined,
13
+ setReferenceLabel() {
14
+ /* Noop */
15
+ }
16
+ }
17
+ };
18
+ /**
19
+ * @internal
20
+ */
21
+ export const CardProvider = cardContext.Provider;
22
+ /**
23
+ * @internal
24
+ */
25
+ export const useCardContext_unstable = () => {
26
+ var _a;
27
+ return (_a = React.useContext(cardContext)) !== null && _a !== void 0 ? _a : cardContextDefaultValue;
28
+ };
29
+ //# sourceMappingURL=CardContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,WAAW,gBAAGD,KAAK,CAACE,aAAa,CAA+BC,SAAS,CAAC;AAEhF;;;AAGA,OAAO,MAAMC,uBAAuB,GAAqB;EACvDC,mBAAmB,EAAE;IACnBC,WAAW,EAAEH,SAAS;IACtBI,cAAc;MACZ;IAAA,CACD;IACDC,cAAc,EAAEL,SAAS;IACzBM,iBAAiB;MACf;IAAA;;CAGL;AAED;;;AAGA,OAAO,MAAMC,YAAY,GAAGT,WAAW,CAACU,QAAQ;AAEhD;;;AAGA,OAAO,MAAMC,uBAAuB,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACZ,WAAW,CAAC,mCAAIG,uBAAuB;AAAA","names":["React","cardContext","createContext","undefined","cardContextDefaultValue","selectableA11yProps","referenceId","setReferenceId","referenceLabel","setReferenceLabel","CardProvider","Provider","useCardContext_unstable","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-card/src/components/Card/CardContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { CardContextValue } from './Card.types';\n\nconst cardContext = React.createContext<CardContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport const cardContextDefaultValue: CardContextValue = {\n selectableA11yProps: {\n referenceId: undefined,\n setReferenceId() {\n /* Noop */\n },\n referenceLabel: undefined,\n setReferenceLabel() {\n /* Noop */\n },\n },\n};\n\n/**\n * @internal\n */\nexport const CardProvider = cardContext.Provider;\n\n/**\n * @internal\n */\nexport const useCardContext_unstable = () => React.useContext(cardContext) ?? cardContextDefaultValue;\n"]}
@@ -1,5 +1,6 @@
1
1
  export * from './Card';
2
2
  export * from './Card.types';
3
+ export * from './CardContext';
3
4
  export * from './renderCard';
4
5
  export * from './useCard';
5
6
  export * from './useCardStyles';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-card/src/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './Card';\nexport * from './Card.types';\nexport * from './CardContext';\nexport * from './renderCard';\nexport * from './useCard';\nexport * from './useCardStyles';\n"]}
@@ -1,14 +1,22 @@
1
1
  import * as React from 'react';
2
2
  import { getSlots } from '@fluentui/react-utilities';
3
+ import { CardProvider } from './CardContext';
3
4
  /**
4
- * Render the final JSX of Card
5
+ * Render the final JSX of Card.
5
6
  */
6
-
7
- export const renderCard = state => {
7
+ export const renderCard_unstable = (state, cardContextValue) => {
8
8
  const {
9
9
  slots,
10
10
  slotProps
11
11
  } = getSlots(state);
12
- return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root));
12
+ return /*#__PURE__*/React.createElement(slots.root, {
13
+ ...slotProps.root
14
+ }, /*#__PURE__*/React.createElement(CardProvider, {
15
+ value: cardContextValue
16
+ }, slots.checkbox ? /*#__PURE__*/React.createElement(slots.checkbox, {
17
+ ...slotProps.checkbox
18
+ }) : null, slots.floatingAction ? /*#__PURE__*/React.createElement(slots.floatingAction, {
19
+ ...slotProps.floatingAction
20
+ }) : null, slotProps.root.children));
13
21
  };
14
22
  //# sourceMappingURL=renderCard.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Card/renderCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,UAAU,GAAI,KAAD,IAAqB;AAC7C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAY,KAAZ,CAArC;AAEA,sBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAAP;AACD,CAJM","sourceRoot":""}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,YAAY,QAAQ,eAAe;AAE5C;;;AAGA,OAAO,MAAMC,mBAAmB,GAAG,CAACC,KAAgB,EAAEC,gBAAkC,KAAI;EAC1F,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAYG,KAAK,CAAC;EAEvD,oBACEJ,oBAACM,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,gBAC5BR,oBAACE,YAAY;IAACO,KAAK,EAAEJ;EAAgB,GAClCC,KAAK,CAACI,QAAQ,gBAAGV,oBAACM,KAAK,CAACI,QAAQ;IAAA,GAAKH,SAAS,CAACG;EAAQ,EAAI,GAAG,IAAI,EAClEJ,KAAK,CAACK,cAAc,gBAAGX,oBAACM,KAAK,CAACK,cAAc;IAAA,GAAKJ,SAAS,CAACI;EAAc,EAAI,GAAG,IAAI,EACpFJ,SAAS,CAACC,IAAI,CAACI,QAAQ,CACX,CACJ;AAEjB,CAAC","names":["React","getSlots","CardProvider","renderCard_unstable","state","cardContextValue","slots","slotProps","root","value","checkbox","floatingAction","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-card/src/components/Card/renderCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardContextValue, CardSlots, CardState } from './Card.types';\nimport { CardProvider } from './CardContext';\n\n/**\n * Render the final JSX of Card.\n */\nexport const renderCard_unstable = (state: CardState, cardContextValue: CardContextValue) => {\n const { slots, slotProps } = getSlots<CardSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <CardProvider value={cardContextValue}>\n {slots.checkbox ? <slots.checkbox {...slotProps.checkbox} /> : null}\n {slots.floatingAction ? <slots.floatingAction {...slotProps.floatingAction} /> : null}\n {slotProps.root.children}\n </CardProvider>\n </slots.root>\n );\n};\n"]}