@fluentui/react-card 9.0.0-beta.12 → 9.0.0-beta.15
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 +180 -1
- package/CHANGELOG.md +88 -40
- package/Spec.md +20 -16
- package/dist/{react-card.d.ts → index.d.ts} +25 -6
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Card/Card.types.js.map +1 -1
- package/lib/components/Card/useCard.js +16 -5
- package/lib/components/Card/useCard.js.map +1 -1
- package/lib/components/Card/useCardStyles.js +80 -74
- package/lib/components/Card/useCardStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Card/useCard.js +16 -5
- package/lib-commonjs/components/Card/useCard.js.map +1 -1
- package/lib-commonjs/components/Card/useCardStyles.js +80 -74
- package/lib-commonjs/components/Card/useCardStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -11
- package/lib/Card.d.ts +0 -1
- package/lib/CardFooter.d.ts +0 -1
- package/lib/CardHeader.d.ts +0 -1
- package/lib/CardPreview.d.ts +0 -1
- package/lib/components/Card/Card.d.ts +0 -6
- package/lib/components/Card/Card.types.d.ts +0 -15
- package/lib/components/Card/index.d.ts +0 -5
- package/lib/components/Card/renderCard.d.ts +0 -5
- package/lib/components/Card/useCard.d.ts +0 -12
- package/lib/components/Card/useCardStyles.d.ts +0 -11
- package/lib/components/CardFooter/CardFooter.d.ts +0 -6
- package/lib/components/CardFooter/CardFooter.types.d.ts +0 -13
- package/lib/components/CardFooter/index.d.ts +0 -5
- package/lib/components/CardFooter/renderCardFooter.d.ts +0 -5
- package/lib/components/CardFooter/useCardFooter.d.ts +0 -12
- package/lib/components/CardFooter/useCardFooterStyles.d.ts +0 -11
- package/lib/components/CardHeader/CardHeader.d.ts +0 -6
- package/lib/components/CardHeader/CardHeader.types.d.ts +0 -17
- package/lib/components/CardHeader/index.d.ts +0 -5
- package/lib/components/CardHeader/renderCardHeader.d.ts +0 -5
- package/lib/components/CardHeader/useCardHeader.d.ts +0 -12
- package/lib/components/CardHeader/useCardHeaderStyles.d.ts +0 -11
- package/lib/components/CardPreview/CardPreview.d.ts +0 -6
- package/lib/components/CardPreview/CardPreview.types.d.ts +0 -13
- package/lib/components/CardPreview/index.d.ts +0 -5
- package/lib/components/CardPreview/renderCardPreview.d.ts +0 -5
- package/lib/components/CardPreview/useCardPreview.d.ts +0 -12
- package/lib/components/CardPreview/useCardPreviewStyles.d.ts +0 -11
- package/lib/index.d.ts +0 -8
- package/lib-commonjs/Card.d.ts +0 -1
- package/lib-commonjs/CardFooter.d.ts +0 -1
- package/lib-commonjs/CardHeader.d.ts +0 -1
- package/lib-commonjs/CardPreview.d.ts +0 -1
- package/lib-commonjs/components/Card/Card.d.ts +0 -6
- package/lib-commonjs/components/Card/Card.types.d.ts +0 -15
- package/lib-commonjs/components/Card/index.d.ts +0 -5
- package/lib-commonjs/components/Card/renderCard.d.ts +0 -5
- package/lib-commonjs/components/Card/useCard.d.ts +0 -12
- package/lib-commonjs/components/Card/useCardStyles.d.ts +0 -11
- package/lib-commonjs/components/CardFooter/CardFooter.d.ts +0 -6
- package/lib-commonjs/components/CardFooter/CardFooter.types.d.ts +0 -13
- package/lib-commonjs/components/CardFooter/index.d.ts +0 -5
- package/lib-commonjs/components/CardFooter/renderCardFooter.d.ts +0 -5
- package/lib-commonjs/components/CardFooter/useCardFooter.d.ts +0 -12
- package/lib-commonjs/components/CardFooter/useCardFooterStyles.d.ts +0 -11
- package/lib-commonjs/components/CardHeader/CardHeader.d.ts +0 -6
- package/lib-commonjs/components/CardHeader/CardHeader.types.d.ts +0 -17
- package/lib-commonjs/components/CardHeader/index.d.ts +0 -5
- package/lib-commonjs/components/CardHeader/renderCardHeader.d.ts +0 -5
- package/lib-commonjs/components/CardHeader/useCardHeader.d.ts +0 -12
- package/lib-commonjs/components/CardHeader/useCardHeaderStyles.d.ts +0 -11
- package/lib-commonjs/components/CardPreview/CardPreview.d.ts +0 -6
- package/lib-commonjs/components/CardPreview/CardPreview.types.d.ts +0 -13
- package/lib-commonjs/components/CardPreview/index.d.ts +0 -5
- package/lib-commonjs/components/CardPreview/renderCardPreview.d.ts +0 -5
- package/lib-commonjs/components/CardPreview/useCardPreview.d.ts +0 -12
- package/lib-commonjs/components/CardPreview/useCardPreviewStyles.d.ts +0 -11
- package/lib-commonjs/index.d.ts +0 -8
@@ -17,10 +17,6 @@ export declare const cardClassName = "fui-Card";
|
|
17
17
|
|
18
18
|
export declare const cardClassNames: SlotClassNames<CardSlots>;
|
19
19
|
|
20
|
-
export declare type CardCommons = {
|
21
|
-
appearance: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
22
|
-
};
|
23
|
-
|
24
20
|
/**
|
25
21
|
* Component to render Button actions in a Card component.
|
26
22
|
*/
|
@@ -109,7 +105,30 @@ export declare type CardPreviewState = ComponentState<CardPreviewSlots>;
|
|
109
105
|
/**
|
110
106
|
* Card Props
|
111
107
|
*/
|
112
|
-
export declare type CardProps = ComponentProps<CardSlots> &
|
108
|
+
export declare type CardProps = ComponentProps<CardSlots> & {
|
109
|
+
appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
110
|
+
/**
|
111
|
+
* Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.
|
112
|
+
*
|
113
|
+
* `off`
|
114
|
+
* The card will not focusable.
|
115
|
+
*
|
116
|
+
* `no-tab`
|
117
|
+
* This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when
|
118
|
+
* pressing the Escape key.
|
119
|
+
*
|
120
|
+
* `tab-exit`
|
121
|
+
* This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing
|
122
|
+
* the Tab key on the last inner element.
|
123
|
+
*
|
124
|
+
* `tab-only`
|
125
|
+
* This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus
|
126
|
+
* after the last inner element.
|
127
|
+
*
|
128
|
+
* @defaultvalue off
|
129
|
+
*/
|
130
|
+
focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';
|
131
|
+
};
|
113
132
|
|
114
133
|
export declare type CardSlots = {
|
115
134
|
root: Slot<'div'>;
|
@@ -118,7 +137,7 @@ export declare type CardSlots = {
|
|
118
137
|
/**
|
119
138
|
* State used in rendering Card
|
120
139
|
*/
|
121
|
-
export declare type CardState = ComponentState<CardSlots> &
|
140
|
+
export declare type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance'>>;
|
122
141
|
|
123
142
|
/**
|
124
143
|
* Render the final JSX of Card
|
File without changes
|
@@ -1 +1 @@
|
|
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
|
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\n/**\n * Card Props\n */\nexport type CardProps = ComponentProps<CardSlots> & {\n appearance?: 'filled' | 'filled-alternative' | 'outline' | 'subtle';\n\n /**\n * Sets the focus behavior for the card. If `true`, the card will use the `noTab` focus behavior.\n *\n * `off`\n * The card will not focusable.\n *\n * `no-tab`\n * This behaviour traps the focus inside of the Card when pressing the Enter key and will only release focus when\n * pressing the Escape key.\n *\n * `tab-exit`\n * This behaviour traps the focus inside of the Card when pressing the Enter key but will release focus when pressing\n * the Tab key on the last inner element.\n *\n * `tab-only`\n * This behaviour will cycle through all elements inside of the Card when pressing the Tab key and then release focus\n * after the last inner element.\n *\n * @defaultvalue off\n */\n focusMode?: 'off' | 'no-tab' | 'tab-exit' | 'tab-only';\n};\n\n/**\n * State used in rendering Card\n */\nexport type CardState = ComponentState<CardSlots> & Required<Pick<CardProps, 'appearance'>>;\n"]}
|
@@ -11,12 +11,23 @@ import { useFocusableGroup } from '@fluentui/react-tabster';
|
|
11
11
|
*/
|
12
12
|
|
13
13
|
export const useCard_unstable = (props, ref) => {
|
14
|
-
const groupperAttrs = useFocusableGroup({
|
15
|
-
tabBehavior: 'limitedTrapFocus'
|
16
|
-
});
|
17
14
|
const {
|
18
|
-
appearance = 'filled'
|
15
|
+
appearance = 'filled',
|
16
|
+
focusMode = 'off'
|
19
17
|
} = props;
|
18
|
+
const focusMap = {
|
19
|
+
off: undefined,
|
20
|
+
'no-tab': 'limitedTrapFocus',
|
21
|
+
'tab-exit': 'limited',
|
22
|
+
'tab-only': 'unlimited'
|
23
|
+
};
|
24
|
+
const groupperAttrs = useFocusableGroup({
|
25
|
+
tabBehavior: focusMap[focusMode]
|
26
|
+
});
|
27
|
+
const focusAttrs = focusMode !== 'off' ? {
|
28
|
+
tabIndex: 0,
|
29
|
+
...groupperAttrs
|
30
|
+
} : null;
|
20
31
|
return {
|
21
32
|
appearance,
|
22
33
|
components: {
|
@@ -25,7 +36,7 @@ export const useCard_unstable = (props, ref) => {
|
|
25
36
|
root: getNativeElementProps(props.as || 'div', {
|
26
37
|
ref,
|
27
38
|
role: 'group',
|
28
|
-
...
|
39
|
+
...focusAttrs,
|
29
40
|
...props
|
30
41
|
})
|
31
42
|
};
|
@@ -1 +1 @@
|
|
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;
|
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;AAAE,IAAA,UAAU,GAAG,QAAf;AAAyB,IAAA,SAAS,GAAG;AAArC,MAA+C,KAArD;AAEA,QAAM,QAAQ,GAAG;AACf,IAAA,GAAG,EAAE,SADU;AAEf,cAAU,kBAFK;AAGf,gBAAY,SAHG;AAIf,gBAAY;AAJG,GAAjB;AAOA,QAAM,aAAa,GAAG,iBAAiB,CAAC;AACtC,IAAA,WAAW,EAAE,QAAQ,CAAC,SAAD;AADiB,GAAD,CAAvC;AAIA,QAAM,UAAU,GAAG,SAAS,KAAK,KAAd,GAAsB;AAAE,IAAA,QAAQ,EAAE,CAAZ;AAAe,OAAG;AAAlB,GAAtB,GAA0D,IAA7E;AAEA,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,UAH0C;AAI7C,SAAG;AAJ0C,KAApB;AAJtB,GAAP;AAWD,CA3BM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { CardProps, CardState } from './Card.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Card.\n *\n * The returned state can be modified with hooks such as useCardStyles_unstable,\n * before being passed to renderCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param ref - reference to root HTMLElement of Card\n */\nexport const useCard_unstable = (props: CardProps, ref: React.Ref<HTMLElement>): CardState => {\n const { appearance = 'filled', focusMode = 'off' } = props;\n\n const focusMap = {\n off: undefined,\n 'no-tab': 'limitedTrapFocus',\n 'tab-exit': 'limited',\n 'tab-only': 'unlimited',\n } as const;\n\n const groupperAttrs = useFocusableGroup({\n tabBehavior: focusMap[focusMode],\n });\n\n const focusAttrs = focusMode !== 'off' ? { tabIndex: 0, ...groupperAttrs } : null;\n\n return {\n appearance,\n\n components: { root: 'div' },\n root: getNativeElementProps(props.as || 'div', {\n ref,\n role: 'group',\n ...focusAttrs,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -16,132 +16,138 @@ export const cardClassNames = {
|
|
16
16
|
const useStyles = /*#__PURE__*/__styles({
|
17
17
|
"root": {
|
18
18
|
"mc9l5x": "ftgm304",
|
19
|
+
"qhf8xq": "f10pi13n",
|
19
20
|
"B68tc82": "f1p9o1ba",
|
20
21
|
"Bmxbyg5": "f1sil6mw",
|
21
22
|
"sj55zd": "f19n0e5",
|
22
|
-
"icvyot": "fzkkow9",
|
23
|
-
"vrafjx": ["fcdblym", "fjik90z"],
|
24
|
-
"oivjwe": "fg706s2",
|
25
|
-
"wvpqe5": ["fjik90z", "fcdblym"],
|
26
|
-
"B4j52fo": "f192inf7",
|
27
|
-
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
28
|
-
"Bn0qgzm": "f1vxd6vx",
|
29
|
-
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
30
23
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
31
24
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
32
25
|
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
33
26
|
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
27
|
+
"E3zdtr": "f1mdlcz9",
|
28
|
+
"bn5sak": "frwkxtg",
|
29
|
+
"Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
|
30
|
+
"B1piin3": ["f15yvnhg", "f1n6gb5g"],
|
31
|
+
"By385i5": "fo72kxq",
|
32
|
+
"Bsft5z2": "f13zj6fq",
|
33
|
+
"B80jsxd": "f1nwj1ja",
|
34
|
+
"Bm2nyyq": "f8rth92",
|
35
|
+
"Barhvk9": ["flthirb", "ftkbnf5"],
|
36
|
+
"Bw17bha": "f1lh990p",
|
37
|
+
"vfts7": ["ftkbnf5", "flthirb"],
|
38
|
+
"xrcqlc": "f6czdpx",
|
39
|
+
"Ihftqj": ["f13hvwk3", "f1en4csx"],
|
40
|
+
"Bcgy8vk": "f1i1u9k0",
|
41
|
+
"Bhxzhr1": ["f1en4csx", "f13hvwk3"],
|
42
|
+
"B3778ie": ["f1ibwz09", "f1kp91vd"],
|
43
|
+
"d9w3h3": ["f1kp91vd", "f1ibwz09"],
|
44
|
+
"Bl18szs": ["f1pix4dl", "f13nd1z4"],
|
45
|
+
"B4j8arr": ["f13nd1z4", "f1pix4dl"],
|
34
46
|
"Ecqjvq": "f70or3y",
|
35
47
|
"B39syqp": ["f1s27jks", "f1x7x6se"],
|
36
48
|
"m3o775": "f1q2lvbs",
|
37
49
|
"I0kkcn": ["f1x7x6se", "f1s27jks"]
|
38
50
|
},
|
51
|
+
"interactiveNoOutline": {
|
52
|
+
"Be0v6ae": "ftr40te",
|
53
|
+
"B5kxglz": ["fcsoo7g", "f1rl4q8i"],
|
54
|
+
"B3pwyw6": "fbb4roj",
|
55
|
+
"Bymgtzf": ["f1rl4q8i", "fcsoo7g"],
|
56
|
+
"dmfk": "fd4vwcp",
|
57
|
+
"B4ofi8": ["f1crelnc", "fup9tr0"],
|
58
|
+
"jgq6uv": "f12d33p4",
|
59
|
+
"Baxewws": ["fup9tr0", "f1crelnc"]
|
60
|
+
},
|
39
61
|
"filledInteractive": {
|
40
62
|
"Bceei9c": "f1k6fduh",
|
41
63
|
"De3pzq": "fxugw4r",
|
42
|
-
"g2u3we": "fghlq4f",
|
43
|
-
"h3c5rm": ["f1gn591s", "fjscplz"],
|
44
|
-
"B9xav0g": "fb073pr",
|
45
|
-
"zhjwy3": ["fjscplz", "f1gn591s"],
|
46
64
|
"E5pizo": "f1whvlc6",
|
65
|
+
"B0n5ga8": "f16gxe2i",
|
66
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
67
|
+
"B1q35kw": "f1osi826",
|
68
|
+
"Gp14am": ["fzybk4o", "fpgykix"],
|
47
69
|
"Jwef8y": "f1knas48",
|
48
|
-
"Bgoe8wy": "fpa59ij",
|
49
|
-
"Bwzppfd": ["f1rhln42", "f1l1ogpg"],
|
50
|
-
"oetu4i": "fz67qlh",
|
51
|
-
"gg5e9n": ["f1l1ogpg", "f1rhln42"],
|
52
70
|
"Bvxd0ez": "f1m145df",
|
53
|
-
"ecr2s2": "fb40n2d"
|
54
|
-
"B6oc9vd": "f7cshhm",
|
55
|
-
"ak43y8": ["f1bzyac8", "f131p3c2"],
|
56
|
-
"wmxk5l": "f1bazisv",
|
57
|
-
"B50zh58": ["f131p3c2", "f1bzyac8"]
|
71
|
+
"ecr2s2": "fb40n2d"
|
58
72
|
},
|
59
73
|
"filled": {
|
60
74
|
"De3pzq": "fxugw4r",
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"
|
75
|
+
"E5pizo": "f1whvlc6",
|
76
|
+
"B0n5ga8": "f16gxe2i",
|
77
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
78
|
+
"B1q35kw": "f1osi826",
|
79
|
+
"Gp14am": ["fzybk4o", "fpgykix"]
|
66
80
|
},
|
67
81
|
"filledAlternativeInteractive": {
|
68
82
|
"Bceei9c": "f1k6fduh",
|
69
83
|
"De3pzq": "f1dmdbja",
|
70
|
-
"g2u3we": "fghlq4f",
|
71
|
-
"h3c5rm": ["f1gn591s", "fjscplz"],
|
72
|
-
"B9xav0g": "fb073pr",
|
73
|
-
"zhjwy3": ["fjscplz", "f1gn591s"],
|
74
84
|
"E5pizo": "f1whvlc6",
|
85
|
+
"B0n5ga8": "f16gxe2i",
|
86
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
87
|
+
"B1q35kw": "f1osi826",
|
88
|
+
"Gp14am": ["fzybk4o", "fpgykix"],
|
75
89
|
"Jwef8y": "f1uvynv3",
|
76
|
-
"Bgoe8wy": "fpa59ij",
|
77
|
-
"Bwzppfd": ["f1rhln42", "f1l1ogpg"],
|
78
|
-
"oetu4i": "fz67qlh",
|
79
|
-
"gg5e9n": ["f1l1ogpg", "f1rhln42"],
|
80
90
|
"Bvxd0ez": "f1m145df",
|
81
|
-
"ecr2s2": "f1yhgkbh"
|
82
|
-
"B6oc9vd": "f7cshhm",
|
83
|
-
"ak43y8": ["f1bzyac8", "f131p3c2"],
|
84
|
-
"wmxk5l": "f1bazisv",
|
85
|
-
"B50zh58": ["f131p3c2", "f1bzyac8"]
|
91
|
+
"ecr2s2": "f1yhgkbh"
|
86
92
|
},
|
87
93
|
"filledAlternative": {
|
88
94
|
"De3pzq": "f1dmdbja",
|
89
|
-
"
|
90
|
-
"
|
91
|
-
"
|
92
|
-
"
|
93
|
-
"
|
95
|
+
"E5pizo": "f1whvlc6",
|
96
|
+
"B0n5ga8": "f16gxe2i",
|
97
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
98
|
+
"B1q35kw": "f1osi826",
|
99
|
+
"Gp14am": ["fzybk4o", "fpgykix"]
|
94
100
|
},
|
95
101
|
"outlineInteractive": {
|
96
102
|
"Bceei9c": "f1k6fduh",
|
97
103
|
"De3pzq": "f1c21dwh",
|
98
|
-
"g2u3we": "fj3muxo",
|
99
|
-
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
100
|
-
"B9xav0g": "f1aperda",
|
101
|
-
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
102
104
|
"E5pizo": "f1couhl3",
|
105
|
+
"B0n5ga8": "ft83z1f",
|
106
|
+
"s924m2": ["f1g4150c", "f192dr6e"],
|
107
|
+
"B1q35kw": "f1qnawh6",
|
108
|
+
"Gp14am": ["f192dr6e", "f1g4150c"],
|
103
109
|
"Jwef8y": "fjxutwb",
|
104
|
-
"
|
105
|
-
"
|
106
|
-
"
|
107
|
-
"
|
110
|
+
"Be0v6ae": "f1llr77y",
|
111
|
+
"B5kxglz": ["fzk0khw", "fjj8tog"],
|
112
|
+
"B3pwyw6": "fb1u8ub",
|
113
|
+
"Bymgtzf": ["fjj8tog", "fzk0khw"],
|
108
114
|
"ecr2s2": "fophhak",
|
109
|
-
"
|
110
|
-
"
|
111
|
-
"
|
112
|
-
"
|
115
|
+
"dmfk": "f1uohb70",
|
116
|
+
"B4ofi8": ["f1jm7v1n", "f1bus3rq"],
|
117
|
+
"jgq6uv": "f1fbu7rr",
|
118
|
+
"Baxewws": ["f1bus3rq", "f1jm7v1n"]
|
113
119
|
},
|
114
120
|
"outline": {
|
115
121
|
"De3pzq": "f1c21dwh",
|
116
|
-
"
|
117
|
-
"
|
118
|
-
"
|
119
|
-
"
|
120
|
-
"
|
122
|
+
"E5pizo": "f1couhl3",
|
123
|
+
"B0n5ga8": "ft83z1f",
|
124
|
+
"s924m2": ["f1g4150c", "f192dr6e"],
|
125
|
+
"B1q35kw": "f1qnawh6",
|
126
|
+
"Gp14am": ["f192dr6e", "f1g4150c"]
|
121
127
|
},
|
122
128
|
"subtleInteractive": {
|
123
129
|
"Bceei9c": "f1k6fduh",
|
124
130
|
"De3pzq": "fhovq9v",
|
125
|
-
"g2u3we": "fghlq4f",
|
126
|
-
"h3c5rm": ["f1gn591s", "fjscplz"],
|
127
|
-
"B9xav0g": "fb073pr",
|
128
|
-
"zhjwy3": ["fjscplz", "f1gn591s"],
|
129
131
|
"E5pizo": "f1couhl3",
|
132
|
+
"B0n5ga8": "f16gxe2i",
|
133
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
134
|
+
"B1q35kw": "f1osi826",
|
135
|
+
"Gp14am": ["fzybk4o", "fpgykix"],
|
130
136
|
"Jwef8y": "f1t94bn6",
|
131
137
|
"ecr2s2": "f1wfn5kd"
|
132
138
|
},
|
133
139
|
"subtle": {
|
134
140
|
"De3pzq": "fhovq9v",
|
135
|
-
"
|
136
|
-
"
|
137
|
-
"
|
138
|
-
"
|
139
|
-
"
|
141
|
+
"E5pizo": "f1couhl3",
|
142
|
+
"B0n5ga8": "f16gxe2i",
|
143
|
+
"s924m2": ["fpgykix", "fzybk4o"],
|
144
|
+
"B1q35kw": "f1osi826",
|
145
|
+
"Gp14am": ["fzybk4o", "fpgykix"]
|
140
146
|
}
|
141
147
|
}, {
|
142
|
-
"d": [".ftgm304{display:block;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".
|
143
|
-
"h": [".
|
144
|
-
"a": [".
|
148
|
+
"d": [".ftgm304{display:block;}", ".f10pi13n{position:relative;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".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);}", ".f1mdlcz9::after{position:absolute;}", ".frwkxtg::after{top:0;}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right:0;}", ".fo72kxq::after{bottom:0;}", ".f13zj6fq::after{content:\"\";}", ".f1nwj1ja::after{pointer-events:none;}", ".f8rth92::after{border-top-style:solid;}", ".flthirb::after{border-right-style:solid;}", ".ftkbnf5::after{border-left-style:solid;}", ".f1lh990p::after{border-bottom-style:solid;}", ".f6czdpx::after{border-top-width:var(--strokeWidthThin);}", ".f13hvwk3::after{border-right-width:var(--strokeWidthThin);}", ".f1en4csx::after{border-left-width:var(--strokeWidthThin);}", ".f1i1u9k0::after{border-bottom-width:var(--strokeWidthThin);}", ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1pix4dl::after{border-top-right-radius:var(--borderRadiusMedium);}", ".f13nd1z4::after{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);}", ".f1whvlc6{box-shadow:var(--shadow4);}", ".f16gxe2i::after{border-top-color:var(--colorTransparentStroke);}", ".fpgykix::after{border-right-color:var(--colorTransparentStroke);}", ".fzybk4o::after{border-left-color:var(--colorTransparentStroke);}", ".f1osi826::after{border-bottom-color:var(--colorTransparentStroke);}", ".f1dmdbja{background-color:var(--colorNeutralBackground2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1couhl3{box-shadow:none;}", ".ft83z1f::after{border-top-color:var(--colorNeutralStroke1);}", ".f1g4150c::after{border-right-color:var(--colorNeutralStroke1);}", ".f192dr6e::after{border-left-color:var(--colorNeutralStroke1);}", ".f1qnawh6::after{border-bottom-color:var(--colorNeutralStroke1);}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"],
|
149
|
+
"h": [".ftr40te:hover::after{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fcsoo7g:hover::after{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f1rl4q8i:hover::after{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fbb4roj:hover::after{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".f1m145df:hover{box-shadow:var(--shadow8);}", ".f1uvynv3:hover{background-color:var(--colorNeutralBackground2Hover);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f1llr77y:hover::after{border-top-color:var(--colorNeutralStroke1Hover);}", ".fzk0khw:hover::after{border-right-color:var(--colorNeutralStroke1Hover);}", ".fjj8tog:hover::after{border-left-color:var(--colorNeutralStroke1Hover);}", ".fb1u8ub:hover::after{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
150
|
+
"a": [".fd4vwcp:active::after{border-top-color:var(--colorTransparentStrokeInteractive);}", ".f1crelnc:active::after{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fup9tr0:active::after{border-left-color:var(--colorTransparentStrokeInteractive);}", ".f12d33p4:active::after{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".f1yhgkbh:active{background-color:var(--colorNeutralBackground2Pressed);}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f1uohb70:active::after{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1jm7v1n:active::after{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f1bus3rq:active::after{border-left-color:var(--colorNeutralStroke1Pressed);}", ".f1fbu7rr:active::after{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
145
151
|
});
|
146
152
|
/**
|
147
153
|
* Apply styling to the Card slots based on the state
|
@@ -151,7 +157,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
151
157
|
export const useCardStyles_unstable = state => {
|
152
158
|
const styles = useStyles();
|
153
159
|
const interactive = state.root.onClick || state.root.onMouseUp || state.root.onMouseDown || state.root.onPointerUp || state.root.onPointerDown || state.root.onTouchStart || state.root.onTouchEnd;
|
154
|
-
state.root.className = mergeClasses(cardClassNames.root, 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);
|
160
|
+
state.root.className = mergeClasses(cardClassNames.root, 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, interactive && state.appearance !== 'outline' && styles.interactiveNoOutline, state.root.className);
|
155
161
|
return state;
|
156
162
|
};
|
157
163
|
//# sourceMappingURL=useCardStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Card/useCardStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,qBAAT,QAAsC,sBAAtC;AAIA;;AAEG;;AACH,OAAO,MAAM,aAAa,GAAG,UAAtB;AACP,OAAO,MAAM,cAAc,GAA8B;AACvD,EAAA,IAAI,EAAE;AADiD,CAAlD;AAIP;;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;
|
1
|
+
{"version":3,"sources":["components/Card/useCardStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,qBAAT,QAAsC,sBAAtC;AAIA;;AAEG;;AACH,OAAO,MAAM,aAAa,GAAG,UAAtB;AACP,OAAO,MAAM,cAAc,GAA8B;AACvD,EAAA,IAAI,EAAE;AADiD,CAAlD;AAIP;;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoJA;;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,cAAc,CAAC,IADkB,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,WAAW,IAAI,KAAK,CAAC,UAAN,KAAqB,SAApC,IAAiD,MAAM,CAAC,oBAXvB,EAYjC,KAAK,CAAC,IAAN,CAAW,SAZsB,CAAnC;AAeA,SAAO,KAAP;AACD,CA5BM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { cardPreviewClassNames } from '../CardPreview/index';\nimport type { CardSlots, CardState } from './Card.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `cardClassNames.root` instead.\n */\nexport const cardClassName = 'fui-Card';\nexport const cardClassNames: SlotClassNames<CardSlots> = {\n root: 'fui-Card',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'block',\n position: 'relative',\n ...shorthands.overflow('hidden'),\n color: tokens.colorNeutralForeground1,\n\n // TODO: Extract this to separate stiles when tackling the `size` prop\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n '::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n content: '\"\"',\n pointerEvents: 'none',\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n // TODO: Extract this to separate styles when tackling the `size` prop\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n\n [`> *:not(.${cardPreviewClassNames.root})`]: {\n // TODO: Extract this to separate styles when tackling the `size` prop\n ...shorthands.margin('12px'),\n },\n },\n\n interactiveNoOutline: {\n ':hover::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n ':active::after': {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n },\n },\n\n filledInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n },\n },\n filled: {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n filledAlternativeInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground2Hover,\n boxShadow: tokens.shadow8,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground2Pressed,\n },\n },\n filledAlternative: {\n backgroundColor: tokens.colorNeutralBackground2,\n boxShadow: tokens.shadow4,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n },\n outlineInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n },\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n },\n },\n subtleInteractive: {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n boxShadow: 'none',\n\n '::after': {\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\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 cardClassNames.root,\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 interactive && state.appearance !== 'outline' && styles.interactiveNoOutline,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA;AAEA,SACE,IADF,EAEE,aAFF,EAGE,cAHF,EAIE,mBAJF,EAKE,sBALF,EAME,gBANF,QAOO,QAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,WADF,EAEE,oBAFF,EAGE,qBAHF,EAIE,0BAJF,EAKE,6BALF,EAME,uBANF,QAOO,eAPP","sourcesContent":["/* eslint-disable deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851*/\n\nexport {\n Card,\n cardClassName,\n cardClassNames,\n renderCard_unstable,\n useCardStyles_unstable,\n useCard_unstable,\n} from './Card';\nexport type {
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA;AAEA,SACE,IADF,EAEE,aAFF,EAGE,cAHF,EAIE,mBAJF,EAKE,sBALF,EAME,gBANF,QAOO,QAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,UADF,EAEE,mBAFF,EAGE,oBAHF,EAIE,yBAJF,EAKE,4BALF,EAME,sBANF,QAOO,cAPP;AASA,SACE,WADF,EAEE,oBAFF,EAGE,qBAHF,EAIE,0BAJF,EAKE,6BALF,EAME,uBANF,QAOO,eAPP","sourcesContent":["/* eslint-disable deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851*/\n\nexport {\n Card,\n cardClassName,\n cardClassNames,\n renderCard_unstable,\n useCardStyles_unstable,\n useCard_unstable,\n} from './Card';\nexport type { CardProps, CardSlots, CardState } from './Card';\nexport {\n CardFooter,\n cardFooterClassName,\n cardFooterClassNames,\n renderCardFooter_unstable,\n useCardFooterStyles_unstable,\n useCardFooter_unstable,\n} from './CardFooter';\nexport type { CardFooterProps, CardFooterSlots, CardFooterState } from './CardFooter';\nexport {\n CardHeader,\n cardHeaderClassName,\n cardHeaderClassNames,\n renderCardHeader_unstable,\n useCardHeaderStyles_unstable,\n useCardHeader_unstable,\n} from './CardHeader';\nexport type { CardHeaderProps, CardHeaderSlots, CardHeaderState } from './CardHeader';\nexport {\n CardPreview,\n cardPreviewClassName,\n cardPreviewClassNames,\n renderCardPreview_unstable,\n useCardPreviewStyles_unstable,\n useCardPreview_unstable,\n} from './CardPreview';\nexport type { CardPreviewProps, CardPreviewSlots, CardPreviewState } from './CardPreview';\n"],"sourceRoot":"../src/"}
|
@@ -20,12 +20,23 @@ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
20
20
|
|
21
21
|
|
22
22
|
const useCard_unstable = (props, ref) => {
|
23
|
-
const groupperAttrs = react_tabster_1.useFocusableGroup({
|
24
|
-
tabBehavior: 'limitedTrapFocus'
|
25
|
-
});
|
26
23
|
const {
|
27
|
-
appearance = 'filled'
|
24
|
+
appearance = 'filled',
|
25
|
+
focusMode = 'off'
|
28
26
|
} = props;
|
27
|
+
const focusMap = {
|
28
|
+
off: undefined,
|
29
|
+
'no-tab': 'limitedTrapFocus',
|
30
|
+
'tab-exit': 'limited',
|
31
|
+
'tab-only': 'unlimited'
|
32
|
+
};
|
33
|
+
const groupperAttrs = react_tabster_1.useFocusableGroup({
|
34
|
+
tabBehavior: focusMap[focusMode]
|
35
|
+
});
|
36
|
+
const focusAttrs = focusMode !== 'off' ? {
|
37
|
+
tabIndex: 0,
|
38
|
+
...groupperAttrs
|
39
|
+
} : null;
|
29
40
|
return {
|
30
41
|
appearance,
|
31
42
|
components: {
|
@@ -34,7 +45,7 @@ const useCard_unstable = (props, ref) => {
|
|
34
45
|
root: react_utilities_1.getNativeElementProps(props.as || 'div', {
|
35
46
|
ref,
|
36
47
|
role: 'group',
|
37
|
-
...
|
48
|
+
...focusAttrs,
|
38
49
|
...props
|
39
50
|
})
|
40
51
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Card/useCard.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAD,EAAmB,GAAnB,KAA6D;AAC3F,QAAM,aAAa,GAAG,eAAA,CAAA,iBAAA,CAAkB;AACtC,IAAA,WAAW,EAAE;
|
1
|
+
{"version":3,"sources":["components/Card/useCard.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAD,EAAmB,GAAnB,KAA6D;AAC3F,QAAM;AAAE,IAAA,UAAU,GAAG,QAAf;AAAyB,IAAA,SAAS,GAAG;AAArC,MAA+C,KAArD;AAEA,QAAM,QAAQ,GAAG;AACf,IAAA,GAAG,EAAE,SADU;AAEf,cAAU,kBAFK;AAGf,gBAAY,SAHG;AAIf,gBAAY;AAJG,GAAjB;AAOA,QAAM,aAAa,GAAG,eAAA,CAAA,iBAAA,CAAkB;AACtC,IAAA,WAAW,EAAE,QAAQ,CAAC,SAAD;AADiB,GAAlB,CAAtB;AAIA,QAAM,UAAU,GAAG,SAAS,KAAK,KAAd,GAAsB;AAAE,IAAA,QAAQ,EAAE,CAAZ;AAAe,OAAG;AAAlB,GAAtB,GAA0D,IAA7E;AAEA,SAAO;AACL,IAAA,UADK;AAGL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE;AAAR,KAHP;AAIL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAK,CAAC,EAAN,IAAY,KAAlC,EAAyC;AAC7C,MAAA,GAD6C;AAE7C,MAAA,IAAI,EAAE,OAFuC;AAG7C,SAAG,UAH0C;AAI7C,SAAG;AAJ0C,KAAzC;AAJD,GAAP;AAWD,CA3BM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { CardProps, CardState } from './Card.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Card.\n *\n * The returned state can be modified with hooks such as useCardStyles_unstable,\n * before being passed to renderCard_unstable.\n *\n * @param props - props from this instance of Card\n * @param ref - reference to root HTMLElement of Card\n */\nexport const useCard_unstable = (props: CardProps, ref: React.Ref<HTMLElement>): CardState => {\n const { appearance = 'filled', focusMode = 'off' } = props;\n\n const focusMap = {\n off: undefined,\n 'no-tab': 'limitedTrapFocus',\n 'tab-exit': 'limited',\n 'tab-only': 'unlimited',\n } as const;\n\n const groupperAttrs = useFocusableGroup({\n tabBehavior: focusMap[focusMode],\n });\n\n const focusAttrs = focusMode !== 'off' ? { tabIndex: 0, ...groupperAttrs } : null;\n\n return {\n appearance,\n\n components: { root: 'div' },\n root: getNativeElementProps(props.as || 'div', {\n ref,\n role: 'group',\n ...focusAttrs,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|