@toptal/picasso-modal 3.2.2 → 3.2.3-alpha-1757603192867.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 (53) hide show
  1. package/package.json +19 -18
  2. package/dist-package/src/Modal/Modal.d.ts +0 -41
  3. package/dist-package/src/Modal/Modal.d.ts.map +0 -1
  4. package/dist-package/src/Modal/Modal.js +0 -139
  5. package/dist-package/src/Modal/Modal.js.map +0 -1
  6. package/dist-package/src/Modal/index.d.ts +0 -7
  7. package/dist-package/src/Modal/index.d.ts.map +0 -1
  8. package/dist-package/src/Modal/index.js +0 -4
  9. package/dist-package/src/Modal/index.js.map +0 -1
  10. package/dist-package/src/ModalActions/ModalActions.d.ts +0 -10
  11. package/dist-package/src/ModalActions/ModalActions.d.ts.map +0 -1
  12. package/dist-package/src/ModalActions/ModalActions.js +0 -20
  13. package/dist-package/src/ModalActions/ModalActions.js.map +0 -1
  14. package/dist-package/src/ModalActions/index.d.ts +0 -5
  15. package/dist-package/src/ModalActions/index.d.ts.map +0 -1
  16. package/dist-package/src/ModalActions/index.js +0 -2
  17. package/dist-package/src/ModalActions/index.js.map +0 -1
  18. package/dist-package/src/ModalCompound/index.d.ts +0 -7
  19. package/dist-package/src/ModalCompound/index.d.ts.map +0 -1
  20. package/dist-package/src/ModalCompound/index.js +0 -10
  21. package/dist-package/src/ModalCompound/index.js.map +0 -1
  22. package/dist-package/src/ModalContent/ModalContent.d.ts +0 -15
  23. package/dist-package/src/ModalContent/ModalContent.d.ts.map +0 -1
  24. package/dist-package/src/ModalContent/ModalContent.js +0 -38
  25. package/dist-package/src/ModalContent/ModalContent.js.map +0 -1
  26. package/dist-package/src/ModalContent/hooks/use-scrollable-shades.d.ts +0 -6
  27. package/dist-package/src/ModalContent/hooks/use-scrollable-shades.d.ts.map +0 -1
  28. package/dist-package/src/ModalContent/hooks/use-scrollable-shades.js +0 -34
  29. package/dist-package/src/ModalContent/hooks/use-scrollable-shades.js.map +0 -1
  30. package/dist-package/src/ModalContent/index.d.ts +0 -5
  31. package/dist-package/src/ModalContent/index.d.ts.map +0 -1
  32. package/dist-package/src/ModalContent/index.js +0 -2
  33. package/dist-package/src/ModalContent/index.js.map +0 -1
  34. package/dist-package/src/ModalPaper/ModalPaper.d.ts +0 -13
  35. package/dist-package/src/ModalPaper/ModalPaper.d.ts.map +0 -1
  36. package/dist-package/src/ModalPaper/ModalPaper.js +0 -43
  37. package/dist-package/src/ModalPaper/ModalPaper.js.map +0 -1
  38. package/dist-package/src/ModalPaper/index.d.ts +0 -2
  39. package/dist-package/src/ModalPaper/index.d.ts.map +0 -1
  40. package/dist-package/src/ModalPaper/index.js +0 -2
  41. package/dist-package/src/ModalPaper/index.js.map +0 -1
  42. package/dist-package/src/ModalTitle/ModalTitle.d.ts +0 -10
  43. package/dist-package/src/ModalTitle/ModalTitle.d.ts.map +0 -1
  44. package/dist-package/src/ModalTitle/ModalTitle.js +0 -22
  45. package/dist-package/src/ModalTitle/ModalTitle.js.map +0 -1
  46. package/dist-package/src/ModalTitle/index.d.ts +0 -5
  47. package/dist-package/src/ModalTitle/index.d.ts.map +0 -1
  48. package/dist-package/src/ModalTitle/index.js +0 -2
  49. package/dist-package/src/ModalTitle/index.js.map +0 -1
  50. package/dist-package/src/index.d.ts +0 -6
  51. package/dist-package/src/index.d.ts.map +0 -1
  52. package/dist-package/src/index.js +0 -6
  53. package/dist-package/src/index.js.map +0 -1
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@toptal/picasso-modal",
3
- "version": "3.2.2",
3
+ "version": "3.2.3-alpha-1757603192867.0",
4
4
  "description": "Toptal UI components library - Modal",
5
5
  "publishConfig": {
6
- "access": "public"
6
+ "access": "public",
7
+ "provenance": true
7
8
  },
8
9
  "main": "./dist-package/src/index.js",
9
10
  "module": "./dist-package/src/index.js",
10
11
  "scripts": {
11
12
  "build:package": "tsc -b tsconfig.json",
12
- "prepublishOnly": "yarn build:package"
13
+ "prepublishOnly": "echo 0"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -23,15 +24,15 @@
23
24
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
25
  "dependencies": {
25
26
  "@mui/base": "5.0.0-beta.58",
26
- "@toptal/picasso-backdrop": "1.0.9",
27
- "@toptal/picasso-fade": "1.0.8",
28
- "@toptal/picasso-paper": "4.0.3",
29
- "@toptal/picasso-shared": "15.0.0",
30
- "@toptal/picasso-button": "4.0.23",
31
- "@toptal/picasso-icons": "1.12.1",
32
- "@toptal/picasso-typography": "4.0.4",
33
- "@toptal/picasso-utils": "3.1.0",
34
- "@toptal/picasso-modal-context": "1.0.1",
27
+ "@toptal/picasso-backdrop": "1.0.10-alpha-1757603192867.0",
28
+ "@toptal/picasso-fade": "1.0.9-alpha-1757603192867.0",
29
+ "@toptal/picasso-paper": "4.0.4-alpha-1757603192867.0",
30
+ "@toptal/picasso-shared": "15.0.1-alpha-1757603192867.0",
31
+ "@toptal/picasso-button": "4.0.24-alpha-1757603192867.0",
32
+ "@toptal/picasso-icons": "1.12.2-alpha-1757603192867.0",
33
+ "@toptal/picasso-typography": "4.0.5-alpha-1757603192867.0",
34
+ "@toptal/picasso-utils": "3.1.1-alpha-1757603192867.0",
35
+ "@toptal/picasso-modal-context": "1.0.2-alpha-1757603192867.0",
35
36
  "debounce": "^1.2.1"
36
37
  },
37
38
  "sideEffects": [
@@ -39,18 +40,18 @@
39
40
  "**/styles.js"
40
41
  ],
41
42
  "peerDependencies": {
42
- "@toptal/picasso-provider": "*",
43
+ "@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
43
44
  "react": ">=16.12.0 < 19.0.0",
44
- "@toptal/picasso-tailwind": ">=2.5.0",
45
- "@toptal/picasso-tailwind-merge": "^2.0.0"
45
+ "@toptal/picasso-tailwind": "3.0.1-alpha-1757603192867.0",
46
+ "@toptal/picasso-tailwind-merge": "2.0.4-alpha-1757603192867.0"
46
47
  },
47
48
  "exports": {
48
49
  ".": "./dist-package/src/index.js"
49
50
  },
50
51
  "devDependencies": {
51
- "@toptal/picasso-provider": "5.0.1",
52
- "@toptal/picasso-tailwind-merge": "2.0.3",
53
- "@toptal/picasso-test-utils": "1.1.1"
52
+ "@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
53
+ "@toptal/picasso-tailwind-merge": "2.0.4-alpha-1757603192867.0",
54
+ "@toptal/picasso-test-utils": "1.1.2-alpha-1757603192867.0"
54
55
  },
55
56
  "files": [
56
57
  "dist-package/**",
@@ -1,41 +0,0 @@
1
- import type { ReactNode, HTMLAttributes } from 'react';
2
- import React from 'react';
3
- import type { BaseProps, SizeType, TransitionProps } from '@toptal/picasso-shared';
4
- declare type ContainerValue = HTMLElement | (() => HTMLElement);
5
- declare type Alignment = 'top' | 'centered';
6
- export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
7
- /** Content of Modal component */
8
- children: ReactNode;
9
- /** Whether modal should be displayed */
10
- open: boolean;
11
- /** Width of modal */
12
- size?: SizeType<'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'> | 'full-screen';
13
- /** Callback executed when backdrop was clicked */
14
- onBackdropClick?: () => void;
15
- /** If `true`, clicking the backdrop will not fire `onClose` or `onBackdropClick` */
16
- disableBackdropClick?: boolean;
17
- /** Callback executed when attempting to close modal */
18
- onClose?: () => void;
19
- /** Callback executed when modal is being opened */
20
- onOpen?: () => void;
21
- /** A node, or a function that returns node. The container will have the portal children appended to it. */
22
- container?: ContainerValue;
23
- /** If `true`, the backdrop is not rendered */
24
- hideBackdrop?: boolean;
25
- /** Position of the modal relative to the browser's viewport */
26
- align?: Alignment;
27
- /** Animation lifecycle callbacks. Backed by [react-transition-group/Transition](https://reactcommunity.org/react-transition-group/transition#Transition-props) */
28
- transitionProps?: TransitionProps;
29
- transitionDuration?: number;
30
- /** used for specifying aria attributes, changing role, or customizing styles */
31
- paperProps?: React.HTMLAttributes<HTMLDivElement>;
32
- testIds?: {
33
- closeButton?: string;
34
- };
35
- classes?: {
36
- closeButton?: string;
37
- };
38
- }
39
- export declare const Modal: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
40
- export default Modal;
41
- //# sourceMappingURL=Modal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,KAMN,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EAChB,MAAM,wBAAwB,CAAA;AAgB/B,aAAK,cAAc,GAAG,WAAW,GAAG,CAAC,MAAM,WAAW,CAAC,CAAA;AACvD,aAAK,SAAS,GAAG,KAAK,GAAG,UAAU,CAAA;AAEnC,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,iCAAiC;IACjC,QAAQ,EAAE,SAAS,CAAA;IACnB,wCAAwC;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,qBAAqB;IACrB,IAAI,CAAC,EACD,QAAQ,CAAC,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC5D,aAAa,CAAA;IACjB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,oFAAoF;IACpF,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,2GAA2G;IAC3G,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,kKAAkK;IAClK,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gFAAgF;IAChF,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;IACjD,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;CACF;AAuDD,eAAO,MAAM,KAAK,8EA2JhB,CAAA;AAYF,eAAe,KAAK,CAAA"}
@@ -1,139 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { Modal as Dialog } from '@mui/base/Modal';
13
- import React, { forwardRef, useEffect, useRef, useCallback, useContext, } from 'react';
14
- import { usePicassoRoot, RootContext } from '@toptal/picasso-provider';
15
- import { CloseMinor16 } from '@toptal/picasso-icons';
16
- import { useCombinedRefs, ModalManager, usePageScrollLock, } from '@toptal/picasso-utils';
17
- import { ButtonCircular } from '@toptal/picasso-button';
18
- import { Fade } from '@toptal/picasso-fade';
19
- import { Backdrop } from '@toptal/picasso-backdrop';
20
- import ModalContext from '@toptal/picasso-modal-context';
21
- import { twMerge } from '@toptal/picasso-tailwind-merge';
22
- import { ModalPaper } from '../ModalPaper';
23
- const defaultManager = new ModalManager();
24
- // https://github.com/udacity/ud891/blob/gh-pages/lesson2-focus/07-modals-and-keyboard-traps/solution/modal.js#L25
25
- // found in https://developers.google.com/web/fundamentals/accessibility/focus/using-tabindex
26
- const focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
27
- const tooltipContainerString = '[role=tooltip]';
28
- const focusFirstFocusableElement = (node) => {
29
- const elements = node.querySelectorAll(focusableElementsString);
30
- // Convert NodeList to Array
31
- const focusableElements = Array.prototype.slice.call(elements);
32
- if (focusableElements.length > 0) {
33
- focusableElements[0].focus();
34
- }
35
- };
36
- const isFocusInsideModal = (modalNode) => {
37
- const modalContainsFocusedElement = modalNode.contains(document.activeElement);
38
- if (modalContainsFocusedElement) {
39
- return true;
40
- }
41
- return false;
42
- };
43
- const isFocusInsideTooltip = () => {
44
- const tooltipContainers = document.querySelectorAll(tooltipContainerString);
45
- if (tooltipContainers.length === 0) {
46
- return false;
47
- }
48
- const tooltipContainsFocusedElement = Array.from(tooltipContainers).some(container => container.contains(document.activeElement));
49
- if (tooltipContainsFocusedElement) {
50
- return true;
51
- }
52
- return false;
53
- };
54
- const generateKey = (() => {
55
- let count = 0;
56
- return () => ++count;
57
- })();
58
- // eslint-disable-next-line react/display-name
59
- export const Modal = forwardRef(function Modal(props, ref) {
60
- const { children, open, size = 'medium', onBackdropClick, onClose, onOpen, className, style, container, hideBackdrop = false, transitionDuration = 300, paperProps, align = 'centered', testIds, transitionProps, disableBackdropClick = false, classes } = props, rest = __rest(props, ["children", "open", "size", "onBackdropClick", "onClose", "onOpen", "className", "style", "container", "hideBackdrop", "transitionDuration", "paperProps", "align", "testIds", "transitionProps", "disableBackdropClick", "classes"]);
61
- const picassoRootContainer = usePicassoRoot();
62
- const modalRef = useCombinedRefs(ref, useRef(null));
63
- const modalId = useRef(generateKey());
64
- const { rootRef } = useContext(RootContext);
65
- useEffect(() => {
66
- const handleDocumentFocus = () => {
67
- if (!(rootRef === null || rootRef === void 0 ? void 0 : rootRef.current)) {
68
- console.warn('Modal is not rendered inside PicassoRoot, some things might not work as expected. Please open the Modal on mount using useEffect.');
69
- }
70
- if (!defaultManager.isTopModal(modalId.current)) {
71
- return;
72
- }
73
- if (!modalRef || !modalRef.current) {
74
- return;
75
- }
76
- if (isFocusInsideModal(modalRef.current)) {
77
- return;
78
- }
79
- if (isFocusInsideTooltip()) {
80
- return;
81
- }
82
- focusFirstFocusableElement(modalRef.current);
83
- };
84
- if (!open) {
85
- return;
86
- }
87
- document.addEventListener('focus', handleDocumentFocus, true);
88
- return () => {
89
- document.removeEventListener('focus', handleDocumentFocus, true);
90
- };
91
- }, [open, modalRef, rootRef]);
92
- useEffect(() => {
93
- const currentModalId = modalId.current;
94
- if (open) {
95
- defaultManager.add(currentModalId);
96
- }
97
- return () => {
98
- defaultManager.remove(currentModalId);
99
- };
100
- }, [open]);
101
- usePageScrollLock(open);
102
- const handleClose = useCallback((_event, reason) => {
103
- if (reason === 'escapeKeyDown' && onClose) {
104
- onClose();
105
- }
106
- else if (reason === 'backdropClick' && !disableBackdropClick) {
107
- if (onBackdropClick) {
108
- onBackdropClick();
109
- }
110
- if (onClose) {
111
- onClose();
112
- }
113
- }
114
- }, [disableBackdropClick, onBackdropClick, onClose]);
115
- const duration = (transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.timeout) || transitionDuration;
116
- const backdropProps = { transitionDuration: duration };
117
- return (React.createElement(Dialog, Object.assign({}, rest, { ref: modalRef, className: twMerge(className, 'fixed z-modal inset-0 flex flex-col text-lg leading-[normal] justify-center items-center'), style: style, slots: {
118
- backdrop: Backdrop,
119
- }, closeAfterTransition: true, slotProps: {
120
- backdrop: backdropProps,
121
- }, container: container || picassoRootContainer, hideBackdrop: hideBackdrop, onClose: handleClose, open: open, disableEnforceFocus // we need our own mechanism to keep focus inside the Modals
122
- : true, disableScrollLock: true }),
123
- React.createElement(Fade, { in: open, onEnter: onOpen, onExited: transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.onExited, timeout: transitionDuration },
124
- React.createElement(ModalPaper, Object.assign({ size: size, align: align, tabIndex: -1 }, paperProps),
125
- React.createElement(ModalContext.Provider, { value: true },
126
- children,
127
- onClose && (React.createElement(ButtonCircular, { "aria-label": 'Close', variant: 'flat', className: twMerge('absolute top-8 right-8', classes === null || classes === void 0 ? void 0 : classes.closeButton), onClick: onClose, "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.closeButton },
128
- React.createElement(CloseMinor16, null))))))));
129
- });
130
- Modal.defaultProps = {
131
- hideBackdrop: false,
132
- disableBackdropClick: false,
133
- size: 'medium',
134
- transitionDuration: 300,
135
- align: 'centered',
136
- };
137
- Modal.displayName = 'Modal';
138
- export default Modal;
139
- //# sourceMappingURL=Modal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,GACX,MAAM,OAAO,CAAA;AAMd,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,YAAY,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAyC1C,MAAM,cAAc,GAAG,IAAI,YAAY,EAAE,CAAA;AAEzC,kHAAkH;AAClH,6FAA6F;AAC7F,MAAM,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kB,EAAE,GAAG;IACvB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,eAAe,KAAK,CAAA"}
@@ -1,7 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props } from './Modal';
3
- export { default as Modal } from './Modal';
4
- export { default as ModalContext } from '@toptal/picasso-modal-context';
5
- export declare type ModalProps = OmitInternalProps<Props>;
6
- export * from './Modal';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,oBAAY,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACjD,cAAc,SAAS,CAAA"}
@@ -1,4 +0,0 @@
1
- export { default as Modal } from './Modal';
2
- export { default as ModalContext } from '@toptal/picasso-modal-context';
3
- export * from './Modal';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEvE,cAAc,SAAS,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { ReactNode, HTMLAttributes } from 'react';
2
- import React from 'react';
3
- import type { BaseProps } from '@toptal/picasso-shared';
4
- export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
5
- /** Action content (e.g. Buttons) */
6
- children: ReactNode;
7
- }
8
- export declare const ModalActions: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
9
- export default ModalActions;
10
- //# sourceMappingURL=ModalActions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalActions.d.ts","sourceRoot":"","sources":["../../../src/ModalActions/ModalActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,YAAY,8EAexB,CAAA;AAID,eAAe,YAAY,CAAA"}
@@ -1,20 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { forwardRef } from 'react';
13
- import { twMerge } from '@toptal/picasso-tailwind-merge';
14
- export const ModalActions = forwardRef(function ModalActions(props, ref) {
15
- const { children, className, style } = props, rest = __rest(props, ["children", "className", "style"]);
16
- return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: twMerge('mt-0 mx-8 mb-8 text-right', className), style: style }), children));
17
- });
18
- ModalActions.displayName = 'ModalActions';
19
- export default ModalActions;
20
- //# sourceMappingURL=ModalActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalActions.js","sourceRoot":"","sources":["../../../src/ModalActions/ModalActions.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAOxD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,SAAS,YAAY,CAAC,KAAK,EAAE,GAAG;IAC9B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA/C,kCAAuC,CAAQ,CAAA;IAErD,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAC1D,KAAK,EAAE,KAAK,KAEX,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAEzC,eAAe,YAAY,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props } from './ModalActions';
3
- export { default as ModalActions } from './ModalActions';
4
- export declare type ModalActionsProps = OmitInternalProps<Props>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ModalActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,oBAAY,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as ModalActions } from './ModalActions';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ModalActions/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const ModalCompound: import("react").ForwardRefExoticComponent<import("../Modal").Props & import("react").RefAttributes<HTMLDivElement>> & {
3
- Content: import("react").ForwardRefExoticComponent<import("../ModalContent/ModalContent").Props & import("react").RefAttributes<HTMLDivElement>>;
4
- Actions: import("react").ForwardRefExoticComponent<import("../ModalActions/ModalActions").Props & import("react").RefAttributes<HTMLDivElement>>;
5
- Title: import("react").ForwardRefExoticComponent<import("../ModalTitle/ModalTitle").Props & import("react").RefAttributes<HTMLDivElement>>;
6
- };
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ModalCompound/index.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,aAAa;;;;CAIxB,CAAA"}
@@ -1,10 +0,0 @@
1
- import { Modal } from '../Modal';
2
- import { ModalActions } from '../ModalActions';
3
- import { ModalContent } from '../ModalContent';
4
- import { ModalTitle } from '../ModalTitle';
5
- export const ModalCompound = Object.assign(Modal, {
6
- Content: ModalContent,
7
- Actions: ModalActions,
8
- Title: ModalTitle,
9
- });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ModalCompound/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IAChD,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,UAAU;CAClB,CAAC,CAAA"}
@@ -1,15 +0,0 @@
1
- import type { ReactNode, HTMLAttributes } from 'react';
2
- import React from 'react';
3
- import type { BaseProps } from '@toptal/picasso-shared';
4
- export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
5
- /** Content of Modal */
6
- children: ReactNode;
7
- classes?: {
8
- root?: string;
9
- topShade?: string;
10
- bottomShade?: string;
11
- };
12
- }
13
- export declare const ModalContent: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
14
- export default ModalContent;
15
- //# sourceMappingURL=ModalContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/ModalContent/ModalContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAMvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,uBAAuB;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACrE;AACD,eAAO,MAAM,YAAY,8EA0DxB,CAAA;AAID,eAAe,YAAY,CAAA"}
@@ -1,38 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { forwardRef } from 'react';
13
- import { useCombinedRefs } from '@toptal/picasso-utils';
14
- import { twMerge } from '@toptal/picasso-tailwind-merge';
15
- import useScrollableShades from './hooks/use-scrollable-shades';
16
- export const ModalContent = forwardRef(function ModalContent(props, ref) {
17
- const { children, className, style, classes } = props, rest = __rest(props
18
- /**
19
- * This is necessary to ensure if ref is not passed in, there's still a ref to calculate
20
- * when to show the scrollable shades or not.
21
- */
22
- , ["children", "className", "style", "classes"]);
23
- /**
24
- * This is necessary to ensure if ref is not passed in, there's still a ref to calculate
25
- * when to show the scrollable shades or not.
26
- */
27
- const modalContentRef = useCombinedRefs(ref);
28
- const { top, bottom } = useScrollableShades(modalContentRef);
29
- const shadeClasses = 'z-[1] absolute pointer-events-none right-8 left-8 h-[112px]';
30
- const gradientClasses = 'from-white to-transparent to-100% from-0% via-[2rem] via-white';
31
- return (React.createElement("div", { className: twMerge('flex relative flex-auto overflow-y-hidden', classes === null || classes === void 0 ? void 0 : classes.root) },
32
- top && (React.createElement("div", { className: twMerge(shadeClasses, gradientClasses, classes === null || classes === void 0 ? void 0 : classes.topShade, 'top-0 bg-gradient-to-b') })),
33
- bottom && (React.createElement("div", { className: twMerge(shadeClasses, gradientClasses, classes === null || classes === void 0 ? void 0 : classes.bottomShade, 'bottom-0 bg-gradient-to-t') })),
34
- React.createElement("div", Object.assign({}, rest, { style: style, ref: modalContentRef, className: twMerge('pt-6 px-8 pb-8 overflow-auto flex-auto', className) }), children)));
35
- });
36
- ModalContent.displayName = 'ModalContent';
37
- export default ModalContent;
38
- //# sourceMappingURL=ModalContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalContent.js","sourceRoot":"","sources":["../../../src/ModalContent/ModalContent.tsx"],"names":[],"mappings":";;;;;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H,CAAC,CACF,CAAA;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAEzC,eAAe,YAAY,CAAA"}
@@ -1,6 +0,0 @@
1
- declare const useScrollableShades: (ref: React.RefObject<HTMLDivElement>) => {
2
- top: boolean;
3
- bottom: boolean;
4
- };
5
- export default useScrollableShades;
6
- //# sourceMappingURL=use-scrollable-shades.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-scrollable-shades.d.ts","sourceRoot":"","sources":["../../../../src/ModalContent/hooks/use-scrollable-shades.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,mBAAmB,QAAS,MAAM,SAAS,CAAC,cAAc,CAAC;;;CAsChE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,34 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import debounce from 'debounce';
3
- const useScrollableShades = (ref) => {
4
- const [top, setTop] = useState(false);
5
- const [bottom, setBottom] = useState(false);
6
- useEffect(() => {
7
- const el = ref.current;
8
- if (!el) {
9
- return;
10
- }
11
- const updateShades = debounce(() => {
12
- if (el.clientHeight === el.scrollHeight) {
13
- setTop(false);
14
- setBottom(false);
15
- }
16
- setTop(el.scrollTop > 0);
17
- setBottom(Math.ceil(el.scrollTop) + el.clientHeight < el.scrollHeight);
18
- }, 20);
19
- updateShades();
20
- el.addEventListener('scroll', updateShades);
21
- window.addEventListener('resize', updateShades);
22
- const observer = new MutationObserver(updateShades);
23
- observer.observe(el, { childList: true, subtree: true });
24
- return () => {
25
- updateShades.clear();
26
- el.removeEventListener('scroll', updateShades);
27
- window.addEventListener('resize', updateShades);
28
- observer.disconnect();
29
- };
30
- }, [ref]);
31
- return { top, bottom };
32
- };
33
- export default useScrollableShades;
34
- //# sourceMappingURL=use-scrollable-shades.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-scrollable-shades.js","sourceRoot":"","sources":["../../../../src/ModalContent/hooks/use-scrollable-shades.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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C,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YAC9C,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YAC/C,QAAQ,CAAC,UAAU,EAAE,CAAA;QACvB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAET,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AACxB,CAAC,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props } from './ModalContent';
3
- export { default as ModalContent } from './ModalContent';
4
- export declare type ModalContentProps = OmitInternalProps<Props>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ModalContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,oBAAY,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as ModalContent } from './ModalContent';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ModalContent/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import type { SizeType } from '@toptal/picasso-shared';
3
- declare type PaperSize = SizeType<'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'> | 'full-screen';
4
- declare type Alignment = 'top' | 'centered';
5
- interface Props extends React.HTMLAttributes<HTMLDivElement> {
6
- align: Alignment;
7
- children: React.ReactNode;
8
- /** Width of modal */
9
- size: PaperSize;
10
- }
11
- export declare const ModalPaper: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
12
- export default ModalPaper;
13
- //# sourceMappingURL=ModalPaper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalPaper.d.ts","sourceRoot":"","sources":["../../../src/ModalPaper/ModalPaper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAItD,aAAK,SAAS,GACV,QAAQ,CAAC,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC5D,aAAa,CAAA;AACjB,aAAK,SAAS,GAAG,KAAK,GAAG,UAAU,CAAA;AAEnC,UAAU,KAAM,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1D,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAA;CAChB;AA+BD,eAAO,MAAM,UAAU,8EAqBtB,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,43 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from 'react';
13
- import { Paper } from '@toptal/picasso-paper';
14
- import { twMerge } from '@toptal/picasso-tailwind-merge';
15
- const fullscreenClasses = `h-full w-full max-h-full max-w-full`;
16
- const defaultClasses = `m-4 sm:h-auto sm:m-8 max-w-[calc(100%_-_2rem)] sm:max-w-[calc(100%_-_6rem)] rounded-md`;
17
- const sizeBasedClasses = {
18
- xsmall: `${defaultClasses} w-[20.5rem]`,
19
- small: `${defaultClasses} w-[32.5rem]`,
20
- medium: `${defaultClasses} w-[40.625rem]`,
21
- large: `${defaultClasses} w-[50rem]`,
22
- xlarge: `${defaultClasses} w-[75rem]`,
23
- 'full-screen': fullscreenClasses,
24
- };
25
- const alignBasedClasses = {
26
- centered: 'relative',
27
- top: 'absolute top-0',
28
- };
29
- const getMaxHeightClass = (size, align) => {
30
- if (size === 'full-screen') {
31
- return 'max-h-full';
32
- }
33
- if (align === 'top') {
34
- return `max-h-[calc(100%_-_2rem)] sm:max-h-[calc(100%_-_4rem)]`;
35
- }
36
- return `max-h-[calc(100%_-_2rem)] sm:max-h-[calc(100%_-_6rem)]`;
37
- };
38
- export const ModalPaper = React.forwardRef(function ModalPaper(_a, ref) {
39
- var { children, size, align, className } = _a, props = __rest(_a, ["children", "size", "align", "className"]);
40
- return (React.createElement(Paper, Object.assign({ ref: ref, role: 'dialog', elevation: 2, className: twMerge(className, 'outline-none overflow-y-auto', 'flex flex-col', sizeBasedClasses[size], alignBasedClasses[align], getMaxHeightClass(size, align)) }, props), children));
41
- });
42
- export default ModalPaper;
43
- //# sourceMappingURL=ModalPaper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalPaper.js","sourceRoot":"","sources":["../../../src/ModalPaper/ModalPaper.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAcxD,MAAM,iBAAiB,GAAG,qCAAqC,CAAA;AAC/D,MAAM,cAAc,GAAG,wFAAwF,CAAA;AAE/G,MAAM,gBAAgB,GAAG;IACvB,MAAM,EAAE,GAAG,cAAc,cAAc;IACvC,KAAK,EAAE,GAAG,cAAc,cAAc;IACtC,MAAM,EAAE,GAAG,cAAc,gBAAgB;IACzC,KAAK,EAAE,GAAG,cAAc,YAAY;IACpC,MAAM,EAAE,GAAG,cAAc,YAAY;IACrC,aAAa,EAAE,iBAAiB;CACjC,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,gBAAgB;CACtB,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,IAAe,EAAE,KAAgB,EAAE,EAAE;IAC9D,IAAI,IAAI,KAAK,aAAa,EAAE;QAC1B,OAAO,YAAY,CAAA;KACpB;IAED,IAAI,KAAK,KAAK,KAAK,EAAE;QACnB,OAAO,wDAAwD,CAAA;KAChE;IAED,OAAO,wDAAwD,CAAA;AACjE,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,SAAS,UAAU,CAAC,EAA8C,EAAE,GAAG;QAAnD,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,OAAY,EAAP,KAAK,cAA5C,0CAA8C,CAAF;IAC9D,OAAO,CACL,oBAAC,KAAK,kBACJ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,OAAO,CAChB,SAAS,EACT,8BAA8B,EAC9B,eAAe,EACf,gBAAgB,CAAC,IAAI,CAAC,EACtB,iBAAiB,CAAC,KAAK,CAAC,EACxB,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAC/B,IACG,KAAK,GAER,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,2 +0,0 @@
1
- export { ModalPaper } from './ModalPaper';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ModalPaper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
@@ -1,2 +0,0 @@
1
- export { ModalPaper } from './ModalPaper';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ModalPaper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { ReactNode, HTMLAttributes } from 'react';
2
- import React from 'react';
3
- import type { BaseProps } from '@toptal/picasso-shared';
4
- export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {
5
- /** Title content */
6
- children: ReactNode;
7
- }
8
- export declare const ModalTitle: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
9
- export default ModalTitle;
10
- //# sourceMappingURL=ModalTitle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalTitle.d.ts","sourceRoot":"","sources":["../../../src/ModalTitle/ModalTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,oBAAoB;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,UAAU,8EAkBrB,CAAA;AAIF,eAAe,UAAU,CAAA"}
@@ -1,22 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { forwardRef } from 'react';
13
- import { Typography } from '@toptal/picasso-typography';
14
- import { twMerge } from '@toptal/picasso-tailwind-merge';
15
- export const ModalTitle = forwardRef(function ModalTitle(props, ref) {
16
- const { children, className, style } = props, rest = __rest(props, ["children", "className", "style"]);
17
- return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: twMerge('pr-6 mt-8 mx-8 mb-0', className), style: style }),
18
- React.createElement(Typography, { variant: 'heading', size: 'large' }, children)));
19
- });
20
- ModalTitle.displayName = 'ModalTitle';
21
- export default ModalTitle;
22
- //# sourceMappingURL=ModalTitle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalTitle.js","sourceRoot":"","sources":["../../../src/ModalTitle/ModalTitle.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAMxD,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAwB,SAAS,UAAU,CAC7E,KAAK,EACL,GAAG;IAEH,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA/C,kCAAuC,CAAQ,CAAA;IAErD,OAAO,CACL,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,qBAAqB,EAAE,SAAS,CAAC,EACpD,KAAK,EAAE,KAAK;QAEZ,oBAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,IACvC,QAAQ,CACE,CACT,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,eAAe,UAAU,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props } from './ModalTitle';
3
- export { default as ModalTitle } from './ModalTitle';
4
- export declare type ModalTitleProps = OmitInternalProps<Props>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ModalTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,oBAAY,eAAe,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as ModalTitle } from './ModalTitle';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ModalTitle/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
@@ -1,6 +0,0 @@
1
- export * from './Modal';
2
- export * from './ModalCompound';
3
- export * from './ModalActions';
4
- export * from './ModalContent';
5
- export * from './ModalTitle';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
@@ -1,6 +0,0 @@
1
- export * from './Modal';
2
- export * from './ModalCompound';
3
- export * from './ModalActions';
4
- export * from './ModalContent';
5
- export * from './ModalTitle';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}