cozy-ui 62.1.2 → 62.2.0
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/CHANGELOG.md +29 -0
- package/babel.config.js +1 -1
- package/package.json +17 -12
- package/react/ActionMenu/index.jsx +30 -7
- package/react/AppIcon/index.jsx +2 -0
- package/react/AppSections/categories.js +1 -0
- package/react/BarContextProvider/index.spec.jsx +1 -23
- package/react/CipherIcon/index.jsx +4 -3
- package/react/CipherIcon/index.spec.jsx +50 -0
- package/react/Dialog/index.jsx +41 -3
- package/react/IntentIframe/IntentIframe.jsx +1 -0
- package/react/Popup/index.jsx +1 -0
- package/react/PopupOpener/index.jsx +1 -0
- package/react/PushClientButton/index.jsx +2 -1
- package/react/QuotaAlert/index.jsx +2 -0
- package/react/SelectionBar/index.jsx +34 -1
- package/react/Sidebar/index.jsx +25 -5
- package/react/Viewer/index.jsx +15 -0
- package/react/__snapshots__/examples.spec.jsx.snap +1 -1
- package/react/helpers/tracker.jsx +1 -1
- package/react/hooks/useRealtime.js +2 -0
- package/react/hooks/useSetFlagshipUi/useSetFlagshipUI.spec.ts +202 -0
- package/react/hooks/useSetFlagshipUi/useSetFlagshipUI.ts +41 -0
- package/transpiled/react/ActionMenu/index.js +46 -24
- package/transpiled/react/Alerter/Alert.js +13 -8
- package/transpiled/react/Alerter/index.js +12 -7
- package/transpiled/react/AppIcon/index.js +15 -7
- package/transpiled/react/AppLinker/index.js +17 -6
- package/transpiled/react/AppSections/Sections.js +23 -16
- package/transpiled/react/AppSections/categories.js +19 -17
- package/transpiled/react/AppSections/components/AppsSection.js +3 -3
- package/transpiled/react/AppSections/components/DropdownFilter.js +12 -5
- package/transpiled/react/AppTile/index.js +6 -6
- package/transpiled/react/AppTitle/index.js +3 -2
- package/transpiled/react/Avatar/index.js +4 -4
- package/transpiled/react/Badge/index.js +9 -3
- package/transpiled/react/Banner/index.js +11 -11
- package/transpiled/react/BarButton/index.js +18 -8
- package/transpiled/react/BarContextProvider/index.js +4 -4
- package/transpiled/react/BarTitle/index.js +2 -2
- package/transpiled/react/BottomDrawer/index.js +15 -8
- package/transpiled/react/BottomSheet/BottomSheet.js +15 -10
- package/transpiled/react/BottomSheet/BottomSheetHeader.js +1 -1
- package/transpiled/react/BottomSheet/BottomSheetItem.js +4 -3
- package/transpiled/react/Breadcrumbs/index.js +18 -13
- package/transpiled/react/Button/index.js +13 -11
- package/transpiled/react/ButtonAction/index.js +7 -6
- package/transpiled/react/Buttons/index.js +11 -9
- package/transpiled/react/Card/index.js +12 -4
- package/transpiled/react/Checkbox/index.js +8 -6
- package/transpiled/react/Chip/index.js +20 -9
- package/transpiled/react/CipherIcon/index.js +20 -11
- package/transpiled/react/Circle/index.js +2 -2
- package/transpiled/react/CompositeRow/index.js +10 -9
- package/transpiled/react/ContactPicker/index.js +17 -8
- package/transpiled/react/ContactsList/ContactRow.js +7 -6
- package/transpiled/react/ContactsList/Contacts/ContactCozy.js +1 -1
- package/transpiled/react/ContactsList/Contacts/ContactEmail.js +1 -1
- package/transpiled/react/ContactsList/Contacts/ContactIdentity.js +5 -5
- package/transpiled/react/ContactsList/Contacts/ContactName.js +2 -2
- package/transpiled/react/ContactsList/Contacts/ContactPhone.js +1 -1
- package/transpiled/react/ContactsList/ContactsList.js +8 -7
- package/transpiled/react/ContactsListModal/AddContactButton.js +4 -3
- package/transpiled/react/ContactsListModal/DemoProvider.js +1 -1
- package/transpiled/react/ContactsListModal/EmptyMessage.js +3 -2
- package/transpiled/react/ContactsListModal/index.js +18 -17
- package/transpiled/react/Counter/index.js +1 -1
- package/transpiled/react/CozyDialogs/ConfirmDialog.js +13 -8
- package/transpiled/react/CozyDialogs/Dialog.js +5 -5
- package/transpiled/react/CozyDialogs/DialogBackButton.js +5 -4
- package/transpiled/react/CozyDialogs/DialogCloseButton.js +5 -4
- package/transpiled/react/CozyDialogs/DialogTransition.js +5 -4
- package/transpiled/react/CozyDialogs/FixedActionsDialog.js +13 -8
- package/transpiled/react/CozyDialogs/FixedDialog.js +5 -5
- package/transpiled/react/CozyDialogs/IllustrationDialog.js +13 -8
- package/transpiled/react/CozyDialogs/TopAnchoredDialog.js +1 -1
- package/transpiled/react/CozyDialogs/e2e.js +1 -1
- package/transpiled/react/CozyDialogs/useCozyDialog.js +11 -5
- package/transpiled/react/CozyTheme/index.js +4 -4
- package/transpiled/react/DateMonthPicker/index.js +9 -9
- package/transpiled/react/Dialog/index.js +29 -4
- package/transpiled/react/DropdownButton/index.js +5 -4
- package/transpiled/react/Empty/index.js +8 -7
- package/transpiled/react/Field/index.js +35 -25
- package/transpiled/react/Figure/Figure.js +3 -3
- package/transpiled/react/Figure/FigureBlock.js +3 -3
- package/transpiled/react/FileImageLoader/checkImageSource.js +1 -1
- package/transpiled/react/FileImageLoader/index.js +11 -6
- package/transpiled/react/FileInput/index.js +6 -5
- package/transpiled/react/FilePath/index.js +1 -1
- package/transpiled/react/FilePathLink/index.js +4 -3
- package/transpiled/react/FilePicker/FilePickerBody.js +4 -4
- package/transpiled/react/FilePicker/FilePickerBodyItem.js +10 -10
- package/transpiled/react/FilePicker/FilePickerBreadcrumb.js +6 -6
- package/transpiled/react/FilePicker/FilePickerFooter.js +3 -3
- package/transpiled/react/FilePicker/FilePickerHeader.js +7 -6
- package/transpiled/react/FilePicker/index.js +5 -5
- package/transpiled/react/Filename/index.js +4 -4
- package/transpiled/react/GhostFileBadge/index.js +5 -3
- package/transpiled/react/Hero/index.js +4 -3
- package/transpiled/react/HistoryRow/index.js +13 -12
- package/transpiled/react/I18n/index.js +13 -6
- package/transpiled/react/I18n/withLocales.js +17 -6
- package/transpiled/react/Icon/Sprite.js +1 -1
- package/transpiled/react/Icon/index.js +4 -3
- package/transpiled/react/IconStack/index.js +2 -2
- package/transpiled/react/Icons/Album.js +2 -2
- package/transpiled/react/Icons/AlbumAdd.js +2 -2
- package/transpiled/react/Icons/AlbumRemove.js +2 -2
- package/transpiled/react/Icons/Answer.js +2 -2
- package/transpiled/react/Icons/Apple.js +2 -2
- package/transpiled/react/Icons/Archive.js +2 -2
- package/transpiled/react/Icons/Attachment.js +2 -2
- package/transpiled/react/Icons/Attention.js +2 -2
- package/transpiled/react/Icons/Bank.js +2 -2
- package/transpiled/react/Icons/Banking.js +2 -2
- package/transpiled/react/Icons/BankingAdd.js +2 -2
- package/transpiled/react/Icons/Bell.js +2 -2
- package/transpiled/react/Icons/Bike.js +3 -3
- package/transpiled/react/Icons/Bill.js +2 -2
- package/transpiled/react/Icons/Bottom.js +2 -2
- package/transpiled/react/Icons/BottomSelect.js +2 -2
- package/transpiled/react/Icons/BrowserBrave.js +2 -2
- package/transpiled/react/Icons/BrowserChrome.js +2 -2
- package/transpiled/react/Icons/BrowserDuckduckgo.js +2 -2
- package/transpiled/react/Icons/BrowserEdge.js +4 -4
- package/transpiled/react/Icons/BrowserEdgeChromium.js +2 -2
- package/transpiled/react/Icons/BrowserFirefox.js +2 -2
- package/transpiled/react/Icons/BrowserIe.js +2 -2
- package/transpiled/react/Icons/BrowserOpera.js +2 -2
- package/transpiled/react/Icons/BrowserSafari.js +2 -2
- package/transpiled/react/Icons/Burger.js +2 -2
- package/transpiled/react/Icons/Bus.js +2 -2
- package/transpiled/react/Icons/Calendar.js +2 -2
- package/transpiled/react/Icons/Camera.js +2 -2
- package/transpiled/react/Icons/Car.js +2 -2
- package/transpiled/react/Icons/CarbonCopy.js +2 -2
- package/transpiled/react/Icons/Categories.js +2 -2
- package/transpiled/react/Icons/Certified.js +2 -2
- package/transpiled/react/Icons/Check.js +2 -2
- package/transpiled/react/Icons/CheckCircle.js +2 -2
- package/transpiled/react/Icons/CheckList.js +2 -2
- package/transpiled/react/Icons/CheckSquare.js +2 -2
- package/transpiled/react/Icons/CheckWhite.js +2 -2
- package/transpiled/react/Icons/Checkbox.js +3 -3
- package/transpiled/react/Icons/CircleFilled.js +2 -2
- package/transpiled/react/Icons/Clock.js +2 -2
- package/transpiled/react/Icons/Cloud.js +4 -4
- package/transpiled/react/Icons/CloudBroken.js +4 -4
- package/transpiled/react/Icons/CloudHappy.js +2 -2
- package/transpiled/react/Icons/CloudSync.js +4 -4
- package/transpiled/react/Icons/Collect.js +2 -2
- package/transpiled/react/Icons/Comment.js +2 -2
- package/transpiled/react/Icons/Company.js +2 -2
- package/transpiled/react/Icons/Compass.js +2 -2
- package/transpiled/react/Icons/Connector.js +3 -3
- package/transpiled/react/Icons/Contract.js +2 -2
- package/transpiled/react/Icons/Contrast.js +2 -2
- package/transpiled/react/Icons/Cozy.js +2 -2
- package/transpiled/react/Icons/CozyLaugh.js +2 -2
- package/transpiled/react/Icons/CozyLogo.js +4 -4
- package/transpiled/react/Icons/CozyText.js +2 -2
- package/transpiled/react/Icons/Credit.js +4 -4
- package/transpiled/react/Icons/CreditCard.js +2 -2
- package/transpiled/react/Icons/CreditCardAdd.js +2 -2
- package/transpiled/react/Icons/Crop.js +2 -2
- package/transpiled/react/Icons/Cross.js +2 -2
- package/transpiled/react/Icons/CrossCircle.js +2 -2
- package/transpiled/react/Icons/CrossMedium.js +2 -2
- package/transpiled/react/Icons/CrossSmall.js +2 -2
- package/transpiled/react/Icons/CrossWhite.js +2 -2
- package/transpiled/react/Icons/Cube.js +2 -2
- package/transpiled/react/Icons/Dash.js +2 -2
- package/transpiled/react/Icons/DashWhite.js +2 -2
- package/transpiled/react/Icons/Dashboard.js +2 -2
- package/transpiled/react/Icons/DataControl.js +2 -2
- package/transpiled/react/Icons/Debit.js +4 -4
- package/transpiled/react/Icons/DeviceBrowser.js +4 -4
- package/transpiled/react/Icons/DeviceLaptop.js +5 -5
- package/transpiled/react/Icons/DevicePhone.js +6 -6
- package/transpiled/react/Icons/DeviceTablet.js +5 -5
- package/transpiled/react/Icons/Devices.js +2 -2
- package/transpiled/react/Icons/Dots.js +2 -2
- package/transpiled/react/Icons/DotsWhite.js +2 -2
- package/transpiled/react/Icons/Down.js +2 -2
- package/transpiled/react/Icons/Download.js +2 -2
- package/transpiled/react/Icons/DrawingArrowUp.js +2 -2
- package/transpiled/react/Icons/Dropdown.js +2 -2
- package/transpiled/react/Icons/DropdownClose.js +2 -2
- package/transpiled/react/Icons/DropdownOpen.js +2 -2
- package/transpiled/react/Icons/Dropup.js +2 -2
- package/transpiled/react/Icons/Email.js +2 -2
- package/transpiled/react/Icons/EmailNotification.js +2 -2
- package/transpiled/react/Icons/Eu.js +2 -2
- package/transpiled/react/Icons/Euro.js +2 -2
- package/transpiled/react/Icons/Exchange.js +2 -2
- package/transpiled/react/Icons/Eye.js +2 -2
- package/transpiled/react/Icons/EyeClosed.js +5 -5
- package/transpiled/react/Icons/File.js +3 -3
- package/transpiled/react/Icons/FileAdd.js +2 -2
- package/transpiled/react/Icons/FileDuotone.js +6 -6
- package/transpiled/react/Icons/FileNew.js +2 -2
- package/transpiled/react/Icons/FileNone.js +3 -3
- package/transpiled/react/Icons/FileOutline.js +2 -2
- package/transpiled/react/Icons/FileTypeAudio.js +4 -4
- package/transpiled/react/Icons/FileTypeBin.js +5 -5
- package/transpiled/react/Icons/FileTypeCode.js +7 -7
- package/transpiled/react/Icons/FileTypeFiles.js +4 -4
- package/transpiled/react/Icons/FileTypeFolder.js +4 -4
- package/transpiled/react/Icons/FileTypeImage.js +6 -6
- package/transpiled/react/Icons/FileTypeNote.js +3 -3
- package/transpiled/react/Icons/FileTypePdf.js +4 -4
- package/transpiled/react/Icons/FileTypeSheet.js +4 -4
- package/transpiled/react/Icons/FileTypeSlide.js +4 -4
- package/transpiled/react/Icons/FileTypeText.js +4 -4
- package/transpiled/react/Icons/FileTypeVideo.js +4 -4
- package/transpiled/react/Icons/FileTypeZip.js +4 -4
- package/transpiled/react/Icons/Filter.js +2 -2
- package/transpiled/react/Icons/Fingerprint.js +2 -2
- package/transpiled/react/Icons/Fitness.js +2 -2
- package/transpiled/react/Icons/Flag.js +2 -2
- package/transpiled/react/Icons/FlagOutlined.js +2 -2
- package/transpiled/react/Icons/FlashAuto.js +2 -2
- package/transpiled/react/Icons/Flashlight.js +2 -2
- package/transpiled/react/Icons/Folder.js +4 -4
- package/transpiled/react/Icons/FolderAdd.js +2 -2
- package/transpiled/react/Icons/FolderMoveto.js +2 -2
- package/transpiled/react/Icons/Forbidden.js +2 -2
- package/transpiled/react/Icons/ForbiddenSign.js +4 -4
- package/transpiled/react/Icons/FromUser.js +2 -2
- package/transpiled/react/Icons/Gear.js +4 -4
- package/transpiled/react/Icons/Globe.js +2 -2
- package/transpiled/react/Icons/Google.js +6 -6
- package/transpiled/react/Icons/GraphCircle.js +2 -2
- package/transpiled/react/Icons/Grid.js +2 -2
- package/transpiled/react/Icons/GroupList.js +2 -2
- package/transpiled/react/Icons/Groups.js +2 -2
- package/transpiled/react/Icons/Heart.js +2 -2
- package/transpiled/react/Icons/Help.js +2 -2
- package/transpiled/react/Icons/History.js +2 -2
- package/transpiled/react/Icons/Home.js +2 -2
- package/transpiled/react/Icons/Hourglass.js +3 -3
- package/transpiled/react/Icons/Image.js +2 -2
- package/transpiled/react/Icons/Info.js +3 -3
- package/transpiled/react/Icons/InfoOutlined.js +2 -2
- package/transpiled/react/Icons/Key.js +2 -2
- package/transpiled/react/Icons/Keychain.js +4 -4
- package/transpiled/react/Icons/Laptop.js +2 -2
- package/transpiled/react/Icons/Left.js +2 -2
- package/transpiled/react/Icons/Lightbulb.js +2 -2
- package/transpiled/react/Icons/Link.js +2 -2
- package/transpiled/react/Icons/LinkOut.js +2 -2
- package/transpiled/react/Icons/List.js +2 -2
- package/transpiled/react/Icons/Location.js +2 -2
- package/transpiled/react/Icons/Lock.js +2 -2
- package/transpiled/react/Icons/Logout.js +2 -2
- package/transpiled/react/Icons/LogoutLarge.js +5 -5
- package/transpiled/react/Icons/MagicTrick.js +2 -2
- package/transpiled/react/Icons/Magnet.js +2 -2
- package/transpiled/react/Icons/Magnifier.js +2 -2
- package/transpiled/react/Icons/Merge.js +2 -2
- package/transpiled/react/Icons/Mountain.js +2 -2
- package/transpiled/react/Icons/Movement.js +2 -2
- package/transpiled/react/Icons/MovementIn.js +4 -4
- package/transpiled/react/Icons/MovementOut.js +4 -4
- package/transpiled/react/Icons/Moveto.js +2 -2
- package/transpiled/react/Icons/MultiFiles.js +2 -2
- package/transpiled/react/Icons/Music.js +2 -2
- package/transpiled/react/Icons/New.js +2 -2
- package/transpiled/react/Icons/Next.js +2 -2
- package/transpiled/react/Icons/Note.js +2 -2
- package/transpiled/react/Icons/NotificationEmail.js +2 -2
- package/transpiled/react/Icons/Offline.js +2 -2
- package/transpiled/react/Icons/Online.js +2 -2
- package/transpiled/react/Icons/Openwith.js +2 -2
- package/transpiled/react/Icons/Palette.js +2 -2
- package/transpiled/react/Icons/Paperplane.js +2 -2
- package/transpiled/react/Icons/Password.js +2 -2
- package/transpiled/react/Icons/Pen.js +3 -3
- package/transpiled/react/Icons/People.js +2 -2
- package/transpiled/react/Icons/Percent.js +2 -2
- package/transpiled/react/Icons/PercentCircle.js +2 -2
- package/transpiled/react/Icons/PersonalData.js +2 -2
- package/transpiled/react/Icons/Phone.js +2 -2
- package/transpiled/react/Icons/PhoneDownload.js +2 -2
- package/transpiled/react/Icons/PhoneUpload.js +2 -2
- package/transpiled/react/Icons/PieChart.js +2 -2
- package/transpiled/react/Icons/Pin.js +2 -2
- package/transpiled/react/Icons/Plane.js +2 -2
- package/transpiled/react/Icons/Plus.js +3 -3
- package/transpiled/react/Icons/PlusSmall.js +3 -3
- package/transpiled/react/Icons/Previous.js +2 -2
- package/transpiled/react/Icons/Printer.js +2 -2
- package/transpiled/react/Icons/Qualify.js +2 -2
- package/transpiled/react/Icons/RadioChecked.js +2 -2
- package/transpiled/react/Icons/RadioUnchecked.js +2 -2
- package/transpiled/react/Icons/Rename.js +2 -2
- package/transpiled/react/Icons/Repare.js +2 -2
- package/transpiled/react/Icons/Reply.js +2 -2
- package/transpiled/react/Icons/Restaurant.js +2 -2
- package/transpiled/react/Icons/Restore.js +4 -4
- package/transpiled/react/Icons/RestoreStraight.js +2 -2
- package/transpiled/react/Icons/Right.js +2 -2
- package/transpiled/react/Icons/Rise.js +2 -2
- package/transpiled/react/Icons/RotateLeft.js +2 -2
- package/transpiled/react/Icons/RotateRight.js +2 -2
- package/transpiled/react/Icons/SadCozy.js +2 -2
- package/transpiled/react/Icons/Safe.js +2 -2
- package/transpiled/react/Icons/School.js +2 -2
- package/transpiled/react/Icons/SelectAll.js +2 -2
- package/transpiled/react/Icons/Setting.js +2 -2
- package/transpiled/react/Icons/Share.js +4 -4
- package/transpiled/react/Icons/ShareCircle.js +2 -2
- package/transpiled/react/Icons/ShareGrey08.js +4 -4
- package/transpiled/react/Icons/ShareIos.js +2 -2
- package/transpiled/react/Icons/Shield.js +2 -2
- package/transpiled/react/Icons/Shop.js +2 -2
- package/transpiled/react/Icons/Sound.js +2 -2
- package/transpiled/react/Icons/Spinner.js +3 -3
- package/transpiled/react/Icons/Stack.js +2 -2
- package/transpiled/react/Icons/Star.js +2 -2
- package/transpiled/react/Icons/Stats.js +2 -2
- package/transpiled/react/Icons/Subway.js +2 -2
- package/transpiled/react/Icons/Sync.js +2 -2
- package/transpiled/react/Icons/SyncCozy.js +2 -2
- package/transpiled/react/Icons/Target.js +2 -2
- package/transpiled/react/Icons/Team.js +2 -2
- package/transpiled/react/Icons/Telephone.js +2 -2
- package/transpiled/react/Icons/ToTheCloud.js +2 -2
- package/transpiled/react/Icons/Top.js +2 -2
- package/transpiled/react/Icons/TopSelect.js +2 -2
- package/transpiled/react/Icons/Train.js +2 -2
- package/transpiled/react/Icons/Trash.js +4 -4
- package/transpiled/react/Icons/Trophy.js +2 -2
- package/transpiled/react/Icons/Unknow.js +2 -2
- package/transpiled/react/Icons/Unlink.js +2 -2
- package/transpiled/react/Icons/Unlock.js +2 -2
- package/transpiled/react/Icons/Up.js +2 -2
- package/transpiled/react/Icons/Upload.js +2 -2
- package/transpiled/react/Icons/Videos.js +2 -2
- package/transpiled/react/Icons/Walk.js +2 -2
- package/transpiled/react/Icons/Wallet.js +2 -2
- package/transpiled/react/Icons/WalletAdd.js +2 -2
- package/transpiled/react/Icons/WalletNew.js +2 -2
- package/transpiled/react/Icons/Warn.js +2 -2
- package/transpiled/react/Icons/Warning.js +2 -2
- package/transpiled/react/Icons/WarningCircle.js +2 -2
- package/transpiled/react/Icons/WrenchCircle.js +2 -2
- package/transpiled/react/Infos/index.js +16 -15
- package/transpiled/react/InfosBadge/index.js +5 -3
- package/transpiled/react/InfosCarrousel/index.js +9 -9
- package/transpiled/react/InlineCard/index.js +12 -4
- package/transpiled/react/Input/index.js +3 -2
- package/transpiled/react/InputGroup/index.js +15 -8
- package/transpiled/react/IntentDialogOpener/IntentDialogOpener.js +7 -6
- package/transpiled/react/IntentHeader/index.js +4 -4
- package/transpiled/react/IntentIframe/IntentIframe.js +19 -10
- package/transpiled/react/IntentModal/IntentModal.js +18 -8
- package/transpiled/react/IntentOpener/IntentOpener.js +5 -4
- package/transpiled/react/IntentWrapper/index.js +3 -3
- package/transpiled/react/Label/index.js +3 -2
- package/transpiled/react/Labs/CollectionField/index.js +9 -8
- package/transpiled/react/Labs/ExperimentalDialog/index.js +3 -3
- package/transpiled/react/Labs/GridItem/index.js +1 -1
- package/transpiled/react/Labs/IconGrid/index.js +1 -1
- package/transpiled/react/Labs/PasswordInput/index.js +14 -11
- package/transpiled/react/Layout/Layout.js +18 -8
- package/transpiled/react/ListItemText/index.js +9 -3
- package/transpiled/react/LoadMore/index.js +4 -4
- package/transpiled/react/Media/Media.js +9 -6
- package/transpiled/react/Menu/Button.js +1 -1
- package/transpiled/react/Menu/index.js +29 -15
- package/transpiled/react/MidEllipsis/index.js +3 -3
- package/transpiled/react/Modal/AnimatedContentHeader.js +9 -2
- package/transpiled/react/Modal/ModalBackButton.js +3 -2
- package/transpiled/react/Modal/ModalButtons.js +3 -3
- package/transpiled/react/Modal/ModalContent.js +14 -7
- package/transpiled/react/Modal/ModalCross.js +3 -3
- package/transpiled/react/Modal/ModalFooter.js +1 -1
- package/transpiled/react/Modal/ModalHeader.js +12 -7
- package/transpiled/react/Modal/ModalSection.js +1 -1
- package/transpiled/react/Modal/index.js +25 -14
- package/transpiled/react/MuiCozyTheme/AccordionExpandIcon.js +1 -1
- package/transpiled/react/MuiCozyTheme/Dialog/DialogCloseButton.js +1 -1
- package/transpiled/react/MuiCozyTheme/Dialog/DialogContent.js +1 -1
- package/transpiled/react/MuiCozyTheme/Dialog/DialogContentText.js +1 -1
- package/transpiled/react/MuiCozyTheme/Divider/TextDivider/index.js +3 -2
- package/transpiled/react/MuiCozyTheme/Divider/index.js +5 -2
- package/transpiled/react/MuiCozyTheme/Menus/index.js +18 -13
- package/transpiled/react/MuiCozyTheme/RaisedList/index.js +2 -2
- package/transpiled/react/MuiCozyTheme/index.js +1 -1
- package/transpiled/react/MuiCozyTheme/makeOverrides.js +10 -6
- package/transpiled/react/MuiCozyTheme/makeTheme.js +9 -4
- package/transpiled/react/MuiTabs/index.js +1 -1
- package/transpiled/react/NarrowContent/index.js +3 -2
- package/transpiled/react/Nav/index.js +11 -9
- package/transpiled/react/NavigationList/index.js +5 -5
- package/transpiled/react/NestedSelect/Modal.js +8 -8
- package/transpiled/react/NestedSelect/NestedSelect.js +24 -17
- package/transpiled/react/OrderedList/index.js +6 -4
- package/transpiled/react/Overlay/index.js +12 -7
- package/transpiled/react/Page/index.js +8 -8
- package/transpiled/react/PasswordExample/index.js +7 -5
- package/transpiled/react/PercentageBar/index.js +4 -3
- package/transpiled/react/PercentageLine/index.js +7 -2
- package/transpiled/react/Popover/Popover.js +16 -6
- package/transpiled/react/Popup/index.js +12 -3
- package/transpiled/react/PopupOpener/index.js +3 -1
- package/transpiled/react/Portal/index.js +1 -1
- package/transpiled/react/ProgressionBanner/index.js +3 -3
- package/transpiled/react/PushClientButton/index.js +6 -5
- package/transpiled/react/QuotaAlert/index.js +8 -6
- package/transpiled/react/Radio/index.js +5 -4
- package/transpiled/react/Radios/index.js +3 -3
- package/transpiled/react/SelectBox/ControlDefault.js +10 -4
- package/transpiled/react/SelectBox/SelectBox.js +40 -28
- package/transpiled/react/SelectBox/SelectBoxWithFixedOptions.js +9 -4
- package/transpiled/react/SelectionBar/index.js +34 -11
- package/transpiled/react/Sidebar/index.js +13 -2
- package/transpiled/react/Spinner/index.js +3 -3
- package/transpiled/react/SquareAppIcon/index.js +11 -10
- package/transpiled/react/Stack/index.js +3 -2
- package/transpiled/react/Stepper/testing.js +1 -1
- package/transpiled/react/Table/index.js +18 -12
- package/transpiled/react/Text/index.js +11 -8
- package/transpiled/react/Textarea/index.js +4 -3
- package/transpiled/react/Tile/index.js +8 -7
- package/transpiled/react/Toggle/index.js +12 -5
- package/transpiled/react/UnorderedList/index.js +6 -4
- package/transpiled/react/UploadQueue/index.js +43 -38
- package/transpiled/react/ViewStack/ModalStack.js +2 -2
- package/transpiled/react/ViewStack/ViewStack.js +3 -3
- package/transpiled/react/ViewStack/context.js +1 -1
- package/transpiled/react/ViewStack/example.js +5 -5
- package/transpiled/react/ViewStack/hooks.js +1 -1
- package/transpiled/react/Viewer/AudioViewer.js +4 -4
- package/transpiled/react/Viewer/Footer/BottomSheetContent.js +2 -2
- package/transpiled/react/Viewer/Footer/DownloadButton.js +2 -2
- package/transpiled/react/Viewer/Footer/FooterContent.js +15 -10
- package/transpiled/react/Viewer/Footer/ForwardButton.js +2 -2
- package/transpiled/react/Viewer/Footer/Sharing.js +3 -3
- package/transpiled/react/Viewer/Footer.js +1 -1
- package/transpiled/react/Viewer/ImageViewer.js +21 -11
- package/transpiled/react/Viewer/InformationPanel.js +1 -1
- package/transpiled/react/Viewer/Navigation.js +2 -2
- package/transpiled/react/Viewer/NoNetworkViewer.js +3 -3
- package/transpiled/react/Viewer/NoViewer/DownloadButton.js +1 -1
- package/transpiled/react/Viewer/NoViewer/FileIcon.js +1 -1
- package/transpiled/react/Viewer/NoViewer/NoViewer.js +4 -4
- package/transpiled/react/Viewer/OnlyOfficeViewer.js +2 -2
- package/transpiled/react/Viewer/Panel/Certifications.js +8 -8
- package/transpiled/react/Viewer/Panel/PanelContent.js +6 -6
- package/transpiled/react/Viewer/Panel/Qualification.js +8 -8
- package/transpiled/react/Viewer/Panel/QualificationListItemText.js +3 -3
- package/transpiled/react/Viewer/PdfJsViewer.js +23 -18
- package/transpiled/react/Viewer/PdfMobileViewer.js +8 -8
- package/transpiled/react/Viewer/PdfToolbarButton.js +1 -1
- package/transpiled/react/Viewer/ShortcutViewer.js +2 -2
- package/transpiled/react/Viewer/TextViewer.js +20 -15
- package/transpiled/react/Viewer/Toolbar.js +6 -6
- package/transpiled/react/Viewer/VideoViewer.js +3 -3
- package/transpiled/react/Viewer/ViewerByFile.js +1 -1
- package/transpiled/react/Viewer/ViewerControls.js +15 -10
- package/transpiled/react/Viewer/ViewerSpinner.js +1 -1
- package/transpiled/react/Viewer/ViewerWrapper.js +1 -1
- package/transpiled/react/Viewer/index.js +41 -19
- package/transpiled/react/Viewer/withFileUrl.js +23 -15
- package/transpiled/react/Wizard/index.js +34 -27
- package/transpiled/react/helpers/migrateProps.js +19 -17
- package/transpiled/react/helpers/tracker.js +1 -1
- package/transpiled/react/helpers/useInstance.js +1 -1
- package/transpiled/react/helpers/withBreakpoints.js +10 -3
- package/transpiled/react/helpers/withOffline.js +13 -10
- package/transpiled/react/helpers/withState.js +11 -4
- package/transpiled/react/hooks/useBreakpoints/index.js +2 -2
- package/transpiled/react/hooks/useConfirmExit/index.js +4 -4
- package/transpiled/react/hooks/useRealtime.js +4 -2
- package/transpiled/react/hooks/useSetFlagshipUi/useSetFlagshipUI.js +29 -0
- package/transpiled/react/utils.js +5 -3
- package/tsconfig.json +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
# [62.2.0](https://github.com/cozy/cozy-ui/compare/v62.1.4...v62.2.0) (2022-03-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** Upgrade few packages ([5df4e2b](https://github.com/cozy/cozy-ui/commit/5df4e2b))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add Typescript support ([1ad1a48](https://github.com/cozy/cozy-ui/commit/1ad1a48))
|
|
12
|
+
* Handle FlagshipUI for cozy-drive cases ([6fa0228](https://github.com/cozy/cozy-ui/commit/6fa0228))
|
|
13
|
+
* Refactor setFlagshipUI feature ([64ca864](https://github.com/cozy/cozy-ui/commit/64ca864))
|
|
14
|
+
* Update cozy-intent for flagship-UI ([2b3d026](https://github.com/cozy/cozy-ui/commit/2b3d026))
|
|
15
|
+
|
|
16
|
+
## [62.1.4](https://github.com/cozy/cozy-ui/compare/v62.1.3...v62.1.4) (2022-03-03)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* Do not stretch small screenshots ([4af1a3f](https://github.com/cozy/cozy-ui/commit/4af1a3f))
|
|
22
|
+
|
|
23
|
+
## [62.1.3](https://github.com/cozy/cozy-ui/compare/v62.1.2...v62.1.3) (2022-03-02)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **AppIcon:** Add appData to getIconUrl without using blob ([9e99569](https://github.com/cozy/cozy-ui/commit/9e99569))
|
|
29
|
+
|
|
1
30
|
## [62.1.2](https://github.com/cozy/cozy-ui/compare/v62.1.1...v62.1.2) (2022-02-24)
|
|
2
31
|
|
|
3
32
|
|
package/babel.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui",
|
|
3
|
-
"version": "62.
|
|
3
|
+
"version": "62.2.0",
|
|
4
4
|
"description": "Cozy apps UI SDK",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"build:doc:config": "copyfiles -u 1 docs/*.md docs/_config.yml build",
|
|
28
28
|
"build:doc:kss": "kss --destination build/styleguide --title 'Cozy-UI Styleguide' --source stylus --builder node_modules/michelangelo/kss_styleguide/custom-template --homepage styleguide.md --css app.css",
|
|
29
29
|
"build:doc:react": "styleguidist build --config docs/styleguide.config.js",
|
|
30
|
-
"build": "env BABEL_ENV=transpilation babel react/ --out-dir transpiled/react --verbose",
|
|
30
|
+
"build": "env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx react/ --out-dir transpiled/react --verbose",
|
|
31
31
|
"clean:doc:kss": "rm -rf build/styleguide",
|
|
32
32
|
"commitmsg": "commitlint -e $GIT_PARAMS",
|
|
33
33
|
"deploy:doc": "git-directory-deploy --directory build/ --branch gh-pages",
|
|
34
34
|
"makeSvgr": "scripts/generate-svgr-icon.sh",
|
|
35
35
|
"lint": "npm-run-all 'lint:*'",
|
|
36
36
|
"lint:commit": "git merge-base HEAD master && commitlint --from=$(git merge-base HEAD master) --to=HEAD || true",
|
|
37
|
-
"lint:js": "eslint 'react/**/*.jsx' 'react/**/*.js' 'docs/styleguide.config.js'",
|
|
37
|
+
"lint:js": "eslint 'react/**/*.jsx' 'react/**/*.js' 'react/**/*.ts' 'docs/styleguide.config.js'",
|
|
38
38
|
"lint:stylus": "stylint stylus --config .stylintrc",
|
|
39
39
|
"lint:md": "remark . -o -S",
|
|
40
40
|
"palette": "scripts/make-palette.sh",
|
|
@@ -68,7 +68,10 @@
|
|
|
68
68
|
],
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/cli": "7.11.5",
|
|
71
|
-
"@babel/core": "7.
|
|
71
|
+
"@babel/core": "7.16.12",
|
|
72
|
+
"@babel/helper-builder-react-jsx": "7.16.7",
|
|
73
|
+
"@babel/helper-define-map": "7.16.7",
|
|
74
|
+
"@babel/helper-regex": "7.10.5",
|
|
72
75
|
"@cozy/codemods": "^1.9.0",
|
|
73
76
|
"@material-ui/core": "4.12.3",
|
|
74
77
|
"@semantic-release/changelog": "5.0.1",
|
|
@@ -83,25 +86,25 @@
|
|
|
83
86
|
"babel-loader": "8.1.0",
|
|
84
87
|
"babel-plugin-css-modules-transform": "1.6.2",
|
|
85
88
|
"babel-plugin-inline-json-import": "0.3.2",
|
|
86
|
-
"babel-preset-cozy-app": "
|
|
89
|
+
"babel-preset-cozy-app": "2.0.2",
|
|
87
90
|
"browserslist-config-cozy": "0.4.0",
|
|
88
91
|
"commitlint": "7.6.1",
|
|
89
92
|
"commitlint-config-cozy": "0.6.0",
|
|
90
93
|
"copyfiles": "2.1.1",
|
|
91
|
-
"cozy-client": "
|
|
94
|
+
"cozy-client": "27.19.1",
|
|
92
95
|
"cozy-device-helper": "^1.16.1",
|
|
93
96
|
"cozy-doctypes": "^1.69.0",
|
|
94
97
|
"cozy-harvest-lib": "^6.7.3",
|
|
95
|
-
"cozy-intent": "
|
|
98
|
+
"cozy-intent": "1.13.0",
|
|
96
99
|
"cozy-sharing": "^3.10.0",
|
|
100
|
+
"cozy-stack-client": "27.19.1",
|
|
97
101
|
"css-loader": "0.28.11",
|
|
98
102
|
"cssnano": "4.1.11",
|
|
99
103
|
"cssnano-preset-advanced": "4.0.8",
|
|
100
104
|
"enzyme": "3.11.0",
|
|
101
105
|
"enzyme-adapter-react-16": "1.15.6",
|
|
102
106
|
"enzyme-to-json": "3.6.2",
|
|
103
|
-
"eslint": "4.
|
|
104
|
-
"eslint-config-cozy-app": "0.5.1",
|
|
107
|
+
"eslint-config-cozy-app": "4.0.0",
|
|
105
108
|
"express": "^4.17.1",
|
|
106
109
|
"focus-trap-react": "^6.0.0",
|
|
107
110
|
"git-directory-deploy": "1.5.1",
|
|
@@ -168,7 +171,7 @@
|
|
|
168
171
|
},
|
|
169
172
|
"peerDependencies": {
|
|
170
173
|
"@material-ui/core": ">=4.12",
|
|
171
|
-
"cozy-client": ">=27.
|
|
174
|
+
"cozy-client": ">=27.19.1",
|
|
172
175
|
"cozy-device-helper": "^1.16.0",
|
|
173
176
|
"cozy-doctypes": "^1.69.0",
|
|
174
177
|
"cozy-harvest-lib": "^6.7.3",
|
|
@@ -197,7 +200,9 @@
|
|
|
197
200
|
"js",
|
|
198
201
|
"jsx",
|
|
199
202
|
"json",
|
|
200
|
-
"styl"
|
|
203
|
+
"styl",
|
|
204
|
+
"ts",
|
|
205
|
+
"tsx"
|
|
201
206
|
],
|
|
202
207
|
"testPathIgnorePatterns": [
|
|
203
208
|
"/node_modules/",
|
|
@@ -210,7 +215,7 @@
|
|
|
210
215
|
"react-styleguidist/lib"
|
|
211
216
|
],
|
|
212
217
|
"transform": {
|
|
213
|
-
"^.+\\.jsx?$": "babel-jest"
|
|
218
|
+
"^.+\\.(ts|tsx|js|jsx)?$": "babel-jest"
|
|
214
219
|
},
|
|
215
220
|
"transformIgnorePatterns": [
|
|
216
221
|
"node_modules/(?!(react-styleguidist)/)"
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ClickAwayListener from '@material-ui/core/ClickAwayListener'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
import cx from 'classnames'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { usePopper } from 'react-popper'
|
|
6
|
+
import { useTheme } from '@material-ui/core'
|
|
7
|
+
|
|
7
8
|
import BottomDrawer from '../BottomDrawer'
|
|
9
|
+
import Radio from '../Radio'
|
|
10
|
+
import createDepreciationLogger from '../helpers/createDepreciationLogger'
|
|
11
|
+
import styles from './styles.styl'
|
|
8
12
|
import useBreakpoints from '../hooks/useBreakpoints'
|
|
13
|
+
import { Media, Bd, Img } from '../Media'
|
|
9
14
|
import { getCssVariableValue } from '../utils/color'
|
|
10
|
-
import Radio from '../Radio'
|
|
11
15
|
import { spacingProp } from '../Stack'
|
|
12
|
-
import {
|
|
13
|
-
import createDepreciationLogger from '../helpers/createDepreciationLogger'
|
|
16
|
+
import { useSetFlagshipUI } from '../hooks/useSetFlagshipUi/useSetFlagshipUI'
|
|
14
17
|
|
|
15
18
|
const ActionMenuWrapper = ({
|
|
16
19
|
inline,
|
|
@@ -101,6 +104,26 @@ const ActionMenu = ({
|
|
|
101
104
|
anchorElRef,
|
|
102
105
|
containerElRef
|
|
103
106
|
}) => {
|
|
107
|
+
const theme = useTheme()
|
|
108
|
+
const sidebar = document.getElementById('sidebar')
|
|
109
|
+
|
|
110
|
+
useSetFlagshipUI(
|
|
111
|
+
{
|
|
112
|
+
bottomBackground: theme.palette.background.paper,
|
|
113
|
+
bottomTheme: 'dark',
|
|
114
|
+
topOverlay: getCssVariableValue('overlay'), // TODO: refactor to semantic variable
|
|
115
|
+
topBackground: theme.palette.background.paper,
|
|
116
|
+
topTheme: 'light'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
bottomBackground: theme.palette.background[sidebar ? 'default' : 'paper'],
|
|
120
|
+
bottomTheme: 'dark',
|
|
121
|
+
topOverlay: 'transparent',
|
|
122
|
+
topBackground: theme.palette.background.paper,
|
|
123
|
+
topTheme: 'dark'
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
|
|
104
127
|
if (placement)
|
|
105
128
|
logDepecratedPlacement(
|
|
106
129
|
'<ActionMenu placement /> is deprecated, use <ActionMenu popperOptions={{ placement }} /> instead'
|
package/react/AppIcon/index.jsx
CHANGED
|
@@ -49,6 +49,7 @@ export class AppIcon extends Component {
|
|
|
49
49
|
return client.getStackClient().getIconURL({
|
|
50
50
|
type,
|
|
51
51
|
slug: app.slug || app,
|
|
52
|
+
appData: app,
|
|
52
53
|
priority
|
|
53
54
|
})
|
|
54
55
|
}
|
|
@@ -59,6 +60,7 @@ export class AppIcon extends Component {
|
|
|
59
60
|
|
|
60
61
|
async load() {
|
|
61
62
|
const { app, fetchIcon, onReady, client } = this.props
|
|
63
|
+
|
|
62
64
|
const loadFn = fetchIcon || this.fetchIcon
|
|
63
65
|
let loadedUrl
|
|
64
66
|
let loadError
|
|
@@ -21,6 +21,7 @@ const multiGroupBy = (iter, grouper) => {
|
|
|
21
21
|
for (const obj of iter) {
|
|
22
22
|
const values = grouper(obj) || []
|
|
23
23
|
values.forEach(v => {
|
|
24
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
24
25
|
if (!groups.hasOwnProperty(v)) groups[v] = []
|
|
25
26
|
groups[v].push(obj)
|
|
26
27
|
})
|
|
@@ -33,6 +33,7 @@ const IntentComponent = () => {
|
|
|
33
33
|
let render
|
|
34
34
|
|
|
35
35
|
try {
|
|
36
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
37
|
webviewIntent = useWebviewIntent()
|
|
37
38
|
render = webviewIntent.foo
|
|
38
39
|
} catch {
|
|
@@ -172,27 +173,4 @@ describe('BarContextProvider', () => {
|
|
|
172
173
|
|
|
173
174
|
expect(queryByText(mockVoidWebviewService)).toBeInTheDocument()
|
|
174
175
|
})
|
|
175
|
-
|
|
176
|
-
it('should not try to provide a cozy-intent context if one is provided', () => {
|
|
177
|
-
// Set Web context
|
|
178
|
-
window.cozy.isFlagshipApp = false
|
|
179
|
-
|
|
180
|
-
const client = createMockClient({})
|
|
181
|
-
const mockStore = configureStore()
|
|
182
|
-
const store = mockStore(x => x)
|
|
183
|
-
|
|
184
|
-
const { queryByText } = render(
|
|
185
|
-
<Provider store={store}>
|
|
186
|
-
<CozyProvider client={client}>
|
|
187
|
-
<I18n lang="en" dictRequire={() => locales}>
|
|
188
|
-
<App webviewService={mockWebviewService}>
|
|
189
|
-
<IntentComponent />
|
|
190
|
-
</App>
|
|
191
|
-
</I18n>
|
|
192
|
-
</CozyProvider>
|
|
193
|
-
</Provider>
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
expect(queryByText(mockWebviewService.foo)).not.toBeInTheDocument()
|
|
197
|
-
})
|
|
198
176
|
})
|
|
@@ -6,7 +6,7 @@ import Icon from '../Icon'
|
|
|
6
6
|
import { withClient } from 'cozy-client'
|
|
7
7
|
import { AppDoctype } from '../proptypes'
|
|
8
8
|
|
|
9
|
-
import KeychainIcon from '
|
|
9
|
+
import KeychainIcon from '../Icons/Keychain'
|
|
10
10
|
|
|
11
11
|
class CipherIcon extends React.PureComponent {
|
|
12
12
|
constructor(props) {
|
|
@@ -17,9 +17,10 @@ class CipherIcon extends React.PureComponent {
|
|
|
17
17
|
fetchIcon() {
|
|
18
18
|
const { client, konnector } = this.props
|
|
19
19
|
|
|
20
|
-
return client.
|
|
20
|
+
return client.getStackClient().getIconURL({
|
|
21
21
|
type: 'konnector',
|
|
22
|
-
slug: konnector.slug || konnector
|
|
22
|
+
slug: konnector.slug || konnector,
|
|
23
|
+
appData: konnector
|
|
23
24
|
})
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react'
|
|
3
|
+
import CipherIcon from './index'
|
|
4
|
+
|
|
5
|
+
jest.mock('cozy-client', () => ({
|
|
6
|
+
withClient: Component => {
|
|
7
|
+
const client = {
|
|
8
|
+
getStackClient: () => ({
|
|
9
|
+
getIconURL: ({ type, appData }) => {
|
|
10
|
+
console.log('getIconUrl called with:')
|
|
11
|
+
console.log(type)
|
|
12
|
+
console.log(appData)
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
return konnector => (
|
|
17
|
+
<Component client={client} konnector={{ ...konnector }} />
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
}))
|
|
21
|
+
|
|
22
|
+
jest.mock('../AppIcon', () => ({ fetchIcon }) => (
|
|
23
|
+
<button data-testid="app-icon" onClick={fetchIcon}></button>
|
|
24
|
+
))
|
|
25
|
+
|
|
26
|
+
describe('CipherIcon', () => {
|
|
27
|
+
it('should provide appData to getIconUrl in order to get icon simply, when oauth not needed', () => {
|
|
28
|
+
// Given
|
|
29
|
+
jest.spyOn(console, 'log').mockImplementation()
|
|
30
|
+
const konnector = {
|
|
31
|
+
name: 'PropTypes.string',
|
|
32
|
+
slug: 'slug',
|
|
33
|
+
links: {
|
|
34
|
+
icon: 'icon url'
|
|
35
|
+
},
|
|
36
|
+
latest_version: {
|
|
37
|
+
version: 'version'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const { getByTestId } = render(<CipherIcon konnector={konnector} />)
|
|
41
|
+
|
|
42
|
+
// When
|
|
43
|
+
fireEvent.click(getByTestId('app-icon'))
|
|
44
|
+
|
|
45
|
+
// Then
|
|
46
|
+
expect(console.log).toHaveBeenNthCalledWith(1, 'getIconUrl called with:')
|
|
47
|
+
expect(console.log).toHaveBeenNthCalledWith(2, 'konnector')
|
|
48
|
+
expect(console.log).toHaveBeenNthCalledWith(3, { konnector })
|
|
49
|
+
})
|
|
50
|
+
})
|
package/react/Dialog/index.jsx
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { default as MUIDialog } from '@material-ui/core/Dialog'
|
|
3
2
|
import { RemoveScroll } from 'react-remove-scroll'
|
|
3
|
+
import { default as MUIDialog } from '@material-ui/core/Dialog'
|
|
4
|
+
import { useTheme } from '@material-ui/core'
|
|
5
|
+
|
|
4
6
|
import useBreakpoints from '../hooks/useBreakpoints'
|
|
5
7
|
import { useCozyTheme } from '../CozyTheme'
|
|
6
8
|
import themesStyles from '../../stylus/settings/palette.styl'
|
|
9
|
+
import { useSetFlagshipUI } from '../hooks/useSetFlagshipUi/useSetFlagshipUI'
|
|
7
10
|
|
|
8
11
|
const Dialog = props => {
|
|
9
12
|
const { isMobile, isTablet } = useBreakpoints()
|
|
@@ -21,12 +24,47 @@ const Dialog = props => {
|
|
|
21
24
|
(props.open || props.opened) && shouldBlockScroll
|
|
22
25
|
? RemoveScroll
|
|
23
26
|
: React.Fragment
|
|
27
|
+
const cozyTheme = useCozyTheme()
|
|
28
|
+
const theme = useTheme()
|
|
29
|
+
const cozBar = document.querySelector('.coz-bar-wrapper')
|
|
30
|
+
const sidebar = document.getElementById('sidebar')
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
useSetFlagshipUI(
|
|
33
|
+
props.fullScreen
|
|
34
|
+
? {
|
|
35
|
+
bottomBackground: theme.palette.background.paper,
|
|
36
|
+
bottomTheme: 'dark',
|
|
37
|
+
topBackground: theme.palette.background.paper,
|
|
38
|
+
topTheme: 'dark'
|
|
39
|
+
}
|
|
40
|
+
: {
|
|
41
|
+
bottomBackground: theme.palette.background.default,
|
|
42
|
+
bottomTheme: 'light',
|
|
43
|
+
bottomOverlay: 'rgba(0, 0, 0, 0.5)',
|
|
44
|
+
topOverlay: 'rgba(0, 0, 0, 0.5)',
|
|
45
|
+
topBackground: theme.palette.background.paper,
|
|
46
|
+
topTheme: 'light'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
bottomBackground: theme.palette.background[sidebar ? 'default' : 'paper'],
|
|
50
|
+
bottomTheme: 'dark',
|
|
51
|
+
bottomOverlay: 'transparent',
|
|
52
|
+
topOverlay: 'transparent',
|
|
53
|
+
topBackground:
|
|
54
|
+
cozBar && getComputedStyle(cozBar).getPropertyValue('background-color'),
|
|
55
|
+
topTheme:
|
|
56
|
+
cozBar && cozBar.classList.contains('coz-theme-primary')
|
|
57
|
+
? 'light'
|
|
58
|
+
: 'dark'
|
|
59
|
+
}
|
|
60
|
+
)
|
|
26
61
|
|
|
27
62
|
return (
|
|
28
63
|
<Wrapper>
|
|
29
|
-
<MUIDialog
|
|
64
|
+
<MUIDialog
|
|
65
|
+
className={themesStyles[`CozyTheme--${cozyTheme}`]}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
30
68
|
</Wrapper>
|
|
31
69
|
)
|
|
32
70
|
}
|
package/react/Popup/index.jsx
CHANGED
|
@@ -12,6 +12,7 @@ import { isMobileApp } from 'cozy-device-helper'
|
|
|
12
12
|
*/
|
|
13
13
|
// source https://stackoverflow.com/a/16861050
|
|
14
14
|
export function popupCenter(w, h) {
|
|
15
|
+
// eslint-disable-next-line no-redeclare
|
|
15
16
|
/* global screen */
|
|
16
17
|
// Fixes dual-screen position
|
|
17
18
|
// Most browsers Firefox
|
|
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
// customized function to center a popup window
|
|
5
5
|
// source https://stackoverflow.com/a/16861050
|
|
6
6
|
export function openCenteredPopup(url, title, w, h) {
|
|
7
|
+
// eslint-disable-next-line no-redeclare
|
|
7
8
|
/* global screen */
|
|
8
9
|
var width =
|
|
9
10
|
window.innerWidth || document.documentElement.clientWidth || screen.width
|
|
@@ -13,10 +13,11 @@ const ButtonClient = props => {
|
|
|
13
13
|
return (
|
|
14
14
|
<a
|
|
15
15
|
href={href}
|
|
16
|
-
//eslint-disable-next-line react/jsx-no-target-blank
|
|
16
|
+
// eslint-disable-next-line react/jsx-no-target-blank
|
|
17
17
|
target="_blank"
|
|
18
18
|
className={cx(styles['c-btn-client'], className)}
|
|
19
19
|
onClick={onClick}
|
|
20
|
+
rel="noreferrer"
|
|
20
21
|
>
|
|
21
22
|
<figure>
|
|
22
23
|
<Icon icon={icon || DeviceLaptopIcon} size="32" />
|
|
@@ -65,6 +65,8 @@ const QuotaAlert = ({ onClose }) => {
|
|
|
65
65
|
if (isMobileApp()) {
|
|
66
66
|
return <QuotaModalAlert onClose={onClose} />
|
|
67
67
|
}
|
|
68
|
+
// TODO: why is there a conditional hook here?
|
|
69
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
68
70
|
const instanceInfo = useInstance(client)
|
|
69
71
|
return <QuotaModalAlert instance={instanceInfo} onClose={onClose} />
|
|
70
72
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import cx from 'classnames'
|
|
4
4
|
|
|
@@ -11,6 +11,8 @@ import useBreakpoints from '../hooks/useBreakpoints'
|
|
|
11
11
|
import styles from './styles.styl'
|
|
12
12
|
|
|
13
13
|
import CrossIcon from 'cozy-ui/transpiled/react/Icons/Cross'
|
|
14
|
+
import { useWebviewIntent } from 'cozy-intent'
|
|
15
|
+
import { useTheme } from '@material-ui/core'
|
|
14
16
|
|
|
15
17
|
/*
|
|
16
18
|
|
|
@@ -39,6 +41,37 @@ const SelectionBar = ({ actions, selected, hideSelectionBar }) => {
|
|
|
39
41
|
action.displayCondition === undefined || action.displayCondition(selected)
|
|
40
42
|
)
|
|
41
43
|
})
|
|
44
|
+
const webviewIntent = useWebviewIntent()
|
|
45
|
+
const theme = useTheme()
|
|
46
|
+
|
|
47
|
+
// This component is always rendered but hidden with CSS if there is no selection
|
|
48
|
+
// That is why we do not use useSetFlagship API here because that hook can not accept changing values
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!webviewIntent || !theme) return
|
|
51
|
+
|
|
52
|
+
selectedCount === 0 &&
|
|
53
|
+
webviewIntent &&
|
|
54
|
+
webviewIntent.call('setFlagshipUI', {
|
|
55
|
+
bottomBackground: theme.palette.background.default,
|
|
56
|
+
bottomTheme: 'dark'
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
selectedCount > 0 &&
|
|
60
|
+
webviewIntent &&
|
|
61
|
+
webviewIntent.call('setFlagshipUI', {
|
|
62
|
+
bottomBackground: theme.palette.grey[700],
|
|
63
|
+
bottomTheme: 'light'
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
return () =>
|
|
67
|
+
webviewIntent &&
|
|
68
|
+
theme &&
|
|
69
|
+
webviewIntent.call('setFlagshipUI', {
|
|
70
|
+
bottomBackground: theme.palette.background.default,
|
|
71
|
+
bottomTheme: 'dark'
|
|
72
|
+
})
|
|
73
|
+
}, [selectedCount, webviewIntent])
|
|
74
|
+
|
|
42
75
|
return (
|
|
43
76
|
<div
|
|
44
77
|
data-testid="selectionBar"
|
package/react/Sidebar/index.jsx
CHANGED
|
@@ -2,12 +2,32 @@ import React from 'react'
|
|
|
2
2
|
import cx from 'classnames'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
4
|
import styles from './styles.styl'
|
|
5
|
+
import { useSetFlagshipUI } from '../hooks/useSetFlagshipUi/useSetFlagshipUI'
|
|
6
|
+
import { useTheme } from '@material-ui/core'
|
|
5
7
|
|
|
6
|
-
const Sidebar = ({ children, className, ...restProps }) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const Sidebar = ({ children, className, ...restProps }) => {
|
|
9
|
+
const theme = useTheme()
|
|
10
|
+
|
|
11
|
+
useSetFlagshipUI(
|
|
12
|
+
{
|
|
13
|
+
bottomBackground: theme.palette.background.default,
|
|
14
|
+
bottomTheme: 'dark'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
bottomBackground: theme.palette.background.paper
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<aside
|
|
23
|
+
id="sidebar"
|
|
24
|
+
className={cx(styles['o-sidebar'], className)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</aside>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
11
31
|
|
|
12
32
|
Sidebar.propTypes = {
|
|
13
33
|
children: PropTypes.node,
|
package/react/Viewer/index.jsx
CHANGED
|
@@ -12,6 +12,8 @@ import ViewerByFile from './ViewerByFile'
|
|
|
12
12
|
import { isValidForPanel } from './helpers'
|
|
13
13
|
import PanelContent from './Panel/PanelContent'
|
|
14
14
|
import FooterContent from './Footer/FooterContent'
|
|
15
|
+
import { useSetFlagshipUI } from '../hooks/useSetFlagshipUi/useSetFlagshipUI'
|
|
16
|
+
import { useTheme } from '@material-ui/core'
|
|
15
17
|
|
|
16
18
|
const KEY_CODE_LEFT = 37
|
|
17
19
|
const KEY_CODE_RIGHT = 39
|
|
@@ -149,6 +151,19 @@ const ViewerInformationsWrapper = ({
|
|
|
149
151
|
validForPanel,
|
|
150
152
|
toolbarRef
|
|
151
153
|
}) => {
|
|
154
|
+
const theme = useTheme()
|
|
155
|
+
const sidebar = document.querySelector('[class*="sidebar"]')
|
|
156
|
+
|
|
157
|
+
useSetFlagshipUI(
|
|
158
|
+
{
|
|
159
|
+
bottomBackground: theme.palette.background.paper,
|
|
160
|
+
bottomTheme: 'dark'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
bottomBackground: theme.palette.background[sidebar ? 'default' : 'paper']
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
|
|
152
167
|
return (
|
|
153
168
|
<>
|
|
154
169
|
{!disableFooter && (
|
|
@@ -8090,7 +8090,7 @@ exports[`SelectBox should render examples: SelectBox 14`] = `"<div><button>Toggl
|
|
|
8090
8090
|
|
|
8091
8091
|
exports[`Sidebar should render examples: Sidebar 1`] = `
|
|
8092
8092
|
"<div>
|
|
8093
|
-
<aside
|
|
8093
|
+
<aside id=\\"sidebar\\" class=\\"styles__o-sidebar___1295j\\">
|
|
8094
8094
|
<nav role=\\"navigation\\">
|
|
8095
8095
|
<ul class=\\"styles__c-nav___33dZy\\">
|
|
8096
8096
|
<li class=\\"styles__c-nav-item___3XOLK\\" id=\\"nav-item\\"><a class=\\"styles__c-nav-link___3mK6W styles__is-active___2D0jN\\"><span class=\\"styles__c-nav-icon___hrJUe\\"><svg viewBox=\\"0 0 48 48\\" class=\\"styles__icon___23x3R\\" width=\\"16\\" height=\\"16\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path fill-rule=\\"evenodd\\" d=\\"M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm-1.503-34.897c.83-1.438 2.175-1.44 3.007 0l9.992 17.294c.83 1.438.16 2.603-1.504 2.603H14.008c-1.661 0-2.336-1.162-1.504-2.603l9.993-17.294zm.082 5.323A1.334 1.334 0 0123.93 17h.141c.79 0 1.395.633 1.35 1.426l-.365 6.576c-.03.551-.499.998-1.055.998a1.069 1.069 0 01-1.055-.998l-.366-6.576zM22.5 29c0-.828.666-1.5 1.5-1.5.828 0 1.5.666 1.5 1.5 0 .828-.666 1.5-1.5 1.5-.828 0-1.5-.666-1.5-1.5z\\"></path></svg></span><span class=\\"styles__c-nav-text___1J3yU\\">Warn</span></a></li>
|
|
@@ -180,7 +180,7 @@ export const trackEvent = (event, trackerForTest) => {
|
|
|
180
180
|
if (tracker) {
|
|
181
181
|
let trackEventArray = []
|
|
182
182
|
if (event && event[0]) {
|
|
183
|
-
//Like that, we can do trackEvent(['Drive', 'option1']) without thinking of adding this `trackEvent` attr
|
|
183
|
+
// Like that, we can do trackEvent(['Drive', 'option1']) without thinking of adding this `trackEvent` attr
|
|
184
184
|
if (event[0] !== 'trackEvent') {
|
|
185
185
|
trackEventArray = event.unshift('trackEvent')
|
|
186
186
|
}
|