@fluentui/react-popover 9.5.4 → 9.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +115 -1
  3. package/CHANGELOG.md +34 -2
  4. package/lib/Popover.js.map +1 -1
  5. package/lib/PopoverSurface.js.map +1 -1
  6. package/lib/PopoverTrigger.js.map +1 -1
  7. package/lib/components/Popover/Popover.js +1 -0
  8. package/lib/components/Popover/Popover.js.map +1 -1
  9. package/lib/components/Popover/Popover.types.js +1 -1
  10. package/lib/components/Popover/Popover.types.js.map +1 -1
  11. package/lib/components/Popover/constants.js +1 -2
  12. package/lib/components/Popover/constants.js.map +1 -1
  13. package/lib/components/Popover/index.js.map +1 -1
  14. package/lib/components/Popover/renderPopover.js.map +1 -1
  15. package/lib/components/Popover/usePopover.js +8 -8
  16. package/lib/components/Popover/usePopover.js.map +1 -1
  17. package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
  18. package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  19. package/lib/components/PopoverSurface/index.js.map +1 -1
  20. package/lib/components/PopoverSurface/renderPopoverSurface.js +1 -3
  21. package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  22. package/lib/components/PopoverSurface/usePopoverSurface.js +3 -2
  23. package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  24. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  25. package/lib/components/PopoverTrigger/PopoverTrigger.js +1 -0
  26. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  27. package/lib/components/PopoverTrigger/PopoverTrigger.types.js +1 -1
  28. package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  29. package/lib/components/PopoverTrigger/index.js.map +1 -1
  30. package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -2
  31. package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  32. package/lib/components/PopoverTrigger/usePopoverTrigger.js +1 -0
  33. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/popoverContext.js.map +1 -1
  36. package/lib-commonjs/Popover.js +5 -4
  37. package/lib-commonjs/Popover.js.map +1 -1
  38. package/lib-commonjs/PopoverSurface.js +5 -4
  39. package/lib-commonjs/PopoverSurface.js.map +1 -1
  40. package/lib-commonjs/PopoverTrigger.js +5 -4
  41. package/lib-commonjs/PopoverTrigger.js.map +1 -1
  42. package/lib-commonjs/components/Popover/Popover.js +14 -13
  43. package/lib-commonjs/components/Popover/Popover.js.map +1 -1
  44. package/lib-commonjs/components/Popover/Popover.types.js +5 -2
  45. package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
  46. package/lib-commonjs/components/Popover/constants.js +10 -8
  47. package/lib-commonjs/components/Popover/constants.js.map +1 -1
  48. package/lib-commonjs/components/Popover/index.js +8 -7
  49. package/lib-commonjs/components/Popover/index.js.map +1 -1
  50. package/lib-commonjs/components/Popover/renderPopover.js +31 -47
  51. package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
  52. package/lib-commonjs/components/Popover/usePopover.js +179 -173
  53. package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
  54. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +19 -20
  55. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
  56. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +3 -2
  57. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  58. package/lib-commonjs/components/PopoverSurface/index.js +9 -8
  59. package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
  60. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +23 -28
  61. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  62. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +70 -81
  63. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  64. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +243 -113
  65. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  66. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +15 -14
  67. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  68. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +5 -2
  69. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  70. package/lib-commonjs/components/PopoverTrigger/index.js +8 -7
  71. package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
  72. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +12 -11
  73. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  74. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +71 -80
  75. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  76. package/lib-commonjs/index.js +30 -92
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/lib-commonjs/popoverContext.js +34 -25
  79. package/lib-commonjs/popoverContext.js.map +1 -1
  80. package/package.json +14 -13
  81. package/lib-amd/Popover.js +0 -6
  82. package/lib-amd/Popover.js.map +0 -1
  83. package/lib-amd/PopoverSurface.js +0 -6
  84. package/lib-amd/PopoverSurface.js.map +0 -1
  85. package/lib-amd/PopoverTrigger.js +0 -6
  86. package/lib-amd/PopoverTrigger.js.map +0 -1
  87. package/lib-amd/components/Popover/Popover.js +0 -15
  88. package/lib-amd/components/Popover/Popover.js.map +0 -1
  89. package/lib-amd/components/Popover/Popover.types.js +0 -5
  90. package/lib-amd/components/Popover/Popover.types.js.map +0 -1
  91. package/lib-amd/components/Popover/constants.js +0 -15
  92. package/lib-amd/components/Popover/constants.js.map +0 -1
  93. package/lib-amd/components/Popover/index.js +0 -9
  94. package/lib-amd/components/Popover/index.js.map +0 -1
  95. package/lib-amd/components/Popover/renderPopover.js +0 -32
  96. package/lib-amd/components/Popover/renderPopover.js.map +0 -1
  97. package/lib-amd/components/Popover/usePopover.js +0 -147
  98. package/lib-amd/components/Popover/usePopover.js.map +0 -1
  99. package/lib-amd/components/PopoverSurface/PopoverSurface.js +0 -17
  100. package/lib-amd/components/PopoverSurface/PopoverSurface.js.map +0 -1
  101. package/lib-amd/components/PopoverSurface/PopoverSurface.types.js +0 -5
  102. package/lib-amd/components/PopoverSurface/PopoverSurface.types.js.map +0 -1
  103. package/lib-amd/components/PopoverSurface/index.js +0 -10
  104. package/lib-amd/components/PopoverSurface/index.js.map +0 -1
  105. package/lib-amd/components/PopoverSurface/renderPopoverSurface.js +0 -20
  106. package/lib-amd/components/PopoverSurface/renderPopoverSurface.js.map +0 -1
  107. package/lib-amd/components/PopoverSurface/usePopoverSurface.js +0 -69
  108. package/lib-amd/components/PopoverSurface/usePopoverSurface.js.map +0 -1
  109. package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js +0 -44
  110. package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
  111. package/lib-amd/components/PopoverTrigger/PopoverTrigger.js +0 -17
  112. package/lib-amd/components/PopoverTrigger/PopoverTrigger.js.map +0 -1
  113. package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js +0 -5
  114. package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js.map +0 -1
  115. package/lib-amd/components/PopoverTrigger/index.js +0 -9
  116. package/lib-amd/components/PopoverTrigger/index.js.map +0 -1
  117. package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js +0 -13
  118. package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js.map +0 -1
  119. package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js +0 -61
  120. package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js.map +0 -1
  121. package/lib-amd/index.js +0 -20
  122. package/lib-amd/index.js.map +0 -1
  123. package/lib-amd/popoverContext.js +0 -28
  124. package/lib-amd/popoverContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["shorthands","__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["../src/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"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ,6BAA6B;AACxF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAKhE,OAAO,MAAMC,wBAAwB,GAAwC;EAC3EC,IAAI,EAAE;CACP;AAED,OAAO,MAAMC,YAAY,GAAgC;EACvDC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;CACR;AAED;;;AAGA,MAAMC,SAA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AM,GAAGnE,SAAS,EAAE;EAC1BkE,KAAK,CAACvE,IAAI,CAACyE,SAAS,GAAG/E,YAAY,CACjCK,wBAAwB,CAACC,IAAI,EAC7BwE,MAAM,CAACxE,IAAI,EACXuE,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAACzC,YAAY,EAC7CwC,KAAK,CAACG,IAAI,KAAK,QAAQ,IAAIF,MAAM,CAACpC,aAAa,EAC/CmC,KAAK,CAACG,IAAI,KAAK,OAAO,IAAIF,MAAM,CAACnC,YAAY,EAC7CkC,KAAK,CAACI,UAAU,KAAK,UAAU,IAAIH,MAAM,CAAC3C,QAAQ,EAClD0C,KAAK,CAACI,UAAU,KAAK,OAAO,IAAIH,MAAM,CAAC1C,KAAK,EAC5CyC,KAAK,CAACvE,IAAI,CAACyE,SAAS,CACrB;EAEDF,KAAK,CAACK,cAAc,GAAGlF,YAAY,CACjC8E,MAAM,CAAC9B,KAAK,EACZ6B,KAAK,CAACG,IAAI,KAAK,OAAO,GAAGF,MAAM,CAAClC,UAAU,GAAGkC,MAAM,CAAC/B,gBAAgB,CACrE;EAED,OAAO8B,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["shorthands","__styles","mergeClasses","createArrowHeightStyles","createArrowStyles","tokens","typographyStyles","popoverSurfaceClassNames","root","arrowHeights","small","medium","large","useStyles","sj55zd","De3pzq","E5pizo","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","inverted","brand","smallPadding","z8tnut","z189sj","Byoj8tv","uwmqm3","mediumPadding","largePadding","smallArrow","a9b677","Bqenvij","mediumLargeArrow","arrow","qhf8xq","Bcdw1i0","Bj3rh1h","Ftih45","B1puzpu","Brfgrao","Bcvre1j","Ccq8qp","Baz25je","cmx5o7","B4f6apu","m598lv","Bk5zm6e","y0oebl","qa3bma","Bqjgrrk","Budzafs","Hv9wc6","hl6cv3","Bh2vraf","yayu3t","wedwtw","rhl9o9","Bu8t5uz","B6q6orb","Bwwlvwl","d","usePopoverSurfaceStyles_unstable","state","styles","className","size","appearance","arrowClassName"],"sources":["../../../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"],"mappings":"AAAA,SAASA,UAAU,EAAAC,QAAA,EAAcC,YAAY,QAAQ;AACrD,SAASC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAC3D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAKzC,OAAO,MAAMC,wBAAA,GAAgE;EAC3EC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,YAAA,GAA4C;EACvDC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,KAAA,EAAO;AACT;AAEA;;;AAGA,MAAMC,SAAA,gBAAYZ,QAAA;EAAAO,IAAA;IAAAM,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAtB,MAAA;IAAAD,MAAA;EAAA;EAAAwB,KAAA;IAAAvB,MAAA;IAAAD,MAAA;EAAA;EAAAyB,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,aAAA;IAAAJ,MAAA;IAAAC,MAAA;IAAAC,OAAA;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AAA,CAAMG,IAAI,KAAK,UAAUF,MAAA,CAAOlC,UAAU,GAAGkC,MAAA,CAAO/B,gBAAgB;EAGtE,OAAO8B,KAAA;AACT"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { usePopoverTrigger_unstable } from './usePopoverTrigger';
2
3
  import { renderPopoverTrigger_unstable } from './renderPopoverTrigger';
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["usePopoverTrigger_unstable","renderPopoverTrigger_unstable","PopoverTrigger","props","state","displayName","isFluentTriggerComponent"],"sources":["../src/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"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AAItE;;;AAGA,OAAO,MAAMC,cAAc,GAAkCC,KAAK,IAAG;EACnE,MAAMC,KAAK,GAAGJ,0BAA0B,CAACG,KAAK,CAAC;EAE/C,OAAOF,6BAA6B,CAACG,KAAK,CAAC;AAC7C,CAAC;AAEDF,cAAc,CAACG,WAAW,GAAG,gBAAgB;AAC7C;AACCH,cAAyC,CAACI,wBAAwB,GAAG,IAAI"}
1
+ {"version":3,"names":["React","usePopoverTrigger_unstable","renderPopoverTrigger_unstable","PopoverTrigger","props","state","displayName","isFluentTriggerComponent"],"sources":["../../../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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAI9C;;;AAGA,OAAO,MAAMC,cAAA,GAAgDC,KAAA,IAAS;EACpE,MAAMC,KAAA,GAAQJ,0BAAA,CAA2BG,KAAA;EAEzC,OAAOF,6BAAA,CAA8BG,KAAA;AACvC;AAEAF,cAAA,CAAeG,WAAW,GAAG;AAC7B;AACCH,cAAA,CAA0CI,wBAAwB,GAAG,IAAI"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ import * as React from 'react';
2
2
  //# sourceMappingURL=PopoverTrigger.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverTrigger.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/PopoverTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * PopoverTrigger State\n */\nexport type PopoverTriggerState = {\n children: React.ReactElement | null;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-expanded'?: 'true' | 'false';\n ref: React.Ref<unknown>;\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n }\n>;\n"]}
1
+ {"version":3,"names":["React"],"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * PopoverTrigger State\n */\nexport type PopoverTriggerState = {\n children: React.ReactElement | null;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-expanded'?: 'true' | 'false';\n ref: React.Ref<unknown>;\n onMouseEnter: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onMouseLeave: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n onContextMenu: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;\n }\n>;\n"],"mappings":"AAEA,YAAYA,KAAA,MAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-popover/src/components/PopoverTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"]}
1
+ {"version":3,"names":[],"sources":["../../../src/components/PopoverTrigger/index.ts"],"sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Render the final JSX of PopoverTrigger
3
- */
4
- export const renderPopoverTrigger_unstable = state => {
3
+ */export const renderPopoverTrigger_unstable = state => {
5
4
  return state.children;
6
5
  };
7
6
  //# sourceMappingURL=renderPopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["renderPopoverTrigger_unstable","state","children"],"sources":["../src/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"],"mappings":"AAEA;;;AAGA,OAAO,MAAMA,6BAA6B,GAAIC,KAA0B,IAAI;EAC1E,OAAOA,KAAK,CAACC,QAAQ;AACvB,CAAC"}
1
+ {"version":3,"names":["renderPopoverTrigger_unstable","state","children"],"sources":["../../../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"],"mappings":"AAEA;;GAGA,OAAO,MAAMA,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,OAAOA,KAAA,CAAMC,QAAQ;AACvB"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { applyTriggerPropsToChildren, getTriggerChild, mergeCallbacks, useMergedRefs, useEventCallback } from '@fluentui/react-utilities';
2
3
  import { useModalAttributes } from '@fluentui/react-tabster';
3
4
  import { usePopoverContext_unstable } from '../../popoverContext';
@@ -1 +1 @@
1
- {"version":3,"names":["applyTriggerPropsToChildren","getTriggerChild","mergeCallbacks","useMergedRefs","useEventCallback","useModalAttributes","usePopoverContext_unstable","useARIAButtonProps","Escape","usePopoverTrigger_unstable","props","children","disableButtonEnhancement","child","open","context","setOpen","toggleOpen","triggerRef","openOnHover","openOnContext","triggerAttributes","onContextMenu","e","preventDefault","onClick","onKeyDown","key","stopPropagation","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"sources":["../src/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"],"mappings":"AACA,SACEA,2BAA2B,EAC3BC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,gBAAgB,QACX,2BAA2B;AAClC,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,0BAA0B,QAAQ,sBAAsB;AAEjE,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,MAAM,QAAQ,yBAAyB;AAEhD;;;;;;;;AAQA,OAAO,MAAMC,0BAA0B,GAAIC,KAA0B,IAAyB;EAC5F,MAAM;IAAEC,QAAQ;IAAEC,wBAAwB,GAAG;EAAK,CAAE,GAAGF,KAAK;EAC5D,MAAMG,KAAK,GAAGZ,eAAe,CAACU,QAAQ,CAAC;EAEvC,MAAMG,IAAI,GAAGR,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACD,IAAI,CAAC;EAChE,MAAME,OAAO,GAAGV,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACC,OAAO,CAAC;EACtE,MAAMC,UAAU,GAAGX,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACE,UAAU,CAAC;EAC5E,MAAMC,UAAU,GAAGZ,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACG,UAAU,CAAC;EAC5E,MAAMC,WAAW,GAAGb,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACI,WAAW,CAAC;EAC9E,MAAMC,aAAa,GAAGd,0BAA0B,CAACS,OAAO,IAAIA,OAAO,CAACK,aAAa,CAAC;EAClF,MAAM;IAAEC;EAAiB,CAAE,GAAGhB,kBAAkB,EAAE;EAElD,MAAMiB,aAAa,GAAIC,CAAgC,IAAI;IACzD,IAAIH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UAAU,EAAEL,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEmB,GAAG;GACjC;EAEV,MAAMC,iBAAiB,GAAG;IACxB,GAAGF,gBAAgB;IACnBN,OAAO,EAAErB,gBAAgB,CAACF,cAAc,CAACW,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEH,KAAK,CAACe,OAAO,EAAEA,OAAO,CAAC,CAAC;IACxEC,SAAS,EAAEtB,gBAAgB,CAACF,cAAc,CAACW,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEH,KAAK,CAACgB,SAAS,EAAEA,SAAS,CAAC;GAC9E;EAED,MAAMQ,2BAA2B,GAAG3B,kBAAkB,CACpD,CAAAM,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsB,IAAI,MAAK,QAAQ,IAAI,CAAAtB,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsB,IAAI,MAAK,GAAG,GAAGtB,KAAK,CAACsB,IAAI,GAAG,KAAK,EACpEF,iBAAiB,CAClB;EAED,OAAO;IACLtB,QAAQ,EAAEX,2BAA2B,CACnCU,KAAK,CAACC,QAAQ,EACdJ,kBAAkB,CAChB,CAAAM,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsB,IAAI,MAAK,QAAQ,IAAI,CAAAtB,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsB,IAAI,MAAK,GAAG,GAAGtB,KAAK,CAACsB,IAAI,GAAG,KAAK,EACpEf,aAAa,GAAGW,gBAAgB,GAAGnB,wBAAwB,GAAGqB,iBAAiB,GAAGC,2BAA2B,CAC9G;GAEJ;AACH,CAAC"}
1
+ {"version":3,"names":["React","applyTriggerPropsToChildren","getTriggerChild","mergeCallbacks","useMergedRefs","useEventCallback","useModalAttributes","usePopoverContext_unstable","useARIAButtonProps","Escape","usePopoverTrigger_unstable","props","children","disableButtonEnhancement","child","open","context","setOpen","toggleOpen","triggerRef","openOnHover","openOnContext","triggerAttributes","onContextMenu","e","preventDefault","onClick","onKeyDown","key","stopPropagation","onMouseEnter","onMouseLeave","contextMenuProps","ref","triggerChildProps","ariaButtonTriggerChildProps","type"],"sources":["../../../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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,2BAA2B,EAC3BC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAE3C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,MAAM,QAAQ;AAEvB;;;;;;;;AAQA,OAAO,MAAMC,0BAAA,GAA8BC,KAAA,IAAoD;EAC7F,MAAM;IAAEC,QAAA;IAAUC,wBAAA,GAA2B;EAAK,CAAE,GAAGF,KAAA;EACvD,MAAMG,KAAA,GAAQZ,eAAA,CAAgBU,QAAA;EAE9B,MAAMG,IAAA,GAAOR,0BAAA,CAA2BS,OAAA,IAAWA,OAAA,CA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AAI,MAAK,MAAMtB,KAAA,CAAMsB,IAAI,GAAG,KAAK,EACpEf,aAAA,GAAgBW,gBAAA,GAAmBnB,wBAAA,GAA2BqB,iBAAA,GAAoBC,2BAA2B;EAGnH;AACF"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Popover","renderPopover_unstable","usePopover_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"sources":["../src/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"],"mappings":"AAAA,SAASA,OAAO,EAAEC,sBAAsB,EAAEC,mBAAmB,QAAQ,WAAW;AAEhF,SACEC,cAAc,EACdC,YAAY,EACZC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,kBAAkB;AAEzB,SAASC,eAAe,EAAEC,0BAA0B,QAAQ,kBAAkB;AAE9E,SAASC,cAAc,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ,kBAAkB"}
1
+ {"version":3,"names":["Popover","renderPopover_unstable","usePopover_unstable","PopoverSurface","arrowHeights","popoverSurfaceClassNames","renderPopoverSurface_unstable","usePopoverSurfaceStyles_unstable","usePopoverSurface_unstable","PopoverProvider","usePopoverContext_unstable","PopoverTrigger","renderPopoverTrigger_unstable","usePopoverTrigger_unstable"],"sources":["../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"],"mappings":"AAAA,SAASA,OAAO,EAAEC,sBAAsB,EAAEC,mBAAmB,QAAQ;AAErE,SACEC,cAAc,EACdC,YAAY,EACZC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB;AAEP,SAASC,eAAe,EAAEC,0BAA0B,QAAQ;AAE5D,SAASC,cAAc,EAAEC,6BAA6B,EAAEC,0BAA0B,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContextSelector","PopoverContext","undefined","popoverContextDefaultValue","open","setOpen","toggleOpen","triggerRef","current","contentRef","arrowRef","openOnContext","openOnHover","size","trapFocus","inline","PopoverProvider","Provider","usePopoverContext_unstable","selector","ctx"],"sources":["../src/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 | 'inertTrapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, (ctx = popoverContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,kCAAkC;AAIpF,OAAO,MAAMC,cAAc,gBAAiCF,aAAa,CACvEG,SAAS,CACsB;AACjC,MAAMC,0BAA0B,GAAwB;EACtDC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAEA,CAAA,KAAM,IAAI;EACnBC,UAAU,EAAEA,CAAA,KAAM,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;AAED,OAAO,MAAMC,eAAe,GAAGf,cAAc,CAACgB,QAAQ;AAwBtD,OAAO,MAAMC,0BAA0B,GAAOC,QAAiD,IAC7FnB,kBAAkB,CAACC,cAAc,EAAE,CAACmB,GAAG,GAAGjB,0BAA0B,KAAKgB,QAAQ,CAACC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"names":["createContext","useContextSelector","PopoverContext","undefined","popoverContextDefaultValue","open","setOpen","toggleOpen","triggerRef","current","contentRef","arrowRef","openOnContext","openOnHover","size","trapFocus","inline","PopoverProvider","Provider","usePopoverContext_unstable","selector","ctx"],"sources":["../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 | 'inertTrapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, (ctx = popoverContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ;AAIlD,OAAO,MAAMC,cAAA,gBAA+CF,aAAA,CAC1DG,SAAA;AAEF,MAAMC,0BAAA,GAAkD;EACtDC,IAAA,EAAM,KAAK;EACXC,OAAA,EAASA,CAAA,KAAM,IAAI;EACnBC,UAAA,EAAYA,CAAA,KAAM,IAAI;EACtBC,UAAA,EAAY;IAAEC,OAAA,EAAS;EAAK;EAC5BC,UAAA,EAAY;IAAED,OAAA,EAAS;EAAK;EAC5BE,QAAA,EAAU;IAAEF,OAAA,EAAS;EAAK;EAC1BG,aAAA,EAAe,KAAK;EACpBC,WAAA,EAAa,KAAK;EAClBC,IAAA,EAAM;EACNC,SAAA,EAAW,KAAK;EAChBC,MAAA,EAAQ;AACV;AAEA,OAAO,MAAMC,eAAA,GAAkBf,cAAA,CAAegB,QAAQ;AAwBtD,OAAO,MAAMC,0BAAA,GAAiCC,QAAA,IAC5CnB,kBAAA,CAAmBC,cAAA,EAAgB,CAACmB,GAAA,GAAMjB,0BAA0B,KAAKgB,QAAA,CAASC,GAAA"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Popover/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Popover/index"), exports);
7
+ //# sourceMappingURL=Popover.js.map
8
+
8
9
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-popover/src/Popover.ts"],"sourcesContent":["export * from './components/Popover/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,gCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Popover.js"],"sourcesContent":["export * from './components/Popover/index';\n//# sourceMappingURL=Popover.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,mCAAmC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/PopoverSurface/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/PopoverSurface/index"), exports);
7
+ //# sourceMappingURL=PopoverSurface.js.map
8
+
8
9
  //# sourceMappingURL=PopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-popover/src/PopoverSurface.ts"],"sourcesContent":["export * from './components/PopoverSurface/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,uCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/PopoverSurface.js"],"sourcesContent":["export * from './components/PopoverSurface/index';\n//# sourceMappingURL=PopoverSurface.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,0CAA0C"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/PopoverTrigger/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/PopoverTrigger/index"), exports);
7
+ //# sourceMappingURL=PopoverTrigger.js.map
8
+
8
9
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-popover/src/PopoverTrigger.ts"],"sourcesContent":["export * from './components/PopoverTrigger/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,uCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/PopoverTrigger.js"],"sourcesContent":["export * from './components/PopoverTrigger/index';\n//# sourceMappingURL=PopoverTrigger.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,0CAA0C"}
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Popover", {
6
+ enumerable: true,
7
+ get: ()=>Popover
5
8
  });
6
- exports.Popover = void 0;
7
- const usePopover_1 = /*#__PURE__*/require("./usePopover");
8
- const renderPopover_1 = /*#__PURE__*/require("./renderPopover");
9
- /**
10
- * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
11
- */
12
- const Popover = props => {
13
- const state = usePopover_1.usePopover_unstable(props);
14
- return renderPopover_1.renderPopover_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _usePopover = require("./usePopover");
12
+ const _renderPopover = require("./renderPopover");
13
+ const Popover = (props)=>{
14
+ const state = (0, _usePopover.usePopover_unstable)(props);
15
+ return (0, _renderPopover.renderPopover_unstable)(state);
15
16
  };
16
- exports.Popover = Popover;
17
- exports.Popover.displayName = 'Popover';
17
+ Popover.displayName = 'Popover'; //# sourceMappingURL=Popover.js.map
18
+
18
19
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["usePopover_1","require","renderPopover_1","Popover","props","state","usePopover_unstable","renderPopover_unstable","exports","displayName"],"sources":["../src/packages/react-components/react-popover/src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { renderPopover_unstable } from './renderPopover';\nimport type { PopoverProps } from './Popover.types';\n\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n const state = usePopover_unstable(props);\n\n return renderPopover_unstable(state);\n};\n\nPopover.displayName = 'Popover';\n"],"mappings":";;;;;;AACA,MAAAA,YAAA,gBAAAC,OAAA;AACA,MAAAC,eAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,OAAO,GAA2BC,KAAK,IAAG;EACrD,MAAMC,KAAK,GAAGL,YAAA,CAAAM,mBAAmB,CAACF,KAAK,CAAC;EAExC,OAAOF,eAAA,CAAAK,sBAAsB,CAACF,KAAK,CAAC;AACtC,CAAC;AAJYG,OAAA,CAAAL,OAAO,GAAAA,OAAA;AAMpBK,OAAA,CAAAL,OAAO,CAACM,WAAW,GAAG,SAAS"}
1
+ {"version":3,"sources":["../../../lib/components/Popover/Popover.js"],"sourcesContent":["import * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { renderPopover_unstable } from './renderPopover';\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover = props => {\n const state = usePopover_unstable(props);\n return renderPopover_unstable(state);\n};\nPopover.displayName = 'Popover';\n//# sourceMappingURL=Popover.js.map"],"names":["Popover","props","state","usePopover_unstable","renderPopover_unstable","displayName"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;4BACa;+BACG;AAIhC,MAAMA,UAAUC,CAAAA,QAAS;IAC9B,MAAMC,QAAQC,IAAAA,+BAAmB,EAACF;IAClC,OAAOG,IAAAA,qCAAsB,EAACF;AAChC;AACAF,QAAQK,WAAW,GAAG,WACtB,mCAAmC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=Popover.types.js.map
8
+
6
9
  //# sourceMappingURL=Popover.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-popover/src/components/Popover/Popover.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n PositioningVirtualElement,\n PositioningShorthand,\n SetVirtualMouseTarget,\n} from '@fluentui/react-positioning';\nimport type { PortalProps } from '@fluentui/react-portal';\n\n/**\n * Determines popover padding and arrow size\n */\nexport type PopoverSize = 'small' | 'medium' | 'large';\n\n/**\n * Popover Props\n */\nexport type PopoverProps = Pick<PortalProps, 'mountNode'> & {\n /**\n * A popover can appear styled with brand or inverted.\n * When not specified, the default style is used.\n */\n appearance?: 'brand' | 'inverted';\n\n /**\n * Can contain two children including {@link PopoverTrigger} and {@link PopoverSurface}.\n * Alternatively can only contain {@link PopoverSurface} if using a custom `target`.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n\n /**\n * Close when scroll outside of it\n *\n * @default false\n */\n closeOnScroll?: boolean;\n\n /**\n * Used to set the initial open state of the Popover in uncontrolled mode\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Popovers are rendered out of DOM order on `document.body` by default, use this to render the popover in DOM order\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Sets the delay for closing popover on mouse leave\n */\n mouseLeaveDelay?: number;\n\n /**\n * Display an arrow pointing to the target.\n *\n * @default false\n */\n withArrow?: boolean;\n\n /**\n * Call back when the component requests to change value\n * The `open` value is used as a hint when directly controlling the component\n */\n onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;\n\n /**\n * Controls the opening of the Popover\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Flag to open the Popover as a context menu. Disables all other interactions\n *\n * @default false\n */\n openOnContext?: boolean;\n\n /**\n * Flag to open the Popover by hovering the trigger\n *\n * @default false\n */\n openOnHover?: boolean;\n\n /**\n * Configures the position of the Popover\n */\n positioning?: PositioningShorthand;\n\n /**\n * Determines popover padding and arrow size\n *\n * @default medium\n */\n size?: PopoverSize;\n\n /**\n * Should trap focus\n *\n * @default false\n */\n trapFocus?: boolean;\n\n /**\n * Must be used with the `trapFocus` prop\n * Enables older Fluent UI focus trap behavior where the user\n * cannot tab into the window outside of the document. This is now\n * non-standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @deprecated this behavior is default provided now, to opt-out of it in favor of standard behavior use the `inertTrapFocus` property\n */\n legacyTrapFocus?: boolean;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert,\n * making navigation leak from the trapped area back to the browser toolbar and vice-versa.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n\n /**\n * By default Popover focuses the first focusable element in PopoverSurface on open.\n * Specify `disableAutoFocus` to prevent this behavior.\n *\n * @default false\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableAutoFocus?: boolean;\n};\n\n/**\n * Popover State\n */\nexport type PopoverState = Pick<\n PopoverProps,\n | 'appearance'\n | 'mountNode'\n | 'onOpenChange'\n | 'openOnContext'\n | 'openOnHover'\n | 'trapFocus'\n | 'withArrow'\n | 'inertTrapFocus'\n> &\n Required<Pick<PopoverProps, 'inline' | 'open'>> &\n Pick<PopoverProps, 'children'> & {\n /**\n * Ref of the pointing arrow\n */\n arrowRef: React.MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Ref of the PopoverSurface\n */\n contentRef: React.MutableRefObject<HTMLElement | null>;\n\n /**\n * Anchors the popper to the mouse click for context events\n */\n contextTarget: PositioningVirtualElement | undefined;\n\n popoverSurface: React.ReactElement | undefined;\n\n popoverTrigger: React.ReactElement | undefined;\n\n /**\n * A callback to set the target of the popper to the mouse click for context events\n */\n setContextTarget: SetVirtualMouseTarget;\n\n /**\n * Callback to open/close the Popover\n */\n setOpen: (e: OpenPopoverEvents, open: boolean) => void;\n\n size: NonNullable<PopoverProps['size']>;\n\n /**\n * Callback to toggle the open state of the Popover\n */\n toggleOpen: (e: OpenPopoverEvents) => void;\n\n /**\n * Ref of the PopoverTrigger\n */\n triggerRef: React.MutableRefObject<HTMLElement | null>;\n };\n\n/**\n * Data attached to open/close events\n */\nexport type OnOpenChangeData = { open: boolean };\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type OpenPopoverEvents =\n | MouseEvent\n | TouchEvent\n | React.FocusEvent<HTMLElement>\n | React.KeyboardEvent<HTMLElement>\n | React.MouseEvent<HTMLElement>;\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Popover/Popover.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Popover.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,yCAAyC"}
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.popoverSurfaceBorderRadius = void 0;
7
1
  /**
8
2
  * @internal
9
3
  * The default value of the tooltip's border radius (borderRadiusMedium).
@@ -11,6 +5,14 @@ exports.popoverSurfaceBorderRadius = void 0;
11
5
  * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
12
6
  * While we could use getComputedStyle, that adds a performance penalty for something that
13
7
  * will likely never change.
14
- */
15
- exports.popoverSurfaceBorderRadius = 4;
8
+ */ "use strict";
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: true
11
+ });
12
+ Object.defineProperty(exports, "popoverSurfaceBorderRadius", {
13
+ enumerable: true,
14
+ get: ()=>popoverSurfaceBorderRadius
15
+ });
16
+ const popoverSurfaceBorderRadius = 4; //# sourceMappingURL=constants.js.map
17
+
16
18
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["exports","popoverSurfaceBorderRadius"],"sources":["../src/packages/react-components/react-popover/src/components/Popover/constants.ts"],"sourcesContent":["/**\n * @internal\n * The default value of the tooltip's border radius (borderRadiusMedium).\n *\n * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.\n * While we could use getComputedStyle, that adds a performance penalty for something that\n * will likely never change.\n */\nexport const popoverSurfaceBorderRadius = 4;\n"],"mappings":";;;;;;AAAA;;;;;;;;AAQaA,OAAA,CAAAC,0BAA0B,GAAG,CAAC"}
1
+ {"version":3,"sources":["../../../lib/components/Popover/constants.js"],"sourcesContent":["/**\n * @internal\n * The default value of the tooltip's border radius (borderRadiusMedium).\n *\n * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.\n * While we could use getComputedStyle, that adds a performance penalty for something that\n * will likely never change.\n */export const popoverSurfaceBorderRadius = 4;\n//# sourceMappingURL=constants.js.map"],"names":["popoverSurfaceBorderRadius"],"mappings":"AAAA;;;;;;;CAOC;;;;+BAAeA;;aAAAA;;AAAN,MAAMA,6BAA6B,GAC7C,qCAAqC"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Popover"), exports);
8
- tslib_1.__exportStar(require("./Popover.types"), exports);
9
- tslib_1.__exportStar(require("./renderPopover"), exports);
10
- tslib_1.__exportStar(require("./usePopover"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Popover"), exports);
7
+ _exportStar(require("./Popover.types"), exports);
8
+ _exportStar(require("./renderPopover"), exports);
9
+ _exportStar(require("./usePopover"), exports);
10
+ //# sourceMappingURL=index.js.map
11
+
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-popover/src/components/Popover/index.ts"],"sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,eAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Popover/index.js"],"sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,51 +1,35 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderPopover_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderPopover_unstable
5
8
  });
6
- exports.renderPopover_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
9
- /**
10
- * Render the final JSX of Popover
11
- */
12
- const renderPopover_unstable = state => {
13
- const {
14
- appearance,
15
- arrowRef,
16
- contentRef,
17
- inline,
18
- mountNode,
19
- open,
20
- openOnContext,
21
- openOnHover,
22
- setOpen,
23
- size,
24
- toggleOpen,
25
- trapFocus,
26
- triggerRef,
27
- withArrow,
28
- inertTrapFocus
29
- } = state;
30
- return React.createElement(popoverContext_1.PopoverContext.Provider, {
31
- value: {
32
- appearance,
33
- arrowRef,
34
- contentRef,
35
- inline,
36
- mountNode,
37
- open,
38
- openOnContext,
39
- openOnHover,
40
- setOpen,
41
- toggleOpen,
42
- triggerRef,
43
- size,
44
- trapFocus,
45
- inertTrapFocus,
46
- withArrow
47
- }
48
- }, state.popoverTrigger, state.open && state.popoverSurface);
49
- };
50
- exports.renderPopover_unstable = renderPopover_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _popoverContext = require("../../popoverContext");
12
+ const renderPopover_unstable = (state)=>{
13
+ const { appearance , arrowRef , contentRef , inline , mountNode , open , openOnContext , openOnHover , setOpen , size , toggleOpen , trapFocus , triggerRef , withArrow , inertTrapFocus } = state;
14
+ return /*#__PURE__*/ _react.createElement(_popoverContext.PopoverContext.Provider, {
15
+ value: {
16
+ appearance,
17
+ arrowRef,
18
+ contentRef,
19
+ inline,
20
+ mountNode,
21
+ open,
22
+ openOnContext,
23
+ openOnHover,
24
+ setOpen,
25
+ toggleOpen,
26
+ triggerRef,
27
+ size,
28
+ trapFocus,
29
+ inertTrapFocus,
30
+ withArrow
31
+ }
32
+ }, state.popoverTrigger, state.open && state.popoverSurface);
33
+ }; //# sourceMappingURL=renderPopover.js.map
34
+
51
35
  //# sourceMappingURL=renderPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","popoverContext_1","renderPopover_unstable","state","appearance","arrowRef","contentRef","inline","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","inertTrapFocus","createElement","PopoverContext","Provider","value","popoverTrigger","popoverSurface","exports"],"sources":["../src/packages/react-components/react-popover/src/components/Popover/renderPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PopoverContext } from '../../popoverContext';\nimport type { PopoverState } from './Popover.types';\n\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = (state: PopoverState) => {\n const {\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n inertTrapFocus,\n } = state;\n\n return (\n <PopoverContext.Provider\n value={{\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n toggleOpen,\n triggerRef,\n size,\n trapFocus,\n inertTrapFocus,\n withArrow,\n }}\n >\n {state.popoverTrigger}\n {state.open && state.popoverSurface}\n </PopoverContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,gBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,sBAAsB,GAAIC,KAAmB,IAAI;EAC5D,MAAM;IACJC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,MAAM;IACNC,SAAS;IACTC,IAAI;IACJC,aAAa;IACbC,WAAW;IACXC,OAAO;IACPC,IAAI;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC;EAAc,CACf,GAAGf,KAAK;EAET,OACEJ,KAAA,CAAAoB,aAAA,CAAClB,gBAAA,CAAAmB,cAAc,CAACC,QAAQ;IACtBC,KAAK,EAAE;MACLlB,UAAU;MACVC,QAAQ;MACRC,UAAU;MACVC,MAAM;MACNC,SAAS;MACTC,IAAI;MACJC,aAAa;MACbC,WAAW;MACXC,OAAO;MACPE,UAAU;MACVE,UAAU;MACVH,IAAI;MACJE,SAAS;MACTG,cAAc;MACdD;;EACD,GAEAd,KAAK,CAACoB,cAAc,EACpBpB,KAAK,CAACM,IAAI,IAAIN,KAAK,CAACqB,cAAc,CACX;AAE9B,CAAC;AA3CYC,OAAA,CAAAvB,sBAAsB,GAAAA,sBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Popover/renderPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { PopoverContext } from '../../popoverContext';\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover_unstable = state => {\n const {\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n size,\n toggleOpen,\n trapFocus,\n triggerRef,\n withArrow,\n inertTrapFocus\n } = state;\n return /*#__PURE__*/React.createElement(PopoverContext.Provider, {\n value: {\n appearance,\n arrowRef,\n contentRef,\n inline,\n mountNode,\n open,\n openOnContext,\n openOnHover,\n setOpen,\n toggleOpen,\n triggerRef,\n size,\n trapFocus,\n inertTrapFocus,\n withArrow\n }\n }, state.popoverTrigger, state.open && state.popoverSurface);\n};\n//# sourceMappingURL=renderPopover.js.map"],"names":["renderPopover_unstable","state","appearance","arrowRef","contentRef","inline","mountNode","open","openOnContext","openOnHover","setOpen","size","toggleOpen","trapFocus","triggerRef","withArrow","inertTrapFocus","React","createElement","PopoverContext","Provider","value","popoverTrigger","popoverSurface"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACQ;AAIxB,MAAMA,yBAAyBC,CAAAA,QAAS;IAC7C,MAAM,EACJC,WAAU,EACVC,SAAQ,EACRC,WAAU,EACVC,OAAM,EACNC,UAAS,EACTC,KAAI,EACJC,cAAa,EACbC,YAAW,EACXC,QAAO,EACPC,KAAI,EACJC,WAAU,EACVC,UAAS,EACTC,WAAU,EACVC,UAAS,EACTC,eAAc,EACf,GAAGf;IACJ,OAAO,WAAW,GAAEgB,OAAMC,aAAa,CAACC,8BAAc,CAACC,QAAQ,EAAE;QAC/DC,OAAO;YACLnB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAE;YACAH;YACAE;YACAG;YACAD;QACF;IACF,GAAGd,MAAMqB,cAAc,EAAErB,MAAMM,IAAI,IAAIN,MAAMsB,cAAc;AAC7D,GACA,yCAAyC"}