@procore/core-react 12.21.0-cdn.2 → 12.21.0-cdn.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/__mocks__/_hooks/DelayedCallback.tsx +88 -0
  2. package/__mocks__/_hooks/Visibility.tsx +100 -0
  3. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  4. package/dist/Avatar/Avatar.js +10 -8
  5. package/dist/Avatar/Avatar.js.map +1 -1
  6. package/dist/Avatar/Avatar.styles.js +5 -5
  7. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  8. package/dist/Badge/Badge.styles.js +2 -2
  9. package/dist/Banner/Banner.styles.js +10 -10
  10. package/dist/Box/Box.styles.js +1 -1
  11. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  12. package/dist/Button/Button.styles.js +5 -5
  13. package/dist/Calendar/Calendar.styles.js +8 -8
  14. package/dist/Card/Card.styles.js +1 -1
  15. package/dist/Checkbox/Checkbox.styles.js +6 -6
  16. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  17. package/dist/ContactItem/ContactItem.styles.js +5 -5
  18. package/dist/Content/Content.styles.js +2 -2
  19. package/dist/DateInput/DateInput.styles.js +6 -6
  20. package/dist/DetailPage/DetailPage.styles.js +7 -7
  21. package/dist/Dropdown/Dropdown.styles.js +3 -3
  22. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  23. package/dist/Dropzone/Dropzone.js +1 -1
  24. package/dist/Dropzone/Dropzone.styles.js +9 -9
  25. package/dist/EmptyState/EmptyState.styles.js +6 -6
  26. package/dist/Field/Field.styles.js +3 -3
  27. package/dist/FileList/FileList.styles.js +4 -4
  28. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  29. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  30. package/dist/FileSelect/FileSelect.styles.js +2 -2
  31. package/dist/FileSelect/FileSelect.types.d.ts +4 -0
  32. package/dist/FileSelect/FileSelect.types.js.map +1 -1
  33. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  34. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  35. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  36. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  37. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  38. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  39. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  40. package/dist/FileToken/FileToken.styles.js +4 -4
  41. package/dist/FilterToken/FilterToken.styles.js +5 -5
  42. package/dist/FlexList/FlexList.styles.js +1 -1
  43. package/dist/Form/Form.js +12 -5
  44. package/dist/Form/Form.js.map +1 -1
  45. package/dist/Form/Form.styles.js +14 -14
  46. package/dist/Form/StyledFormikForm.styles.js +2 -2
  47. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  48. package/dist/Grid/Grid.styles.js +2 -2
  49. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  50. package/dist/Input/Input.styles.js +1 -1
  51. package/dist/Link/Link.styles.js +1 -1
  52. package/dist/ListPage/ListPage.styles.js +8 -8
  53. package/dist/Loader/Loader.styles.js +2 -2
  54. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  55. package/dist/Modal/Modal.styles.js +13 -13
  56. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  57. package/dist/MultiSelect/MultiSelect.types.d.ts +5 -0
  58. package/dist/MultiSelect/MultiSelect.types.js.map +1 -1
  59. package/dist/NextMenu/NextMenu.styles.js +3 -3
  60. package/dist/Notation/Notation.js +1 -1
  61. package/dist/NumberInput/NumberInput.styles.js +7 -7
  62. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  63. package/dist/PageLayout/PageLayout.styles.js +16 -16
  64. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  65. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  66. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  67. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  68. package/dist/Pagination/Pagination.styles.js +5 -5
  69. package/dist/Panel/Panel.js +2 -1
  70. package/dist/Panel/Panel.js.map +1 -1
  71. package/dist/Panel/Panel.styles.js +11 -11
  72. package/dist/Pill/Pill.styles.js +2 -2
  73. package/dist/PillSelect/PillSelect.styles.js +4 -4
  74. package/dist/Popover/Popover.styles.js +2 -2
  75. package/dist/Portal/Portal.styles.js +1 -1
  76. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  77. package/dist/RadioButton/RadioButton.js +1 -0
  78. package/dist/RadioButton/RadioButton.js.map +1 -1
  79. package/dist/RadioButton/RadioButton.styles.js +3 -3
  80. package/dist/Required/Required.styles.js +3 -3
  81. package/dist/Search/Search.styles.js +5 -5
  82. package/dist/Section/Section.styles.js +7 -7
  83. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  84. package/dist/Select/Select.styles.js +7 -7
  85. package/dist/Semantic/Semantic.styles.js +9 -9
  86. package/dist/Slider/Slider.styles.js +5 -5
  87. package/dist/Spinner/Spinner.styles.js +7 -7
  88. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  89. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  90. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  91. package/dist/Switch/Switch.styles.js +4 -4
  92. package/dist/Table/Table.styles.js +28 -28
  93. package/dist/TableShelf/TableShelf.styles.js +5 -5
  94. package/dist/Tabs/Tabs.js +6 -4
  95. package/dist/Tabs/Tabs.js.map +1 -1
  96. package/dist/Tabs/Tabs.styles.js +15 -15
  97. package/dist/Tearsheet/Tearsheet.js +61 -40
  98. package/dist/Tearsheet/Tearsheet.js.map +1 -1
  99. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  100. package/dist/TextArea/TextArea.styles.js +1 -1
  101. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  102. package/dist/Thumbnail/Thumbnail.js +4 -2
  103. package/dist/Thumbnail/Thumbnail.js.map +1 -1
  104. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  105. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  106. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  107. package/dist/Tile/Tile.styles.js +8 -8
  108. package/dist/Title/Title.styles.js +7 -7
  109. package/dist/Toast/Toast.styles.js +3 -3
  110. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  111. package/dist/Token/Token.styles.js +3 -3
  112. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  113. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  114. package/dist/Tooltip/Tooltip.styles.js +2 -2
  115. package/dist/Tree/Tree.styles.js +9 -9
  116. package/dist/Typeahead/Typeahead.styles.js +3 -3
  117. package/dist/Typography/Typography.styles.js +1 -1
  118. package/dist/Typography/Typography.table.story.js +2 -2
  119. package/dist/_hooks/DelayedCallback.js +9 -4
  120. package/dist/_hooks/DelayedCallback.js.map +1 -1
  121. package/dist/_hooks/Visibility.js +10 -0
  122. package/dist/_hooks/Visibility.js.map +1 -1
  123. package/dist/_locales/it-IT.json +216 -216
  124. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  125. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  126. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  127. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  128. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  129. package/dist/_typedoc/Box/Box.types.json +68 -68
  130. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  131. package/dist/_typedoc/Button/Button.types.json +13 -13
  132. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  133. package/dist/_typedoc/Card/Card.types.json +6 -6
  134. package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
  135. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  136. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  137. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  138. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  139. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  140. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
  141. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  142. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  143. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  144. package/dist/_typedoc/FileSelect/FileSelect.types.json +36 -26
  145. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  146. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  147. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  148. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  149. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  150. package/dist/_typedoc/Form/Form.types.json +741 -741
  151. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  152. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  153. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  154. package/dist/_typedoc/Input/Input.types.json +2 -2
  155. package/dist/_typedoc/Link/Link.types.json +4 -4
  156. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  157. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  158. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  159. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  160. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  161. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  162. package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
  163. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
  164. package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
  165. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  166. package/dist/_typedoc/Panel/Panel.types.json +28 -28
  167. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  168. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  169. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  170. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  171. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  172. package/dist/_typedoc/Required/Required.types.json +5 -5
  173. package/dist/_typedoc/Search/Search.types.json +19 -19
  174. package/dist/_typedoc/Section/Section.types.json +15 -15
  175. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  176. package/dist/_typedoc/Select/Select.types.json +60 -60
  177. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  178. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  179. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  180. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
  181. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  182. package/dist/_typedoc/Table/Table.types.json +101 -101
  183. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  184. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  185. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  186. package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
  187. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  188. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  189. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  190. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  191. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  192. package/dist/_typedoc/Title/Title.types.json +1 -1
  193. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  194. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  195. package/dist/_typedoc/Token/Token.types.json +4 -4
  196. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  197. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  198. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  199. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  200. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  201. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  202. package/dist/_typedoc/_utils/types.json +3 -3
  203. package/package.json +3 -2
  204. package/tsconfig.prod.json +2 -1
@@ -7,6 +7,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
7
7
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
8
8
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
9
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
10
+ // ATTENTION: If you modify this file, you must also update the corresponding mock in __mocks__/_hooks
11
+
10
12
  import React from 'react';
11
13
 
12
14
  /* TYPES */
@@ -40,13 +42,21 @@ export function useVisibility(_ref) {
40
42
  _React$useState2 = _slicedToArray(_React$useState, 2),
41
43
  isVisible = _React$useState2[0],
42
44
  setVisibility = _React$useState2[1];
45
+ var isMounted = React.useRef(true);
46
+ React.useEffect(function () {
47
+ return function () {
48
+ isMounted.current = false;
49
+ };
50
+ }, []);
43
51
  var hide = function hide(e) {
52
+ if (!isMounted.current) return;
44
53
  setVisibility(false);
45
54
  if (isVisible) {
46
55
  afterHide(e);
47
56
  }
48
57
  };
49
58
  var show = function show() {
59
+ if (!isMounted.current) return;
50
60
  setVisibility(true);
51
61
  if (!isVisible) {
52
62
  afterShow();
@@ -1 +1 @@
1
- {"version":3,"file":"Visibility.js","names":["React","noop","useVisibility","_ref","_ref$afterHide","afterHide","_ref$afterShow","afterShow","_ref$initialIsVisible","initialIsVisible","_React$useState","useState","_React$useState2","_slicedToArray","isVisible","setVisibility","hide","e","show","toggle","Visibility","_ref2","children","props","_objectWithoutProperties","_excluded","visibility"],"sources":["../../src/_hooks/Visibility.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface VisibilityConfig {\n afterHide?: (e?: Event) => void\n afterShow?: () => void\n initialIsVisible?: boolean\n}\n\ninterface VisibilityApi {\n hide: (e?: Event) => any\n isVisible: boolean\n show: () => any\n toggle: () => any\n}\n\ninterface Props extends VisibilityConfig {\n children?: React.ReactNode\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface RenderProps extends VisibilityConfig {\n children: (props: VisibilityApi) => React.ReactElement<{}>\n}\n\n/* HOOK */\n\nfunction noop() {}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useVisibility({\n afterHide = noop,\n afterShow = noop,\n initialIsVisible = false,\n}: VisibilityConfig): VisibilityApi {\n const [isVisible, setVisibility] = React.useState(initialIsVisible)\n\n const hide = (e?: Event) => {\n setVisibility(false)\n\n if (isVisible) {\n afterHide(e)\n }\n }\n\n const show = () => {\n setVisibility(true)\n\n if (!isVisible) {\n afterShow()\n }\n }\n\n const toggle = isVisible ? hide : show\n\n return {\n hide,\n isVisible,\n show,\n toggle,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function Visibility({ children, ...props }: RenderProps) {\n const visibility = useVisibility(props)\n\n return typeof children === 'function' ? children(visibility) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAEA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;;AAKA;;AAEA,SAASC,IAAIA,CAAA,EAAG,CAAC;;AAEjB;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAIO;EAAA,IAAAC,cAAA,GAAAD,IAAA,CAHlCE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGH,IAAI,GAAAG,cAAA;IAAAE,cAAA,GAAAH,IAAA,CAChBI,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGL,IAAI,GAAAK,cAAA;IAAAE,qBAAA,GAAAL,IAAA,CAChBM,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;EAExB,IAAAE,eAAA,GAAmCV,KAAK,CAACW,QAAQ,CAACF,gBAAgB,CAAC;IAAAG,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA5DI,SAAS,GAAAF,gBAAA;IAAEG,aAAa,GAAAH,gBAAA;EAE/B,IAAMI,IAAI,GAAG,SAAPA,IAAIA,CAAIC,CAAS,EAAK;IAC1BF,aAAa,CAAC,KAAK,CAAC;IAEpB,IAAID,SAAS,EAAE;MACbT,SAAS,CAACY,CAAC,CAAC;IACd;EACF,CAAC;EAED,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAS;IACjBH,aAAa,CAAC,IAAI,CAAC;IAEnB,IAAI,CAACD,SAAS,EAAE;MACdP,SAAS,CAAC,CAAC;IACb;EACF,CAAC;EAED,IAAMY,MAAM,GAAGL,SAAS,GAAGE,IAAI,GAAGE,IAAI;EAEtC,OAAO;IACLF,IAAI,EAAJA,IAAI;IACJF,SAAS,EAATA,SAAS;IACTI,IAAI,EAAJA,IAAI;IACJC,MAAM,EAANA;EACF,CAAC;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAAC,KAAA,EAAsC;EAAA,IAAnCC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EAC7C,IAAMC,UAAU,GAAGxB,aAAa,CAACqB,KAAK,CAAC;EAEvC,OAAO,OAAOD,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACI,UAAU,CAAC,GAAGJ,QAAQ;AACzE"}
1
+ {"version":3,"file":"Visibility.js","names":["React","noop","useVisibility","_ref","_ref$afterHide","afterHide","_ref$afterShow","afterShow","_ref$initialIsVisible","initialIsVisible","_React$useState","useState","_React$useState2","_slicedToArray","isVisible","setVisibility","isMounted","useRef","useEffect","current","hide","e","show","toggle","Visibility","_ref2","children","props","_objectWithoutProperties","_excluded","visibility"],"sources":["../../src/_hooks/Visibility.tsx"],"sourcesContent":["// ATTENTION: If you modify this file, you must also update the corresponding mock in __mocks__/_hooks\n\nimport React from 'react'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface VisibilityConfig {\n afterHide?: (e?: Event) => void\n afterShow?: () => void\n initialIsVisible?: boolean\n}\n\ninterface VisibilityApi {\n hide: (e?: Event) => any\n isVisible: boolean\n show: () => any\n toggle: () => any\n}\n\ninterface Props extends VisibilityConfig {\n children?: React.ReactNode\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface RenderProps extends VisibilityConfig {\n children: (props: VisibilityApi) => React.ReactElement<{}>\n}\n\n/* HOOK */\n\nfunction noop() {}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useVisibility({\n afterHide = noop,\n afterShow = noop,\n initialIsVisible = false,\n}: VisibilityConfig): VisibilityApi {\n const [isVisible, setVisibility] = React.useState(initialIsVisible)\n const isMounted = React.useRef(true)\n\n React.useEffect(() => {\n return () => {\n isMounted.current = false\n }\n }, [])\n\n const hide = (e?: Event) => {\n if (!isMounted.current) return\n\n setVisibility(false)\n\n if (isVisible) {\n afterHide(e)\n }\n }\n\n const show = () => {\n if (!isMounted.current) return\n\n setVisibility(true)\n if (!isVisible) {\n afterShow()\n }\n }\n\n const toggle = isVisible ? hide : show\n\n return {\n hide,\n isVisible,\n show,\n toggle,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function Visibility({ children, ...props }: RenderProps) {\n const visibility = useVisibility(props)\n\n return typeof children === 'function' ? children(visibility) : children\n}\n"],"mappings":";;;;;;;;;AAAA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAEA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;;AAKA;;AAEA,SAASC,IAAIA,CAAA,EAAG,CAAC;;AAEjB;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAIO;EAAA,IAAAC,cAAA,GAAAD,IAAA,CAHlCE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGH,IAAI,GAAAG,cAAA;IAAAE,cAAA,GAAAH,IAAA,CAChBI,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGL,IAAI,GAAAK,cAAA;IAAAE,qBAAA,GAAAL,IAAA,CAChBM,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;EAExB,IAAAE,eAAA,GAAmCV,KAAK,CAACW,QAAQ,CAACF,gBAAgB,CAAC;IAAAG,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA5DI,SAAS,GAAAF,gBAAA;IAAEG,aAAa,GAAAH,gBAAA;EAC/B,IAAMI,SAAS,GAAGhB,KAAK,CAACiB,MAAM,CAAC,IAAI,CAAC;EAEpCjB,KAAK,CAACkB,SAAS,CAAC,YAAM;IACpB,OAAO,YAAM;MACXF,SAAS,CAACG,OAAO,GAAG,KAAK;IAC3B,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAIC,CAAS,EAAK;IAC1B,IAAI,CAACL,SAAS,CAACG,OAAO,EAAE;IAExBJ,aAAa,CAAC,KAAK,CAAC;IAEpB,IAAID,SAAS,EAAE;MACbT,SAAS,CAACgB,CAAC,CAAC;IACd;EACF,CAAC;EAED,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAS;IACjB,IAAI,CAACN,SAAS,CAACG,OAAO,EAAE;IAExBJ,aAAa,CAAC,IAAI,CAAC;IACnB,IAAI,CAACD,SAAS,EAAE;MACdP,SAAS,CAAC,CAAC;IACb;EACF,CAAC;EAED,IAAMgB,MAAM,GAAGT,SAAS,GAAGM,IAAI,GAAGE,IAAI;EAEtC,OAAO;IACLF,IAAI,EAAJA,IAAI;IACJN,SAAS,EAATA,SAAS;IACTQ,IAAI,EAAJA,IAAI;IACJC,MAAM,EAANA;EACF,CAAC;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAAC,KAAA,EAAsC;EAAA,IAAnCC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EAC7C,IAAMC,UAAU,GAAG5B,aAAa,CAACyB,KAAK,CAAC;EAEvC,OAAO,OAAOD,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACI,UAAU,CAAC,GAAGJ,QAAQ;AACzE"}