@transferwise/components 0.0.0-experimental-7df8816 → 0.0.0-experimental-d2bc8ee
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/build/common/closeButton/CloseButton.messages.js +2 -2
- package/build/common/closeButton/CloseButton.messages.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.mjs +2 -2
- package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +2 -2
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/drawer/Drawer.js +9 -18
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +9 -18
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/main.css +476 -223
- package/build/modal/Modal.js +21 -20
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +21 -20
- package/build/modal/Modal.mjs.map +1 -1
- package/build/select/Select.js +1 -2
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -2
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/accordion/Accordion.css +2 -6
- package/build/styles/actionButton/ActionButton.css +12 -4
- package/build/styles/avatar/Avatar.css +13 -10
- package/build/styles/avatarView/AvatarView.css +5 -3
- package/build/styles/avatarView/Dot.css +2 -1
- package/build/styles/button/Button.css +1 -0
- package/build/styles/card/Card.css +2 -2
- package/build/styles/carousel/Carousel.css +5 -2
- package/build/styles/checkboxButton/CheckboxButton.css +0 -1
- package/build/styles/chips/Chip.css +31 -12
- package/build/styles/circularButton/CircularButton.css +6 -0
- package/build/styles/common/Option/Option.css +2 -2
- package/build/styles/common/RadioButton/RadioButton.css +1 -1
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
- package/build/styles/common/card/Card.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +7 -2
- package/build/styles/criticalBanner/CriticalCommsBanner.css +4 -0
- package/build/styles/dateLookup/DateLookup.css +5 -3
- package/build/styles/definitionList/DefinitionList.css +1 -1
- package/build/styles/divider/Divider.css +1 -1
- package/build/styles/drawer/Drawer.css +58 -11
- package/build/styles/emphasis/Emphasis.css +4 -5
- package/build/styles/expressiveMoneyInput/ExpressiveMoneyInput.css +2 -0
- package/build/styles/expressiveMoneyInput/amountInput/AmountInput.css +1 -0
- package/build/styles/expressiveMoneyInput/chevron/Chevron.css +1 -0
- package/build/styles/flowNavigation/FlowNavigation.css +2 -1
- package/build/styles/header/Header.css +2 -2
- package/build/styles/iconButton/IconButton.css +27 -4
- package/build/styles/inputs/Input.css +5 -5
- package/build/styles/inputs/InputGroup.css +3 -2
- package/build/styles/inputs/SelectInput.css +14 -13
- package/build/styles/inputs/TextArea.css +5 -5
- package/build/styles/instructionsList/InstructionsList.css +2 -0
- package/build/styles/listItem/ListItem.css +22 -8
- package/build/styles/logo/Logo.css +2 -0
- package/build/styles/main.css +476 -223
- package/build/styles/modal/Modal.css +68 -6
- package/build/styles/moneyInput/MoneyInput.css +2 -2
- package/build/styles/navigationOption/NavigationOption.css +1 -3
- package/build/styles/nudge/Nudge.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +2 -1
- package/build/styles/popover/Popover.css +2 -2
- package/build/styles/progress/Progress.css +3 -3
- package/build/styles/progressBar/ProgressBar.css +2 -2
- package/build/styles/promoCard/PromoCard.css +3 -3
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +39 -3
- package/build/styles/segmentedControl/SegmentedControl.css +6 -2
- package/build/styles/select/Select.css +25 -41
- package/build/styles/slidingPanel/SlidingPanel.css +4 -4
- package/build/styles/snackbar/Snackbar.css +4 -4
- package/build/styles/statusIcon/StatusIcon.css +10 -2
- package/build/styles/stepper/Stepper.css +4 -4
- package/build/styles/summary/Summary.css +5 -2
- package/build/styles/switch/Switch.css +3 -2
- package/build/styles/table/Table.css +13 -5
- package/build/styles/tabs/Tabs.css +10 -9
- package/build/styles/tile/Tile.css +8 -5
- package/build/styles/typeahead/Typeahead.css +2 -1
- package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -4
- package/build/styles/upload/Upload.css +1 -1
- package/build/styles/uploadInput/uploadButton/UploadButton.css +4 -2
- package/build/styles/uploadInput/uploadItem/UploadItem.css +8 -4
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/select/Select.d.ts +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/package.json +12 -7
- package/src/accordion/Accordion.css +2 -6
- package/src/accordion/Accordion.less +0 -7
- package/src/accordion/Accordion.story.tsx +1 -1
- package/src/actionButton/ActionButton.css +12 -4
- package/src/avatar/Avatar.css +13 -10
- package/src/avatarLayout/AvatarLayout.story.tsx +0 -1
- package/src/avatarView/AvatarView.css +5 -3
- package/src/avatarView/AvatarView.story.tsx +0 -1
- package/src/avatarView/Dot.css +2 -1
- package/src/button/Button.css +1 -0
- package/src/card/Card.css +2 -2
- package/src/carousel/Carousel.css +5 -2
- package/src/checkboxButton/CheckboxButton.css +0 -1
- package/src/chips/Chip.css +31 -12
- package/src/circularButton/CircularButton.css +6 -0
- package/src/common/Option/Option.css +2 -2
- package/src/common/RadioButton/RadioButton.css +1 -1
- package/src/common/bottomSheet/BottomSheet.css +1 -1
- package/src/common/card/Card.css +1 -1
- package/src/common/closeButton/CloseButton.css +7 -2
- package/src/criticalBanner/CriticalCommsBanner.css +4 -0
- package/src/dateLookup/DateLookup.css +5 -3
- package/src/definitionList/DefinitionList.css +1 -1
- package/src/display/Display.story.tsx +0 -1
- package/src/divider/Divider.css +1 -1
- package/src/drawer/Drawer.css +58 -11
- package/src/drawer/Drawer.less +70 -14
- package/src/drawer/Drawer.story.tsx +100 -158
- package/src/drawer/Drawer.tsx +7 -26
- package/src/emphasis/Emphasis.css +4 -5
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.css +2 -0
- package/src/expressiveMoneyInput/amountInput/AmountInput.css +1 -0
- package/src/expressiveMoneyInput/chevron/Chevron.css +1 -0
- package/src/flowNavigation/FlowNavigation.css +2 -1
- package/src/header/Header.css +2 -2
- package/src/iconButton/IconButton.css +27 -4
- package/src/iconButton/IconButton.story.tsx +0 -1
- package/src/inputs/Input.css +5 -5
- package/src/inputs/InputGroup.css +3 -2
- package/src/inputs/SelectInput.css +14 -13
- package/src/inputs/TextArea.css +5 -5
- package/src/instructionsList/InstructionsList.css +2 -0
- package/src/listItem/ListItem.css +22 -8
- package/src/logo/Logo.css +2 -0
- package/src/main.css +476 -223
- package/src/modal/Modal.css +68 -6
- package/src/modal/Modal.less +76 -6
- package/src/modal/Modal.tsx +23 -23
- package/src/moneyInput/MoneyInput.css +2 -2
- package/src/navigationOption/NavigationOption.css +1 -3
- package/src/nudge/Nudge.css +1 -1
- package/src/overlayHeader/OverlayHeader.css +2 -1
- package/src/popover/Popover.css +2 -2
- package/src/progress/Progress.css +3 -3
- package/src/progressBar/ProgressBar.css +2 -2
- package/src/promoCard/PromoCard.css +3 -3
- package/src/prompt/InlinePrompt/InlinePrompt.css +39 -3
- package/src/segmentedControl/SegmentedControl.css +6 -2
- package/src/select/Select.css +25 -41
- package/src/select/Select.less +0 -25
- package/src/select/Select.tsx +1 -6
- package/src/slidingPanel/SlidingPanel.css +4 -4
- package/src/snackbar/Snackbar.css +4 -4
- package/src/snackbar/Snackbar.less +2 -4
- package/src/statusIcon/StatusIcon.css +10 -2
- package/src/stepper/Stepper.css +4 -4
- package/src/summary/Summary.css +5 -2
- package/src/switch/Switch.css +3 -2
- package/src/table/Table.css +13 -5
- package/src/tabs/Tabs.css +10 -9
- package/src/tile/Tile.css +8 -5
- package/src/typeahead/Typeahead.css +2 -1
- package/src/typeahead/typeaheadOption/TypeaheadOption.css +1 -4
- package/src/typeahead/typeaheadOption/TypeaheadOption.less +0 -6
- package/src/upload/Upload.css +1 -1
- package/src/uploadInput/uploadButton/UploadButton.css +4 -2
- package/src/uploadInput/uploadItem/UploadItem.css +8 -4
package/src/drawer/Drawer.css
CHANGED
|
@@ -16,41 +16,88 @@
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
.np-drawer .np-drawer-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
flex-wrap: nowrap;
|
|
19
22
|
min-height: 56px;
|
|
20
23
|
min-height: var(--size-56);
|
|
24
|
+
padding: 24px 16px;
|
|
25
|
+
padding: var(--size-24) var(--size-16);
|
|
26
|
+
}
|
|
27
|
+
.np-theme-personal .np-drawer .np-drawer-header {
|
|
21
28
|
padding: 24px;
|
|
22
29
|
padding: var(--size-24);
|
|
23
30
|
}
|
|
24
31
|
@media (max-width: 320px) {
|
|
25
|
-
.np-drawer .np-drawer-header {
|
|
32
|
+
.np-theme-personal .np-drawer .np-drawer-header {
|
|
26
33
|
padding: 16px;
|
|
27
34
|
padding: var(--size-16);
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
|
-
.np-drawer .np-drawer-
|
|
31
|
-
|
|
37
|
+
.np-theme-personal .np-drawer .np-drawer-header .np-close-button {
|
|
38
|
+
margin-top: calc(8px * -1);
|
|
39
|
+
margin-top: calc(var(--size-8) * -1);
|
|
40
|
+
margin-right: calc(8px * -1);
|
|
41
|
+
margin-right: calc(var(--size-8) * -1);
|
|
42
|
+
margin-bottom: calc(8px * -1);
|
|
43
|
+
margin-bottom: calc(var(--size-8) * -1);
|
|
44
|
+
}
|
|
45
|
+
.np-drawer .np-drawer-header.np-drawer-header--withborder {
|
|
46
|
+
box-shadow: inset 0 -1px 0 0 #e2e6e8;
|
|
47
|
+
}
|
|
48
|
+
.np-theme-personal .np-drawer .np-drawer-header.np-drawer-header--withborder {
|
|
49
|
+
box-shadow: inset 0 -1px 0 0 rgba(14,15,12,0.12157);
|
|
50
|
+
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
51
|
+
}
|
|
52
|
+
.np-drawer .np-drawer-header .np-text-title-body {
|
|
53
|
+
margin-right: 16px;
|
|
54
|
+
margin-right: var(--size-16);
|
|
55
|
+
font-size: 1.125rem;
|
|
56
|
+
font-size: var(--font-size-18);
|
|
57
|
+
letter-spacing: -0.01em;
|
|
58
|
+
letter-spacing: var(--letter-spacing-negative-xs);
|
|
59
|
+
line-height: 1.5rem;
|
|
60
|
+
line-height: var(--line-height-24);
|
|
61
|
+
}
|
|
62
|
+
.np-drawer .np-drawer-header .np-close-button {
|
|
63
|
+
margin-left: auto;
|
|
64
|
+
}
|
|
65
|
+
.np-drawer .np-drawer-header .tw-icon {
|
|
66
|
+
display: block;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
fill: #00b9ff;
|
|
32
69
|
}
|
|
33
70
|
.np-drawer .np-drawer-content {
|
|
34
71
|
overflow-y: auto;
|
|
35
72
|
flex: 1;
|
|
73
|
+
}
|
|
74
|
+
.np-drawer .np-drawer-content .np-theme-personal {
|
|
36
75
|
background-color: transparent;
|
|
37
76
|
}
|
|
38
|
-
.np-drawer .np-drawer-footer
|
|
77
|
+
.np-drawer .np-drawer-footer,
|
|
78
|
+
.np-drawer .np-drawer-content {
|
|
39
79
|
padding: 16px;
|
|
40
80
|
padding: var(--size-16);
|
|
41
81
|
}
|
|
42
|
-
.np-drawer .np-drawer-
|
|
43
|
-
|
|
44
|
-
|
|
82
|
+
.np-drawer .np-drawer-footer {
|
|
83
|
+
box-shadow: inset 0 1px 0 0 #e2e6e8;
|
|
84
|
+
}
|
|
85
|
+
.np-theme-personal .np-drawer .np-drawer-footer {
|
|
86
|
+
box-shadow: inset 0 1px 0 0 rgba(14,15,12,0.12157);
|
|
87
|
+
box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
|
|
45
88
|
}
|
|
46
89
|
@media (min-width: 768px) {
|
|
47
|
-
.np-drawer .np-drawer-header
|
|
48
|
-
|
|
90
|
+
.np-drawer .np-drawer-header {
|
|
91
|
+
padding: 32px 24px;
|
|
92
|
+
padding: var(--size-32) var(--size-24);
|
|
93
|
+
}
|
|
94
|
+
.np-theme-personal .np-drawer .np-drawer-header {
|
|
49
95
|
padding: 24px;
|
|
50
96
|
padding: var(--size-24);
|
|
51
97
|
}
|
|
98
|
+
.np-drawer .np-drawer-footer,
|
|
52
99
|
.np-drawer .np-drawer-content {
|
|
53
|
-
padding:
|
|
54
|
-
padding:
|
|
100
|
+
padding: 24px;
|
|
101
|
+
padding: var(--size-24);
|
|
55
102
|
}
|
|
56
103
|
}
|
package/src/drawer/Drawer.less
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@import (reference) "../../node_modules/@transferwise/neptune-css/src/less/addons/_spacing-utilities.less";
|
|
2
|
+
@import (reference) "../../node_modules/@transferwise/neptune-css/src/less/mixins/_logical-properties.less";
|
|
3
|
+
|
|
1
4
|
.np-drawer {
|
|
2
5
|
display: flex;
|
|
3
6
|
flex-direction: column;
|
|
@@ -13,36 +16,89 @@
|
|
|
13
16
|
max-height: 100dvh;
|
|
14
17
|
|
|
15
18
|
.np-drawer-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
flex-wrap: nowrap;
|
|
16
22
|
min-height: var(--size-56);
|
|
17
|
-
padding: var(--size-24);
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
padding: var(--size-24) var(--size-16);
|
|
24
|
+
|
|
25
|
+
.np-theme-personal & {
|
|
26
|
+
padding: var(--size-24);
|
|
27
|
+
@media (--screen-400-zoom) {
|
|
28
|
+
padding: var(--size-16);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.np-close-button {
|
|
32
|
+
@close-btn-margin: calc(var(--size-8) * -1);
|
|
33
|
+
|
|
34
|
+
margin-top: @close-btn-margin;
|
|
35
|
+
margin-right: @close-btn-margin;
|
|
36
|
+
margin-bottom: @close-btn-margin;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.np-drawer-header--withborder {
|
|
41
|
+
box-shadow: inset 0 -1px 0 0 rgb(226 230 232);
|
|
42
|
+
|
|
43
|
+
.np-theme-personal & {
|
|
44
|
+
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.np-text-title-body {
|
|
49
|
+
margin-right: var(--size-16);
|
|
50
|
+
font-size: var(--font-size-18);
|
|
51
|
+
letter-spacing: var(--letter-spacing-negative-xs);
|
|
52
|
+
line-height: var(--line-height-24);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.np-close-button {
|
|
56
|
+
margin-left: auto;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tw-icon {
|
|
60
|
+
display: block;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
fill: rgb(0 185 255);
|
|
20
63
|
}
|
|
21
64
|
}
|
|
22
|
-
|
|
23
|
-
max-width: 85%;
|
|
24
|
-
}
|
|
65
|
+
|
|
25
66
|
.np-drawer-content {
|
|
26
67
|
overflow-y: auto;
|
|
27
68
|
flex: 1;
|
|
28
|
-
|
|
69
|
+
|
|
70
|
+
.np-theme-personal {
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
}
|
|
29
73
|
}
|
|
30
|
-
|
|
74
|
+
|
|
75
|
+
.np-drawer-footer,
|
|
76
|
+
.np-drawer-content {
|
|
31
77
|
padding: var(--size-16);
|
|
32
78
|
}
|
|
33
|
-
|
|
34
|
-
|
|
79
|
+
|
|
80
|
+
.np-drawer-footer {
|
|
81
|
+
box-shadow: inset 0 1px 0 0 rgb(226 230 232);
|
|
82
|
+
|
|
83
|
+
.np-theme-personal & {
|
|
84
|
+
box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
|
|
85
|
+
}
|
|
35
86
|
}
|
|
36
87
|
}
|
|
37
88
|
|
|
38
89
|
@media (--screen-md) {
|
|
39
90
|
.np-drawer {
|
|
40
|
-
.np-drawer-header
|
|
41
|
-
|
|
42
|
-
|
|
91
|
+
.np-drawer-header {
|
|
92
|
+
padding: var(--size-32) var(--size-24);
|
|
93
|
+
|
|
94
|
+
.np-theme-personal & {
|
|
95
|
+
padding: var(--size-24);
|
|
96
|
+
}
|
|
43
97
|
}
|
|
98
|
+
|
|
99
|
+
.np-drawer-footer,
|
|
44
100
|
.np-drawer-content {
|
|
45
|
-
padding:
|
|
101
|
+
padding: var(--size-24);
|
|
46
102
|
}
|
|
47
103
|
}
|
|
48
104
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Position, Priority } from '../common';
|
|
3
|
-
import { Section, Button, Input, Modal, type DrawerProps
|
|
3
|
+
import { Section, Button, Input, Modal, type DrawerProps } from '..';
|
|
4
4
|
import Drawer from './Drawer';
|
|
5
|
-
import { lorem10, lorem20, lorem40, lorem5 } from '../test-utils';
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
component: Drawer,
|
|
@@ -15,167 +14,110 @@ export default {
|
|
|
15
14
|
},
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
export const Basic = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
open: true,
|
|
22
|
-
},
|
|
23
|
-
render: (args: DrawerProps) => {
|
|
24
|
-
const [openDrawer, setOpenDrawer] = useState(args.open);
|
|
25
|
-
const [openModal, setOpenModal] = useState(false);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
<Button v2 disabled={false} block={false} onClick={() => setOpenDrawer(true)}>
|
|
30
|
-
Open drawer
|
|
31
|
-
</Button>
|
|
32
|
-
<Drawer
|
|
33
|
-
open={openDrawer}
|
|
34
|
-
position={args.position}
|
|
35
|
-
headerTitle="This is the title of the drawer"
|
|
36
|
-
footerContent={
|
|
37
|
-
<>
|
|
38
|
-
<Button v2 block className="m-b-1" onClick={() => {}}>
|
|
39
|
-
Action 1
|
|
40
|
-
</Button>
|
|
41
|
-
<Button v2 block priority={Priority.SECONDARY} onClick={() => {}}>
|
|
42
|
-
Action 2
|
|
43
|
-
</Button>
|
|
44
|
-
</>
|
|
45
|
-
}
|
|
46
|
-
onClose={(event) => {
|
|
47
|
-
console.log('drawer close');
|
|
48
|
-
event.stopPropagation();
|
|
49
|
-
setOpenDrawer(false);
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<p>{lorem20}</p>
|
|
53
|
-
<Section className="m-t-2">
|
|
54
|
-
<Input />
|
|
55
|
-
<p className="m-t-3">{lorem5}</p>
|
|
56
|
-
<Button v2 onClick={() => setOpenModal(true)}>
|
|
57
|
-
Open Modal
|
|
58
|
-
</Button>
|
|
59
|
-
<Modal
|
|
60
|
-
body={<p>{lorem40}</p>}
|
|
61
|
-
open={openModal}
|
|
62
|
-
title="Title"
|
|
63
|
-
onClose={() => {
|
|
64
|
-
console.log('modal close');
|
|
65
|
-
setOpenModal(false);
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
</Section>
|
|
69
|
-
<p>{lorem40}</p>
|
|
70
|
-
<p>{lorem40}</p>
|
|
71
|
-
<p>{lorem40}</p>
|
|
72
|
-
<p>{lorem40}</p>
|
|
73
|
-
<p>{lorem40}</p>
|
|
74
|
-
<p>{lorem40}</p>
|
|
75
|
-
</Drawer>
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
78
|
-
},
|
|
79
|
-
};
|
|
17
|
+
export const Basic = (args: DrawerProps) => {
|
|
18
|
+
const [openDrawer, setOpenDrawer] = useState(false);
|
|
19
|
+
const [openModal, setOpenModal] = useState(false);
|
|
80
20
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<Drawer
|
|
93
|
-
open={openDrawer}
|
|
94
|
-
headerTitle={lorem10}
|
|
95
|
-
footerContent={
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<Button v2 disabled={false} block={false} onClick={() => setOpenDrawer(true)}>
|
|
24
|
+
Open drawer
|
|
25
|
+
</Button>
|
|
26
|
+
<Drawer
|
|
27
|
+
open={openDrawer}
|
|
28
|
+
position={args.position}
|
|
29
|
+
headerTitle="This is the title of the drawer"
|
|
30
|
+
footerContent={
|
|
31
|
+
<>
|
|
96
32
|
<Button v2 block onClick={() => {}}>
|
|
97
33
|
Action 1
|
|
98
34
|
</Button>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setOpenDrawer(false);
|
|
102
|
-
}}
|
|
103
|
-
>
|
|
104
|
-
<p>{lorem20}</p>
|
|
105
|
-
<p>{lorem40}</p>
|
|
106
|
-
<p>{lorem40}</p>
|
|
107
|
-
<p>{lorem40}</p>
|
|
108
|
-
<p>{lorem40}</p>
|
|
109
|
-
<p>{lorem40}</p>
|
|
110
|
-
<p>{lorem40}</p>
|
|
111
|
-
</Drawer>
|
|
112
|
-
</>
|
|
113
|
-
);
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const NoTitle = {
|
|
118
|
-
args: {
|
|
119
|
-
open: true,
|
|
120
|
-
},
|
|
121
|
-
render: (args: DrawerProps) => {
|
|
122
|
-
const [openDrawer, setOpenDrawer] = useState(args.open);
|
|
123
|
-
return (
|
|
124
|
-
<>
|
|
125
|
-
<Button v2 block={false} onClick={() => setOpenDrawer(true)}>
|
|
126
|
-
Open drawer
|
|
127
|
-
</Button>
|
|
128
|
-
<Drawer
|
|
129
|
-
open={openDrawer}
|
|
130
|
-
footerContent={
|
|
131
|
-
<Button v2 block onClick={() => {}}>
|
|
132
|
-
Action 1
|
|
35
|
+
<Button v2 block priority={Priority.SECONDARY} onClick={() => {}}>
|
|
36
|
+
Action 2
|
|
133
37
|
</Button>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
38
|
+
</>
|
|
39
|
+
}
|
|
40
|
+
onClose={(event) => {
|
|
41
|
+
console.log('drawer close');
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
setOpenDrawer(false);
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<p>
|
|
47
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
48
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
49
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
50
|
+
stumptown try-hard chartreuse.
|
|
51
|
+
</p>
|
|
52
|
+
<Section className="m-t-2">
|
|
53
|
+
<Input />
|
|
54
|
+
<p className="m-t-3">Cat ipsum dolor sit amet, purr when being pet.</p>
|
|
55
|
+
<Button v2 onClick={() => setOpenModal(true)}>
|
|
56
|
+
Open Modal
|
|
57
|
+
</Button>
|
|
58
|
+
<Modal
|
|
59
|
+
body={
|
|
60
|
+
<p className="m-t-4">
|
|
61
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray
|
|
62
|
+
activated charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo,
|
|
63
|
+
cliche lyft marfa ethical waistcoat poke jean shorts. Scenester readymade selvage
|
|
64
|
+
disrupt pok pok. La croix stumptown try-hard chartreuse. I am baby actually poke
|
|
65
|
+
kickstarter, street art jean shorts bespoke chambray activated charcoal ramps marfa
|
|
66
|
+
shoreditch tumeric, I am baby actually poke kickstarter, street art jean shorts
|
|
67
|
+
bespoke chambray activated charcoal ramps marfa shoreditch tumeric tumblr. Mixtape
|
|
68
|
+
cred palo santo, cliche lyft marfa ethical waistcoat poke jean shorts. Scenester
|
|
69
|
+
readymade selvage disrupt pok pok.
|
|
70
|
+
</p>
|
|
71
|
+
}
|
|
72
|
+
open={openModal}
|
|
73
|
+
title="Title"
|
|
74
|
+
onClose={() => {
|
|
75
|
+
console.log('modal close');
|
|
76
|
+
setOpenModal(false);
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
</Section>
|
|
80
|
+
<p>
|
|
81
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
82
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
83
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
84
|
+
stumptown try-hard chartreuse.
|
|
85
|
+
</p>
|
|
86
|
+
<p>
|
|
87
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
88
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
89
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
90
|
+
stumptown try-hard chartreuse.
|
|
91
|
+
</p>
|
|
92
|
+
<p>
|
|
93
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
94
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
95
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
96
|
+
stumptown try-hard chartreuse.
|
|
97
|
+
</p>
|
|
98
|
+
<p>
|
|
99
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
100
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
101
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
102
|
+
stumptown try-hard chartreuse.
|
|
103
|
+
</p>
|
|
104
|
+
<p>
|
|
105
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
106
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
107
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
108
|
+
stumptown try-hard chartreuse.
|
|
109
|
+
</p>
|
|
110
|
+
<p>
|
|
111
|
+
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
112
|
+
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
113
|
+
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
114
|
+
stumptown try-hard chartreuse.
|
|
115
|
+
</p>
|
|
116
|
+
</Drawer>
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
150
119
|
};
|
|
151
120
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
open: true,
|
|
155
|
-
},
|
|
156
|
-
render: (args: DrawerProps) => {
|
|
157
|
-
const [openDrawer, setOpenDrawer] = useState(args.open);
|
|
158
|
-
return (
|
|
159
|
-
<>
|
|
160
|
-
<Button v2 block={false} onClick={() => setOpenDrawer(true)}>
|
|
161
|
-
Open drawer
|
|
162
|
-
</Button>
|
|
163
|
-
<Drawer
|
|
164
|
-
open={openDrawer}
|
|
165
|
-
headerTitle="This is the title of the drawer"
|
|
166
|
-
onClose={() => {
|
|
167
|
-
setOpenDrawer(false);
|
|
168
|
-
}}
|
|
169
|
-
>
|
|
170
|
-
<p>{lorem20}</p>
|
|
171
|
-
<p>{lorem40}</p>
|
|
172
|
-
<p>{lorem40}</p>
|
|
173
|
-
<p>{lorem40}</p>
|
|
174
|
-
<p>{lorem40}</p>
|
|
175
|
-
<p>{lorem40}</p>
|
|
176
|
-
<Body>{lorem40}</Body>
|
|
177
|
-
</Drawer>
|
|
178
|
-
</>
|
|
179
|
-
);
|
|
180
|
-
},
|
|
121
|
+
Basic.args = {
|
|
122
|
+
position: Position.RIGHT,
|
|
181
123
|
};
|
package/src/drawer/Drawer.tsx
CHANGED
|
@@ -2,16 +2,13 @@ import { clsx } from 'clsx';
|
|
|
2
2
|
import { HTMLAttributes, useContext, useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Position, Typography } from '../common';
|
|
5
|
+
import { CloseButton } from '../common/closeButton';
|
|
5
6
|
import { useLayout } from '../common/hooks';
|
|
6
7
|
import Dimmer from '../dimmer';
|
|
7
8
|
import { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';
|
|
8
9
|
import SlidingPanel from '../slidingPanel';
|
|
9
10
|
import Title from '../title';
|
|
10
11
|
import { logActionRequiredIf } from '../utilities';
|
|
11
|
-
import IconButton from '../iconButton';
|
|
12
|
-
import closeBtnMessages from '../common/closeButton/CloseButton.messages';
|
|
13
|
-
import { useIntl } from 'react-intl';
|
|
14
|
-
import { Cross } from '@transferwise/icons';
|
|
15
12
|
|
|
16
13
|
export type DrawerProps = {
|
|
17
14
|
/** The content to appear in the drawer body. */
|
|
@@ -42,7 +39,6 @@ export default function Drawer({
|
|
|
42
39
|
role = 'dialog',
|
|
43
40
|
'aria-labelledby': ariaLabelledBy,
|
|
44
41
|
}: DrawerProps) {
|
|
45
|
-
const intl = useIntl();
|
|
46
42
|
logActionRequiredIf(
|
|
47
43
|
'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',
|
|
48
44
|
!onClose,
|
|
@@ -64,34 +60,19 @@ export default function Drawer({
|
|
|
64
60
|
className={clsx('np-drawer', className)}
|
|
65
61
|
>
|
|
66
62
|
<div
|
|
67
|
-
className={clsx(
|
|
68
|
-
'np-drawer-header',
|
|
69
|
-
|
|
70
|
-
'align-items-center',
|
|
71
|
-
headerTitle ? 'justify-content-between' : 'justify-content-end',
|
|
72
|
-
'flex-wrap',
|
|
73
|
-
)}
|
|
63
|
+
className={clsx('np-drawer-header', {
|
|
64
|
+
'np-drawer-header--withborder': headerTitle,
|
|
65
|
+
})}
|
|
74
66
|
>
|
|
75
67
|
{headerTitle && (
|
|
76
|
-
<Title id={titleId} type={Typography.
|
|
68
|
+
<Title id={titleId} type={Typography.TITLE_BODY}>
|
|
77
69
|
{headerTitle}
|
|
78
70
|
</Title>
|
|
79
71
|
)}
|
|
80
|
-
<
|
|
81
|
-
size={40}
|
|
82
|
-
priority="tertiary"
|
|
83
|
-
aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}
|
|
84
|
-
onClick={onClose}
|
|
85
|
-
>
|
|
86
|
-
<Cross />
|
|
87
|
-
</IconButton>
|
|
72
|
+
<CloseButton onClick={onClose} />
|
|
88
73
|
</div>
|
|
89
74
|
{children && <div className={clsx('np-drawer-content')}>{children}</div>}
|
|
90
|
-
{footerContent
|
|
91
|
-
<div className={clsx('np-drawer-footer')}>{footerContent}</div>
|
|
92
|
-
) : (
|
|
93
|
-
<div className="m-t-3" />
|
|
94
|
-
)}
|
|
75
|
+
{footerContent && <div className={clsx('np-drawer-footer')}>{footerContent}</div>}
|
|
95
76
|
</div>
|
|
96
77
|
</SlidingPanel>
|
|
97
78
|
</Dimmer>
|
|
@@ -4,28 +4,27 @@
|
|
|
4
4
|
font-style: normal;
|
|
5
5
|
}
|
|
6
6
|
.emphasis--important {
|
|
7
|
-
color: #
|
|
7
|
+
color: #0e0f0c;
|
|
8
8
|
color: var(--color-content-primary);
|
|
9
9
|
}
|
|
10
10
|
.emphasis--positive {
|
|
11
|
-
color: #008026;
|
|
12
11
|
color: var(--color-content-positive);
|
|
13
12
|
}
|
|
14
13
|
.np-theme-personal .emphasis--positive {
|
|
14
|
+
color: #054d28;
|
|
15
15
|
color: var(--color-sentiment-positive);
|
|
16
16
|
}
|
|
17
17
|
.emphasis--negative {
|
|
18
|
-
color: #cf2929;
|
|
19
18
|
color: var(--color-content-negative);
|
|
20
19
|
}
|
|
21
20
|
.np-theme-personal .emphasis--negative {
|
|
21
|
+
color: #cb272f;
|
|
22
22
|
color: var(--color-sentiment-negative);
|
|
23
23
|
}
|
|
24
24
|
.emphasis--warning {
|
|
25
|
-
color: #9a6500;
|
|
26
25
|
color: var(--color-content-warning);
|
|
27
26
|
}
|
|
28
27
|
.np-theme-personal .emphasis--warning {
|
|
29
|
-
color: #
|
|
28
|
+
color: #454745;
|
|
30
29
|
color: var(--color-content-secondary);
|
|
31
30
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
justify-content: right;
|
|
7
7
|
width: 100%;
|
|
8
8
|
transition: font-size 0.4s cubic-bezier(0.3, 0, 0.1, 1), height 0.4s cubic-bezier(0.3, 0, 0.1, 1), margin-top 0.4s cubic-bezier(0.3, 0, 0.1, 1), color 0.4s ease;
|
|
9
|
+
color: #163300;
|
|
9
10
|
color: var(--color-interactive-primary);
|
|
10
11
|
overflow: hidden;
|
|
11
12
|
margin-bottom: 0 !important;
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
width: 32px;
|
|
41
42
|
width: var(--size-32);
|
|
42
43
|
overflow: hidden;
|
|
44
|
+
color: #163300;
|
|
43
45
|
color: var(--color-interactive-primary);
|
|
44
46
|
margin-left: 8px;
|
|
45
47
|
margin-left: var(--size-8);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
justify-content: right;
|
|
7
7
|
width: 100%;
|
|
8
8
|
transition: font-size 0.4s cubic-bezier(0.3, 0, 0.1, 1), height 0.4s cubic-bezier(0.3, 0, 0.1, 1), margin-top 0.4s cubic-bezier(0.3, 0, 0.1, 1), color 0.4s ease;
|
|
9
|
+
color: #163300;
|
|
9
10
|
color: var(--color-interactive-primary);
|
|
10
11
|
overflow: hidden;
|
|
11
12
|
margin-bottom: 0 !important;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
}
|
|
5
5
|
.np-flow-navigation--border-bottom {
|
|
6
6
|
min-height: 96px;
|
|
7
|
-
border-bottom: 1px solid rgba(
|
|
7
|
+
border-bottom: 1px solid rgba(14,15,12,0.12157);
|
|
8
8
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
9
9
|
}
|
|
10
10
|
.np-flow-navigation__content {
|
|
@@ -72,5 +72,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
72
72
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
73
73
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
74
74
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
75
|
+
fill: #163300;
|
|
75
76
|
fill: var(--color-interactive-primary);
|
|
76
77
|
}
|
package/src/header/Header.css
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
}
|
|
18
18
|
.np-header--group {
|
|
19
19
|
align-items: flex-end;
|
|
20
|
-
border-bottom: 1px solid rgba(
|
|
20
|
+
border-bottom: 1px solid rgba(14,15,12,0.12157);
|
|
21
21
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
22
22
|
}
|
|
23
23
|
.np-header--group,
|
|
24
24
|
.np-header--group .np-header__title {
|
|
25
|
-
color: #
|
|
25
|
+
color: #454745;
|
|
26
26
|
color: var(--color-content-secondary);
|
|
27
27
|
}
|
|
28
28
|
.np-header__action {
|