@fluentui/react-popover 9.3.4 → 9.3.6
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +111 -1
- package/CHANGELOG.md +31 -2
- package/lib/components/Popover/Popover.js +0 -1
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/renderPopover.js +0 -1
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +8 -26
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +0 -1
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +2 -4
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +2 -11
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +80 -83
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +2 -3
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +6 -11
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +0 -2
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/PopoverSurface.js +0 -2
- package/lib-commonjs/PopoverSurface.js.map +1 -1
- package/lib-commonjs/PopoverTrigger.js +0 -2
- package/lib-commonjs/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.js +0 -5
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
- package/lib-commonjs/components/Popover/constants.js +0 -1
- package/lib-commonjs/components/Popover/constants.js.map +1 -1
- package/lib-commonjs/components/Popover/index.js +0 -5
- package/lib-commonjs/components/Popover/index.js.map +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +0 -5
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +8 -36
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +0 -6
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +0 -6
- package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +2 -9
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +2 -16
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +80 -88
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +2 -7
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/index.js +0 -5
- package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +0 -2
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +6 -18
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +0 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.js +0 -4
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +12 -12
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.usePopoverSurfaceStyles_unstable = exports.arrowHeights = exports.popoverSurfaceClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
11
|
-
|
12
9
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
|
-
|
14
10
|
exports.popoverSurfaceClassNames = {
|
15
11
|
root: 'fui-PopoverSurface'
|
16
12
|
};
|
@@ -22,110 +18,106 @@ exports.arrowHeights = {
|
|
22
18
|
/**
|
23
19
|
* Styles for the root slot
|
24
20
|
*/
|
25
|
-
|
26
21
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
22
|
+
root: {
|
23
|
+
sj55zd: "f19n0e5",
|
24
|
+
De3pzq: "fxugw4r",
|
25
|
+
E5pizo: "f1hg901r",
|
26
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
27
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
28
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
29
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
30
|
+
B4j52fo: "f5ogflp",
|
31
|
+
Bekrc4i: ["f1hqa2wf", "finvdd3"],
|
32
|
+
Bn0qgzm: "f1f09k3d",
|
33
|
+
ibv6hh: ["finvdd3", "f1hqa2wf"],
|
34
|
+
icvyot: "fzkkow9",
|
35
|
+
vrafjx: ["fcdblym", "fjik90z"],
|
36
|
+
oivjwe: "fg706s2",
|
37
|
+
wvpqe5: ["fjik90z", "fcdblym"],
|
38
|
+
g2u3we: "fghlq4f",
|
39
|
+
h3c5rm: ["f1gn591s", "fjscplz"],
|
40
|
+
B9xav0g: "fb073pr",
|
41
|
+
zhjwy3: ["fjscplz", "f1gn591s"],
|
42
|
+
Bahqtrf: "fk6fouc",
|
43
|
+
Be2twd7: "fkhj508",
|
44
|
+
Bhrd7zp: "figsok6",
|
45
|
+
Bg96gwp: "f1i3iumi"
|
51
46
|
},
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
inverted: {
|
48
|
+
De3pzq: "fg3r6xk",
|
49
|
+
sj55zd: "fonrgv7"
|
55
50
|
},
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
brand: {
|
52
|
+
De3pzq: "ffp7eso",
|
53
|
+
sj55zd: "f1phragk"
|
59
54
|
},
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
smallPadding: {
|
56
|
+
z8tnut: "f1kcqot9",
|
57
|
+
z189sj: ["f11qrl6u", "fjlbh76"],
|
58
|
+
Byoj8tv: "fpe6lb7",
|
59
|
+
uwmqm3: ["fjlbh76", "f11qrl6u"]
|
65
60
|
},
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
mediumPadding: {
|
62
|
+
z8tnut: "fqag9an",
|
63
|
+
z189sj: ["f1gbmcue", "f1rh9g5y"],
|
64
|
+
Byoj8tv: "fp67ikv",
|
65
|
+
uwmqm3: ["f1rh9g5y", "f1gbmcue"]
|
71
66
|
},
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
67
|
+
largePadding: {
|
68
|
+
z8tnut: "fc7z3ec",
|
69
|
+
z189sj: ["fat0sn4", "fekwl8i"],
|
70
|
+
Byoj8tv: "fe2my4m",
|
71
|
+
uwmqm3: ["fekwl8i", "fat0sn4"]
|
77
72
|
},
|
78
|
-
|
79
|
-
|
80
|
-
|
73
|
+
smallArrow: {
|
74
|
+
a9b677: "f1ekdpwm",
|
75
|
+
Bqenvij: "f83vc9z"
|
81
76
|
},
|
82
|
-
|
83
|
-
|
84
|
-
|
77
|
+
mediumLargeArrow: {
|
78
|
+
a9b677: "f1kmc0fn",
|
79
|
+
Bqenvij: "fb6lvc5"
|
85
80
|
},
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
81
|
+
arrow: {
|
82
|
+
qhf8xq: "f1euv43f",
|
83
|
+
De3pzq: "f1u2r49w",
|
84
|
+
Bcdw1i0: "fd7fpy0",
|
85
|
+
Bj3rh1h: "f1bsuimh",
|
86
|
+
Ftih45: "f1wl9k8s",
|
87
|
+
B1puzpu: "f1wkw4r9",
|
88
|
+
Brfgrao: "f1j7ml58",
|
89
|
+
Bcvre1j: "fyl8oag",
|
90
|
+
Ccq8qp: "frdoeuz",
|
91
|
+
Baz25je: "fb81m9q",
|
92
|
+
cmx5o7: "f1ljr5q2",
|
93
|
+
B4f6apu: "fyfemzf",
|
94
|
+
m598lv: "focyt6c",
|
95
|
+
Bk5zm6e: "fnhxbxj",
|
96
|
+
y0oebl: "fdw6hkg",
|
97
|
+
qa3bma: "f11yjt3y",
|
98
|
+
Bqjgrrk: "f1172wan",
|
99
|
+
Budzafs: ["f9e5op9", "f112wvtl"],
|
100
|
+
Hv9wc6: ["ftj5xct", "fyavhwi"],
|
101
|
+
hl6cv3: "f1773hnp",
|
102
|
+
Bh2vraf: "f1n8855c",
|
103
|
+
yayu3t: "f1v7783n",
|
104
|
+
wedwtw: "fsw6im5",
|
105
|
+
rhl9o9: "fh2hsk5",
|
106
|
+
Bu8t5uz: "f159pzir",
|
107
|
+
B6q6orb: "f11yvu4",
|
108
|
+
Bwwlvwl: "fm1ycve"
|
114
109
|
}
|
115
110
|
}, {
|
116
|
-
|
111
|
+
d: [".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".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);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fg3r6xk{background-color:var(--colorNeutralBackgroundStatic);}", ".fonrgv7{color:var(--colorNeutralForegroundStaticInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1ekdpwm{width:8.484px;}", ".f83vc9z{height:8.484px;}", ".f1kmc0fn{width:11.312px;}", ".fb6lvc5{height:11.312px;}", ".f1euv43f{position:absolute;}", ".f1u2r49w{background-color:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".f1wl9k8s::before{content:\"\";}", ".f1wkw4r9::before{visibility:visible;}", ".f1j7ml58::before{position:absolute;}", ".fyl8oag::before{box-sizing:border-box;}", ".frdoeuz::before{width:inherit;}", ".fb81m9q::before{height:inherit;}", ".f1ljr5q2::before{background-color:inherit;}", ".fyfemzf::before{border-right-width:1px;}", ".focyt6c::before{border-right-style:solid;}", ".fnhxbxj::before{border-right-color:var(--colorTransparentStroke);}", ".fdw6hkg::before{border-bottom-width:1px;}", ".f11yjt3y::before{border-bottom-style:solid;}", ".f1172wan::before{border-bottom-color:var(--colorTransparentStroke);}", ".f9e5op9::before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f112wvtl::before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".ftj5xct::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", ".fyavhwi::before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);}", "[data-popper-placement^=\"top\"] .f1773hnp{bottom:-1px;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1v7783n{left:-1px;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .fh2hsk5{top:-1px;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f11yvu4{right:-1px;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
|
117
112
|
});
|
118
113
|
/**
|
119
114
|
* Apply styling to the PopoverSurface slots based on the state
|
120
115
|
*/
|
121
|
-
|
122
|
-
|
123
116
|
const usePopoverSurfaceStyles_unstable = state => {
|
124
117
|
const styles = useStyles();
|
125
118
|
state.root.className = react_1.mergeClasses(exports.popoverSurfaceClassNames.root, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
|
126
119
|
state.arrowClassName = react_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
|
127
120
|
return state;
|
128
121
|
};
|
129
|
-
|
130
122
|
exports.usePopoverSurfaceStyles_unstable = usePopoverSurfaceStyles_unstable;
|
131
123
|
//# sourceMappingURL=usePopoverSurfaceStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAKaA,gCAAwB,GAAwC;EAC3EC,IAAI,EAAE;CACP;AAEYD,oBAAY,GAAgC;EACvDE,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;CACR;AAED;;;AAGA,MAAMC,SAAS,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAmC1B;AAEF;;;AAGO,MAAMC,gCAAgC,GAAIC,KAA0B,IAAyB;EAClG,MAAMC,MAAM,GAAGJ,SAAS,EAAE;EAC1BG,KAAK,CAACP,IAAI,CAACS,SAAS,GAAGJ,oBAAY,CACjCN,gCAAwB,CAACC,IAAI,EAC7BQ,MAAM,CAACR,IAAI,EACXO,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAACG,YAAY,EAC7CJ,KAAK,CAACG,IAAI,KAAK,QAAQ,IAAIF,MAAM,CAACI,aAAa,EAC/CL,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAACK,YAAY,EAC7CN,KAAK,CAACO,UAAU,KAAK,UAAU,IAAIN,MAAM,CAACO,QAAQ,EAClDR,KAAK,CAACO,UAAU,KAAK,OAAO,IAAIN,MAAM,CAACQ,KAAK,EAC5CT,KAAK,CAACP,IAAI,CAACS,SAAS,CACrB;EAEDF,KAAK,CAACU,cAAc,GAAGZ,oBAAY,CACjCG,MAAM,CAACU,KAAK,EACZX,KAAK,CAACG,IAAI,KAAK,OAAO,GAAGF,MAAM,CAACW,UAAU,GAAGX,MAAM,CAACY,gBAAgB,CACrE;EAED,OAAOb,KAAK;AACd,CAAC;AAnBYR,wCAAgC","names":["exports","root","small","medium","large","useStyles","react_1","usePopoverSurfaceStyles_unstable","state","styles","className","size","smallPadding","mediumPadding","largePadding","appearance","inverted","brand","arrowClassName","arrow","smallArrow","mediumLargeArrow"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { PopoverSize } from '../Popover/Popover.types';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots> = {\n root: 'fui-PopoverSurface',\n};\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...typographyStyles.body1,\n },\n\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundStatic,\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n smallPadding: {\n ...shorthands.padding('12px'),\n },\n\n mediumPadding: {\n ...shorthands.padding('16px'),\n },\n\n largePadding: {\n ...shorthands.padding('20px'),\n },\n\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({ arrowHeight: undefined }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n popoverSurfaceClassNames.root,\n styles.root,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.appearance === 'inverted' && styles.inverted,\n state.appearance === 'brand' && styles.brand,\n state.root.className,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"]}
|
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.PopoverTrigger = void 0;
|
7
|
-
|
8
7
|
const usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
|
9
|
-
|
10
8
|
const renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
|
11
9
|
/**
|
12
10
|
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
13
11
|
*/
|
14
|
-
|
15
|
-
|
16
12
|
const PopoverTrigger = props => {
|
17
13
|
const state = usePopoverTrigger_1.usePopoverTrigger_unstable(props);
|
18
14
|
return renderPopoverTrigger_1.renderPopoverTrigger_unstable(state);
|
19
15
|
};
|
20
|
-
|
21
16
|
exports.PopoverTrigger = PopoverTrigger;
|
22
|
-
exports.PopoverTrigger.displayName = 'PopoverTrigger';
|
23
|
-
|
17
|
+
exports.PopoverTrigger.displayName = 'PopoverTrigger';
|
18
|
+
// type casting here is required to ensure internal type FluentTriggerComponent is not leaked
|
24
19
|
exports.PopoverTrigger.isFluentTriggerComponent = true;
|
25
20
|
//# sourceMappingURL=PopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AACA;AAIA;;;AAGO,MAAMA,cAAc,GAAkCC,KAAK,IAAG;EACnE,MAAMC,KAAK,GAAGC,8CAA0B,CAACF,KAAK,CAAC;EAE/C,OAAOG,oDAA6B,CAACF,KAAK,CAAC;AAC7C,CAAC;AAJYG,sBAAc;AAM3BA,sBAAc,CAACC,WAAW,GAAG,gBAAgB;AAC7C;AACCD,sBAAyC,CAACE,wBAAwB,GAAG,IAAI","names":["PopoverTrigger","props","state","usePopoverTrigger_1","renderPopoverTrigger_1","exports","displayName","isFluentTriggerComponent"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/PopoverTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverTrigger_unstable } from './usePopoverTrigger';\nimport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\nimport type { PopoverTriggerProps } from './PopoverTrigger.types';\n\n/**\n * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.\n */\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = props => {\n const state = usePopoverTrigger_unstable(props);\n\n return renderPopoverTrigger_unstable(state);\n};\n\nPopoverTrigger.displayName = 'PopoverTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(PopoverTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -3,14 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
|
9
7
|
tslib_1.__exportStar(require("./PopoverTrigger"), exports);
|
10
|
-
|
11
8
|
tslib_1.__exportStar(require("./PopoverTrigger.types"), exports);
|
12
|
-
|
13
9
|
tslib_1.__exportStar(require("./renderPopoverTrigger"), exports);
|
14
|
-
|
15
10
|
tslib_1.__exportStar(require("./usePopoverTrigger"), exports);
|
16
11
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-popover/src/components/PopoverTrigger/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/index.ts"],"sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"]}
|
@@ -7,10 +7,8 @@ exports.renderPopoverTrigger_unstable = void 0;
|
|
7
7
|
/**
|
8
8
|
* Render the final JSX of PopoverTrigger
|
9
9
|
*/
|
10
|
-
|
11
10
|
const renderPopoverTrigger_unstable = state => {
|
12
11
|
return state.children;
|
13
12
|
};
|
14
|
-
|
15
13
|
exports.renderPopoverTrigger_unstable = renderPopoverTrigger_unstable;
|
16
14
|
//# sourceMappingURL=renderPopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAEA;;;AAGO,MAAMA,6BAA6B,GAAIC,KAA0B,IAAI;EAC1E,OAAOA,KAAK,CAACC,QAAQ;AACvB,CAAC;AAFYC,qCAA6B","names":["renderPopoverTrigger_unstable","state","children","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"sourcesContent":["import type { PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Render the final JSX of PopoverTrigger\n */\nexport const renderPopoverTrigger_unstable = (state: PopoverTriggerState) => {\n return state.children;\n};\n"]}
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.usePopoverTrigger_unstable = void 0;
|
7
|
-
|
8
7
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
|
-
|
10
8
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
11
|
-
|
12
9
|
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
13
|
-
|
14
10
|
const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
|
15
|
-
|
16
11
|
const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
|
17
12
|
/**
|
18
13
|
* Create the state required to render PopoverTrigger.
|
@@ -22,8 +17,6 @@ const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
|
|
22
17
|
*
|
23
18
|
* @param props - props from this instance of PopoverTrigger
|
24
19
|
*/
|
25
|
-
|
26
|
-
|
27
20
|
const usePopoverTrigger_unstable = props => {
|
28
21
|
const {
|
29
22
|
children,
|
@@ -39,42 +32,37 @@ const usePopoverTrigger_unstable = props => {
|
|
39
32
|
const {
|
40
33
|
triggerAttributes
|
41
34
|
} = react_tabster_1.useModalAttributes();
|
42
|
-
|
43
35
|
const onContextMenu = e => {
|
44
36
|
if (openOnContext) {
|
45
37
|
e.preventDefault();
|
46
38
|
setOpen(e, true);
|
47
39
|
}
|
48
40
|
};
|
49
|
-
|
50
41
|
const onClick = e => {
|
51
42
|
if (!openOnContext) {
|
52
43
|
toggleOpen(e);
|
53
44
|
}
|
54
45
|
};
|
55
|
-
|
56
46
|
const onKeyDown = e => {
|
57
47
|
if (e.key === keyboard_keys_1.Escape && open) {
|
58
|
-
setOpen(e, false);
|
48
|
+
setOpen(e, false);
|
49
|
+
// stop propagation to avoid conflicting with other elements that listen for `Escape`
|
59
50
|
// e,g: Dialog, Menu
|
60
|
-
|
61
51
|
e.stopPropagation();
|
62
52
|
}
|
63
53
|
};
|
64
|
-
|
65
54
|
const onMouseEnter = e => {
|
66
55
|
if (openOnHover) {
|
67
56
|
setOpen(e, true);
|
68
57
|
}
|
69
58
|
};
|
70
|
-
|
71
59
|
const onMouseLeave = e => {
|
72
60
|
if (openOnHover) {
|
73
61
|
setOpen(e, false);
|
74
62
|
}
|
75
63
|
};
|
76
|
-
|
77
|
-
|
64
|
+
const contextMenuProps = {
|
65
|
+
...triggerAttributes,
|
78
66
|
'aria-expanded': `${open}`,
|
79
67
|
...(child === null || child === void 0 ? void 0 : child.props),
|
80
68
|
onMouseEnter: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),
|
@@ -82,7 +70,8 @@ const usePopoverTrigger_unstable = props => {
|
|
82
70
|
onContextMenu: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),
|
83
71
|
ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref)
|
84
72
|
};
|
85
|
-
const triggerChildProps = {
|
73
|
+
const triggerChildProps = {
|
74
|
+
...contextMenuProps,
|
86
75
|
onClick: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),
|
87
76
|
onKeyDown: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))
|
88
77
|
};
|
@@ -91,6 +80,5 @@ const usePopoverTrigger_unstable = props => {
|
|
91
80
|
children: react_utilities_1.applyTriggerPropsToChildren(props.children, react_aria_1.useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps))
|
92
81
|
};
|
93
82
|
};
|
94
|
-
|
95
83
|
exports.usePopoverTrigger_unstable = usePopoverTrigger_unstable;
|
96
84
|
//# sourceMappingURL=usePopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"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","names":["usePopoverTrigger_unstable","props","children","disableButtonEnhancement","child","react_utilities_1","open","popoverContext_1","context","setOpen","toggleOpen","triggerRef","openOnHover","openOnContext","triggerAttributes","react_tabster_1","onContextMenu","e","preventDefault","onClick","onKeyDown","key","keyboard_keys_1","stopPropagation","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","react_aria_1","type","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/usePopoverTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n mergeCallbacks,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render PopoverTrigger.\n *\n * The returned state can be modified with hooks such as usePopoverTriggerStyles,\n * before being passed to renderPopoverTrigger_unstable.\n *\n * @param props - props from this instance of PopoverTrigger\n */\nexport const usePopoverTrigger_unstable = (props: PopoverTriggerProps): PopoverTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const child = getTriggerChild(children);\n\n const open = usePopoverContext_unstable(context => context.open);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const toggleOpen = usePopoverContext_unstable(context => context.toggleOpen);\n const triggerRef = usePopoverContext_unstable(context => context.triggerRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const openOnContext = usePopoverContext_unstable(context => context.openOnContext);\n const { triggerAttributes } = useModalAttributes();\n\n const onContextMenu = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, true);\n }\n };\n\n const onClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n toggleOpen(e);\n }\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === Escape && open) {\n setOpen(e, false);\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: Dialog, Menu\n e.stopPropagation();\n }\n };\n\n const onMouseEnter = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n };\n\n const contextMenuProps = {\n ...triggerAttributes,\n 'aria-expanded': `${open}`,\n ...child?.props,\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n ref: useMergedRefs(triggerRef, child?.ref),\n } as const;\n\n const triggerChildProps = {\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n children: applyTriggerPropsToChildren(\n props.children,\n useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n ),\n };\n};\n"]}
|
package/lib-commonjs/index.js
CHANGED
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.usePopoverTrigger_unstable = exports.renderPopoverTrigger_unstable = exports.PopoverTrigger = exports.usePopoverContext_unstable = exports.PopoverProvider = exports.usePopoverSurface_unstable = exports.usePopoverSurfaceStyles_unstable = exports.renderPopoverSurface_unstable = exports.popoverSurfaceClassNames = exports.arrowHeights = exports.PopoverSurface = exports.usePopover_unstable = exports.renderPopover_unstable = exports.Popover = void 0;
|
7
|
-
|
8
7
|
var Popover_1 = /*#__PURE__*/require("./Popover");
|
9
|
-
|
10
8
|
Object.defineProperty(exports, "Popover", {
|
11
9
|
enumerable: true,
|
12
10
|
get: function () {
|
@@ -25,9 +23,7 @@ Object.defineProperty(exports, "usePopover_unstable", {
|
|
25
23
|
return Popover_1.usePopover_unstable;
|
26
24
|
}
|
27
25
|
});
|
28
|
-
|
29
26
|
var PopoverSurface_1 = /*#__PURE__*/require("./PopoverSurface");
|
30
|
-
|
31
27
|
Object.defineProperty(exports, "PopoverSurface", {
|
32
28
|
enumerable: true,
|
33
29
|
get: function () {
|
@@ -64,9 +60,7 @@ Object.defineProperty(exports, "usePopoverSurface_unstable", {
|
|
64
60
|
return PopoverSurface_1.usePopoverSurface_unstable;
|
65
61
|
}
|
66
62
|
});
|
67
|
-
|
68
63
|
var popoverContext_1 = /*#__PURE__*/require("./popoverContext");
|
69
|
-
|
70
64
|
Object.defineProperty(exports, "PopoverProvider", {
|
71
65
|
enumerable: true,
|
72
66
|
get: function () {
|
@@ -79,9 +73,7 @@ Object.defineProperty(exports, "usePopoverContext_unstable", {
|
|
79
73
|
return popoverContext_1.usePopoverContext_unstable;
|
80
74
|
}
|
81
75
|
});
|
82
|
-
|
83
76
|
var PopoverTrigger_1 = /*#__PURE__*/require("./PopoverTrigger");
|
84
|
-
|
85
77
|
Object.defineProperty(exports, "PopoverTrigger", {
|
86
78
|
enumerable: true,
|
87
79
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,wBAAO;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,uCAAsB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,oCAAmB;EAAA;AAAA;AAE7D;AACEF;EAAAC;EAAAC;IAAA,sCAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,oCAAY;EAAA;AAAA;AACZF;EAAAC;EAAAC;IAAA,gDAAwB;EAAA;AAAA;AACxBF;EAAAC;EAAAC;IAAA,qDAA6B;EAAA;AAAA;AAC7BF;EAAAC;EAAAC;IAAA,wDAAgC;EAAA;AAAA;AAChCF;EAAAC;EAAAC;IAAA,kDAA0B;EAAA;AAAA;AAG5B;AAASF;EAAAC;EAAAC;IAAA,uCAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kDAA0B;EAAA;AAAA;AAEpD;AAASF;EAAAC;EAAAC;IAAA,sCAAc;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,qDAA6B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kDAA0B;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/index.ts"],"sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverProvider, usePopoverContext_unstable } from './popoverContext';\nexport type { PopoverContextValue } from './popoverContext';\nexport { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger';\n"]}
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.usePopoverContext_unstable = exports.PopoverProvider = exports.PopoverContext = void 0;
|
7
|
-
|
8
7
|
const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
9
|
-
|
10
8
|
exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext(undefined);
|
11
9
|
const popoverContextDefaultValue = {
|
12
10
|
open: false,
|
@@ -28,8 +26,6 @@ const popoverContextDefaultValue = {
|
|
28
26
|
inline: false
|
29
27
|
};
|
30
28
|
exports.PopoverProvider = exports.PopoverContext.Provider;
|
31
|
-
|
32
29
|
const usePopoverContext_unstable = selector => react_context_selector_1.useContextSelector(exports.PopoverContext, (ctx = popoverContextDefaultValue) => selector(ctx));
|
33
|
-
|
34
30
|
exports.usePopoverContext_unstable = usePopoverContext_unstable;
|
35
31
|
//# sourceMappingURL=popoverContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAIaA,sBAAc,gBAAiCC,sCAAa,CACvEC,SAAS,CACsB;AACjC,MAAMC,0BAA0B,GAAwB;EACtDC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAE,MAAM,IAAI;EACnBC,UAAU,EAAE,MAAM,IAAI;EACtBC,UAAU,EAAE;IAAEC,OAAO,EAAE;EAAI,CAAE;EAC7BC,UAAU,EAAE;IAAED,OAAO,EAAE;EAAI,CAAE;EAC7BE,QAAQ,EAAE;IAAEF,OAAO,EAAE;EAAI,CAAE;EAC3BG,aAAa,EAAE,KAAK;EACpBC,WAAW,EAAE,KAAK;EAClBC,IAAI,EAAE,QAAiB;EACvBC,SAAS,EAAE,KAAK;EAChBC,MAAM,EAAE;CACT;AAEYf,uBAAe,GAAGA,sBAAc,CAACgB,QAAQ;AAwB/C,MAAMC,0BAA0B,GAAOC,QAAiD,IAC7FjB,2CAAkB,CAACD,sBAAc,EAAE,CAACmB,GAAG,GAAGhB,0BAA0B,KAAKe,QAAQ,CAACC,GAAG,CAAC,CAAC;AAD5EnB,kCAA0B","names":["exports","react_context_selector_1","undefined","popoverContextDefaultValue","open","setOpen","toggleOpen","triggerRef","current","contentRef","arrowRef","openOnContext","openOnHover","size","trapFocus","inline","Provider","usePopoverContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/popoverContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { PopoverState } from './components/Popover/index';\n\nexport const PopoverContext: Context<PopoverContextValue> = createContext<PopoverContextValue | undefined>(\n undefined,\n) as Context<PopoverContextValue>;\nconst popoverContextDefaultValue: PopoverContextValue = {\n open: false,\n setOpen: () => null,\n toggleOpen: () => null,\n triggerRef: { current: null },\n contentRef: { current: null },\n arrowRef: { current: null },\n openOnContext: false,\n openOnHover: false,\n size: 'medium' as const,\n trapFocus: false,\n inline: false,\n};\n\nexport const PopoverProvider = PopoverContext.Provider;\n\n/**\n * Context shared between Popover and its children components\n */\nexport type PopoverContextValue = Pick<\n PopoverState,\n | 'open'\n | 'toggleOpen'\n | 'setOpen'\n | 'triggerRef'\n | 'contentRef'\n | 'openOnHover'\n | 'openOnContext'\n | 'mountNode'\n | 'withArrow'\n | 'arrowRef'\n | 'size'\n | 'appearance'\n | 'trapFocus'\n | 'legacyTrapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, (ctx = popoverContextDefaultValue) => selector(ctx));\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.3.
|
3
|
+
"version": "9.3.6",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -29,20 +29,20 @@
|
|
29
29
|
"devDependencies": {
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
31
31
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
33
|
-
"@fluentui/scripts": "
|
32
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.19",
|
33
|
+
"@fluentui/scripts": "*"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
36
|
"@fluentui/keyboard-keys": "^9.0.1",
|
37
|
-
"@fluentui/react-aria": "^9.3.
|
38
|
-
"@fluentui/react-context-selector": "^9.1.
|
39
|
-
"@fluentui/react-portal": "^9.0.
|
40
|
-
"@fluentui/react-positioning": "^9.3.
|
41
|
-
"@fluentui/react-shared-contexts": "^9.1.
|
42
|
-
"@fluentui/react-tabster": "^9.3.
|
43
|
-
"@fluentui/react-theme": "^9.1.
|
44
|
-
"@fluentui/react-utilities": "^9.3.
|
45
|
-
"@griffel/react": "^1.
|
37
|
+
"@fluentui/react-aria": "^9.3.4",
|
38
|
+
"@fluentui/react-context-selector": "^9.1.4",
|
39
|
+
"@fluentui/react-portal": "^9.0.15",
|
40
|
+
"@fluentui/react-positioning": "^9.3.6",
|
41
|
+
"@fluentui/react-shared-contexts": "^9.1.4",
|
42
|
+
"@fluentui/react-tabster": "^9.3.5",
|
43
|
+
"@fluentui/react-theme": "^9.1.5",
|
44
|
+
"@fluentui/react-utilities": "^9.3.1",
|
45
|
+
"@griffel/react": "^1.5.2",
|
46
46
|
"tslib": "^2.1.0"
|
47
47
|
},
|
48
48
|
"peerDependencies": {
|