@dnanpm/styleguide 3.7.2 → 3.8.2
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/README.md +29 -22
- package/build/cjs/components/Accordion/Accordion.js +7 -12
- package/build/cjs/components/AccordionItem/AccordionItem.js +30 -35
- package/build/cjs/components/AmountSelector/AmountSelector.js +25 -29
- package/build/cjs/components/Box/Box.js +8 -13
- package/build/cjs/components/Button/Button.js +28 -33
- package/build/cjs/components/Button/ButtonArrow.js +16 -21
- package/build/cjs/components/Button/ButtonClose.js +4 -8
- package/build/cjs/components/Button/ButtonIcon.js +17 -22
- package/build/cjs/components/Button/ButtonPrimary.js +13 -17
- package/build/cjs/components/Button/ButtonRound.js +6 -11
- package/build/cjs/components/Button/ButtonSecondary.js +13 -17
- package/build/cjs/components/Carousel/Carousel.d.ts +1 -1
- package/build/cjs/components/Carousel/Carousel.js +43 -47
- package/build/cjs/components/Checkbox/Checkbox.js +23 -27
- package/build/cjs/components/Chip/Chip.js +11 -16
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +76 -82
- package/build/cjs/components/Divider/Divider.js +5 -10
- package/build/cjs/components/DnaLogo/DnaLogo.js +14 -18
- package/build/cjs/components/Drawer/Drawer.js +47 -52
- package/build/cjs/components/EmptyState/EmptyState.js +8 -12
- package/build/cjs/components/Expander/Expander.js +13 -17
- package/build/cjs/components/Floater/Floater.js +3 -8
- package/build/cjs/components/Footer/Components/FooterComponents.js +58 -64
- package/build/cjs/components/Footer/Footer.js +63 -67
- package/build/cjs/components/Footer/context/FooterContext.js +2 -2
- package/build/cjs/components/Icon/Icon.js +9 -13
- package/build/cjs/components/Icons/Small/hlArrowBackSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlArrowForwardSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlArrowUnderSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlCalendarSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronDownSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronLeftSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronRightSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronUpSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlClockSmall.js +4 -8
- package/build/cjs/components/Icons/Small/hlDownloadSmall.js +5 -9
- package/build/cjs/components/Icons/Small/hlExternalSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlUploadSmall.js +5 -9
- package/build/cjs/components/Icons/Social/facebook.js +3 -7
- package/build/cjs/components/Icons/Social/instagram.js +3 -7
- package/build/cjs/components/Icons/Social/linkedin.js +3 -7
- package/build/cjs/components/Icons/Social/tiktok.js +3 -7
- package/build/cjs/components/Icons/Social/twitter.js +3 -7
- package/build/cjs/components/Icons/Social/youtube.js +3 -7
- package/build/cjs/components/Icons/hl404.js +3 -7
- package/build/cjs/components/Icons/hl4gSim.js +3 -7
- package/build/cjs/components/Icons/hl5gSim.js +3 -7
- package/build/cjs/components/Icons/hlBattery.js +5 -9
- package/build/cjs/components/Icons/hlBell.js +3 -7
- package/build/cjs/components/Icons/hlCableTVCard.js +3 -7
- package/build/cjs/components/Icons/hlCalendar.js +14 -18
- package/build/cjs/components/Icons/hlCall.js +3 -7
- package/build/cjs/components/Icons/hlCameraBack.js +5 -9
- package/build/cjs/components/Icons/hlCameraFront.js +4 -8
- package/build/cjs/components/Icons/hlCart.js +5 -9
- package/build/cjs/components/Icons/hlCartEmpty.js +5 -9
- package/build/cjs/components/Icons/hlChat.js +6 -10
- package/build/cjs/components/Icons/hlCheck.js +3 -7
- package/build/cjs/components/Icons/hlChevronDown.js +3 -7
- package/build/cjs/components/Icons/hlChevronLeft.js +3 -7
- package/build/cjs/components/Icons/hlChevronRight.js +3 -7
- package/build/cjs/components/Icons/hlChevronUp.js +3 -7
- package/build/cjs/components/Icons/hlCompensation.js +3 -7
- package/build/cjs/components/Icons/hlCookie.js +3 -7
- package/build/cjs/components/Icons/hlCopy.js +4 -8
- package/build/cjs/components/Icons/hlCoupon.js +5 -9
- package/build/cjs/components/Icons/hlDelivery.js +3 -7
- package/build/cjs/components/Icons/hlDigiturva.js +3 -7
- package/build/cjs/components/Icons/hlDisplaySize.js +5 -9
- package/build/cjs/components/Icons/hlDocument.js +4 -8
- package/build/cjs/components/Icons/hlDownload.js +5 -9
- package/build/cjs/components/Icons/hlEnvelope.js +3 -7
- package/build/cjs/components/Icons/hlError.js +5 -9
- package/build/cjs/components/Icons/hlEuro.js +3 -7
- package/build/cjs/components/Icons/hlExclamationMark.js +3 -7
- package/build/cjs/components/Icons/hlExpand.js +3 -7
- package/build/cjs/components/Icons/hlExternal.js +3 -7
- package/build/cjs/components/Icons/hlEyeClosed.js +3 -7
- package/build/cjs/components/Icons/hlEyeOpen.js +4 -8
- package/build/cjs/components/Icons/hlFaceId.js +3 -7
- package/build/cjs/components/Icons/hlFastDelivery.js +3 -7
- package/build/cjs/components/Icons/hlFingerprint.js +7 -11
- package/build/cjs/components/Icons/hlGlobe.js +3 -7
- package/build/cjs/components/Icons/hlHeadphones.js +3 -7
- package/build/cjs/components/Icons/hlHeadset.js +5 -9
- package/build/cjs/components/Icons/hlHeart.js +3 -7
- package/build/cjs/components/Icons/hlHome.js +3 -7
- package/build/cjs/components/Icons/hlHub.js +4 -8
- package/build/cjs/components/Icons/hlImage.js +3 -7
- package/build/cjs/components/Icons/hlInfo.js +5 -9
- package/build/cjs/components/Icons/hlInstallment.js +4 -8
- package/build/cjs/components/Icons/hlIotSim.js +4 -8
- package/build/cjs/components/Icons/hlLaptop.js +3 -7
- package/build/cjs/components/Icons/hlLink.js +4 -8
- package/build/cjs/components/Icons/hlLiveVideo.js +3 -7
- package/build/cjs/components/Icons/hlLock.js +5 -9
- package/build/cjs/components/Icons/hlMagnifyingGlass.js +4 -8
- package/build/cjs/components/Icons/hlMarker.js +4 -8
- package/build/cjs/components/Icons/hlMemory.js +4 -8
- package/build/cjs/components/Icons/hlMenu.js +3 -7
- package/build/cjs/components/Icons/hlMinimize.js +3 -7
- package/build/cjs/components/Icons/hlMinus.js +3 -7
- package/build/cjs/components/Icons/hlMobileData.js +3 -7
- package/build/cjs/components/Icons/hlMobilePayment.js +5 -9
- package/build/cjs/components/Icons/hlModem.js +7 -11
- package/build/cjs/components/Icons/hlMore.js +5 -9
- package/build/cjs/components/Icons/hlOs.js +4 -8
- package/build/cjs/components/Icons/hlPackage.js +3 -7
- package/build/cjs/components/Icons/hlPaperclip.js +3 -7
- package/build/cjs/components/Icons/hlPaytime.js +3 -7
- package/build/cjs/components/Icons/hlPen.js +3 -7
- package/build/cjs/components/Icons/hlPerson.js +3 -7
- package/build/cjs/components/Icons/hlPhone.js +4 -8
- package/build/cjs/components/Icons/hlPlaylist.js +3 -7
- package/build/cjs/components/Icons/hlPlus.js +4 -8
- package/build/cjs/components/Icons/hlPrepaid.js +3 -7
- package/build/cjs/components/Icons/hlProcessor.js +4 -8
- package/build/cjs/components/Icons/hlServices.js +3 -7
- package/build/cjs/components/Icons/hlSettings.js +3 -7
- package/build/cjs/components/Icons/hlShield.js +4 -8
- package/build/cjs/components/Icons/hlSim.js +4 -8
- package/build/cjs/components/Icons/hlSimSimple.js +5 -9
- package/build/cjs/components/Icons/hlSmile.js +6 -10
- package/build/cjs/components/Icons/hlSpeechBubble.js +4 -8
- package/build/cjs/components/Icons/hlSquaretrade.js +3 -7
- package/build/cjs/components/Icons/hlStar.js +3 -7
- package/build/cjs/components/Icons/hlStarFilled.js +3 -7
- package/build/cjs/components/Icons/hlTrash.js +4 -8
- package/build/cjs/components/Icons/hlTv.js +3 -7
- package/build/cjs/components/Icons/hlUnlock.js +4 -8
- package/build/cjs/components/Icons/hlUpload.js +5 -9
- package/build/cjs/components/Icons/hlWarning.js +5 -9
- package/build/cjs/components/Icons/hlWifi.js +5 -9
- package/build/cjs/components/Icons/hlWrench.js +3 -7
- package/build/cjs/components/Icons/hlX.js +3 -7
- package/build/cjs/components/Icons/index.js +109 -111
- package/build/cjs/components/InfoDialog/InfoDialog.js +18 -22
- package/build/cjs/components/Input/Input.js +44 -48
- package/build/cjs/components/Label/Label.js +14 -18
- package/build/cjs/components/LabelText/LabelText.js +11 -15
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +23 -27
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +59 -63
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +11 -15
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LinkModifier.js +6 -10
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LoginTooltip.js +5 -9
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +4 -4
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +28 -30
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +11 -11
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.d.ts +3 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +9 -11
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +50 -54
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/PageSearch.js +5 -9
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +11 -2
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +41 -43
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.js +1 -1
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +1 -1
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.d.ts +5 -5
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +48 -50
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +14 -18
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +49 -53
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +44 -48
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +11 -15
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +7 -11
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +5 -9
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +21 -25
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +7 -7
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +6 -10
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +52 -56
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +5 -9
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +20 -24
- package/build/cjs/components/MainNavigation/MainNavigation.js +20 -24
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.js +1 -1
- package/build/cjs/components/MainNavigation/context/NavContext.js +1 -1
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +5 -5
- package/build/cjs/components/MainNavigation/globalNavStyles.js +12 -14
- package/build/cjs/components/Modal/Modal.js +20 -25
- package/build/cjs/components/Notification/Notification.js +17 -22
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +8 -12
- package/build/cjs/components/Overlay/Overlay.d.ts +49 -0
- package/build/cjs/components/Overlay/Overlay.js +80 -0
- package/build/cjs/components/Pill/Pill.js +19 -24
- package/build/cjs/components/PixelLoader/PixelLoader.js +9 -13
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.d.ts +10 -0
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +84 -53
- package/build/cjs/components/PriorityNavigationItem/PriorityNavigationItem.js +20 -15
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +30 -34
- package/build/cjs/components/RadioButton/RadioButton.js +11 -15
- package/build/cjs/components/ReadMore/ReadMore.js +14 -17
- package/build/cjs/components/Search/Search.js +16 -20
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +53 -57
- package/build/cjs/components/Selectbox/Selectbox.js +44 -49
- package/build/cjs/components/Switch/Switch.js +18 -19
- package/build/cjs/components/Tab/Tab.js +29 -33
- package/build/cjs/components/Tabs/Tabs.js +15 -19
- package/build/cjs/components/Textarea/Textarea.js +29 -33
- package/build/cjs/components/Toaster/Toaster.js +19 -24
- package/build/cjs/components/Tooltip/Tooltip.js +21 -25
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +2 -4
- package/build/cjs/components/TooltipMenu/TooltipMenu.js +20 -24
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/hooks/useCloseOutsideOrElementClicked.js +1 -1
- package/build/cjs/hooks/useDebounce.js +1 -1
- package/build/cjs/hooks/useDocHeight.js +2 -2
- package/build/cjs/hooks/useOutsideClick.js +1 -1
- package/build/cjs/hooks/useResizeObserver.d.ts +1 -1
- package/build/cjs/hooks/useResizeObserver.js +1 -1
- package/build/cjs/hooks/useScrollPosition.d.ts +3 -1
- package/build/cjs/hooks/useScrollPosition.js +1 -1
- package/build/cjs/hooks/useWindowSize.js +1 -1
- package/build/cjs/index.js +164 -164
- package/build/cjs/themes/globalStyles.js +78 -80
- package/build/cjs/themes/gridTheme.js +1 -1
- package/build/cjs/themes/styled.js +2 -2
- package/build/cjs/themes/theme.js +11 -11
- package/build/cjs/themes/themeComponents/base.js +2 -2
- package/build/cjs/themes/themeComponents/breakpoints.js +1 -1
- package/build/cjs/themes/themeComponents/color.js +1 -1
- package/build/cjs/themes/themeComponents/fontFamily.js +1 -1
- package/build/cjs/themes/themeComponents/fontSize.js +14 -14
- package/build/cjs/themes/themeComponents/fontWeight.js +1 -1
- package/build/cjs/themes/themeComponents/forms.js +2 -2
- package/build/cjs/themes/themeComponents/lineHeight.js +14 -14
- package/build/cjs/themes/themeComponents/navigation.js +1 -1
- package/build/cjs/themes/themeComponents/radius.js +1 -1
- package/build/cjs/utils/common.d.ts +1 -1
- package/build/cjs/utils/common.js +4 -4
- package/build/cjs/utils/createStyled.d.ts +2 -163
- package/build/cjs/utils/createStyled.js +4 -5
- package/build/cjs/utils/styledUtils.js +2 -4
- package/build/es/components/Carousel/Carousel.d.ts +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +4 -4
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +5 -3
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.d.ts +3 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +4 -2
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +11 -2
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +8 -6
- package/build/es/components/MainHeaderNavigation/globalNavStyles.d.ts +5 -5
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +1 -1
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +5 -5
- package/build/es/components/Overlay/Overlay.d.ts +49 -0
- package/build/es/components/Overlay/Overlay.js +76 -0
- package/build/es/components/PriorityNavigation/PriorityNavigation.d.ts +10 -0
- package/build/es/components/PriorityNavigation/PriorityNavigation.js +60 -25
- package/build/es/components/PriorityNavigationItem/PriorityNavigationItem.js +10 -1
- package/build/es/components/ReadMore/ReadMore.js +1 -0
- package/build/es/components/index.d.ts +1 -0
- package/build/es/hooks/useResizeObserver.d.ts +1 -1
- package/build/es/hooks/useScrollPosition.d.ts +3 -1
- package/build/es/index.js +1 -0
- package/build/es/themes/themeComponents/base.js +1 -1
- package/build/es/themes/themeComponents/fontSize.js +13 -13
- package/build/es/themes/themeComponents/forms.js +1 -1
- package/build/es/themes/themeComponents/lineHeight.js +13 -13
- package/build/es/utils/common.d.ts +1 -1
- package/build/es/utils/createStyled.d.ts +2 -163
- package/package.json +49 -53
package/README.md
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Styles and styled components for DNA.
|
|
1
|
+
DNA Styleguide repository provides the set of components and theme object used in various DNA projects.
|
|
4
2
|
|
|
5
3
|
## Installation
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
Run install command in repository where DNA Styleguide should be added
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @dnanpm/styleguide
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> Requires access to DNA Cloud URL!
|
|
15
|
+
|
|
16
|
+
### Interactive documentation and API
|
|
17
|
+
|
|
18
|
+
See latest version of [DNA Styleguide](https://styleguide.devkube.kauppa5test.acs.dnacloud.fi/latest/) for theme documentation, API and interactive documentation of components.
|
|
19
|
+
|
|
20
|
+
### Changelog
|
|
21
|
+
|
|
22
|
+
See [Changelog](https://styleguide.devkube.kauppa5test.acs.dnacloud.fi/latest/#/Changelog) for current major version changes, or [Changelog Archive](https://styleguide.devkube.kauppa5test.acs.dnacloud.fi/latest/#/Changelog%20archive) for old major versions' changes.
|
|
23
|
+
|
|
24
|
+
### Migration guide
|
|
25
|
+
|
|
26
|
+
See [Migration guide](https://styleguide.devkube.kauppa5test.acs.dnacloud.fi/latest/#/Migration%20Guide) for more information about how to migrate between major versions of DNA Styleguide.
|
|
27
|
+
|
|
28
|
+
### Contribution guide
|
|
29
|
+
|
|
30
|
+
See [Contribution guide](https://styleguide.devkube.kauppa5test.acs.dnacloud.fi/latest/#/Contribution%20guide) for more information about how to contribute to DNA Styleguide.
|
|
12
31
|
|
|
13
32
|
## Usage example
|
|
14
33
|
|
|
15
34
|
### Theme
|
|
16
35
|
|
|
17
36
|
```js
|
|
18
|
-
import {
|
|
37
|
+
import { theme as defaultTheme } from '@dnanpm/styleguide';
|
|
19
38
|
|
|
20
39
|
const color = {
|
|
21
40
|
...defaultTheme.color,
|
|
@@ -34,7 +53,6 @@ const theme = {
|
|
|
34
53
|
};
|
|
35
54
|
|
|
36
55
|
export type ThemeInterface = typeof theme;
|
|
37
|
-
export const { styled, css } = createStyled<ThemeInterface>();
|
|
38
56
|
export default theme;
|
|
39
57
|
```
|
|
40
58
|
|
|
@@ -54,7 +72,7 @@ class MyApp {
|
|
|
54
72
|
}
|
|
55
73
|
```
|
|
56
74
|
|
|
57
|
-
###
|
|
75
|
+
### Component
|
|
58
76
|
|
|
59
77
|
```js
|
|
60
78
|
import { ButtonPrimary } from '@dnanpm/styleguide';
|
|
@@ -73,14 +91,3 @@ const MyComponent = ({
|
|
|
73
91
|
|
|
74
92
|
export default MyComponent;
|
|
75
93
|
```
|
|
76
|
-
|
|
77
|
-
## IE11 Support NextJS
|
|
78
|
-
|
|
79
|
-
In `next.config.js` you need to use [next-transpile-modules](https://www.npmjs.com/package/next-transpile-modules) package to allow nextjs to be able to transpile styleguide and related es6 modules based on babel config.
|
|
80
|
-
|
|
81
|
-
```js
|
|
82
|
-
// next.config.js
|
|
83
|
-
const withTM = require('next-transpile-modules')(['@dnanpm/styleguide', "react-spring"]);
|
|
84
|
-
|
|
85
|
-
module.exports = withTM();
|
|
86
|
-
```
|
|
@@ -9,16 +9,11 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var AccordionItem = require('../AccordionItem/AccordionItem.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
-
|
|
17
|
-
const AccordionContainer = styled__default["default"].div `
|
|
12
|
+
const AccordionContainer = styled.div `
|
|
18
13
|
${p => p.type === 'box' &&
|
|
19
14
|
styled.css `
|
|
20
15
|
& > * {
|
|
21
|
-
margin: ${styledUtils.getMultipliedSize(theme
|
|
16
|
+
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)} 0;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
& > *:first-of-type {
|
|
@@ -37,7 +32,7 @@ const Accordion = (_a) => {
|
|
|
37
32
|
const getAccordionItemId = (index, title) => `${title.replace(/\s+/g, '')}-${index}`;
|
|
38
33
|
if (props.isExpanded) {
|
|
39
34
|
React.Children.map(props.children, (child, index) => {
|
|
40
|
-
if (React.isValidElement(child) && child.type === AccordionItem
|
|
35
|
+
if (React.isValidElement(child) && child.type === AccordionItem.default) {
|
|
41
36
|
initialItemList[getAccordionItemId(index, child.props.title)] = Boolean(props.isExpanded);
|
|
42
37
|
}
|
|
43
38
|
});
|
|
@@ -61,16 +56,16 @@ const Accordion = (_a) => {
|
|
|
61
56
|
}
|
|
62
57
|
};
|
|
63
58
|
const accordionItems = React.Children.map(props.children, (child, index) => {
|
|
64
|
-
if (React.isValidElement(child) && child.type === AccordionItem
|
|
59
|
+
if (React.isValidElement(child) && child.type === AccordionItem.default) {
|
|
65
60
|
const id = getAccordionItemId(index, child.props.title);
|
|
66
|
-
return (
|
|
61
|
+
return (React.createElement(AccordionItem.default, { id: id, key: id, type: type, title: child.props.title, isExpanded: itemList[id], highlightSelected: highlightSelected, hasCloseButton: hasCloseButton, openLabel: props.openLabel, closeLabel: props.closeLabel, onClick: handleClick, onKeyDown: handleKeyDown, className: child.props.className }, child.props.children));
|
|
67
62
|
}
|
|
68
63
|
return null;
|
|
69
64
|
});
|
|
70
65
|
if (!accordionItems) {
|
|
71
66
|
return null;
|
|
72
67
|
}
|
|
73
|
-
return (
|
|
68
|
+
return (React.createElement(AccordionContainer, { type: type, className: props.className }, accordionItems));
|
|
74
69
|
};
|
|
75
70
|
|
|
76
|
-
exports
|
|
71
|
+
exports.default = Accordion;
|
|
@@ -12,55 +12,50 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
12
12
|
var Box = require('../Box/Box.js');
|
|
13
13
|
var Icon = require('../Icon/Icon.js');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
19
|
-
|
|
20
|
-
const AccordionItemContainer = styled__default["default"].div `
|
|
15
|
+
const AccordionItemContainer = styled.div `
|
|
21
16
|
${p => p.type === 'panel' &&
|
|
22
17
|
styled.css `
|
|
23
|
-
border-bottom: 1px solid ${theme
|
|
18
|
+
border-bottom: 1px solid ${theme.default.color.line.L02};
|
|
24
19
|
`}
|
|
25
20
|
`;
|
|
26
|
-
const AccordionItemTitle =
|
|
27
|
-
font-size: ${theme
|
|
28
|
-
line-height: ${theme
|
|
29
|
-
font-weight: ${theme
|
|
21
|
+
const AccordionItemTitle = styled.div `
|
|
22
|
+
font-size: ${theme.default.fontSize.default};
|
|
23
|
+
line-height: ${theme.default.lineHeight.default};
|
|
24
|
+
font-weight: ${theme.default.fontWeight.bold};
|
|
30
25
|
display: flex;
|
|
31
26
|
justify-content: space-between;
|
|
32
27
|
flex-direction: row;
|
|
33
28
|
cursor: pointer;
|
|
34
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
35
|
-
${styledUtils.getMultipliedSize(theme
|
|
36
|
-
color: ${p => p.isExpanded && p.highlightSelected ? theme
|
|
29
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)}
|
|
30
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
31
|
+
color: ${p => p.isExpanded && p.highlightSelected ? theme.default.color.default.pink : theme.default.color.default.black};
|
|
37
32
|
transition: color 0.2s;
|
|
38
33
|
${p => p.highlightSelected &&
|
|
39
34
|
styled.css `
|
|
40
35
|
&:hover,
|
|
41
36
|
&:active {
|
|
42
|
-
color: ${theme
|
|
37
|
+
color: ${theme.default.color.default.pink};
|
|
43
38
|
text-decoration: none;
|
|
44
39
|
}
|
|
45
40
|
`}
|
|
46
41
|
`;
|
|
47
|
-
const AccordionItemContentWrapper =
|
|
42
|
+
const AccordionItemContentWrapper = styled.div `
|
|
48
43
|
overflow: hidden;
|
|
49
44
|
transition: all 0.2s ease;
|
|
50
45
|
height: ${p => (p.isExpanded ? p.maxHeight / 16 + 1.25 : 0)}rem;
|
|
51
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
46
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
52
47
|
visibility: ${p => (p.isExpanded ? 'visible' : 'hidden')};
|
|
53
48
|
`;
|
|
54
|
-
const AccordionItemContent =
|
|
55
|
-
padding-bottom: ${styledUtils.getMultipliedSize(theme
|
|
49
|
+
const AccordionItemContent = styled.div `
|
|
50
|
+
padding-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)};
|
|
56
51
|
`;
|
|
57
|
-
const AccordionItemCloseButton =
|
|
52
|
+
const AccordionItemCloseButton = styled.div `
|
|
58
53
|
display: flex;
|
|
59
54
|
justify-content: flex-end;
|
|
60
|
-
line-height: ${theme
|
|
61
|
-
margin-bottom: ${styledUtils.getMultipliedSize(theme
|
|
62
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
63
|
-
gap: ${styledUtils.getMultipliedSize(theme
|
|
55
|
+
line-height: ${theme.default.lineHeight.default};
|
|
56
|
+
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)};
|
|
57
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
58
|
+
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
|
|
64
59
|
cursor: pointer;
|
|
65
60
|
`;
|
|
66
61
|
/** @visibleName Accordion Item */
|
|
@@ -68,17 +63,17 @@ const AccordionItem = (_a) => {
|
|
|
68
63
|
var { type = 'box', hasCloseButton = false, highlightSelected = type === 'panel' } = _a, props = tslib.__rest(_a, ["type", "hasCloseButton", "highlightSelected"]);
|
|
69
64
|
const contentRef = React.useRef(null);
|
|
70
65
|
// Get height when element dimensions change
|
|
71
|
-
const { height: contentHeight } = useResizeObserver
|
|
72
|
-
const itemContent = (
|
|
73
|
-
|
|
66
|
+
const { height: contentHeight } = useResizeObserver.default(contentRef);
|
|
67
|
+
const itemContent = (React.createElement(AccordionItemContainer, { id: props.id, type: type, "aria-expanded": Boolean(props.isExpanded), className: props.className },
|
|
68
|
+
React.createElement(AccordionItemTitle, { tabIndex: 0, onClick: props.onClick, onKeyDown: props.onKeyDown, isExpanded: Boolean(props.isExpanded), highlightSelected: highlightSelected, role: "button" },
|
|
74
69
|
props.title,
|
|
75
|
-
props.isExpanded ? (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
hasCloseButton && props.isExpanded && (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return type === 'box' ? (
|
|
70
|
+
props.isExpanded ? (React.createElement(Icon.default, { icon: icons.ChevronUp, color: theme.default.color.default.black, position: "right", "aria-label": props.closeLabel })) : (React.createElement(Icon.default, { icon: icons.ChevronDown, color: theme.default.color.default.black, position: "right", "aria-label": props.openLabel }))),
|
|
71
|
+
React.createElement(AccordionItemContentWrapper, { maxHeight: contentHeight, isExpanded: props.isExpanded },
|
|
72
|
+
React.createElement(AccordionItemContent, { ref: contentRef }, props.children)),
|
|
73
|
+
hasCloseButton && props.isExpanded && (React.createElement(AccordionItemCloseButton, { tabIndex: 0, onClick: props.onClick, onKeyDown: props.onKeyDown, "aria-label": props.closeLabel, role: "button" },
|
|
74
|
+
React.createElement("span", null, props.closeLabel),
|
|
75
|
+
React.createElement(Icon.default, { icon: icons.Close })))));
|
|
76
|
+
return type === 'box' ? (React.createElement(Box.default, { elevation: props.isExpanded ? 'low' : 'none', padding: "0" }, itemContent)) : (itemContent);
|
|
82
77
|
};
|
|
83
78
|
|
|
84
|
-
exports
|
|
79
|
+
exports.default = AccordionItem;
|
|
@@ -11,23 +11,19 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
11
11
|
var ButtonArrow = require('../Button/ButtonArrow.js');
|
|
12
12
|
var Icon = require('../Icon/Icon.js');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
-
|
|
18
|
-
const Container = styled["default"].div `
|
|
14
|
+
const Container = styled.default.div `
|
|
19
15
|
display: flex;
|
|
20
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
16
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 12)};
|
|
21
17
|
`;
|
|
22
|
-
const Button = styled
|
|
18
|
+
const Button = styled.default(ButtonArrow.default) `
|
|
23
19
|
display: inline-flex;
|
|
24
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
25
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
20
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)};
|
|
21
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)};
|
|
26
22
|
border-radius: 0;
|
|
27
23
|
|
|
28
24
|
&:first-of-type {
|
|
29
|
-
border-top-left-radius: ${theme
|
|
30
|
-
border-bottom-left-radius: ${theme
|
|
25
|
+
border-top-left-radius: ${theme.default.radius.s};
|
|
26
|
+
border-bottom-left-radius: ${theme.default.radius.s};
|
|
31
27
|
|
|
32
28
|
&:focus {
|
|
33
29
|
z-index: 2;
|
|
@@ -35,32 +31,32 @@ const Button = styled["default"](ButtonArrow["default"]) `
|
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
&:last-of-type {
|
|
38
|
-
border-top-right-radius: ${theme
|
|
39
|
-
border-bottom-right-radius: ${theme
|
|
34
|
+
border-top-right-radius: ${theme.default.radius.s};
|
|
35
|
+
border-bottom-right-radius: ${theme.default.radius.s};
|
|
40
36
|
}
|
|
41
37
|
`;
|
|
42
|
-
const Input = styled
|
|
43
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
44
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
45
|
-
font-family: ${theme
|
|
46
|
-
font-size: ${theme
|
|
38
|
+
const Input = styled.default.input `
|
|
39
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)};
|
|
40
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)};
|
|
41
|
+
font-family: ${theme.default.fontFamily.default};
|
|
42
|
+
font-size: ${theme.default.fontSize.default};
|
|
47
43
|
text-align: center;
|
|
48
44
|
border: 0 none;
|
|
49
45
|
border-radius: 0;
|
|
50
|
-
border-top: 1px solid ${theme
|
|
51
|
-
border-bottom: 1px solid ${theme
|
|
46
|
+
border-top: 1px solid ${theme.default.color.line.L01};
|
|
47
|
+
border-bottom: 1px solid ${theme.default.color.line.L01};
|
|
52
48
|
|
|
53
49
|
&:focus {
|
|
54
|
-
border: 2px solid ${theme
|
|
55
|
-
box-shadow: 0px 0px 0px 2px ${theme
|
|
50
|
+
border: 2px solid ${theme.default.color.focus.light};
|
|
51
|
+
box-shadow: 0px 0px 0px 2px ${theme.default.color.focus.dark};
|
|
56
52
|
outline: none;
|
|
57
53
|
z-index: 2;
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
&:disabled,
|
|
61
57
|
&[disabled] {
|
|
62
|
-
background-color: ${theme
|
|
63
|
-
border: 1px solid ${theme
|
|
58
|
+
background-color: ${theme.default.color.background.sand.E02 + theme.default.color.transparency.T30};
|
|
59
|
+
border: 1px solid ${theme.default.color.line.L02 + theme.default.color.transparency.T30};
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
&:read-only {
|
|
@@ -107,11 +103,11 @@ const AmountSelector = (_a) => {
|
|
|
107
103
|
onChange(min);
|
|
108
104
|
}
|
|
109
105
|
};
|
|
110
|
-
return (
|
|
111
|
-
|
|
106
|
+
return (React.createElement(Container, { "data-testid": dataTestId, className: props.className },
|
|
107
|
+
React.createElement(Button, { icon: React.createElement(Icon.default, { icon: props.removable && isMinReached(value - step) ? icons.Trash : icons.Minus, size: styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2) }), variant: "secondary", onClick: decrease, disabled: disabled, type: "button", "data-testid": dataTestId &&
|
|
112
108
|
`${dataTestId}${props.removable && isMinReached(value - step) ? '-remove' : '-decrease'}` }),
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
React.createElement(Input, { id: props.id, name: props.name, type: "number", onChange: handleChange, value: value, readOnly: readonly || disabled, disabled: disabled }),
|
|
110
|
+
React.createElement(Button, { icon: React.createElement(Icon.default, { icon: icons.Plus, size: styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2) }), variant: "secondary", onClick: increase, disabled: disabled, type: "button", "data-testid": dataTestId ? `${dataTestId}-increase` : undefined })));
|
|
115
111
|
};
|
|
116
112
|
|
|
117
|
-
exports
|
|
113
|
+
exports.default = AmountSelector;
|
|
@@ -9,24 +9,19 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var common = require('../../utils/common.js');
|
|
10
10
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
-
|
|
17
|
-
const BoxWrapper = styled__default["default"].div `
|
|
18
|
-
border: 1px solid ${theme["default"].color.line.L04};
|
|
12
|
+
const BoxWrapper = styled.div `
|
|
13
|
+
border: 1px solid ${theme.default.color.line.L04};
|
|
19
14
|
${({ width }) => width && `width: ${width}`};
|
|
20
15
|
${({ height }) => height && `height: ${height}`};
|
|
21
16
|
${({ margin }) => margin && `margin: ${margin}`};
|
|
22
|
-
padding: ${({ padding }) => padding || styledUtils.getMultipliedSize(theme
|
|
23
|
-
background-color: ${theme
|
|
24
|
-
border-radius: ${theme
|
|
25
|
-
${({ $elevation, shadow }) => $elevation !== 'none' && common
|
|
17
|
+
padding: ${({ padding }) => padding || styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
18
|
+
background-color: ${theme.default.color.default.white};
|
|
19
|
+
border-radius: ${theme.default.radius.default};
|
|
20
|
+
${({ $elevation, shadow }) => $elevation !== 'none' && common.default({ elevation: $elevation, shadow })}
|
|
26
21
|
`;
|
|
27
22
|
const Box = (_a) => {
|
|
28
23
|
var { elevation = 'none', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["elevation", 'data-testid']);
|
|
29
|
-
return (
|
|
24
|
+
return (React.createElement(BoxWrapper, { id: props.id, "$elevation": elevation, shadow: props.shadow, width: props.width, height: props.height, margin: props.margin, padding: props.padding, className: props.className, "data-testid": dataTestId }, props.children));
|
|
30
25
|
};
|
|
31
26
|
|
|
32
|
-
exports
|
|
27
|
+
exports.default = Box;
|
|
@@ -9,11 +9,6 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
11
11
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
-
|
|
17
12
|
// Only Button component specific shades to be used on user interaction styles
|
|
18
13
|
const shade = {
|
|
19
14
|
pink: {
|
|
@@ -31,66 +26,66 @@ const shade = {
|
|
|
31
26
|
},
|
|
32
27
|
},
|
|
33
28
|
};
|
|
34
|
-
const Element =
|
|
29
|
+
const Element = styled.button `
|
|
35
30
|
display: inline-block;
|
|
36
|
-
font-family: ${theme
|
|
37
|
-
font-weight: ${theme
|
|
38
|
-
font-size: ${({ small }) => (small ? theme
|
|
39
|
-
line-height: ${({ small }) => (small ? theme
|
|
40
|
-
min-width: ${({ small }) => styledUtils.getMultipliedSize(theme
|
|
31
|
+
font-family: ${theme.default.fontFamily.default};
|
|
32
|
+
font-weight: ${theme.default.fontWeight.bold};
|
|
33
|
+
font-size: ${({ small }) => (small ? theme.default.fontSize.s : theme.default.fontSize.default)};
|
|
34
|
+
line-height: ${({ small }) => (small ? theme.default.lineHeight.xs : theme.default.lineHeight.default)};
|
|
35
|
+
min-width: ${({ small }) => styledUtils.getMultipliedSize(theme.default.base.baseWidth, small ? 10 : 12.8)};
|
|
41
36
|
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
|
42
37
|
cursor: pointer;
|
|
43
|
-
color: ${({ darkBg }) => (darkBg ? theme
|
|
38
|
+
color: ${({ darkBg }) => (darkBg ? theme.default.color.text.white : theme.default.color.text.plum)};
|
|
44
39
|
background-color: transparent;
|
|
45
|
-
border-radius: ${theme
|
|
40
|
+
border-radius: ${theme.default.radius.pill};
|
|
46
41
|
border: 2px solid
|
|
47
|
-
${({ darkBg }) => (darkBg ? theme
|
|
48
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
49
|
-
${styledUtils.getMultipliedSize(theme
|
|
42
|
+
${({ darkBg }) => (darkBg ? theme.default.color.default.white : theme.default.color.default.plum)};
|
|
43
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.6)}
|
|
44
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
50
45
|
|
|
51
46
|
> span {
|
|
52
47
|
display: inline-flex;
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
&:focus {
|
|
56
|
-
color: ${({ darkBg }) => (darkBg ? theme
|
|
57
|
-
background-color: ${({ darkBg }) => darkBg ? theme
|
|
51
|
+
color: ${({ darkBg }) => (darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
52
|
+
background-color: ${({ darkBg }) => darkBg ? theme.default.color.default.white : shade.plum.darker};
|
|
58
53
|
border: 2px solid
|
|
59
|
-
${({ darkBg }) => (darkBg ? theme
|
|
54
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.dark : theme.default.color.focus.light)};
|
|
60
55
|
box-shadow: 0px 0px 0px 2px
|
|
61
|
-
${({ darkBg }) => (darkBg ? theme
|
|
56
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.light : theme.default.color.focus.dark)};
|
|
62
57
|
outline: none;
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
&:hover {
|
|
66
|
-
color: ${({ darkBg }) => (darkBg ? theme
|
|
67
|
-
background-color: ${({ darkBg }) => darkBg ? theme
|
|
61
|
+
color: ${({ darkBg }) => (darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
62
|
+
background-color: ${({ darkBg }) => darkBg ? theme.default.color.default.white : shade.plum.darker};
|
|
68
63
|
|
|
69
64
|
&:focus {
|
|
70
65
|
border: 2px solid
|
|
71
|
-
${({ darkBg }) => (darkBg ? theme
|
|
66
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.dark : theme.default.color.focus.light)};
|
|
72
67
|
box-shadow: 0px 0px 0px 2px
|
|
73
|
-
${({ darkBg }) => (darkBg ? theme
|
|
68
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.light : theme.default.color.focus.dark)};
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
&:active {
|
|
78
|
-
color: ${({ darkBg }) => (darkBg ? theme
|
|
79
|
-
background-color: ${({ darkBg }) => darkBg ? theme
|
|
73
|
+
color: ${({ darkBg }) => (darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
74
|
+
background-color: ${({ darkBg }) => darkBg ? theme.default.color.default.white + theme.default.color.transparency.T90 : shade.plum.lighter};
|
|
80
75
|
border: 2px solid
|
|
81
76
|
${({ darkBg }) => darkBg
|
|
82
|
-
? theme
|
|
77
|
+
? theme.default.color.default.white + theme.default.color.transparency.T90
|
|
83
78
|
: shade.plum.lighter};
|
|
84
79
|
outline: none;
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
&:disabled,
|
|
88
83
|
&[disabled] {
|
|
89
|
-
color: ${({ darkBg }) => darkBg ? theme
|
|
84
|
+
color: ${({ darkBg }) => darkBg ? theme.default.color.text.white + theme.default.color.transparency.T70 : theme.default.color.text.gray};
|
|
90
85
|
border: 2px solid
|
|
91
86
|
${({ darkBg }) => darkBg
|
|
92
|
-
? theme
|
|
93
|
-
: theme
|
|
87
|
+
? theme.default.color.default.white + theme.default.color.transparency.T30
|
|
88
|
+
: theme.default.color.default.plum + theme.default.color.transparency.T30};
|
|
94
89
|
pointer-events: none;
|
|
95
90
|
}
|
|
96
91
|
|
|
@@ -123,11 +118,11 @@ const Element = styled__default["default"].button `
|
|
|
123
118
|
/** @visibleName Button */
|
|
124
119
|
const Button = (_a) => {
|
|
125
120
|
var { type = 'submit', 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ["type", 'data-testid', 'data-no-close', 'data-track-value']);
|
|
126
|
-
return (
|
|
121
|
+
return (React.createElement(Element, Object.assign({ id: props.id, as: props.href ? 'a' : undefined, type: props.href ? undefined : type, href: props.href, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, fullWidth: props.fullWidth, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, (!props.href && {
|
|
127
122
|
name: props.name,
|
|
128
123
|
disabled: props.disabled,
|
|
129
|
-
})), props.loading ? (
|
|
124
|
+
})), props.loading ? (React.createElement(PixelLoader.default, { color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.plum })) : (React.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))));
|
|
130
125
|
};
|
|
131
126
|
|
|
132
|
-
exports
|
|
127
|
+
exports.default = Button;
|
|
133
128
|
exports.shade = shade;
|
|
@@ -12,11 +12,6 @@ var Icon = require('../Icon/Icon.js');
|
|
|
12
12
|
var ButtonPrimary = require('./ButtonPrimary.js');
|
|
13
13
|
var ButtonSecondary = require('./ButtonSecondary.js');
|
|
14
14
|
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
19
|
-
|
|
20
15
|
const iconsMap = {
|
|
21
16
|
up: icons.ChevronUp,
|
|
22
17
|
right: icons.ChevronRight,
|
|
@@ -26,8 +21,8 @@ const iconsMap = {
|
|
|
26
21
|
const overrideStyles = `
|
|
27
22
|
display: flex;
|
|
28
23
|
min-width: initial;
|
|
29
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
30
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
24
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3.2)};
|
|
25
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 3.2)};
|
|
31
26
|
padding: initial;
|
|
32
27
|
text-align: center;
|
|
33
28
|
vertical-align: middle;
|
|
@@ -35,37 +30,37 @@ const overrideStyles = `
|
|
|
35
30
|
align-items: center;
|
|
36
31
|
`;
|
|
37
32
|
const buttonsMap = {
|
|
38
|
-
primary:
|
|
33
|
+
primary: styled(ButtonPrimary.default) `
|
|
39
34
|
${overrideStyles};
|
|
40
|
-
border-radius: ${theme
|
|
35
|
+
border-radius: ${theme.default.radius.circle};
|
|
41
36
|
|
|
42
37
|
&:disabled,
|
|
43
38
|
&[disabled] {
|
|
44
|
-
color: ${theme
|
|
39
|
+
color: ${theme.default.color.text.black};
|
|
45
40
|
}
|
|
46
41
|
`,
|
|
47
|
-
secondary:
|
|
42
|
+
secondary: styled(ButtonSecondary.default) `
|
|
48
43
|
${overrideStyles};
|
|
49
|
-
color: ${theme
|
|
50
|
-
border: 1px solid ${theme
|
|
51
|
-
border-radius: ${theme
|
|
44
|
+
color: ${theme.default.color.text.black};
|
|
45
|
+
border: 1px solid ${theme.default.color.line.L01};
|
|
46
|
+
border-radius: ${theme.default.radius.s};
|
|
52
47
|
|
|
53
48
|
&:focus {
|
|
54
|
-
color: ${theme
|
|
49
|
+
color: ${theme.default.color.text.black};
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
&:hover {
|
|
58
|
-
color: ${theme
|
|
53
|
+
color: ${theme.default.color.text.black};
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
&:active {
|
|
62
|
-
color: ${theme
|
|
63
|
-
border: 1px solid ${theme
|
|
57
|
+
color: ${theme.default.color.text.black};
|
|
58
|
+
border: 1px solid ${theme.default.color.line.L01};
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
&:disabled,
|
|
67
62
|
&[disabled] {
|
|
68
|
-
border: 1px solid ${theme
|
|
63
|
+
border: 1px solid ${theme.default.color.line.L02 + theme.default.color.transparency.T30};
|
|
69
64
|
}
|
|
70
65
|
`,
|
|
71
66
|
};
|
|
@@ -73,7 +68,7 @@ const buttonsMap = {
|
|
|
73
68
|
const ButtonArrow = (_a) => {
|
|
74
69
|
var { variant = 'primary', 'data-testid': dataTestId, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ["variant", 'data-testid', 'data-track-value']);
|
|
75
70
|
const Element = buttonsMap[variant];
|
|
76
|
-
return (
|
|
71
|
+
return (React.createElement(Element, { id: props.id, href: props.href, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, darkBg: props.darkBg, disabled: props.disabled, className: props.className, "data-testid": dataTestId, "data-track-value": dataTrackValue }, props.direction ? (React.createElement(Icon.default, { icon: iconsMap[props.direction], size: "1rem" })) : (React.isValidElement(props.icon) && props.icon.type === Icon.default && props.icon)));
|
|
77
72
|
};
|
|
78
73
|
|
|
79
|
-
exports
|
|
74
|
+
exports.default = ButtonArrow;
|
|
@@ -8,15 +8,11 @@ var styled = require('../../themes/styled.js');
|
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
|
-
const ButtonElement = styled["default"].button `
|
|
11
|
+
const ButtonElement = styled.default.button `
|
|
16
12
|
position: absolute;
|
|
17
13
|
top: 0;
|
|
18
14
|
right: 0;
|
|
19
|
-
margin: ${styledUtils.getMultipliedSize(theme
|
|
15
|
+
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
|
|
20
16
|
display: inline-flex;
|
|
21
17
|
cursor: pointer;
|
|
22
18
|
background: none;
|
|
@@ -26,7 +22,7 @@ const ButtonElement = styled["default"].button `
|
|
|
26
22
|
/** @visibleName Button Close */
|
|
27
23
|
const ButtonClose = (_a) => {
|
|
28
24
|
var { 'data-testid': dataTestId, 'aria-label': ariaLabel } = _a, props = tslib.__rest(_a, ['data-testid', 'aria-label']);
|
|
29
|
-
return (
|
|
25
|
+
return (React.createElement(ButtonElement, { id: props.id, name: props.name, onClick: props.onClick, onMouseDown: props.onMouseDown, className: props.className, "data-testid": dataTestId, "aria-label": ariaLabel }, props.children));
|
|
30
26
|
};
|
|
31
27
|
|
|
32
|
-
exports
|
|
28
|
+
exports.default = ButtonClose;
|