@fluentui/react-card 9.0.0-beta.5 → 9.0.0-beta.9
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 +248 -9
- package/CHANGELOG.md +62 -10
- 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 +36 -46
- 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 +6 -6
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/Card.types.d.ts +5 -3
- 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 +3 -2
- package/lib/components/Card/renderCard.js.map +1 -1
- package/lib/components/Card/useCard.d.ts +3 -3
- package/lib/components/Card/useCard.js +7 -3
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.d.ts +1 -1
- package/lib/components/Card/useCardStyles.js +127 -23
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.js +6 -6
- package/lib/components/CardFooter/CardFooter.js.map +1 -1
- package/lib/components/CardFooter/CardFooter.types.d.ts +3 -3
- 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 +5 -4
- package/lib/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooter.d.ts +4 -8
- package/lib/components/CardFooter/useCardFooter.js +3 -8
- package/lib/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +1 -1
- package/lib/components/CardFooter/useCardFooterStyles.js +5 -4
- package/lib/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.js +6 -6
- package/lib/components/CardHeader/CardHeader.js.map +1 -1
- package/lib/components/CardHeader/CardHeader.types.d.ts +8 -8
- 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 +9 -4
- package/lib/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeader.d.ts +4 -5
- package/lib/components/CardHeader/useCardHeader.js +3 -4
- package/lib/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +1 -1
- package/lib/components/CardHeader/useCardHeaderStyles.js +5 -4
- package/lib/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.js +6 -6
- package/lib/components/CardPreview/CardPreview.js.map +1 -1
- package/lib/components/CardPreview/CardPreview.types.d.ts +3 -3
- 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 +5 -4
- package/lib/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreview.d.ts +4 -8
- package/lib/components/CardPreview/useCardPreview.js +3 -8
- package/lib/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +1 -1
- package/lib/components/CardPreview/useCardPreviewStyles.js +3 -7
- package/lib/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Card.js.map +1 -1
- package/lib-commonjs/CardFooter.js.map +1 -1
- package/lib-commonjs/CardHeader.js.map +1 -1
- package/lib-commonjs/CardPreview.js.map +1 -1
- package/lib-commonjs/components/Card/Card.js +3 -3
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.d.ts +5 -3
- package/lib-commonjs/components/Card/Card.types.js.map +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 +5 -4
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.d.ts +3 -3
- package/lib-commonjs/components/Card/useCard.js +9 -5
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.d.ts +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +131 -26
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +3 -3
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +3 -3
- package/lib-commonjs/components/CardFooter/CardFooter.types.js.map +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 +7 -7
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +4 -8
- package/lib-commonjs/components/CardFooter/useCardFooter.js +6 -11
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +10 -9
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +3 -3
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +8 -8
- package/lib-commonjs/components/CardHeader/CardHeader.types.js.map +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 +11 -7
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +4 -5
- package/lib-commonjs/components/CardHeader/useCardHeader.js +6 -7
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +11 -10
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +3 -3
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +3 -3
- package/lib-commonjs/components/CardPreview/CardPreview.types.js.map +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 +7 -7
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +4 -8
- package/lib-commonjs/components/CardPreview/useCardPreview.js +6 -11
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +8 -12
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -11
package/dist/react-card.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
2
|
import type { ComponentState } from '@fluentui/react-utilities';
|
3
3
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
4
|
-
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
5
4
|
import * as React_2 from 'react';
|
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.
|
@@ -11,7 +11,9 @@ export declare const Card: ForwardRefComponent<CardProps>;
|
|
11
11
|
|
12
12
|
export declare const cardClassName = "fui-Card";
|
13
13
|
|
14
|
-
export declare type CardCommons = {
|
14
|
+
export declare type CardCommons = {
|
15
|
+
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
16
|
+
};
|
15
17
|
|
16
18
|
/**
|
17
19
|
* Component to render Button actions in a Card component.
|
@@ -25,14 +27,9 @@ export declare const cardFooterClassName = "fui-CardFooter";
|
|
25
27
|
*/
|
26
28
|
export declare type CardFooterProps = ComponentProps<CardFooterSlots>;
|
27
29
|
|
28
|
-
/**
|
29
|
-
* Array of all shorthand properties listed in CardFooterShorthandProps
|
30
|
-
*/
|
31
|
-
export declare const cardFooterShorthandProps: Array<keyof CardFooterSlots>;
|
32
|
-
|
33
30
|
export declare type CardFooterSlots = {
|
34
|
-
root:
|
35
|
-
action?:
|
31
|
+
root: Slot<'div'>;
|
32
|
+
action?: Slot<'div'>;
|
36
33
|
};
|
37
34
|
|
38
35
|
/**
|
@@ -50,17 +47,15 @@ export declare const cardHeaderClassName = "fui-CardHeader";
|
|
50
47
|
/**
|
51
48
|
* CardHeader props
|
52
49
|
*/
|
53
|
-
export declare type CardHeaderProps = ComponentProps<CardHeaderSlots
|
54
|
-
|
55
|
-
export declare const cardHeaderShorthandProps: Array<keyof CardHeaderSlots>;
|
50
|
+
export declare type CardHeaderProps = ComponentProps<Partial<CardHeaderSlots>>;
|
56
51
|
|
57
52
|
export declare type CardHeaderSlots = {
|
58
|
-
root:
|
59
|
-
image:
|
60
|
-
content?:
|
61
|
-
header:
|
62
|
-
description:
|
63
|
-
action?:
|
53
|
+
root: Slot<'div'>;
|
54
|
+
image: Slot<'div'>;
|
55
|
+
content?: Slot<'div'>;
|
56
|
+
header: Slot<'span'>;
|
57
|
+
description: Slot<'span'>;
|
58
|
+
action?: Slot<'div'>;
|
64
59
|
};
|
65
60
|
|
66
61
|
/**
|
@@ -80,14 +75,9 @@ export declare const cardPreviewClassName = "fui-CardPreview";
|
|
80
75
|
*/
|
81
76
|
export declare type CardPreviewProps = ComponentProps<CardPreviewSlots>;
|
82
77
|
|
83
|
-
/**
|
84
|
-
* Array of all shorthand properties listed in CardPreviewShorthandProps
|
85
|
-
*/
|
86
|
-
export declare const cardPreviewShorthandProps: Array<keyof CardPreviewSlots>;
|
87
|
-
|
88
78
|
export declare type CardPreviewSlots = {
|
89
|
-
root:
|
90
|
-
logo?:
|
79
|
+
root: Slot<'div'>;
|
80
|
+
logo?: Slot<'div'>;
|
91
81
|
};
|
92
82
|
|
93
83
|
/**
|
@@ -101,7 +91,7 @@ export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
|
101
91
|
export declare type CardProps = ComponentProps<CardSlots> & Partial<CardCommons>;
|
102
92
|
|
103
93
|
export declare type CardSlots = {
|
104
|
-
root:
|
94
|
+
root: Slot<'div'>;
|
105
95
|
};
|
106
96
|
|
107
97
|
/**
|
@@ -112,85 +102,85 @@ export declare type CardState = ComponentState<CardSlots> & CardCommons;
|
|
112
102
|
/**
|
113
103
|
* Render the final JSX of Card
|
114
104
|
*/
|
115
|
-
export declare const
|
105
|
+
export declare const renderCard_unstable: (state: CardState) => JSX.Element;
|
116
106
|
|
117
107
|
/**
|
118
108
|
* Render the final JSX of CardFooter
|
119
109
|
*/
|
120
|
-
export declare const
|
110
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|
121
111
|
|
122
112
|
/**
|
123
113
|
* Render the final JSX of CardHeader
|
124
114
|
*/
|
125
|
-
export declare const
|
115
|
+
export declare const renderCardHeader_unstable: (state: CardHeaderState) => JSX.Element;
|
126
116
|
|
127
117
|
/**
|
128
118
|
* Render the final JSX of CardPreview
|
129
119
|
*/
|
130
|
-
export declare const
|
120
|
+
export declare const renderCardPreview_unstable: (state: CardPreviewState) => JSX.Element;
|
131
121
|
|
132
122
|
/**
|
133
123
|
* Create the state required to render Card.
|
134
124
|
*
|
135
|
-
* The returned state can be modified with hooks such as
|
136
|
-
* before being passed to
|
125
|
+
* The returned state can be modified with hooks such as useCardStyles_unstable,
|
126
|
+
* before being passed to renderCard_unstable.
|
137
127
|
*
|
138
128
|
* @param props - props from this instance of Card
|
139
129
|
* @param ref - reference to root HTMLElement of Card
|
140
130
|
*/
|
141
|
-
export declare const
|
131
|
+
export declare const useCard_unstable: (props: CardProps, ref: React_2.Ref<HTMLElement>) => CardState;
|
142
132
|
|
143
133
|
/**
|
144
134
|
* Create the state required to render CardFooter.
|
145
135
|
*
|
146
|
-
* The returned state can be modified with hooks such as
|
147
|
-
* before being passed to
|
136
|
+
* The returned state can be modified with hooks such as useCardFooterStyles_unstable,
|
137
|
+
* before being passed to renderCardFooter_unstable.
|
148
138
|
*
|
149
139
|
* @param props - props from this instance of CardFooter
|
150
140
|
* @param ref - reference to root HTMLElement of CardFooter
|
151
141
|
*/
|
152
|
-
export declare const
|
142
|
+
export declare const useCardFooter_unstable: (props: CardFooterProps, ref: React_2.Ref<HTMLElement>) => CardFooterState;
|
153
143
|
|
154
144
|
/**
|
155
145
|
* Apply styling to the CardFooter slots based on the state
|
156
146
|
*/
|
157
|
-
export declare const
|
147
|
+
export declare const useCardFooterStyles_unstable: (state: CardFooterState) => CardFooterState;
|
158
148
|
|
159
149
|
/**
|
160
150
|
* Create the state required to render CardHeader.
|
161
151
|
*
|
162
|
-
* The returned state can be modified with hooks such as
|
163
|
-
* before being passed to
|
152
|
+
* The returned state can be modified with hooks such as useCardHeaderStyles_unstable,
|
153
|
+
* before being passed to renderCardHeader_unstable.
|
164
154
|
*
|
165
155
|
* @param props - props from this instance of CardHeader
|
166
156
|
* @param ref - reference to root HTMLElement of CardHeader
|
167
157
|
*/
|
168
|
-
export declare const
|
158
|
+
export declare const useCardHeader_unstable: (props: CardHeaderProps, ref: React_2.Ref<HTMLElement>) => CardHeaderState;
|
169
159
|
|
170
160
|
/**
|
171
161
|
* Apply styling to the CardHeader slots based on the state
|
172
162
|
*/
|
173
|
-
export declare const
|
163
|
+
export declare const useCardHeaderStyles_unstable: (state: CardHeaderState) => CardHeaderState;
|
174
164
|
|
175
165
|
/**
|
176
166
|
* Create the state required to render CardPreview.
|
177
167
|
*
|
178
|
-
* The returned state can be modified with hooks such as
|
179
|
-
* before being passed to
|
168
|
+
* The returned state can be modified with hooks such as useCardPreviewStyles_unstable,
|
169
|
+
* before being passed to renderCardPreview_unstable.
|
180
170
|
*
|
181
171
|
* @param props - props from this instance of CardPreview
|
182
172
|
* @param ref - reference to root HTMLElement of CardPreview
|
183
173
|
*/
|
184
|
-
export declare const
|
174
|
+
export declare const useCardPreview_unstable: (props: CardPreviewProps, ref: React_2.Ref<HTMLElement>) => CardPreviewState;
|
185
175
|
|
186
176
|
/**
|
187
177
|
* Apply styling to the CardPreview slots based on the state
|
188
178
|
*/
|
189
|
-
export declare const
|
179
|
+
export declare const useCardPreviewStyles_unstable: (state: CardPreviewState) => CardPreviewState;
|
190
180
|
|
191
181
|
/**
|
192
182
|
* Apply styling to the Card slots based on the state
|
193
183
|
*/
|
194
|
-
export declare const
|
184
|
+
export declare const useCardStyles_unstable: (state: CardState) => CardState;
|
195
185
|
|
196
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,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
9
|
export const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
-
const state =
|
11
|
-
|
12
|
-
return
|
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,8 +1,10 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
2
|
export declare type CardSlots = {
|
3
|
-
root:
|
3
|
+
root: Slot<'div'>;
|
4
|
+
};
|
5
|
+
export declare type CardCommons = {
|
6
|
+
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
4
7
|
};
|
5
|
-
export declare type CardCommons = {};
|
6
8
|
/**
|
7
9
|
* Card Props
|
8
10
|
*/
|
@@ -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"]}
|
@@ -4,11 +4,12 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
4
4
|
* Render the final JSX of Card
|
5
5
|
*/
|
6
6
|
|
7
|
-
export const
|
7
|
+
export const renderCard_unstable = state => {
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
11
|
} = getSlots(state);
|
12
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
13
|
+
});
|
13
14
|
};
|
14
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,10 +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
11
|
*/
|
12
|
-
export declare const
|
12
|
+
export declare const useCard_unstable: (props: CardProps, ref: React.Ref<HTMLElement>) => CardState;
|
@@ -3,18 +3,22 @@ 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
11
|
*/
|
12
12
|
|
13
|
-
export const
|
13
|
+
export const useCard_unstable = (props, ref) => {
|
14
14
|
const groupperAttrs = useFocusableGroup({
|
15
15
|
tabBehavior: 'limitedTrapFocus'
|
16
16
|
});
|
17
|
+
const {
|
18
|
+
appearance = 'filled'
|
19
|
+
} = props;
|
17
20
|
return {
|
21
|
+
appearance,
|
18
22
|
components: {
|
19
23
|
root: 'div'
|
20
24
|
},
|
@@ -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,4 +1,5 @@
|
|
1
|
-
import { __styles, mergeClasses } from '@
|
1
|
+
import { shorthands, __styles, mergeClasses } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
2
3
|
import { cardPreviewClassName } from '../CardPreview/index';
|
3
4
|
export const cardClassName = 'fui-Card';
|
4
5
|
/**
|
@@ -7,40 +8,143 @@ export const cardClassName = 'fui-Card';
|
|
7
8
|
|
8
9
|
const useStyles = /*#__PURE__*/__styles({
|
9
10
|
"root": {
|
10
|
-
"mc9l5x": "
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"E5pizo": "f1whvlc6",
|
11
|
+
"mc9l5x": "ftgm304",
|
12
|
+
"B68tc82": "f1p9o1ba",
|
13
|
+
"Bmxbyg5": "f1sil6mw",
|
14
14
|
"sj55zd": "f19n0e5",
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
|
26
|
-
|
15
|
+
"icvyot": "fzkkow9",
|
16
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
17
|
+
"oivjwe": "fg706s2",
|
18
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
19
|
+
"B4j52fo": "f192inf7",
|
20
|
+
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
21
|
+
"Bn0qgzm": "f1vxd6vx",
|
22
|
+
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
23
|
+
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
24
|
+
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
25
|
+
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
26
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
27
|
+
"Ecqjvq": "f70or3y",
|
28
|
+
"B39syqp": ["f1s27jks", "f1x7x6se"],
|
29
|
+
"m3o775": "f1q2lvbs",
|
30
|
+
"I0kkcn": ["f1x7x6se", "f1s27jks"]
|
31
|
+
},
|
32
|
+
"filledInteractive": {
|
27
33
|
"Bceei9c": "f1k6fduh",
|
34
|
+
"De3pzq": "fxugw4r",
|
35
|
+
"g2u3we": "fghlq4f",
|
36
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
37
|
+
"B9xav0g": "fb073pr",
|
38
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
39
|
+
"E5pizo": "f1whvlc6",
|
28
40
|
"Jwef8y": "f1knas48",
|
29
|
-
"
|
41
|
+
"Bgoe8wy": "fpa59ij",
|
42
|
+
"Bwzppfd": ["f1rhln42", "f1l1ogpg"],
|
43
|
+
"oetu4i": "fz67qlh",
|
44
|
+
"gg5e9n": ["f1l1ogpg", "f1rhln42"],
|
45
|
+
"Bvxd0ez": "f1m145df",
|
46
|
+
"ecr2s2": "fb40n2d",
|
47
|
+
"B6oc9vd": "f7cshhm",
|
48
|
+
"ak43y8": ["f1bzyac8", "f131p3c2"],
|
49
|
+
"wmxk5l": "f1bazisv",
|
50
|
+
"B50zh58": ["f131p3c2", "f1bzyac8"]
|
51
|
+
},
|
52
|
+
"filled": {
|
53
|
+
"De3pzq": "fxugw4r",
|
54
|
+
"g2u3we": "fghlq4f",
|
55
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
56
|
+
"B9xav0g": "fb073pr",
|
57
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
58
|
+
"E5pizo": "f1whvlc6"
|
59
|
+
},
|
60
|
+
"filledAlternativeInteractive": {
|
61
|
+
"Bceei9c": "f1k6fduh",
|
62
|
+
"De3pzq": "f1dmdbja",
|
63
|
+
"g2u3we": "fghlq4f",
|
64
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
65
|
+
"B9xav0g": "fb073pr",
|
66
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
67
|
+
"E5pizo": "f1whvlc6",
|
68
|
+
"Jwef8y": "f1uvynv3",
|
69
|
+
"Bgoe8wy": "fpa59ij",
|
70
|
+
"Bwzppfd": ["f1rhln42", "f1l1ogpg"],
|
71
|
+
"oetu4i": "fz67qlh",
|
72
|
+
"gg5e9n": ["f1l1ogpg", "f1rhln42"],
|
73
|
+
"Bvxd0ez": "f1m145df",
|
74
|
+
"ecr2s2": "f1yhgkbh",
|
75
|
+
"B6oc9vd": "f7cshhm",
|
76
|
+
"ak43y8": ["f1bzyac8", "f131p3c2"],
|
77
|
+
"wmxk5l": "f1bazisv",
|
78
|
+
"B50zh58": ["f131p3c2", "f1bzyac8"]
|
79
|
+
},
|
80
|
+
"filledAlternative": {
|
81
|
+
"De3pzq": "f1dmdbja",
|
82
|
+
"g2u3we": "fghlq4f",
|
83
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
84
|
+
"B9xav0g": "fb073pr",
|
85
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
86
|
+
"E5pizo": "f1whvlc6"
|
87
|
+
},
|
88
|
+
"outlineInteractive": {
|
89
|
+
"Bceei9c": "f1k6fduh",
|
90
|
+
"De3pzq": "f1c21dwh",
|
91
|
+
"g2u3we": "fj3muxo",
|
92
|
+
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
93
|
+
"B9xav0g": "f1aperda",
|
94
|
+
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
95
|
+
"E5pizo": "f1couhl3",
|
96
|
+
"Jwef8y": "fjxutwb",
|
97
|
+
"Bgoe8wy": "fvcxoqz",
|
98
|
+
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
99
|
+
"oetu4i": "f1xlaoq0",
|
100
|
+
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
101
|
+
"ecr2s2": "fophhak",
|
102
|
+
"B6oc9vd": "fvs00aa",
|
103
|
+
"ak43y8": ["f1assf6x", "f4ruux4"],
|
104
|
+
"wmxk5l": "fumykes",
|
105
|
+
"B50zh58": ["f4ruux4", "f1assf6x"]
|
106
|
+
},
|
107
|
+
"outline": {
|
108
|
+
"De3pzq": "f1c21dwh",
|
109
|
+
"g2u3we": "fj3muxo",
|
110
|
+
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
111
|
+
"B9xav0g": "f1aperda",
|
112
|
+
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
113
|
+
"E5pizo": "f1couhl3"
|
114
|
+
},
|
115
|
+
"subtleInteractive": {
|
116
|
+
"Bceei9c": "f1k6fduh",
|
117
|
+
"De3pzq": "fhovq9v",
|
118
|
+
"g2u3we": "fghlq4f",
|
119
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
120
|
+
"B9xav0g": "fb073pr",
|
121
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
122
|
+
"E5pizo": "f1couhl3",
|
123
|
+
"Jwef8y": "f1t94bn6",
|
124
|
+
"ecr2s2": "f1wfn5kd"
|
125
|
+
},
|
126
|
+
"subtle": {
|
127
|
+
"De3pzq": "fhovq9v",
|
128
|
+
"g2u3we": "fghlq4f",
|
129
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
130
|
+
"B9xav0g": "fb073pr",
|
131
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
132
|
+
"E5pizo": "f1couhl3"
|
30
133
|
}
|
31
134
|
}, {
|
32
|
-
"d": [".
|
33
|
-
"h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}"],
|
34
|
-
"a": [".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}"]
|
135
|
+
"d": [".ftgm304{display:block;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f70or3y>*:not(.fui-CardPreview){margin-top:12px;}", ".f1s27jks>*:not(.fui-CardPreview){margin-right:12px;}", ".f1x7x6se>*:not(.fui-CardPreview){margin-left:12px;}", ".f1q2lvbs>*:not(.fui-CardPreview){margin-bottom:12px;}", ".f1k6fduh{cursor:pointer;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1whvlc6{box-shadow:var(--shadow4);}", ".f1dmdbja{background-color:var(--colorNeutralBackground2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f1couhl3{box-shadow:none;}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"],
|
136
|
+
"h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fpa59ij:hover{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f1rhln42:hover{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f1l1ogpg:hover{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fz67qlh:hover{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1m145df:hover{box-shadow:var(--shadow8);}", ".f1uvynv3:hover{background-color:var(--colorNeutralBackground2Hover);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
137
|
+
"a": [".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".f7cshhm:active{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f1bzyac8:active{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f131p3c2:active{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f1bazisv:active{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1yhgkbh:active{background-color:var(--colorNeutralBackground2Pressed);}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fumykes:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
35
138
|
});
|
36
139
|
/**
|
37
140
|
* Apply styling to the Card slots based on the state
|
38
141
|
*/
|
39
142
|
|
40
143
|
|
41
|
-
export const
|
144
|
+
export const useCardStyles_unstable = state => {
|
42
145
|
const styles = useStyles();
|
43
|
-
|
146
|
+
const interactive = state.root.onClick || state.root.onMouseUp || state.root.onMouseDown || state.root.onPointerUp || state.root.onPointerDown || state.root.onTouchStart || state.root.onTouchEnd;
|
147
|
+
state.root.className = mergeClasses(cardClassName, styles.root, state.appearance === 'filled' && styles.filled, state.appearance === 'filled-alternative' && styles.filledAlternative, state.appearance === 'outline' && styles.outline, state.appearance === 'subtle' && styles.subtle, interactive && state.appearance === 'filled' && styles.filledInteractive, interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive, interactive && state.appearance === 'outline' && styles.outlineInteractive, interactive && state.appearance === 'subtle' && styles.subtleInteractive, state.root.className);
|
44
148
|
return state;
|
45
149
|
};
|
46
150
|
//# sourceMappingURL=useCardStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Card/useCardStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,oBAAT,QAAqC,sBAArC;AAGA,OAAO,MAAM,aAAa,GAAG,UAAtB;AAEP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoGA;;AAEG;;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAgC;AACpE,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,QAAM,WAAW,GACf,KAAK,CAAC,IAAN,CAAW,OAAX,IACA,KAAK,CAAC,IAAN,CAAW,SADX,IAEA,KAAK,CAAC,IAAN,CAAW,WAFX,IAGA,KAAK,CAAC,IAAN,CAAW,WAHX,IAIA,KAAK,CAAC,IAAN,CAAW,aAJX,IAKA,KAAK,CAAC,IAAN,CAAW,YALX,IAMA,KAAK,CAAC,IAAN,CAAW,UAPb;AASA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,aADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,UAAN,KAAqB,QAArB,IAAiC,MAAM,CAAC,MAHP,EAIjC,KAAK,CAAC,UAAN,KAAqB,oBAArB,IAA6C,MAAM,CAAC,iBAJnB,EAKjC,KAAK,CAAC,UAAN,KAAqB,SAArB,IAAkC,MAAM,CAAC,OALR,EAMjC,KAAK,CAAC,UAAN,KAAqB,QAArB,IAAiC,MAAM,CAAC,MANP,EAOjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,QAApC,IAAgD,MAAM,CAAC,iBAPtB,EAQjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,oBAApC,IAA4D,MAAM,CAAC,4BARlC,EASjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,SAApC,IAAiD,MAAM,CAAC,kBATvB,EAUjC,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,QAApC,IAAgD,MAAM,CAAC,iBAVtB,EAWjC,KAAK,CAAC,IAAN,CAAW,SAXsB,CAAnC;AAcA,SAAO,KAAP;AACD,CA3BM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { cardPreviewClassName } from '../CardPreview/index';\nimport type { CardState } from './Card.types';\n\nexport const cardClassName = 'fui-Card';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'block',\n ...shorthands.overflow('hidden'),\n\n color: tokens.colorNeutralForeground1,\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n // Size: medium\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n [`> *:not(.${cardPreviewClassName})`]: {\n // Size: medium\n ...shorthands.margin('12px'),\n },\n },\n\n filledInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n filled: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n },\n filledAlternativeInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Hover,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground2Pressed,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: tokens.shadow4,\n },\n outlineInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n boxShadow: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n boxShadow: 'none',\n },\n subtleInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n boxShadow: 'none',\n },\n});\n\n/**\n * Apply styling to the Card slots based on the state\n */\nexport const useCardStyles_unstable = (state: CardState): CardState => {\n const styles = useStyles();\n\n const interactive =\n state.root.onClick ||\n state.root.onMouseUp ||\n state.root.onMouseDown ||\n state.root.onPointerUp ||\n state.root.onPointerDown ||\n state.root.onTouchStart ||\n state.root.onTouchEnd;\n\n state.root.className = mergeClasses(\n cardClassName,\n styles.root,\n state.appearance === 'filled' && styles.filled,\n state.appearance === 'filled-alternative' && styles.filledAlternative,\n state.appearance === 'outline' && styles.outline,\n state.appearance === 'subtle' && styles.subtle,\n interactive && state.appearance === 'filled' && styles.filledInteractive,\n interactive && state.appearance === 'filled-alternative' && styles.filledAlternativeInteractive,\n interactive && state.appearance === 'outline' && styles.outlineInteractive,\n interactive && state.appearance === 'subtle' && styles.subtleInteractive,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { useCardFooter_unstable } from './useCardFooter';
|
3
|
+
import { renderCardFooter_unstable } from './renderCardFooter';
|
4
|
+
import { useCardFooterStyles_unstable } from './useCardFooterStyles';
|
5
5
|
/**
|
6
6
|
* Component to render Button actions in a Card component.
|
7
7
|
*/
|
8
8
|
|
9
9
|
export const CardFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
-
const state =
|
11
|
-
|
12
|
-
return
|
10
|
+
const state = useCardFooter_unstable(props, ref);
|
11
|
+
useCardFooterStyles_unstable(state);
|
12
|
+
return renderCardFooter_unstable(state);
|
13
13
|
});
|
14
14
|
CardFooter.displayName = 'CardFooter';
|
15
15
|
//# sourceMappingURL=CardFooter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CardFooter/CardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AACA,SAAO,yBAAyB,CAAC,KAAD,CAAhC;AACD,CAL+D,CAAzD;AAOP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { useCardFooter_unstable } from './useCardFooter';\nimport { renderCardFooter_unstable } from './renderCardFooter';\nimport { useCardFooterStyles_unstable } from './useCardFooterStyles';\nimport type { CardFooterProps } from './CardFooter.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Component to render Button actions in a Card component.\n */\nexport const CardFooter: ForwardRefComponent<CardFooterProps> = React.forwardRef((props, ref) => {\n const state = useCardFooter_unstable(props, ref);\n\n useCardFooterStyles_unstable(state);\n return renderCardFooter_unstable(state);\n});\n\nCardFooter.displayName = 'CardFooter';\n"],"sourceRoot":"../src/"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
2
|
export declare type CardFooterSlots = {
|
3
|
-
root:
|
4
|
-
action?:
|
3
|
+
root: Slot<'div'>;
|
4
|
+
action?: Slot<'div'>;
|
5
5
|
};
|
6
6
|
/**
|
7
7
|
* CardFooter props
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CardFooter.types.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"CardFooter.types.js","sourceRoot":"../src/","sources":["components/CardFooter/CardFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CardFooterSlots = {\n root: Slot<'div'>;\n action?: Slot<'div'>;\n};\n\n/**\n * CardFooter props\n */\nexport type CardFooterProps = ComponentProps<CardFooterSlots>;\n\n/**\n * State used in rendering CardFooter\n */\nexport type CardFooterState = ComponentState<CardFooterSlots>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CardFooter/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './CardFooter';\nexport * from './CardFooter.types';\nexport * from './renderCardFooter';\nexport * from './useCardFooter';\nexport * from './useCardFooterStyles';\n"]}
|
@@ -2,4 +2,4 @@ import type { CardFooterState } from './CardFooter.types';
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of CardFooter
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderCardFooter_unstable: (state: CardFooterState) => JSX.Element;
|