@indico-data/design-system 2.46.0 → 2.47.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 (45) hide show
  1. package/lib/components/index.d.ts +1 -0
  2. package/lib/components/modal/Modal.d.ts +2 -0
  3. package/lib/components/modal/Modal.stories.d.ts +7 -0
  4. package/lib/components/modal/__tests__/Modal.test.d.ts +1 -0
  5. package/lib/components/modal/index.d.ts +1 -0
  6. package/lib/components/modal/types.d.ts +15 -0
  7. package/lib/index.css +87 -0
  8. package/lib/index.d.ts +27 -48
  9. package/lib/index.esm.css +87 -0
  10. package/lib/index.esm.js +11223 -11386
  11. package/lib/index.esm.js.map +1 -1
  12. package/lib/index.js +11221 -11385
  13. package/lib/index.js.map +1 -1
  14. package/lib/legacy/components/index.d.ts +0 -1
  15. package/package.json +1 -1
  16. package/src/components/index.ts +1 -0
  17. package/src/components/modal/Modal.mdx +111 -0
  18. package/src/components/modal/Modal.stories.tsx +275 -0
  19. package/src/components/modal/Modal.tsx +61 -0
  20. package/src/components/modal/__tests__/Modal.test.tsx +60 -0
  21. package/src/components/modal/index.ts +1 -0
  22. package/src/components/modal/styles/Modal.scss +100 -0
  23. package/src/components/modal/types.ts +15 -0
  24. package/src/index.ts +2 -8
  25. package/src/legacy/components/index.ts +0 -1
  26. package/src/setup/setupIcons.ts +2 -0
  27. package/src/styles/index.scss +1 -0
  28. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.d.ts +0 -17
  29. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.stories.d.ts +0 -44
  30. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +0 -1
  31. package/lib/legacy/components/modals/ConfirmModal/index.d.ts +0 -1
  32. package/lib/legacy/components/modals/ModalBase/ModalBase.d.ts +0 -26
  33. package/lib/legacy/components/modals/ModalBase/ModalBase.stories.d.ts +0 -9
  34. package/lib/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +0 -4
  35. package/lib/legacy/components/modals/ModalBase/index.d.ts +0 -2
  36. package/lib/legacy/components/modals/index.d.ts +0 -2
  37. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.stories.tsx +0 -76
  38. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.styles.ts +0 -27
  39. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.tsx +0 -79
  40. package/src/legacy/components/modals/ConfirmModal/index.ts +0 -1
  41. package/src/legacy/components/modals/ModalBase/ModalBase.stories.tsx +0 -45
  42. package/src/legacy/components/modals/ModalBase/ModalBase.styles.tsx +0 -72
  43. package/src/legacy/components/modals/ModalBase/ModalBase.tsx +0 -79
  44. package/src/legacy/components/modals/ModalBase/index.ts +0 -2
  45. package/src/legacy/components/modals/index.ts +0 -2
@@ -1,3 +1,2 @@
1
1
  export { BarSpinner, CirclePulse, CircleSpinner } from './loading-indicators';
2
- export { ConfirmModal, ModalBase } from './modals';
3
2
  export { Tooltip } from './Tooltip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indico-data/design-system",
3
- "version": "2.46.0",
3
+ "version": "2.47.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "lib/index.js",
@@ -18,4 +18,5 @@ export { DatePicker } from './forms/date/datePicker/DatePicker';
18
18
  export { IconTriggerDatePicker } from './forms/date/iconTriggerDatePicker';
19
19
  export { SingleInputDatePicker } from './forms/date/inputDatePicker';
20
20
  export { InputDateRangePicker } from './forms/date/inputDateRangePicker';
21
+ export { Modal } from './modal';
21
22
  export { Badge } from './badge';
@@ -0,0 +1,111 @@
1
+ import { Canvas, Meta, Controls, Story } from '@storybook/blocks';
2
+ import * as Modal from './Modal.stories';
3
+
4
+ <Meta title="Components/Modal" name="Modal" of={Modal} />
5
+
6
+ # Modal
7
+ The Modal component provides us with a way to display content in a modal window. It can be used as a confirmation modal or as a content modal. It extends the react-modal library. For more information on props not listed here, please visit the [react-modal documentation](https://github.com/reactjs/react-modal).
8
+ <Canvas of={Modal.Default} />
9
+
10
+ ### The following props are available for the Modal component:
11
+
12
+ <Controls of={Modal.Default} />
13
+
14
+ ## Usage
15
+ We have designed this modal with the intention for it to be used as a wrapper for content as you will see below. The recommended way to best use this component is to create your own wrapper in your application for specific modal needs. For example, you may create a wrapper component that displays a confirmation modal. You may also wish to create one for a stepper modal. The idea is that you wrap this modal in a component and build the body of your modal in that wrapped component so that you can reuse the modal component for different modal needs.
16
+
17
+ ### Opening The Modal
18
+ To open the modal, you can use the following as an example. You create a state variable to control the modal's open/close state and then pass that state variable to the modal component.
19
+
20
+ ```tsx
21
+ const [isOpen, setIsOpen] = useState<boolean>(false);
22
+
23
+ const handleOpen = () => {
24
+ setIsOpen(true);
25
+ };
26
+
27
+ const handleClose = () => {
28
+ setIsOpen(false);
29
+ };
30
+
31
+ <Button onClick={handleOpen}>Open Modal</Button>
32
+
33
+ // Modal Component
34
+ <Modal isOpen={isOpen} onRequestClose={handleClose}>
35
+ <h2>The Legend of Zelda</h2>
36
+ </Modal>
37
+ ```
38
+
39
+ ### Content Modal
40
+ The content inside of the Modal tag will be displayed when you open the modal. Anything you pass to the modal should be visible. There is also no set width for the modal, it will take up the width you provide the body elements.
41
+
42
+ ```tsx
43
+ <Modal
44
+ isOpen={isOpen}
45
+ onRequestClose={() => {}}
46
+ shouldCloseOnEsc
47
+ shouldCloseOnOverlayClick
48
+ >
49
+ <h2>
50
+ The Legend of Zelda
51
+ </h2>
52
+ <p>
53
+ In the mystical realm of Hyrule, where ancient magic flows through verdant fields and towering mountains, a timeless tale unfolds across countless generations. The legendary hero Link, eternally reborn when darkness threatens the land, stands as the chosen wielder of the Master Sword and bearer of the Triforce of Courage. Through the ages, he has faced the malevolent forces of Ganon, whose insatiable desire for power has brought destruction and chaos to this peaceful kingdom.
54
+ </p>
55
+ <p>
56
+ Princess Zelda, blessed with the wisdom of the goddesses and keeper of the royal bloodline, serves as both ruler and guardian of Hyrule's most sacred treasures. Together with Link, she maintains the delicate balance between light and shadow, protecting the realm from those who would seek to corrupt its divine power. From the windswept peaks of Death Mountain to the depths of Lake Hylia, their epic saga continues to inspire hope and courage in all who call Hyrule home, as they battle against the forces of evil that would plunge their world into darkness.
57
+ </p>
58
+ <div className="actions text-align--right">
59
+ <hr />
60
+ <Button
61
+ ariaLabel="Close"
62
+ onClick={() => {}}
63
+ variant="outline"
64
+ >
65
+ Close
66
+ </Button>
67
+ </div>
68
+ </Modal>
69
+ ```
70
+
71
+ ### Confirmation Modal
72
+ If you are looking for a confirmation modal, you can use the following as an example.
73
+
74
+ ```tsx
75
+ <Modal isOpen={isOpen} onRequestClose={handleClose}>
76
+ <h2>Would you like to continue?</h2>
77
+ <p>
78
+ If you would like to proceed, please click the confirm button. Otherwise, click the
79
+ cancel button.
80
+ </p>
81
+ <hr />
82
+ <Row nogutter justify="end" align="center">
83
+ <Col xs="content">
84
+ <Button
85
+ onClick={() => {
86
+ console.log('cancelled');
87
+ handleClose();
88
+ }}
89
+ className="mr-2"
90
+ variant="outline"
91
+ ariaLabel="Cancel"
92
+ >
93
+ Cancel
94
+ </Button>
95
+ <Button
96
+ onClick={() => {
97
+ console.log('confirmed');
98
+ handleClose();
99
+ }}
100
+ ariaLabel="Confirm"
101
+ >
102
+ Confirm
103
+ </Button>
104
+ </Col>
105
+ </Row>
106
+ </Modal>
107
+ ```
108
+
109
+ ### Title vs Content
110
+ The title prop is optional for the modal. If you do not provide a title, the modal will only display the content. If you do provide a title, the modal will display the title and content.
111
+
@@ -0,0 +1,275 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Modal } from './Modal';
3
+ import { Col, Container, Row } from '../grid';
4
+ import { useState } from 'react';
5
+ import { Button } from '../button';
6
+ import { registerFontAwesomeIcons } from '@/setup/setupIcons';
7
+ import { indiconDefinitions } from '@/components/icons/indicons';
8
+ import { fas } from '@fortawesome/free-solid-svg-icons';
9
+
10
+ registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
11
+
12
+ const meta: Meta = {
13
+ title: 'Components/Modal',
14
+ component: Modal,
15
+ argTypes: {
16
+ className: {
17
+ control: 'text',
18
+ description: 'Additional classes for the badge component',
19
+ table: {
20
+ category: 'Props',
21
+ type: {
22
+ summary: 'string',
23
+ },
24
+ },
25
+ },
26
+ children: {
27
+ control: false,
28
+ description: 'The content of the badge (superseded by the string prop)',
29
+ table: {
30
+ category: 'Props',
31
+ type: {
32
+ summary: 'React.ReactNode',
33
+ },
34
+ },
35
+ },
36
+ isOpen: {
37
+ control: false,
38
+ description: 'Whether the modal is open',
39
+ table: {
40
+ category: 'Props',
41
+ type: {
42
+ summary: 'boolean',
43
+ },
44
+ },
45
+ },
46
+ onRequestClose: {
47
+ control: false,
48
+ description: 'Callback function to be called when the modal is closed',
49
+ table: {
50
+ category: 'Props',
51
+ type: {
52
+ summary: 'function',
53
+ },
54
+ },
55
+ },
56
+ portalClassName: {
57
+ control: false,
58
+ description: 'Additional classes for the portal element',
59
+ table: {
60
+ category: 'Props',
61
+ type: {
62
+ summary: 'string',
63
+ },
64
+ },
65
+ },
66
+ overlayClassName: {
67
+ control: false,
68
+ description: 'Additional classes for the overlay element',
69
+ table: {
70
+ category: 'Props',
71
+ type: {
72
+ summary: 'string',
73
+ },
74
+ },
75
+ },
76
+ appElement: {
77
+ control: false,
78
+ description: 'The element to use as the app element',
79
+ table: {
80
+ category: 'Props',
81
+ type: {
82
+ summary: 'HTMLElement',
83
+ },
84
+ },
85
+ },
86
+ shouldCloseOnOverlayClick: {
87
+ control: 'boolean',
88
+ description: 'Whether the modal should close when the overlay is clicked',
89
+ table: {
90
+ category: 'Props',
91
+ type: {
92
+ summary: 'boolean',
93
+ },
94
+ },
95
+ },
96
+ shouldCloseOnEsc: {
97
+ control: 'boolean',
98
+ description: 'Whether the modal should close when the escape key is pressed',
99
+ table: {
100
+ category: 'Props',
101
+ type: {
102
+ summary: 'boolean',
103
+ },
104
+ },
105
+ },
106
+ contentElement: {
107
+ control: false,
108
+ description: 'Custom content element for the modal',
109
+ table: {
110
+ category: 'Props',
111
+ type: {
112
+ summary: 'React.ReactNode',
113
+ },
114
+ },
115
+ },
116
+ overlayElement: {
117
+ control: false,
118
+ description: 'Custom overlay element for the modal',
119
+ table: {
120
+ category: 'Props',
121
+ type: {
122
+ summary: 'React.ReactNode',
123
+ },
124
+ },
125
+ },
126
+ position: {
127
+ control: 'select',
128
+ options: ['top', 'center'],
129
+ description: 'The position of the modal opens on the page',
130
+ table: {
131
+ category: 'Props',
132
+ type: {
133
+ summary: 'string',
134
+ },
135
+ },
136
+ },
137
+ testId: {
138
+ table: {
139
+ disable: true,
140
+ },
141
+ },
142
+ },
143
+ };
144
+
145
+ export default meta;
146
+
147
+ type Story = StoryObj<typeof Modal>;
148
+
149
+ export const Default: Story = {
150
+ args: {
151
+ className: '',
152
+ onRequestClose: () => {
153
+ console.log('closed');
154
+ },
155
+ shouldCloseOnOverlayClick: true,
156
+ shouldCloseOnEsc: true,
157
+ },
158
+
159
+ render: (args) => {
160
+ const [isOpen, setIsOpen] = useState<boolean>(false);
161
+
162
+ const handleOpen = () => {
163
+ setIsOpen(true);
164
+ };
165
+
166
+ const handleClose = () => {
167
+ setIsOpen(false);
168
+ };
169
+
170
+ return (
171
+ <Container>
172
+ <Row>
173
+ <Col sm={4}>
174
+ <Modal {...args} isOpen={isOpen} onRequestClose={handleClose}>
175
+ <h2>The Legend of Zelda</h2>
176
+ <p>
177
+ In the mystical realm of Hyrule, where ancient magic flows through verdant fields
178
+ and towering mountains, a timeless tale unfolds across countless generations. The
179
+ legendary hero Link, eternally reborn when darkness threatens the land, stands as
180
+ the chosen wielder of the Master Sword and bearer of the Triforce of Courage.
181
+ Through the ages, he has faced the malevolent forces of Ganon, whose insatiable
182
+ desire for power has brought destruction and chaos to this peaceful kingdom.
183
+ </p>
184
+ <p>
185
+ Princess Zelda, blessed with the wisdom of the goddesses and keeper of the royal
186
+ bloodline, serves as both ruler and guardian of Hyrule's most sacred treasures.
187
+ Together with Link, she maintains the delicate balance between light and shadow,
188
+ protecting the realm from those who would seek to corrupt its divine power. From the
189
+ windswept peaks of Death Mountain to the depths of Lake Hylia, their epic saga
190
+ continues to inspire hope and courage in all who call Hyrule home, as they battle
191
+ against the forces of evil that would plunge their world into darkness.
192
+ </p>
193
+ <div className="actions text-align--right">
194
+ <hr />
195
+ <Button onClick={handleClose} ariaLabel="Close" variant="outline">
196
+ Close
197
+ </Button>
198
+ </div>
199
+ </Modal>
200
+ <Button ariaLabel="open modal" onClick={handleOpen}>
201
+ Open modal
202
+ </Button>
203
+ </Col>
204
+ </Row>
205
+ </Container>
206
+ );
207
+ },
208
+ };
209
+
210
+ export const ConfirmationModal: Story = {
211
+ args: {
212
+ className: '',
213
+ onRequestClose: () => {
214
+ console.log('closed');
215
+ },
216
+ shouldCloseOnOverlayClick: true,
217
+ shouldCloseOnEsc: true,
218
+ },
219
+
220
+ render: (args) => {
221
+ const [isOpen, setIsOpen] = useState<boolean>(false);
222
+
223
+ const handleOpen = () => {
224
+ setIsOpen(true);
225
+ };
226
+
227
+ const handleClose = () => {
228
+ setIsOpen(false);
229
+ };
230
+
231
+ return (
232
+ <Container>
233
+ <Row>
234
+ <Col sm={4}>
235
+ <Modal {...args} isOpen={isOpen} onRequestClose={handleClose}>
236
+ <h2>Would you like to continue?</h2>
237
+ <p>
238
+ If you would like to proceed, please click the confirm button. Otherwise, click the
239
+ cancel button.
240
+ </p>
241
+ <hr />
242
+ <Row nogutter justify="end" align="center">
243
+ <Col xs="content">
244
+ <Button
245
+ onClick={() => {
246
+ console.log('cancelled');
247
+ handleClose();
248
+ }}
249
+ className="mr-2"
250
+ variant="outline"
251
+ ariaLabel="Cancel"
252
+ >
253
+ Cancel
254
+ </Button>
255
+ <Button
256
+ onClick={() => {
257
+ console.log('confirmed');
258
+ handleClose();
259
+ }}
260
+ ariaLabel="Confirm"
261
+ >
262
+ Confirm
263
+ </Button>
264
+ </Col>
265
+ </Row>
266
+ </Modal>
267
+ <Button ariaLabel="open modal" onClick={handleOpen}>
268
+ Open modal
269
+ </Button>
270
+ </Col>
271
+ </Row>
272
+ </Container>
273
+ );
274
+ },
275
+ };
@@ -0,0 +1,61 @@
1
+ import classNames from 'classnames';
2
+ import ReactModal from 'react-modal';
3
+ import { Button } from '../button/Button';
4
+ import { Col, Row } from '../grid';
5
+ import { ModalProps } from './types';
6
+
7
+ export const Modal = ({
8
+ className = '',
9
+ children,
10
+ isOpen,
11
+ onRequestClose,
12
+ portalClassName,
13
+ overlayClassName,
14
+ appElement,
15
+ shouldCloseOnOverlayClick,
16
+ shouldCloseOnEsc,
17
+ testId,
18
+ contentElement,
19
+ overlayElement,
20
+ position = 'center',
21
+ ...rest
22
+ }: ModalProps) => {
23
+ const modalClasses = classNames('modal', `modal--${position}`, className);
24
+ const overlayClasses = classNames('modal-overlay', overlayClassName);
25
+
26
+ return (
27
+ <ReactModal
28
+ style={{}}
29
+ className={modalClasses}
30
+ overlayClassName={overlayClasses}
31
+ testId={testId}
32
+ isOpen={isOpen}
33
+ onRequestClose={onRequestClose}
34
+ portalClassName={portalClassName}
35
+ appElement={appElement}
36
+ shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}
37
+ shouldCloseOnEsc={shouldCloseOnEsc}
38
+ contentElement={contentElement}
39
+ overlayElement={overlayElement}
40
+ {...rest}
41
+ >
42
+ <div className="modal-content">
43
+ <div className="modal-header">
44
+ <Row nogutter>
45
+ <Col xs={12} className="modal-close">
46
+ <Button
47
+ className="modal-close-button"
48
+ onClick={onRequestClose}
49
+ variant="link"
50
+ size="md"
51
+ iconLeft="fa-xmark"
52
+ ariaLabel="Close"
53
+ />
54
+ </Col>
55
+ </Row>
56
+ </div>
57
+ <div className="modal-body">{children}</div>
58
+ </div>
59
+ </ReactModal>
60
+ );
61
+ };
@@ -0,0 +1,60 @@
1
+ import { render, screen, fireEvent } from '@testing-library/react';
2
+ import { Modal } from '../Modal';
3
+
4
+ // Mock ReactModal's app element setting to avoid warnings
5
+ beforeAll(() => {
6
+ const div = document.createElement('div');
7
+ div.setAttribute('id', 'root');
8
+ document.body.appendChild(div);
9
+ });
10
+
11
+ describe('Modal', () => {
12
+ const mockOnRequestClose = jest.fn();
13
+
14
+ const defaultProps = {
15
+ isOpen: true,
16
+ onRequestClose: mockOnRequestClose,
17
+ title: 'Test Modal',
18
+ ariaHideApp: false, // Disable aria hiding for tests
19
+ };
20
+
21
+ beforeEach(() => {
22
+ jest.clearAllMocks();
23
+ });
24
+
25
+ it('renders children content', () => {
26
+ render(
27
+ <Modal {...defaultProps}>
28
+ <p>Modal content</p>
29
+ </Modal>,
30
+ );
31
+ expect(screen.getByText('Modal content')).toBeInTheDocument();
32
+ });
33
+
34
+ it('calls onRequestClose when close button is clicked', () => {
35
+ render(<Modal {...defaultProps} />);
36
+ const closeButton = screen.getByLabelText('Close');
37
+ fireEvent.click(closeButton);
38
+ expect(mockOnRequestClose).toHaveBeenCalledTimes(1);
39
+ });
40
+
41
+ describe('Modal positioning', () => {
42
+ it('applies center position class by default', () => {
43
+ render(<Modal {...defaultProps} />);
44
+ const modal = screen.getByRole('dialog');
45
+ expect(modal).toHaveClass('modal--center');
46
+ });
47
+
48
+ it('applies top position class when specified', () => {
49
+ render(<Modal {...defaultProps} position="top" />);
50
+ const modal = screen.getByRole('dialog');
51
+ expect(modal).toHaveClass('modal--top');
52
+ });
53
+ });
54
+
55
+ it('applies custom className when provided', () => {
56
+ render(<Modal {...defaultProps} className="custom-modal" />);
57
+ const modal = screen.getByRole('dialog');
58
+ expect(modal).toHaveClass('custom-modal');
59
+ });
60
+ });
@@ -0,0 +1 @@
1
+ export { Modal } from './Modal';
@@ -0,0 +1,100 @@
1
+ // Common Variables
2
+ :root {
3
+ --pf-modal-rounded: var(--pf-rounded-lg);
4
+ }
5
+
6
+ // Light Theme Specific Variables
7
+ :root [data-theme='light'] {
8
+ --pf-modal-background-color: var(--pf-white-color);
9
+ --pf-modal-border-color: var(--pf-border-color);
10
+ }
11
+
12
+ // Dark Theme Specific Variables
13
+ :root [data-theme='dark'],
14
+ :root {
15
+ --pf-modal-background-color: var(--pf-primary-color-600);
16
+ --pf-modal-border-color: var(--pf-border-color);
17
+ }
18
+
19
+ // Library overrides
20
+ .ReactModal__Overlay {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ background-color: rgba(0, 0, 0, 0.5);
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ }
31
+ .ReactModal__Overlay {
32
+ opacity: 0;
33
+ transition: opacity 100ms ease-in-out;
34
+ }
35
+
36
+ .ReactModal__Overlay--after-open {
37
+ opacity: 1;
38
+ }
39
+
40
+ .ReactModal__Overlay--before-close {
41
+ opacity: 0;
42
+ }
43
+
44
+ // New CSS
45
+ .modal {
46
+ position: absolute;
47
+ left: 50%;
48
+ transform: translateX(-50%);
49
+ background: var(--pf-background-color);
50
+ border-radius: var(--pf-modal-rounded);
51
+ outline: none;
52
+
53
+ &--center {
54
+ top: 50%;
55
+ transform: translate(-50%, -50%);
56
+ }
57
+
58
+ &--top {
59
+ top: 50px;
60
+ }
61
+
62
+ .modal-content {
63
+ background-color: var(--pf-modal-background-color);
64
+ border: var(--pf-border-sm) solid var(--pf-modal-border-color);
65
+ border-radius: var(--pf-modal-rounded);
66
+
67
+ .modal-body {
68
+ padding: var(--pf-padding-8);
69
+ padding-top: 0;
70
+
71
+ h2 {
72
+ font-size: var(--pf-font-size-h1);
73
+ }
74
+
75
+ h1,
76
+ h2,
77
+ h3,
78
+ h4,
79
+ h5,
80
+ h6 {
81
+ margin-bottom: var(--pf-margin-4);
82
+ }
83
+
84
+ p {
85
+ margin-bottom: var(--pf-margin-4);
86
+ }
87
+
88
+ // We should build a divider component for this
89
+ hr {
90
+ margin-top: var(--pf-margin-8);
91
+ margin-bottom: var(--pf-margin-8);
92
+ border: var(--pf-border-sm) solid var(--pf-border-color);
93
+ }
94
+ }
95
+
96
+ .modal-close {
97
+ text-align: right;
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,15 @@
1
+ export interface ModalProps {
2
+ className?: string;
3
+ children?: React.ReactNode;
4
+ isOpen: boolean;
5
+ onRequestClose?: () => void;
6
+ portalClassName?: string;
7
+ overlayClassName?: string;
8
+ appElement?: HTMLElement;
9
+ shouldCloseOnOverlayClick?: boolean;
10
+ shouldCloseOnEsc?: boolean;
11
+ testId?: string;
12
+ contentElement?: (props: any, children: React.ReactNode) => React.ReactElement;
13
+ overlayElement?: (props: any, contentElement: React.ReactElement) => React.ReactElement;
14
+ position?: 'top' | 'center';
15
+ }
package/src/index.ts CHANGED
@@ -4,14 +4,7 @@ import './setup/setupIcons';
4
4
  // This is so consumers of the DS can import floating ui functions/hooks/types from the DS rather than the (peer dependency) floating-ui package
5
5
  export * from '@floating-ui/react-dom';
6
6
 
7
- export {
8
- BarSpinner,
9
- CirclePulse,
10
- CircleSpinner,
11
- ConfirmModal,
12
- ModalBase,
13
- Tooltip,
14
- } from './legacy/components';
7
+ export { BarSpinner, CirclePulse, CircleSpinner, Tooltip } from './legacy/components';
15
8
 
16
9
  export { Container, Row, Col } from './components/grid';
17
10
  export { Button } from './components/button';
@@ -34,6 +27,7 @@ export { FloatUI } from './components/floatUI';
34
27
  export { Menu } from './components/menu';
35
28
  export { Pill } from './components/pill';
36
29
  export { Badge } from './components/badge';
30
+ export { Modal } from './components/modal';
37
31
 
38
32
  // Utilities
39
33
  export { registerFontAwesomeIcons } from './setup/setupIcons';
@@ -1,3 +1,2 @@
1
1
  export { BarSpinner, CirclePulse, CircleSpinner } from './loading-indicators';
2
- export { ConfirmModal, ModalBase } from './modals';
3
2
  export { Tooltip } from './Tooltip';
@@ -22,6 +22,7 @@ import {
22
22
  faFileDownload,
23
23
  faQuestionCircle,
24
24
  faCopy,
25
+ faXmark,
25
26
  } from '@fortawesome/free-solid-svg-icons';
26
27
  import { indiconDefinitions } from '@/components/icons/indicons';
27
28
 
@@ -52,6 +53,7 @@ registerFontAwesomeIcons(
52
53
  faFileDownload,
53
54
  faQuestionCircle,
54
55
  faCopy,
56
+ faXmark,
55
57
  // backwards compat, don't require registration of custom indicons
56
58
  // might want to consider doing so in the future
57
59
  ...indiconDefinitions,