@dmsi/wedgekit-react 0.0.171 → 0.0.172

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 (39) hide show
  1. package/dist/{chunk-GCBW2LDM.js → chunk-F6YFWBVV.js} +7 -5
  2. package/dist/{chunk-6A54FL75.js → chunk-MJKBQSNI.js} +16 -4
  3. package/dist/{chunk-OJX75MY2.js → chunk-O4JGGMFE.js} +6 -6
  4. package/dist/{chunk-IDSFWKOR.js → chunk-PMBEIP24.js} +1 -1
  5. package/dist/{chunk-KADNOKNW.js → chunk-XH65MD2C.js} +1 -1
  6. package/dist/components/DataGridCell.js +6 -6
  7. package/dist/components/DateInput.js +10 -10
  8. package/dist/components/DateRangeInput.js +10 -10
  9. package/dist/components/FilterGroup.js +5 -5
  10. package/dist/components/Input.js +2 -2
  11. package/dist/components/MobileDataGrid.js +3 -3
  12. package/dist/components/Modal.cjs +18 -4
  13. package/dist/components/Modal.js +4 -4
  14. package/dist/components/ModalButtons.js +2 -2
  15. package/dist/components/ModalHeader.cjs +13 -1
  16. package/dist/components/ModalHeader.js +2 -2
  17. package/dist/components/NavigationTab.js +2 -2
  18. package/dist/components/NavigationTabs.js +2 -2
  19. package/dist/components/Notification.js +3 -3
  20. package/dist/components/OptionPill.js +2 -2
  21. package/dist/components/PDFViewer.cjs +221 -101
  22. package/dist/components/PDFViewer.js +155 -97
  23. package/dist/components/Password.js +2 -2
  24. package/dist/components/Search.js +3 -3
  25. package/dist/components/Select.js +3 -3
  26. package/dist/components/Stepper.js +5 -5
  27. package/dist/components/Time.js +2 -2
  28. package/dist/components/Toast.js +3 -3
  29. package/dist/components/Upload.js +3 -3
  30. package/dist/components/index.js +12 -12
  31. package/dist/index.css +8 -0
  32. package/package.json +1 -1
  33. package/src/components/Modal.tsx +5 -2
  34. package/src/components/ModalHeader.tsx +10 -1
  35. package/src/components/PDFViewer.tsx +86 -15
  36. package/dist/{chunk-MVGOAMTP.js → chunk-4T3DRGLF.js} +3 -3
  37. package/dist/{chunk-T7NDKJDP.js → chunk-C4JGTH6G.js} +3 -3
  38. package/dist/{chunk-UGNB32SL.js → chunk-LM5MKBPM.js} +3 -3
  39. package/dist/{chunk-ZR4E5A43.js → chunk-ZGFQN47L.js} +3 -3
@@ -1,16 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-GCBW2LDM.js";
4
+ } from "../chunk-F6YFWBVV.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
- import "../chunk-T7NDKJDP.js";
6
+ import "../chunk-C4JGTH6G.js";
7
7
  import "../chunk-SYEJVSE4.js";
8
- import "../chunk-6A54FL75.js";
8
+ import "../chunk-MJKBQSNI.js";
9
9
  import "../chunk-ZFOANBWG.js";
10
10
  import {
11
11
  Spinner
12
12
  } from "../chunk-PLMGI5K5.js";
13
- import "../chunk-AZ7LVLOK.js";
13
+ import {
14
+ Heading3
15
+ } from "../chunk-AZ7LVLOK.js";
14
16
  import {
15
17
  Caption
16
18
  } from "../chunk-E7D24OHM.js";
@@ -20,11 +22,14 @@ import {
20
22
  Stack
21
23
  } from "../chunk-N6JVLYEE.js";
22
24
  import {
23
- Icon
24
- } from "../chunk-NKUETCDA.js";
25
+ Paragraph
26
+ } from "../chunk-HVI3CL7Y.js";
25
27
  import {
26
28
  Button
27
29
  } from "../chunk-FKMKHLQH.js";
30
+ import {
31
+ Icon
32
+ } from "../chunk-NKUETCDA.js";
28
33
  import "../chunk-RDLEIAQU.js";
29
34
  import "../chunk-ORMEWXMH.js";
30
35
 
@@ -52,14 +57,32 @@ function PDFViewer(props) {
52
57
  setIsDownloading(false);
53
58
  }, [currentIndex, encodedPdfs]);
54
59
  if (!encodedPdfs.length) return null;
60
+ function handleNextFile() {
61
+ if (currentIndex < encodedPdfs.length - 1) {
62
+ setCurrentIndex((prev) => prev + 1);
63
+ }
64
+ }
65
+ function handlePreviousFile() {
66
+ if (currentIndex > 0) {
67
+ setCurrentIndex((prev) => prev - 1);
68
+ }
69
+ }
70
+ function handleClose() {
71
+ setCurrentIndex(0);
72
+ setIsDownloading(false);
73
+ onClose();
74
+ }
55
75
  return /* @__PURE__ */ jsx(
56
76
  Modal,
57
77
  {
58
78
  testid,
59
79
  open: isOpen,
60
- onClose,
80
+ onClose: handleClose,
61
81
  showButtons: !!customActions,
62
82
  customActions,
83
+ size: "large",
84
+ fixedHeightScrolling: true,
85
+ headerIconAlign: "right",
63
86
  headerIcon: /* @__PURE__ */ jsx(
64
87
  DownloadIcon,
65
88
  {
@@ -68,33 +91,49 @@ function PDFViewer(props) {
68
91
  isDownloading
69
92
  }
70
93
  ),
71
- children: /* @__PURE__ */ jsxs(Stack, { sizing: "layout", children: [
94
+ className: "!max-w-fit",
95
+ children: /* @__PURE__ */ jsxs(Stack, { sizing: "layout", items: "center", children: [
72
96
  /* @__PURE__ */ jsx(PDFElement, { testid, b64: encodedPdfs[currentIndex].base64 }),
73
- /* @__PURE__ */ jsx(Stack, { horizontal: true, overflowX: "auto", sizing: "layout-group", children: encodedPdfs.map((pdf, index) => /* @__PURE__ */ jsxs(
74
- Button,
97
+ !!encodedPdfs[currentIndex].fileName && /* @__PURE__ */ jsx(Paragraph, { children: encodedPdfs[currentIndex].fileName.endsWith(".pdf") ? encodedPdfs[currentIndex].fileName : `${encodedPdfs[currentIndex].fileName}.pdf` }),
98
+ /* @__PURE__ */ jsxs(
99
+ Stack,
75
100
  {
76
- testid: testid ? `${testid}-${pdf.fileName}-button` : void 0,
77
- variant: index === currentIndex ? "primary" : "secondary",
78
- classNameLabel: "items-center flex flex-row gap-2",
79
- onClick: (e) => {
80
- setCurrentIndex(index);
81
- requestAnimationFrame(() => {
82
- const button = e.target;
83
- button.scrollIntoView({
84
- behavior: "smooth",
85
- block: "nearest",
86
- inline: "center"
87
- });
88
- });
89
- },
90
- disabled: isDownloading || currentIndex === index || !pdf.base64,
101
+ horizontal: true,
102
+ overflowX: "auto",
103
+ justify: "center",
104
+ items: "center",
105
+ sizing: "layout-group",
91
106
  children: [
92
- !pdf.base64 && /* @__PURE__ */ jsx(Spinner, {}),
93
- pdf.fileName
107
+ /* @__PURE__ */ jsx(
108
+ Button,
109
+ {
110
+ iconOnly: true,
111
+ variant: "tertiary",
112
+ onClick: handlePreviousFile,
113
+ leftIcon: /* @__PURE__ */ jsx(Icon, { name: "chevron_backward" }),
114
+ disabled: currentIndex === 0,
115
+ testid: testid ? `${testid}-pdf-file-previous-button` : void 0
116
+ }
117
+ ),
118
+ /* @__PURE__ */ jsxs(Heading3, { className: "text-text-primary-normal", children: [
119
+ currentIndex + 1,
120
+ " / ",
121
+ encodedPdfs.length
122
+ ] }),
123
+ /* @__PURE__ */ jsx(
124
+ Button,
125
+ {
126
+ iconOnly: true,
127
+ variant: "tertiary",
128
+ onClick: handleNextFile,
129
+ rightIcon: /* @__PURE__ */ jsx(Icon, { name: "chevron_forward" }),
130
+ disabled: currentIndex === encodedPdfs.length - 1,
131
+ testid: testid ? `${testid}-pdf-file-next-button` : void 0
132
+ }
133
+ )
94
134
  ]
95
- },
96
- `${pdf.fileName}-${index}`
97
- )) })
135
+ }
136
+ )
98
137
  ] })
99
138
  }
100
139
  );
@@ -123,74 +162,93 @@ function PDFElement({ b64, testid }) {
123
162
  workerSrc: "/scripts/pdf.worker.min.mjs",
124
163
  page,
125
164
  canvasRef,
126
- scale: 1
165
+ scale: 1.1
127
166
  });
128
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-4", children: [
129
- pdfDocument ? /* @__PURE__ */ jsx(
130
- "canvas",
131
- {
132
- "data-testid": testid ? `${testid}-pdf-content` : void 0,
133
- ref: canvasRef
134
- }
135
- ) : /* @__PURE__ */ jsx("div", { "data-testid": testid ? `${testid}-pdf-loading` : void 0, children: "Loading PDF..." }),
136
- (pdfDocument == null ? void 0 : pdfDocument.numPages) && pdfDocument.numPages > 1 && /* @__PURE__ */ jsxs(
137
- "ul",
138
- {
139
- className: "flex flex-row justify-between items-center",
140
- "data-testid": testid ? `${testid}-pdf-pagination` : void 0,
141
- children: [
142
- /* @__PURE__ */ jsx("li", { className: "previous", children: /* @__PURE__ */ jsx(
143
- "button",
144
- {
145
- "data-testid": testid ? `${testid}-pdf-pagination-previous-button` : void 0,
146
- disabled: page === 1,
147
- onClick: () => setPage(page - 1),
148
- className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
149
- children: /* @__PURE__ */ jsx(Caption, { children: "Previous" })
150
- }
151
- ) }),
152
- /* @__PURE__ */ jsxs(
153
- "li",
154
- {
155
- "data-testid": testid ? `${testid}-pdf-pagination-text` : void 0,
156
- className: "text-label-desktop text-text-on-action-primary-normal",
157
- children: [
158
- "Page",
159
- " ",
160
- /* @__PURE__ */ jsx(
161
- "span",
162
- {
163
- "data-testid": testid ? `${testid}-pdf-pagination-page-${page}` : void 0,
164
- children: page
165
- }
166
- ),
167
- " ",
168
- "of",
169
- " ",
170
- /* @__PURE__ */ jsx(
171
- "span",
172
- {
173
- "data-testid": testid ? `${testid}-pdf-pagination-total-page-${pdfDocument.numPages}` : void 0,
174
- children: pdfDocument.numPages
175
- }
176
- )
177
- ]
178
- }
179
- ),
180
- /* @__PURE__ */ jsx("li", { className: "next", children: /* @__PURE__ */ jsx(
181
- "button",
182
- {
183
- "data-testid": testid ? `${testid}-pdf-pagination-next-button` : void 0,
184
- disabled: page === pdfDocument.numPages,
185
- onClick: () => setPage(page + 1),
186
- className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
187
- children: /* @__PURE__ */ jsx(Caption, { children: "Next" })
188
- }
189
- ) })
190
- ]
191
- }
192
- )
193
- ] });
167
+ return /* @__PURE__ */ jsxs(
168
+ "div",
169
+ {
170
+ className: "flex flex-col space-y-4 ",
171
+ style: {
172
+ minHeight: 871,
173
+ minWidth: 654
174
+ },
175
+ children: [
176
+ !!pdfDocument && !!b64 ? /* @__PURE__ */ jsx(
177
+ "canvas",
178
+ {
179
+ "data-testid": testid ? `${testid}-pdf-content` : void 0,
180
+ ref: canvasRef
181
+ }
182
+ ) : /* @__PURE__ */ jsx(
183
+ Stack,
184
+ {
185
+ justify: "center",
186
+ items: "center",
187
+ height: "full",
188
+ flexGrow: 1,
189
+ "data-testid": testid ? `${testid}-pdf-loading` : void 0,
190
+ children: /* @__PURE__ */ jsx(Spinner, { size: "large" })
191
+ }
192
+ ),
193
+ (pdfDocument == null ? void 0 : pdfDocument.numPages) && pdfDocument.numPages > 1 && /* @__PURE__ */ jsxs(
194
+ "ul",
195
+ {
196
+ className: "flex flex-row justify-between items-center",
197
+ "data-testid": testid ? `${testid}-pdf-pagination` : void 0,
198
+ children: [
199
+ /* @__PURE__ */ jsx("li", { className: "previous", children: /* @__PURE__ */ jsx(
200
+ "button",
201
+ {
202
+ "data-testid": testid ? `${testid}-pdf-pagination-previous-button` : void 0,
203
+ disabled: page === 1,
204
+ onClick: () => setPage(page - 1),
205
+ className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
206
+ children: /* @__PURE__ */ jsx(Caption, { className: "not-disabled:cursor-pointer not-disabled:hover:underline not-disabled:text-text-primary-normal", children: "Previous" })
207
+ }
208
+ ) }),
209
+ /* @__PURE__ */ jsxs(
210
+ "li",
211
+ {
212
+ "data-testid": testid ? `${testid}-pdf-pagination-text` : void 0,
213
+ className: "text-label-desktop text-text-primary-normal",
214
+ children: [
215
+ "Page",
216
+ " ",
217
+ /* @__PURE__ */ jsx(
218
+ "span",
219
+ {
220
+ "data-testid": testid ? `${testid}-pdf-pagination-page-${page}` : void 0,
221
+ children: page
222
+ }
223
+ ),
224
+ " ",
225
+ "of",
226
+ " ",
227
+ /* @__PURE__ */ jsx(
228
+ "span",
229
+ {
230
+ "data-testid": testid ? `${testid}-pdf-pagination-total-page-${pdfDocument.numPages}` : void 0,
231
+ children: pdfDocument.numPages
232
+ }
233
+ )
234
+ ]
235
+ }
236
+ ),
237
+ /* @__PURE__ */ jsx("li", { className: "next", children: /* @__PURE__ */ jsx(
238
+ "button",
239
+ {
240
+ "data-testid": testid ? `${testid}-pdf-pagination-next-button` : void 0,
241
+ disabled: page === pdfDocument.numPages,
242
+ onClick: () => setPage(page + 1),
243
+ children: /* @__PURE__ */ jsx(Caption, { className: "not-disabled:cursor-pointer not-disabled:hover:underline not-disabled:text-text-primary-normal", children: "Next" })
244
+ }
245
+ ) })
246
+ ]
247
+ }
248
+ )
249
+ ]
250
+ }
251
+ );
194
252
  }
195
253
  export {
196
254
  PDFViewer
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  InputBase
4
- } from "../chunk-MVGOAMTP.js";
5
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-4T3DRGLF.js";
6
5
  import "../chunk-5UH6QUFB.js";
6
+ import "../chunk-JWCT72WR.js";
7
7
  import {
8
8
  Icon
9
9
  } from "../chunk-NKUETCDA.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Search
4
- } from "../chunk-IDSFWKOR.js";
5
- import "../chunk-MVGOAMTP.js";
6
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-PMBEIP24.js";
5
+ import "../chunk-4T3DRGLF.js";
7
6
  import "../chunk-5UH6QUFB.js";
7
+ import "../chunk-JWCT72WR.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
10
10
  import "../chunk-ORMEWXMH.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "../chunk-KADNOKNW.js";
5
- import "../chunk-MVGOAMTP.js";
6
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-XH65MD2C.js";
5
+ import "../chunk-4T3DRGLF.js";
7
6
  import "../chunk-5UH6QUFB.js";
7
+ import "../chunk-JWCT72WR.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
10
10
  import "../chunk-ORMEWXMH.js";
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  InputBase
4
- } from "../chunk-MVGOAMTP.js";
5
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-4T3DRGLF.js";
6
5
  import "../chunk-5UH6QUFB.js";
7
- import {
8
- Icon
9
- } from "../chunk-NKUETCDA.js";
6
+ import "../chunk-JWCT72WR.js";
10
7
  import {
11
8
  Button
12
9
  } from "../chunk-FKMKHLQH.js";
10
+ import {
11
+ Icon
12
+ } from "../chunk-NKUETCDA.js";
13
13
  import {
14
14
  componentGap
15
15
  } from "../chunk-RDLEIAQU.js";
@@ -3,9 +3,9 @@ import {
3
3
  } from "../chunk-6LN6QT6M.js";
4
4
  import {
5
5
  InputBase
6
- } from "../chunk-MVGOAMTP.js";
7
- import "../chunk-JWCT72WR.js";
6
+ } from "../chunk-4T3DRGLF.js";
8
7
  import "../chunk-5UH6QUFB.js";
8
+ import "../chunk-JWCT72WR.js";
9
9
  import {
10
10
  Stack
11
11
  } from "../chunk-N6JVLYEE.js";
@@ -5,12 +5,12 @@ import {
5
5
  import {
6
6
  Paragraph
7
7
  } from "../chunk-HVI3CL7Y.js";
8
- import {
9
- Icon
10
- } from "../chunk-NKUETCDA.js";
11
8
  import {
12
9
  Button
13
10
  } from "../chunk-FKMKHLQH.js";
11
+ import {
12
+ Icon
13
+ } from "../chunk-NKUETCDA.js";
14
14
  import {
15
15
  componentGap,
16
16
  componentPadding,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Paragraph
3
3
  } from "../chunk-HVI3CL7Y.js";
4
- import {
5
- Icon
6
- } from "../chunk-NKUETCDA.js";
7
4
  import {
8
5
  Button
9
6
  } from "../chunk-FKMKHLQH.js";
7
+ import {
8
+ Icon
9
+ } from "../chunk-NKUETCDA.js";
10
10
  import {
11
11
  componentGap
12
12
  } from "../chunk-RDLEIAQU.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-3WNXMCZV.js";
4
4
  import {
5
5
  Select
6
- } from "../chunk-KADNOKNW.js";
6
+ } from "../chunk-XH65MD2C.js";
7
7
  import {
8
8
  Checkbox
9
9
  } from "../chunk-WFQEE2OO.js";
@@ -12,29 +12,29 @@ import {
12
12
  DataGridCell,
13
13
  DragAlongCell,
14
14
  DraggableCellHeader
15
- } from "../chunk-OJX75MY2.js";
16
- import {
17
- MenuOption
18
- } from "../chunk-FFU6FB3K.js";
15
+ } from "../chunk-O4JGGMFE.js";
19
16
  import {
20
17
  Menu
21
18
  } from "../chunk-UBU6IJML.js";
22
19
  import "../chunk-5GUW4DUY.js";
20
+ import {
21
+ MenuOption
22
+ } from "../chunk-FFU6FB3K.js";
23
23
  import {
24
24
  useInfiniteScroll
25
25
  } from "../chunk-WNQ53SVY.js";
26
- import "../chunk-WVUIIBRR.js";
27
26
  import "../chunk-6LN6QT6M.js";
28
27
  import {
29
28
  Search
30
- } from "../chunk-IDSFWKOR.js";
29
+ } from "../chunk-PMBEIP24.js";
31
30
  import {
32
31
  Input
33
- } from "../chunk-MVGOAMTP.js";
32
+ } from "../chunk-4T3DRGLF.js";
33
+ import "../chunk-5UH6QUFB.js";
34
34
  import {
35
35
  Label
36
36
  } from "../chunk-JWCT72WR.js";
37
- import "../chunk-5UH6QUFB.js";
37
+ import "../chunk-WVUIIBRR.js";
38
38
  import {
39
39
  Subheader
40
40
  } from "../chunk-CYZL57LH.js";
@@ -48,12 +48,12 @@ import {
48
48
  import {
49
49
  Paragraph
50
50
  } from "../chunk-HVI3CL7Y.js";
51
- import {
52
- Icon
53
- } from "../chunk-NKUETCDA.js";
54
51
  import {
55
52
  Button
56
53
  } from "../chunk-FKMKHLQH.js";
54
+ import {
55
+ Icon
56
+ } from "../chunk-NKUETCDA.js";
57
57
  import {
58
58
  componentGap,
59
59
  componentPadding
package/dist/index.css CHANGED
@@ -843,6 +843,9 @@
843
843
  .w-screen {
844
844
  width: 100vw;
845
845
  }
846
+ .\!max-w-fit {
847
+ max-width: fit-content !important;
848
+ }
846
849
  .max-w-25 {
847
850
  max-width: calc(var(--spacing) * 25);
848
851
  }
@@ -2421,6 +2424,11 @@
2421
2424
  cursor: pointer;
2422
2425
  }
2423
2426
  }
2427
+ .not-disabled\:text-text-primary-normal {
2428
+ &:not(*:disabled) {
2429
+ color: var(--color-text-primary-normal);
2430
+ }
2431
+ }
2424
2432
  .group-hover\:block {
2425
2433
  &:is(:where(.group):hover *) {
2426
2434
  @media (hover: hover) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.171",
4
+ "version": "0.0.172",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -25,6 +25,7 @@ type ModalProps = PropsWithChildren<{
25
25
  showButtons?: boolean;
26
26
  hideCloseIcon?: boolean;
27
27
  headerIcon?: React.ReactNode;
28
+ headerIconAlign?: "left" | "center" | "right";
28
29
  fixedHeightScrolling?: boolean;
29
30
  customActions?: React.ReactNode;
30
31
  }>;
@@ -117,6 +118,7 @@ export const Modal = ({
117
118
  showButtons = false,
118
119
  hideCloseIcon = false,
119
120
  headerIcon,
121
+ headerIconAlign,
120
122
  fixedHeightScrolling = false,
121
123
  customActions,
122
124
  }: ModalProps) => {
@@ -150,7 +152,7 @@ export const Modal = ({
150
152
  fadeInScale(modalRef.current);
151
153
  bgFadeIn(bgRef.current);
152
154
  }
153
- }, [mounted, open]);
155
+ }, [mounted, onClose, open, wasOpen]);
154
156
 
155
157
  const handleKeyDown = useCallback(
156
158
  (e: KeyboardEvent) => {
@@ -161,7 +163,7 @@ export const Modal = ({
161
163
  }
162
164
  }
163
165
  },
164
- [onClose, bgRef, modalRef],
166
+ [onClose],
165
167
  );
166
168
 
167
169
  const handleClose = useCallback(() => {
@@ -259,6 +261,7 @@ export const Modal = ({
259
261
  onClose={handleClose}
260
262
  hideCloseIcon={hideCloseIcon}
261
263
  headerIcon={headerIcon}
264
+ headerIconAlign={headerIconAlign}
262
265
  />
263
266
  {children && (
264
267
  <ModalContent
@@ -9,6 +9,7 @@ type ModalHeaderProps = {
9
9
  title?: string;
10
10
  hideCloseIcon?: boolean;
11
11
  headerIcon?: React.ReactNode;
12
+ headerIconAlign?: "left" | "center" | "right";
12
13
  onClose?: () => void;
13
14
  id?: string;
14
15
  testid?: string;
@@ -18,6 +19,7 @@ export const ModalHeader = ({
18
19
  title,
19
20
  hideCloseIcon,
20
21
  headerIcon,
22
+ headerIconAlign,
21
23
  onClose,
22
24
  id,
23
25
  testid,
@@ -28,6 +30,9 @@ export const ModalHeader = ({
28
30
  data-testid={testid}
29
31
  className={clsx(
30
32
  "flex justify-between items-center",
33
+ headerIconAlign === "center" && "justify-center",
34
+ headerIconAlign === "right" && "justify-end",
35
+ headerIconAlign === "left" && "justify-start",
31
36
  layoutPaddding,
32
37
  layoutGroupGap,
33
38
  )}
@@ -35,7 +40,11 @@ export const ModalHeader = ({
35
40
  <div className={clsx("flex items-center", layoutGroupGap)}>
36
41
  {headerIcon}
37
42
  {title && (
38
- <Heading2 id={id ? `${id}-title` : undefined} testid={testid ? `${testid}-title` : undefined} as="p">
43
+ <Heading2
44
+ id={id ? `${id}-title` : undefined}
45
+ testid={testid ? `${testid}-title` : undefined}
46
+ as="p"
47
+ >
39
48
  {title}
40
49
  </Heading2>
41
50
  )}