@transferwise/components 0.0.0-experimental-63cdd4d → 0.0.0-experimental-0f1fe62
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/index.esm.js +152 -164
- package/build/index.esm.js.map +1 -1
- package/build/index.js +152 -164
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/chips/Chip.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- package/build/styles/statusIcon/StatusIcon.css +1 -1
- package/build/styles/summary/Summary.css +1 -1
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/styles/uploadInput/UploadInput.css +1 -1
- package/build/types/chips/Chip.d.ts +3 -2
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts +4 -2
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/propsValues/breakpoint.d.ts +0 -1
- package/build/types/common/propsValues/breakpoint.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +1 -11
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/actionButton/ActionButton.css +1 -1
- package/src/actionButton/ActionButton.less +1 -5
- package/src/chips/Chip.css +1 -1
- package/src/chips/Chip.less +42 -32
- package/src/chips/Chip.tsx +15 -1
- package/src/chips/Chips.tsx +5 -1
- package/src/chips/__snapshots__/Chips.spec.tsx.snap +8 -8
- package/src/circularButton/CircularButton.css +1 -1
- package/src/circularButton/CircularButton.less +3 -9
- package/src/common/Option/Option.css +1 -1
- package/src/common/Option/Option.less +0 -6
- package/src/common/bottomSheet/BottomSheet.css +1 -1
- package/src/common/bottomSheet/BottomSheet.less +1 -1
- package/src/common/bottomSheet/BottomSheet.spec.tsx +1 -4
- package/src/common/bottomSheet/BottomSheet.story.tsx +0 -4
- package/src/common/bottomSheet/BottomSheet.tsx +1 -10
- package/src/common/closeButton/CloseButton.css +1 -1
- package/src/common/closeButton/CloseButton.less +0 -12
- package/src/common/hooks/useMedia.spec.ts +17 -3
- package/src/common/propsValues/breakpoint.ts +0 -1
- package/src/dateLookup/DateLookup.css +1 -1
- package/src/dateLookup/DateLookup.js +3 -7
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +0 -3
- package/src/dateLookup/DateLookup.less +0 -6
- package/src/dateLookup/DateLookup.story.js +1 -6
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +1 -3
- package/src/dateLookup/DateLookup.view.spec.js +0 -4
- package/src/dateLookup/dateHeader/DateHeader.js +2 -4
- package/src/drawer/Drawer.css +1 -1
- package/src/drawer/Drawer.less +0 -6
- package/src/drawer/Drawer.story.js +2 -42
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/main.css +1 -1
- package/src/modal/Modal.tsx +2 -2
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/popover/Popover.spec.js +1 -3
- package/src/select/Select.spec.js +9 -6
- package/src/statusIcon/StatusIcon.css +1 -1
- package/src/statusIcon/StatusIcon.less +0 -10
- package/src/summary/Summary.css +1 -1
- package/src/summary/Summary.less +1 -1
- package/src/test-utils/index.js +0 -1
- package/src/test-utils/story-config.ts +7 -21
- package/src/typeahead/Typeahead.css +1 -1
- package/src/typeahead/Typeahead.less +6 -5
- package/src/uploadInput/UploadInput.css +1 -1
- package/src/uploadInput/UploadInput.less +1 -5
- package/build/types/test-utils/window-mock.d.ts +0 -2
- package/build/types/test-utils/window-mock.d.ts.map +0 -1
- package/src/test-utils/window-mock.ts +0 -19
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { render
|
|
1
|
+
import { render } from '../../test-utils';
|
|
2
2
|
|
|
3
3
|
import BottomSheet from './BottomSheet';
|
|
4
4
|
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
6
|
-
mockMatchMedia();
|
|
7
|
-
|
|
8
5
|
describe('BottomSheet', () => {
|
|
9
6
|
it('renders content when open', () => {
|
|
10
7
|
const { baseElement } = render(
|
|
@@ -105,7 +105,3 @@ export const WithOverflowContentDark: Story = storyConfig(WithOverflowContent, {
|
|
|
105
105
|
export const WithOverflowContentDarkMobile: Story = storyConfig(WithOverflowContent, {
|
|
106
106
|
variants: ['dark', 'mobile'],
|
|
107
107
|
});
|
|
108
|
-
|
|
109
|
-
export const WithOverflowContentZoom400: Story = storyConfig(WithOverflowContent, {
|
|
110
|
-
variants: ['400%'],
|
|
111
|
-
});
|
|
@@ -9,14 +9,11 @@ import {
|
|
|
9
9
|
} from 'react';
|
|
10
10
|
|
|
11
11
|
import Dimmer from '../../dimmer';
|
|
12
|
-
import Drawer from '../../drawer';
|
|
13
12
|
import SlidingPanel from '../../slidingPanel';
|
|
14
13
|
import { CloseButton } from '../closeButton';
|
|
15
14
|
import { CommonProps } from '../commonProps';
|
|
16
15
|
import { isServerSide } from '../domHelpers';
|
|
17
16
|
import { useConditionalListener } from '../hooks';
|
|
18
|
-
import { useMedia } from '../hooks/useMedia';
|
|
19
|
-
import { Breakpoint } from '../propsValues/breakpoint';
|
|
20
17
|
import { Position } from '../propsValues/position';
|
|
21
18
|
|
|
22
19
|
const INITIAL_Y_POSITION = 0;
|
|
@@ -170,13 +167,7 @@ const BottomSheet = (props: Props): ReactElement => {
|
|
|
170
167
|
};
|
|
171
168
|
}
|
|
172
169
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return is400Zoom ? (
|
|
176
|
-
<Drawer open={props.open} className={props.className} onClose={close}>
|
|
177
|
-
{props.children}
|
|
178
|
-
</Drawer>
|
|
179
|
-
) : (
|
|
170
|
+
return (
|
|
180
171
|
<Dimmer open={props.open} fadeContentOnEnter fadeContentOnExit onClose={close}>
|
|
181
172
|
{/* @ts-expect-error remove when SlidingPanel will be written on TS */}
|
|
182
173
|
<SlidingPanel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-close-button{--ring-outline-offset:0;background:none;border:none;color:#00a2dd;color:var(--color-interactive-accent);height:16px;height:var(--size-16);padding:0;transition:color .15s ease-in-out}.np-close-button--large,.np-close-button--x-large{height:24px;height:var(--size-24)}.np-close-button:hover{color:#008fc9;color:var(--color-interactive-accent-hover)}.np-theme-personal .np-close-button{align-items:center;border-radius:9999px;border-radius:var(--radius-full);color:var(--color-interactive-primary);display:inline-flex;height:32px;height:var(--size-32);justify-content:center;transition:background-color .1s ease;width:32px;width:var(--size-32)}
|
|
1
|
+
.np-close-button{--ring-outline-offset:0;background:none;border:none;color:#00a2dd;color:var(--color-interactive-accent);height:16px;height:var(--size-16);padding:0;transition:color .15s ease-in-out}.np-close-button--large,.np-close-button--x-large{height:24px;height:var(--size-24)}.np-close-button:hover{color:#008fc9;color:var(--color-interactive-accent-hover)}.np-theme-personal .np-close-button{align-items:center;border-radius:9999px;border-radius:var(--radius-full);color:var(--color-interactive-primary);display:inline-flex;height:32px;height:var(--size-32);justify-content:center;transition:background-color .1s ease;width:32px;width:var(--size-32)}.np-theme-personal .np-close-button--large{flex-shrink:0;height:40px;height:var(--size-40);width:40px;width:var(--size-40)}.np-theme-personal .np-close-button--x-large{flex-shrink:0;height:48px;height:var(--size-48);width:48px;width:var(--size-48)}.np-theme-personal .np-close-button:not(.disabled,:disabled):hover{background-color:var(--color-background-neutral-hover);color:var(--color-interactive-primary-hover)}.np-theme-personal .np-close-button:not(.disabled,:disabled):active{background-color:var(--color-background-neutral-active);color:var(--color-interactive-primary-active)}
|
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
color: var(--color-interactive-primary);
|
|
24
24
|
height: var(--size-32);
|
|
25
25
|
width: var(--size-32);
|
|
26
|
-
@media (--screen-400-zoom) {
|
|
27
|
-
height: var(--size-64);
|
|
28
|
-
width: var(--size-64);
|
|
29
|
-
}
|
|
30
26
|
display: inline-flex;
|
|
31
27
|
align-items: center;
|
|
32
28
|
justify-content: center;
|
|
@@ -36,20 +32,12 @@
|
|
|
36
32
|
&--large {
|
|
37
33
|
height: var(--size-40);
|
|
38
34
|
width: var(--size-40);
|
|
39
|
-
@media (--screen-400-zoom) {
|
|
40
|
-
height: var(--size-80);
|
|
41
|
-
width: var(--size-80);
|
|
42
|
-
}
|
|
43
35
|
flex-shrink: 0;
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
&--x-large {
|
|
47
39
|
height: var(--size-48);
|
|
48
40
|
width: var(--size-48);
|
|
49
|
-
@media (--screen-400-zoom) {
|
|
50
|
-
height: var(--size-96);
|
|
51
|
-
width: var(--size-96);
|
|
52
|
-
}
|
|
53
41
|
flex-shrink: 0;
|
|
54
42
|
}
|
|
55
43
|
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { renderHook } from '@testing-library/react-hooks';
|
|
2
2
|
|
|
3
|
-
import { mockMatchMedia } from '../../test-utils/window-mock';
|
|
4
|
-
|
|
5
3
|
import { useMedia } from './useMedia';
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
6
|
+
writable: true,
|
|
7
|
+
value: jest.fn().mockImplementation((query: string) => {
|
|
8
|
+
const matches = /^\(min-width: ([0-9]+)px\)$/.exec(query);
|
|
9
|
+
const minWidth = matches != null ? Number(matches[1]) : undefined;
|
|
10
|
+
return {
|
|
11
|
+
matches: minWidth != null ? window.innerWidth >= minWidth : false,
|
|
12
|
+
media: query,
|
|
13
|
+
onchange: null,
|
|
14
|
+
addListener: jest.fn(), // deprecated
|
|
15
|
+
removeListener: jest.fn(), // deprecated
|
|
16
|
+
addEventListener: jest.fn(),
|
|
17
|
+
removeEventListener: jest.fn(),
|
|
18
|
+
dispatchEvent: jest.fn(),
|
|
19
|
+
};
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
8
22
|
|
|
9
23
|
describe('useMedia', () => {
|
|
10
24
|
it('tracks changes of window size', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.tw-date-lookup-menu{width:400px}.tw-date-lookup-calendar{min-width:300px;table-layout:fixed;text-align:center}.tw-date-lookup-calendar>tbody>tr>td{padding:4px;padding:var(--size-4)}
|
|
1
|
+
.tw-date-lookup-menu{width:400px}.tw-date-lookup-calendar{min-width:300px;table-layout:fixed;text-align:center}.tw-date-lookup-calendar>tbody>tr>td{padding:4px;padding:var(--size-4)}.tw-date-lookup-calendar>tbody>tr>td button{background-color:transparent;border:transparent;border-radius:10px;border-radius:var(--radius-small);color:#0097c7;color:var(--color-content-accent);font-weight:600;font-weight:var(--font-weight-semi-bold);padding:4px 0;padding:var(--size-4) 0;width:100%}.tw-date-lookup-calendar>tbody>tr>td button:not(.disabled,:disabled).active{background-color:#0081ba;background-color:var(--color-interactive-accent-active);color:#fff}.tw-date-lookup-calendar>tbody>tr>td button:not(.disabled,:disabled):hover{background-color:#008fc9;background-color:var(--color-interactive-accent-hover);color:#fff}.np-theme-personal .tw-date-lookup-calendar>tbody>tr>td button{color:#37517e;color:var(--color-content-primary)}.np-theme-personal .tw-date-lookup-calendar>tbody>tr>td button:not(.disabled,:disabled).active,.np-theme-personal .tw-date-lookup-calendar>tbody>tr>td button:not(.disabled,:disabled):hover{color:var(--color-interactive-control)}.np-theme-personal .tw-date-lookup-calendar>tbody>tr>td:nth-child(7n+6) button,.np-theme-personal .tw-date-lookup-calendar>tbody>tr>td:nth-child(7n+7) button,.np-theme-personal .tw-date-lookup-calendar>thead>tr>th:nth-child(7n+6),.np-theme-personal .tw-date-lookup-calendar>thead>tr>th:nth-child(7n+7){color:#5d7079;color:var(--color-content-secondary);font-weight:400;font-weight:var(--font-weight-regular)}.tw-date-lookup-calendar abbr{text-decoration:none}.np-theme-personal .tw-date-lookup-calendar{background-color:inherit}.np-theme-personal .tw-date-lookup-menu .table-bordered,.np-theme-personal.tw-date-lookup-menu .table-bordered{border:none}.np-theme-personal .tw-date-lookup-menu thead,.np-theme-personal.tw-date-lookup-menu thead{background-color:unset}.np-theme-personal .tw-date-lookup-menu td,.np-theme-personal.tw-date-lookup-menu td{border:none}.np-theme-personal .tw-date-lookup-menu .tw-date-lookup-header-current-container,.np-theme-personal.tw-date-lookup-menu .tw-date-lookup-header-current-container{display:inline-block}.np-theme-personal .tw-date-lookup-menu .tw-date-lookup-header-current-container .tw-date-lookup-header-current,.np-theme-personal.tw-date-lookup-menu .tw-date-lookup-header-current-container .tw-date-lookup-header-current{color:#37517e;color:var(--color-content-primary)}.np-theme-personal .tw-date-lookup-menu .tw-date-lookup-day-option,.np-theme-personal.tw-date-lookup-menu .tw-date-lookup-day-option{align-items:center;color:#37517e;color:var(--color-content-primary);display:inline-flex;height:32px;height:var(--size-32);justify-content:center;line-height:32px;line-height:var(--size-32)}.np-theme-personal .tw-date-lookup-menu .tw-date-lookup-day-option.active,.np-theme-personal.tw-date-lookup-menu .tw-date-lookup-day-option.active{background-color:#00a2dd;background-color:var(--color-interactive-accent);color:var(--color-interactive-primary)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import { createRef, PureComponent } from 'react';
|
|
4
3
|
|
|
5
|
-
import { Size, MonthFormat, Position
|
|
4
|
+
import { Size, MonthFormat, Position } from '../common';
|
|
6
5
|
import { isWithinRange, moveToWithinRange } from '../common/dateUtils';
|
|
7
6
|
import KeyCodes from '../common/keyCodes';
|
|
8
7
|
import ResponsivePanel from '../common/responsivePanel';
|
|
@@ -34,7 +33,6 @@ class DateLookup extends PureComponent {
|
|
|
34
33
|
viewYear: (props.value || new Date()).getFullYear(),
|
|
35
34
|
open: false,
|
|
36
35
|
mode: MODE.DAY,
|
|
37
|
-
isMobile: false,
|
|
38
36
|
};
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -65,8 +63,6 @@ class DateLookup extends PureComponent {
|
|
|
65
63
|
if (+this.props.value !== +previousProps.value && this.state.open) {
|
|
66
64
|
this.focusOn('.active');
|
|
67
65
|
}
|
|
68
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${Breakpoint.SMALL}px)`);
|
|
69
|
-
this.setState({ isMobile: this.mediaQuery.matches });
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
componentWillUnmount() {
|
|
@@ -187,10 +183,10 @@ class DateLookup extends PureComponent {
|
|
|
187
183
|
};
|
|
188
184
|
|
|
189
185
|
getCalendar = () => {
|
|
190
|
-
const { selectedDate, min, max, viewMonth, viewYear, mode
|
|
186
|
+
const { selectedDate, min, max, viewMonth, viewYear, mode } = this.state;
|
|
191
187
|
const { placeholder, monthFormat } = this.props;
|
|
192
188
|
return (
|
|
193
|
-
<div className=
|
|
189
|
+
<div className="p-a-1">
|
|
194
190
|
{mode === MODE.DAY && (
|
|
195
191
|
<DayCalendar
|
|
196
192
|
{...{ selectedDate, min, max, viewMonth, viewYear, monthFormat }}
|
|
@@ -3,12 +3,9 @@ import { mount } from 'enzyme';
|
|
|
3
3
|
|
|
4
4
|
import { fakeKeyDownEventForKey } from '../common/fakeEvents';
|
|
5
5
|
import KEY_CODES from '../common/keyCodes';
|
|
6
|
-
import { mockMatchMedia } from '../test-utils';
|
|
7
6
|
|
|
8
7
|
import DateLookup from '.';
|
|
9
8
|
|
|
10
|
-
mockMatchMedia();
|
|
11
|
-
|
|
12
9
|
const defaultLocale = 'en-GB';
|
|
13
10
|
const formatMessage = (id) => `${id}`;
|
|
14
11
|
jest.mock('react-intl', () => ({
|
|
@@ -11,16 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
> tbody > tr > td {
|
|
13
13
|
padding: var(--size-4);
|
|
14
|
-
@media (--screen-400-zoom) {
|
|
15
|
-
padding: 0;
|
|
16
|
-
}
|
|
17
14
|
|
|
18
15
|
button {
|
|
19
16
|
width: 100%;
|
|
20
17
|
padding: var(--size-4) 0;
|
|
21
|
-
@media (--screen-400-zoom) {
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
18
|
color: var(--color-content-accent);
|
|
25
19
|
border: transparent;
|
|
26
20
|
border-radius: var(--radius-small);
|
|
@@ -2,7 +2,7 @@ import { boolean, select, date, text } from '@storybook/addon-knobs';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Size } from '../common';
|
|
5
|
-
import { within, userEvent
|
|
5
|
+
import { within, userEvent } from '../test-utils';
|
|
6
6
|
|
|
7
7
|
import DateLookup from './DateLookup';
|
|
8
8
|
|
|
@@ -47,11 +47,6 @@ Basic.play = ({ canvasElement }) => {
|
|
|
47
47
|
userEvent.click(canvas.getByRole('button'));
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
export const Basic400Zoom = storyConfig(
|
|
51
|
-
{ render: Basic, play: Basic.play, parameters: { chromatic: { deplay: 4000 } } },
|
|
52
|
-
{ variants: ['400%'] },
|
|
53
|
-
);
|
|
54
|
-
|
|
55
50
|
export const RightAligned = () => {
|
|
56
51
|
const [value, setValue] = useState(null);
|
|
57
52
|
const disabled = boolean('disabled', false);
|
|
@@ -2,12 +2,10 @@ import '@testing-library/jest-dom';
|
|
|
2
2
|
import user from '@testing-library/user-event';
|
|
3
3
|
|
|
4
4
|
import { Breakpoint } from '../common';
|
|
5
|
-
import { render, screen, fireEvent
|
|
5
|
+
import { render, screen, fireEvent } from '../test-utils';
|
|
6
6
|
|
|
7
7
|
import DateLookup from '.';
|
|
8
8
|
|
|
9
|
-
mockMatchMedia();
|
|
10
|
-
|
|
11
9
|
jest.mock(
|
|
12
10
|
'../dimmer',
|
|
13
11
|
() =>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { shallow } from 'enzyme';
|
|
2
2
|
|
|
3
|
-
import { mockMatchMedia } from '../test-utils';
|
|
4
|
-
|
|
5
3
|
import DateTrigger from './dateTrigger';
|
|
6
4
|
import DayCalendar from './dayCalendar';
|
|
7
5
|
import MonthCalendar from './monthCalendar';
|
|
@@ -9,8 +7,6 @@ import YearCalendar from './yearCalendar';
|
|
|
9
7
|
|
|
10
8
|
import DateLookup from '.';
|
|
11
9
|
|
|
12
|
-
mockMatchMedia();
|
|
13
|
-
|
|
14
10
|
const defaultLocale = 'en-GB';
|
|
15
11
|
jest.mock('react-intl', () => ({
|
|
16
12
|
injectIntl: (Component) =>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import { useIntl } from 'react-intl';
|
|
4
3
|
|
|
5
4
|
import Chevron from '../../chevron';
|
|
6
5
|
import { Position, Size, Typography } from '../../common';
|
|
7
|
-
import { useLayout } from '../../common/hooks';
|
|
8
6
|
import Title from '../../title';
|
|
9
7
|
import messages from '../DateLookup.messages';
|
|
10
8
|
|
|
@@ -12,9 +10,9 @@ const buttonClasses = 'btn-link p-a-0 text-no-decoration np-text-body-large-bold
|
|
|
12
10
|
|
|
13
11
|
const DateHeader = ({ label, onLabelClick, onPreviousClick, onNextClick, dateMode }) => {
|
|
14
12
|
const intl = useIntl();
|
|
15
|
-
|
|
13
|
+
|
|
16
14
|
return (
|
|
17
|
-
<div className=
|
|
15
|
+
<div className="text-xs-center p-t-1 p-b-2 clearfix">
|
|
18
16
|
<div className="pull-left-single-direction">
|
|
19
17
|
<button
|
|
20
18
|
type="button"
|
package/src/drawer/Drawer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-drawer{display:flex;flex-direction:column;height:100vh;height:100dvh;justify-content:space-between;max-height:100vh;max-height:100dvh;max-width:600px;width:100vw}
|
|
1
|
+
.np-drawer{display:flex;flex-direction:column;height:100vh;height:100dvh;justify-content:space-between;max-height:100vh;max-height:100dvh;max-width:600px;width:100vw}.np-drawer .np-drawer-header{display:flex;flex-wrap:nowrap;min-height:56px;min-height:var(--size-56);padding:24px 16px;padding:var(--size-24) var(--size-16)}.np-theme-personal .np-drawer .np-drawer-header{padding:24px;padding:var(--size-24)}.np-theme-personal .np-drawer .np-drawer-header .np-text-title-body{margin-bottom:0;padding-top:0}.np-theme-personal .np-drawer .np-drawer-header .np-close-button{margin-bottom:-8px;margin-bottom:calc(var(--size-8)*-1);margin-right:-8px;margin-right:calc(var(--size-8)*-1);margin-top:-8px;margin-top:calc(var(--size-8)*-1)}.np-drawer .np-drawer-header.np-drawer-header--withborder{box-shadow:inset 0 -1px 0 0 #e2e6e8}.np-theme-personal .np-drawer .np-drawer-header.np-drawer-header--withborder{box-shadow:inset 0 -1px 0 0 #0000001a;box-shadow:inset 0 -1px 0 0 var(--color-border-neutral)}.np-drawer .np-drawer-header .np-text-title-body{font-size:1.125rem;font-size:var(--font-size-18);letter-spacing:-.01em;letter-spacing:var(--letter-spacing-negative-xs);line-height:1.5rem;line-height:var(--line-height-24);margin-bottom:-2px;margin-right:16px;margin-right:var(--size-16);padding-top:2px}.np-drawer .np-drawer-header .np-close-button{margin-left:auto}.np-drawer .np-drawer-header .tw-icon{fill:#00b9ff;cursor:pointer;display:block}.np-drawer .np-drawer-content{flex:1;overflow-y:auto}.np-drawer .np-drawer-content,.np-drawer .np-drawer-footer{padding:16px;padding:var(--size-16)}.np-drawer .np-drawer-footer{box-shadow:inset 0 1px 0 0 #e2e6e8}.np-theme-personal .np-drawer .np-drawer-footer{box-shadow:inset 0 1px 0 0 #0000001a;box-shadow:inset 0 1px 0 0 var(--color-border-neutral)}@media (min-width:768px){.np-drawer .np-drawer-header{padding:32px 24px;padding:var(--size-32) var(--size-24)}.np-drawer .np-drawer-content,.np-drawer .np-drawer-footer,.np-theme-personal .np-drawer .np-drawer-header{padding:24px;padding:var(--size-24)}}
|
package/src/drawer/Drawer.less
CHANGED
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
width: 100vw;
|
|
9
9
|
max-width: 600px;
|
|
10
|
-
@media (max-width: 770px) {
|
|
11
|
-
max-width: unset;
|
|
12
|
-
}
|
|
13
10
|
height: 100vh;
|
|
14
11
|
height: 100dvh;
|
|
15
12
|
max-height: 100vh;
|
|
@@ -23,9 +20,6 @@
|
|
|
23
20
|
|
|
24
21
|
.np-theme-personal & {
|
|
25
22
|
padding: var(--size-24);
|
|
26
|
-
@media (--screen-400-zoom) {
|
|
27
|
-
padding: var(--size-16);
|
|
28
|
-
}
|
|
29
23
|
|
|
30
24
|
.np-text-title-body {
|
|
31
25
|
padding-top: 0;
|
|
@@ -2,8 +2,7 @@ import { select } from '@storybook/addon-knobs';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Section, Button, Input, Modal } from '..';
|
|
5
|
-
import { Position
|
|
6
|
-
import { storyConfig } from '../test-utils';
|
|
5
|
+
import { Position } from '../common';
|
|
7
6
|
|
|
8
7
|
import Drawer from './Drawer';
|
|
9
8
|
|
|
@@ -41,10 +40,7 @@ export const Basic = () => {
|
|
|
41
40
|
footerContent={
|
|
42
41
|
<>
|
|
43
42
|
<Button block onClick={() => {}}>
|
|
44
|
-
Action
|
|
45
|
-
</Button>
|
|
46
|
-
<Button block priority={Priority.SECONDARY} onClick={() => {}}>
|
|
47
|
-
Action 2
|
|
43
|
+
Action
|
|
48
44
|
</Button>
|
|
49
45
|
</>
|
|
50
46
|
}
|
|
@@ -81,42 +77,6 @@ export const Basic = () => {
|
|
|
81
77
|
onClose={handleModalClose}
|
|
82
78
|
/>
|
|
83
79
|
</Section>
|
|
84
|
-
<p>
|
|
85
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
86
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
87
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
88
|
-
stumptown try-hard chartreuse.
|
|
89
|
-
</p>
|
|
90
|
-
<p>
|
|
91
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
92
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
93
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
94
|
-
stumptown try-hard chartreuse.
|
|
95
|
-
</p>
|
|
96
|
-
<p>
|
|
97
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
98
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
99
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
100
|
-
stumptown try-hard chartreuse.
|
|
101
|
-
</p>
|
|
102
|
-
<p>
|
|
103
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
104
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
105
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
106
|
-
stumptown try-hard chartreuse.
|
|
107
|
-
</p>
|
|
108
|
-
<p>
|
|
109
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
110
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
111
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
112
|
-
stumptown try-hard chartreuse.
|
|
113
|
-
</p>
|
|
114
|
-
<p>
|
|
115
|
-
I am baby actually poke kickstarter, street art jean shorts bespoke chambray activated
|
|
116
|
-
charcoal ramps marfa shoreditch tumeric tumblr. Mixtape cred palo santo, cliche lyft marfa
|
|
117
|
-
ethical waistcoat poke jean shorts. Scenester readymade selvage disrupt pok pok. La croix
|
|
118
|
-
stumptown try-hard chartreuse.
|
|
119
|
-
</p>
|
|
120
80
|
</Drawer>
|
|
121
81
|
</>
|
|
122
82
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-flow-navigation{min-height:97px;width:100%}.np-flow-navigation--border-bottom{border-bottom:1px solid #0000001a;border-bottom:1px solid var(--color-border-neutral);min-height:96px}.np-flow-navigation__content{max-width:1164px;min-width:320px;width:100%}.np-flow-navigation__stepper{padding-bottom:0!important}[dir=rtl] .np-flow-navigation__stepper{padding-right:0!important}[dir=rtl] .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation__stepper{padding-left:0!important}html:not([dir=rtl]) .np-flow-navigation__stepper{padding-right:0!important}.np-flow-navigation--xs-max .np-flow-navigation__stepper .tw-stepper-steps{display:none}.np-flow-navigation--xs-max .np-flow-navigation__stepper .progress{margin-bottom:0}.np-flow-navigation--xs-max .np-animated-label{height:auto}.np-flow-navigation--sm .np-flow-navigation__stepper{min-height:56px}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important
|
|
1
|
+
.np-flow-navigation{min-height:97px;width:100%}.np-flow-navigation--border-bottom{border-bottom:1px solid #0000001a;border-bottom:1px solid var(--color-border-neutral);min-height:96px}.np-flow-navigation__content{max-width:1164px;min-width:320px;width:100%}.np-flow-navigation__stepper{padding-bottom:0!important}[dir=rtl] .np-flow-navigation__stepper{padding-right:0!important}[dir=rtl] .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation__stepper{padding-left:0!important}html:not([dir=rtl]) .np-flow-navigation__stepper{padding-right:0!important}.np-flow-navigation--xs-max .np-flow-navigation__stepper .tw-stepper-steps{display:none}.np-flow-navigation--xs-max .np-flow-navigation__stepper .progress{margin-bottom:0}.np-flow-navigation--xs-max .np-animated-label{height:auto}.np-flow-navigation--sm .np-flow-navigation__stepper{min-height:56px}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-left:24px!important}html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important}.np-flow-navigation--lg .np-flow-navigation__stepper{max-width:562px}.np-flow-navigation--lg .np-flow-header__left,.np-flow-navigation--lg .np-flow-header__right{width:180px}.np-flow-navigation .separator{background-color:#0000001a;background-color:var(--color-border-neutral);height:32px;height:var(--size-32);min-width:1px;width:1px}[dir=rtl] .np-flow-navigation .separator{margin-right:16px!important}[dir=rtl] .np-flow-navigation .separator,html:not([dir=rtl]) .np-flow-navigation .separator{margin-left:16px!important}html:not([dir=rtl]) .np-flow-navigation .separator{margin-right:16px!important}.np-flow-navigation--hidden{visibility:hidden}.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path,.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path{fill:var(--color-interactive-primary)}
|