@procore/core-react 12.17.5 → 12.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +4 -1
- package/dist/AnchorNavigation/AnchorNavigation.js.map +1 -1
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/AnchorNavigation/AnchorNavigationProvider.js +5 -5
- package/dist/AnchorNavigation/AnchorNavigationProvider.js.map +1 -1
- package/dist/Avatar/Avatar.js +10 -11
- package/dist/Avatar/Avatar.js.map +1 -1
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.js +14 -14
- package/dist/AvatarStack/AvatarStack.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.js +1 -1
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/Banner/Banner.js +44 -14
- package/dist/Banner/Banner.js.map +1 -1
- package/dist/Banner/Banner.styles.d.ts +1 -1
- package/dist/Banner/Banner.styles.js +15 -15
- package/dist/Banner/Banner.styles.js.map +1 -1
- package/dist/Box/Box.js +3 -3
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +9 -9
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.js +7 -7
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.styles.d.ts +1 -0
- package/dist/Button/Button.styles.js +7 -7
- package/dist/Button/Button.styles.js.map +1 -1
- package/dist/Button/Button.types.d.ts +4 -0
- package/dist/Button/Button.types.js.map +1 -1
- package/dist/Calendar/Calendar.js +4 -4
- package/dist/Calendar/Calendar.js.map +1 -1
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.js +3 -3
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.js +9 -9
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +2 -2
- package/dist/CheckboxGroup/CheckboxGroup.js +8 -8
- package/dist/ClickOutside/ClickOutside.js +3 -3
- package/dist/ContactItem/ContactItem.js +3 -3
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.js +11 -11
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.js +10 -10
- package/dist/DateSelect/DateSelect.js +8 -8
- package/dist/DateSelect/DateSelect.js.map +1 -1
- package/dist/DetailPage/DetailPage.js +3 -3
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/DetailPage/examples/TableExample.js +5 -5
- package/dist/DetailPageTemplate/DetailPageTemplate.js +3 -3
- package/dist/Dropdown/Dropdown.js +8 -8
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.helpers.js +14 -14
- package/dist/DropdownFlyout/DropdownFlyout.js +8 -8
- package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.hooks.js +17 -18
- package/dist/Dropzone/Dropzone.hooks.js.map +1 -1
- package/dist/Dropzone/Dropzone.js +19 -21
- package/dist/Dropzone/Dropzone.js.map +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.js +3 -3
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.js +3 -3
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.js +3 -3
- package/dist/FileSelect/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerModal.js +3 -3
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js +5 -5
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileExplorer/useSidebarNavigation.js +8 -8
- package/dist/FileSelect/FileSelect.js +21 -21
- package/dist/FileSelect/FileSelect.js.map +1 -1
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js +5 -5
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.js +8 -8
- package/dist/FileSelect/FileTokenList/FileTokenList.js.map +1 -1
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.js +20 -20
- package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.js +19 -19
- package/dist/FileSelect/LocalSource/LocalSource.js.map +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.js +11 -11
- package/dist/FileSelect/SourceItem/SourceItem.js +3 -3
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.js +8 -8
- package/dist/FileSelect/ThumbnailList/ThumbnailList.js.map +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.js +21 -21
- package/dist/FileSelect/TreeSource/TreeSource.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileSelect/storyHelpers.js +4 -4
- package/dist/FileSelect/storyHelpers.js.map +1 -1
- package/dist/FileToken/FileToken.js +8 -8
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.js +25 -35
- package/dist/FilterToken/FilterToken.js.map +1 -1
- package/dist/FilterToken/FilterToken.styles.d.ts +5 -0
- package/dist/FilterToken/FilterToken.styles.js +18 -2
- package/dist/FilterToken/FilterToken.styles.js.map +1 -1
- package/dist/Flex/Flex.js +3 -3
- package/dist/FlexList/FlexList.js +3 -3
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.js +22 -18
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/FormFieldTooltip.js +1 -1
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/Form/stories/util.js +9 -9
- package/dist/Form/stories/util.js.map +1 -1
- package/dist/GhostPlaceholder/GhostPlaceholder.js +3 -3
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.js +3 -3
- package/dist/Grid/Grid.styles.js +3 -3
- package/dist/Grid/Grid.utils.js +5 -5
- package/dist/GroupSelect/GroupSelect.js +17 -17
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.js +3 -3
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.js +3 -3
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.js +3 -3
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.js +3 -3
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/Menu/Menu.js +15 -15
- package/dist/Menu/Menu.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.js +15 -15
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/MenuImperative/sensors.js +8 -8
- package/dist/MenuImperative/sensors.js.map +1 -1
- package/dist/Modal/ChildRegistry.context.js +11 -11
- package/dist/Modal/Modal.js +8 -8
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/Modal/Modal.types.d.ts +3 -1
- package/dist/Modal/Modal.types.js.map +1 -1
- package/dist/Modal/storyHelpers.js +7 -7
- package/dist/MultiSelect/MultiSelect.js +17 -17
- package/dist/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.js +14 -14
- package/dist/NextMenu/NextMenu.js.map +1 -1
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/NextMenu/NextMenuItem.js +3 -3
- package/dist/NextMenu/sampleData.js +7 -6
- package/dist/NextMenu/sampleData.js.map +1 -1
- package/dist/NextTile/NextTile.js +9 -9
- package/dist/Notation/Notation.js +4 -4
- package/dist/NumberInput/NumberInput.hooks.js +5 -5
- package/dist/NumberInput/NumberInput.js +14 -14
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/NumberInput/NumberInput.utils.js +11 -11
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/Overlay/OverlayArrow.js +4 -4
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/OverlayTrigger/OverlayTrigger.js +15 -15
- package/dist/OverlayTrigger/OverlayTrigger.js.map +1 -1
- package/dist/OverlayTrigger/a11yPresets.js +6 -6
- package/dist/OverlayTrigger/a11yPresets.js.map +1 -1
- package/dist/PageFooterTemplate/PageFooterTemplate.js +3 -3
- package/dist/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageHeaderTemplate/PageHeaderTemplate.js +3 -3
- package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageHeaderTemplate/PageHeaderTemplate.utils.js +5 -5
- package/dist/PageLayout/PageLayout.js +15 -15
- package/dist/PageLayout/PageLayout.js.map +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate.js +3 -3
- package/dist/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/PageTemplate/PageTemplateCard.js +3 -3
- package/dist/Pagination/Pagination.js +3 -3
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Pagination/PaginationSelect.js +3 -3
- package/dist/Panel/Panel.js +8 -8
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.js +3 -3
- package/dist/Pill/Pill.styles.js +2 -2
- package/dist/PillSelect/PillSelect.js +8 -8
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.js +9 -9
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.js +3 -3
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/ProgressBar/ProgressBar.js +10 -8
- package/dist/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/ProgressBar/ProgressBar.types.js.map +1 -1
- package/dist/RadioButton/RadioButton.js +3 -3
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.hooks.js +5 -5
- package/dist/Search/Search.js +3 -3
- package/dist/Search/Search.js.map +1 -1
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.js +15 -16
- package/dist/Section/Section.js.map +1 -1
- package/dist/Section/Section.styles.js +7 -7
- package/dist/Section/Section.styles.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.js +14 -14
- package/dist/SegmentedController/SegmentedController.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.js +8 -8
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.js +3 -3
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/SettingsPage/SettingsPage.js +3 -3
- package/dist/SettingsPageTemplate/SettingsPageTemplate.js +3 -3
- package/dist/Slider/Slider.js +8 -8
- package/dist/Slider/Slider.js.map +1 -1
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.js +3 -3
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.context.js +5 -5
- package/dist/SplitViewCard/SplitViewCard.context.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCard.js +8 -8
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.components.js +8 -8
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.js +7 -7
- package/dist/SuperSelect/SuperSelect.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/SuperSelect/SuperSelect.utils.js +15 -16
- package/dist/SuperSelect/SuperSelect.utils.js.map +1 -1
- package/dist/SuperSelect/presets/contactsPreset.js +3 -3
- package/dist/SuperSelect/presets/contactsPreset.js.map +1 -1
- package/dist/SuperSelect/presets/filterPreset.js +1 -1
- package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
- package/dist/SuperSelect/presets/pillPreset.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.js +14 -14
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.js +3 -3
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.js +9 -9
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.js +3 -3
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.js +17 -17
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.js +11 -11
- package/dist/Tearsheet/Tearsheet.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.js +3 -3
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditor/TextEditor.js +17 -17
- package/dist/TextEditorOutput/TextEditorOutput.js +9 -9
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.d.ts +8 -0
- package/dist/Thumbnail/Thumbnail.hooks.js +8 -8
- package/dist/Thumbnail/Thumbnail.js +9 -9
- package/dist/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/Thumbnail/Thumbnail.utils.js +11 -12
- package/dist/Thumbnail/Thumbnail.utils.js.map +1 -1
- package/dist/Thumbnail/ThumbnailCaption.js +3 -3
- package/dist/Thumbnail/ThumbnailDocumentIcon.js +7 -8
- package/dist/Thumbnail/ThumbnailDocumentIcon.js.map +1 -1
- package/dist/Thumbnail/ThumbnailPreview.js +5 -5
- package/dist/ThumbnailGrid/ThumbnailGrid.hooks.js +5 -5
- package/dist/ThumbnailGrid/ThumbnailGrid.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredDropdown/TieredDropdown.js +14 -14
- package/dist/TieredDropdown/TieredDropdown.js.map +1 -1
- package/dist/TieredDropdown/useSearch.js +5 -5
- package/dist/TieredSelect/LeafSelectionTieredSelect.js +8 -8
- package/dist/TieredSelect/LeafSelectionTieredSelect.js.map +1 -1
- package/dist/TieredSelect/TierSelectionTieredSelect.js +17 -17
- package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.js +8 -8
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/TieredSelect/TieredSelectMenu.js +17 -17
- package/dist/TieredSelect/TieredSelectMenu.js.map +1 -1
- package/dist/Tile/Tile.js +3 -3
- package/dist/Tile/Tile.js.map +1 -1
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.js +3 -3
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.js +4 -4
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.js +4 -4
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ActionIcon.js +3 -3
- package/dist/ToolHeader/ActionIcon.types.example.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.js +9 -9
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.js +3 -3
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.js +3 -3
- package/dist/Tooltip/Tooltip.js +8 -8
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.hooks.js +14 -14
- package/dist/Tree/Tree.hooks.js.map +1 -1
- package/dist/Tree/Tree.js +14 -14
- package/dist/Tree/Tree.js.map +1 -1
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Tree/Tree.styles.js.map +1 -1
- package/dist/Typeahead/Typeahead.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/Anchor.js +19 -16
- package/dist/_hooks/Anchor.js.map +1 -1
- package/dist/_hooks/Buffer.js +8 -7
- package/dist/_hooks/Buffer.js.map +1 -1
- package/dist/_hooks/ClickOutside.js +2 -1
- package/dist/_hooks/ClickOutside.js.map +1 -1
- package/dist/_hooks/DateTime/DateTime.js +17 -17
- package/dist/_hooks/DelayedCallback.js +1 -1
- package/dist/_hooks/DelayedToggle.js +7 -2
- package/dist/_hooks/DelayedToggle.js.map +1 -1
- package/dist/_hooks/Deprecation.js +1 -0
- package/dist/_hooks/Deprecation.js.map +1 -1
- package/dist/_hooks/EventListener.js +5 -5
- package/dist/_hooks/FocusScopeOverride.js +6 -6
- package/dist/_hooks/FocusScopeOverride.js.map +1 -1
- package/dist/_hooks/Hotkey.js +2 -2
- package/dist/_hooks/Hotkey.js.map +1 -1
- package/dist/_hooks/I18n.js +13 -13
- package/dist/_hooks/InjectedScript.js +8 -7
- package/dist/_hooks/InjectedScript.js.map +1 -1
- package/dist/_hooks/IntersectionObserver/useIntersectionObserver.js +5 -5
- package/dist/_hooks/ListNavigation.js +9 -7
- package/dist/_hooks/ListNavigation.js.map +1 -1
- package/dist/_hooks/OverflowObserver/OverflowObserver.js +6 -6
- package/dist/_hooks/ResizeObserver.js +5 -5
- package/dist/_hooks/TextEntry.js +5 -2
- package/dist/_hooks/TextEntry.js.map +1 -1
- package/dist/_hooks/Timer.js +1 -0
- package/dist/_hooks/Timer.js.map +1 -1
- package/dist/_hooks/Trigger.js +19 -13
- package/dist/_hooks/Trigger.js.map +1 -1
- package/dist/_hooks/Visibility.js +9 -7
- package/dist/_hooks/Visibility.js.map +1 -1
- package/dist/_hooks/ZIndex.js +7 -7
- package/dist/_hooks/getI18nProviderLocale.js +2 -1
- package/dist/_hooks/getI18nProviderLocale.js.map +1 -1
- package/dist/_hooks/useCurrentMedia.js +5 -5
- package/dist/_hooks/useFileUploader.js +15 -15
- package/dist/_hooks/useFileUploader.js.map +1 -1
- package/dist/_hooks/useFocusWithin.js +5 -5
- package/dist/_hooks/useMediaLessThan.js +5 -5
- package/dist/_hooks/useSet.js +5 -5
- package/dist/_styles/colors.js +6 -6
- package/dist/_styles/spacing.d.ts +27 -0
- package/dist/_styles/spacing.js +27 -0
- package/dist/_styles/spacing.js.map +1 -1
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +24 -16
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +43 -39
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
- package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
- package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +745 -745
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +50 -50
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
- package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +34 -30
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +19 -19
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +60 -60
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +11 -11
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +6 -6
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +48 -44
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +30 -30
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +86 -86
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_typedoc/deprecations.json +1 -1
- package/dist/_utils/TinyMCE.js +4 -4
- package/dist/_utils/TinyMCE.js.map +1 -1
- package/dist/_utils/closeWithConfirm.js +5 -5
- package/dist/_utils/closeWithConfirm.js.map +1 -1
- package/dist/_utils/dateTime.js +6 -6
- package/dist/_utils/dateTime.js.map +1 -1
- package/dist/_utils/getAnchorPosition.js +11 -11
- package/dist/_utils/getAnchorPosition.js.map +1 -1
- package/dist/_utils/partition.js +5 -5
- package/dist/_utils/runInQueue.js +4 -4
- package/dist/_utils/runInQueue.js.map +1 -1
- package/dist/_utils/slotify.js +7 -7
- package/dist/_utils/triggerListeners.js +6 -6
- package/package.json +5 -4
- package/tsconfig.prod.json +2 -1
- package/tsconfig.test.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buffer.js","names":["React","useBuffer","_ref","_ref$initialValue","initialValue","_React$useState","useState","_React$useState2","_slicedToArray","value","setValue","clear","reset","update","Buffer","_ref2","children","props","_objectWithoutProperties","_excluded","buffer"],"sources":["../../src/_hooks/Buffer.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\ninterface BufferConfig {\n initialValue: string\n}\n\ninterface BufferApi {\n clear: () => void\n reset: () => void\n update: (value: string) => void\n value: string\n}\n\ninterface Props extends BufferConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends BufferConfig {\n children: (props: BufferApi) => {}\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated A trivial hook for storing a string. Write your own or use a hook utility lib.\n * \n * **Source:**\n * ```\n export function useBuffer({ initialValue = '' }) {\n const [value, setValue] = React.useState(initialValue)\n\n const clear = () => setValue('')\n\n const reset = () => setValue(initialValue)\n\n const update = (value: string) => setValue(value)\n\n return {\n clear,\n reset,\n update,\n value,\n }\n}\n```\n */\nexport function useBuffer({ initialValue = '' }: BufferConfig): BufferApi {\n const [value, setValue] = React.useState(initialValue)\n\n const clear = () => setValue('')\n const reset = () => setValue(initialValue)\n const update = (value: string) => setValue(value)\n\n return {\n clear,\n reset,\n update,\n value,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated\n */\nexport function Buffer({ children, ...props }: RenderProps) {\n const buffer = useBuffer(props)\n\n return typeof children === 'function' ? children(buffer) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAqBA
|
|
1
|
+
{"version":3,"file":"Buffer.js","names":["React","useBuffer","_ref","_ref$initialValue","initialValue","_React$useState","useState","_React$useState2","_slicedToArray","value","setValue","clear","reset","update","Buffer","_ref2","children","props","_objectWithoutProperties","_excluded","buffer"],"sources":["../../src/_hooks/Buffer.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\ninterface BufferConfig {\n initialValue: string\n}\n\ninterface BufferApi {\n clear: () => void\n reset: () => void\n update: (value: string) => void\n value: string\n}\n\ninterface Props extends BufferConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends BufferConfig {\n children: (props: BufferApi) => {}\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated A trivial hook for storing a string. Write your own or use a hook utility lib.\n * \n * **Source:**\n * ```\n export function useBuffer({ initialValue = '' }) {\n const [value, setValue] = React.useState(initialValue)\n\n const clear = () => setValue('')\n\n const reset = () => setValue(initialValue)\n\n const update = (value: string) => setValue(value)\n\n return {\n clear,\n reset,\n update,\n value,\n }\n}\n```\n */\nexport function useBuffer({ initialValue = '' }: BufferConfig): BufferApi {\n const [value, setValue] = React.useState(initialValue)\n\n const clear = () => setValue('')\n const reset = () => setValue(initialValue)\n const update = (value: string) => setValue(value)\n\n return {\n clear,\n reset,\n update,\n value,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated\n */\nexport function Buffer({ children, ...props }: RenderProps) {\n const buffer = useBuffer(props)\n\n return typeof children === 'function' ? children(buffer) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAqBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAAC,IAAA,EAAiD;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CAA9CE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;EAC3C,IAAAE,eAAA,GAA0BL,KAAK,CAACM,QAAQ,CAACF,YAAY,CAAC;IAAAG,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA/CI,KAAK,GAAAF,gBAAA;IAAEG,QAAQ,GAAAH,gBAAA;EAEtB,IAAMI,KAAK,GAAG,SAARA,KAAKA,CAAA;IAAA,OAASD,QAAQ,CAAC,EAAE,CAAC;EAAA;EAChC,IAAME,KAAK,GAAG,SAARA,KAAKA,CAAA;IAAA,OAASF,QAAQ,CAACN,YAAY,CAAC;EAAA;EAC1C,IAAMS,MAAM,GAAG,SAATA,MAAMA,CAAIJ,KAAa;IAAA,OAAKC,QAAQ,CAACD,KAAK,CAAC;EAAA;EAEjD,OAAO;IACLE,KAAK,EAALA,KAAK;IACLC,KAAK,EAALA,KAAK;IACLC,MAAM,EAANA,MAAM;IACNJ,KAAK,EAALA;EACF,CAAC;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,MAAMA,CAAAC,KAAA,EAAsC;EAAA,IAAnCC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EACzC,IAAMC,MAAM,GAAGnB,SAAS,CAACgB,KAAK,CAAC;EAE/B,OAAO,OAAOD,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACI,MAAM,CAAC,GAAGJ,QAAQ;AACrE"}
|
|
@@ -2,7 +2,8 @@ import { useEventListener } from './EventListener';
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecatedSince 9
|
|
4
4
|
* @deprecated Never officially documented/supported
|
|
5
|
-
*/
|
|
5
|
+
*/
|
|
6
|
+
// To support MenuRef had to change to any. Could manually do <HTMLElement & MenuRef> but seems brittle
|
|
6
7
|
export function isEventSource(ref, event) {
|
|
7
8
|
if (ref !== null && ref !== void 0 && ref.current && event && (event.target instanceof HTMLElement || event.target instanceof SVGElement)) {
|
|
8
9
|
return ref.current.contains(event.target);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickOutside.js","names":["useEventListener","isEventSource","ref","event","current","target","HTMLElement","SVGElement","contains","useClickOutside","_ref","_ref$refs","refs","onClickOutside","container","handler","find","options","capture","containerDocument","ownerDocument","scope","defaultView","undefined"],"sources":["../../src/_hooks/ClickOutside.ts"],"sourcesContent":["import type React from 'react'\nimport type { PortalProps } from '../Portal/Portal.types'\nimport { useEventListener } from './EventListener'\n\nexport interface ClickOutsideConfig extends Pick<PortalProps, 'container'> {\n /**\n * @since 10.19.0\n */\n onClickOutside: (event: MouseEvent) => void\n /**\n * @since 10.19.0\n */\n refs: Array<React.RefObject<HTMLElement>>\n}\n\nexport interface ClickOutsideProps extends ClickOutsideConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\n// To support MenuRef had to change to any. Could manually do <HTMLElement & MenuRef> but seems brittle\nexport function isEventSource(ref: React.RefObject<any>, event: Event) {\n if (\n ref?.current &&\n event &&\n (event.target instanceof HTMLElement || event.target instanceof SVGElement)\n ) {\n return ref.current.contains(event.target)\n } else {\n return false\n }\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useClickOutside({\n refs = [],\n onClickOutside,\n container,\n}: ClickOutsideConfig) {\n const handler = (event: MouseEvent) => {\n if (onClickOutside && !refs.find((ref) => isEventSource(ref, event))) {\n onClickOutside(event)\n }\n }\n\n const options = { capture: true }\n\n const containerDocument = container?.ownerDocument\n const scope = containerDocument?.defaultView || undefined\n\n useEventListener({ event: 'click', handler, options, scope: scope })\n\n useEventListener({ event: 'touchend', handler, options, scope: scope })\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,iBAAiB;AAoBlD;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"ClickOutside.js","names":["useEventListener","isEventSource","ref","event","current","target","HTMLElement","SVGElement","contains","useClickOutside","_ref","_ref$refs","refs","onClickOutside","container","handler","find","options","capture","containerDocument","ownerDocument","scope","defaultView","undefined"],"sources":["../../src/_hooks/ClickOutside.ts"],"sourcesContent":["import type React from 'react'\nimport type { PortalProps } from '../Portal/Portal.types'\nimport { useEventListener } from './EventListener'\n\nexport interface ClickOutsideConfig extends Pick<PortalProps, 'container'> {\n /**\n * @since 10.19.0\n */\n onClickOutside: (event: MouseEvent) => void\n /**\n * @since 10.19.0\n */\n refs: Array<React.RefObject<HTMLElement>>\n}\n\nexport interface ClickOutsideProps extends ClickOutsideConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\n// To support MenuRef had to change to any. Could manually do <HTMLElement & MenuRef> but seems brittle\nexport function isEventSource(ref: React.RefObject<any>, event: Event) {\n if (\n ref?.current &&\n event &&\n (event.target instanceof HTMLElement || event.target instanceof SVGElement)\n ) {\n return ref.current.contains(event.target)\n } else {\n return false\n }\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useClickOutside({\n refs = [],\n onClickOutside,\n container,\n}: ClickOutsideConfig) {\n const handler = (event: MouseEvent) => {\n if (onClickOutside && !refs.find((ref) => isEventSource(ref, event))) {\n onClickOutside(event)\n }\n }\n\n const options = { capture: true }\n\n const containerDocument = container?.ownerDocument\n const scope = containerDocument?.defaultView || undefined\n\n useEventListener({ event: 'click', handler, options, scope: scope })\n\n useEventListener({ event: 'touchend', handler, options, scope: scope })\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,iBAAiB;AAoBlD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,GAAyB,EAAEC,KAAY,EAAE;EACrE,IACED,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEE,OAAO,IACZD,KAAK,KACJA,KAAK,CAACE,MAAM,YAAYC,WAAW,IAAIH,KAAK,CAACE,MAAM,YAAYE,UAAU,CAAC,EAC3E;IACA,OAAOL,GAAG,CAACE,OAAO,CAACI,QAAQ,CAACL,KAAK,CAACE,MAAM,CAAC;EAC3C,CAAC,MAAM;IACL,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,eAAeA,CAAAC,IAAA,EAIR;EAAA,IAAAC,SAAA,GAAAD,IAAA,CAHrBE,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,EAAE,GAAAA,SAAA;IACTE,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,SAAS,GAAAJ,IAAA,CAATI,SAAS;EAET,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIZ,KAAiB,EAAK;IACrC,IAAIU,cAAc,IAAI,CAACD,IAAI,CAACI,IAAI,CAAC,UAACd,GAAG;MAAA,OAAKD,aAAa,CAACC,GAAG,EAAEC,KAAK,CAAC;IAAA,EAAC,EAAE;MACpEU,cAAc,CAACV,KAAK,CAAC;IACvB;EACF,CAAC;EAED,IAAMc,OAAO,GAAG;IAAEC,OAAO,EAAE;EAAK,CAAC;EAEjC,IAAMC,iBAAiB,GAAGL,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEM,aAAa;EAClD,IAAMC,KAAK,GAAG,CAAAF,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAEG,WAAW,KAAIC,SAAS;EAEzDvB,gBAAgB,CAAC;IAAEG,KAAK,EAAE,OAAO;IAAEY,OAAO,EAAPA,OAAO;IAAEE,OAAO,EAAPA,OAAO;IAAEI,KAAK,EAAEA;EAAM,CAAC,CAAC;EAEpErB,gBAAgB,CAAC;IAAEG,KAAK,EAAE,UAAU;IAAEY,OAAO,EAAPA,OAAO;IAAEE,OAAO,EAAPA,OAAO;IAAEI,KAAK,EAAEA;EAAM,CAAC,CAAC;AACzE"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _process$env$TZ_LOG;
|
|
3
|
-
function _construct(
|
|
4
|
-
function
|
|
5
|
-
function
|
|
6
|
-
function _toConsumableArray(
|
|
3
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
4
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
5
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
6
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
7
7
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
function _iterableToArray(
|
|
9
|
-
function _arrayWithoutHoles(
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
15
|
-
function _slicedToArray(
|
|
8
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
function _unsupportedIterableToArray(
|
|
18
|
-
function _arrayLikeToArray(
|
|
19
|
-
function _iterableToArrayLimit(
|
|
20
|
-
function _arrayWithHoles(
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
21
|
import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';
|
|
22
22
|
import * as React from 'react';
|
|
23
23
|
import { getPresetDateTimeOptions, intlDateTimeFormat } from '../../_utils/dateTime';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useTimer } from './Timer';
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["children"],
|
|
2
2
|
_excluded2 = ["children"];
|
|
3
|
-
function _objectWithoutProperties(
|
|
4
|
-
function _objectWithoutPropertiesLoose(
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useDelayedCallback } from './DelayedCallback';
|
|
7
7
|
import { useTimer } from './Timer';
|
|
@@ -12,19 +12,24 @@ import { useTimer } from './Timer';
|
|
|
12
12
|
* @deprecatedSince 9
|
|
13
13
|
* @deprecated Never officially documented/supported
|
|
14
14
|
*/
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* @deprecatedSince 9
|
|
17
18
|
* @deprecated Never officially documented/supported
|
|
18
19
|
*/
|
|
20
|
+
|
|
19
21
|
/**
|
|
20
22
|
* @deprecatedSince 9
|
|
21
23
|
* @deprecated Never officially documented/supported
|
|
22
24
|
*/
|
|
25
|
+
|
|
23
26
|
/**
|
|
24
27
|
* @deprecatedSince 9
|
|
25
28
|
* @deprecated Never officially documented/supported
|
|
26
29
|
*/
|
|
30
|
+
|
|
27
31
|
/* HOOK */
|
|
32
|
+
|
|
28
33
|
/**
|
|
29
34
|
* @deprecatedSince 9
|
|
30
35
|
* @deprecated Never officially documented/supported
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayedToggle.js","names":["React","useDelayedCallback","useTimer","useDelayedToggle","_ref","_ref$beforeDisable","beforeDisable","_ref$beforeEnable","beforeEnable","_ref$disableDelay","disableDelay","_ref$enableDelay","enableDelay","_ref$isEnabled","isEnabled","onDisable","onEnable","_ref$timer","timer","handleEnable","useCallback","reset","handleCancel","cancel","enable","after","before","delay","disable","toggle","DelayedToggle","forwardRef","props","ref","children","config","_objectWithoutProperties","_excluded","element","cloneElement","noop","method","console","warn","concat","initDelayedToggle","DelayedToggleContext","createContext","DelayedToggleProvider","_ref2","_excluded2","createElement","Provider","value","useDelayedToggleContext","useContext"],"sources":["../../src/_hooks/DelayedToggle.tsx"],"sourcesContent":["import React from 'react'\nimport type { BeforeCallback } from './DelayedCallback'\nimport { useDelayedCallback } from './DelayedCallback'\nimport type { TimerApi } from './Timer'\nimport { useTimer } from './Timer'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport type Callback = () => void\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n beforeDisable?: BeforeCallback\n /**\n * @since 10.19.0\n */\n beforeEnable?: BeforeCallback\n /**\n * @since 10.19.0\n */\n disableDelay?: number\n /**\n * @since 10.19.0\n */\n enableDelay?: number\n /**\n * @since 10.19.0\n */\n isEnabled?: boolean\n /**\n * @since 10.19.0\n */\n onDisable: Callback\n /**\n * @since 10.19.0\n */\n onEnable: Callback\n /**\n * @since 10.19.0\n */\n timer?: TimerApi\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface DelayedToggleProps extends DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactNode\n}\n\ninterface DelayedToggleRenderProps extends DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement | ((props: Api) => React.ReactElement)\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface Api {\n /**\n * @since 10.19.0\n */\n disable: (event: any) => any\n /**\n * @since 10.19.0\n */\n enable: (event: any) => any\n /**\n * @since 10.19.0\n */\n toggle: (event: any) => any\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDelayedToggle({\n beforeDisable = () => true,\n beforeEnable = () => true,\n disableDelay = 0,\n enableDelay = 0,\n isEnabled = false,\n onDisable,\n onEnable,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n timer = useTimer({}),\n}: DelayedToggleConfig): Api {\n const handleEnable = React.useCallback(() => {\n timer.reset()\n return true\n }, [timer])\n\n const handleCancel = React.useCallback(() => {\n timer.cancel()\n return false\n }, [timer])\n\n const enable = useDelayedCallback({\n after: onEnable,\n before: isEnabled ? handleEnable : beforeEnable,\n delay: enableDelay,\n timer,\n })\n\n const disable = useDelayedCallback({\n after: onDisable,\n before: isEnabled ? beforeDisable : handleCancel,\n delay: disableDelay,\n timer,\n })\n\n return {\n disable,\n enable,\n toggle: isEnabled ? disable : enable,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const DelayedToggle = React.forwardRef<\n HTMLElement,\n DelayedToggleRenderProps\n>(function DelayedToggle(props, ref) {\n const { children, ...config } = props\n\n const toggle = useDelayedToggle(config)\n\n const element =\n typeof children === 'function'\n ? (children as (props: Api) => React.ReactElement)(toggle)\n : (children as React.ReactElement)\n\n return element && React.cloneElement(element, { ref })\n})\n\n/* CONTEXT */\n\nconst noop: (method: string) => (event?: any) => any = (method) => () =>\n console.warn(\n `Could not call \\`${method}\\`, please wrap your component in an \\`<DelayedToggleProvider>\\``\n )\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const initDelayedToggle: Api = {\n disable: noop('disable'),\n enable: noop('enable'),\n toggle: noop('toggle'),\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const DelayedToggleContext = React.createContext<Api>(initDelayedToggle)\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function DelayedToggleProvider({\n children,\n ...props\n}: DelayedToggleProps) {\n return (\n <DelayedToggleContext.Provider value={useDelayedToggle(props)}>\n {children}\n </DelayedToggleContext.Provider>\n )\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDelayedToggleContext() {\n return React.useContext(DelayedToggleContext)\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,kBAAkB,QAAQ,mBAAmB;AAEtD,SAASC,QAAQ,QAAQ,SAAS;;AAElC;;AAEA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"DelayedToggle.js","names":["React","useDelayedCallback","useTimer","useDelayedToggle","_ref","_ref$beforeDisable","beforeDisable","_ref$beforeEnable","beforeEnable","_ref$disableDelay","disableDelay","_ref$enableDelay","enableDelay","_ref$isEnabled","isEnabled","onDisable","onEnable","_ref$timer","timer","handleEnable","useCallback","reset","handleCancel","cancel","enable","after","before","delay","disable","toggle","DelayedToggle","forwardRef","props","ref","children","config","_objectWithoutProperties","_excluded","element","cloneElement","noop","method","console","warn","concat","initDelayedToggle","DelayedToggleContext","createContext","DelayedToggleProvider","_ref2","_excluded2","createElement","Provider","value","useDelayedToggleContext","useContext"],"sources":["../../src/_hooks/DelayedToggle.tsx"],"sourcesContent":["import React from 'react'\nimport type { BeforeCallback } from './DelayedCallback'\nimport { useDelayedCallback } from './DelayedCallback'\nimport type { TimerApi } from './Timer'\nimport { useTimer } from './Timer'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport type Callback = () => void\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n beforeDisable?: BeforeCallback\n /**\n * @since 10.19.0\n */\n beforeEnable?: BeforeCallback\n /**\n * @since 10.19.0\n */\n disableDelay?: number\n /**\n * @since 10.19.0\n */\n enableDelay?: number\n /**\n * @since 10.19.0\n */\n isEnabled?: boolean\n /**\n * @since 10.19.0\n */\n onDisable: Callback\n /**\n * @since 10.19.0\n */\n onEnable: Callback\n /**\n * @since 10.19.0\n */\n timer?: TimerApi\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface DelayedToggleProps extends DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactNode\n}\n\ninterface DelayedToggleRenderProps extends DelayedToggleConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement | ((props: Api) => React.ReactElement)\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface Api {\n /**\n * @since 10.19.0\n */\n disable: (event: any) => any\n /**\n * @since 10.19.0\n */\n enable: (event: any) => any\n /**\n * @since 10.19.0\n */\n toggle: (event: any) => any\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDelayedToggle({\n beforeDisable = () => true,\n beforeEnable = () => true,\n disableDelay = 0,\n enableDelay = 0,\n isEnabled = false,\n onDisable,\n onEnable,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n timer = useTimer({}),\n}: DelayedToggleConfig): Api {\n const handleEnable = React.useCallback(() => {\n timer.reset()\n return true\n }, [timer])\n\n const handleCancel = React.useCallback(() => {\n timer.cancel()\n return false\n }, [timer])\n\n const enable = useDelayedCallback({\n after: onEnable,\n before: isEnabled ? handleEnable : beforeEnable,\n delay: enableDelay,\n timer,\n })\n\n const disable = useDelayedCallback({\n after: onDisable,\n before: isEnabled ? beforeDisable : handleCancel,\n delay: disableDelay,\n timer,\n })\n\n return {\n disable,\n enable,\n toggle: isEnabled ? disable : enable,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const DelayedToggle = React.forwardRef<\n HTMLElement,\n DelayedToggleRenderProps\n>(function DelayedToggle(props, ref) {\n const { children, ...config } = props\n\n const toggle = useDelayedToggle(config)\n\n const element =\n typeof children === 'function'\n ? (children as (props: Api) => React.ReactElement)(toggle)\n : (children as React.ReactElement)\n\n return element && React.cloneElement(element, { ref })\n})\n\n/* CONTEXT */\n\nconst noop: (method: string) => (event?: any) => any = (method) => () =>\n console.warn(\n `Could not call \\`${method}\\`, please wrap your component in an \\`<DelayedToggleProvider>\\``\n )\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const initDelayedToggle: Api = {\n disable: noop('disable'),\n enable: noop('enable'),\n toggle: noop('toggle'),\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport const DelayedToggleContext = React.createContext<Api>(initDelayedToggle)\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function DelayedToggleProvider({\n children,\n ...props\n}: DelayedToggleProps) {\n return (\n <DelayedToggleContext.Provider value={useDelayedToggle(props)}>\n {children}\n </DelayedToggleContext.Provider>\n )\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDelayedToggleContext() {\n return React.useContext(DelayedToggleContext)\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deprecation.js","names":["React","useDeprecation","config","oldThing","newThing","link","when","useLayoutEffect","indexOf","process","env","NODE_ENV","notice","concat","recommendation","console","warn"],"sources":["../../src/_hooks/Deprecation.tsx"],"sourcesContent":["import React from 'react'\n\ninterface Config {\n /**\n * @since 10.19.0\n */\n when?: any\n /**\n * @since 10.19.0\n */\n oldThing: string\n /**\n * @since 10.19.0\n */\n newThing?: string\n /**\n * @since 10.19.0\n */\n link?: string\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDeprecation(config: Config) {\n const { oldThing, newThing, link } = config\n let when = 'when' in config ? typeof config.when !== 'undefined' : true\n\n React.useLayoutEffect(() => {\n if (\n when &&\n ['test', 'development'].indexOf(process.env.NODE_ENV || '') >= 0\n ) {\n const notice = `${oldThing} is deprecated`\n const recommendation = newThing ? `, please use ${newThing}` : ''\n\n console.warn(`${notice}${recommendation}`, link ?? '')\n }\n }, [when, newThing, oldThing, link])\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAqBzB
|
|
1
|
+
{"version":3,"file":"Deprecation.js","names":["React","useDeprecation","config","oldThing","newThing","link","when","useLayoutEffect","indexOf","process","env","NODE_ENV","notice","concat","recommendation","console","warn"],"sources":["../../src/_hooks/Deprecation.tsx"],"sourcesContent":["import React from 'react'\n\ninterface Config {\n /**\n * @since 10.19.0\n */\n when?: any\n /**\n * @since 10.19.0\n */\n oldThing: string\n /**\n * @since 10.19.0\n */\n newThing?: string\n /**\n * @since 10.19.0\n */\n link?: string\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useDeprecation(config: Config) {\n const { oldThing, newThing, link } = config\n let when = 'when' in config ? typeof config.when !== 'undefined' : true\n\n React.useLayoutEffect(() => {\n if (\n when &&\n ['test', 'development'].indexOf(process.env.NODE_ENV || '') >= 0\n ) {\n const notice = `${oldThing} is deprecated`\n const recommendation = newThing ? `, please use ${newThing}` : ''\n\n console.warn(`${notice}${recommendation}`, link ?? '')\n }\n }, [when, newThing, oldThing, link])\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAqBzB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAAc,EAAE;EAC7C,IAAQC,QAAQ,GAAqBD,MAAM,CAAnCC,QAAQ;IAAEC,QAAQ,GAAWF,MAAM,CAAzBE,QAAQ;IAAEC,IAAI,GAAKH,MAAM,CAAfG,IAAI;EAChC,IAAIC,IAAI,GAAG,MAAM,IAAIJ,MAAM,GAAG,OAAOA,MAAM,CAACI,IAAI,KAAK,WAAW,GAAG,IAAI;EAEvEN,KAAK,CAACO,eAAe,CAAC,YAAM;IAC1B,IACED,IAAI,IACJ,CAAC,MAAM,EAAE,aAAa,CAAC,CAACE,OAAO,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,EAChE;MACA,IAAMC,MAAM,MAAAC,MAAA,CAAMV,QAAQ,mBAAgB;MAC1C,IAAMW,cAAc,GAAGV,QAAQ,mBAAAS,MAAA,CAAmBT,QAAQ,IAAK,EAAE;MAEjEW,OAAO,CAACC,IAAI,IAAAH,MAAA,CAAID,MAAM,EAAAC,MAAA,CAAGC,cAAc,GAAIT,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,EAAE,CAAC;IACxD;EACF,CAAC,EAAE,CAACC,IAAI,EAAEF,QAAQ,EAAED,QAAQ,EAAEE,IAAI,CAAC,CAAC;AACtC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _toConsumableArray(
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _iterableToArray(
|
|
5
|
-
function _arrayWithoutHoles(
|
|
6
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
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; }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
function _slicedToArray(
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
6
|
-
function _iterableToArrayLimit(
|
|
7
|
-
function _arrayWithHoles(
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
8
|
import { FocusScope } from '@react-aria/focus';
|
|
9
9
|
import React, { useMemo } from 'react';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusScopeOverride.js","names":["FocusScope","React","useMemo","FocusScopeOverrideContext","createContext","setProps","useOverridableFocusScope","useContext","OverridableFocusScope","props","_React$useState","useState","_React$useState2","_slicedToArray","overrideProps","value","createElement","Provider","_extends"],"sources":["../../src/_hooks/FocusScopeOverride.tsx"],"sourcesContent":["import type { FocusScopeProps } from '@react-aria/focus'\nimport { FocusScope } from '@react-aria/focus'\nimport React, { useMemo } from 'react'\n\n/**\n * STOP - READ BEFORE USING\n *\n * The following wrapper was added to help TinyMCE modals.\n * When used with React Aria contained Focus Scope,\n * focus does not move into the TinyMCE modal.\n * This patch gets critical functionality back at\n * the cost of possibly failing accessbility.\n * This hack keeps bugfixes for TinyMCE internal.\n * If a TextEditor isn't really a valid child,\n * use the plain FocusScope from React Aria.\n */\n\ntype OverrideProps = Omit<FocusScopeProps, 'children'>\n\nconst FocusScopeOverrideContext = React.createContext<{\n setProps: (arg: OverrideProps) => void\n}>({\n setProps: () => {},\n})\n\nexport function useOverridableFocusScope() {\n return React.useContext(FocusScopeOverrideContext)\n}\n\nexport function OverridableFocusScope(props: FocusScopeProps) {\n const [overrideProps, setProps] = React.useState<OverrideProps>()\n\n const value = useMemo(() => ({ setProps }), [setProps])\n return (\n <FocusScopeOverrideContext.Provider value={value}>\n <FocusScope {...props} {...overrideProps} />\n </FocusScopeOverrideContext.Provider>\n )\n}\n"],"mappings":";;;;;;;AACA,SAASA,UAAU,QAAQ,mBAAmB;AAC9C,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,IAAMC,yBAAyB,gBAAGF,KAAK,CAACG,aAAa,CAElD;EACDC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"FocusScopeOverride.js","names":["FocusScope","React","useMemo","FocusScopeOverrideContext","createContext","setProps","useOverridableFocusScope","useContext","OverridableFocusScope","props","_React$useState","useState","_React$useState2","_slicedToArray","overrideProps","value","createElement","Provider","_extends"],"sources":["../../src/_hooks/FocusScopeOverride.tsx"],"sourcesContent":["import type { FocusScopeProps } from '@react-aria/focus'\nimport { FocusScope } from '@react-aria/focus'\nimport React, { useMemo } from 'react'\n\n/**\n * STOP - READ BEFORE USING\n *\n * The following wrapper was added to help TinyMCE modals.\n * When used with React Aria contained Focus Scope,\n * focus does not move into the TinyMCE modal.\n * This patch gets critical functionality back at\n * the cost of possibly failing accessbility.\n * This hack keeps bugfixes for TinyMCE internal.\n * If a TextEditor isn't really a valid child,\n * use the plain FocusScope from React Aria.\n */\n\ntype OverrideProps = Omit<FocusScopeProps, 'children'>\n\nconst FocusScopeOverrideContext = React.createContext<{\n setProps: (arg: OverrideProps) => void\n}>({\n setProps: () => {},\n})\n\nexport function useOverridableFocusScope() {\n return React.useContext(FocusScopeOverrideContext)\n}\n\nexport function OverridableFocusScope(props: FocusScopeProps) {\n const [overrideProps, setProps] = React.useState<OverrideProps>()\n\n const value = useMemo(() => ({ setProps }), [setProps])\n return (\n <FocusScopeOverrideContext.Provider value={value}>\n <FocusScope {...props} {...overrideProps} />\n </FocusScopeOverrideContext.Provider>\n )\n}\n"],"mappings":";;;;;;;AACA,SAASA,UAAU,QAAQ,mBAAmB;AAC9C,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,IAAMC,yBAAyB,gBAAGF,KAAK,CAACG,aAAa,CAElD;EACDC,QAAQ,EAAE,SAAVA,QAAQA,CAAA,EAAQ,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAOL,KAAK,CAACM,UAAU,CAACJ,yBAAyB,CAAC;AACpD;AAEA,OAAO,SAASK,qBAAqBA,CAACC,KAAsB,EAAE;EAC5D,IAAAC,eAAA,GAAkCT,KAAK,CAACU,QAAQ,CAAgB,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA1DI,aAAa,GAAAF,gBAAA;IAAEP,QAAQ,GAAAO,gBAAA;EAE9B,IAAMG,KAAK,GAAGb,OAAO,CAAC;IAAA,OAAO;MAAEG,QAAQ,EAARA;IAAS,CAAC;EAAA,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACvD,oBACEJ,KAAA,CAAAe,aAAA,CAACb,yBAAyB,CAACc,QAAQ;IAACF,KAAK,EAAEA;EAAM,gBAC/Cd,KAAA,CAAAe,aAAA,CAAChB,UAAU,EAAAkB,QAAA,KAAKT,KAAK,EAAMK,aAAa,CAAG,CACT,CAAC;AAEzC"}
|
package/dist/_hooks/Hotkey.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["scope"];
|
|
2
|
-
function _objectWithoutProperties(
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import { useEventListener } from './EventListener';
|
|
5
5
|
function bindHotkeys(_ref) {
|
|
6
6
|
var _ref$dependencies = _ref.dependencies,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotkey.js","names":["useEventListener","bindHotkeys","_ref","_ref$dependencies","dependencies","_ref$event","event","_ref$handler","handler","key","preventDefault","stopPropagation","scope","keys","Array","isArray","e","includes","useHotkey","_ref2","_ref2$scope","window","config","_objectWithoutProperties","_excluded","scopes","forEach"],"sources":["../../src/_hooks/Hotkey.ts"],"sourcesContent":["import type { Scope } from './EventListener'\nimport { useEventListener } from './EventListener'\n\ntype EventType = 'keydown' | 'keyup'\n\ninterface Config {\n /**\n * @since 10.19.0\n */\n dependencies?: any[]\n /**\n * @since 10.19.0\n */\n event?: EventType\n /**\n * @since 10.19.0\n */\n handler: (event: KeyboardEvent) => void\n /**\n * @since 10.19.0\n */\n key: string | string[]\n /**\n * @since 10.19.0\n */\n preventDefault?: boolean\n /**\n * @since 10.19.0\n */\n scope?: Scope\n /**\n * @since 10.19.0\n */\n stopPropagation?: boolean\n}\n\nfunction bindHotkeys({\n dependencies = [],\n event = 'keydown',\n handler = () => {},\n key,\n preventDefault,\n stopPropagation,\n}: Config) {\n return (scope: Scope) => {\n const keys = Array.isArray(key) ? key : [key]\n\n useEventListener({\n dependencies,\n event,\n handler: (e: KeyboardEvent) => {\n if (keys.includes(e.key)) {\n handler(e)\n preventDefault && e.preventDefault()\n stopPropagation && e.stopPropagation()\n }\n },\n scope,\n })\n }\n}\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated Pass functions directly to JSX elements. For window events, add a new listener and remove it in an effect\n */\nexport function useHotkey({ scope = window, ...config }: Config) {\n const scopes = Array.isArray(scope) ? scope : [scope]\n\n scopes.forEach(bindHotkeys(config))\n}\n"],"mappings":";;;AACA,SAASA,gBAAgB,QAAQ,iBAAiB;AAmClD,SAASC,WAAWA,CAAAC,IAAA,EAOT;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CANTE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,UAAA,GAAAH,IAAA,CACjBI,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,SAAS,GAAAA,UAAA;IAAAE,YAAA,GAAAL,IAAA,CACjBM,OAAO;IAAPA,QAAO,GAAAD,YAAA,cAAG,YAAM,CAAC,CAAC,GAAAA,YAAA;IAClBE,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,eAAe,GAAAT,IAAA,CAAfS,eAAe;EAEf,OAAO,UAACC,KAAY,EAAK;IACvB,IAAMC,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACN,GAAG,CAAC,GAAGA,GAAG,GAAG,CAACA,GAAG,CAAC;IAE7CT,gBAAgB,CAAC;MACfI,YAAY,EAAZA,YAAY;MACZE,KAAK,EAALA,KAAK;MACLE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Hotkey.js","names":["useEventListener","bindHotkeys","_ref","_ref$dependencies","dependencies","_ref$event","event","_ref$handler","handler","key","preventDefault","stopPropagation","scope","keys","Array","isArray","e","includes","useHotkey","_ref2","_ref2$scope","window","config","_objectWithoutProperties","_excluded","scopes","forEach"],"sources":["../../src/_hooks/Hotkey.ts"],"sourcesContent":["import type { Scope } from './EventListener'\nimport { useEventListener } from './EventListener'\n\ntype EventType = 'keydown' | 'keyup'\n\ninterface Config {\n /**\n * @since 10.19.0\n */\n dependencies?: any[]\n /**\n * @since 10.19.0\n */\n event?: EventType\n /**\n * @since 10.19.0\n */\n handler: (event: KeyboardEvent) => void\n /**\n * @since 10.19.0\n */\n key: string | string[]\n /**\n * @since 10.19.0\n */\n preventDefault?: boolean\n /**\n * @since 10.19.0\n */\n scope?: Scope\n /**\n * @since 10.19.0\n */\n stopPropagation?: boolean\n}\n\nfunction bindHotkeys({\n dependencies = [],\n event = 'keydown',\n handler = () => {},\n key,\n preventDefault,\n stopPropagation,\n}: Config) {\n return (scope: Scope) => {\n const keys = Array.isArray(key) ? key : [key]\n\n useEventListener({\n dependencies,\n event,\n handler: (e: KeyboardEvent) => {\n if (keys.includes(e.key)) {\n handler(e)\n preventDefault && e.preventDefault()\n stopPropagation && e.stopPropagation()\n }\n },\n scope,\n })\n }\n}\n\n/**\n * @deprecatedSince 9.7.0\n * @deprecated Pass functions directly to JSX elements. For window events, add a new listener and remove it in an effect\n */\nexport function useHotkey({ scope = window, ...config }: Config) {\n const scopes = Array.isArray(scope) ? scope : [scope]\n\n scopes.forEach(bindHotkeys(config))\n}\n"],"mappings":";;;AACA,SAASA,gBAAgB,QAAQ,iBAAiB;AAmClD,SAASC,WAAWA,CAAAC,IAAA,EAOT;EAAA,IAAAC,iBAAA,GAAAD,IAAA,CANTE,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAAAE,UAAA,GAAAH,IAAA,CACjBI,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,SAAS,GAAAA,UAAA;IAAAE,YAAA,GAAAL,IAAA,CACjBM,OAAO;IAAPA,QAAO,GAAAD,YAAA,cAAG,YAAM,CAAC,CAAC,GAAAA,YAAA;IAClBE,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,eAAe,GAAAT,IAAA,CAAfS,eAAe;EAEf,OAAO,UAACC,KAAY,EAAK;IACvB,IAAMC,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACN,GAAG,CAAC,GAAGA,GAAG,GAAG,CAACA,GAAG,CAAC;IAE7CT,gBAAgB,CAAC;MACfI,YAAY,EAAZA,YAAY;MACZE,KAAK,EAALA,KAAK;MACLE,OAAO,EAAE,SAATA,OAAOA,CAAGQ,CAAgB,EAAK;QAC7B,IAAIH,IAAI,CAACI,QAAQ,CAACD,CAAC,CAACP,GAAG,CAAC,EAAE;UACxBD,QAAO,CAACQ,CAAC,CAAC;UACVN,cAAc,IAAIM,CAAC,CAACN,cAAc,CAAC,CAAC;UACpCC,eAAe,IAAIK,CAAC,CAACL,eAAe,CAAC,CAAC;QACxC;MACF,CAAC;MACDC,KAAK,EAALA;IACF,CAAC,CAAC;EACJ,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASM,SAASA,CAAAC,KAAA,EAAwC;EAAA,IAAAC,WAAA,GAAAD,KAAA,CAArCP,KAAK;IAALA,KAAK,GAAAQ,WAAA,cAAGC,MAAM,GAAAD,WAAA;IAAKE,MAAM,GAAAC,wBAAA,CAAAJ,KAAA,EAAAK,SAAA;EACnD,IAAMC,MAAM,GAAGX,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;EAErDa,MAAM,CAACC,OAAO,CAACzB,WAAW,CAACqB,MAAM,CAAC,CAAC;AACrC"}
|
package/dist/_hooks/I18n.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
|
-
function _typeof(
|
|
3
|
-
function _objectWithoutProperties(
|
|
4
|
-
function _objectWithoutPropertiesLoose(
|
|
5
|
-
function _toConsumableArray(
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
6
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _unsupportedIterableToArray(
|
|
8
|
-
function _iterableToArray(
|
|
9
|
-
function _arrayWithoutHoles(
|
|
10
|
-
function _arrayLikeToArray(
|
|
11
|
-
function ownKeys(
|
|
12
|
-
function _objectSpread(
|
|
13
|
-
function _defineProperty(
|
|
14
|
-
function _toPropertyKey(
|
|
15
|
-
function _toPrimitive(
|
|
7
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
|
+
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; }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
16
|
import { createI18njs } from '@procore/core-i18n-js';
|
|
17
17
|
import * as R from 'ramda';
|
|
18
18
|
import React from 'react';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
|
-
function _objectWithoutProperties(
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
4
|
-
function _slicedToArray(
|
|
2
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(
|
|
7
|
-
function _arrayLikeToArray(
|
|
8
|
-
function _iterableToArrayLimit(
|
|
9
|
-
function _arrayWithHoles(
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
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
|
+
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
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
|
|
12
12
|
/* TYPES */
|
|
13
13
|
|
|
14
14
|
/* HOOK */
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* @deprecatedSince 11
|
|
17
18
|
* @deprecated Not a concern of the Design System. See source to duplicate https://github.com/procore/core/blob/%40procore/core-react%4010.30.0/packages/core-react/src/state/InjectedScript.tsx#L25
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InjectedScript.js","names":["React","useInjectedScript","_ref","id","src","_React$useState","useState","_React$useState2","_slicedToArray","isLoaded","setLoaded","useEffect","existingScript","document","getElementById","script","createElement","type","async","onload","head","appendChild","InjectedScript","_ref2","_ref2$children","children","props","_objectWithoutProperties","_excluded","injectedScript"],"sources":["../../src/_hooks/InjectedScript.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\ninterface InjectedScriptConfig {\n id: string\n src: string\n}\n\ninterface InjectedScriptApi {\n isLoaded: boolean\n setLoaded: (isLoaded: boolean) => void\n}\n\ninterface Props extends InjectedScriptConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends InjectedScriptConfig {\n children?: ((props: InjectedScriptApi) => React.ReactNode) | null\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 11\n * @deprecated Not a concern of the Design System. See source to duplicate https://github.com/procore/core/blob/%40procore/core-react%4010.30.0/packages/core-react/src/state/InjectedScript.tsx#L25\n */\nexport function useInjectedScript({ id, src }: InjectedScriptConfig) {\n const [isLoaded, setLoaded] = React.useState(false)\n\n React.useEffect(() => {\n const existingScript = document.getElementById(id)\n\n if (existingScript) {\n setLoaded(true)\n } else {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.async = true\n script.id = id\n script.onload = () => {\n setLoaded(true)\n }\n script.src = src\n\n document.head && document.head.appendChild(script)\n }\n }, [id, src])\n\n return { isLoaded, setLoaded }\n}\n\n/* RENDER PROP */\n/**\n * @deprecatedSince 11\n * @deprecated Not a concern of the Design System. See source to duplicate https://github.com/procore/core/blob/%40procore/core-react%4010.30.0/packages/core-react/src/state/InjectedScript.tsx#L25\n */\nexport function InjectedScript({ children = null, ...props }: RenderProps) {\n const injectedScript = useInjectedScript(props)\n\n return typeof children === 'function' ? children(injectedScript) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAoBA
|
|
1
|
+
{"version":3,"file":"InjectedScript.js","names":["React","useInjectedScript","_ref","id","src","_React$useState","useState","_React$useState2","_slicedToArray","isLoaded","setLoaded","useEffect","existingScript","document","getElementById","script","createElement","type","async","onload","head","appendChild","InjectedScript","_ref2","_ref2$children","children","props","_objectWithoutProperties","_excluded","injectedScript"],"sources":["../../src/_hooks/InjectedScript.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\ninterface InjectedScriptConfig {\n id: string\n src: string\n}\n\ninterface InjectedScriptApi {\n isLoaded: boolean\n setLoaded: (isLoaded: boolean) => void\n}\n\ninterface Props extends InjectedScriptConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends InjectedScriptConfig {\n children?: ((props: InjectedScriptApi) => React.ReactNode) | null\n}\n\n/* HOOK */\n\n/**\n * @deprecatedSince 11\n * @deprecated Not a concern of the Design System. See source to duplicate https://github.com/procore/core/blob/%40procore/core-react%4010.30.0/packages/core-react/src/state/InjectedScript.tsx#L25\n */\nexport function useInjectedScript({ id, src }: InjectedScriptConfig) {\n const [isLoaded, setLoaded] = React.useState(false)\n\n React.useEffect(() => {\n const existingScript = document.getElementById(id)\n\n if (existingScript) {\n setLoaded(true)\n } else {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.async = true\n script.id = id\n script.onload = () => {\n setLoaded(true)\n }\n script.src = src\n\n document.head && document.head.appendChild(script)\n }\n }, [id, src])\n\n return { isLoaded, setLoaded }\n}\n\n/* RENDER PROP */\n/**\n * @deprecatedSince 11\n * @deprecated Not a concern of the Design System. See source to duplicate https://github.com/procore/core/blob/%40procore/core-react%4010.30.0/packages/core-react/src/state/InjectedScript.tsx#L25\n */\nexport function InjectedScript({ children = null, ...props }: RenderProps) {\n const injectedScript = useInjectedScript(props)\n\n return typeof children === 'function' ? children(injectedScript) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAoBA;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAAC,IAAA,EAAoC;EAAA,IAAjCC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;EACzC,IAAAC,eAAA,GAA8BL,KAAK,CAACM,QAAQ,CAAC,KAAK,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA;IAA5CI,QAAQ,GAAAF,gBAAA;IAAEG,SAAS,GAAAH,gBAAA;EAE1BP,KAAK,CAACW,SAAS,CAAC,YAAM;IACpB,IAAMC,cAAc,GAAGC,QAAQ,CAACC,cAAc,CAACX,EAAE,CAAC;IAElD,IAAIS,cAAc,EAAE;MAClBF,SAAS,CAAC,IAAI,CAAC;IACjB,CAAC,MAAM;MACL,IAAMK,MAAM,GAAGF,QAAQ,CAACG,aAAa,CAAC,QAAQ,CAAC;MAC/CD,MAAM,CAACE,IAAI,GAAG,iBAAiB;MAC/BF,MAAM,CAACG,KAAK,GAAG,IAAI;MACnBH,MAAM,CAACZ,EAAE,GAAGA,EAAE;MACdY,MAAM,CAACI,MAAM,GAAG,YAAM;QACpBT,SAAS,CAAC,IAAI,CAAC;MACjB,CAAC;MACDK,MAAM,CAACX,GAAG,GAAGA,GAAG;MAEhBS,QAAQ,CAACO,IAAI,IAAIP,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACN,MAAM,CAAC;IACpD;EACF,CAAC,EAAE,CAACZ,EAAE,EAAEC,GAAG,CAAC,CAAC;EAEb,OAAO;IAAEK,QAAQ,EAARA,QAAQ;IAAEC,SAAS,EAATA;EAAU,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,cAAcA,CAAAC,KAAA,EAA6C;EAAA,IAAAC,cAAA,GAAAD,KAAA,CAA1CE,QAAQ;IAARA,QAAQ,GAAAD,cAAA,cAAG,IAAI,GAAAA,cAAA;IAAKE,KAAK,GAAAC,wBAAA,CAAAJ,KAAA,EAAAK,SAAA;EACxD,IAAMC,cAAc,GAAG5B,iBAAiB,CAACyB,KAAK,CAAC;EAE/C,OAAO,OAAOD,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACI,cAAc,CAAC,GAAGJ,QAAQ;AAC7E"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _slicedToArray(
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _arrayLikeToArray(
|
|
5
|
-
function _iterableToArrayLimit(
|
|
6
|
-
function _arrayWithHoles(
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { createIntersectionObserver } from './createIntersectionObserver';
|
|
9
9
|
export function useIntersectionObserver(callback) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
|
-
function _objectWithoutProperties(
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
4
|
-
function _slicedToArray(
|
|
2
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(
|
|
7
|
-
function _arrayLikeToArray(
|
|
8
|
-
function _iterableToArrayLimit(
|
|
9
|
-
function _arrayWithHoles(
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
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
|
+
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
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
|
|
12
12
|
/* TYPES */
|
|
@@ -15,10 +15,12 @@ import React from 'react';
|
|
|
15
15
|
* @deprecatedSince 9
|
|
16
16
|
* @deprecated Never officially documented/supported
|
|
17
17
|
*/
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* @deprecatedSince 9
|
|
20
21
|
* @deprecated Never officially documented/supported
|
|
21
22
|
*/
|
|
23
|
+
|
|
22
24
|
function clamp(max, n) {
|
|
23
25
|
return Math.min(max - 1, Math.max(0, n));
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListNavigation.js","names":["React","clamp","max","n","Math","min","wrap","useListNavigation","_ref","_ref$circular","circular","_ref$initialIndex","initialIndex","_ref$size","size","initialSize","_React$useState","useState","_React$useState2","_slicedToArray","index","setIndex","_React$useState3","_React$useState4","setSize","set","useCallback","i","clear","increment","incrementBy","amount","decrement","decrementBy","reset","ListNavigation","_ref2","children","props","_objectWithoutProperties","_excluded","listNavigation"],"sources":["../../src/_hooks/ListNavigation.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface ListNavigationConfig {\n circular?: boolean\n initialIndex?: number\n size?: number\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface ListNavigationApi {\n clear: () => void\n decrement: () => void\n decrementBy: (amount: number) => void\n increment: () => void\n incrementBy: (amount: number) => void\n index: number\n reset: () => void\n set: (index: number) => void\n setSize: (index: number) => void\n size: number\n}\n\ninterface Props extends ListNavigationConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends ListNavigationConfig {\n children: (props: ListNavigationApi) => {}\n}\n\nfunction clamp(max: number, n: number) {\n return Math.min(max - 1, Math.max(0, n))\n}\n\nfunction wrap(max: number, n: number) {\n if (max === 0) {\n return n\n }\n\n return n < 0 ? max + n : n % max\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useListNavigation({\n circular = false,\n initialIndex = 0,\n size: initialSize = 0,\n}: ListNavigationConfig): ListNavigationApi {\n const [index, setIndex] = React.useState(initialIndex)\n\n const [size, setSize] = React.useState(initialSize)\n\n const set = React.useCallback(\n function (i: number) {\n if (size === 0) {\n setIndex(i)\n } else {\n setIndex(clamp(size, circular ? wrap(size, i) : i))\n }\n },\n [circular, size]\n )\n\n function clear() {\n set(0)\n }\n\n function increment() {\n set(index + 1)\n }\n\n function incrementBy(amount: number) {\n set(index + amount)\n }\n\n function decrement() {\n set(index - 1)\n }\n\n function decrementBy(amount: number) {\n set(index - amount)\n }\n\n function reset() {\n set(initialIndex)\n }\n\n return {\n clear,\n decrement,\n decrementBy,\n increment,\n incrementBy,\n index,\n reset,\n set,\n setSize,\n size,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function ListNavigation({ children, ...props }: RenderProps) {\n const listNavigation = useListNavigation(props)\n\n return typeof children === 'function' ? children(listNavigation) : children\n}\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;;AAEA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"ListNavigation.js","names":["React","clamp","max","n","Math","min","wrap","useListNavigation","_ref","_ref$circular","circular","_ref$initialIndex","initialIndex","_ref$size","size","initialSize","_React$useState","useState","_React$useState2","_slicedToArray","index","setIndex","_React$useState3","_React$useState4","setSize","set","useCallback","i","clear","increment","incrementBy","amount","decrement","decrementBy","reset","ListNavigation","_ref2","children","props","_objectWithoutProperties","_excluded","listNavigation"],"sources":["../../src/_hooks/ListNavigation.tsx"],"sourcesContent":["import React from 'react'\n\n/* TYPES */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface ListNavigationConfig {\n circular?: boolean\n initialIndex?: number\n size?: number\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport interface ListNavigationApi {\n clear: () => void\n decrement: () => void\n decrementBy: (amount: number) => void\n increment: () => void\n incrementBy: (amount: number) => void\n index: number\n reset: () => void\n set: (index: number) => void\n setSize: (index: number) => void\n size: number\n}\n\ninterface Props extends ListNavigationConfig {\n children?: React.ReactNode\n}\n\ninterface RenderProps extends ListNavigationConfig {\n children: (props: ListNavigationApi) => {}\n}\n\nfunction clamp(max: number, n: number) {\n return Math.min(max - 1, Math.max(0, n))\n}\n\nfunction wrap(max: number, n: number) {\n if (max === 0) {\n return n\n }\n\n return n < 0 ? max + n : n % max\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useListNavigation({\n circular = false,\n initialIndex = 0,\n size: initialSize = 0,\n}: ListNavigationConfig): ListNavigationApi {\n const [index, setIndex] = React.useState(initialIndex)\n\n const [size, setSize] = React.useState(initialSize)\n\n const set = React.useCallback(\n function (i: number) {\n if (size === 0) {\n setIndex(i)\n } else {\n setIndex(clamp(size, circular ? wrap(size, i) : i))\n }\n },\n [circular, size]\n )\n\n function clear() {\n set(0)\n }\n\n function increment() {\n set(index + 1)\n }\n\n function incrementBy(amount: number) {\n set(index + amount)\n }\n\n function decrement() {\n set(index - 1)\n }\n\n function decrementBy(amount: number) {\n set(index - amount)\n }\n\n function reset() {\n set(initialIndex)\n }\n\n return {\n clear,\n decrement,\n decrementBy,\n increment,\n incrementBy,\n index,\n reset,\n set,\n setSize,\n size,\n }\n}\n\n/* RENDER PROP */\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function ListNavigation({ children, ...props }: RenderProps) {\n const listNavigation = useListNavigation(props)\n\n return typeof children === 'function' ? children(listNavigation) : children\n}\n"],"mappings":"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"}
|