@kvdbil/components 3.3.5-4 → 3.4.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/cjs/ColorCard.js +10 -31
- package/cjs/ElevationCard.js +5 -21
- package/cjs/Interfaces.js +1 -2
- package/cjs/Types.js +1 -2
- package/cjs/components/Accordion/index.js +20 -64
- package/cjs/components/Badge/index.js +9 -43
- package/cjs/components/Button/index.js +60 -125
- package/cjs/components/Card/index.js +6 -25
- package/cjs/components/CheckBox/index.js +24 -53
- package/cjs/components/Chip/index.js +10 -65
- package/cjs/components/DayPicker/DayPickerNavBar.js +9 -32
- package/cjs/components/DayPicker/index.js +10 -40
- package/cjs/components/DayPicker/localeUtils.js +1 -60
- package/cjs/components/DayPicker/style.js +226 -0
- package/cjs/components/Dialog/index.js +9 -42
- package/cjs/components/ErrorMessage/index.js +6 -21
- package/cjs/components/FieldLabel.js +22 -49
- package/cjs/components/Header/Hamburger.js +7 -22
- package/cjs/components/Header/Link.js +9 -26
- package/cjs/components/Header/index.js +16 -45
- package/cjs/components/Hero/index.js +7 -32
- package/cjs/components/Icon/index.js +11 -76
- package/cjs/components/IconButton.js +15 -54
- package/cjs/components/Icons/Arrow.js +1 -9
- package/cjs/components/Icons/CheckCircle.js +1 -9
- package/cjs/components/Icons/CheckIcon.js +1 -9
- package/cjs/components/Icons/Close.js +1 -9
- package/cjs/components/Icons/ErrorCircle.js +1 -9
- package/cjs/components/Icons/InfoCircle.js +1 -9
- package/cjs/components/InlineStepper/Step.js +16 -53
- package/cjs/components/InlineStepper/StepCircle.js +11 -46
- package/cjs/components/InlineStepper/index.js +4 -39
- package/cjs/components/ListItem/Bacon.js +1 -9
- package/cjs/components/ListItem/index.js +7 -28
- package/cjs/components/Logo/LogoEn.js +1 -9
- package/cjs/components/Logo/LogoSv.js +1 -9
- package/cjs/components/Logo/index.js +3 -30
- package/cjs/components/MenuItem/index.js +23 -68
- package/cjs/components/Modal/index.js +11 -54
- package/cjs/components/NotificationButton/index.js +4 -28
- package/cjs/components/OffCanvas/Overlay.js +2 -33
- package/cjs/components/OffCanvas/index.js +21 -62
- package/cjs/components/OffCanvas/useClickOutside.js +1 -21
- package/cjs/components/RadioButton/index.js +28 -58
- package/cjs/components/Range/index.js +10 -35
- package/cjs/components/Select/components/test-icon.js +1 -9
- package/cjs/components/Select/index.js +18 -147
- package/cjs/components/Snackbar/index.js +24 -76
- package/cjs/components/Spinner/index.js +10 -46
- package/cjs/components/Stepper/index.js +11 -35
- package/cjs/components/StepperAccordion/index.js +26 -76
- package/cjs/components/Tabs/index.js +7 -47
- package/cjs/components/TextArea/index.js +30 -61
- package/cjs/components/Textfield/index.js +29 -69
- package/cjs/components/TimePicker/index.js +2 -29
- package/cjs/components/TimePicker/testHelper.js +1 -17
- package/cjs/components/Toggle/index.js +12 -45
- package/cjs/icons/components/AccountCreateIcon.js +1 -11
- package/cjs/icons/components/AccountIcon.js +1 -11
- package/cjs/icons/components/AccountLoginIcon.js +1 -11
- package/cjs/icons/components/ArrowDownIcon.js +1 -11
- package/cjs/icons/components/ArrowLeftIcon.js +1 -11
- package/cjs/icons/components/ArrowLeftSharpIcon.js +1 -11
- package/cjs/icons/components/ArrowLeftSmallIcon.js +1 -11
- package/cjs/icons/components/ArrowLong.js +1 -11
- package/cjs/icons/components/ArrowRestartIcon.js +1 -11
- package/cjs/icons/components/ArrowRightIcon.js +1 -11
- package/cjs/icons/components/ArrowRightSharpIcon.js +1 -11
- package/cjs/icons/components/ArrowUpIcon.js +1 -11
- package/cjs/icons/components/AuctionIcon.js +1 -11
- package/cjs/icons/components/BackArrowIcon.js +1 -11
- package/cjs/icons/components/Baseline360Icon.js +1 -11
- package/cjs/icons/components/BellIcon.js +1 -11
- package/cjs/icons/components/BidIcon.js +1 -11
- package/cjs/icons/components/BidKrIcon.js +1 -11
- package/cjs/icons/components/BreaksIcon.js +1 -11
- package/cjs/icons/components/BuyCarIcon.js +1 -11
- package/cjs/icons/components/CabIcon.js +1 -11
- package/cjs/icons/components/CalendarIcon.js +1 -11
- package/cjs/icons/components/CameraIcon.js +1 -11
- package/cjs/icons/components/Car360Icon.js +1 -11
- package/cjs/icons/components/CarFrontIcon.js +1 -11
- package/cjs/icons/components/CarSearchIcon.js +1 -11
- package/cjs/icons/components/CarSideIcon.js +1 -11
- package/cjs/icons/components/CarTiresIcon.js +1 -11
- package/cjs/icons/components/CaravanIcon.js +1 -11
- package/cjs/icons/components/CardViewIcon.js +1 -11
- package/cjs/icons/components/CarloanIcon.js +1 -11
- package/cjs/icons/components/CertifiedIcon.js +1 -11
- package/cjs/icons/components/ChatIcon.js +1 -11
- package/cjs/icons/components/CheckIcon.js +1 -11
- package/cjs/icons/components/CheckThinIcon.js +1 -11
- package/cjs/icons/components/CheckmarkFilledIcon.js +1 -11
- package/cjs/icons/components/CheckmarkIcon.js +1 -11
- package/cjs/icons/components/ClipboardFilledIcon.js +1 -11
- package/cjs/icons/components/ClipboardIcon.js +1 -11
- package/cjs/icons/components/ClockFilledIcon.js +1 -11
- package/cjs/icons/components/ClockIcon.js +1 -11
- package/cjs/icons/components/CloseIcon.js +1 -11
- package/cjs/icons/components/CloseThinIcon.js +1 -11
- package/cjs/icons/components/CoffeeIcon.js +1 -11
- package/cjs/icons/components/CombiIcon.js +1 -11
- package/cjs/icons/components/CommentCircleFilledIcon.js +1 -11
- package/cjs/icons/components/CommentCircleIconIcon.js +1 -11
- package/cjs/icons/components/CommentIcon.js +1 -11
- package/cjs/icons/components/ContactIcon.js +1 -11
- package/cjs/icons/components/CoupeIcon.js +1 -11
- package/cjs/icons/components/CreditCardIcon.js +1 -11
- package/cjs/icons/components/CrossCircleIcon.js +1 -11
- package/cjs/icons/components/CrownIcon.js +1 -11
- package/cjs/icons/components/DealmakerIcon.js +1 -11
- package/cjs/icons/components/DeliveryIcon.js +1 -11
- package/cjs/icons/components/DetailedSearchIcon.js +1 -11
- package/cjs/icons/components/EcoFriendlyIcon.js +1 -11
- package/cjs/icons/components/EditIcon.js +1 -11
- package/cjs/icons/components/EngineIcon.js +1 -11
- package/cjs/icons/components/EnglandFlagIcon.js +1 -11
- package/cjs/icons/components/EvaluationIcon.js +1 -11
- package/cjs/icons/components/ExaminationMarkFilledIcon.js +1 -11
- package/cjs/icons/components/ExaminationMarkIcon.js +1 -11
- package/cjs/icons/components/ExteriorIcon.js +1 -11
- package/cjs/icons/components/EyeIcon.js +1 -11
- package/cjs/icons/components/FacebookBtnIcon.js +1 -11
- package/cjs/icons/components/FacebookIcon.js +1 -11
- package/cjs/icons/components/FatalIcon.js +1 -11
- package/cjs/icons/components/FavouriteIcon.js +1 -11
- package/cjs/icons/components/FavouriteSolidIcon.js +1 -11
- package/cjs/icons/components/FilterIcon.js +1 -11
- package/cjs/icons/components/FinanceIcon.js +1 -11
- package/cjs/icons/components/FindCarIcon.js +1 -11
- package/cjs/icons/components/FixedMonthlyCostIcon.js +1 -11
- package/cjs/icons/components/FlagIcon.js +1 -11
- package/cjs/icons/components/FlexibilityIcon.js +1 -11
- package/cjs/icons/components/ForumLargeIcon.js +1 -11
- package/cjs/icons/components/ForumSmallIcon.js +1 -11
- package/cjs/icons/components/GavelIcon.js +1 -11
- package/cjs/icons/components/GearboxIcon.js +1 -11
- package/cjs/icons/components/GiftIcon.js +1 -11
- package/cjs/icons/components/GridViewIcon.js +1 -11
- package/cjs/icons/components/GroupIcon.js +1 -11
- package/cjs/icons/components/GuaranteeIcon.js +1 -11
- package/cjs/icons/components/GuaranteeLargeIcon.js +1 -11
- package/cjs/icons/components/GuaranteeSmallIcon.js +1 -11
- package/cjs/icons/components/HalfCombiIcon.js +1 -11
- package/cjs/icons/components/HamburgerIcon.js +1 -11
- package/cjs/icons/components/HandshakeIcon.js +1 -11
- package/cjs/icons/components/HelpingHandIcon.js +1 -11
- package/cjs/icons/components/IdIcon.js +1 -11
- package/cjs/icons/components/InformationIcon.js +1 -11
- package/cjs/icons/components/InstagramIcon.js +1 -11
- package/cjs/icons/components/InsuranceIcon.js +1 -11
- package/cjs/icons/components/InteriorIcon.js +1 -11
- package/cjs/icons/components/InteriorThinIcon.js +1 -11
- package/cjs/icons/components/InternationalIcon.js +1 -11
- package/cjs/icons/components/KvdTestIcon.js +1 -11
- package/cjs/icons/components/KvdVenueIcon.js +1 -11
- package/cjs/icons/components/LifebuoyIcon.js +1 -11
- package/cjs/icons/components/LiftTruckIcon.js +1 -11
- package/cjs/icons/components/LinkedInIcon.js +1 -11
- package/cjs/icons/components/ListViewIcon.js +1 -11
- package/cjs/icons/components/MailIcon.js +1 -11
- package/cjs/icons/components/MinibusIcon.js +1 -11
- package/cjs/icons/components/MinivanIcon.js +1 -11
- package/cjs/icons/components/MobileIcon.js +1 -11
- package/cjs/icons/components/MotorcycleIcon.js +1 -11
- package/cjs/icons/components/MrfLogoIcon.js +1 -11
- package/cjs/icons/components/NotFoundIcon.js +1 -11
- package/cjs/icons/components/OverbidIcon.js +1 -11
- package/cjs/icons/components/PdfIconIcon.js +1 -11
- package/cjs/icons/components/PhoneIcon.js +1 -11
- package/cjs/icons/components/PickUpIcon.js +1 -11
- package/cjs/icons/components/PinIcon.js +1 -11
- package/cjs/icons/components/PlayIcon.js +1 -11
- package/cjs/icons/components/Pricetag.js +1 -11
- package/cjs/icons/components/PricetagFilledKronaIcon.js +1 -11
- package/cjs/icons/components/PrivateCarIcon.js +1 -11
- package/cjs/icons/components/ProfileCircleIcon.js +1 -11
- package/cjs/icons/components/ProfileIcon.js +1 -11
- package/cjs/icons/components/RadioIcon.js +1 -11
- package/cjs/icons/components/ReclamationIcon.js +1 -11
- package/cjs/icons/components/ReleasingIcon.js +1 -11
- package/cjs/icons/components/RemoveFilterIcon.js +1 -11
- package/cjs/icons/components/ReservedPriceIcon.js +1 -11
- package/cjs/icons/components/ResultIcon.js +1 -11
- package/cjs/icons/components/SafePaymentIcon.js +1 -11
- package/cjs/icons/components/SaleTagIcon.js +1 -11
- package/cjs/icons/components/SearchCheckIcon.js +1 -11
- package/cjs/icons/components/SearchIcon.js +1 -11
- package/cjs/icons/components/SedanIcon.js +1 -11
- package/cjs/icons/components/SellCarIcon.js +1 -11
- package/cjs/icons/components/SellCarsIcon.js +1 -11
- package/cjs/icons/components/ServiceIcon.js +1 -11
- package/cjs/icons/components/ShareIcon.js +1 -11
- package/cjs/icons/components/ShieldIcon.js +1 -11
- package/cjs/icons/components/SignInIcon.js +1 -11
- package/cjs/icons/components/SignOutIcon.js +1 -11
- package/cjs/icons/components/SpeedMeterIcon.js +1 -11
- package/cjs/icons/components/StarCircleIcon.js +1 -11
- package/cjs/icons/components/StartIcon.js +1 -11
- package/cjs/icons/components/StoreIcon.js +1 -11
- package/cjs/icons/components/SuvIcon.js +1 -11
- package/cjs/icons/components/SwedenFlag.js +1 -11
- package/cjs/icons/components/TankIcon.js +1 -11
- package/cjs/icons/components/TireIcon.js +1 -11
- package/cjs/icons/components/TransportIcon.js +1 -11
- package/cjs/icons/components/TrashcanIcon.js +1 -11
- package/cjs/icons/components/TrophyIcon.js +1 -11
- package/cjs/icons/components/TruckIcon.js +1 -11
- package/cjs/icons/components/UmbrellaIcon.js +1 -11
- package/cjs/icons/components/ValuationIcon.js +1 -11
- package/cjs/icons/components/ValueIcon.js +1 -11
- package/cjs/icons/components/WarningIcon.js +1 -11
- package/cjs/icons/components/YoutubeIcon.js +1 -11
- package/cjs/icons/components/index.js +1 -320
- package/cjs/index.js +1 -439
- package/cjs/shared/constants.js +1 -7
- package/cjs/shared/helpers.js +1 -28
- package/cjs/shared/helpers.spec.js +1 -42
- package/cjs/shared/media-queries.js +1 -41
- package/cjs/theme.js +1 -125
- package/cjs/typography/BodyText/index.js +20 -53
- package/cjs/typography/ButtonText/index.js +15 -43
- package/cjs/typography/Heading/index.js +22 -54
- package/cjs/utils/utils.js +2 -30
- package/esm/ColorCard.js +10 -23
- package/esm/ElevationCard.js +5 -13
- package/esm/components/Accordion/index.js +20 -55
- package/esm/components/Badge/index.js +9 -34
- package/esm/components/Button/index.js +50 -106
- package/esm/components/Card/index.js +6 -16
- package/esm/components/CheckBox/index.js +17 -37
- package/esm/components/Chip/index.js +10 -56
- package/esm/components/DayPicker/DayPickerNavBar.js +9 -24
- package/esm/components/DayPicker/index.js +10 -30
- package/esm/components/DayPicker/localeUtils.js +1 -52
- package/esm/components/DayPicker/style.js +226 -0
- package/esm/components/Dialog/index.js +9 -33
- package/esm/components/ErrorMessage/index.js +6 -12
- package/esm/components/FieldLabel.js +21 -40
- package/esm/components/Header/Hamburger.js +7 -14
- package/esm/components/Header/Link.js +9 -18
- package/esm/components/Header/index.js +16 -36
- package/esm/components/Hero/index.js +7 -23
- package/esm/components/Icon/index.js +11 -68
- package/esm/components/IconButton.js +15 -46
- package/esm/components/Icons/Arrow.js +1 -5
- package/esm/components/Icons/CheckCircle.js +1 -5
- package/esm/components/Icons/CheckIcon.js +1 -5
- package/esm/components/Icons/Close.js +1 -5
- package/esm/components/Icons/ErrorCircle.js +1 -5
- package/esm/components/Icons/InfoCircle.js +1 -5
- package/esm/components/InlineStepper/Step.js +16 -44
- package/esm/components/InlineStepper/StepCircle.js +11 -38
- package/esm/components/InlineStepper/index.js +4 -31
- package/esm/components/ListItem/Bacon.js +1 -5
- package/esm/components/ListItem/index.js +7 -20
- package/esm/components/Logo/LogoEn.js +1 -5
- package/esm/components/Logo/LogoSv.js +1 -5
- package/esm/components/Logo/index.js +3 -21
- package/esm/components/MenuItem/index.js +22 -58
- package/esm/components/Modal/index.js +11 -45
- package/esm/components/NotificationButton/index.js +4 -20
- package/esm/components/OffCanvas/Overlay.js +2 -25
- package/esm/components/OffCanvas/index.js +21 -53
- package/esm/components/OffCanvas/useClickOutside.js +1 -17
- package/esm/components/RadioButton/index.js +21 -42
- package/esm/components/Range/index.js +10 -26
- package/esm/components/Select/components/test-icon.js +1 -5
- package/esm/components/Select/index.js +18 -137
- package/esm/components/Snackbar/index.js +24 -67
- package/esm/components/Spinner/index.js +10 -38
- package/esm/components/Stepper/index.js +11 -27
- package/esm/components/StepperAccordion/index.js +23 -64
- package/esm/components/Tabs/index.js +7 -37
- package/esm/components/TextArea/index.js +30 -52
- package/esm/components/Textfield/index.js +29 -60
- package/esm/components/TimePicker/index.js +2 -20
- package/esm/components/TimePicker/testHelper.js +1 -13
- package/esm/components/Toggle/index.js +12 -37
- package/esm/icons/components/AccountCreateIcon.js +1 -7
- package/esm/icons/components/AccountIcon.js +1 -7
- package/esm/icons/components/AccountLoginIcon.js +1 -7
- package/esm/icons/components/ArrowDownIcon.js +1 -7
- package/esm/icons/components/ArrowLeftIcon.js +1 -7
- package/esm/icons/components/ArrowLeftSharpIcon.js +1 -7
- package/esm/icons/components/ArrowLeftSmallIcon.js +1 -7
- package/esm/icons/components/ArrowLong.js +1 -7
- package/esm/icons/components/ArrowRestartIcon.js +1 -7
- package/esm/icons/components/ArrowRightIcon.js +1 -7
- package/esm/icons/components/ArrowRightSharpIcon.js +1 -7
- package/esm/icons/components/ArrowUpIcon.js +1 -7
- package/esm/icons/components/AuctionIcon.js +1 -7
- package/esm/icons/components/BackArrowIcon.js +1 -7
- package/esm/icons/components/Baseline360Icon.js +1 -7
- package/esm/icons/components/BellIcon.js +1 -7
- package/esm/icons/components/BidIcon.js +1 -7
- package/esm/icons/components/BidKrIcon.js +1 -7
- package/esm/icons/components/BreaksIcon.js +1 -7
- package/esm/icons/components/BuyCarIcon.js +1 -7
- package/esm/icons/components/CabIcon.js +1 -7
- package/esm/icons/components/CalendarIcon.js +1 -7
- package/esm/icons/components/CameraIcon.js +1 -7
- package/esm/icons/components/Car360Icon.js +1 -7
- package/esm/icons/components/CarFrontIcon.js +1 -7
- package/esm/icons/components/CarSearchIcon.js +1 -7
- package/esm/icons/components/CarSideIcon.js +1 -7
- package/esm/icons/components/CarTiresIcon.js +1 -7
- package/esm/icons/components/CaravanIcon.js +1 -7
- package/esm/icons/components/CardViewIcon.js +1 -7
- package/esm/icons/components/CarloanIcon.js +1 -7
- package/esm/icons/components/CertifiedIcon.js +1 -7
- package/esm/icons/components/ChatIcon.js +1 -7
- package/esm/icons/components/CheckIcon.js +1 -7
- package/esm/icons/components/CheckThinIcon.js +1 -7
- package/esm/icons/components/CheckmarkFilledIcon.js +1 -7
- package/esm/icons/components/CheckmarkIcon.js +1 -7
- package/esm/icons/components/ClipboardFilledIcon.js +1 -7
- package/esm/icons/components/ClipboardIcon.js +1 -7
- package/esm/icons/components/ClockFilledIcon.js +1 -7
- package/esm/icons/components/ClockIcon.js +1 -7
- package/esm/icons/components/CloseIcon.js +1 -7
- package/esm/icons/components/CloseThinIcon.js +1 -7
- package/esm/icons/components/CoffeeIcon.js +1 -7
- package/esm/icons/components/CombiIcon.js +1 -7
- package/esm/icons/components/CommentCircleFilledIcon.js +1 -7
- package/esm/icons/components/CommentCircleIconIcon.js +1 -7
- package/esm/icons/components/CommentIcon.js +1 -7
- package/esm/icons/components/ContactIcon.js +1 -7
- package/esm/icons/components/CoupeIcon.js +1 -7
- package/esm/icons/components/CreditCardIcon.js +1 -7
- package/esm/icons/components/CrossCircleIcon.js +1 -7
- package/esm/icons/components/CrownIcon.js +1 -7
- package/esm/icons/components/DealmakerIcon.js +1 -7
- package/esm/icons/components/DeliveryIcon.js +1 -7
- package/esm/icons/components/DetailedSearchIcon.js +1 -7
- package/esm/icons/components/EcoFriendlyIcon.js +1 -7
- package/esm/icons/components/EditIcon.js +1 -7
- package/esm/icons/components/EngineIcon.js +1 -7
- package/esm/icons/components/EnglandFlagIcon.js +1 -7
- package/esm/icons/components/EvaluationIcon.js +1 -7
- package/esm/icons/components/ExaminationMarkFilledIcon.js +1 -7
- package/esm/icons/components/ExaminationMarkIcon.js +1 -7
- package/esm/icons/components/ExteriorIcon.js +1 -7
- package/esm/icons/components/EyeIcon.js +1 -7
- package/esm/icons/components/FacebookBtnIcon.js +1 -7
- package/esm/icons/components/FacebookIcon.js +1 -7
- package/esm/icons/components/FatalIcon.js +1 -7
- package/esm/icons/components/FavouriteIcon.js +1 -7
- package/esm/icons/components/FavouriteSolidIcon.js +1 -7
- package/esm/icons/components/FilterIcon.js +1 -7
- package/esm/icons/components/FinanceIcon.js +1 -7
- package/esm/icons/components/FindCarIcon.js +1 -7
- package/esm/icons/components/FixedMonthlyCostIcon.js +1 -7
- package/esm/icons/components/FlagIcon.js +1 -7
- package/esm/icons/components/FlexibilityIcon.js +1 -7
- package/esm/icons/components/ForumLargeIcon.js +1 -7
- package/esm/icons/components/ForumSmallIcon.js +1 -7
- package/esm/icons/components/GavelIcon.js +1 -7
- package/esm/icons/components/GearboxIcon.js +1 -7
- package/esm/icons/components/GiftIcon.js +1 -7
- package/esm/icons/components/GridViewIcon.js +1 -7
- package/esm/icons/components/GroupIcon.js +1 -7
- package/esm/icons/components/GuaranteeIcon.js +1 -7
- package/esm/icons/components/GuaranteeLargeIcon.js +1 -7
- package/esm/icons/components/GuaranteeSmallIcon.js +1 -7
- package/esm/icons/components/HalfCombiIcon.js +1 -7
- package/esm/icons/components/HamburgerIcon.js +1 -7
- package/esm/icons/components/HandshakeIcon.js +1 -7
- package/esm/icons/components/HelpingHandIcon.js +1 -7
- package/esm/icons/components/IdIcon.js +1 -7
- package/esm/icons/components/InformationIcon.js +1 -7
- package/esm/icons/components/InstagramIcon.js +1 -7
- package/esm/icons/components/InsuranceIcon.js +1 -7
- package/esm/icons/components/InteriorIcon.js +1 -7
- package/esm/icons/components/InteriorThinIcon.js +1 -7
- package/esm/icons/components/InternationalIcon.js +1 -7
- package/esm/icons/components/KvdTestIcon.js +1 -7
- package/esm/icons/components/KvdVenueIcon.js +1 -7
- package/esm/icons/components/LifebuoyIcon.js +1 -7
- package/esm/icons/components/LiftTruckIcon.js +1 -7
- package/esm/icons/components/LinkedInIcon.js +1 -7
- package/esm/icons/components/ListViewIcon.js +1 -7
- package/esm/icons/components/MailIcon.js +1 -7
- package/esm/icons/components/MinibusIcon.js +1 -7
- package/esm/icons/components/MinivanIcon.js +1 -7
- package/esm/icons/components/MobileIcon.js +1 -7
- package/esm/icons/components/MotorcycleIcon.js +1 -7
- package/esm/icons/components/MrfLogoIcon.js +1 -7
- package/esm/icons/components/NotFoundIcon.js +1 -7
- package/esm/icons/components/OverbidIcon.js +1 -7
- package/esm/icons/components/PdfIconIcon.js +1 -7
- package/esm/icons/components/PhoneIcon.js +1 -7
- package/esm/icons/components/PickUpIcon.js +1 -7
- package/esm/icons/components/PinIcon.js +1 -7
- package/esm/icons/components/PlayIcon.js +1 -7
- package/esm/icons/components/Pricetag.js +1 -7
- package/esm/icons/components/PricetagFilledKronaIcon.js +1 -7
- package/esm/icons/components/PrivateCarIcon.js +1 -7
- package/esm/icons/components/ProfileCircleIcon.js +1 -7
- package/esm/icons/components/ProfileIcon.js +1 -7
- package/esm/icons/components/RadioIcon.js +1 -7
- package/esm/icons/components/ReclamationIcon.js +1 -7
- package/esm/icons/components/ReleasingIcon.js +1 -7
- package/esm/icons/components/RemoveFilterIcon.js +1 -7
- package/esm/icons/components/ReservedPriceIcon.js +1 -7
- package/esm/icons/components/ResultIcon.js +1 -7
- package/esm/icons/components/SafePaymentIcon.js +1 -7
- package/esm/icons/components/SaleTagIcon.js +1 -7
- package/esm/icons/components/SearchCheckIcon.js +1 -7
- package/esm/icons/components/SearchIcon.js +1 -7
- package/esm/icons/components/SedanIcon.js +1 -7
- package/esm/icons/components/SellCarIcon.js +1 -7
- package/esm/icons/components/SellCarsIcon.js +1 -7
- package/esm/icons/components/ServiceIcon.js +1 -7
- package/esm/icons/components/ShareIcon.js +1 -7
- package/esm/icons/components/ShieldIcon.js +1 -7
- package/esm/icons/components/SignInIcon.js +1 -7
- package/esm/icons/components/SignOutIcon.js +1 -7
- package/esm/icons/components/SpeedMeterIcon.js +1 -7
- package/esm/icons/components/StarCircleIcon.js +1 -7
- package/esm/icons/components/StartIcon.js +1 -7
- package/esm/icons/components/StoreIcon.js +1 -7
- package/esm/icons/components/SuvIcon.js +1 -7
- package/esm/icons/components/SwedenFlag.js +1 -7
- package/esm/icons/components/TankIcon.js +1 -7
- package/esm/icons/components/TireIcon.js +1 -7
- package/esm/icons/components/TransportIcon.js +1 -7
- package/esm/icons/components/TrashcanIcon.js +1 -7
- package/esm/icons/components/TrophyIcon.js +1 -7
- package/esm/icons/components/TruckIcon.js +1 -7
- package/esm/icons/components/UmbrellaIcon.js +1 -7
- package/esm/icons/components/ValuationIcon.js +1 -7
- package/esm/icons/components/ValueIcon.js +1 -7
- package/esm/icons/components/WarningIcon.js +1 -7
- package/esm/icons/components/YoutubeIcon.js +1 -7
- package/esm/icons/components/index.js +1 -157
- package/esm/index.js +1 -221
- package/esm/shared/constants.js +1 -3
- package/esm/shared/helpers.js +1 -23
- package/esm/shared/helpers.spec.js +1 -40
- package/esm/shared/media-queries.js +1 -35
- package/esm/theme.js +1 -121
- package/esm/typography/BodyText/index.js +20 -35
- package/esm/typography/ButtonText/index.js +15 -28
- package/esm/typography/Heading/index.js +22 -38
- package/esm/utils/utils.js +2 -25
- package/package.json +11 -8
- package/types/components/DayPicker/index.d.ts +0 -1
- package/types/components/DayPicker/style.d.ts +2 -0
- package/types/components/FieldLabel.d.ts +1 -1
- package/types/components/Header/Link.d.ts +1 -1
- package/types/components/MenuItem/index.d.ts +1 -1
- package/types/components/Select/index.d.ts +9 -8
- package/cjs/react-app-env.d.js +0 -2
- package/cjs/styled.d.js +0 -4
- package/esm/react-app-env.d.js +0 -1
- package/esm/styled.d.js +0 -1
|
@@ -1,60 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import ReactSelect from 'react-select';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { DEFAULT_TRANSITION_MS } from '../../shared/constants.js';
|
|
6
|
-
import { fadedColor } from '../../shared/helpers.js';
|
|
7
|
-
import theme from '../../theme.js';
|
|
8
|
-
import { Label } from '../FieldLabel.js';
|
|
9
|
-
|
|
10
|
-
const Container = styled.div `
|
|
11
|
-
font-family: ${({ theme }) => theme.typography.fontBaseFamily};
|
|
1
|
+
import t,{useState as $}from"react";import z from"react-select";import d from"styled-components";import{DEFAULT_TRANSITION_MS as x}from"../../shared/constants.js";import r from"../../theme.js";import{Label as A}from"../FieldLabel.js";const M=d.div`
|
|
2
|
+
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
12
3
|
position: relative;
|
|
13
|
-
|
|
14
|
-
const prefixStyles = (hasPrefix) => hasPrefix && {
|
|
15
|
-
paddingLeft: '2.5rem',
|
|
16
|
-
};
|
|
17
|
-
const disabledStyles = (isDisabled) => isDisabled && {
|
|
18
|
-
border: `1px solid ${theme.colors.gray.light1}`,
|
|
19
|
-
color: theme.colors.gray.dark1,
|
|
20
|
-
fill: theme.colors.gray.light1,
|
|
21
|
-
};
|
|
22
|
-
const Prefix = styled.div `
|
|
4
|
+
`,F=e=>e&&{paddingLeft:"2.5rem"},O=e=>e&&{border:`1px solid ${r.colors.gray.light1}`,color:r.colors.gray.dark1,fill:r.colors.gray.light1},_=d.div`
|
|
23
5
|
position: absolute;
|
|
24
6
|
z-index: 1;
|
|
25
7
|
top: 0.5rem;
|
|
26
8
|
margin: 0.35rem 0.75rem;
|
|
27
9
|
|
|
28
|
-
fill: ${
|
|
29
|
-
transition: ${
|
|
10
|
+
fill: ${r.colors.gray.dark5};
|
|
11
|
+
transition: ${x};
|
|
30
12
|
|
|
31
|
-
${
|
|
32
|
-
|
|
33
|
-
fill: ${theme.colors.gray.light1};
|
|
13
|
+
${e=>e.isDisabled&&`
|
|
14
|
+
fill: ${r.colors.gray.light1};
|
|
34
15
|
`}
|
|
35
16
|
|
|
36
|
-
${
|
|
37
|
-
|
|
38
|
-
fill: ${props.theme.colors.text.dark};
|
|
17
|
+
${e=>e.isFocused&&`
|
|
18
|
+
fill: ${e.theme.colors.text.dark};
|
|
39
19
|
`}
|
|
40
|
-
|
|
41
|
-
const HelperText = styled.span `
|
|
20
|
+
`,j=d.span`
|
|
42
21
|
display: block;
|
|
43
|
-
font-family: ${({
|
|
22
|
+
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
44
23
|
font-size: 0.81rem;
|
|
45
|
-
|
|
46
24
|
margin-top: 0.25rem;
|
|
47
25
|
margin-left: 0.85rem;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`;
|
|
51
|
-
const Arrow = (props) => (jsxs("svg", Object.assign({}, props, { children: [jsx("symbol", Object.assign({ id: "icon-arrow", viewBox: "0 0 19 19" }, { children: jsx("path", { d: "M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z" }, void 0) }), void 0), jsx("use", { xlinkHref: "#icon-arrow" }, void 0)] }), void 0));
|
|
52
|
-
const DropdownArrow = styled(Arrow) `
|
|
26
|
+
color: ${({hasError:e})=>e?r.colors.error.main:r.colors.text.disabled};
|
|
27
|
+
`,T=e=>t.createElement("svg",{...e},t.createElement("symbol",{id:"icon-arrow",viewBox:"0 0 19 19"},t.createElement("path",{d:"M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z"})),t.createElement("use",{xlinkHref:"#icon-arrow"})),V=d(T)`
|
|
53
28
|
width: 0.8rem;
|
|
54
29
|
height: 0.8rem;
|
|
55
30
|
margin: 0 0.5rem;
|
|
56
|
-
${
|
|
57
|
-
${
|
|
31
|
+
${e=>e.$isFocused&&`color: ${e.$theme.colors.text.dark}`}
|
|
32
|
+
${e=>e.$isDisabled&&`color: ${e.$theme.colors.gray.dark1}`}
|
|
58
33
|
|
|
59
34
|
|
|
60
35
|
path {
|
|
@@ -62,102 +37,8 @@ const DropdownArrow = styled(Arrow) `
|
|
|
62
37
|
stroke: currentColor;
|
|
63
38
|
}
|
|
64
39
|
|
|
65
|
-
transition: transform ${
|
|
40
|
+
transition: transform ${x};
|
|
66
41
|
|
|
67
|
-
transform: ${
|
|
42
|
+
transform: ${e=>e.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
|
|
68
43
|
transform-origin: 50% 60%;
|
|
69
|
-
|
|
70
|
-
const getBorderColor = (isFocused, hasError) => {
|
|
71
|
-
if (hasError) {
|
|
72
|
-
return theme.colors.error.main;
|
|
73
|
-
}
|
|
74
|
-
return isFocused ? theme.colors.text.dark : theme.colors.gray.light1;
|
|
75
|
-
};
|
|
76
|
-
const DropdownIndicator = ({ selectProps: { menuIsOpen = false }, isFocused = false, isDisabled, }) => {
|
|
77
|
-
return (jsx(DropdownArrow, { "$isDisabled": isDisabled, "$isFocused": isFocused, "$isMenuOpen": menuIsOpen, "$theme": theme }, void 0));
|
|
78
|
-
};
|
|
79
|
-
const Select = ({ color = 'primary', isDisabled = false, placeholder = '', helperText, height, className, hasError = false, onBlur = () => null, onFocus = () => null, forwardRef, onInputChange = () => null, ...props }) => {
|
|
80
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
81
|
-
const [inputValue, setInputValue] = useState('');
|
|
82
|
-
const handleInputChange = (newValue, actionMeta) => {
|
|
83
|
-
onInputChange(newValue, actionMeta);
|
|
84
|
-
setInputValue(newValue);
|
|
85
|
-
};
|
|
86
|
-
const getOptionColor = ({ isSelected, isFocused }) => {
|
|
87
|
-
if (isSelected) {
|
|
88
|
-
return fadedColor(theme.colors[color].main, 0.72);
|
|
89
|
-
}
|
|
90
|
-
if (isFocused) {
|
|
91
|
-
return fadedColor(theme.colors[color].main, 0.18);
|
|
92
|
-
}
|
|
93
|
-
return 'white';
|
|
94
|
-
};
|
|
95
|
-
const handleFocus = (event) => {
|
|
96
|
-
setIsFocused(true);
|
|
97
|
-
onFocus(event);
|
|
98
|
-
};
|
|
99
|
-
const handleBlur = (event) => {
|
|
100
|
-
setIsFocused(false);
|
|
101
|
-
onBlur(event);
|
|
102
|
-
};
|
|
103
|
-
const borderColor = getBorderColor(isFocused, hasError);
|
|
104
|
-
return (jsxs(Container, Object.assign({ className: className }, { children: [props.label && (jsx(Label, Object.assign({ height: height, isFocused: isFocused, hasValue: Boolean(props.value || inputValue), disabled: isDisabled, theme: theme, hasError: hasError }, { children: props.label }), void 0)), props.prefix && (jsx(Prefix, Object.assign({ isDisabled: isDisabled, isFocused: isFocused }, { children: props.prefix }), void 0)), jsx(ReactSelect, Object.assign({}, props, { ref: forwardRef, isDisabled: isDisabled, onInputChange: handleInputChange, placeholder: placeholder, onFocus: handleFocus, onBlur: handleBlur, styles: {
|
|
105
|
-
control: styles => ({
|
|
106
|
-
...styles,
|
|
107
|
-
fontFamily: theme.typography.fontBaseFamily,
|
|
108
|
-
fontSize: '1rem',
|
|
109
|
-
fontWeight: 400,
|
|
110
|
-
cursor: 'pointer',
|
|
111
|
-
padding: '0.7rem 0.75rem',
|
|
112
|
-
backgroundColor: theme.colors.background.light,
|
|
113
|
-
borderColor,
|
|
114
|
-
boxShadow: 'none',
|
|
115
|
-
'&:hover': {
|
|
116
|
-
borderColor: 'none',
|
|
117
|
-
},
|
|
118
|
-
...disabledStyles(isDisabled),
|
|
119
|
-
...prefixStyles(Boolean(props.prefix)),
|
|
120
|
-
}),
|
|
121
|
-
placeholder: styles => ({
|
|
122
|
-
...styles,
|
|
123
|
-
display: !isFocused ? 'none' : 'static',
|
|
124
|
-
}),
|
|
125
|
-
singleValue: styles => ({
|
|
126
|
-
...styles,
|
|
127
|
-
...{
|
|
128
|
-
maxWidth: 'calc(100% - 3.3rem)',
|
|
129
|
-
width: 'calc(100% - 3.3rem)',
|
|
130
|
-
},
|
|
131
|
-
}),
|
|
132
|
-
menu: styles => ({
|
|
133
|
-
...styles,
|
|
134
|
-
zIndex: 2,
|
|
135
|
-
padding: '0.25rem 0',
|
|
136
|
-
}),
|
|
137
|
-
option: (styles, { isSelected, isFocused }) => {
|
|
138
|
-
return {
|
|
139
|
-
...styles,
|
|
140
|
-
padding: '1rem',
|
|
141
|
-
'&:hover': {
|
|
142
|
-
background: getOptionColor({ isFocused: true, isSelected }),
|
|
143
|
-
},
|
|
144
|
-
background: getOptionColor({ isSelected, isFocused }),
|
|
145
|
-
cursor: 'pointer',
|
|
146
|
-
...prefixStyles(Boolean(props.prefix)),
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
valueContainer: styles => ({
|
|
150
|
-
...styles,
|
|
151
|
-
...{
|
|
152
|
-
position: 'static',
|
|
153
|
-
padding: height ? `${height - 1}rem 0 ` : 0,
|
|
154
|
-
height: height ? 'auto' : '21px',
|
|
155
|
-
},
|
|
156
|
-
}),
|
|
157
|
-
}, components: {
|
|
158
|
-
IndicatorSeparator: () => null,
|
|
159
|
-
DropdownIndicator: DropdownIndicator,
|
|
160
|
-
} }), void 0), helperText && jsx(HelperText, Object.assign({ hasError: hasError }, { children: helperText }), void 0)] }), void 0));
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export { Select, Select as default };
|
|
44
|
+
`,H=(e,a)=>a?r.colors.error.main:e?r.colors.text.dark:r.colors.gray.light1,N=({selectProps:{menuIsOpen:e=!1},isFocused:a=!1,isDisabled:m})=>t.createElement(V,{$isDisabled:m,$isFocused:a,$isMenuOpen:e,$theme:r}),k=({className:e,color:a="primary",forwardRef:m,hasError:u=!1,height:i,helperText:p,isDisabled:s=!1,onBlur:C=()=>null,onFocus:v=()=>null,onInputChange:w=()=>null,placeholder:L="",name:f,...n})=>{const[c,h]=$(!1),[B,I]=$(""),S=(o,l)=>{w(o,l),I(o)},y=({isSelected:o,isFocused:l,isDisabled:g})=>o?r.colors[a].main:g?r.colors.background.light:l?r.colors.background.gray:r.colors.background.light,E=o=>{h(!0),v(o)},D=o=>{h(!1),C(o)},R=H(c,u);return t.createElement(M,{className:e},n.label&&t.createElement(A,{htmlFor:f,height:i,isFocused:c,hasValue:Boolean(n.value||B),disabled:s,theme:r,hasError:u},n.label),n.prefix&&t.createElement(_,{isDisabled:s,isFocused:c},n.prefix),t.createElement(z,{...n,inputId:f,name:f,ref:m,isDisabled:s,onInputChange:S,placeholder:L,onFocus:E,onBlur:D,styles:{control:o=>({...o,borderRadius:0,color:r.colors.text.dark,fontFamily:r.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.75rem",backgroundColor:r.colors.background.light,borderColor:R,boxShadow:"none","&:hover":{borderColor:"none"},...O(s),...F(Boolean(n.prefix))}),placeholder:o=>({...o,display:c?"static":"none"}),singleValue:o=>({...o,maxWidth:"calc(100% - 3.3rem)",width:"calc(100% - 3.3rem)"}),menuList:o=>({...o,padding:"8px 0"}),menu:o=>({...o,borderRadius:0,boxShadow:r.elevations.elevation2,zIndex:2,padding:"0"}),option:(o,{isSelected:l,isFocused:g,isDisabled:b})=>({...o,padding:"1rem",cursor:b?"not-allowed":"pointer","&:hover":{background:y({isSelected:l,isFocused:!0,isDisabled:b})},background:y({isSelected:l,isFocused:g}),...F(Boolean(n.prefix))}),valueContainer:o=>({...o,position:"static",padding:i?`${i-1}rem 0 `:0,height:i?"auto":"21px"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:N}}),p&&t.createElement(j,{hasError:u},p))};export{k as Select,k as default};
|
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import theme from '../../theme.js';
|
|
5
|
-
import CheckCircle from '../Icons/CheckCircle.js';
|
|
6
|
-
import Close from '../Icons/Close.js';
|
|
7
|
-
import ErrorCircle from '../Icons/ErrorCircle.js';
|
|
8
|
-
import InfoCircle from '../Icons/InfoCircle.js';
|
|
9
|
-
import { CSSTransition } from 'react-transition-group';
|
|
10
|
-
|
|
11
|
-
const verticalStyles = {
|
|
12
|
-
top: css `
|
|
1
|
+
import t,{useEffect as E}from"react";import a,{css as o}from"styled-components";import r from"../../theme.js";import $ from"../Icons/CheckCircle.js";import C from"../Icons/Close.js";import k from"../Icons/ErrorCircle.js";import b from"../Icons/InfoCircle.js";import{CSSTransition as v}from"react-transition-group";const I={top:o`
|
|
13
2
|
top: 0;
|
|
14
|
-
`,
|
|
15
|
-
bottom: css `
|
|
3
|
+
`,bottom:o`
|
|
16
4
|
bottom: 0;
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
const horizontalStyles = {
|
|
20
|
-
right: css `
|
|
5
|
+
`},j={right:o`
|
|
21
6
|
right: 0;
|
|
22
|
-
`,
|
|
23
|
-
center: css `
|
|
7
|
+
`,center:o`
|
|
24
8
|
left: 50%;
|
|
25
9
|
transform: translate(-50%, 0);
|
|
26
|
-
`,
|
|
27
|
-
left: css `
|
|
10
|
+
`,left:o`
|
|
28
11
|
left: 0;
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
const animationDuration = 200;
|
|
32
|
-
const transitionClassName = 'anim';
|
|
33
|
-
const Container = styled.div `
|
|
34
|
-
font-family: ${({ theme }) => theme.typography.fontBaseFamily};
|
|
12
|
+
`},g=200,n="anim",w=a.div`
|
|
13
|
+
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
35
14
|
position: fixed;
|
|
36
15
|
display: flex;
|
|
37
16
|
align-items: center;
|
|
@@ -44,49 +23,43 @@ const Container = styled.div `
|
|
|
44
23
|
border-radius: 0.4rem;
|
|
45
24
|
padding: 1.15rem 1.25rem;
|
|
46
25
|
|
|
47
|
-
font-weight: ${({
|
|
26
|
+
font-weight: ${({theme:e})=>e.typography.fontBaseBoldWeight};
|
|
48
27
|
font-size: 0.875rem;
|
|
49
28
|
|
|
50
|
-
box-shadow: ${
|
|
51
|
-
background-color: ${
|
|
52
|
-
|
|
53
|
-
: theme.colors.background.light};
|
|
54
|
-
color: ${props => props.color !== 'none' ? theme.colors.text.light : theme.colors.text.dark};
|
|
29
|
+
box-shadow: ${r.elevations.elevation8};
|
|
30
|
+
background-color: ${e=>e.color!=="none"?r.colors[e.color].main:r.colors.background.light};
|
|
31
|
+
color: ${e=>e.color!=="none"?r.colors.text.light:r.colors.text.dark};
|
|
55
32
|
|
|
56
|
-
${
|
|
57
|
-
${
|
|
33
|
+
${e=>I[e.origin.vertical||"bottom"]}
|
|
34
|
+
${e=>j[e.origin.horizontal||"left"]}
|
|
58
35
|
|
|
59
|
-
transition: opacity ${
|
|
36
|
+
transition: opacity ${g}ms ease-in;
|
|
60
37
|
|
|
61
|
-
&.${
|
|
38
|
+
&.${n}-enter {
|
|
62
39
|
opacity: 0;
|
|
63
40
|
}
|
|
64
|
-
&.${
|
|
41
|
+
&.${n}-enter-active {
|
|
65
42
|
opacity: 1;
|
|
66
43
|
}
|
|
67
|
-
&.${
|
|
44
|
+
&.${n}-exit {
|
|
68
45
|
opacity: 1;
|
|
69
46
|
}
|
|
70
|
-
&.${
|
|
47
|
+
&.${n}-exit-active {
|
|
71
48
|
opacity: 0;
|
|
72
49
|
}
|
|
73
|
-
|
|
74
|
-
const Icon = styled.div `
|
|
50
|
+
`,f=a.div`
|
|
75
51
|
display: inline-flex;
|
|
76
52
|
margin: -0.25rem 0;
|
|
77
53
|
margin-right: 0.75rem;
|
|
78
54
|
|
|
79
|
-
${
|
|
55
|
+
${e=>e.type==="text"&&"margin-right: 0;"}
|
|
80
56
|
|
|
81
57
|
svg {
|
|
82
58
|
width: 1.5rem;
|
|
83
59
|
height: 1.5rem;
|
|
84
|
-
fill: ${
|
|
85
|
-
? theme.colors.background.light
|
|
86
|
-
: theme.colors.background.dark};
|
|
60
|
+
fill: ${e=>e.color!=="none"?r.colors.background.light:r.colors.background.dark};
|
|
87
61
|
}
|
|
88
|
-
|
|
89
|
-
const CloseIcon = styled(Icon) `
|
|
62
|
+
`,S=a(f)`
|
|
90
63
|
cursor: pointer;
|
|
91
64
|
|
|
92
65
|
/* Bigger click area */
|
|
@@ -100,22 +73,6 @@ const CloseIcon = styled(Icon) `
|
|
|
100
73
|
width: 1rem;
|
|
101
74
|
height: 1rem;
|
|
102
75
|
}
|
|
103
|
-
|
|
104
|
-
const Message = styled.span `
|
|
76
|
+
`,B=a.span`
|
|
105
77
|
flex: 1;
|
|
106
|
-
|
|
107
|
-
const icons = {
|
|
108
|
-
error: jsx(ErrorCircle, {}, void 0),
|
|
109
|
-
success: jsx(CheckCircle, {}, void 0),
|
|
110
|
-
info: jsx(InfoCircle, {}, void 0),
|
|
111
|
-
text: '',
|
|
112
|
-
};
|
|
113
|
-
const Snackbar = ({ message, color = 'none', type = 'info', action, isOpen, origin = {}, onClose = () => { }, onExited = () => { }, autoHideDuration = 4000, ...props }) => {
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
const timeout = setTimeout(onClose, autoHideDuration);
|
|
116
|
-
return () => clearTimeout(timeout);
|
|
117
|
-
}, [autoHideDuration, onClose]);
|
|
118
|
-
return (jsx(CSSTransition, Object.assign({ in: isOpen, timeout: animationDuration, mountOnEnter: true, unmountOnExit: true, onExited: onExited, classNames: transitionClassName }, { children: jsxs(Container, Object.assign({}, props, { color: color, origin: origin }, { children: [jsx(Icon, Object.assign({ color: color, type: type }, { children: icons[type] }), void 0), jsx(Message, { children: message }, void 0), action && action, jsx(CloseIcon, Object.assign({ color: color !== null && color !== void 0 ? color : 'none', onClick: onClose }, { children: jsx(Close, {}, void 0) }), void 0)] }), void 0) }), void 0));
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export { Snackbar, Snackbar as default };
|
|
78
|
+
`,z={error:t.createElement(k,null),success:t.createElement($,null),info:t.createElement(b,null),text:""},h=({message:e,color:i="none",type:c="info",action:m,isOpen:p,origin:d={},onClose:l=()=>{},onExited:u=()=>{},autoHideDuration:s=4e3,...y})=>(E(()=>{const x=setTimeout(l,s);return()=>clearTimeout(x)},[s,l]),t.createElement(v,{in:p,timeout:g,mountOnEnter:!0,unmountOnExit:!0,onExited:u,classNames:n},t.createElement(w,{...y,color:i,origin:d},t.createElement(f,{color:i,type:c},z[c]),t.createElement(B,null,e),m&&m,t.createElement(S,{color:i!=null?i:"none",onClick:l},t.createElement(C,null)))));export{h as Snackbar,h as default};
|
|
@@ -1,47 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import styled, { keyframes } from 'styled-components';
|
|
3
|
-
import theme from '../../theme.js';
|
|
4
|
-
|
|
5
|
-
const getDuration = (speed) => {
|
|
6
|
-
const durations = {
|
|
7
|
-
slow: '2s',
|
|
8
|
-
default: '1s',
|
|
9
|
-
fast: '0.5s',
|
|
10
|
-
};
|
|
11
|
-
return durations[speed] || durations.default;
|
|
12
|
-
};
|
|
13
|
-
const getSize = (size) => {
|
|
14
|
-
const sizes = {
|
|
15
|
-
smaller: 1,
|
|
16
|
-
small: 2,
|
|
17
|
-
regular: 3,
|
|
18
|
-
large: 4,
|
|
19
|
-
};
|
|
20
|
-
if (typeof size === 'number') {
|
|
21
|
-
return size;
|
|
22
|
-
}
|
|
23
|
-
return sizes[size] || sizes.regular;
|
|
24
|
-
};
|
|
25
|
-
const spin = keyframes `
|
|
1
|
+
import s from"react";import i,{keyframes as l}from"styled-components";import n from"../../theme.js";const m=e=>{const r={slow:"2s",default:"1s",fast:"0.5s"};return r[e]||r.default},t=e=>{const r={smaller:1,small:2,regular:3,large:4};return typeof e=="number"?e:r[e]||r.regular},d=l`
|
|
26
2
|
0% {
|
|
27
3
|
transform: rotate(0deg);
|
|
28
4
|
}
|
|
29
5
|
100% {
|
|
30
6
|
transform: rotate(360deg);
|
|
31
7
|
}
|
|
32
|
-
|
|
33
|
-
const StyledSpinner = styled.div `
|
|
8
|
+
`,u=i.div`
|
|
34
9
|
display: inline-block;
|
|
35
10
|
border-radius: 50%;
|
|
36
|
-
border-top: ${({
|
|
37
|
-
border-bottom: ${({
|
|
38
|
-
border-right: ${({
|
|
39
|
-
border-left: ${({
|
|
40
|
-
width: ${({
|
|
41
|
-
height: ${({
|
|
42
|
-
animation: ${
|
|
11
|
+
border-top: ${({theme:e,color:r,size:o})=>`${t(o)/10}em solid ${e.colors[r].main}`};
|
|
12
|
+
border-bottom: ${({size:e})=>`${t(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
13
|
+
border-right: ${({size:e})=>`${t(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
14
|
+
border-left: ${({size:e})=>`${t(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
15
|
+
width: ${({size:e})=>t(e)}em;
|
|
16
|
+
height: ${({size:e})=>t(e)}em;
|
|
17
|
+
animation: ${d} ${({speed:e})=>m(e)} infinite linear;
|
|
43
18
|
will-change: transform;
|
|
44
|
-
|
|
45
|
-
const Spinner = ({ size = 'regular', color = 'primary', speed = 'default', ...props }) => (jsx(StyledSpinner, Object.assign({}, props, { role: "status", "aria-live": "polite", "aria-busy": "true", size: size, speed: speed, color: color, theme: theme }), void 0));
|
|
46
|
-
|
|
47
|
-
export { Spinner as default };
|
|
19
|
+
`,f=({size:e="regular",color:r="primary",speed:o="default",...a})=>s.createElement(u,{...a,role:"status","aria-live":"polite","aria-busy":"true",size:e,speed:o,color:r,theme:n});export{f as default};
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import theme from '../../theme.js';
|
|
4
|
-
import { Title } from '../../typography/Heading/index.js';
|
|
5
|
-
import '../../shared/media-queries.js';
|
|
6
|
-
|
|
7
|
-
const Container = styled.div `
|
|
1
|
+
import e from"react";import t from"styled-components";import n from"../../theme.js";import{Title as l}from"../../typography/Heading/index.js";import"../../shared/media-queries.js";const c=t.div`
|
|
8
2
|
min-height: 4rem;
|
|
9
|
-
|
|
10
|
-
const Line = styled.div `
|
|
3
|
+
`,o=t.div`
|
|
11
4
|
margin: auto;
|
|
12
5
|
width: 2px;
|
|
13
6
|
height: 100%;
|
|
14
|
-
background-color: ${
|
|
15
|
-
|
|
16
|
-
const Graphic = styled.div `
|
|
7
|
+
background-color: ${n.colors.primary.main};
|
|
8
|
+
`,s=t.div`
|
|
17
9
|
margin-right: 0.75rem;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
font-family: ${({ theme }) => theme.typography.fontBaseFamily};
|
|
10
|
+
`,d=t.div`
|
|
11
|
+
font-family: ${({theme:r})=>r.typography.fontBaseFamily};
|
|
21
12
|
display: flex;
|
|
22
13
|
padding-bottom: 1rem;
|
|
23
14
|
|
|
24
15
|
&:last-child {
|
|
25
|
-
${
|
|
16
|
+
${o} {
|
|
26
17
|
display: none;
|
|
27
18
|
}
|
|
28
19
|
}
|
|
29
|
-
|
|
30
|
-
const Circle = styled.div `
|
|
20
|
+
`,p=t.div`
|
|
31
21
|
width: 3rem;
|
|
32
22
|
height: 3rem;
|
|
33
23
|
border-radius: 3rem;
|
|
@@ -36,14 +26,8 @@ const Circle = styled.div `
|
|
|
36
26
|
display: flex;
|
|
37
27
|
align-items: center;
|
|
38
28
|
justify-content: center;
|
|
39
|
-
background-color: ${
|
|
40
|
-
|
|
41
|
-
const CircleText = styled(Title) `
|
|
29
|
+
background-color: ${n.colors.primary.main};
|
|
30
|
+
`,h=t(l)`
|
|
42
31
|
font-size: 1.5rem;
|
|
43
32
|
font-variant: lining-nums;
|
|
44
|
-
|
|
45
|
-
const Stepper = ({ children, ...props }) => {
|
|
46
|
-
return (jsx(Container, Object.assign({}, props, { children: children.map((step, index) => (jsxs(Step, { children: [jsxs(Graphic, { children: [jsx(Circle, { children: jsx(CircleText, { children: index + 1 }, void 0) }, void 0), jsx(Line, {}, void 0)] }, void 0), step] }, index))) }), void 0));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export { Stepper };
|
|
33
|
+
`,y=({children:r,...m})=>e.createElement(c,{...m},r.map((a,i)=>e.createElement(d,{key:i},e.createElement(s,null,e.createElement(p,null,e.createElement(h,null,i+1)),e.createElement(o,null)),a)));export{y as Stepper};
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import theme from '../../theme.js';
|
|
5
|
-
import { Title } from '../../typography/Heading/index.js';
|
|
6
|
-
import CheckIcon from '../Icons/CheckIcon.js';
|
|
7
|
-
import Arrow from '../Icons/Arrow.js';
|
|
8
|
-
import { fadedColor } from '../../shared/helpers.js';
|
|
9
|
-
import { Collapse } from 'react-collapse';
|
|
10
|
-
import '../../shared/media-queries.js';
|
|
11
|
-
|
|
12
|
-
const DEFAULT_TRANSITION_TIME = '200ms';
|
|
13
|
-
const Container = styled.div `
|
|
1
|
+
import t,{useState as C,useCallback as u,useEffect as b}from"react";import r,{css as n}from"styled-components";import l from"../../theme.js";import{Title as E}from"../../typography/Heading/index.js";import x from"../Icons/CheckIcon.js";import y from"../Icons/Arrow.js";import{fadedColor as s}from"../../shared/helpers.js";import{Collapse as $}from"react-collapse";import"../../shared/media-queries.js";const a="200ms",D=r.div`
|
|
14
2
|
.ReactCollapse--collapse {
|
|
15
|
-
transition: height ${
|
|
3
|
+
transition: height ${a} ease-in-out;
|
|
16
4
|
}
|
|
17
|
-
|
|
18
|
-
const HeaderExpandedProps = css `
|
|
5
|
+
`,k=n`
|
|
19
6
|
margin-top: 0.25rem;
|
|
20
7
|
transform: rotate(-180deg);
|
|
21
|
-
|
|
22
|
-
const Header = styled.div `
|
|
8
|
+
`,I=r.div`
|
|
23
9
|
display: flex;
|
|
24
10
|
align-items: center;
|
|
25
11
|
height: 4rem;
|
|
26
12
|
|
|
27
|
-
color: ${
|
|
28
|
-
|
|
29
|
-
const StyledTitle = styled(Title) `
|
|
13
|
+
color: ${e=>e.isDisabled?l.colors.text.disabled:l.colors.text.dark};
|
|
14
|
+
`,p=r(E)`
|
|
30
15
|
margin: 0;
|
|
31
|
-
|
|
32
|
-
const HeaderArrow = styled(Arrow) `
|
|
16
|
+
`,w=r(y)`
|
|
33
17
|
margin-left: auto;
|
|
34
18
|
height: 1.25rem;
|
|
35
19
|
width: 1.25rem;
|
|
@@ -37,27 +21,23 @@ const HeaderArrow = styled(Arrow) `
|
|
|
37
21
|
|
|
38
22
|
fill: currentColor;
|
|
39
23
|
|
|
40
|
-
transition: ${
|
|
24
|
+
transition: ${a};
|
|
41
25
|
transform: rotate(0deg);
|
|
42
26
|
transform-origin: center;
|
|
43
|
-
${
|
|
44
|
-
|
|
45
|
-
const CircleIsCompleteStyles = (color) => css `
|
|
27
|
+
${e=>e.isExpanded&&k};
|
|
28
|
+
`,j=e=>n`
|
|
46
29
|
color: white;
|
|
47
|
-
background-color: ${
|
|
48
|
-
|
|
49
|
-
const CircleIsDisabledStyles = (isComplete, color) => css `
|
|
30
|
+
background-color: ${l.colors[e].main};
|
|
31
|
+
`,S=(e,i)=>n`
|
|
50
32
|
fill: white;
|
|
51
|
-
border: 2px solid ${
|
|
33
|
+
border: 2px solid ${s(l.colors[i].main,.2)};
|
|
52
34
|
|
|
53
|
-
${
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
background-color: ${fadedColor(theme.colors[color].main, 0.5)};
|
|
35
|
+
${e&&`
|
|
36
|
+
border: 2px solid ${s(l.colors[i].main,0)};
|
|
37
|
+
background-color: ${s(l.colors[i].main,.5)};
|
|
57
38
|
`}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
font-family: ${({ theme }) => theme.typography.fontBaseFamily};
|
|
39
|
+
`,v=r.div`
|
|
40
|
+
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
61
41
|
display: flex;
|
|
62
42
|
align-items: center;
|
|
63
43
|
justify-content: center;
|
|
@@ -67,7 +47,7 @@ const Circle = styled.div `
|
|
|
67
47
|
width: 2rem;
|
|
68
48
|
height: 2rem;
|
|
69
49
|
border-radius: 2rem;
|
|
70
|
-
border: 2px solid ${
|
|
50
|
+
border: 2px solid ${e=>l.colors[e.color].main};
|
|
71
51
|
|
|
72
52
|
svg {
|
|
73
53
|
fill: currentColor;
|
|
@@ -86,28 +66,7 @@ const Circle = styled.div `
|
|
|
86
66
|
margin-top: 0.1rem;
|
|
87
67
|
}
|
|
88
68
|
|
|
89
|
-
transition: background-color ${
|
|
90
|
-
${
|
|
91
|
-
${
|
|
92
|
-
|
|
93
|
-
const StepperAccordion = (props) => {
|
|
94
|
-
const [isExpanded, setIsExpanded] = useState(props.isExpanded || false);
|
|
95
|
-
const toggleIsExpanded = useCallback(() => {
|
|
96
|
-
if (!props.isDisabled) {
|
|
97
|
-
setIsExpanded(previousValue => !previousValue);
|
|
98
|
-
}
|
|
99
|
-
}, [props.isDisabled]);
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
setIsExpanded(props.isExpanded || false);
|
|
102
|
-
}, [props.isDisabled, props.isExpanded]);
|
|
103
|
-
const hasSteps = props.step || props.step === 0;
|
|
104
|
-
const handleClick = (event) => {
|
|
105
|
-
const onClick = props.onClick || toggleIsExpanded;
|
|
106
|
-
if (!props.isDisabled) {
|
|
107
|
-
onClick(event);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
return (jsxs(Container, { children: [jsxs(Header, Object.assign({}, props, { onClick: handleClick, isExpanded: isExpanded, isDisabled: props.isDisabled || false }, { children: [hasSteps && (jsx(Circle, Object.assign({ isComplete: props.isComplete || false, isDisabled: props.isDisabled || false, color: props.color || 'primary' }, { children: props.isComplete ? jsx(CheckIcon, {}, void 0) : jsx("span", { children: props.step }, void 0) }), void 0)), jsx(StyledTitle, { children: props.title }, void 0), jsx(HeaderArrow, { isExpanded: isExpanded }, void 0)] }), void 0), jsx(Collapse, Object.assign({ isOpened: isExpanded }, { children: props.children }), void 0), props.closedChildren && props.closedChildren] }, void 0));
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export { StepperAccordion, StepperAccordion as default };
|
|
69
|
+
transition: background-color ${a};
|
|
70
|
+
${e=>e.isComplete&&j(e.color)};
|
|
71
|
+
${e=>e.isDisabled&&S(e.isComplete,e.color)};
|
|
72
|
+
`,d=e=>{const[i,c]=C(e.isExpanded||!1),m=u(()=>{e.isDisabled||c(o=>!o)},[e.isDisabled]);b(()=>{c(e.isExpanded||!1)},[e.isDisabled,e.isExpanded]);const f=e.step||e.step===0,h=o=>{const g=e.onClick||m;e.isDisabled||g(o)};return t.createElement(D,null,t.createElement(I,{...e,onClick:h,isExpanded:i,isDisabled:e.isDisabled||!1},f&&t.createElement(v,{isComplete:e.isComplete||!1,isDisabled:e.isDisabled||!1,color:e.color||"primary"},e.isComplete?t.createElement(x,null):t.createElement("span",null,e.step)),t.createElement(p,null,e.title),t.createElement(w,{isExpanded:i})),t.createElement($,{isOpened:i},e.children),e.closedChildren&&e.closedChildren)};export{d as StepperAccordion,d as default};
|
|
@@ -1,41 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Children } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
|
|
5
|
-
const TabsContainer = styled.div `
|
|
1
|
+
import a,{Children as l}from"react";import p from"styled-components";const d=p.div`
|
|
6
2
|
display: inline-flex;
|
|
7
|
-
border-bottom: 1px solid ${({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
font-
|
|
11
|
-
font-weight: ${({ theme }) => theme.typography.fontAlternativeRegularWeight};
|
|
3
|
+
border-bottom: 1px solid ${({theme:t})=>t.colors.gray.light4};
|
|
4
|
+
`,c=p.div`
|
|
5
|
+
font-family: ${({theme:t})=>t.typography.fontAlternativeFamily};
|
|
6
|
+
font-weight: ${({theme:t})=>t.typography.fontAlternativeRegularWeight};
|
|
12
7
|
padding: 1em;
|
|
13
|
-
border-bottom: ${({
|
|
14
|
-
? `3px solid ${theme.colors[activeColor].main}`
|
|
15
|
-
: '3px solid transparent'};
|
|
8
|
+
border-bottom: ${({theme:t,isActive:r,activeColor:e})=>r?`3px solid ${t.colors[e].main}`:"3px solid transparent"};
|
|
16
9
|
transition: color 0.3s ease, border 0.3s ease;
|
|
17
10
|
cursor: pointer;
|
|
18
|
-
|
|
19
|
-
const Tab = ({ children, isActive = false, onClick, activeColor = 'primary', }) => {
|
|
20
|
-
return (jsx(TabWrapper, Object.assign({ isActive: isActive, onClick: onClick, activeColor: activeColor }, { children: children }), void 0));
|
|
21
|
-
};
|
|
22
|
-
const Tabs = ({ activeIndex, activeColor = 'primary', children, onTabClick, className, }) => {
|
|
23
|
-
if (Children.count(children) <= 1) {
|
|
24
|
-
console.error('<Tabs /> component has too few children!');
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return (jsx(TabsContainer, Object.assign({ className: className }, { children: Children.map(children, (child, index) => {
|
|
28
|
-
if (!child) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const onClick = child.props.onClick;
|
|
32
|
-
return (jsx(TabWrapper, Object.assign({}, child.props, { isActive: activeIndex === index, activeColor: activeColor, onClick: event => {
|
|
33
|
-
onTabClick(index);
|
|
34
|
-
if (typeof onClick === 'function') {
|
|
35
|
-
onClick(event);
|
|
36
|
-
}
|
|
37
|
-
}, as: child.type || 'div' }, { children: child.props.children }), void 0));
|
|
38
|
-
}) }), void 0));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { Tab, Tabs, Tabs as default };
|
|
11
|
+
`,u=({children:t,isActive:r=!1,onClick:e,activeColor:n="primary"})=>a.createElement(c,{isActive:r,onClick:e,activeColor:n},t),m=({activeIndex:t,activeColor:r="primary",children:e,onTabClick:n,className:f})=>l.count(e)<=1?(console.error("<Tabs /> component has too few children!"),null):a.createElement(d,{className:f},l.map(e,(o,s)=>{if(!o)return null;const i=o.props.onClick;return a.createElement(c,{...o.props,isActive:t===s,activeColor:r,onClick:y=>{n(s),typeof i=="function"&&i(y)},as:o.type||"div"},o.props.children)}));export{u as Tab,m as Tabs,m as default};
|