@fluentui/react-card 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.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 +2063 -22
- package/CHANGELOG.md +627 -42
- package/README.md +68 -4
- package/dist/index.d.ts +389 -0
- package/lib/Card.js.map +1 -1
- package/lib/CardFooter.js.map +1 -1
- package/lib/CardHeader.js.map +1 -1
- package/lib/CardPreview.js.map +1 -1
- package/lib/components/Card/Card.js +10 -9
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/CardContext.js +29 -0
- package/lib/components/Card/CardContext.js.map +1 -0
- package/lib/components/Card/index.js +1 -0
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Card/renderCard.js +16 -9
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.js +89 -16
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardContextValue.js +8 -0
- package/lib/components/Card/useCardContextValue.js.map +1 -0
- package/lib/components/Card/useCardSelectable.js +116 -0
- package/lib/components/Card/useCardSelectable.js.map +1 -0
- package/lib/components/Card/useCardStyles.js +329 -34
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.js +7 -8
- package/lib/components/CardFooter/CardFooter.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib/components/CardFooter/index.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +11 -10
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.js +10 -14
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +20 -20
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.js +7 -8
- package/lib/components/CardHeader/CardHeader.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib/components/CardHeader/index.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +17 -10
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.js +40 -25
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +53 -40
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.js +7 -8
- package/lib/components/CardPreview/CardPreview.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib/components/CardPreview/index.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +11 -10
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.js +42 -15
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +24 -28
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Card.js +1 -3
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js +1 -3
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js +1 -3
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js +1 -3
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.js +11 -15
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/CardContext.js +36 -0
- package/lib-commonjs/components/Card/CardContext.js.map +1 -0
- package/lib-commonjs/components/Card/index.js +2 -7
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js +20 -18
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +91 -23
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardContextValue.js +15 -0
- package/lib-commonjs/components/Card/useCardContextValue.js.map +1 -0
- package/lib-commonjs/components/Card/useCardSelectable.js +123 -0
- package/lib-commonjs/components/Card/useCardSelectable.js.map +1 -0
- package/lib-commonjs/components/Card/useCardStyles.js +331 -39
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +8 -14
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js +1 -7
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +15 -20
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.js +13 -21
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +22 -25
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +8 -14
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js +1 -7
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +21 -20
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.js +43 -33
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +55 -45
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +8 -14
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js +1 -7
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +15 -20
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.js +44 -21
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +26 -33
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js +150 -10
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +30 -30
- package/assets/ai_deck_template.png +0 -0
- package/assets/avatar_elvia.svg +0 -9
- package/assets/avatar_mauricio.svg +0 -9
- package/assets/doc_template.png +0 -0
- package/assets/powerpoint_logo.svg +0 -9
- package/assets/sales_template.png +0 -0
- package/assets/word_logo.svg +0 -9
- package/dist/react-card.d.ts +0 -188
- package/lib/Card.d.ts +0 -1
- package/lib/CardFooter.d.ts +0 -1
- package/lib/CardHeader.d.ts +0 -1
- package/lib/CardPreview.d.ts +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -11
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Card/Card.d.ts +0 -6
- package/lib/components/Card/Card.types.d.ts +0 -13
- package/lib/components/Card/index.d.ts +0 -5
- package/lib/components/Card/renderCard.d.ts +0 -5
- package/lib/components/Card/useCard.d.ts +0 -12
- package/lib/components/Card/useCardStyles.d.ts +0 -5
- package/lib/components/CardFooter/CardFooter.d.ts +0 -6
- package/lib/components/CardFooter/CardFooter.types.d.ts +0 -13
- package/lib/components/CardFooter/index.d.ts +0 -5
- package/lib/components/CardFooter/renderCardFooter.d.ts +0 -5
- package/lib/components/CardFooter/useCardFooter.d.ts +0 -16
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +0 -5
- package/lib/components/CardHeader/CardHeader.d.ts +0 -6
- package/lib/components/CardHeader/CardHeader.types.d.ts +0 -17
- package/lib/components/CardHeader/index.d.ts +0 -5
- package/lib/components/CardHeader/renderCardHeader.d.ts +0 -5
- package/lib/components/CardHeader/useCardHeader.d.ts +0 -13
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +0 -5
- package/lib/components/CardPreview/CardPreview.d.ts +0 -6
- package/lib/components/CardPreview/CardPreview.types.d.ts +0 -13
- package/lib/components/CardPreview/index.d.ts +0 -5
- package/lib/components/CardPreview/renderCardPreview.d.ts +0 -5
- package/lib/components/CardPreview/useCardPreview.d.ts +0 -16
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +0 -5
- package/lib/index.d.ts +0 -4
- package/lib/tsdoc-metadata.json +0 -11
- package/lib-commonjs/Card.d.ts +0 -1
- package/lib-commonjs/CardFooter.d.ts +0 -1
- package/lib-commonjs/CardHeader.d.ts +0 -1
- package/lib-commonjs/CardPreview.d.ts +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -22
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Card/Card.d.ts +0 -6
- package/lib-commonjs/components/Card/Card.types.d.ts +0 -13
- package/lib-commonjs/components/Card/index.d.ts +0 -5
- package/lib-commonjs/components/Card/renderCard.d.ts +0 -5
- package/lib-commonjs/components/Card/useCard.d.ts +0 -12
- package/lib-commonjs/components/Card/useCardStyles.d.ts +0 -5
- package/lib-commonjs/components/CardFooter/CardFooter.d.ts +0 -6
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +0 -13
- package/lib-commonjs/components/CardFooter/index.d.ts +0 -5
- package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +0 -5
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +0 -16
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +0 -5
- package/lib-commonjs/components/CardHeader/CardHeader.d.ts +0 -6
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +0 -17
- package/lib-commonjs/components/CardHeader/index.d.ts +0 -5
- package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +0 -5
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +0 -13
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +0 -5
- package/lib-commonjs/components/CardPreview/CardPreview.d.ts +0 -6
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +0 -13
- package/lib-commonjs/components/CardPreview/index.d.ts +0 -5
- package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +0 -5
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +0 -16
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +0 -5
- 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://
|
3
|
+
**React Card components for [Fluent UI React](https://react.fluentui.dev)**
|
4
4
|
|
5
|
-
|
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 {
|
14
|
+
import { Card, CardPreview, CardHeader, CardFooter } from "@fluentui/react-components/unstable';
|
15
|
+
```
|
16
|
+
|
17
|
+
Example Card usage:
|
18
|
+
|
19
|
+

|
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).
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,389 @@
|
|
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.
|
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
|
+
* Floating action that can be rendered on the top-right of a card. Often used together with
|
261
|
+
* `selected`, `defaultSelected`, and `onSelectionChange` props
|
262
|
+
*/
|
263
|
+
floatingAction?: Slot<'div'>;
|
264
|
+
/**
|
265
|
+
* The internal checkbox element that renders when the card is selectable.
|
266
|
+
*/
|
267
|
+
checkbox?: Slot<'input'>;
|
268
|
+
};
|
269
|
+
|
270
|
+
/**
|
271
|
+
* State used in rendering Card.
|
272
|
+
*/
|
273
|
+
export declare type CardState = ComponentState<CardSlots> & CardContextValue & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'> & {
|
274
|
+
/**
|
275
|
+
* Represents a card that contains interactive events (MouseEvents) or is a button/a tag.
|
276
|
+
*
|
277
|
+
* @default false
|
278
|
+
*/
|
279
|
+
interactive: boolean;
|
280
|
+
/**
|
281
|
+
* Represents a selectable card.
|
282
|
+
*
|
283
|
+
* @default false
|
284
|
+
*/
|
285
|
+
selectable: boolean;
|
286
|
+
/**
|
287
|
+
* Defines whether the card is currently selected.
|
288
|
+
*
|
289
|
+
* @default false
|
290
|
+
*/
|
291
|
+
selected: boolean;
|
292
|
+
/**
|
293
|
+
* Defines whether the card internal checkbox is currently focused.
|
294
|
+
*
|
295
|
+
* @default false
|
296
|
+
*/
|
297
|
+
selectFocused: boolean;
|
298
|
+
}>;
|
299
|
+
|
300
|
+
/**
|
301
|
+
* Render the final JSX of Card.
|
302
|
+
*/
|
303
|
+
export declare const renderCard_unstable: (state: CardState, cardContextValue: CardContextValue) => JSX.Element;
|
304
|
+
|
305
|
+
/**
|
306
|
+
* Render the final JSX of CardFooter.
|
307
|
+
*/
|
308
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
309
|
+
|
310
|
+
/**
|
311
|
+
* Render the final JSX of CardHeader.
|
312
|
+
*/
|
313
|
+
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Render the final JSX of CardPreview.
|
317
|
+
*/
|
318
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
319
|
+
|
320
|
+
/**
|
321
|
+
* Create the state required to render Card.
|
322
|
+
*
|
323
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
324
|
+
* before being passed to renderCard_unstable.
|
325
|
+
*
|
326
|
+
* @param props - props from this instance of Card
|
327
|
+
* @param ref - reference to the root element of Card
|
328
|
+
*/
|
329
|
+
export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLDivElement>) => CardState;
|
330
|
+
|
331
|
+
/**
|
332
|
+
* @internal
|
333
|
+
*/
|
334
|
+
export declare const useCardContext_unstable: () => CardContextValue;
|
335
|
+
|
336
|
+
/**
|
337
|
+
* Create the state required to render CardFooter.
|
338
|
+
*
|
339
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
340
|
+
* before being passed to renderCardFooter_unstable.
|
341
|
+
*
|
342
|
+
* @param props - props from this instance of CardFooter
|
343
|
+
* @param ref - reference to root HTMLElement of CardFooter
|
344
|
+
*/
|
345
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
346
|
+
|
347
|
+
/**
|
348
|
+
* Apply styling to the CardFooter slots based on the state.
|
349
|
+
*/
|
350
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
351
|
+
|
352
|
+
/**
|
353
|
+
* Create the state required to render CardHeader.
|
354
|
+
*
|
355
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
356
|
+
* before being passed to renderCardHeader_unstable.
|
357
|
+
*
|
358
|
+
* @param props - props from this instance of CardHeader
|
359
|
+
* @param ref - reference to root HTMLElement of CardHeader
|
360
|
+
*/
|
361
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
362
|
+
|
363
|
+
/**
|
364
|
+
* Apply styling to the CardHeader slots based on the state.
|
365
|
+
*/
|
366
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Create the state required to render CardPreview.
|
370
|
+
*
|
371
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
372
|
+
* before being passed to renderCardPreview_unstable.
|
373
|
+
*
|
374
|
+
* @param props - props from this instance of CardPreview
|
375
|
+
* @param ref - reference to root HTMLElement of CardPreview
|
376
|
+
*/
|
377
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
378
|
+
|
379
|
+
/**
|
380
|
+
* Apply styling to the CardPreview slots based on the state.
|
381
|
+
*/
|
382
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Apply styling to the Card slots based on the state.
|
386
|
+
*/
|
387
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
388
|
+
|
389
|
+
export { }
|
package/lib/Card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["
|
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"]}
|
package/lib/CardFooter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardFooter.js","sourceRoot":"","sources":["
|
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"]}
|
package/lib/CardHeader.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["
|
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"]}
|
package/lib/CardPreview.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardPreview.js","sourceRoot":"","sources":["
|
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 {
|
3
|
-
import {
|
4
|
-
import {
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
return
|
9
|
+
export const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
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":["
|
1
|
+
{"version":3,"names":["React","useCard_unstable","renderCard_unstable","useCardStyles_unstable","useCardContextValue","Card","forwardRef","props","ref","state","cardContextValue","displayName"],"sources":["../src/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"],"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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.types.js","sourceRoot":"","sources":["
|
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 * Floating action that can be rendered on the top-right of a card. Often used together with\n * `selected`, `defaultSelected`, and `onSelectionChange` props\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.\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,"names":["React","cardContext","createContext","undefined","cardContextDefaultValue","selectableA11yProps","referenceId","setReferenceId","referenceLabel","setReferenceLabel","CardProvider","Provider","useCardContext_unstable","_a","useContext"],"sources":["../src/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"],"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,cAAcA,CAAA;MACZ;IAAA,CACD;IACDC,cAAc,EAAEL,SAAS;IACzBM,iBAAiBA,CAAA;MACf;IAAA;;CAGL;AAED;;;AAGA,OAAO,MAAMC,YAAY,GAAGT,WAAW,CAACU,QAAQ;AAEhD;;;AAGA,OAAO,MAAMC,uBAAuB,GAAGA,CAAA,KAAK;EAAA,IAAAC,EAAA;EAAC,QAAAA,EAAA,GAAAb,KAAK,CAACc,UAAU,CAACb,WAAW,CAAC,cAAAY,EAAA,cAAAA,EAAA,GAAIT,uBAAuB;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
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,15 +1,22 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { getSlots } from '@fluentui/react-utilities';
|
3
|
+
import { CardProvider } from './CardContext';
|
4
4
|
/**
|
5
|
-
* Render the final JSX of Card
|
5
|
+
* Render the final JSX of Card.
|
6
6
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
export const renderCard_unstable = (state, cardContextValue) => {
|
8
|
+
const {
|
9
|
+
slots,
|
10
|
+
slotProps
|
11
|
+
} = getSlots(state);
|
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));
|
14
21
|
};
|
15
22
|
//# sourceMappingURL=renderCard.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"names":["React","getSlots","CardProvider","renderCard_unstable","state","cardContextValue","slots","slotProps","createElement","root","value","checkbox","floatingAction","children"],"sources":["../src/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"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,YAAY,QAAQ,eAAe;AAE5C;;;AAGA,OAAO,MAAMC,mBAAmB,GAAGA,CAACC,KAAgB,EAAEC,gBAAkC,KAAI;EAC1F,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAYG,KAAK,CAAC;EAEvD,oBACEJ,KAAA,CAAAQ,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,gBAC5BT,KAAA,CAAAQ,aAAA,CAACN,YAAY;IAACQ,KAAK,EAAEL;EAAgB,GAClCC,KAAK,CAACK,QAAQ,gBAAGX,KAAA,CAAAQ,aAAA,CAACF,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,GAAG,IAAI,EAClEL,KAAK,CAACM,cAAc,gBAAGZ,KAAA,CAAAQ,aAAA,CAACF,KAAK,CAACM,cAAc;IAAA,GAAKL,SAAS,CAACK;EAAc,EAAI,GAAG,IAAI,EACpFL,SAAS,CAACE,IAAI,CAACI,QAAQ,CACX,CACJ;AAEjB,CAAC"}
|