@fluentui/react-card 9.0.0-beta.2 → 9.0.0-beta.20
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 +1037 -1
- package/CHANGELOG.md +293 -30
- package/README.md +3 -1
- package/Spec.md +527 -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/logo.svg +9 -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/index.d.ts +283 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -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 +8 -8
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/index.js.map +1 -1
- package/lib/components/Card/renderCard.js +8 -8
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.js +31 -11
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +219 -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.js.map +1 -1
- package/lib/components/CardFooter/index.js.map +1 -1
- package/lib/components/CardFooter/renderCardFooter.js +9 -9
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.js +10 -13
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +16 -10
- 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.js.map +1 -1
- package/lib/components/CardHeader/index.js.map +1 -1
- package/lib/components/CardHeader/renderCardHeader.js +13 -9
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.js +16 -16
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +33 -11
- 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.js.map +1 -1
- package/lib/components/CardPreview/index.js.map +1 -1
- package/lib/components/CardPreview/renderCardPreview.js +9 -9
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.js +10 -13
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +17 -15
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.js +4 -4
- 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.js +9 -9
- 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/index.js +1 -1
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js +12 -13
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +34 -15
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +226 -27
- 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.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.js +13 -15
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.js +14 -18
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +18 -12
- 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.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.js +17 -15
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.js +20 -22
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +35 -13
- 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.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.js +13 -15
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.js +14 -18
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +19 -17
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js +134 -5
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +22 -24
- 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-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/dist/index.d.ts
ADDED
@@ -0,0 +1,283 @@
|
|
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
|
+
* CSS variable names used internally for uniform styling in Card.
|
20
|
+
*/
|
21
|
+
export declare const cardCSSVars: {
|
22
|
+
cardSizeVar: string;
|
23
|
+
cardBorderRadiusVar: string;
|
24
|
+
};
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Component to render Button actions in a Card component.
|
28
|
+
*/
|
29
|
+
export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Static CSS class names used internally for the component slots.
|
33
|
+
*/
|
34
|
+
export declare const cardFooterClassNames: SlotClassNames<CardFooterSlots>;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* CardFooter component props.
|
38
|
+
*/
|
39
|
+
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Slots available in the CardFooter component.
|
43
|
+
*/
|
44
|
+
export declare type CardFooterSlots = {
|
45
|
+
/**
|
46
|
+
* Root element of the component.
|
47
|
+
*/
|
48
|
+
root: Slot<'div'>;
|
49
|
+
/**
|
50
|
+
* Container that renders on the far end of the footer, used for action buttons.
|
51
|
+
*/
|
52
|
+
action?: Slot<'div'>;
|
53
|
+
};
|
54
|
+
|
55
|
+
/**
|
56
|
+
* State used in rendering CardFooter.
|
57
|
+
*/
|
58
|
+
export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Component to render an image, text and an action in a Card component.
|
62
|
+
*/
|
63
|
+
export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Static CSS class names used internally for the component slots.
|
67
|
+
*/
|
68
|
+
export declare const cardHeaderClassNames: SlotClassNames<CardHeaderSlots>;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* CardHeader component props.
|
72
|
+
*/
|
73
|
+
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Slots available in the CardHeader component.
|
77
|
+
*/
|
78
|
+
export declare type CardHeaderSlots = {
|
79
|
+
/**
|
80
|
+
* Root element of the component.
|
81
|
+
*/
|
82
|
+
root: Slot<'div'>;
|
83
|
+
/**
|
84
|
+
* Element used to render an image or avatar related to the card.
|
85
|
+
*/
|
86
|
+
image: Slot<'div'>;
|
87
|
+
/**
|
88
|
+
* Parent container of the header and description slots.
|
89
|
+
*/
|
90
|
+
content?: Slot<'div'>;
|
91
|
+
/**
|
92
|
+
* Element used to render the main header title.
|
93
|
+
*/
|
94
|
+
header: Slot<'span'>;
|
95
|
+
/**
|
96
|
+
* Element used to render short descriptions related to the title.
|
97
|
+
*/
|
98
|
+
description: Slot<'span'>;
|
99
|
+
/**
|
100
|
+
* Container that renders on the far end of the footer, used for action buttons.
|
101
|
+
*/
|
102
|
+
action?: Slot<'div'>;
|
103
|
+
};
|
104
|
+
|
105
|
+
/**
|
106
|
+
* State used in rendering CardHeader.
|
107
|
+
*/
|
108
|
+
export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Component to render image previews of documents or articles in a Card component.
|
112
|
+
*/
|
113
|
+
export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
|
114
|
+
|
115
|
+
/**
|
116
|
+
* Static CSS class names used internally for the component slots.
|
117
|
+
*/
|
118
|
+
export declare const cardPreviewClassNames: SlotClassNames<CardPreviewSlots>;
|
119
|
+
|
120
|
+
/**
|
121
|
+
* CardPreview component props.
|
122
|
+
*/
|
123
|
+
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Slots available in the Card component.
|
127
|
+
*/
|
128
|
+
export declare type CardPreviewSlots = {
|
129
|
+
/**
|
130
|
+
* Root element of the component.
|
131
|
+
*/
|
132
|
+
root: Slot<'div'>;
|
133
|
+
/**
|
134
|
+
* Container that holds a logo related to the image preview provided.
|
135
|
+
*/
|
136
|
+
logo?: Slot<'div'>;
|
137
|
+
};
|
138
|
+
|
139
|
+
/**
|
140
|
+
* State used in rendering CardPreview.
|
141
|
+
*/
|
142
|
+
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Card component props.
|
146
|
+
*/
|
147
|
+
export declare type CardProps = ComponentProps<CardSlots> & {
|
148
|
+
appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
149
|
+
/**
|
150
|
+
* Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.
|
151
|
+
*
|
152
|
+
* `off`
|
153
|
+
* The card will not focusable.
|
154
|
+
*
|
155
|
+
* `no-tab`
|
156
|
+
* This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when
|
157
|
+
* pressing the Escape key.
|
158
|
+
*
|
159
|
+
* `tab-exit`
|
160
|
+
* This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing
|
161
|
+
* the Tab key on the last inner element.
|
162
|
+
*
|
163
|
+
* `tab-only`
|
164
|
+
* This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus
|
165
|
+
* after the last inner element.
|
166
|
+
*
|
167
|
+
* @default 'off'
|
168
|
+
*/
|
169
|
+
focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';
|
170
|
+
/**
|
171
|
+
* Defines the orientation of the card.
|
172
|
+
*
|
173
|
+
* @default 'vertical'
|
174
|
+
*/
|
175
|
+
orientation?: 'horizontal' | 'vertical';
|
176
|
+
/**
|
177
|
+
* Controls the card's border radius and padding between inner elements.
|
178
|
+
*
|
179
|
+
* @default 'medium'
|
180
|
+
*/
|
181
|
+
size?: 'small' | 'medium' | 'large';
|
182
|
+
};
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Slots available in the Card component.
|
186
|
+
*/
|
187
|
+
export declare type CardSlots = {
|
188
|
+
/**
|
189
|
+
* Root element of the component.
|
190
|
+
*/
|
191
|
+
root: Slot<'div'>;
|
192
|
+
};
|
193
|
+
|
194
|
+
/**
|
195
|
+
* State used in rendering Card.
|
196
|
+
*/
|
197
|
+
export declare type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'>>;
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Render the final JSX of Card.
|
201
|
+
*/
|
202
|
+
export declare const renderCard_unstable: (state: CardState) => JSX.Element;
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Render the final JSX of CardFooter.
|
206
|
+
*/
|
207
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Render the final JSX of CardHeader.
|
211
|
+
*/
|
212
|
+
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Render the final JSX of CardPreview.
|
216
|
+
*/
|
217
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Create the state required to render Card.
|
221
|
+
*
|
222
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
223
|
+
* before being passed to renderCard_unstable.
|
224
|
+
*
|
225
|
+
* @param props - props from this instance of Card
|
226
|
+
* @param ref - reference to root HTMLElement of Card
|
227
|
+
*/
|
228
|
+
export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLElement>) => CardState;
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Create the state required to render CardFooter.
|
232
|
+
*
|
233
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
234
|
+
* before being passed to renderCardFooter_unstable.
|
235
|
+
*
|
236
|
+
* @param props - props from this instance of CardFooter
|
237
|
+
* @param ref - reference to root HTMLElement of CardFooter
|
238
|
+
*/
|
239
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
240
|
+
|
241
|
+
/**
|
242
|
+
* Apply styling to the CardFooter slots based on the state.
|
243
|
+
*/
|
244
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Create the state required to render CardHeader.
|
248
|
+
*
|
249
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
250
|
+
* before being passed to renderCardHeader_unstable.
|
251
|
+
*
|
252
|
+
* @param props - props from this instance of CardHeader
|
253
|
+
* @param ref - reference to root HTMLElement of CardHeader
|
254
|
+
*/
|
255
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Apply styling to the CardHeader slots based on the state.
|
259
|
+
*/
|
260
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Create the state required to render CardPreview.
|
264
|
+
*
|
265
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
266
|
+
* before being passed to renderCardPreview_unstable.
|
267
|
+
*
|
268
|
+
* @param props - props from this instance of CardPreview
|
269
|
+
* @param ref - reference to root HTMLElement of CardPreview
|
270
|
+
*/
|
271
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
272
|
+
|
273
|
+
/**
|
274
|
+
* Apply styling to the CardPreview slots based on the state.
|
275
|
+
*/
|
276
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
277
|
+
|
278
|
+
/**
|
279
|
+
* Apply styling to the Card slots based on the state.
|
280
|
+
*/
|
281
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
282
|
+
|
283
|
+
export { }
|
File without changes
|
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,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;EAClF,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;EAEA,sBAAsB,CAAC,KAAD,CAAtB;EACA,OAAO,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 +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\n/**\n * Slots available in the Card component.\n */\nexport type CardSlots = {\n /**\n * Root element of the component.\n */\n root: Slot<'div'>;\n};\n\n/**\n * Card component props.\n */\nexport type CardProps = ComponentProps<CardSlots> & {\n appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';\n\n /**\n * Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.\n *\n * `off`\n * The card will not focusable.\n *\n * `no-tab`\n * This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when\n * pressing the Escape key.\n *\n * `tab-exit`\n * This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing\n * the Tab key on the last inner element.\n *\n * `tab-only`\n * This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus\n * after the last inner element.\n *\n * @default 'off'\n */\n focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';\n\n /**\n * Defines the orientation of the card.\n *\n * @default 'vertical'\n */\n orientation?: 'horizontal' | 'vertical';\n\n /**\n * Controls the card's border radius and padding between inner elements.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering Card.\n */\nexport type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance' | 'orientation' | 'size'>>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"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
2
|
import { getSlots } from '@fluentui/react-utilities';
|
4
3
|
/**
|
5
|
-
* Render the final JSX of Card
|
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;EACtD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAY,KAAZ,CAArC;EAEA,oBAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CardSlots, CardState } from './Card.types';\n\n/**\n * Render the final JSX of Card.\n */\nexport const renderCard_unstable = (state: CardState) => {\n const { slots, slotProps } = getSlots<CardSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,28 +1,48 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import { getNativeElementProps } from '@fluentui/react-utilities';
|
3
|
-
import { useFocusableGroup
|
2
|
+
import { useFocusableGroup } from '@fluentui/react-tabster';
|
4
3
|
/**
|
5
4
|
* Create the state required to render Card.
|
6
5
|
*
|
7
|
-
* The returned state can be modified with hooks such as
|
8
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
7
|
+
* before being passed to renderCard_unstable.
|
9
8
|
*
|
10
9
|
* @param props - props from this instance of Card
|
11
10
|
* @param ref - reference to root HTMLElement of Card
|
12
11
|
*/
|
13
12
|
|
14
|
-
export
|
15
|
-
|
16
|
-
|
13
|
+
export const useCard_unstable = (props, ref) => {
|
14
|
+
const {
|
15
|
+
appearance = 'filled',
|
16
|
+
focusMode = 'off',
|
17
|
+
orientation = 'vertical',
|
18
|
+
size = 'medium'
|
19
|
+
} = props;
|
20
|
+
const focusMap = {
|
21
|
+
off: undefined,
|
22
|
+
'no-tab': 'limited-trap-focus',
|
23
|
+
'tab-exit': 'limited',
|
24
|
+
'tab-only': 'unlimited'
|
25
|
+
};
|
26
|
+
const groupperAttrs = useFocusableGroup({
|
27
|
+
tabBehavior: focusMap[focusMode]
|
17
28
|
});
|
29
|
+
const focusAttrs = focusMode !== 'off' ? {
|
30
|
+
tabIndex: 0,
|
31
|
+
...groupperAttrs
|
32
|
+
} : null;
|
18
33
|
return {
|
34
|
+
appearance,
|
35
|
+
orientation,
|
36
|
+
size,
|
19
37
|
components: {
|
20
38
|
root: 'div'
|
21
39
|
},
|
22
|
-
root: getNativeElementProps(props.as || 'div',
|
23
|
-
ref
|
24
|
-
role: 'group'
|
25
|
-
|
40
|
+
root: getNativeElementProps(props.as || 'div', {
|
41
|
+
ref,
|
42
|
+
role: 'group',
|
43
|
+
...focusAttrs,
|
44
|
+
...props
|
45
|
+
})
|
26
46
|
};
|
27
47
|
};
|
28
48
|
//# 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;EAC3F,MAAM;IAAE,UAAU,GAAG,QAAf;IAAyB,SAAS,GAAG,KAArC;IAA4C,WAAW,GAAG,UAA1D;IAAsE,IAAI,GAAG;EAA7E,IAA0F,KAAhG;EAEA,MAAM,QAAQ,GAAG;IACf,GAAG,EAAE,SADU;IAEf,UAAU,oBAFK;IAGf,YAAY,SAHG;IAIf,YAAY;EAJG,CAAjB;EAOA,MAAM,aAAa,GAAG,iBAAiB,CAAC;IACtC,WAAW,EAAE,QAAQ,CAAC,SAAD;EADiB,CAAD,CAAvC;EAIA,MAAM,UAAU,GAAG,SAAS,KAAK,KAAd,GAAsB;IAAE,QAAQ,EAAE,CAAZ;IAAe,GAAG;EAAlB,CAAtB,GAA0D,IAA7E;EAEA,OAAO;IACL,UADK;IAEL,WAFK;IAGL,IAHK;IAKL,UAAU,EAAE;MAAE,IAAI,EAAE;IAAR,CALP;IAML,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAN,IAAY,KAAb,EAAoB;MAC7C,GAD6C;MAE7C,IAAI,EAAE,OAFuC;MAG7C,GAAG,UAH0C;MAI7C,GAAG;IAJ0C,CAApB;EANtB,CAAP;AAaD,CA7BM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { CardProps, CardState } from './Card.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Card.\n *\n * The returned state can be modified with hooks such as useCardStyles_unstable,\n * before being passed to renderCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param ref - reference to root HTMLElement of Card\n */\nexport const useCard_unstable = (props: CardProps, ref: React.Ref<HTMLElement>): CardState => {\n const { appearance = 'filled', focusMode = 'off', orientation = 'vertical', size = 'medium' } = props;\n\n const focusMap = {\n off: undefined,\n 'no-tab': 'limited-trap-focus',\n 'tab-exit': 'limited',\n 'tab-only': 'unlimited',\n } as const;\n\n const groupperAttrs = useFocusableGroup({\n tabBehavior: focusMap[focusMode],\n });\n\n const focusAttrs = focusMode !== 'off' ? { tabIndex: 0, ...groupperAttrs } : null;\n\n return {\n appearance,\n orientation,\n size,\n\n components: { root: 'div' },\n root: getNativeElementProps(props.as || 'div', {\n ref,\n role: 'group',\n ...focusAttrs,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|