@fluentui/react-card 9.0.0-alpha.9 → 9.0.0-beta.11
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 +961 -8
- package/CHANGELOG.md +267 -9
- 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 +77 -131
- 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 +3 -3
- 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 +8 -2
- package/lib/components/Card/useCardStyles.js +140 -24
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.d.ts +2 -2
- 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 +8 -2
- package/lib/components/CardFooter/useCardFooterStyles.js +18 -8
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.d.ts +2 -2
- 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 -33
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +8 -2
- package/lib/components/CardHeader/useCardHeaderStyles.js +35 -9
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.d.ts +2 -2
- 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 +8 -2
- package/lib/components/CardPreview/useCardPreviewStyles.js +16 -11
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.d.ts +8 -4
- package/lib/index.js +5 -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.d.ts +3 -3
- 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 +8 -2
- package/lib-commonjs/components/Card/useCardStyles.js +145 -27
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.d.ts +2 -2
- 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 +8 -2
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +21 -11
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.d.ts +2 -2
- 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 +38 -37
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +8 -2
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +38 -12
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.d.ts +2 -2
- 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 +8 -2
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +19 -14
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +8 -4
- package/lib-commonjs/index.js +153 -5
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +20 -22
- 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/dist/react-card.d.ts
CHANGED
@@ -1,261 +1,207 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
3
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
4
|
import * as React_2 from 'react';
|
4
|
-
import type {
|
5
|
+
import type { Slot } from '@fluentui/react-utilities';
|
6
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
5
7
|
|
6
8
|
/**
|
7
|
-
*
|
9
|
+
* A card provides scaffolding for hosting actions and content for a single topic.
|
8
10
|
*/
|
9
|
-
export declare const Card:
|
11
|
+
export declare const Card: ForwardRefComponent<CardProps>;
|
10
12
|
|
11
13
|
/**
|
12
|
-
*
|
14
|
+
* @deprecated Use `cardClassNames.root` instead.
|
13
15
|
*/
|
14
|
-
export declare
|
16
|
+
export declare const cardClassName = "fui-Card";
|
17
|
+
|
18
|
+
export declare const cardClassNames: SlotClassNames<CardSlots>;
|
19
|
+
|
20
|
+
export declare type CardCommons = {
|
21
|
+
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
22
|
+
};
|
15
23
|
|
16
24
|
/**
|
17
25
|
* Component to render Button actions in a Card component.
|
18
26
|
*/
|
19
|
-
export declare const CardFooter:
|
27
|
+
export declare const CardFooter: ForwardRefComponent<CardFooterProps>;
|
20
28
|
|
21
29
|
/**
|
22
|
-
*
|
30
|
+
* @deprecated Use `cardFooterClassNames.root` instead.
|
23
31
|
*/
|
24
|
-
export declare
|
32
|
+
export declare const cardFooterClassName = "fui-CardFooter";
|
25
33
|
|
26
|
-
|
27
|
-
* CardFooter Props
|
28
|
-
*/
|
29
|
-
export declare interface CardFooterProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
|
30
|
-
/**
|
31
|
-
* Actions slot
|
32
|
-
*/
|
33
|
-
action?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
34
|
-
}
|
34
|
+
export declare const cardFooterClassNames: SlotClassNames<CardFooterSlots>;
|
35
35
|
|
36
36
|
/**
|
37
|
-
*
|
37
|
+
* CardFooter props
|
38
38
|
*/
|
39
|
-
export declare type
|
39
|
+
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
export declare type CardFooterSlots = {
|
42
|
+
root: Slot<'div'>;
|
43
|
+
action?: Slot<'div'>;
|
44
|
+
};
|
45
45
|
|
46
46
|
/**
|
47
47
|
* State used in rendering CardFooter
|
48
48
|
*/
|
49
|
-
export declare
|
50
|
-
/**
|
51
|
-
* Ref to the root element
|
52
|
-
*/
|
53
|
-
ref: React_2.Ref<HTMLElement>;
|
54
|
-
}
|
49
|
+
export declare type CardFooterState = ComponentState<CardFooterSlots>;
|
55
50
|
|
56
51
|
/**
|
57
52
|
* Component to render an image, text and an action in a Card component.
|
58
53
|
*/
|
59
|
-
export declare const CardHeader:
|
54
|
+
export declare const CardHeader: ForwardRefComponent<CardHeaderProps>;
|
60
55
|
|
61
56
|
/**
|
62
|
-
*
|
57
|
+
* @deprecated Use `cardHeaderClassNames.root` instead.
|
63
58
|
*/
|
64
|
-
export declare
|
59
|
+
export declare const cardHeaderClassName = "fui-CardHeader";
|
65
60
|
|
66
|
-
|
67
|
-
* CardHeader Props
|
68
|
-
*/
|
69
|
-
export declare interface CardHeaderProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
|
70
|
-
/**
|
71
|
-
* Image slot
|
72
|
-
*/
|
73
|
-
image: ShorthandPropsCompat<React_2.ImgHTMLAttributes<HTMLImageElement>>;
|
74
|
-
/**
|
75
|
-
* Content slot, wrapper of the header and description slots
|
76
|
-
*/
|
77
|
-
content?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
78
|
-
/**
|
79
|
-
* Header title slot
|
80
|
-
*/
|
81
|
-
header: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
82
|
-
/**
|
83
|
-
* Description slot
|
84
|
-
*/
|
85
|
-
description: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
86
|
-
/**
|
87
|
-
* Actions slot
|
88
|
-
*/
|
89
|
-
action?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
90
|
-
}
|
61
|
+
export declare const cardHeaderClassNames: SlotClassNames<CardHeaderSlots>;
|
91
62
|
|
92
63
|
/**
|
93
|
-
*
|
64
|
+
* CardHeader props
|
94
65
|
*/
|
95
|
-
export declare type
|
66
|
+
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
96
67
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
68
|
+
export declare type CardHeaderSlots = {
|
69
|
+
root: Slot<'div'>;
|
70
|
+
image: Slot<'div'>;
|
71
|
+
content?: Slot<'div'>;
|
72
|
+
header: Slot<'span'>;
|
73
|
+
description: Slot<'span'>;
|
74
|
+
action?: Slot<'div'>;
|
75
|
+
};
|
101
76
|
|
102
77
|
/**
|
103
78
|
* State used in rendering CardHeader
|
104
79
|
*/
|
105
|
-
export declare
|
106
|
-
/**
|
107
|
-
* Ref to the root element
|
108
|
-
*/
|
109
|
-
ref: React_2.Ref<HTMLElement>;
|
110
|
-
}
|
80
|
+
export declare type CardHeaderState = ComponentState<CardHeaderSlots>;
|
111
81
|
|
112
82
|
/**
|
113
83
|
* Component to render image previews of documents or articles in a Card component.
|
114
84
|
*/
|
115
|
-
export declare const CardPreview:
|
85
|
+
export declare const CardPreview: ForwardRefComponent<CardPreviewProps>;
|
116
86
|
|
117
87
|
/**
|
118
|
-
*
|
88
|
+
* @deprecated Use `cardPreviewClassNames.root` instead.
|
119
89
|
*/
|
120
|
-
export declare
|
90
|
+
export declare const cardPreviewClassName = "fui-CardPreview";
|
121
91
|
|
122
|
-
|
123
|
-
* CardPreview Props
|
124
|
-
*/
|
125
|
-
export declare interface CardPreviewProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
|
126
|
-
/**
|
127
|
-
* Image slot
|
128
|
-
*/
|
129
|
-
logo?: ShorthandPropsCompat<React_2.ImgHTMLAttributes<HTMLImageElement>>;
|
130
|
-
}
|
92
|
+
export declare const cardPreviewClassNames: SlotClassNames<CardPreviewSlots>;
|
131
93
|
|
132
94
|
/**
|
133
|
-
*
|
95
|
+
* CardPreview props
|
134
96
|
*/
|
135
|
-
export declare type
|
97
|
+
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
136
98
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
99
|
+
export declare type CardPreviewSlots = {
|
100
|
+
root: Slot<'div'>;
|
101
|
+
logo?: Slot<'div'>;
|
102
|
+
};
|
141
103
|
|
142
104
|
/**
|
143
105
|
* State used in rendering CardPreview
|
144
106
|
*/
|
145
|
-
export declare
|
146
|
-
/**
|
147
|
-
* Ref to the root element
|
148
|
-
*/
|
149
|
-
ref: React_2.Ref<HTMLElement>;
|
150
|
-
}
|
107
|
+
export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
151
108
|
|
152
109
|
/**
|
153
110
|
* Card Props
|
154
111
|
*/
|
155
|
-
export declare
|
156
|
-
}
|
112
|
+
export declare type CardProps = ComponentProps<CardSlots> & Partial<CardCommons>;
|
157
113
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
export declare type CardShorthandProps = never;
|
114
|
+
export declare type CardSlots = {
|
115
|
+
root: Slot<'div'>;
|
116
|
+
};
|
162
117
|
|
163
118
|
/**
|
164
119
|
* State used in rendering Card
|
165
120
|
*/
|
166
|
-
export declare
|
167
|
-
/**
|
168
|
-
* Ref to the root element
|
169
|
-
*/
|
170
|
-
ref: React_2.Ref<HTMLElement>;
|
171
|
-
}
|
121
|
+
export declare type CardState = ComponentState<CardSlots> & CardCommons;
|
172
122
|
|
173
123
|
/**
|
174
124
|
* Render the final JSX of Card
|
175
125
|
*/
|
176
|
-
export declare const
|
126
|
+
export declare const renderCard_unstable: (state: CardState) => JSX.Element;
|
177
127
|
|
178
128
|
/**
|
179
129
|
* Render the final JSX of CardFooter
|
180
130
|
*/
|
181
|
-
export declare const
|
131
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
182
132
|
|
183
133
|
/**
|
184
134
|
* Render the final JSX of CardHeader
|
185
135
|
*/
|
186
|
-
export declare const
|
136
|
+
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
187
137
|
|
188
138
|
/**
|
189
139
|
* Render the final JSX of CardPreview
|
190
140
|
*/
|
191
|
-
export declare const
|
141
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
192
142
|
|
193
143
|
/**
|
194
144
|
* Create the state required to render Card.
|
195
145
|
*
|
196
|
-
* The returned state can be modified with hooks such as
|
197
|
-
* before being passed to
|
146
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
147
|
+
* before being passed to renderCard_unstable.
|
198
148
|
*
|
199
149
|
* @param props - props from this instance of Card
|
200
150
|
* @param ref - reference to root HTMLElement of Card
|
201
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
202
151
|
*/
|
203
|
-
export declare const
|
152
|
+
export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLElement>) => CardState;
|
204
153
|
|
205
154
|
/**
|
206
155
|
* Create the state required to render CardFooter.
|
207
156
|
*
|
208
|
-
* The returned state can be modified with hooks such as
|
209
|
-
* before being passed to
|
157
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
158
|
+
* before being passed to renderCardFooter_unstable.
|
210
159
|
*
|
211
160
|
* @param props - props from this instance of CardFooter
|
212
161
|
* @param ref - reference to root HTMLElement of CardFooter
|
213
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
214
162
|
*/
|
215
|
-
export declare const
|
163
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
216
164
|
|
217
165
|
/**
|
218
166
|
* Apply styling to the CardFooter slots based on the state
|
219
167
|
*/
|
220
|
-
export declare const
|
168
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
221
169
|
|
222
170
|
/**
|
223
171
|
* Create the state required to render CardHeader.
|
224
172
|
*
|
225
|
-
* The returned state can be modified with hooks such as
|
226
|
-
* before being passed to
|
173
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
174
|
+
* before being passed to renderCardHeader_unstable.
|
227
175
|
*
|
228
176
|
* @param props - props from this instance of CardHeader
|
229
177
|
* @param ref - reference to root HTMLElement of CardHeader
|
230
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
231
178
|
*/
|
232
|
-
export declare const
|
179
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
233
180
|
|
234
181
|
/**
|
235
182
|
* Apply styling to the CardHeader slots based on the state
|
236
183
|
*/
|
237
|
-
export declare const
|
184
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
238
185
|
|
239
186
|
/**
|
240
187
|
* Create the state required to render CardPreview.
|
241
188
|
*
|
242
|
-
* The returned state can be modified with hooks such as
|
243
|
-
* before being passed to
|
189
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
190
|
+
* before being passed to renderCardPreview_unstable.
|
244
191
|
*
|
245
192
|
* @param props - props from this instance of CardPreview
|
246
193
|
* @param ref - reference to root HTMLElement of CardPreview
|
247
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
248
194
|
*/
|
249
|
-
export declare const
|
195
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
250
196
|
|
251
197
|
/**
|
252
198
|
* Apply styling to the CardPreview slots based on the state
|
253
199
|
*/
|
254
|
-
export declare const
|
200
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
255
201
|
|
256
202
|
/**
|
257
203
|
* Apply styling to the Card slots based on the state
|
258
204
|
*/
|
259
|
-
export declare const
|
205
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
260
206
|
|
261
207
|
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
|
-
import * as React from 'react';
|
2
1
|
import type { CardProps } from './Card.types';
|
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
|
-
export declare const Card:
|
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,11 @@
|
|
1
|
-
import type { CardState } from './Card.types';
|
1
|
+
import type { CardSlots, CardState } from './Card.types';
|
2
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* @deprecated Use `cardClassNames.root` instead.
|
5
|
+
*/
|
6
|
+
export declare const cardClassName = "fui-Card";
|
7
|
+
export declare const cardClassNames: SlotClassNames<CardSlots>;
|
2
8
|
/**
|
3
9
|
* Apply styling to the Card slots based on the state
|
4
10
|
*/
|
5
|
-
export declare const
|
11
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|