@transferwise/components 46.114.0 → 46.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/build/common/closeButton/CloseButton.messages.js +2 -2
  2. package/build/common/closeButton/CloseButton.messages.js.map +1 -1
  3. package/build/common/closeButton/CloseButton.messages.mjs +2 -2
  4. package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
  5. package/build/common/closeButton/CloseButton.mjs +2 -2
  6. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  7. package/build/common/hooks/useVirtualKeyboard.js +4 -3
  8. package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
  9. package/build/common/hooks/useVirtualKeyboard.mjs +4 -3
  10. package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
  11. package/build/drawer/Drawer.js +18 -9
  12. package/build/drawer/Drawer.js.map +1 -1
  13. package/build/drawer/Drawer.mjs +18 -9
  14. package/build/drawer/Drawer.mjs.map +1 -1
  15. package/build/i18n/nl.json +1 -1
  16. package/build/i18n/nl.json.js +1 -1
  17. package/build/i18n/nl.json.mjs +1 -1
  18. package/build/inputs/_BottomSheet.js +1 -1
  19. package/build/inputs/_BottomSheet.js.map +1 -1
  20. package/build/inputs/_BottomSheet.mjs +1 -1
  21. package/build/inputs/_BottomSheet.mjs.map +1 -1
  22. package/build/main.css +17 -127
  23. package/build/modal/Modal.js +20 -21
  24. package/build/modal/Modal.js.map +1 -1
  25. package/build/modal/Modal.mjs +20 -21
  26. package/build/modal/Modal.mjs.map +1 -1
  27. package/build/styles/drawer/Drawer.css +11 -58
  28. package/build/styles/main.css +17 -127
  29. package/build/styles/modal/Modal.css +6 -69
  30. package/build/types/common/hooks/useVirtualKeyboard.d.ts +2 -1
  31. package/build/types/common/hooks/useVirtualKeyboard.d.ts.map +1 -1
  32. package/build/types/drawer/Drawer.d.ts.map +1 -1
  33. package/build/types/modal/Modal.d.ts.map +1 -1
  34. package/package.json +2 -2
  35. package/src/accordion/Accordion.story.tsx +1 -1
  36. package/src/avatarLayout/AvatarLayout.story.tsx +1 -0
  37. package/src/avatarView/AvatarView.story.tsx +1 -0
  38. package/src/common/hooks/useVirtualKeyboard.ts +4 -3
  39. package/src/display/Display.story.tsx +1 -0
  40. package/src/drawer/Drawer.css +11 -58
  41. package/src/drawer/Drawer.less +14 -70
  42. package/src/drawer/Drawer.story.tsx +158 -100
  43. package/src/drawer/Drawer.tsx +26 -7
  44. package/src/i18n/nl.json +1 -1
  45. package/src/iconButton/IconButton.story.tsx +1 -0
  46. package/src/inputs/_BottomSheet.tsx +1 -1
  47. package/src/main.css +17 -127
  48. package/src/modal/Modal.css +6 -69
  49. package/src/modal/Modal.less +6 -76
  50. package/src/modal/Modal.tsx +23 -23
  51. package/src/provider/theme/ThemeProvider.story.tsx +23 -0
package/build/main.css CHANGED
@@ -2326,89 +2326,42 @@ button.np-option {
2326
2326
  }
2327
2327
  }
2328
2328
  .np-drawer .np-drawer-header {
2329
- display: flex;
2330
- align-items: center;
2331
- flex-wrap: nowrap;
2332
2329
  min-height: 56px;
2333
2330
  min-height: var(--size-56);
2334
- padding: 24px 16px;
2335
- padding: var(--size-24) var(--size-16);
2336
- }
2337
- .np-theme-personal .np-drawer .np-drawer-header {
2338
2331
  padding: 24px;
2339
2332
  padding: var(--size-24);
2340
2333
  }
2341
2334
  @media (max-width: 320px) {
2342
- .np-theme-personal .np-drawer .np-drawer-header {
2335
+ .np-drawer .np-drawer-header {
2343
2336
  padding: 16px;
2344
2337
  padding: var(--size-16);
2345
2338
  }
2346
2339
  }
2347
- .np-theme-personal .np-drawer .np-drawer-header .np-close-button {
2348
- margin-top: calc(8px * -1);
2349
- margin-top: calc(var(--size-8) * -1);
2350
- margin-right: calc(8px * -1);
2351
- margin-right: calc(var(--size-8) * -1);
2352
- margin-bottom: calc(8px * -1);
2353
- margin-bottom: calc(var(--size-8) * -1);
2354
- }
2355
- .np-drawer .np-drawer-header.np-drawer-header--withborder {
2356
- box-shadow: inset 0 -1px 0 0 #e2e6e8;
2357
- }
2358
- .np-theme-personal .np-drawer .np-drawer-header.np-drawer-header--withborder {
2359
- box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
2360
- box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
2361
- }
2362
- .np-drawer .np-drawer-header .np-text-title-body {
2363
- margin-right: 16px;
2364
- margin-right: var(--size-16);
2365
- font-size: 1.125rem;
2366
- font-size: var(--font-size-18);
2367
- letter-spacing: -0.01em;
2368
- letter-spacing: var(--letter-spacing-negative-xs);
2369
- line-height: 1.5rem;
2370
- line-height: var(--line-height-24);
2371
- }
2372
- .np-drawer .np-drawer-header .np-close-button {
2373
- margin-left: auto;
2374
- }
2375
- .np-drawer .np-drawer-header .tw-icon {
2376
- display: block;
2377
- cursor: pointer;
2378
- fill: #00b9ff;
2340
+ .np-drawer .np-drawer-title {
2341
+ max-width: 85%;
2379
2342
  }
2380
2343
  .np-drawer .np-drawer-content {
2381
2344
  overflow-y: auto;
2382
2345
  flex: 1;
2383
- }
2384
- .np-drawer .np-drawer-content .np-theme-personal {
2385
2346
  background-color: transparent;
2386
2347
  }
2387
- .np-drawer .np-drawer-footer,
2388
- .np-drawer .np-drawer-content {
2348
+ .np-drawer .np-drawer-footer {
2389
2349
  padding: 16px;
2390
2350
  padding: var(--size-16);
2391
2351
  }
2392
- .np-drawer .np-drawer-footer {
2393
- box-shadow: inset 0 1px 0 0 #e2e6e8;
2394
- }
2395
- .np-theme-personal .np-drawer .np-drawer-footer {
2396
- box-shadow: inset 0 1px 0 0 rgba(0,0,0,0.10196);
2397
- box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
2352
+ .np-drawer .np-drawer-content {
2353
+ padding: 0 16px;
2354
+ padding: 0 var(--size-16);
2398
2355
  }
2399
2356
  @media (min-width: 768px) {
2400
- .np-drawer .np-drawer-header {
2401
- padding: 32px 24px;
2402
- padding: var(--size-32) var(--size-24);
2403
- }
2404
- .np-theme-personal .np-drawer .np-drawer-header {
2357
+ .np-drawer .np-drawer-header,
2358
+ .np-drawer .np-drawer-footer {
2405
2359
  padding: 24px;
2406
2360
  padding: var(--size-24);
2407
2361
  }
2408
- .np-drawer .np-drawer-footer,
2409
2362
  .np-drawer .np-drawer-content {
2410
- padding: 24px;
2411
- padding: var(--size-24);
2363
+ padding: 0 24px;
2364
+ padding: 0 var(--size-24);
2412
2365
  }
2413
2366
  }
2414
2367
  .wds-Divider {
@@ -4231,14 +4184,9 @@ button.np-link {
4231
4184
  .tw-modal .tw-modal-dialog {
4232
4185
  transition: transform 0.3s ease-out;
4233
4186
  transform: translateY(-25%);
4234
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
4235
- background: #ffffff;
4236
- background: var(--color-background-elevated);
4237
- }
4238
- .np-theme-personal .tw-modal .tw-modal-dialog {
4187
+ box-shadow: none;
4239
4188
  background: #ffffff;
4240
4189
  background: var(--color-background-elevated);
4241
- box-shadow: none;
4242
4190
  border-radius: 24px;
4243
4191
  border-radius: var(--radius-large);
4244
4192
  }
@@ -4247,6 +4195,7 @@ button.np-link {
4247
4195
  }
4248
4196
  .tw-modal .tw-modal-content {
4249
4197
  width: 100%;
4198
+ background-color: transparent;
4250
4199
  }
4251
4200
  .tw-modal .tw-modal-content .tw-modal-body {
4252
4201
  flex: 1;
@@ -4255,26 +4204,6 @@ button.np-link {
4255
4204
  .tw-modal .tw-modal-content .tw-modal-body--scrollable {
4256
4205
  overflow-y: auto;
4257
4206
  }
4258
- .tw-modal .tw-modal-content .tw-modal-header {
4259
- box-shadow: inset 0 -1px 0 0 #e2e6e8;
4260
- }
4261
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header {
4262
- box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
4263
- box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
4264
- }
4265
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
4266
- margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
4267
- margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
4268
- }
4269
- .tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
4270
- box-shadow: none;
4271
- }
4272
- .tw-modal .tw-modal-content .tw-modal-header .tw-icon {
4273
- fill: #0097c7;
4274
- fill: var(--color-content-accent);
4275
- cursor: pointer;
4276
- display: block;
4277
- }
4278
4207
  .tw-modal .tw-modal-content .tw-modal-header,
4279
4208
  .tw-modal .tw-modal-content .tw-modal-footer,
4280
4209
  .tw-modal .tw-modal-content .tw-modal-body {
@@ -4289,55 +4218,16 @@ button.np-link {
4289
4218
  padding-top: var(--size-12);
4290
4219
  padding-bottom: 12px;
4291
4220
  padding-bottom: var(--size-12);
4292
- box-shadow: inset 0 1px 0 0 #e2e6e8;
4293
- }
4294
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer {
4295
- border-top: 1px solid rgba(0,0,0,0.10196);
4296
- border-top: 1px solid var(--color-border-neutral);
4297
- }
4298
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
4299
- .tw-modal .tw-modal-content .tw-modal-footer.modal--withoutborder {
4300
- box-shadow: none;
4301
- }
4302
- .tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-body {
4303
- padding-top: 0 !important;
4304
- }
4305
- .tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-header {
4306
- min-height: 32px;
4307
- min-height: var(--size-32);
4308
- padding-bottom: 4px !important;
4309
- }
4310
- .tw-modal .tw-modal-content .np-theme-personal {
4311
- background-color: transparent;
4312
- }
4313
- .tw-modal table,
4314
- .tw-modal .table {
4315
- background-color: transparent;
4316
4221
  }
4317
4222
  @media (min-width: 576px) {
4318
4223
  .tw-modal .tw-modal-content .tw-modal-header,
4319
- .tw-modal .tw-modal-content .tw-modal-footer,
4320
- .tw-modal .tw-modal-content .tw-modal-body {
4321
- padding: 32px 24px;
4322
- padding: var(--size-32) var(--size-24);
4323
- }
4324
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-header,
4325
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
4326
- .np-theme-personal .tw-modal .tw-modal-content .tw-modal-body {
4224
+ .tw-modal .tw-modal-content .tw-modal-footer {
4327
4225
  padding: 24px;
4328
4226
  padding: var(--size-24);
4329
4227
  }
4330
- .tw-modal .tw-modal-compact .tw-modal-header {
4331
- min-height: calc(8px * 7);
4332
- min-height: calc(var(--size-8) * 7);
4333
- }
4334
- .tw-modal .tw-modal-compact .tw-modal-header,
4335
- .tw-modal .tw-modal-compact .tw-modal-footer,
4336
- .tw-modal .tw-modal-compact .tw-modal-body {
4337
- padding-top: 16px;
4338
- padding-top: var(--size-16);
4339
- padding-bottom: 16px;
4340
- padding-bottom: var(--size-16);
4228
+ .tw-modal .tw-modal-content .tw-modal-body {
4229
+ padding: 0 24px;
4230
+ padding: 0 var(--size-24);
4341
4231
  }
4342
4232
  }
4343
4233
  @media (min-width: 480px) {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var clsx = require('clsx');
6
6
  var React = require('react');
7
7
  var reactTransitionGroup = require('react-transition-group');
8
+ var reactIntl = require('react-intl');
8
9
  require('../common/theme.js');
9
10
  require('../common/direction.js');
10
11
  require('../common/propsValues/control.js');
@@ -24,7 +25,9 @@ require('../common/propsValues/variant.js');
24
25
  var scroll = require('../common/propsValues/scroll.js');
25
26
  require('../common/propsValues/markdownNodeType.js');
26
27
  require('../common/fileType.js');
27
- var CloseButton = require('../common/closeButton/CloseButton.js');
28
+ var icons = require('@transferwise/icons');
29
+ var CloseButton_messages = require('../common/closeButton/CloseButton.messages.js');
30
+ var jsxRuntime = require('react/jsx-runtime');
28
31
  require('@transferwise/neptune-validation');
29
32
  require('../provider/direction/DirectionProvider.js');
30
33
  var useLayout = require('../common/hooks/useLayout/useLayout.js');
@@ -32,7 +35,7 @@ var Dimmer = require('../dimmer/Dimmer.js');
32
35
  var Drawer = require('../drawer/Drawer.js');
33
36
  var OverlayIdProvider = require('../provider/overlay/OverlayIdProvider.js');
34
37
  var Title = require('../title/Title.js');
35
- var jsxRuntime = require('react/jsx-runtime');
38
+ var IconButton = require('../iconButton/IconButton.js');
36
39
 
37
40
  const TRANSITION_DURATION_IN_MILLISECONDS = 150;
38
41
  const Modal = ({
@@ -49,13 +52,10 @@ const Modal = ({
49
52
  disableDimmerClickToClose = false,
50
53
  ...otherProps
51
54
  }) => {
52
- const checkSpecialClasses = classToCheck => className?.split(' ').includes(classToCheck);
55
+ const intl = reactIntl.useIntl();
53
56
  const {
54
57
  isMedium
55
58
  } = useLayout.useLayout();
56
- // These should be replaced with props in breaking change.
57
- const isCompact = checkSpecialClasses('compact');
58
- const noDivider = checkSpecialClasses('no-divider');
59
59
  const contentReference = React.useRef(null);
60
60
  const titleId = React.useId();
61
61
  const overlayId = React.useContext(OverlayIdProvider.OverlayIdContext);
@@ -96,32 +96,31 @@ const Modal = ({
96
96
  [`tw-modal-${size$1}`]: size$1
97
97
  }),
98
98
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
99
- className: clsx.clsx('tw-modal-content', 'd-flex', 'flex-column', 'justify-content-between', {
100
- 'tw-modal-compact': isCompact,
101
- 'tw-modal-no-title': !title
102
- }),
99
+ className: clsx.clsx('tw-modal-content', 'd-flex', 'flex-column', 'justify-content-between'),
103
100
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
104
- className: clsx.clsx('tw-modal-header', 'd-flex', 'align-items-center', 'justify-content-between', 'flex-wrap', {
105
- 'modal--withoutborder': !title || noDivider
106
- }),
107
- children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
101
+ className: clsx.clsx('tw-modal-header', 'd-flex', 'align-items-center', title ? 'justify-content-between' : 'justify-content-end', 'flex-wrap'),
102
+ children: [title && /*#__PURE__*/jsxRuntime.jsx(Title.default, {
108
103
  id: titleId,
109
- type: typography.Typography.TITLE_BODY,
104
+ type: typography.Typography.TITLE_SUBSECTION,
110
105
  className: "tw-modal-title",
111
106
  children: title
112
- }), /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
113
- onClick: onClose
107
+ }), /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
108
+ size: 40,
109
+ priority: "tertiary",
110
+ "aria-label": intl.formatMessage(CloseButton_messages.default.ariaLabel),
111
+ onClick: onClose,
112
+ children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
114
113
  })]
115
114
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
116
115
  className: clsx.clsx('tw-modal-body', {
117
116
  'tw-modal-body--scrollable': scroll$1 === scroll.Scroll.CONTENT
118
117
  }),
119
118
  children: body
120
- }), footer && /*#__PURE__*/jsxRuntime.jsx("div", {
121
- className: clsx.clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap', {
122
- 'modal--withoutborder': noDivider
123
- }),
119
+ }), footer ? /*#__PURE__*/jsxRuntime.jsx("div", {
120
+ className: clsx.clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap'),
124
121
  children: footer
122
+ }) : /*#__PURE__*/jsxRuntime.jsx("div", {
123
+ className: "m-t-3"
125
124
  })]
126
125
  })
127
126
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../src/modal/Modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode, useContext, useId, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n Size,\n Position,\n PositionTop,\n PositionCenter,\n Scroll,\n CommonProps,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n SizeExtraLarge,\n ScrollContent,\n ScrollViewport,\n Typography,\n} from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport Drawer from '../drawer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport Title from '../title/Title';\n\nconst TRANSITION_DURATION_IN_MILLISECONDS = 150;\n\nexport type ModalProps = CommonProps & {\n title?: ReactNode;\n body: ReactNode;\n footer?: ReactNode;\n size?: SizeSmall | SizeMedium | SizeLarge | SizeExtraLarge;\n onClose: () => void;\n onUnmount?: () => void;\n open: boolean;\n scroll?: ScrollContent | ScrollViewport;\n position?: PositionTop | PositionCenter;\n disableDimmerClickToClose?: boolean;\n};\n\nconst Modal = ({\n title = null,\n body,\n footer = null,\n onClose,\n onUnmount,\n className,\n open,\n size = Size.MEDIUM,\n scroll = Scroll.VIEWPORT,\n position = Position.CENTER,\n disableDimmerClickToClose = false,\n ...otherProps\n}: ModalProps) => {\n const checkSpecialClasses = (classToCheck: string) =>\n className?.split(' ').includes(classToCheck);\n const { isMedium } = useLayout();\n\n // These should be replaced with props in breaking change.\n const isCompact = checkSpecialClasses('compact');\n const noDivider = checkSpecialClasses('no-divider');\n\n const contentReference = useRef<HTMLDivElement>(null);\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return !isMedium ? (\n <Drawer\n open={open}\n headerTitle={title}\n footerContent={footer}\n position={Position.BOTTOM}\n onClose={onClose}\n onUnmount={onUnmount}\n >\n {body}\n </Drawer>\n ) : (\n <Dimmer\n open={open}\n scrollable={scroll === Scroll.VIEWPORT}\n contentPosition={position}\n disableClickToClose={disableDimmerClickToClose}\n onClose={onClose}\n onExited={onUnmount}\n >\n <CSSTransition\n nodeRef={contentReference}\n appear\n in={open}\n classNames={{ enterDone: 'in' }}\n timeout={TRANSITION_DURATION_IN_MILLISECONDS}\n unmountOnExit\n >\n <div\n ref={contentReference}\n className={clsx(\n 'tw-modal',\n 'd-flex',\n 'fade',\n 'outline-none',\n scroll === Scroll.CONTENT && 'tw-modal--scrollable',\n className,\n )}\n {...otherProps}\n >\n <div\n id={overlayId}\n role=\"dialog\"\n aria-modal\n aria-labelledby={titleId}\n className={clsx('tw-modal-dialog', 'd-flex', {\n [`tw-modal-${size}`]: size,\n })}\n >\n <div\n className={clsx(\n 'tw-modal-content',\n 'd-flex',\n 'flex-column',\n 'justify-content-between',\n {\n 'tw-modal-compact': isCompact,\n 'tw-modal-no-title': !title,\n },\n )}\n >\n <div\n className={clsx(\n 'tw-modal-header',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n 'flex-wrap',\n {\n 'modal--withoutborder': !title || noDivider,\n },\n )}\n >\n <Title id={titleId} type={Typography.TITLE_BODY} className=\"tw-modal-title\">\n {title}\n </Title>\n <CloseButton onClick={onClose} />\n </div>\n <div\n className={clsx('tw-modal-body', {\n 'tw-modal-body--scrollable': scroll === Scroll.CONTENT,\n })}\n >\n {body}\n </div>\n {footer && (\n <div\n className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap', {\n 'modal--withoutborder': noDivider,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n </div>\n </CSSTransition>\n </Dimmer>\n );\n};\n\nexport default Modal;\n"],"names":["TRANSITION_DURATION_IN_MILLISECONDS","Modal","title","body","footer","onClose","onUnmount","className","open","size","Size","MEDIUM","scroll","Scroll","VIEWPORT","position","Position","CENTER","disableDimmerClickToClose","otherProps","checkSpecialClasses","classToCheck","split","includes","isMedium","useLayout","isCompact","noDivider","contentReference","useRef","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Drawer","headerTitle","footerContent","BOTTOM","children","Dimmer","scrollable","contentPosition","disableClickToClose","onExited","CSSTransition","nodeRef","appear","in","classNames","enterDone","timeout","unmountOnExit","ref","clsx","CONTENT","id","role","_jsxs","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,mCAAmC,GAAG,GAAG;AAe/C,MAAMC,KAAK,GAAGA,CAAC;AACbC,EAAAA,KAAK,GAAG,IAAI;EACZC,IAAI;AACJC,EAAAA,MAAM,GAAG,IAAI;EACbC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,IAAI;QACJC,MAAI,GAAGC,SAAI,CAACC,MAAM;UA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ACE,sBAAsB,EAAE,CAACrD,KAAK,IAAIyB;AACnC,eAAA,CACD;cAAAa,QAAA,EAAA,cAEFL,cAAA,CAACyB,aAAK,EAAA;AAACH,gBAAAA,EAAE,EAAE3B,OAAQ;gBAAC+B,IAAI,EAAEC,qBAAU,CAACC,UAAW;AAACxD,gBAAAA,SAAS,EAAC,gBAAgB;AAAAiC,gBAAAA,QAAA,EACxEtC;AAAK,eACD,CACP,eAAAiC,cAAA,CAAC6B,uBAAW,EAAA;AAACC,gBAAAA,OAAO,EAAE5D;AAAQ,eAAA,CAChC;aAAK,CACL,eAAA8B,cAAA,CAAA,KAAA,EAAA;AACE5B,cAAAA,SAAS,EAAEgD,SAAI,CAAC,eAAe,EAAE;AAC/B,gBAAA,2BAA2B,EAAE3C,QAAM,KAAKC,aAAM,CAAC2C;AAChD,eAAA,CAAE;AAAAhB,cAAAA,QAAA,EAEFrC;AAAI,aACF,CACL,EAACC,MAAM,iBACL+B,cAAA,CAAA,KAAA,EAAA;cACE5B,SAAS,EAAEgD,SAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE;AAC9E,gBAAA,sBAAsB,EAAE5B;AACzB,eAAA,CAAE;AAAAa,cAAAA,QAAA,EAEFpC;AAAM,aACJ,CACN;WACE;SACF;OACF;KACQ;AACjB,GAAQ,CACT;AACH;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../src/modal/Modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode, useContext, useId, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n Position,\n PositionTop,\n PositionCenter,\n Scroll,\n CommonProps,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n SizeExtraLarge,\n ScrollContent,\n ScrollViewport,\n Typography,\n} from '../common';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport Drawer from '../drawer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport Title from '../title/Title';\nimport { Cross } from '@transferwise/icons';\nimport IconButton from '../iconButton';\nimport closeBtnMessages from '../common/closeButton/CloseButton.messages';\n\nconst TRANSITION_DURATION_IN_MILLISECONDS = 150;\n\nexport type ModalProps = CommonProps & {\n title?: ReactNode;\n body: ReactNode;\n footer?: ReactNode;\n size?: SizeSmall | SizeMedium | SizeLarge | SizeExtraLarge;\n onClose: () => void;\n onUnmount?: () => void;\n open: boolean;\n scroll?: ScrollContent | ScrollViewport;\n position?: PositionTop | PositionCenter;\n disableDimmerClickToClose?: boolean;\n};\n\nconst Modal = ({\n title = null,\n body,\n footer = null,\n onClose,\n onUnmount,\n className,\n open,\n size = Size.MEDIUM,\n scroll = Scroll.VIEWPORT,\n position = Position.CENTER,\n disableDimmerClickToClose = false,\n ...otherProps\n}: ModalProps) => {\n const intl = useIntl();\n const { isMedium } = useLayout();\n\n const contentReference = useRef<HTMLDivElement>(null);\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return !isMedium ? (\n <Drawer\n open={open}\n headerTitle={title}\n footerContent={footer}\n position={Position.BOTTOM}\n onClose={onClose}\n onUnmount={onUnmount}\n >\n {body}\n </Drawer>\n ) : (\n <Dimmer\n open={open}\n scrollable={scroll === Scroll.VIEWPORT}\n contentPosition={position}\n disableClickToClose={disableDimmerClickToClose}\n onClose={onClose}\n onExited={onUnmount}\n >\n <CSSTransition\n nodeRef={contentReference}\n appear\n in={open}\n classNames={{ enterDone: 'in' }}\n timeout={TRANSITION_DURATION_IN_MILLISECONDS}\n unmountOnExit\n >\n <div\n ref={contentReference}\n className={clsx(\n 'tw-modal',\n 'd-flex',\n 'fade',\n 'outline-none',\n scroll === Scroll.CONTENT && 'tw-modal--scrollable',\n className,\n )}\n {...otherProps}\n >\n <div\n id={overlayId}\n role=\"dialog\"\n aria-modal\n aria-labelledby={titleId}\n className={clsx('tw-modal-dialog', 'd-flex', {\n [`tw-modal-${size}`]: size,\n })}\n >\n <div\n className={clsx(\n 'tw-modal-content',\n 'd-flex',\n 'flex-column',\n 'justify-content-between',\n )}\n >\n <div\n className={clsx(\n 'tw-modal-header',\n 'd-flex',\n 'align-items-center',\n title ? 'justify-content-between' : 'justify-content-end',\n 'flex-wrap',\n )}\n >\n {title && (\n <Title id={titleId} type={Typography.TITLE_SUBSECTION} className=\"tw-modal-title\">\n {title}\n </Title>\n )}\n <IconButton\n size={40}\n priority=\"tertiary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onClose}\n >\n <Cross />\n </IconButton>\n </div>\n <div\n className={clsx('tw-modal-body', {\n 'tw-modal-body--scrollable': scroll === Scroll.CONTENT,\n })}\n >\n {body}\n </div>\n {footer ? (\n <div\n className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap')}\n >\n {footer}\n </div>\n ) : (\n <div className=\"m-t-3\" />\n )}\n </div>\n </div>\n </div>\n </CSSTransition>\n </Dimmer>\n );\n};\n\nexport default Modal;\n"],"names":["TRANSITION_DURATION_IN_MILLISECONDS","Modal","title","body","footer","onClose","onUnmount","className","open","size","Size","MEDIUM","scroll","Scroll","VIEWPORT","position","Position","CENTER","disableDimmerClickToClose","otherProps","intl","useIntl","isMedium","useLayout","contentReference","useRef","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Drawer","headerTitle","footerContent","BOTTOM","children","Dimmer","scrollable","contentPosition","disableClickToClose","onExited","CSSTransition","nodeRef","appear","in","classNames","enterDone","timeout","unmountOnExit","ref","clsx","CONTENT","id","role","_jsxs","Title","type","Typography","TITLE_SUBSECTION","IconButton","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,mCAAmC,GAAG,GAAG;AAe/C,MAAMC,KAAK,GAAGA,CAAC;AACbC,EAAAA,KAAK,GAAG,IAAI;EACZC,IAAI;AACJC,EAAAA,MAAM,GAAG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AAA,SAAS,EAAC,gBAAgB;AAAA6B,gBAAAA,QAAA,EAC9ElC;AAAK,eACD,CACR,eACD6B,cAAA,CAAC6B,kBAAU,EAAA;AACTnD,gBAAAA,IAAI,EAAE,EAAG;AACToD,gBAAAA,QAAQ,EAAC,UAAU;AACnB,gBAAA,YAAA,EAAYzC,IAAI,CAAC0C,aAAa,CAACC,4BAAgB,CAACC,SAAS,CAAE;AAC3DC,gBAAAA,OAAO,EAAE5D,OAAQ;AAAA+B,gBAAAA,QAAA,eAEjBL,cAAA,CAACmC,WAAK,EAAA,EAAA;AACR,eAAY,CACd;aAAK,CACL,eAAAnC,cAAA,CAAA,KAAA,EAAA;AACExB,cAAAA,SAAS,EAAE4C,SAAI,CAAC,eAAe,EAAE;AAC/B,gBAAA,2BAA2B,EAAEvC,QAAM,KAAKC,aAAM,CAACuC;AAChD,eAAA,CAAE;AAAAhB,cAAAA,QAAA,EAEFjC;AAAI,aACF,CACL,EAACC,MAAM,gBACL2B,cAAA,CAAA,KAAA,EAAA;cACExB,SAAS,EAAE4C,SAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,CAAE;AAAAf,cAAAA,QAAA,EAE/EhC;aACE,CAAC,gBAEN2B,cAAA,CAAA,KAAA,EAAA;AAAKxB,cAAAA,SAAS,EAAC;AAAO,aAAA,CACvB;WACE;SACF;OACF;KACQ;AACjB,GAAQ,CACT;AACH;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { useRef, useId, useContext } from 'react';
3
3
  import { CSSTransition } from 'react-transition-group';
4
+ import { useIntl } from 'react-intl';
4
5
  import '../common/theme.mjs';
5
6
  import '../common/direction.mjs';
6
7
  import '../common/propsValues/control.mjs';
@@ -20,7 +21,9 @@ import '../common/propsValues/variant.mjs';
20
21
  import { Scroll } from '../common/propsValues/scroll.mjs';
21
22
  import '../common/propsValues/markdownNodeType.mjs';
22
23
  import '../common/fileType.mjs';
23
- import { CloseButton } from '../common/closeButton/CloseButton.mjs';
24
+ import { Cross } from '@transferwise/icons';
25
+ import closeBtnMessages from '../common/closeButton/CloseButton.messages.mjs';
26
+ import { jsx, jsxs } from 'react/jsx-runtime';
24
27
  import '@transferwise/neptune-validation';
25
28
  import '../provider/direction/DirectionProvider.mjs';
26
29
  import { useLayout } from '../common/hooks/useLayout/useLayout.mjs';
@@ -28,7 +31,7 @@ import Dimmer from '../dimmer/Dimmer.mjs';
28
31
  import Drawer from '../drawer/Drawer.mjs';
29
32
  import { OverlayIdContext } from '../provider/overlay/OverlayIdProvider.mjs';
30
33
  import Title from '../title/Title.mjs';
31
- import { jsx, jsxs } from 'react/jsx-runtime';
34
+ import IconButton from '../iconButton/IconButton.mjs';
32
35
 
33
36
  const TRANSITION_DURATION_IN_MILLISECONDS = 150;
34
37
  const Modal = ({
@@ -45,13 +48,10 @@ const Modal = ({
45
48
  disableDimmerClickToClose = false,
46
49
  ...otherProps
47
50
  }) => {
48
- const checkSpecialClasses = classToCheck => className?.split(' ').includes(classToCheck);
51
+ const intl = useIntl();
49
52
  const {
50
53
  isMedium
51
54
  } = useLayout();
52
- // These should be replaced with props in breaking change.
53
- const isCompact = checkSpecialClasses('compact');
54
- const noDivider = checkSpecialClasses('no-divider');
55
55
  const contentReference = useRef(null);
56
56
  const titleId = useId();
57
57
  const overlayId = useContext(OverlayIdContext);
@@ -92,32 +92,31 @@ const Modal = ({
92
92
  [`tw-modal-${size}`]: size
93
93
  }),
94
94
  children: /*#__PURE__*/jsxs("div", {
95
- className: clsx('tw-modal-content', 'd-flex', 'flex-column', 'justify-content-between', {
96
- 'tw-modal-compact': isCompact,
97
- 'tw-modal-no-title': !title
98
- }),
95
+ className: clsx('tw-modal-content', 'd-flex', 'flex-column', 'justify-content-between'),
99
96
  children: [/*#__PURE__*/jsxs("div", {
100
- className: clsx('tw-modal-header', 'd-flex', 'align-items-center', 'justify-content-between', 'flex-wrap', {
101
- 'modal--withoutborder': !title || noDivider
102
- }),
103
- children: [/*#__PURE__*/jsx(Title, {
97
+ className: clsx('tw-modal-header', 'd-flex', 'align-items-center', title ? 'justify-content-between' : 'justify-content-end', 'flex-wrap'),
98
+ children: [title && /*#__PURE__*/jsx(Title, {
104
99
  id: titleId,
105
- type: Typography.TITLE_BODY,
100
+ type: Typography.TITLE_SUBSECTION,
106
101
  className: "tw-modal-title",
107
102
  children: title
108
- }), /*#__PURE__*/jsx(CloseButton, {
109
- onClick: onClose
103
+ }), /*#__PURE__*/jsx(IconButton, {
104
+ size: 40,
105
+ priority: "tertiary",
106
+ "aria-label": intl.formatMessage(closeBtnMessages.ariaLabel),
107
+ onClick: onClose,
108
+ children: /*#__PURE__*/jsx(Cross, {})
110
109
  })]
111
110
  }), /*#__PURE__*/jsx("div", {
112
111
  className: clsx('tw-modal-body', {
113
112
  'tw-modal-body--scrollable': scroll === Scroll.CONTENT
114
113
  }),
115
114
  children: body
116
- }), footer && /*#__PURE__*/jsx("div", {
117
- className: clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap', {
118
- 'modal--withoutborder': noDivider
119
- }),
115
+ }), footer ? /*#__PURE__*/jsx("div", {
116
+ className: clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap'),
120
117
  children: footer
118
+ }) : /*#__PURE__*/jsx("div", {
119
+ className: "m-t-3"
121
120
  })]
122
121
  })
123
122
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.mjs","sources":["../../src/modal/Modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode, useContext, useId, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n Size,\n Position,\n PositionTop,\n PositionCenter,\n Scroll,\n CommonProps,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n SizeExtraLarge,\n ScrollContent,\n ScrollViewport,\n Typography,\n} from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport Drawer from '../drawer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport Title from '../title/Title';\n\nconst TRANSITION_DURATION_IN_MILLISECONDS = 150;\n\nexport type ModalProps = CommonProps & {\n title?: ReactNode;\n body: ReactNode;\n footer?: ReactNode;\n size?: SizeSmall | SizeMedium | SizeLarge | SizeExtraLarge;\n onClose: () => void;\n onUnmount?: () => void;\n open: boolean;\n scroll?: ScrollContent | ScrollViewport;\n position?: PositionTop | PositionCenter;\n disableDimmerClickToClose?: boolean;\n};\n\nconst Modal = ({\n title = null,\n body,\n footer = null,\n onClose,\n onUnmount,\n className,\n open,\n size = Size.MEDIUM,\n scroll = Scroll.VIEWPORT,\n position = Position.CENTER,\n disableDimmerClickToClose = false,\n ...otherProps\n}: ModalProps) => {\n const checkSpecialClasses = (classToCheck: string) =>\n className?.split(' ').includes(classToCheck);\n const { isMedium } = useLayout();\n\n // These should be replaced with props in breaking change.\n const isCompact = checkSpecialClasses('compact');\n const noDivider = checkSpecialClasses('no-divider');\n\n const contentReference = useRef<HTMLDivElement>(null);\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return !isMedium ? (\n <Drawer\n open={open}\n headerTitle={title}\n footerContent={footer}\n position={Position.BOTTOM}\n onClose={onClose}\n onUnmount={onUnmount}\n >\n {body}\n </Drawer>\n ) : (\n <Dimmer\n open={open}\n scrollable={scroll === Scroll.VIEWPORT}\n contentPosition={position}\n disableClickToClose={disableDimmerClickToClose}\n onClose={onClose}\n onExited={onUnmount}\n >\n <CSSTransition\n nodeRef={contentReference}\n appear\n in={open}\n classNames={{ enterDone: 'in' }}\n timeout={TRANSITION_DURATION_IN_MILLISECONDS}\n unmountOnExit\n >\n <div\n ref={contentReference}\n className={clsx(\n 'tw-modal',\n 'd-flex',\n 'fade',\n 'outline-none',\n scroll === Scroll.CONTENT && 'tw-modal--scrollable',\n className,\n )}\n {...otherProps}\n >\n <div\n id={overlayId}\n role=\"dialog\"\n aria-modal\n aria-labelledby={titleId}\n className={clsx('tw-modal-dialog', 'd-flex', {\n [`tw-modal-${size}`]: size,\n })}\n >\n <div\n className={clsx(\n 'tw-modal-content',\n 'd-flex',\n 'flex-column',\n 'justify-content-between',\n {\n 'tw-modal-compact': isCompact,\n 'tw-modal-no-title': !title,\n },\n )}\n >\n <div\n className={clsx(\n 'tw-modal-header',\n 'd-flex',\n 'align-items-center',\n 'justify-content-between',\n 'flex-wrap',\n {\n 'modal--withoutborder': !title || noDivider,\n },\n )}\n >\n <Title id={titleId} type={Typography.TITLE_BODY} className=\"tw-modal-title\">\n {title}\n </Title>\n <CloseButton onClick={onClose} />\n </div>\n <div\n className={clsx('tw-modal-body', {\n 'tw-modal-body--scrollable': scroll === Scroll.CONTENT,\n })}\n >\n {body}\n </div>\n {footer && (\n <div\n className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap', {\n 'modal--withoutborder': noDivider,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n </div>\n </CSSTransition>\n </Dimmer>\n );\n};\n\nexport default Modal;\n"],"names":["TRANSITION_DURATION_IN_MILLISECONDS","Modal","title","body","footer","onClose","onUnmount","className","open","size","Size","MEDIUM","scroll","Scroll","VIEWPORT","position","Position","CENTER","disableDimmerClickToClose","otherProps","checkSpecialClasses","classToCheck","split","includes","isMedium","useLayout","isCompact","noDivider","contentReference","useRef","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Drawer","headerTitle","footerContent","BOTTOM","children","Dimmer","scrollable","contentPosition","disableClickToClose","onExited","CSSTransition","nodeRef","appear","in","classNames","enterDone","timeout","unmountOnExit","ref","clsx","CONTENT","id","role","_jsxs","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,mCAAmC,GAAG,GAAG;AAe/C,MAAMC,KAAK,GAAGA,CAAC;AACbC,EAAAA,KAAK,GAAG,IAAI;EACZC,IAAI;AACJC,EAAAA,MAAM,GAAG,IA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AEgD,IAAI,CACb,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,yBAAyB,EACzB,WAAW,EACX;gBACE,sBAAsB,EAAE,CAACrD,KAAK,IAAIyB;AACnC,eAAA,CACD;cAAAa,QAAA,EAAA,cAEFL,GAAA,CAACyB,KAAK,EAAA;AAACH,gBAAAA,EAAE,EAAE3B,OAAQ;gBAAC+B,IAAI,EAAEC,UAAU,CAACC,UAAW;AAACxD,gBAAAA,SAAS,EAAC,gBAAgB;AAAAiC,gBAAAA,QAAA,EACxEtC;AAAK,eACD,CACP,eAAAiC,GAAA,CAAC6B,WAAW,EAAA;AAACC,gBAAAA,OAAO,EAAE5D;AAAQ,eAAA,CAChC;aAAK,CACL,eAAA8B,GAAA,CAAA,KAAA,EAAA;AACE5B,cAAAA,SAAS,EAAEgD,IAAI,CAAC,eAAe,EAAE;AAC/B,gBAAA,2BAA2B,EAAE3C,MAAM,KAAKC,MAAM,CAAC2C;AAChD,eAAA,CAAE;AAAAhB,cAAAA,QAAA,EAEFrC;AAAI,aACF,CACL,EAACC,MAAM,iBACL+B,GAAA,CAAA,KAAA,EAAA;cACE5B,SAAS,EAAEgD,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE;AAC9E,gBAAA,sBAAsB,EAAE5B;AACzB,eAAA,CAAE;AAAAa,cAAAA,QAAA,EAEFpC;AAAM,aACJ,CACN;WACE;SACF;OACF;KACQ;AACjB,GAAQ,CACT;AACH;;;;"}
1
+ {"version":3,"file":"Modal.mjs","sources":["../../src/modal/Modal.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode, useContext, useId, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n Position,\n PositionTop,\n PositionCenter,\n Scroll,\n CommonProps,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n SizeExtraLarge,\n ScrollContent,\n ScrollViewport,\n Typography,\n} from '../common';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport Drawer from '../drawer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport Title from '../title/Title';\nimport { Cross } from '@transferwise/icons';\nimport IconButton from '../iconButton';\nimport closeBtnMessages from '../common/closeButton/CloseButton.messages';\n\nconst TRANSITION_DURATION_IN_MILLISECONDS = 150;\n\nexport type ModalProps = CommonProps & {\n title?: ReactNode;\n body: ReactNode;\n footer?: ReactNode;\n size?: SizeSmall | SizeMedium | SizeLarge | SizeExtraLarge;\n onClose: () => void;\n onUnmount?: () => void;\n open: boolean;\n scroll?: ScrollContent | ScrollViewport;\n position?: PositionTop | PositionCenter;\n disableDimmerClickToClose?: boolean;\n};\n\nconst Modal = ({\n title = null,\n body,\n footer = null,\n onClose,\n onUnmount,\n className,\n open,\n size = Size.MEDIUM,\n scroll = Scroll.VIEWPORT,\n position = Position.CENTER,\n disableDimmerClickToClose = false,\n ...otherProps\n}: ModalProps) => {\n const intl = useIntl();\n const { isMedium } = useLayout();\n\n const contentReference = useRef<HTMLDivElement>(null);\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return !isMedium ? (\n <Drawer\n open={open}\n headerTitle={title}\n footerContent={footer}\n position={Position.BOTTOM}\n onClose={onClose}\n onUnmount={onUnmount}\n >\n {body}\n </Drawer>\n ) : (\n <Dimmer\n open={open}\n scrollable={scroll === Scroll.VIEWPORT}\n contentPosition={position}\n disableClickToClose={disableDimmerClickToClose}\n onClose={onClose}\n onExited={onUnmount}\n >\n <CSSTransition\n nodeRef={contentReference}\n appear\n in={open}\n classNames={{ enterDone: 'in' }}\n timeout={TRANSITION_DURATION_IN_MILLISECONDS}\n unmountOnExit\n >\n <div\n ref={contentReference}\n className={clsx(\n 'tw-modal',\n 'd-flex',\n 'fade',\n 'outline-none',\n scroll === Scroll.CONTENT && 'tw-modal--scrollable',\n className,\n )}\n {...otherProps}\n >\n <div\n id={overlayId}\n role=\"dialog\"\n aria-modal\n aria-labelledby={titleId}\n className={clsx('tw-modal-dialog', 'd-flex', {\n [`tw-modal-${size}`]: size,\n })}\n >\n <div\n className={clsx(\n 'tw-modal-content',\n 'd-flex',\n 'flex-column',\n 'justify-content-between',\n )}\n >\n <div\n className={clsx(\n 'tw-modal-header',\n 'd-flex',\n 'align-items-center',\n title ? 'justify-content-between' : 'justify-content-end',\n 'flex-wrap',\n )}\n >\n {title && (\n <Title id={titleId} type={Typography.TITLE_SUBSECTION} className=\"tw-modal-title\">\n {title}\n </Title>\n )}\n <IconButton\n size={40}\n priority=\"tertiary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onClose}\n >\n <Cross />\n </IconButton>\n </div>\n <div\n className={clsx('tw-modal-body', {\n 'tw-modal-body--scrollable': scroll === Scroll.CONTENT,\n })}\n >\n {body}\n </div>\n {footer ? (\n <div\n className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap')}\n >\n {footer}\n </div>\n ) : (\n <div className=\"m-t-3\" />\n )}\n </div>\n </div>\n </div>\n </CSSTransition>\n </Dimmer>\n );\n};\n\nexport default Modal;\n"],"names":["TRANSITION_DURATION_IN_MILLISECONDS","Modal","title","body","footer","onClose","onUnmount","className","open","size","Size","MEDIUM","scroll","Scroll","VIEWPORT","position","Position","CENTER","disableDimmerClickToClose","otherProps","intl","useIntl","isMedium","useLayout","contentReference","useRef","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Drawer","headerTitle","footerContent","BOTTOM","children","Dimmer","scrollable","contentPosition","disableClickToClose","onExited","CSSTransition","nodeRef","appear","in","classNames","enterDone","timeout","unmountOnExit","ref","clsx","CONTENT","id","role","_jsxs","Title","type","Typography","TITLE_SUBSECTION","IconButton","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,mCAAmC,GAAG,GAAG;AAe/C,MAAMC,KAAK,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E,EAAE3B,OAAQ;gBAAC+B,IAAI,EAAEC,UAAU,CAACC,gBAAiB;AAACpD,gBAAAA,SAAS,EAAC,gBAAgB;AAAA6B,gBAAAA,QAAA,EAC9ElC;AAAK,eACD,CACR,eACD6B,GAAA,CAAC6B,UAAU,EAAA;AACTnD,gBAAAA,IAAI,EAAE,EAAG;AACToD,gBAAAA,QAAQ,EAAC,UAAU;AACnB,gBAAA,YAAA,EAAYzC,IAAI,CAAC0C,aAAa,CAACC,gBAAgB,CAACC,SAAS,CAAE;AAC3DC,gBAAAA,OAAO,EAAE5D,OAAQ;AAAA+B,gBAAAA,QAAA,eAEjBL,GAAA,CAACmC,KAAK,EAAA,EAAA;AACR,eAAY,CACd;aAAK,CACL,eAAAnC,GAAA,CAAA,KAAA,EAAA;AACExB,cAAAA,SAAS,EAAE4C,IAAI,CAAC,eAAe,EAAE;AAC/B,gBAAA,2BAA2B,EAAEvC,MAAM,KAAKC,MAAM,CAACuC;AAChD,eAAA,CAAE;AAAAhB,cAAAA,QAAA,EAEFjC;AAAI,aACF,CACL,EAACC,MAAM,gBACL2B,GAAA,CAAA,KAAA,EAAA;cACExB,SAAS,EAAE4C,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,WAAW,CAAE;AAAAf,cAAAA,QAAA,EAE/EhC;aACE,CAAC,gBAEN2B,GAAA,CAAA,KAAA,EAAA;AAAKxB,cAAAA,SAAS,EAAC;AAAO,aAAA,CACvB;WACE;SACF;OACF;KACQ;AACjB,GAAQ,CACT;AACH;;;;"}
@@ -16,88 +16,41 @@
16
16
  }
17
17
  }
18
18
  .np-drawer .np-drawer-header {
19
- display: flex;
20
- align-items: center;
21
- flex-wrap: nowrap;
22
19
  min-height: 56px;
23
20
  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 {
28
21
  padding: 24px;
29
22
  padding: var(--size-24);
30
23
  }
31
24
  @media (max-width: 320px) {
32
- .np-theme-personal .np-drawer .np-drawer-header {
25
+ .np-drawer .np-drawer-header {
33
26
  padding: 16px;
34
27
  padding: var(--size-16);
35
28
  }
36
29
  }
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(0,0,0,0.10196);
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;
30
+ .np-drawer .np-drawer-title {
31
+ max-width: 85%;
69
32
  }
70
33
  .np-drawer .np-drawer-content {
71
34
  overflow-y: auto;
72
35
  flex: 1;
73
- }
74
- .np-drawer .np-drawer-content .np-theme-personal {
75
36
  background-color: transparent;
76
37
  }
77
- .np-drawer .np-drawer-footer,
78
- .np-drawer .np-drawer-content {
38
+ .np-drawer .np-drawer-footer {
79
39
  padding: 16px;
80
40
  padding: var(--size-16);
81
41
  }
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(0,0,0,0.10196);
87
- box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
42
+ .np-drawer .np-drawer-content {
43
+ padding: 0 16px;
44
+ padding: 0 var(--size-16);
88
45
  }
89
46
  @media (min-width: 768px) {
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 {
47
+ .np-drawer .np-drawer-header,
48
+ .np-drawer .np-drawer-footer {
95
49
  padding: 24px;
96
50
  padding: var(--size-24);
97
51
  }
98
- .np-drawer .np-drawer-footer,
99
52
  .np-drawer .np-drawer-content {
100
- padding: 24px;
101
- padding: var(--size-24);
53
+ padding: 0 24px;
54
+ padding: 0 var(--size-24);
102
55
  }
103
56
  }