@jetshop/ui 6.3.5 → 7.0.0-alpha-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/Accordion/Accordion.d.ts +0 -33
- package/Accordion/Accordion.js +0 -59
- package/Accordion/Accordion.js.map +0 -1
- package/Auth/FormFields/CountriesInput.d.ts +0 -16
- package/Auth/FormFields/CountriesInput.js +0 -28
- package/Auth/FormFields/CountriesInput.js.map +0 -1
- package/Auth/LogInBehavior.d.ts +0 -22
- package/Auth/LogInBehavior.js +0 -24
- package/Auth/LogInBehavior.js.map +0 -1
- package/Auth/LogInFormProvider.d.ts +0 -7
- package/Auth/LogInFormProvider.js +0 -70
- package/Auth/LogInFormProvider.js.map +0 -1
- package/Auth/LogOut.d.ts +0 -10
- package/Auth/LogOut.js +0 -24
- package/Auth/LogOut.js.map +0 -1
- package/Auth/logInValidator.d.ts +0 -10
- package/Auth/logInValidator.js +0 -16
- package/Auth/logInValidator.js.map +0 -1
- package/Breadcrumbs/Breadcrumbs.d.ts +0 -14
- package/Breadcrumbs/Breadcrumbs.js +0 -84
- package/Breadcrumbs/Breadcrumbs.js.map +0 -1
- package/Breadcrumbs/getParentsOrCanonicalRoute.d.ts +0 -3
- package/Breadcrumbs/getParentsOrCanonicalRoute.js +0 -14
- package/Breadcrumbs/getParentsOrCanonicalRoute.js.map +0 -1
- package/Breadcrumbs/index.d.ts +0 -1
- package/Breadcrumbs/index.js +0 -2
- package/Breadcrumbs/index.js.map +0 -1
- package/Breakpoints.d.ts +0 -12
- package/Breakpoints.js +0 -36
- package/Breakpoints.js.map +0 -1
- package/Button/Button.d.ts +0 -14
- package/Button/Button.js +0 -60
- package/Button/Button.js.map +0 -1
- package/Button/SecondaryButton.d.ts +0 -2
- package/Button/SecondaryButton.js +0 -9
- package/Button/SecondaryButton.js.map +0 -1
- package/Button/TrendButton.d.ts +0 -2
- package/Button/TrendButton.js +0 -8
- package/Button/TrendButton.js.map +0 -1
- package/Button/index.d.ts +0 -4
- package/Button/index.js +0 -5
- package/Button/index.js.map +0 -1
- package/CategoryLink.d.ts +0 -11
- package/CategoryLink.js +0 -49
- package/CategoryLink.js.map +0 -1
- package/ChannelSelector/ChannelListItem.d.ts +0 -10
- package/ChannelSelector/ChannelListItem.js +0 -51
- package/ChannelSelector/ChannelListItem.js.map +0 -1
- package/ChannelSelector/ChannelSelector.d.ts +0 -63
- package/ChannelSelector/ChannelSelector.js +0 -80
- package/ChannelSelector/ChannelSelector.js.map +0 -1
- package/ChannelSelector/ChannelSelectorButtons.d.ts +0 -2
- package/ChannelSelector/ChannelSelectorButtons.js +0 -20
- package/ChannelSelector/ChannelSelectorButtons.js.map +0 -1
- package/ChannelSelector/Channels.d.ts +0 -17
- package/ChannelSelector/Channels.js +0 -12
- package/ChannelSelector/Channels.js.map +0 -1
- package/ChannelSelector/LargeSelector.d.ts +0 -3
- package/ChannelSelector/LargeSelector.js +0 -67
- package/ChannelSelector/LargeSelector.js.map +0 -1
- package/ChannelSelector/MiniSelector.d.ts +0 -4
- package/ChannelSelector/MiniSelector.js +0 -58
- package/ChannelSelector/MiniSelector.js.map +0 -1
- package/ChannelSelector/Region.d.ts +0 -28
- package/ChannelSelector/Region.js +0 -21
- package/ChannelSelector/Region.js.map +0 -1
- package/ChannelSelector/groupBy.d.ts +0 -7
- package/ChannelSelector/groupBy.js +0 -16
- package/ChannelSelector/groupBy.js.map +0 -1
- package/Checkbox/Checkbox.d.ts +0 -14
- package/Checkbox/Checkbox.js +0 -70
- package/Checkbox/Checkbox.js.map +0 -1
- package/Checkbox/CheckboxGroup.d.ts +0 -27
- package/Checkbox/CheckboxGroup.js +0 -22
- package/Checkbox/CheckboxGroup.js.map +0 -1
- package/Checkbox/index.d.ts +0 -2
- package/Checkbox/index.js +0 -3
- package/Checkbox/index.js.map +0 -1
- package/ContentPageLink.d.ts +0 -11
- package/ContentPageLink.js +0 -46
- package/ContentPageLink.js.map +0 -1
- package/ContentRenderer.d.ts +0 -9
- package/ContentRenderer.js +0 -36
- package/ContentRenderer.js.map +0 -1
- package/DropdownMenu/Button.d.ts +0 -7
- package/DropdownMenu/Button.js +0 -33
- package/DropdownMenu/Button.js.map +0 -1
- package/DropdownMenu/DropdownMenu.d.ts +0 -21
- package/DropdownMenu/DropdownMenu.js +0 -72
- package/DropdownMenu/DropdownMenu.js.map +0 -1
- package/DropdownMenu/Item.d.ts +0 -13
- package/DropdownMenu/Item.js +0 -48
- package/DropdownMenu/Item.js.map +0 -1
- package/DropdownMenu/Items.d.ts +0 -16
- package/DropdownMenu/Items.js +0 -53
- package/DropdownMenu/Items.js.map +0 -1
- package/DropdownMenu/index.d.ts +0 -4
- package/DropdownMenu/index.js +0 -5
- package/DropdownMenu/index.js.map +0 -1
- package/ErrorBoundary/Generic.d.ts +0 -18
- package/ErrorBoundary/Generic.js +0 -69
- package/ErrorBoundary/Generic.js.map +0 -1
- package/ErrorBoundary/PassThrough.d.ts +0 -3
- package/ErrorBoundary/PassThrough.js +0 -7
- package/ErrorBoundary/PassThrough.js.map +0 -1
- package/Gallery/Gallery.d.ts +0 -39
- package/Gallery/Gallery.js +0 -121
- package/Gallery/Gallery.js.map +0 -1
- package/Gallery/constructGallery.d.ts +0 -15
- package/Gallery/constructGallery.js +0 -40
- package/Gallery/constructGallery.js.map +0 -1
- package/Image/BaseImage.d.ts +0 -39
- package/Image/BaseImage.js +0 -192
- package/Image/BaseImage.js.map +0 -1
- package/Image/Fallback.d.ts +0 -5
- package/Image/Fallback.js +0 -4
- package/Image/Fallback.js.map +0 -1
- package/Image/FlightImage.d.ts +0 -51
- package/Image/FlightImage.js +0 -59
- package/Image/FlightImage.js.map +0 -1
- package/Image/Image.d.ts +0 -2
- package/Image/Image.js +0 -3
- package/Image/Image.js.map +0 -1
- package/Image/index.d.ts +0 -1
- package/Image/index.js +0 -2
- package/Image/index.js.map +0 -1
- package/Image/useConstructImage.d.ts +0 -49
- package/Image/useConstructImage.js +0 -122
- package/Image/useConstructImage.js.map +0 -1
- package/Image/utils/aspectRatioToFraction.d.ts +0 -2
- package/Image/utils/aspectRatioToFraction.js +0 -11
- package/Image/utils/aspectRatioToFraction.js.map +0 -1
- package/Image/utils/getFullUrl.d.ts +0 -6
- package/Image/utils/getFullUrl.js +0 -18
- package/Image/utils/getFullUrl.js.map +0 -1
- package/Image/utils/getImageWidth.d.ts +0 -1
- package/Image/utils/getImageWidth.js +0 -12
- package/Image/utils/getImageWidth.js.map +0 -1
- package/Image/utils/getImageWidths.d.ts +0 -2
- package/Image/utils/getImageWidths.js +0 -21
- package/Image/utils/getImageWidths.js.map +0 -1
- package/Image/utils/getLQIP.d.ts +0 -8
- package/Image/utils/getLQIP.js +0 -20
- package/Image/utils/getLQIP.js.map +0 -1
- package/Image/utils/getLargestSize.d.ts +0 -7
- package/Image/utils/getLargestSize.js +0 -17
- package/Image/utils/getLargestSize.js.map +0 -1
- package/Image/utils/getSizeForBreakpoint.d.ts +0 -2
- package/Image/utils/getSizeForBreakpoint.js +0 -16
- package/Image/utils/getSizeForBreakpoint.js.map +0 -1
- package/Image/utils/getSizesMap.d.ts +0 -2
- package/Image/utils/getSizesMap.js +0 -35
- package/Image/utils/getSizesMap.js.map +0 -1
- package/Image/utils/getSmallestSize.d.ts +0 -2
- package/Image/utils/getSmallestSize.js +0 -12
- package/Image/utils/getSmallestSize.js.map +0 -1
- package/Image/utils/getSrcSetFromWidths.d.ts +0 -10
- package/Image/utils/getSrcSetFromWidths.js +0 -9
- package/Image/utils/getSrcSetFromWidths.js.map +0 -1
- package/Image/utils/getSrcWithParams.d.ts +0 -3
- package/Image/utils/getSrcWithParams.js +0 -29
- package/Image/utils/getSrcWithParams.js.map +0 -1
- package/Image/utils/paddingForAspectRatio.d.ts +0 -1
- package/Image/utils/paddingForAspectRatio.js +0 -6
- package/Image/utils/paddingForAspectRatio.js.map +0 -1
- package/Image/utils/remToPx.d.ts +0 -1
- package/Image/utils/remToPx.js +0 -2
- package/Image/utils/remToPx.js.map +0 -1
- package/Image/utils/sizeToNumber.d.ts +0 -2
- package/Image/utils/sizeToNumber.js +0 -27
- package/Image/utils/sizeToNumber.js.map +0 -1
- package/Input/Input.d.ts +0 -6
- package/Input/Input.js +0 -45
- package/Input/Input.js.map +0 -1
- package/Input/index.d.ts +0 -3
- package/Input/index.js +0 -4
- package/Input/index.js.map +0 -1
- package/JetshopText.d.ts +0 -3
- package/JetshopText.js +0 -13
- package/JetshopText.js.map +0 -1
- package/Loading/LoadingBar.d.ts +0 -8
- package/Loading/LoadingBar.js +0 -58
- package/Loading/LoadingBar.js.map +0 -1
- package/Loading/LoadingLine.d.ts +0 -31
- package/Loading/LoadingLine.js +0 -26
- package/Loading/LoadingLine.js.map +0 -1
- package/Loading/NetworkStatusNotifier.d.ts +0 -6
- package/Loading/NetworkStatusNotifier.js +0 -8
- package/Loading/NetworkStatusNotifier.js.map +0 -1
- package/Menu/MenuContainer.d.ts +0 -28
- package/Menu/MenuContainer.js +0 -46
- package/Menu/MenuContainer.js.map +0 -1
- package/Menu/RecursiveTree.d.ts +0 -28
- package/Menu/RecursiveTree.js +0 -91
- package/Menu/RecursiveTree.js.map +0 -1
- package/Modal/Drawer/Drawer.d.ts +0 -12
- package/Modal/Drawer/Drawer.js +0 -31
- package/Modal/Drawer/Drawer.js.map +0 -1
- package/Modal/Drawer/DrawerTarget.d.ts +0 -6
- package/Modal/Drawer/DrawerTarget.js +0 -12
- package/Modal/Drawer/DrawerTarget.js.map +0 -1
- package/Modal/Drawer/DrawerTrigger.d.ts +0 -11
- package/Modal/Drawer/DrawerTrigger.js +0 -16
- package/Modal/Drawer/DrawerTrigger.js.map +0 -1
- package/Modal/Drawer/index.d.ts +0 -3
- package/Modal/Drawer/index.js +0 -4
- package/Modal/Drawer/index.js.map +0 -1
- package/Modal/Flyout/FlyoutTarget.d.ts +0 -10
- package/Modal/Flyout/FlyoutTarget.js +0 -15
- package/Modal/Flyout/FlyoutTarget.js.map +0 -1
- package/Modal/Flyout/FlyoutTrigger.d.ts +0 -15
- package/Modal/Flyout/FlyoutTrigger.js +0 -18
- package/Modal/Flyout/FlyoutTrigger.js.map +0 -1
- package/Modal/Flyout/index.d.ts +0 -2
- package/Modal/Flyout/index.js +0 -3
- package/Modal/Flyout/index.js.map +0 -1
- package/Modal/ModalContext.d.ts +0 -26
- package/Modal/ModalContext.js +0 -9
- package/Modal/ModalContext.js.map +0 -1
- package/Modal/ModalProvider.d.ts +0 -5
- package/Modal/ModalProvider.js +0 -83
- package/Modal/ModalProvider.js.map +0 -1
- package/Modal/ModalRoot.d.ts +0 -3
- package/Modal/ModalRoot.js +0 -44
- package/Modal/ModalRoot.js.map +0 -1
- package/Modal/ModalTrigger.d.ts +0 -9
- package/Modal/ModalTrigger.js +0 -9
- package/Modal/ModalTrigger.js.map +0 -1
- package/Pagination/Pagination.d.ts +0 -7
- package/Pagination/Pagination.js +0 -23
- package/Pagination/Pagination.js.map +0 -1
- package/Pagination/PaginationBehaviour.d.ts +0 -52
- package/Pagination/PaginationBehaviour.js +0 -68
- package/Pagination/PaginationBehaviour.js.map +0 -1
- package/Pagination/index.d.ts +0 -2
- package/Pagination/index.js +0 -3
- package/Pagination/index.js.map +0 -1
- package/Pagination/usePagination.d.ts +0 -15
- package/Pagination/usePagination.js +0 -46
- package/Pagination/usePagination.js.map +0 -1
- package/PreOrderDateSelector/PreOrderDateSelector.d.ts +0 -23
- package/PreOrderDateSelector/PreOrderDateSelector.js +0 -74
- package/PreOrderDateSelector/PreOrderDateSelector.js.map +0 -1
- package/PreOrderDateSelector/index.d.ts +0 -2
- package/PreOrderDateSelector/index.js +0 -3
- package/PreOrderDateSelector/index.js.map +0 -1
- package/Price/Currency.d.ts +0 -9
- package/Price/Currency.js +0 -11
- package/Price/Currency.js.map +0 -1
- package/Price/Price.d.ts +0 -44
- package/Price/Price.js +0 -74
- package/Price/Price.js.map +0 -1
- package/Price/index.d.ts +0 -1
- package/Price/index.js +0 -2
- package/Price/index.js.map +0 -1
- package/ProductLink.d.ts +0 -23
- package/ProductLink.js +0 -88
- package/ProductLink.js.map +0 -1
- package/ProductList/Badges.d.ts +0 -6
- package/ProductList/Badges.js +0 -56
- package/ProductList/Badges.js.map +0 -1
- package/ProductList/GridProduct.d.ts +0 -24
- package/ProductList/GridProduct.js +0 -58
- package/ProductList/GridProduct.js.map +0 -1
- package/ProductList/ProductGrid.d.ts +0 -16
- package/ProductList/ProductGrid.js +0 -30
- package/ProductList/ProductGrid.js.map +0 -1
- package/ProductList/ProductImage.d.ts +0 -12
- package/ProductList/ProductImage.js +0 -21
- package/ProductList/ProductImage.js.map +0 -1
- package/ProductSpecifications/ProductSpecifications.d.ts +0 -8
- package/ProductSpecifications/ProductSpecifications.js +0 -78
- package/ProductSpecifications/ProductSpecifications.js.map +0 -1
- package/ScrollRestorationHandler/ScrollRestorationHandler.d.ts +0 -8
- package/ScrollRestorationHandler/ScrollRestorationHandler.js +0 -17
- package/ScrollRestorationHandler/ScrollRestorationHandler.js.map +0 -1
- package/ScrollRestorationHandler/index.d.ts +0 -1
- package/ScrollRestorationHandler/index.js +0 -2
- package/ScrollRestorationHandler/index.js.map +0 -1
- package/ScrollRestorationHandler/isInIgnoredRouteTypes.d.ts +0 -8
- package/ScrollRestorationHandler/isInIgnoredRouteTypes.js +0 -8
- package/ScrollRestorationHandler/isInIgnoredRouteTypes.js.map +0 -1
- package/ScrollRestorationHandler/useScrollRestore.d.ts +0 -9
- package/ScrollRestorationHandler/useScrollRestore.js +0 -20
- package/ScrollRestorationHandler/useScrollRestore.js.map +0 -1
- package/Search/SearchAutoCompleteContainer.d.ts +0 -45
- package/Search/SearchAutoCompleteContainer.js +0 -172
- package/Search/SearchAutoCompleteContainer.js.map +0 -1
- package/Search/SearchField.d.ts +0 -26
- package/Search/SearchField.js +0 -98
- package/Search/SearchField.js.map +0 -1
- package/Search/SearchPage/PageOf.d.ts +0 -5
- package/Search/SearchPage/PageOf.js +0 -7
- package/Search/SearchPage/PageOf.js.map +0 -1
- package/Search/SearchPage/SearchMeta.d.ts +0 -16
- package/Search/SearchPage/SearchMeta.js +0 -20
- package/Search/SearchPage/SearchMeta.js.map +0 -1
- package/Search/SearchPage/SearchPageBehaviour.d.ts +0 -19
- package/Search/SearchPage/SearchPageBehaviour.js +0 -75
- package/Search/SearchPage/SearchPageBehaviour.js.map +0 -1
- package/Search/SuggestedTerm.d.ts +0 -16
- package/Search/SuggestedTerm.js +0 -35
- package/Search/SuggestedTerm.js.map +0 -1
- package/Search/index.d.ts +0 -1
- package/Search/index.js +0 -2
- package/Search/index.js.map +0 -1
- package/Select/Components.d.ts +0 -28
- package/Select/Components.js +0 -91
- package/Select/Components.js.map +0 -1
- package/Select/SelectComponents/Quantity.d.ts +0 -5
- package/Select/SelectComponents/Quantity.js +0 -8
- package/Select/SelectComponents/Quantity.js.map +0 -1
- package/Select/index.d.ts +0 -5
- package/Select/index.js +0 -2
- package/Select/index.js.map +0 -1
- package/SortOrder/SortOrder.d.ts +0 -16
- package/SortOrder/SortOrder.js +0 -33
- package/SortOrder/SortOrder.js.map +0 -1
- package/SortOrder/SortOrderDropdown.d.ts +0 -9
- package/SortOrder/SortOrderDropdown.js +0 -25
- package/SortOrder/SortOrderDropdown.js.map +0 -1
- package/SortOrder/SortOrderList.d.ts +0 -7
- package/SortOrder/SortOrderList.js +0 -17
- package/SortOrder/SortOrderList.js.map +0 -1
- package/StartPageRenderer/StartPageRenderer.d.ts +0 -17
- package/StartPageRenderer/StartPageRenderer.js +0 -52
- package/StartPageRenderer/StartPageRenderer.js.map +0 -1
- package/StartPageRenderer/index.d.ts +0 -1
- package/StartPageRenderer/index.js +0 -2
- package/StartPageRenderer/index.js.map +0 -1
- package/Stock/StockStatusContainer.d.ts +0 -21
- package/Stock/StockStatusContainer.js +0 -45
- package/Stock/StockStatusContainer.js.map +0 -1
- package/Text/Text.d.ts +0 -11
- package/Text/Text.js +0 -22
- package/Text/Text.js.map +0 -1
- package/Text/index.d.ts +0 -3
- package/Text/index.js +0 -4
- package/Text/index.js.map +0 -1
- package/Theme/createTheme.d.ts +0 -16
- package/Theme/createTheme.js +0 -5
- package/Theme/createTheme.js.map +0 -1
- package/Theme/cssReset.d.ts +0 -1
- package/Theme/cssReset.js +0 -160
- package/Theme/cssReset.js.map +0 -1
- package/Theme/normalizeCss.d.ts +0 -1
- package/Theme/normalizeCss.js +0 -357
- package/Theme/normalizeCss.js.map +0 -1
- package/Theme/sanitizeCss.d.ts +0 -1
- package/Theme/sanitizeCss.js +0 -572
- package/Theme/sanitizeCss.js.map +0 -1
- package/WindowGrid/WindowGrid.d.ts +0 -11
- package/WindowGrid/WindowGrid.js +0 -58
- package/WindowGrid/WindowGrid.js.map +0 -1
- package/WindowGrid/index.d.ts +0 -1
- package/WindowGrid/index.js +0 -2
- package/WindowGrid/index.js.map +0 -1
- package/WindowGrid/useResizeObserver.d.ts +0 -3
- package/WindowGrid/useResizeObserver.js +0 -14
- package/WindowGrid/useResizeObserver.js.map +0 -1
- package/WindowGrid/useScrollWithWindow.d.ts +0 -12
- package/WindowGrid/useScrollWithWindow.js +0 -39
- package/WindowGrid/useScrollWithWindow.js.map +0 -1
- package/fuzzySearch/fuzzySearch.d.ts +0 -8
- package/fuzzySearch/fuzzySearch.js +0 -43
- package/fuzzySearch/fuzzySearch.js.map +0 -1
- package/fuzzySearch/index.d.ts +0 -1
- package/fuzzySearch/index.js +0 -2
- package/fuzzySearch/index.js.map +0 -1
- package/hooks/index.d.ts +0 -2
- package/hooks/index.js +0 -3
- package/hooks/index.js.map +0 -1
- package/hooks/useOnClickOutside.d.ts +0 -6
- package/hooks/useOnClickOutside.js +0 -17
- package/hooks/useOnClickOutside.js.map +0 -1
- package/hooks/useOnEsc.d.ts +0 -4
- package/hooks/useOnEsc.js +0 -17
- package/hooks/useOnEsc.js.map +0 -1
- package/utils/breakpoints.d.ts +0 -23
- package/utils/breakpoints.js +0 -94
- package/utils/breakpoints.js.map +0 -1
- package/utils/callAllEventHandlers.d.ts +0 -5
- package/utils/callAllEventHandlers.js +0 -9
- package/utils/callAllEventHandlers.js.map +0 -1
- package/utils/text.d.ts +0 -1
- package/utils/text.js +0 -23
- package/utils/text.js.map +0 -1
- package/utils/theme.d.ts +0 -3
- package/utils/theme.js +0 -5
- package/utils/theme.js.map +0 -1
- package/utils/useHoverIntent.d.ts +0 -10
- package/utils/useHoverIntent.js +0 -78
- package/utils/useHoverIntent.js.map +0 -1
- package/utils/usePropsOfType.d.ts +0 -11
- package/utils/usePropsOfType.js +0 -18
- package/utils/usePropsOfType.js.map +0 -1
- package/withFlightUI.d.ts +0 -17
- package/withFlightUI.js +0 -20
- package/withFlightUI.js.map +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { styled } from 'linaria/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import groupBy from './groupBy';
|
|
4
|
-
export const Region = ({ channels, render }) => {
|
|
5
|
-
const groupedCountries = groupBy(channels, channel => channel.region);
|
|
6
|
-
return (React.createElement(RegionWrapper, null, Object.keys(groupedCountries).map(region => {
|
|
7
|
-
const regionCountries = groupedCountries[region];
|
|
8
|
-
return render({ regionCountries, region });
|
|
9
|
-
})));
|
|
10
|
-
};
|
|
11
|
-
export default Region;
|
|
12
|
-
export const RegionName = styled('h2') `
|
|
13
|
-
text-transform: uppercase;
|
|
14
|
-
font-size: 1rem;
|
|
15
|
-
line-height: 1.5rem;
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
margin: 1rem 0 0.5rem 0;
|
|
18
|
-
`;
|
|
19
|
-
export const RegionWrapper = styled('div') ``;
|
|
20
|
-
export const RegionGroup = styled('div') ``;
|
|
21
|
-
//# sourceMappingURL=Region.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Region.js","sourceRoot":"","sources":["Region.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,WAAW,CAAC;AAiBhC,MAAM,CAAC,MAAM,MAAM,GAAqB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IAC/D,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAEnE,CAAC;IACF,OAAO,CACL,oBAAC,aAAa,QACX,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1C,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAEjD,OAAO,MAAM,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC;AAEtB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;CAMrC,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Takes in an array and a keyGetter function by which to select
|
|
3
|
-
* the key to group by. Returns an array.
|
|
4
|
-
*/
|
|
5
|
-
export default function groupBy(list, keyGetter) {
|
|
6
|
-
// Return if the keyGetter does not return a string
|
|
7
|
-
if (typeof keyGetter(list[0]) !== 'string')
|
|
8
|
-
return list;
|
|
9
|
-
return list.reduce((groups, item) => {
|
|
10
|
-
const key = keyGetter(item);
|
|
11
|
-
groups[key] = groups[key] || [];
|
|
12
|
-
groups[key].push(item);
|
|
13
|
-
return groups;
|
|
14
|
-
}, {});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=groupBy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["groupBy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,IAAS,EACT,SAA8B;IAE9B,mDAAmD;IACnD,IAAI,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,IAAI,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
package/Checkbox/Checkbox.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export type CheckboxProps = {
|
|
3
|
-
label: ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
export type CheckboxCompound = {
|
|
7
|
-
Label?: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: React.SFC<CheckboxProps & React.InputHTMLAttributes<HTMLInputElement>> & CheckboxCompound & {
|
|
10
|
-
Label: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
11
|
-
as?: React.ElementType<any>;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
package/Checkbox/Checkbox.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { styled } from 'linaria/react';
|
|
14
|
-
import { ReactComponent as Check } from '../svg/Check.svg';
|
|
15
|
-
const CheckInput = styled('input') `
|
|
16
|
-
/* hide browser default checkbox */
|
|
17
|
-
position: absolute;
|
|
18
|
-
opacity: 0;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
`;
|
|
21
|
-
const CheckBox = styled('span') `
|
|
22
|
-
height: 22px;
|
|
23
|
-
width: 22px;
|
|
24
|
-
background-color: transparent;
|
|
25
|
-
border: 1px solid black;
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
margin-right: 0.5rem;
|
|
30
|
-
`;
|
|
31
|
-
const CheckMark = styled(Check) `
|
|
32
|
-
display: none;
|
|
33
|
-
width: 1em;
|
|
34
|
-
height: 1em;
|
|
35
|
-
use {
|
|
36
|
-
fill: white;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
const Label = styled('label') `
|
|
40
|
-
display: flex;
|
|
41
|
-
position: relative;
|
|
42
|
-
height: 22px;
|
|
43
|
-
align-items: center;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
font-size: 14px;
|
|
46
|
-
white-space: nowrap;
|
|
47
|
-
:hover input ~ span {
|
|
48
|
-
background-color: #ccc;
|
|
49
|
-
}
|
|
50
|
-
input:focus ~ span {
|
|
51
|
-
border-color: #2f80ed;
|
|
52
|
-
}
|
|
53
|
-
input:checked ~ span {
|
|
54
|
-
svg {
|
|
55
|
-
display: block;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const Checkbox = (_a) => {
|
|
60
|
-
var { label, className } = _a, props = __rest(_a, ["label", "className"]);
|
|
61
|
-
return (React.createElement(Label, { className: className || '', "data-testid": `checkbox-${label}` },
|
|
62
|
-
React.createElement(CheckInput, Object.assign({ type: "checkbox" }, props)),
|
|
63
|
-
React.createElement(CheckBox, null,
|
|
64
|
-
React.createElement(CheckMark, null)),
|
|
65
|
-
label));
|
|
66
|
-
};
|
|
67
|
-
export default Object.assign(Checkbox, {
|
|
68
|
-
Label
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=Checkbox.js.map
|
package/Checkbox/Checkbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;;;;CAKjC,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;;;;CAS9B,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;;;;;;;CAO9B,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;;;;;;;;;;;;;;;;;;CAmB5B,CAAC;AAWF,MAAM,QAAQ,GAGO,CAAC,EAA8B,EAAE,EAAE;QAAlC,EAAE,KAAK,EAAE,SAAS,OAAY,EAAP,KAAK,cAA5B,sBAA8B,CAAF;IAChD,OAAO,CACL,oBAAC,KAAK,IAAC,SAAS,EAAE,SAAS,IAAI,EAAE,iBAAe,YAAY,KAAK,EAAE;QACjE,oBAAC,UAAU,kBAAC,IAAI,EAAC,UAAU,IAAK,KAAK,EAAI;QACzC,oBAAC,QAAQ;YACP,oBAAC,SAAS,OAAG,CACJ;QACV,KAAK,CACA,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IACrC,KAAK;CACN,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type CheckboxGroupChange = (val: string) => any;
|
|
3
|
-
export interface Item {
|
|
4
|
-
/** The checkbox label */
|
|
5
|
-
label: string;
|
|
6
|
-
/** The checkbox value; applied to the underlying input element */
|
|
7
|
-
val: string;
|
|
8
|
-
}
|
|
9
|
-
export interface Props {
|
|
10
|
-
items: Item[];
|
|
11
|
-
selectedItem: string;
|
|
12
|
-
/** The label to display for the entire group */
|
|
13
|
-
groupLabel?: string;
|
|
14
|
-
/** Called when the value changes */
|
|
15
|
-
handleChange: CheckboxGroupChange;
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const Radio: import("linaria/lib/StyledMeta").StyledMeta & React.SFC<import("./Checkbox").CheckboxProps & React.InputHTMLAttributes<HTMLInputElement>> & import("./Checkbox").CheckboxCompound & {
|
|
19
|
-
Label: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
20
|
-
as?: React.ElementType<any>;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
23
|
-
export declare const CheckboxWrapper: import("linaria/lib/StyledMeta").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
24
|
-
as?: React.ElementType<any>;
|
|
25
|
-
}>;
|
|
26
|
-
declare const CheckboxGroup: React.SFC<Props>;
|
|
27
|
-
export default CheckboxGroup;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Checkbox from './Checkbox';
|
|
3
|
-
import { styled } from 'linaria/react';
|
|
4
|
-
export const Radio = styled(Checkbox) `
|
|
5
|
-
display: flex;
|
|
6
|
-
margin-top: 1rem;
|
|
7
|
-
& span {
|
|
8
|
-
width: 16px;
|
|
9
|
-
height: 16px;
|
|
10
|
-
border-radius: 50%;
|
|
11
|
-
flex: 0 0 auto;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
const Label = styled('span') `
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
`;
|
|
17
|
-
export const CheckboxWrapper = styled('div') ``;
|
|
18
|
-
const CheckboxGroup = ({ selectedItem, items, handleChange, groupLabel, className }) => (React.createElement(CheckboxWrapper, { className: className },
|
|
19
|
-
groupLabel && React.createElement(Label, null, groupLabel),
|
|
20
|
-
items.map(item => (React.createElement(Radio, { type: "radio", key: item.val, value: item.val, tabIndex: 0, checked: selectedItem === item.val ? true : false, label: item.label, onChange: () => handleChange(item.val) })))));
|
|
21
|
-
export default CheckboxGroup;
|
|
22
|
-
//# sourceMappingURL=CheckboxGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAoBvC,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;;;;;;;;;CASpC,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;CAE3B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,EAAE,CAAC;AAE/C,MAAM,aAAa,GAAqB,CAAC,EACvC,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACV,EAAE,EAAE,CAAC,CACJ,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS;IAClC,UAAU,IAAI,oBAAC,KAAK,QAAE,UAAU,CAAS;IACzC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,oBAAC,KAAK,IACJ,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,KAAK,EAAE,IAAI,CAAC,GAAG,EACf,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EACjD,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GACtC,CACH,CAAC,CACc,CACnB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/Checkbox/index.d.ts
DELETED
package/Checkbox/index.js
DELETED
package/Checkbox/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,eAAe,QAAQ,CAAC"}
|
package/ContentPageLink.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { LinkProps } from 'react-router-dom';
|
|
3
|
-
import { Page } from '@jetshop/core/types';
|
|
4
|
-
export interface ContentPageLinkProps extends Partial<LinkProps> {
|
|
5
|
-
page: Page;
|
|
6
|
-
className?: string;
|
|
7
|
-
preloadRoute?: boolean;
|
|
8
|
-
onMouseEnter?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => any;
|
|
9
|
-
}
|
|
10
|
-
declare const ContentPageLink: React.FC<ContentPageLinkProps>;
|
|
11
|
-
export default ContentPageLink;
|
package/ContentPageLink.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from 'react';
|
|
13
|
-
import { Link } from 'react-router-dom';
|
|
14
|
-
import { useRoutePreload } from '@jetshop/core/hooks/useRoutePreload';
|
|
15
|
-
import { useHoverIntent } from './utils/useHoverIntent';
|
|
16
|
-
const ContentPageLink = function ContentPageLink(props) {
|
|
17
|
-
const { page, onMouseEnter, preloadRoute = true } = props, rest = __rest(props, ["page", "onMouseEnter", "preloadRoute"]);
|
|
18
|
-
const { primaryRoute } = page;
|
|
19
|
-
const { preload } = useRoutePreload();
|
|
20
|
-
const contentPreload = () => {
|
|
21
|
-
if (!(primaryRoute === null || primaryRoute === void 0 ? void 0 : primaryRoute.path)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
preload({
|
|
25
|
-
pathname: primaryRoute.path,
|
|
26
|
-
routeType: 'Page',
|
|
27
|
-
preloadRoute
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
const [, intentRef] = useHoverIntent({
|
|
31
|
-
onHover: () => {
|
|
32
|
-
contentPreload();
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return (React.createElement(Link, Object.assign({ to: {
|
|
36
|
-
pathname: primaryRoute === null || primaryRoute === void 0 ? void 0 : primaryRoute.path,
|
|
37
|
-
state: { type: 'Page' }
|
|
38
|
-
}, innerRef: intentRef, onTouchStart: contentPreload, onMouseEnter: (event) => {
|
|
39
|
-
contentPreload();
|
|
40
|
-
if (typeof onMouseEnter === 'function') {
|
|
41
|
-
onMouseEnter(event);
|
|
42
|
-
}
|
|
43
|
-
} }, rest)));
|
|
44
|
-
};
|
|
45
|
-
export default ContentPageLink;
|
|
46
|
-
//# sourceMappingURL=ContentPageLink.js.map
|
package/ContentPageLink.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageLink.js","sourceRoot":"","sources":["ContentPageLink.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAa,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAWxD,MAAM,eAAe,GACnB,SAAS,eAAe,CAAC,KAAK;IAC5B,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA5D,wCAAoD,CAAQ,CAAC;IACnE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;IACtC,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,IAAI,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAA,EAAE;YACvB,OAAO;SACR;QACD,OAAO,CAAC;YACN,QAAQ,EAAE,YAAY,CAAC,IAAI;YAC3B,SAAS,EAAE,MAAM;YACjB,YAAY;SACb,CAAC,CAAC;IACL,CAAC,CAAC;IACF,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC;QACnC,OAAO,EAAE,GAAG,EAAE;YACZ,cAAc,EAAE,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,IAAI,kBACH,EAAE,EAAE;YACF,QAAQ,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI;YAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB,EACD,QAAQ,EAAE,SAAgB,EAC1B,YAAY,EAAE,cAAc,EAC5B,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;YACtB,cAAc,EAAE,CAAC;YACjB,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;gBACtC,YAAY,CAAC,KAAK,CAAC,CAAC;aACrB;QACH,CAAC,IACG,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEJ,eAAe,eAAe,CAAC"}
|
package/ContentRenderer.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ContentItem } from '@jetshop/core/types';
|
|
3
|
-
export type Components = {
|
|
4
|
-
[key: string]: React.FC<any>;
|
|
5
|
-
};
|
|
6
|
-
export declare function ContentRenderer({ items, components }: {
|
|
7
|
-
items: ContentItem[];
|
|
8
|
-
components: Components;
|
|
9
|
-
}): JSX.Element;
|
package/ContentRenderer.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
const convertPropsToObject = (item) => {
|
|
3
|
-
const props = item.properties.reduce((merged, current) => {
|
|
4
|
-
var _a, _b;
|
|
5
|
-
if ((current === null || current === void 0 ? void 0 : current.valueType) === 'SCALAR') {
|
|
6
|
-
merged[current.name] = {
|
|
7
|
-
type: current.type,
|
|
8
|
-
value: (_a = current === null || current === void 0 ? void 0 : current.value) === null || _a === void 0 ? void 0 : _a.value,
|
|
9
|
-
__typename: (_b = current === null || current === void 0 ? void 0 : current.value) === null || _b === void 0 ? void 0 : _b.__typename
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
merged[current.name] = {
|
|
14
|
-
type: current.type,
|
|
15
|
-
value: current.value
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return merged;
|
|
19
|
-
}, {});
|
|
20
|
-
return props;
|
|
21
|
-
};
|
|
22
|
-
const renderContent = ({ items, components }) => items.map((item, index) => {
|
|
23
|
-
const Component = components[item.type.toUpperCase()] || components[item.type];
|
|
24
|
-
const props = convertPropsToObject(item);
|
|
25
|
-
if (Component) {
|
|
26
|
-
return (React.createElement(Component, Object.assign({ key: `${item.type}-${index}` }, props), (item === null || item === void 0 ? void 0 : item.children) && item.children.length > 0
|
|
27
|
-
? renderContent({ items: item.children, components })
|
|
28
|
-
: null));
|
|
29
|
-
}
|
|
30
|
-
else
|
|
31
|
-
return null;
|
|
32
|
-
});
|
|
33
|
-
export function ContentRenderer({ items, components }) {
|
|
34
|
-
return React.createElement(React.Fragment, null, renderContent({ items, components }));
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=ContentRenderer.js.map
|
package/ContentRenderer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentRenderer.js","sourceRoot":"","sources":["ContentRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,oBAAoB,GAAG,CAAC,IAAiB,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;;QACvD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,MAAK,QAAQ,EAAE;YACnC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG;gBACrB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,MAAC,OAAO,aAAP,OAAO,uBAAP,OAAO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EAAE,CAAC,CAAI,CAAC;AACrD,CAAC"}
|
package/DropdownMenu/Button.d.ts
DELETED
package/DropdownMenu/Button.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React, { useRef, useEffect } from 'react';
|
|
13
|
-
import { DropdownMenuContext } from './DropdownMenu';
|
|
14
|
-
import { withFlightUI } from '../withFlightUI';
|
|
15
|
-
const Button = (_a) => {
|
|
16
|
-
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
17
|
-
const { isOpen, setIsOpen } = React.useContext(DropdownMenuContext);
|
|
18
|
-
const prevOpenState = useRef(isOpen);
|
|
19
|
-
const buttonRef = useRef();
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (!isOpen && prevOpenState.current === true)
|
|
22
|
-
buttonRef.current.focus();
|
|
23
|
-
prevOpenState.current = isOpen;
|
|
24
|
-
}, [isOpen]);
|
|
25
|
-
const clickHandler = (event) => {
|
|
26
|
-
event.stopPropagation();
|
|
27
|
-
setIsOpen((o) => !o);
|
|
28
|
-
typeof rest.onClick === 'function' && rest.onClick();
|
|
29
|
-
};
|
|
30
|
-
return withFlightUI(children, Object.assign({ as: 'button', 'data-flight-dropdown-button': '', 'aria-expanded': isOpen, 'aria-haspopup': 'menu', type: 'button', role: 'button', ref: buttonRef, onClick: clickHandler }, rest));
|
|
31
|
-
};
|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eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,QAAQ,EACd,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,YAAY,IAClB,IAAI,EACP,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FlightUIProps } from '../withFlightUI';
|
|
3
|
-
export declare const DropdownMenuContext: React.Context<{
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
-
itemRefs: React.RefObject<any>;
|
|
7
|
-
}>;
|
|
8
|
-
interface DropdownMenuProps extends FlightUIProps {
|
|
9
|
-
/** The initial open state of the dropdown menu
|
|
10
|
-
* @default false
|
|
11
|
-
* */
|
|
12
|
-
initialOpen?: boolean;
|
|
13
|
-
/** Set to true if you'd like to disable all default styling */
|
|
14
|
-
unstyled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare const DropdownMenu: React.NamedExoticComponent<DropdownMenuProps>;
|
|
17
|
-
export declare function useDropdownMenu(): {
|
|
18
|
-
isOpen: boolean;
|
|
19
|
-
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { css, cx } from 'linaria';
|
|
13
|
-
import React, { useContext, useRef } from 'react';
|
|
14
|
-
import { withFlightUI } from '../withFlightUI';
|
|
15
|
-
export const DropdownMenuContext = React.createContext(undefined);
|
|
16
|
-
css `
|
|
17
|
-
global([data-flight-dropdown-open='false'] [data-flight-dropdown-items]) {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
const styles = css `
|
|
22
|
-
position: relative;
|
|
23
|
-
|
|
24
|
-
[data-flight-dropdown-button] {
|
|
25
|
-
padding: 0.5em 1em;
|
|
26
|
-
border: 1px solid #c0c0c0;
|
|
27
|
-
border-radius: 3px;
|
|
28
|
-
}
|
|
29
|
-
[data-flight-dropdown-items] {
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: 100%;
|
|
32
|
-
left: 0;
|
|
33
|
-
background: white;
|
|
34
|
-
white-space: nowrap;
|
|
35
|
-
display: block;
|
|
36
|
-
z-index: 2;
|
|
37
|
-
outline: none;
|
|
38
|
-
}
|
|
39
|
-
[data-flight-dropdown-item] {
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
border-top: 1px solid #c0c0c0;
|
|
42
|
-
white-space: nowrap;
|
|
43
|
-
padding: 0.5em 1em;
|
|
44
|
-
:hover {
|
|
45
|
-
color: blue;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
export const DropdownMenu = React.memo(function DropdownMenu(_a) {
|
|
50
|
-
var { initialOpen = false, unstyled, children, className } = _a, rest = __rest(_a, ["initialOpen", "unstyled", "children", "className"]);
|
|
51
|
-
const [isOpen, setIsOpen] = React.useState(initialOpen);
|
|
52
|
-
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
53
|
-
const itemRefs = useRef([]);
|
|
54
|
-
const value = React.useMemo(() => {
|
|
55
|
-
return {
|
|
56
|
-
isOpen,
|
|
57
|
-
setIsOpen,
|
|
58
|
-
selectedIndex,
|
|
59
|
-
setSelectedIndex,
|
|
60
|
-
itemRefs
|
|
61
|
-
};
|
|
62
|
-
}, [isOpen, selectedIndex]);
|
|
63
|
-
return withFlightUI(React.createElement(DropdownMenuContext.Provider, { value: value }, typeof children === 'function'
|
|
64
|
-
? children({ isOpen, setIsOpen })
|
|
65
|
-
: children), Object.assign({ as: 'div', 'data-flight-dropdown': '', 'data-flight-dropdown-open': isOpen, unstyled, className: cx(styles, className) }, rest));
|
|
66
|
-
});
|
|
67
|
-
DropdownMenu.displayName = 'withFlightUI(DropdownMenu)';
|
|
68
|
-
export function useDropdownMenu() {
|
|
69
|
-
const { isOpen, setIsOpen } = useContext(DropdownMenuContext);
|
|
70
|
-
return { isOpen, setIsOpen };
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=DropdownMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["DropdownMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAiB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAInD,SAAS,CAAC,CAAC;AAEd,GAAG,CAAA;;;;CAIF,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BjB,CAAC;AAWF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,EAMzC;QANyC,EAC3D,WAAW,GAAG,KAAK,EACnB,QAAQ,EACR,QAAQ,EACR,SAAS,OAES,EADf,IAAI,cALoD,oDAM5D,CADQ;IAEP,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5D,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IAE5B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC/B,OAAO;YACL,MAAM;YACN,SAAS;YACT,aAAa;YACb,gBAAgB;YAChB,QAAQ;SACT,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAE5B,OAAO,YAAY,CACjB,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACvC,OAAO,QAAQ,KAAK,UAAU;QAC7B,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QACjC,CAAC,CAAC,QAAQ,CACiB,kBAE7B,EAAE,EAAE,KAAK,EACT,sBAAsB,EAAE,EAAE,EAC1B,2BAA2B,EAAE,MAAM,EACnC,QAAQ,EACR,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,IAE7B,IAAI,EAEV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAExD,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAE9D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC/B,CAAC"}
|
package/DropdownMenu/Item.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { As, FlightUIProps } from '../withFlightUI';
|
|
3
|
-
export declare const Item: React.FC<{} & FlightUIProps & {
|
|
4
|
-
/** @default 'li' */
|
|
5
|
-
as?: As;
|
|
6
|
-
closeOnSelect?: boolean;
|
|
7
|
-
/** Function to call when selecting this item */
|
|
8
|
-
onSelect?: ({ isOpen, setIsOpen }: {
|
|
9
|
-
isOpen: boolean;
|
|
10
|
-
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
-
}) => void;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}>;
|
package/DropdownMenu/Item.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { withFlightUI } from '../withFlightUI';
|
|
14
|
-
import { DropdownMenuContext, useDropdownMenu } from './DropdownMenu';
|
|
15
|
-
export const Item = function Item(_a) {
|
|
16
|
-
var { onSelect, closeOnSelect, children, disabled, index } = _a, rest = __rest(_a, ["onSelect", "closeOnSelect", "children", "disabled", "index"]);
|
|
17
|
-
const { itemRefs } = React.useContext(DropdownMenuContext);
|
|
18
|
-
const { isOpen, setIsOpen } = useDropdownMenu();
|
|
19
|
-
const itemRef = React.createRef();
|
|
20
|
-
itemRefs.current[index] = itemRef;
|
|
21
|
-
const select = () => {
|
|
22
|
-
closeOnSelect && setIsOpen(false);
|
|
23
|
-
typeof onSelect === 'function' &&
|
|
24
|
-
!disabled &&
|
|
25
|
-
onSelect({ isOpen, setIsOpen });
|
|
26
|
-
};
|
|
27
|
-
const handleKeydown = (e) => {
|
|
28
|
-
if (e.key === 'Enter' || e.key === 'Space' || e.key === ' ') {
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
select();
|
|
31
|
-
}
|
|
32
|
-
if (e.key === 'ArrowDown') {
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
if (itemRefs.current.length - 1 === index)
|
|
35
|
-
return;
|
|
36
|
-
itemRefs.current[index + 1].current.focus();
|
|
37
|
-
}
|
|
38
|
-
if (e.key === 'ArrowUp') {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
if (index === 0)
|
|
41
|
-
return;
|
|
42
|
-
itemRefs.current[index - 1].current.focus();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const focusItem = () => itemRef.current && itemRef.current.focus();
|
|
46
|
-
return withFlightUI(children, Object.assign({ as: 'li', ref: itemRef, tabIndex: -1, onClick: select, onKeyDown: handleKeydown, onMouseEnter: focusItem, role: 'menuitem', 'data-flight-dropdown-item': '' }, rest));
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=Item.js.map
|
package/DropdownMenu/Item.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["Item.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,CAAC,MAAM,IAAI,GAaV,SAAS,IAAI,CAAC,EAOpB;QAPoB,EACnB,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,KAAK,OAEN,EADI,IAAI,cANY,8DAOpB,CADQ;IAEP,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC3D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE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QAAQ,kBAC1B,EAAE,EAAE,IAAI,EACR,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,SAAS,EACvB,IAAI,EAAE,UAAU,EAChB,2BAA2B,EAAE,EAAE,IAC5B,IAAI,EACP,CAAC;AACL,CAAC,CAAC"}
|
package/DropdownMenu/Items.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { As, FlightUIProps } from '../withFlightUI';
|
|
3
|
-
export declare const Items: React.FC<{
|
|
4
|
-
/** By default, the items are not rendered when the dropdownMenu's `isOpen` state is `false`.
|
|
5
|
-
* Set this to true if you would prefer the list to be hidden with `display: none`
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
onlyHide?: boolean;
|
|
9
|
-
/** Whether the menu should close when clicking outside it.
|
|
10
|
-
* @default true
|
|
11
|
-
*/
|
|
12
|
-
closeOnClickOutside?: boolean;
|
|
13
|
-
} & FlightUIProps & {
|
|
14
|
-
/** @default 'ul' */
|
|
15
|
-
as?: As;
|
|
16
|
-
}>;
|
package/DropdownMenu/Items.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React, { Children, useEffect, useRef } from 'react';
|
|
13
|
-
import { useOnClickOutside, useOnEsc } from '../hooks';
|
|
14
|
-
import { withFlightUI } from '../withFlightUI';
|
|
15
|
-
import { DropdownMenuContext } from './DropdownMenu';
|
|
16
|
-
export const Items = (_a) => {
|
|
17
|
-
var { onlyHide, closeOnClickOutside = true, children } = _a, rest = __rest(_a, ["onlyHide", "closeOnClickOutside", "children"]);
|
|
18
|
-
const { setIsOpen, itemRefs, isOpen } = React.useContext(DropdownMenuContext);
|
|
19
|
-
const ref = useRef();
|
|
20
|
-
const close = () => isOpen && setIsOpen(false);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (!isOpen)
|
|
23
|
-
return;
|
|
24
|
-
if (itemRefs.current.length > 0) {
|
|
25
|
-
itemRefs.current[0].current.focus();
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
ref.current.focus();
|
|
29
|
-
}, [isOpen, itemRefs]);
|
|
30
|
-
useOnClickOutside({
|
|
31
|
-
condition: closeOnClickOutside,
|
|
32
|
-
action: close,
|
|
33
|
-
ref
|
|
34
|
-
});
|
|
35
|
-
useOnEsc({
|
|
36
|
-
condition: isOpen,
|
|
37
|
-
action: close
|
|
38
|
-
});
|
|
39
|
-
// TODO: full keyboard interactions specified @ https://www.w3.org/TR/wai-aria-practices-1.1/#menu
|
|
40
|
-
const childrenWithIndex = Children.map(children, (child, index) => {
|
|
41
|
-
return React.cloneElement(child, {
|
|
42
|
-
index
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
const El = withFlightUI(childrenWithIndex, Object.assign({ as: 'ul', role: 'menu', ref, tabIndex: -1, 'data-flight-dropdown-items': '' }, rest));
|
|
46
|
-
// Return the element and rely on the CSS to hide
|
|
47
|
-
if (onlyHide) {
|
|
48
|
-
return El;
|
|
49
|
-
}
|
|
50
|
-
// Otherwise don't render anything when menu is closed
|
|
51
|
-
return React.createElement(React.Fragment, null, isOpen ? El : null);
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=Items.js.map
|
|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