@fluentui/react-card 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.swcrc +2 -11
- package/CHANGELOG.json +72 -15
- package/CHANGELOG.md +26 -10
- package/lib/Card.js +1 -1
- package/lib/CardFooter.js +1 -1
- package/lib/CardHeader.js +1 -1
- package/lib/CardPreview.js +1 -1
- package/lib/components/Card/Card.js +6 -6
- package/lib/components/Card/Card.types.js +1 -1
- package/lib/components/Card/CardContext.js +3 -2
- package/lib/components/Card/CardContext.js.map +1 -1
- package/lib/components/Card/index.js +6 -6
- package/lib/components/Card/renderCard.js +3 -3
- package/lib/components/Card/useCard.js +20 -20
- package/lib/components/Card/useCardSelectable.js +10 -10
- package/lib/components/Card/useCardSelectable.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +14 -14
- package/lib/components/CardFooter/CardFooter.js +5 -5
- package/lib/components/CardFooter/index.js +5 -5
- package/lib/components/CardFooter/renderCardFooter.js +2 -2
- package/lib/components/CardFooter/useCardFooter.js +5 -5
- package/lib/components/CardFooter/useCardFooterStyles.js +3 -3
- package/lib/components/CardHeader/CardHeader.js +5 -5
- package/lib/components/CardHeader/index.js +5 -5
- package/lib/components/CardHeader/renderCardHeader.js +2 -2
- package/lib/components/CardHeader/useCardHeader.js +10 -10
- package/lib/components/CardHeader/useCardHeaderStyles.js +7 -7
- package/lib/components/CardPreview/CardPreview.js +5 -5
- package/lib/components/CardPreview/index.js +5 -5
- package/lib/components/CardPreview/renderCardPreview.js +2 -2
- package/lib/components/CardPreview/useCardPreview.js +9 -9
- package/lib/components/CardPreview/useCardPreviewStyles.js +3 -3
- package/lib/index.js +5 -5
- 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 +1 -1
- package/lib-commonjs/components/Card/Card.js.map +1 -1
- package/lib-commonjs/components/Card/Card.types.js.map +1 -1
- package/lib-commonjs/components/Card/CardContext.js +2 -1
- package/lib-commonjs/components/Card/CardContext.js.map +1 -1
- package/lib-commonjs/components/Card/index.js.map +1 -1
- package/lib-commonjs/components/Card/renderCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +22 -22
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardSelectable.js +6 -6
- package/lib-commonjs/components/Card/useCardSelectable.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +17 -17
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js +1 -1
- package/lib-commonjs/components/CardFooter/CardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/index.js.map +1 -1
- package/lib-commonjs/components/CardFooter/renderCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooter.js +3 -3
- package/lib-commonjs/components/CardFooter/useCardFooter.js.map +1 -1
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js +2 -2
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.js.map +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js +1 -1
- package/lib-commonjs/components/CardHeader/CardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/index.js.map +1 -1
- package/lib-commonjs/components/CardHeader/renderCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeader.js +6 -6
- package/lib-commonjs/components/CardHeader/useCardHeader.js.map +1 -1
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js +6 -6
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js +1 -1
- package/lib-commonjs/components/CardPreview/CardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/index.js.map +1 -1
- package/lib-commonjs/components/CardPreview/renderCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreview.js +5 -5
- package/lib-commonjs/components/CardPreview/useCardPreview.js.map +1 -1
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js +2 -2
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -7
package/.swcrc
CHANGED
@@ -1,15 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://json.schemastore.org/swcrc",
|
3
|
-
"env": {
|
4
|
-
"targets": {
|
5
|
-
"chrome": "84",
|
6
|
-
"edge": "84",
|
7
|
-
"firefox": "75",
|
8
|
-
"opera": "73",
|
9
|
-
"safari": "14.1"
|
10
|
-
},
|
11
|
-
"bugfixes": true
|
12
|
-
},
|
13
3
|
"exclude": [
|
14
4
|
"/testing",
|
15
5
|
"/**/*.cy.ts",
|
@@ -32,7 +22,8 @@
|
|
32
22
|
"runtime": "classic",
|
33
23
|
"useSpread": true
|
34
24
|
}
|
35
|
-
}
|
25
|
+
},
|
26
|
+
"target": "es2019"
|
36
27
|
},
|
37
28
|
"minify": false,
|
38
29
|
"sourceMaps": true
|
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-card",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-card_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Wed, 22 Mar 2023 04:46:40 GMT",
|
6
|
+
"tag": "@fluentui/react-card_v0.0.0-nightly-20230322-0439.1",
|
7
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,38 +16,95 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-card",
|
19
|
-
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230322-0439.1",
|
20
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-card",
|
25
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1",
|
26
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-card",
|
31
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1",
|
32
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
33
33
|
},
|
34
34
|
{
|
35
35
|
"author": "beachball",
|
36
36
|
"package": "@fluentui/react-card",
|
37
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
38
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1",
|
38
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
39
39
|
},
|
40
40
|
{
|
41
41
|
"author": "beachball",
|
42
42
|
"package": "@fluentui/react-card",
|
43
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
44
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1",
|
44
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
45
45
|
},
|
46
46
|
{
|
47
47
|
"author": "beachball",
|
48
48
|
"package": "@fluentui/react-card",
|
49
|
-
"comment": "Bump @fluentui/react-button to v0.0.0-nightly-
|
50
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/react-button to v0.0.0-nightly-20230322-0439.1",
|
50
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"date": "Tue, 21 Mar 2023 21:23:26 GMT",
|
57
|
+
"tag": "@fluentui/react-card_v9.0.3",
|
58
|
+
"version": "9.0.3",
|
59
|
+
"comments": {
|
60
|
+
"patch": [
|
61
|
+
{
|
62
|
+
"author": "tristan.watanabe@gmail.com",
|
63
|
+
"package": "@fluentui/react-card",
|
64
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
65
|
+
"comment": "chore: migrate to swc transpilation approach."
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"author": "tristan.watanabe@gmail.com",
|
69
|
+
"package": "@fluentui/react-card",
|
70
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
71
|
+
"comment": "fix: add node field to package.json exports map."
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "beachball",
|
75
|
+
"package": "@fluentui/react-card",
|
76
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.2",
|
77
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"author": "beachball",
|
81
|
+
"package": "@fluentui/react-card",
|
82
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
83
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"author": "beachball",
|
87
|
+
"package": "@fluentui/react-card",
|
88
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
89
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"author": "beachball",
|
93
|
+
"package": "@fluentui/react-card",
|
94
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
95
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"author": "beachball",
|
99
|
+
"package": "@fluentui/react-card",
|
100
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
101
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"author": "beachball",
|
105
|
+
"package": "@fluentui/react-card",
|
106
|
+
"comment": "Bump @fluentui/react-button to v9.3.5",
|
107
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
51
108
|
}
|
52
109
|
]
|
53
110
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,23 +1,39 @@
|
|
1
1
|
# Change Log - @fluentui/react-card
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 22 Mar 2023 04:46:40 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20230322-0439.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-card_v0.0.0-nightly-20230322-0439.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-card_v9.0.
|
9
|
+
Wed, 22 Mar 2023 04:46:40 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-card_v9.0.3..@fluentui/react-card_v0.0.0-nightly-20230322-0439.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
18
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
19
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
20
|
-
- Bump @fluentui/react-button to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
16
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
20
|
+
- Bump @fluentui/react-button to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
21
|
+
|
22
|
+
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-card_v9.0.3)
|
23
|
+
|
24
|
+
Tue, 21 Mar 2023 21:23:26 GMT
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-card_v9.0.2..@fluentui/react-card_v9.0.3)
|
26
|
+
|
27
|
+
### Patches
|
28
|
+
|
29
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
30
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
31
|
+
- Bump @fluentui/keyboard-keys to v9.0.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
32
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
33
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
34
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
35
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
36
|
+
- Bump @fluentui/react-button to v9.3.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
21
37
|
|
22
38
|
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-card_v9.0.2)
|
23
39
|
|
package/lib/Card.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/Card/index';
|
2
2
|
//# sourceMappingURL=Card.js.map
|
package/lib/CardFooter.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/CardFooter/index';
|
2
2
|
//# sourceMappingURL=CardFooter.js.map
|
package/lib/CardHeader.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/CardHeader/index';
|
2
2
|
//# sourceMappingURL=CardHeader.js.map
|
package/lib/CardPreview.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/CardPreview/index';
|
2
2
|
//# sourceMappingURL=CardPreview.js.map
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCard_unstable } from
|
3
|
-
import { renderCard_unstable } from
|
4
|
-
import { useCardStyles_unstable } from
|
5
|
-
import { useCardContextValue } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useCard_unstable } from './useCard';
|
3
|
+
import { renderCard_unstable } from './renderCard';
|
4
|
+
import { useCardStyles_unstable } from './useCardStyles';
|
5
|
+
import { useCardContextValue } from './useCardContextValue';
|
6
6
|
/**
|
7
7
|
* A card provides scaffolding for hosting actions and content for a single topic.
|
8
8
|
*/
|
@@ -12,5 +12,5 @@ export const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
12
|
useCardStyles_unstable(state);
|
13
13
|
return renderCard_unstable(state, cardContextValue);
|
14
14
|
});
|
15
|
-
Card.displayName =
|
15
|
+
Card.displayName = 'Card';
|
16
16
|
//# sourceMappingURL=Card.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import * as React from
|
1
|
+
import * as React from 'react';
|
2
2
|
//# sourceMappingURL=Card.types.js.map
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as React from
|
1
|
+
import * as React from 'react';
|
2
2
|
const cardContext = /*#__PURE__*/React.createContext(undefined);
|
3
3
|
/**
|
4
4
|
* @internal
|
@@ -17,8 +17,9 @@ export const cardContextDefaultValue = {
|
|
17
17
|
* @internal
|
18
18
|
*/
|
19
19
|
export const CardProvider = cardContext.Provider;
|
20
|
+
var _React_useContext;
|
20
21
|
/**
|
21
22
|
* @internal
|
22
23
|
*/
|
23
|
-
export const useCardContext_unstable = () => React.useContext(cardContext)
|
24
|
+
export const useCardContext_unstable = () => (_React_useContext = React.useContext(cardContext)) !== null && _React_useContext !== void 0 ? _React_useContext : cardContextDefaultValue;
|
24
25
|
//# sourceMappingURL=CardContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","cardContext","createContext","undefined","cardContextDefaultValue","selectableA11yProps","referenceId","setReferenceId","referenceLabel","setReferenceLabel","CardProvider","Provider","useCardContext_unstable","useContext"],"sources":["../../../src/components/Card/CardContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { CardContextValue } from './Card.types';\n\nconst cardContext = React.createContext<CardContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport const cardContextDefaultValue: CardContextValue = {\n selectableA11yProps: {\n referenceId: undefined,\n setReferenceId() {\n /* Noop */\n },\n referenceLabel: undefined,\n setReferenceLabel() {\n /* Noop */\n },\n },\n};\n\n/**\n * @internal\n */\nexport const CardProvider = cardContext.Provider;\n\n/**\n * @internal\n */\nexport const useCardContext_unstable = () => React.useContext(cardContext) ?? cardContextDefaultValue;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,MAAMC,WAAA,gBAAcD,KAAA,CAAME,aAAa,CAA+BC,SAAA;AAEtE;;;AAGA,OAAO,MAAMC,uBAAA,GAA4C;EACvDC,mBAAA,EAAqB;IACnBC,WAAA,EAAaH,SAAA;IACbI,eAAA,EAAiB;MACf,WACF;IACAC,cAAA,EAAgBL,SAAA;IAChBM,kBAAA,EAAoB;MAClB;EAEJ;AACF;AAEA;;;AAGA,OAAO,MAAMC,YAAA,GAAeT,WAAA,CAAYU,QAAQ;
|
1
|
+
{"version":3,"names":["React","cardContext","createContext","undefined","cardContextDefaultValue","selectableA11yProps","referenceId","setReferenceId","referenceLabel","setReferenceLabel","CardProvider","Provider","_React_useContext","useCardContext_unstable","useContext"],"sources":["../../../src/components/Card/CardContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { CardContextValue } from './Card.types';\n\nconst cardContext = React.createContext<CardContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport const cardContextDefaultValue: CardContextValue = {\n selectableA11yProps: {\n referenceId: undefined,\n setReferenceId() {\n /* Noop */\n },\n referenceLabel: undefined,\n setReferenceLabel() {\n /* Noop */\n },\n },\n};\n\n/**\n * @internal\n */\nexport const CardProvider = cardContext.Provider;\n\n/**\n * @internal\n */\nexport const useCardContext_unstable = () => React.useContext(cardContext) ?? cardContextDefaultValue;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,MAAMC,WAAA,gBAAcD,KAAA,CAAME,aAAa,CAA+BC,SAAA;AAEtE;;;AAGA,OAAO,MAAMC,uBAAA,GAA4C;EACvDC,mBAAA,EAAqB;IACnBC,WAAA,EAAaH,SAAA;IACbI,eAAA,EAAiB;MACf,WACF;IACAC,cAAA,EAAgBL,SAAA;IAChBM,kBAAA,EAAoB;MAClB;EAEJ;AACF;AAEA;;;AAGA,OAAO,MAAMC,YAAA,GAAeT,WAAA,CAAYU,QAAQ;IAKHC,iBAAA;AAH7C;;;AAGA,OAAO,MAAMC,uBAAA,GAA0BA,CAAA,KAAM,CAAAD,iBAAA,GAAAZ,KAAA,CAAMc,UAAU,CAACb,WAAA,eAAjBW,iBAAA,cAAAA,iBAAA,GAAiCR,uBAAuB"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
1
|
+
export * from './Card';
|
2
|
+
export * from './Card.types';
|
3
|
+
export * from './CardContext';
|
4
|
+
export * from './renderCard';
|
5
|
+
export * from './useCard';
|
6
|
+
export * from './useCardStyles';
|
7
7
|
//# sourceMappingURL=index.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
3
|
-
import { CardProvider } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
|
+
import { CardProvider } from './CardContext';
|
4
4
|
/**
|
5
5
|
* Render the final JSX of Card.
|
6
6
|
*/
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getNativeElementProps, useMergedRefs } from
|
3
|
-
import { useFocusableGroup, useFocusWithin } from
|
4
|
-
import { useCardSelectable } from
|
5
|
-
import { cardContextDefaultValue } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
|
3
|
+
import { useFocusableGroup, useFocusWithin } from '@fluentui/react-tabster';
|
4
|
+
import { useCardSelectable } from './useCardSelectable';
|
5
|
+
import { cardContextDefaultValue } from './CardContext';
|
6
6
|
const focusMap = {
|
7
7
|
off: undefined,
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
'no-tab': 'limited-trap-focus',
|
9
|
+
'tab-exit': 'limited',
|
10
|
+
'tab-only': 'unlimited'
|
11
11
|
};
|
12
12
|
/**
|
13
13
|
* Create the state for interactive cards.
|
@@ -18,12 +18,12 @@ const focusMap = {
|
|
18
18
|
* @param props - props from this instance of Card
|
19
19
|
*/
|
20
20
|
const useCardInteractive = ({
|
21
|
-
focusMode =
|
21
|
+
focusMode = 'off',
|
22
22
|
...props
|
23
23
|
}) => {
|
24
|
-
const interactive = [
|
24
|
+
const interactive = ['onClick', 'onDoubleClick', 'onMouseUp', 'onMouseDown', 'onPointerUp', 'onPointerDown', 'onTouchStart', 'onTouchEnd', 'onDragStart', 'onDragEnd'].some(prop => props[prop]);
|
25
25
|
const groupperAttrs = useFocusableGroup({
|
26
|
-
tabBehavior: focusMap[interactive ?
|
26
|
+
tabBehavior: focusMap[interactive ? 'no-tab' : focusMode]
|
27
27
|
});
|
28
28
|
const interactiveFocusAttributes = {
|
29
29
|
...groupperAttrs,
|
@@ -31,7 +31,7 @@ const useCardInteractive = ({
|
|
31
31
|
};
|
32
32
|
return {
|
33
33
|
interactive,
|
34
|
-
focusAttributes: focusMode ===
|
34
|
+
focusAttributes: focusMode === 'off' ? null : interactiveFocusAttributes
|
35
35
|
};
|
36
36
|
};
|
37
37
|
/**
|
@@ -45,9 +45,9 @@ const useCardInteractive = ({
|
|
45
45
|
*/
|
46
46
|
export const useCard_unstable = (props, ref) => {
|
47
47
|
const {
|
48
|
-
appearance =
|
49
|
-
orientation =
|
50
|
-
size =
|
48
|
+
appearance = 'filled',
|
49
|
+
orientation = 'vertical',
|
50
|
+
size = 'medium'
|
51
51
|
} = props;
|
52
52
|
const [referenceId, setReferenceId] = React.useState(cardContextDefaultValue.selectableA11yProps.referenceId);
|
53
53
|
const [referenceLabel, setReferenceLabel] = React.useState(cardContextDefaultValue.selectableA11yProps.referenceId);
|
@@ -83,13 +83,13 @@ export const useCard_unstable = (props, ref) => {
|
|
83
83
|
setReferenceLabel
|
84
84
|
},
|
85
85
|
components: {
|
86
|
-
root:
|
87
|
-
floatingAction:
|
88
|
-
checkbox:
|
86
|
+
root: 'div',
|
87
|
+
floatingAction: 'div',
|
88
|
+
checkbox: 'input'
|
89
89
|
},
|
90
|
-
root: getNativeElementProps(
|
90
|
+
root: getNativeElementProps('div', {
|
91
91
|
ref: cardRef,
|
92
|
-
role:
|
92
|
+
role: 'group',
|
93
93
|
...focusAttributes,
|
94
94
|
...props,
|
95
95
|
...selectableCardProps
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { mergeCallbacks, resolveShorthand } from
|
3
|
-
import { Enter } from
|
4
|
-
import { useFocusFinders } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
import { Enter } from '@fluentui/keyboard-keys';
|
4
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
5
5
|
/**
|
6
6
|
* @internal
|
7
7
|
*
|
@@ -31,7 +31,7 @@ export const useCardSelectable = (props, {
|
|
31
31
|
findAllFocusable
|
32
32
|
} = useFocusFinders();
|
33
33
|
const checkboxRef = React.useRef(null);
|
34
|
-
const isSelectable = [selected, defaultSelected, onSelectionChange].some(prop => typeof prop !==
|
34
|
+
const isSelectable = [selected, defaultSelected, onSelectionChange].some(prop => typeof prop !== 'undefined');
|
35
35
|
const [isCardSelected, setIsCardSelected] = React.useState(false);
|
36
36
|
const [isSelectFocused, setIsSelectFocused] = React.useState(false);
|
37
37
|
const shouldRestrictTriggerAction = React.useCallback(event => {
|
@@ -41,7 +41,7 @@ export const useCardSelectable = (props, {
|
|
41
41
|
const focusableElements = findAllFocusable(cardRef.current);
|
42
42
|
const target = event.target;
|
43
43
|
const isElementInFocusableGroup = focusableElements.some(element => element.contains(target));
|
44
|
-
const isCheckboxSlot = checkboxRef
|
44
|
+
const isCheckboxSlot = (checkboxRef === null || checkboxRef === void 0 ? void 0 : checkboxRef.current) === target;
|
45
45
|
return isElementInFocusableGroup && !isCheckboxSlot;
|
46
46
|
}, [cardRef, findAllFocusable]);
|
47
47
|
const onChangeHandler = React.useCallback(event => {
|
@@ -68,14 +68,14 @@ export const useCardSelectable = (props, {
|
|
68
68
|
}
|
69
69
|
const selectableCheckboxProps = {};
|
70
70
|
if (referenceId) {
|
71
|
-
selectableCheckboxProps[
|
71
|
+
selectableCheckboxProps['aria-labelledby'] = referenceId;
|
72
72
|
} else if (referenceLabel) {
|
73
|
-
selectableCheckboxProps[
|
73
|
+
selectableCheckboxProps['aria-label'] = referenceLabel;
|
74
74
|
}
|
75
75
|
return resolveShorthand(checkbox, {
|
76
76
|
defaultProps: {
|
77
77
|
ref: checkboxRef,
|
78
|
-
type:
|
78
|
+
type: 'checkbox',
|
79
79
|
checked: isCardSelected,
|
80
80
|
onChange: event => onChangeHandler(event),
|
81
81
|
onFocus: () => setIsSelectFocused(true),
|
@@ -103,7 +103,7 @@ export const useCardSelectable = (props, {
|
|
103
103
|
onKeyDown: mergeCallbacks(onKeyDown, onKeyDownHandler)
|
104
104
|
};
|
105
105
|
}, [isSelectable, onChangeHandler, onClick, onKeyDown, onKeyDownHandler]);
|
106
|
-
React.useEffect(() => setIsCardSelected(Boolean(defaultSelected
|
106
|
+
React.useEffect(() => setIsCardSelected(Boolean(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : selected)), [defaultSelected, selected, setIsCardSelected]);
|
107
107
|
return {
|
108
108
|
selected: isCardSelected,
|
109
109
|
selectable: isSelectable,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","mergeCallbacks","resolveShorthand","Enter","useFocusFinders","useCardSelectable","props","referenceLabel","referenceId","cardRef","checkbox","selected","defaultSelected","onSelectionChange","floatingAction","onClick","onKeyDown","findAllFocusable","checkboxRef","useRef","isSelectable","some","prop","isCardSelected","setIsCardSelected","useState","isSelectFocused","setIsSelectFocused","shouldRestrictTriggerAction","useCallback","event","current","focusableElements","target","isElementInFocusableGroup","element","contains","isCheckboxSlot","onChangeHandler","newCheckedValue","onKeyDownHandler","includes","key","preventDefault","checkboxSlot","useMemo","selectableCheckboxProps","defaultProps","ref","type","checked","onChange","onFocus","onBlur","floatingActionSlot","selectableCardProps","useEffect","Boolean","selectable","selectFocused"],"sources":["../../../src/components/Card/useCardSelectable.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { useFocusFinders } from '@fluentui/react-tabster';\n\nimport type { CardContextValue, CardOnSelectionChangeEvent, CardProps, CardSlots } from './Card.types';\n\n/**\n * @internal\n *\n * Create the state related to selectable cards.\n *\n * This internal hook controls all the logic for selectable cards and is\n * intended to be used alongside with useCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param a11yProps - accessibility props shared between elements of the card\n * @param ref - reference to the root element of Card\n */\nexport const useCardSelectable = (\n props: CardProps,\n { referenceLabel, referenceId }: Pick<CardContextValue['selectableA11yProps'], 'referenceId' | 'referenceLabel'>,\n cardRef: React.RefObject<HTMLDivElement>,\n) => {\n const { checkbox = {}, selected, defaultSelected, onSelectionChange, floatingAction, onClick, onKeyDown } = props;\n\n const { findAllFocusable } = useFocusFinders();\n\n const checkboxRef = React.useRef<HTMLInputElement>(null);\n\n const isSelectable = [selected, defaultSelected, onSelectionChange].some(prop => typeof prop !== 'undefined');\n\n const [isCardSelected, setIsCardSelected] = React.useState(false);\n const [isSelectFocused, setIsSelectFocused] = React.useState(false);\n\n const shouldRestrictTriggerAction = React.useCallback(\n (event: CardOnSelectionChangeEvent) => {\n if (!cardRef.current) {\n return false;\n }\n\n const focusableElements = findAllFocusable(cardRef.current);\n const target = event.target as HTMLElement;\n const isElementInFocusableGroup = focusableElements.some(element => element.contains(target));\n const isCheckboxSlot = checkboxRef?.current === target;\n\n return isElementInFocusableGroup && !isCheckboxSlot;\n },\n [cardRef, findAllFocusable],\n );\n\n const onChangeHandler = React.useCallback(\n (event: CardOnSelectionChangeEvent) => {\n if (shouldRestrictTriggerAction(event)) {\n return;\n }\n\n const newCheckedValue = !isCardSelected;\n\n setIsCardSelected(newCheckedValue);\n\n if (onSelectionChange) {\n onSelectionChange(event, { selected: newCheckedValue });\n }\n },\n [onSelectionChange, isCardSelected, shouldRestrictTriggerAction],\n );\n\n const onKeyDownHandler = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if ([Enter].includes(event.key)) {\n event.preventDefault();\n onChangeHandler(event);\n }\n },\n [onChangeHandler],\n );\n\n const checkboxSlot = React.useMemo(() => {\n if (!isSelectable || floatingAction) {\n return;\n }\n\n const selectableCheckboxProps: CardSlots['checkbox'] = {};\n\n if (referenceId) {\n selectableCheckboxProps['aria-labelledby'] = referenceId;\n } else if (referenceLabel) {\n selectableCheckboxProps['aria-label'] = referenceLabel;\n }\n\n return resolveShorthand(checkbox, {\n defaultProps: {\n ref: checkboxRef,\n type: 'checkbox',\n checked: isCardSelected,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => onChangeHandler(event),\n onFocus: () => setIsSelectFocused(true),\n onBlur: () => setIsSelectFocused(false),\n ...selectableCheckboxProps,\n },\n });\n }, [checkbox, floatingAction, isCardSelected, isSelectable, onChangeHandler, referenceId, referenceLabel]);\n\n const floatingActionSlot = React.useMemo(() => {\n if (!floatingAction) {\n return;\n }\n\n return resolveShorthand(floatingAction, {\n defaultProps: {\n ref: checkboxRef,\n },\n });\n }, [floatingAction]);\n\n const selectableCardProps = React.useMemo(() => {\n if (!isSelectable) {\n return null;\n }\n\n return {\n onClick: mergeCallbacks(onClick, onChangeHandler),\n onKeyDown: mergeCallbacks(onKeyDown, onKeyDownHandler),\n };\n }, [isSelectable, onChangeHandler, onClick, onKeyDown, onKeyDownHandler]);\n\n React.useEffect(\n () => setIsCardSelected(Boolean(defaultSelected ?? selected)),\n [defaultSelected, selected, setIsCardSelected],\n );\n\n return {\n selected: isCardSelected,\n selectable: isSelectable,\n selectFocused: isSelectFocused,\n selectableCardProps,\n checkboxSlot,\n floatingActionSlot,\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,cAAc,EAAEC,gBAAgB,QAAQ;AACjD,SAASC,KAAK,QAAQ;AACtB,SAASC,eAAe,QAAQ;AAIhC;;;;;;;;;;;;AAYA,OAAO,MAAMC,iBAAA,GAAoBA,CAC/BC,KAAA,EACA;EAAEC,cAAA;EAAgBC;AAAW,CAAmF,EAChHC,OAAA,KACG;EACH,MAAM;IAAEC,QAAA,GAAW,CAAC;IAAGC,QAAA;IAAUC,eAAA;IAAiBC,iBAAA;IAAmBC,cAAA;IAAgBC,OAAA;IAASC;EAAS,CAAE,GAAGV,KAAA;EAE5G,MAAM;IAAEW;EAAgB,CAAE,GAAGb,eAAA;EAE7B,MAAMc,WAAA,GAAclB,KAAA,CAAMmB,MAAM,CAAmB,IAAI;EAEvD,MAAMC,YAAA,GAAe,CAACT,QAAA,EAAUC,eAAA,EAAiBC,iBAAA,CAAkB,CAACQ,IAAI,CAACC,IAAA,IAAQ,OAAOA,IAAA,KAAS;EAEjG,MAAM,CAACC,cAAA,EAAgBC,iBAAA,CAAkB,GAAGxB,KAAA,CAAMyB,QAAQ,CAAC,KAAK;EAChE,MAAM,CAACC,eAAA,EAAiBC,kBAAA,CAAmB,GAAG3B,KAAA,CAAMyB,QAAQ,CAAC,KAAK;EAElE,MAAMG,2BAAA,GAA8B5B,KAAA,CAAM6B,WAAW,CAClDC,KAAA,IAAsC;IACrC,IAAI,CAACrB,OAAA,CAAQsB,OAAO,EAAE;MACpB,OAAO,KAAK;IACd;IAEA,MAAMC,iBAAA,GAAoBf,gBAAA,CAAiBR,OAAA,CAAQsB,OAAO;IAC1D,MAAME,MAAA,GAASH,KAAA,CAAMG,MAAM;IAC3B,MAAMC,yBAAA,GAA4BF,iBAAA,CAAkBX,IAAI,CAACc,OAAA,IAAWA,OAAA,CAAQC,QAAQ,CAACH,MAAA;IACrF,MAAMI,cAAA,
|
1
|
+
{"version":3,"names":["React","mergeCallbacks","resolveShorthand","Enter","useFocusFinders","useCardSelectable","props","referenceLabel","referenceId","cardRef","checkbox","selected","defaultSelected","onSelectionChange","floatingAction","onClick","onKeyDown","findAllFocusable","checkboxRef","useRef","isSelectable","some","prop","isCardSelected","setIsCardSelected","useState","isSelectFocused","setIsSelectFocused","shouldRestrictTriggerAction","useCallback","event","current","focusableElements","target","isElementInFocusableGroup","element","contains","isCheckboxSlot","onChangeHandler","newCheckedValue","onKeyDownHandler","includes","key","preventDefault","checkboxSlot","useMemo","selectableCheckboxProps","defaultProps","ref","type","checked","onChange","onFocus","onBlur","floatingActionSlot","selectableCardProps","useEffect","Boolean","selectable","selectFocused"],"sources":["../../../src/components/Card/useCardSelectable.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { useFocusFinders } from '@fluentui/react-tabster';\n\nimport type { CardContextValue, CardOnSelectionChangeEvent, CardProps, CardSlots } from './Card.types';\n\n/**\n * @internal\n *\n * Create the state related to selectable cards.\n *\n * This internal hook controls all the logic for selectable cards and is\n * intended to be used alongside with useCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param a11yProps - accessibility props shared between elements of the card\n * @param ref - reference to the root element of Card\n */\nexport const useCardSelectable = (\n props: CardProps,\n { referenceLabel, referenceId }: Pick<CardContextValue['selectableA11yProps'], 'referenceId' | 'referenceLabel'>,\n cardRef: React.RefObject<HTMLDivElement>,\n) => {\n const { checkbox = {}, selected, defaultSelected, onSelectionChange, floatingAction, onClick, onKeyDown } = props;\n\n const { findAllFocusable } = useFocusFinders();\n\n const checkboxRef = React.useRef<HTMLInputElement>(null);\n\n const isSelectable = [selected, defaultSelected, onSelectionChange].some(prop => typeof prop !== 'undefined');\n\n const [isCardSelected, setIsCardSelected] = React.useState(false);\n const [isSelectFocused, setIsSelectFocused] = React.useState(false);\n\n const shouldRestrictTriggerAction = React.useCallback(\n (event: CardOnSelectionChangeEvent) => {\n if (!cardRef.current) {\n return false;\n }\n\n const focusableElements = findAllFocusable(cardRef.current);\n const target = event.target as HTMLElement;\n const isElementInFocusableGroup = focusableElements.some(element => element.contains(target));\n const isCheckboxSlot = checkboxRef?.current === target;\n\n return isElementInFocusableGroup && !isCheckboxSlot;\n },\n [cardRef, findAllFocusable],\n );\n\n const onChangeHandler = React.useCallback(\n (event: CardOnSelectionChangeEvent) => {\n if (shouldRestrictTriggerAction(event)) {\n return;\n }\n\n const newCheckedValue = !isCardSelected;\n\n setIsCardSelected(newCheckedValue);\n\n if (onSelectionChange) {\n onSelectionChange(event, { selected: newCheckedValue });\n }\n },\n [onSelectionChange, isCardSelected, shouldRestrictTriggerAction],\n );\n\n const onKeyDownHandler = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if ([Enter].includes(event.key)) {\n event.preventDefault();\n onChangeHandler(event);\n }\n },\n [onChangeHandler],\n );\n\n const checkboxSlot = React.useMemo(() => {\n if (!isSelectable || floatingAction) {\n return;\n }\n\n const selectableCheckboxProps: CardSlots['checkbox'] = {};\n\n if (referenceId) {\n selectableCheckboxProps['aria-labelledby'] = referenceId;\n } else if (referenceLabel) {\n selectableCheckboxProps['aria-label'] = referenceLabel;\n }\n\n return resolveShorthand(checkbox, {\n defaultProps: {\n ref: checkboxRef,\n type: 'checkbox',\n checked: isCardSelected,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => onChangeHandler(event),\n onFocus: () => setIsSelectFocused(true),\n onBlur: () => setIsSelectFocused(false),\n ...selectableCheckboxProps,\n },\n });\n }, [checkbox, floatingAction, isCardSelected, isSelectable, onChangeHandler, referenceId, referenceLabel]);\n\n const floatingActionSlot = React.useMemo(() => {\n if (!floatingAction) {\n return;\n }\n\n return resolveShorthand(floatingAction, {\n defaultProps: {\n ref: checkboxRef,\n },\n });\n }, [floatingAction]);\n\n const selectableCardProps = React.useMemo(() => {\n if (!isSelectable) {\n return null;\n }\n\n return {\n onClick: mergeCallbacks(onClick, onChangeHandler),\n onKeyDown: mergeCallbacks(onKeyDown, onKeyDownHandler),\n };\n }, [isSelectable, onChangeHandler, onClick, onKeyDown, onKeyDownHandler]);\n\n React.useEffect(\n () => setIsCardSelected(Boolean(defaultSelected ?? selected)),\n [defaultSelected, selected, setIsCardSelected],\n );\n\n return {\n selected: isCardSelected,\n selectable: isSelectable,\n selectFocused: isSelectFocused,\n selectableCardProps,\n checkboxSlot,\n floatingActionSlot,\n };\n};\n"],"mappings":"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"}
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import { shorthands, __styles, mergeClasses } from
|
2
|
-
import { tokens } from
|
3
|
-
import { createFocusOutlineStyle } from
|
4
|
-
import { cardPreviewClassNames } from
|
5
|
-
import { cardHeaderClassNames } from
|
6
|
-
import { cardFooterClassNames } from
|
1
|
+
import { shorthands, __styles, mergeClasses } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
3
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
4
|
+
import { cardPreviewClassNames } from '../CardPreview/useCardPreviewStyles';
|
5
|
+
import { cardHeaderClassNames } from '../CardHeader/useCardHeaderStyles';
|
6
|
+
import { cardFooterClassNames } from '../CardFooter/useCardFooterStyles';
|
7
7
|
/**
|
8
8
|
* Static CSS class names used internally for the component slots.
|
9
9
|
*/
|
10
10
|
export const cardClassNames = {
|
11
|
-
root:
|
12
|
-
floatingAction:
|
13
|
-
checkbox:
|
11
|
+
root: 'fui-Card',
|
12
|
+
floatingAction: 'fui-Card__floatingAction',
|
13
|
+
checkbox: 'fui-Card__checkbox'
|
14
14
|
};
|
15
15
|
/**
|
16
16
|
* CSS variable names used internally for uniform styling in Card.
|
17
17
|
*/
|
18
18
|
export const cardCSSVars = {
|
19
|
-
cardSizeVar:
|
20
|
-
cardBorderRadiusVar:
|
19
|
+
cardSizeVar: '--fui-Card--size',
|
20
|
+
cardBorderRadiusVar: '--fui-Card--border-radius'
|
21
21
|
};
|
22
22
|
const focusOutlineStyle = {
|
23
23
|
outlineRadius: `var(${cardCSSVars.cardBorderRadiusVar})`,
|
@@ -311,19 +311,19 @@ export const useCardStyles_unstable = state => {
|
|
311
311
|
};
|
312
312
|
const appearanceMap = {
|
313
313
|
filled: styles.filled,
|
314
|
-
|
314
|
+
'filled-alternative': styles.filledAlternative,
|
315
315
|
outline: styles.outline,
|
316
316
|
subtle: styles.subtle
|
317
317
|
};
|
318
318
|
const selectedMap = {
|
319
319
|
filled: styles.filledInteractiveSelected,
|
320
|
-
|
320
|
+
'filled-alternative': styles.filledAlternativeInteractiveSelected,
|
321
321
|
outline: styles.outlineInteractiveSelected,
|
322
322
|
subtle: styles.subtleInteractiveSelected
|
323
323
|
};
|
324
324
|
const interactiveMap = {
|
325
325
|
filled: styles.filledInteractive,
|
326
|
-
|
326
|
+
'filled-alternative': styles.filledAlternativeInteractive,
|
327
327
|
outline: styles.outlineInteractive,
|
328
328
|
subtle: styles.subtleInteractive
|
329
329
|
};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useCardFooter_unstable } from
|
3
|
-
import { renderCardFooter_unstable } from
|
4
|
-
import { useCardFooterStyles_unstable } from
|
1
|
+
import * as React from 'react';
|
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
|
*/
|
@@ -10,5 +10,5 @@ export const CardFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
useCardFooterStyles_unstable(state);
|
11
11
|
return renderCardFooter_unstable(state);
|
12
12
|
});
|
13
|
-
CardFooter.displayName =
|
13
|
+
CardFooter.displayName = 'CardFooter';
|
14
14
|
//# sourceMappingURL=CardFooter.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
1
|
+
export * from './CardFooter';
|
2
|
+
export * from './CardFooter.types';
|
3
|
+
export * from './renderCardFooter';
|
4
|
+
export * from './useCardFooter';
|
5
|
+
export * from './useCardFooterStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getNativeElementProps, resolveShorthand } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Create the state required to render CardFooter.
|
5
5
|
*
|
@@ -15,10 +15,10 @@ export const useCardFooter_unstable = (props, ref) => {
|
|
15
15
|
} = props;
|
16
16
|
return {
|
17
17
|
components: {
|
18
|
-
root:
|
19
|
-
action:
|
18
|
+
root: 'div',
|
19
|
+
action: 'div'
|
20
20
|
},
|
21
|
-
root: getNativeElementProps(
|
21
|
+
root: getNativeElementProps('div', {
|
22
22
|
ref,
|
23
23
|
...props
|
24
24
|
}),
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { __styles, mergeClasses, shorthands } from
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
2
2
|
/**
|
3
3
|
* Static CSS class names used internally for the component slots.
|
4
4
|
*/
|
5
5
|
export const cardFooterClassNames = {
|
6
|
-
root:
|
7
|
-
action:
|
6
|
+
root: 'fui-CardFooter',
|
7
|
+
action: 'fui-CardFooter__action'
|
8
8
|
};
|
9
9
|
const useStyles = /*#__PURE__*/__styles({
|
10
10
|
root: {
|