@fluentui/react-card 9.0.0-beta.1 → 9.0.0-beta.10
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 +533 -1
- package/CHANGELOG.md +132 -2
- package/README.md +3 -1
- package/Spec.md +523 -0
- package/assets/Card.png +0 -0
- package/assets/CardHeader.png +0 -0
- package/assets/CardPreview.png +0 -0
- package/assets/context-interaction-keyboard.png +0 -0
- package/assets/context-interaction-mouse.png +0 -0
- package/assets/context-narrator.png +0 -0
- package/assets/disabled-narrator.png +0 -0
- package/assets/disabled.png +0 -0
- package/assets/interactive-interaction-keyboard.png +0 -0
- package/assets/interactive-interaction-mouse.png +0 -0
- package/assets/interactive-narrator.png +0 -0
- package/assets/non-interactive-interaction-keyboard.png +0 -0
- package/assets/non-interactive-interaction-mouse.png +0 -0
- package/assets/non-interactive-narrator.png +0 -0
- package/assets/non-interactive-selectable-interaction-keyboard.png +0 -0
- package/assets/non-interactive-selectable-interaction-mouse.png +0 -0
- package/assets/selectable-interaction-keyboard.png +0 -0
- package/assets/selectable-interaction-mouse.png +0 -0
- package/assets/selectable-narrator.png +0 -0
- package/dist/react-card.d.ts +62 -138
- 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.d.ts +1 -1
- package/lib/components/Card/Card.js +8 -8
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.d.ts +9 -18
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Card/renderCard.d.ts +1 -1
- package/lib/components/Card/renderCard.js +8 -8
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.d.ts +3 -4
- package/lib/components/Card/useCard.js +23 -11
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.d.ts +2 -1
- package/lib/components/Card/useCardStyles.js +131 -25
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.js +7 -7
- package/lib/components/CardFooter/CardFooter.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.d.ts +8 -23
- package/lib/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib/components/CardFooter/index.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.d.ts +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +9 -9
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.d.ts +4 -9
- package/lib/components/CardFooter/useCardFooter.js +18 -17
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +2 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +9 -7
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.js +7 -7
- package/lib/components/CardHeader/CardHeader.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.d.ts +12 -39
- package/lib/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib/components/CardHeader/index.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.d.ts +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +13 -9
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.d.ts +4 -9
- package/lib/components/CardHeader/useCardHeader.js +35 -32
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +2 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +9 -7
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.js +7 -7
- package/lib/components/CardPreview/CardPreview.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.d.ts +8 -23
- package/lib/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib/components/CardPreview/index.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.d.ts +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +9 -9
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.d.ts +4 -9
- package/lib/components/CardPreview/useCardPreview.js +18 -20
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +2 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +7 -10
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Card.js +1 -1
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js +1 -1
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js +1 -1
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js +1 -1
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.d.ts +1 -1
- package/lib-commonjs/components/Card/Card.js +9 -9
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.d.ts +9 -18
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/index.js +1 -1
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.d.ts +1 -1
- package/lib-commonjs/components/Card/renderCard.js +11 -12
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.d.ts +3 -4
- package/lib-commonjs/components/Card/useCard.js +26 -13
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.d.ts +2 -1
- package/lib-commonjs/components/Card/useCardStyles.js +136 -28
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +8 -8
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +8 -23
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js +1 -1
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js +12 -14
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +4 -9
- package/lib-commonjs/components/CardFooter/useCardFooter.js +21 -20
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +2 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +13 -11
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +8 -8
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +12 -39
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js +1 -1
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js +16 -14
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +4 -9
- package/lib-commonjs/components/CardHeader/useCardHeader.js +39 -36
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +2 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +14 -12
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +8 -8
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +8 -23
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js +1 -1
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js +12 -14
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +4 -9
- package/lib-commonjs/components/CardPreview/useCardPreview.js +21 -23
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +2 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +11 -14
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +19 -12
- 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-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/assets/Card.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/dist/react-card.d.ts
CHANGED
@@ -1,262 +1,186 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
3
3
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
4
4
|
import * as React_2 from 'react';
|
5
|
-
import type {
|
5
|
+
import type { Slot } from '@fluentui/react-utilities';
|
6
6
|
|
7
7
|
/**
|
8
|
-
*
|
8
|
+
* A card provides scaffolding for hosting actions and content for a single topic.
|
9
9
|
*/
|
10
10
|
export declare const Card: ForwardRefComponent<CardProps>;
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
export declare const cardClassName = "fui-Card";
|
13
|
+
|
14
|
+
export declare type CardCommons = {
|
15
|
+
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
16
|
+
};
|
16
17
|
|
17
18
|
/**
|
18
19
|
* Component to render Button actions in a Card component.
|
19
20
|
*/
|
20
21
|
export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
|
21
22
|
|
22
|
-
|
23
|
-
* Names of CardFooterProps that have a default value in useCardFooter
|
24
|
-
*/
|
25
|
-
export declare type CardFooterDefaultedProps = never;
|
23
|
+
export declare const cardFooterClassName = "fui-CardFooter";
|
26
24
|
|
27
25
|
/**
|
28
|
-
* CardFooter
|
26
|
+
* CardFooter props
|
29
27
|
*/
|
30
|
-
export declare
|
31
|
-
/**
|
32
|
-
* Actions slot
|
33
|
-
*/
|
34
|
-
action?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
35
|
-
}
|
28
|
+
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
36
29
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
/**
|
43
|
-
* Array of all shorthand properties listed in CardFooterShorthandProps
|
44
|
-
*/
|
45
|
-
export declare const cardFooterShorthandProps: CardFooterShorthandProps[];
|
30
|
+
export declare type CardFooterSlots = {
|
31
|
+
root: Slot<'div'>;
|
32
|
+
action?: Slot<'div'>;
|
33
|
+
};
|
46
34
|
|
47
35
|
/**
|
48
36
|
* State used in rendering CardFooter
|
49
37
|
*/
|
50
|
-
export declare
|
51
|
-
/**
|
52
|
-
* Ref to the root element
|
53
|
-
*/
|
54
|
-
ref: React_2.Ref<HTMLElement>;
|
55
|
-
}
|
38
|
+
export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
56
39
|
|
57
40
|
/**
|
58
41
|
* Component to render an image, text and an action in a Card component.
|
59
42
|
*/
|
60
43
|
export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
|
61
44
|
|
62
|
-
|
63
|
-
* Names of CardHeaderProps that have a default value in useCardHeader
|
64
|
-
*/
|
65
|
-
export declare type CardHeaderDefaultedProps = never;
|
66
|
-
|
67
|
-
/**
|
68
|
-
* CardHeader Props
|
69
|
-
*/
|
70
|
-
export declare interface CardHeaderProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
|
71
|
-
/**
|
72
|
-
* Image slot
|
73
|
-
*/
|
74
|
-
image: ShorthandPropsCompat<React_2.ImgHTMLAttributes<HTMLImageElement>>;
|
75
|
-
/**
|
76
|
-
* Content slot, wrapper of the header and description slots
|
77
|
-
*/
|
78
|
-
content?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
79
|
-
/**
|
80
|
-
* Header title slot
|
81
|
-
*/
|
82
|
-
header: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
83
|
-
/**
|
84
|
-
* Description slot
|
85
|
-
*/
|
86
|
-
description: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
87
|
-
/**
|
88
|
-
* Actions slot
|
89
|
-
*/
|
90
|
-
action?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
91
|
-
}
|
45
|
+
export declare const cardHeaderClassName = "fui-CardHeader";
|
92
46
|
|
93
47
|
/**
|
94
|
-
*
|
48
|
+
* CardHeader props
|
95
49
|
*/
|
96
|
-
export declare type
|
50
|
+
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
97
51
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
52
|
+
export declare type CardHeaderSlots = {
|
53
|
+
root: Slot<'div'>;
|
54
|
+
image: Slot<'div'>;
|
55
|
+
content?: Slot<'div'>;
|
56
|
+
header: Slot<'span'>;
|
57
|
+
description: Slot<'span'>;
|
58
|
+
action?: Slot<'div'>;
|
59
|
+
};
|
102
60
|
|
103
61
|
/**
|
104
62
|
* State used in rendering CardHeader
|
105
63
|
*/
|
106
|
-
export declare
|
107
|
-
/**
|
108
|
-
* Ref to the root element
|
109
|
-
*/
|
110
|
-
ref: React_2.Ref<HTMLElement>;
|
111
|
-
}
|
64
|
+
export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
112
65
|
|
113
66
|
/**
|
114
67
|
* Component to render image previews of documents or articles in a Card component.
|
115
68
|
*/
|
116
69
|
export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
|
117
70
|
|
118
|
-
|
119
|
-
* Names of CardPreviewProps that have a default value in useCardPreview
|
120
|
-
*/
|
121
|
-
export declare type CardPreviewDefaultedProps = never;
|
71
|
+
export declare const cardPreviewClassName = "fui-CardPreview";
|
122
72
|
|
123
73
|
/**
|
124
|
-
* CardPreview
|
74
|
+
* CardPreview props
|
125
75
|
*/
|
126
|
-
export declare
|
127
|
-
/**
|
128
|
-
* Image slot
|
129
|
-
*/
|
130
|
-
logo?: ShorthandPropsCompat<React_2.ImgHTMLAttributes<HTMLImageElement>>;
|
131
|
-
}
|
76
|
+
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
132
77
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
/**
|
139
|
-
* Array of all shorthand properties listed in CardPreviewShorthandProps
|
140
|
-
*/
|
141
|
-
export declare const cardPreviewShorthandPropsCompat: CardPreviewShorthandProps[];
|
78
|
+
export declare type CardPreviewSlots = {
|
79
|
+
root: Slot<'div'>;
|
80
|
+
logo?: Slot<'div'>;
|
81
|
+
};
|
142
82
|
|
143
83
|
/**
|
144
84
|
* State used in rendering CardPreview
|
145
85
|
*/
|
146
|
-
export declare
|
147
|
-
/**
|
148
|
-
* Ref to the root element
|
149
|
-
*/
|
150
|
-
ref: React_2.Ref<HTMLElement>;
|
151
|
-
}
|
86
|
+
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
152
87
|
|
153
88
|
/**
|
154
89
|
* Card Props
|
155
90
|
*/
|
156
|
-
export declare
|
157
|
-
}
|
91
|
+
export declare type CardProps = ComponentProps<CardSlots> & Partial<CardCommons>;
|
158
92
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
export declare type CardShorthandProps = never;
|
93
|
+
export declare type CardSlots = {
|
94
|
+
root: Slot<'div'>;
|
95
|
+
};
|
163
96
|
|
164
97
|
/**
|
165
98
|
* State used in rendering Card
|
166
99
|
*/
|
167
|
-
export declare
|
168
|
-
/**
|
169
|
-
* Ref to the root element
|
170
|
-
*/
|
171
|
-
ref: React_2.Ref<HTMLElement>;
|
172
|
-
}
|
100
|
+
export declare type CardState = ComponentState<CardSlots> & CardCommons;
|
173
101
|
|
174
102
|
/**
|
175
103
|
* Render the final JSX of Card
|
176
104
|
*/
|
177
|
-
export declare const
|
105
|
+
export declare const renderCard_unstable: (state: CardState) => JSX.Element;
|
178
106
|
|
179
107
|
/**
|
180
108
|
* Render the final JSX of CardFooter
|
181
109
|
*/
|
182
|
-
export declare const
|
110
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
183
111
|
|
184
112
|
/**
|
185
113
|
* Render the final JSX of CardHeader
|
186
114
|
*/
|
187
|
-
export declare const
|
115
|
+
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
188
116
|
|
189
117
|
/**
|
190
118
|
* Render the final JSX of CardPreview
|
191
119
|
*/
|
192
|
-
export declare const
|
120
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
193
121
|
|
194
122
|
/**
|
195
123
|
* Create the state required to render Card.
|
196
124
|
*
|
197
|
-
* The returned state can be modified with hooks such as
|
198
|
-
* before being passed to
|
125
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
126
|
+
* before being passed to renderCard_unstable.
|
199
127
|
*
|
200
128
|
* @param props - props from this instance of Card
|
201
129
|
* @param ref - reference to root HTMLElement of Card
|
202
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
203
130
|
*/
|
204
|
-
export declare const
|
131
|
+
export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLElement>) => CardState;
|
205
132
|
|
206
133
|
/**
|
207
134
|
* Create the state required to render CardFooter.
|
208
135
|
*
|
209
|
-
* The returned state can be modified with hooks such as
|
210
|
-
* before being passed to
|
136
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
137
|
+
* before being passed to renderCardFooter_unstable.
|
211
138
|
*
|
212
139
|
* @param props - props from this instance of CardFooter
|
213
140
|
* @param ref - reference to root HTMLElement of CardFooter
|
214
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
215
141
|
*/
|
216
|
-
export declare const
|
142
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
217
143
|
|
218
144
|
/**
|
219
145
|
* Apply styling to the CardFooter slots based on the state
|
220
146
|
*/
|
221
|
-
export declare const
|
147
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
222
148
|
|
223
149
|
/**
|
224
150
|
* Create the state required to render CardHeader.
|
225
151
|
*
|
226
|
-
* The returned state can be modified with hooks such as
|
227
|
-
* before being passed to
|
152
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
153
|
+
* before being passed to renderCardHeader_unstable.
|
228
154
|
*
|
229
155
|
* @param props - props from this instance of CardHeader
|
230
156
|
* @param ref - reference to root HTMLElement of CardHeader
|
231
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
232
157
|
*/
|
233
|
-
export declare const
|
158
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
234
159
|
|
235
160
|
/**
|
236
161
|
* Apply styling to the CardHeader slots based on the state
|
237
162
|
*/
|
238
|
-
export declare const
|
163
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
239
164
|
|
240
165
|
/**
|
241
166
|
* Create the state required to render CardPreview.
|
242
167
|
*
|
243
|
-
* The returned state can be modified with hooks such as
|
244
|
-
* before being passed to
|
168
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
169
|
+
* before being passed to renderCardPreview_unstable.
|
245
170
|
*
|
246
171
|
* @param props - props from this instance of CardPreview
|
247
172
|
* @param ref - reference to root HTMLElement of CardPreview
|
248
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
249
173
|
*/
|
250
|
-
export declare const
|
174
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
251
175
|
|
252
176
|
/**
|
253
177
|
* Apply styling to the CardPreview slots based on the state
|
254
178
|
*/
|
255
|
-
export declare const
|
179
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
256
180
|
|
257
181
|
/**
|
258
182
|
* Apply styling to the Card slots based on the state
|
259
183
|
*/
|
260
|
-
export declare const
|
184
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
261
185
|
|
262
186
|
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":["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":["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":["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":["CardPreview.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/CardPreview/index';\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { CardProps } from './Card.types';
|
2
2
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* A card provides scaffolding for hosting actions and content for a single topic.
|
5
5
|
*/
|
6
6
|
export declare const Card: ForwardRefComponent<CardProps>;
|
@@ -1,15 +1,15 @@
|
|
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
5
|
/**
|
6
|
-
*
|
6
|
+
* A card provides scaffolding for hosting actions and content for a single topic.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
return
|
9
|
+
export const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useCard_unstable(props, ref);
|
11
|
+
useCardStyles_unstable(state);
|
12
|
+
return renderCard_unstable(state);
|
13
13
|
});
|
14
14
|
Card.displayName = 'Card';
|
15
15
|
//# sourceMappingURL=Card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AAIA;;AAEG;;AACH,OAAO,MAAM,IAAI,gBAAmC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClF,QAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;AAEA,EAAA,sBAAsB,CAAC,KAAD,CAAtB;AACA,SAAO,mBAAmB,CAAC,KAAD,CAA1B;AACD,CALmD,CAA7C;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","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';\n\n/**\n * A card provides scaffolding for hosting actions and content for a single topic.\n */\nexport const Card: ForwardRefComponent<CardProps> = React.forwardRef((props, ref) => {\n const state = useCard_unstable(props, ref);\n\n useCardStyles_unstable(state);\n return renderCard_unstable(state);\n});\n\nCard.displayName = 'Card';\n"],"sourceRoot":"../src/"}
|
@@ -1,24 +1,15 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
export declare type CardSlots = {
|
3
|
+
root: Slot<'div'>;
|
4
|
+
};
|
5
|
+
export declare type CardCommons = {
|
6
|
+
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
7
|
+
};
|
3
8
|
/**
|
4
9
|
* Card Props
|
5
10
|
*/
|
6
|
-
export
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
* Names of the shorthand properties in CardProps
|
10
|
-
*/
|
11
|
-
export declare type CardShorthandProps = never;
|
12
|
-
/**
|
13
|
-
* Names of CardProps that have a default value in useCard
|
14
|
-
*/
|
15
|
-
export declare type CardDefaultedProps = never;
|
11
|
+
export declare type CardProps = ComponentProps<CardSlots> & Partial<CardCommons>;
|
16
12
|
/**
|
17
13
|
* State used in rendering Card
|
18
14
|
*/
|
19
|
-
export
|
20
|
-
/**
|
21
|
-
* Ref to the root element
|
22
|
-
*/
|
23
|
-
ref: React.Ref<HTMLElement>;
|
24
|
-
}
|
15
|
+
export declare type CardState = ComponentState<CardSlots> & CardCommons;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.types.js","sourceRoot":"","sources":["
|
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\nexport type CardCommons = {\n appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';\n};\n\n/**\n * Card Props\n */\nexport type CardProps = ComponentProps<CardSlots> & Partial<CardCommons>;\n\n/**\n * State used in rendering Card\n */\nexport type CardState = ComponentState<CardSlots> & CardCommons;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["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","sourcesContent":["export * from './Card';\nexport * from './Card.types';\nexport * from './renderCard';\nexport * from './useCard';\nexport * from './useCardStyles';\n"]}
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
|
-
import {
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
4
3
|
/**
|
5
4
|
* Render the final JSX of Card
|
6
5
|
*/
|
7
6
|
|
8
|
-
export
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
7
|
+
export const renderCard_unstable = state => {
|
8
|
+
const {
|
9
|
+
slots,
|
10
|
+
slotProps
|
11
|
+
} = getSlots(state);
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
13
|
+
});
|
14
14
|
};
|
15
15
|
//# sourceMappingURL=renderCard.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
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;AACtD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAY,KAAZ,CAArC;AAEA,sBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,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/"}
|
@@ -3,11 +3,10 @@ import type { CardProps, CardState } from './Card.types';
|
|
3
3
|
/**
|
4
4
|
* Create the state required to render Card.
|
5
5
|
*
|
6
|
-
* The returned state can be modified with hooks such as
|
7
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
7
|
+
* before being passed to renderCard_unstable.
|
8
8
|
*
|
9
9
|
* @param props - props from this instance of Card
|
10
10
|
* @param ref - reference to root HTMLElement of Card
|
11
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
12
11
|
*/
|
13
|
-
export declare const
|
12
|
+
export declare const useCard_unstable: (props: CardProps, ref: React.Ref<HTMLElement>) => CardState;
|
@@ -1,21 +1,33 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { getNativeElementProps } from '@fluentui/react-utilities';
|
2
|
+
import { useFocusableGroup } from '@fluentui/react-tabster';
|
3
3
|
/**
|
4
4
|
* Create the state required to render Card.
|
5
5
|
*
|
6
|
-
* The returned state can be modified with hooks such as
|
7
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
7
|
+
* before being passed to renderCard_unstable.
|
8
8
|
*
|
9
9
|
* @param props - props from this instance of Card
|
10
10
|
* @param ref - reference to root HTMLElement of Card
|
11
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
12
11
|
*/
|
13
12
|
|
14
|
-
export
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
export const useCard_unstable = (props, ref) => {
|
14
|
+
const groupperAttrs = useFocusableGroup({
|
15
|
+
tabBehavior: 'limitedTrapFocus'
|
16
|
+
});
|
17
|
+
const {
|
18
|
+
appearance = 'filled'
|
19
|
+
} = props;
|
20
|
+
return {
|
21
|
+
appearance,
|
22
|
+
components: {
|
23
|
+
root: 'div'
|
24
|
+
},
|
25
|
+
root: getNativeElementProps(props.as || 'div', {
|
26
|
+
ref,
|
27
|
+
role: 'group',
|
28
|
+
...groupperAttrs,
|
29
|
+
...props
|
30
|
+
})
|
31
|
+
};
|
20
32
|
};
|
21
33
|
//# sourceMappingURL=useCard.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
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;AAC3F,QAAM,aAAa,GAAG,iBAAiB,CAAC;AACtC,IAAA,WAAW,EAAE;AADyB,GAAD,CAAvC;AAIA,QAAM;AAAE,IAAA,UAAU,GAAG;AAAf,MAA4B,KAAlC;AACA,SAAO;AACL,IAAA,UADK;AAGL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE;AAAR,KAHP;AAIL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAN,IAAY,KAAb,EAAoB;AAC7C,MAAA,GAD6C;AAE7C,MAAA,IAAI,EAAE,OAFuC;AAG7C,SAAG,aAH0C;AAI7C,SAAG;AAJ0C,KAApB;AAJtB,GAAP;AAWD,CAjBM","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 groupperAttrs = useFocusableGroup({\n tabBehavior: 'limitedTrapFocus',\n });\n\n const { appearance = 'filled' } = props;\n return {\n appearance,\n\n components: { root: 'div' },\n root: getNativeElementProps(props.as || 'div', {\n ref,\n role: 'group',\n ...groupperAttrs,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { CardState } from './Card.types';
|
2
|
+
export declare const cardClassName = "fui-Card";
|
2
3
|
/**
|
3
4
|
* Apply styling to the Card slots based on the state
|
4
5
|
*/
|
5
|
-
export declare const
|
6
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|