@dmsi/wedgekit-react 0.0.203 → 0.0.205

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 (112) hide show
  1. package/dist/{chunk-F6YFWBVV.js → chunk-2B5T4NCT.js} +2 -2
  2. package/dist/{chunk-ESTHTAR5.js → chunk-2JRZCC2K.js} +2 -2
  3. package/dist/{chunk-PMBEIP24.js → chunk-2WRRRPEB.js} +2 -2
  4. package/dist/{chunk-XH65MD2C.js → chunk-33W2KSCB.js} +3 -3
  5. package/dist/{chunk-C4JGTH6G.js → chunk-47KTDBGA.js} +2 -2
  6. package/dist/{chunk-4T3DRGLF.js → chunk-7W4I2NK3.js} +3 -3
  7. package/dist/{chunk-MJKBQSNI.js → chunk-A5ROZWIH.js} +3 -3
  8. package/dist/{chunk-WSS2DFTP.js → chunk-ARC7FOL2.js} +4 -4
  9. package/dist/{chunk-ORMEWXMH.js → chunk-BBZEL7EG.js} +22 -1
  10. package/dist/{chunk-NW2C4DL4.js → chunk-BHJNYWQG.js} +2 -2
  11. package/dist/{chunk-N6JVLYEE.js → chunk-BOWQUDUU.js} +1 -1
  12. package/dist/{chunk-HVI3CL7Y.js → chunk-CJELWEO2.js} +1 -1
  13. package/dist/{chunk-JWCT72WR.js → chunk-CJVTFYI4.js} +1 -1
  14. package/dist/{chunk-WFQEE2OO.js → chunk-E3UOI2D2.js} +3 -3
  15. package/dist/{chunk-LM5MKBPM.js → chunk-ED7FXZRX.js} +4 -4
  16. package/dist/{chunk-ZGFQN47L.js → chunk-FYW64H7N.js} +3 -3
  17. package/dist/{chunk-CYZL57LH.js → chunk-KGVKHWUK.js} +1 -1
  18. package/dist/{chunk-EUXB3XKL.js → chunk-LPQ4QMAV.js} +1 -1
  19. package/dist/{chunk-AZ7LVLOK.js → chunk-REOLWEZG.js} +1 -1
  20. package/dist/{chunk-SDQPZQTI.js → chunk-RXPS5GVE.js} +6 -6
  21. package/dist/{chunk-4XA32LKR.js → chunk-SE5DM2IJ.js} +2 -2
  22. package/dist/{chunk-FKMKHLQH.js → chunk-SK742QNF.js} +1 -1
  23. package/dist/{chunk-4LXG6QNT.js → chunk-TJWGFGWX.js} +1 -1
  24. package/dist/{chunk-NKUETCDA.js → chunk-UAPWR2KE.js} +1 -1
  25. package/dist/{chunk-AEDQLVKH.js → chunk-WE55TGZZ.js} +1 -1
  26. package/dist/{chunk-QBIEU25R.js → chunk-WKWNBR53.js} +1 -1
  27. package/dist/{chunk-OZKCUKBS.js → chunk-WXHRJSDG.js} +4 -4
  28. package/dist/{chunk-I6GEUF6Y.js → chunk-XQILVD56.js} +1 -1
  29. package/dist/components/AccessChangerTabItem.js +3 -3
  30. package/dist/components/Accordion.js +6 -6
  31. package/dist/components/Breadcrumbs.js +3 -3
  32. package/dist/components/Button.js +2 -2
  33. package/dist/components/CalendarRange.js +3 -3
  34. package/dist/components/Caption.js +129 -5
  35. package/dist/components/Card.js +2 -2
  36. package/dist/components/Checkbox.js +4 -4
  37. package/dist/components/ContentTab.js +3 -3
  38. package/dist/components/ContentTabs.js +3 -3
  39. package/dist/components/DMSiLogo.js +1 -1
  40. package/dist/components/DataGridCell.js +10 -10
  41. package/dist/components/DataTable.js +1 -1
  42. package/dist/components/DateInput.js +5 -5
  43. package/dist/components/DateRangeInput.js +5 -5
  44. package/dist/components/DebugJson.js +1 -1
  45. package/dist/components/Display.js +2 -2
  46. package/dist/components/EditingContext.js +1 -1
  47. package/dist/components/FilterGroup.js +10 -10
  48. package/dist/components/FullViewportBox.js +1 -1
  49. package/dist/components/Grid.js +1 -1
  50. package/dist/components/Heading.js +2 -2
  51. package/dist/components/HorizontalDivider.js +1 -1
  52. package/dist/components/Icon.js +2 -2
  53. package/dist/components/Input.js +4 -4
  54. package/dist/components/InputGroup.js +2 -2
  55. package/dist/components/Label.js +2 -2
  56. package/dist/components/Link.js +2 -2
  57. package/dist/components/List.js +1 -1
  58. package/dist/components/LiveChatComponent.js +1 -1
  59. package/dist/components/LoadingScrim.js +1 -1
  60. package/dist/components/LogoAgilityTopBar.js +1 -1
  61. package/dist/components/LogoDMSiTopBar.js +2 -2
  62. package/dist/components/LogoMillworkTopBar.js +1 -1
  63. package/dist/components/MainBar.js +1 -1
  64. package/dist/components/Menu.js +3 -3
  65. package/dist/components/MenuOption.js +5 -5
  66. package/dist/components/MobileDataGrid.js +6 -6
  67. package/dist/components/Modal.js +7 -7
  68. package/dist/components/ModalButtons.js +4 -4
  69. package/dist/components/ModalContent.js +1 -1
  70. package/dist/components/ModalHeader.js +5 -5
  71. package/dist/components/ModalScrim.js +1 -1
  72. package/dist/components/NavigationTab.js +4 -4
  73. package/dist/components/NavigationTabs.js +4 -4
  74. package/dist/components/NestedMenu.js +5 -5
  75. package/dist/components/Notification.js +6 -6
  76. package/dist/components/OptionPill.js +5 -5
  77. package/dist/components/PDFViewer.cjs +112 -225
  78. package/dist/components/PDFViewer.js +75 -90
  79. package/dist/components/Paragraph.js +2 -2
  80. package/dist/components/Password.js +4 -4
  81. package/dist/components/ProjectBar.js +1 -1
  82. package/dist/components/Radio.js +2 -2
  83. package/dist/components/Search.js +5 -5
  84. package/dist/components/Select.js +5 -5
  85. package/dist/components/SideMenu.js +1 -1
  86. package/dist/components/SideMenuGroup.js +4 -4
  87. package/dist/components/SideMenuItem.js +3 -3
  88. package/dist/components/Spinner.js +1 -1
  89. package/dist/components/Stack.js +2 -2
  90. package/dist/components/StatusPill.js +2 -2
  91. package/dist/components/Stepper.js +5 -5
  92. package/dist/components/Subheader.js +2 -2
  93. package/dist/components/Surface.js +1 -1
  94. package/dist/components/Swatch.js +5 -5
  95. package/dist/components/Textarea.js +1 -1
  96. package/dist/components/Theme.js +1 -1
  97. package/dist/components/Time.js +5 -5
  98. package/dist/components/Toast.js +5 -5
  99. package/dist/components/Tooltip.js +1 -1
  100. package/dist/components/TopBar.js +2 -2
  101. package/dist/components/Upload.js +4 -4
  102. package/dist/components/WorldpayIframe.js +1 -1
  103. package/dist/components/index.css +0 -22
  104. package/dist/components/index.js +17 -17
  105. package/dist/components/useMenuSystem.js +2 -2
  106. package/dist/components/useMounted.js +1 -1
  107. package/dist/hooks/index.js +1 -1
  108. package/dist/index.css +0 -22
  109. package/dist/utils/index.js +1 -1
  110. package/package.json +1 -1
  111. package/src/components/PDFViewer.tsx +61 -73
  112. package/dist/chunk-E7D24OHM.js +0 -134
@@ -1987,9 +1987,6 @@
1987
1987
  .text-heading-3-mobile {
1988
1988
  font-size: var(--text-heading-3-mobile);
1989
1989
  }
1990
- .text-label-desktop {
1991
- font-size: var(--text-label-desktop);
1992
- }
1993
1990
  .text-label-mobile {
1994
1991
  font-size: var(--text-label-mobile);
1995
1992
  }
@@ -2447,16 +2444,6 @@
2447
2444
  padding-block: var(--spacing-mobile-component-padding);
2448
2445
  }
2449
2446
  }
2450
- .not-disabled\:cursor-pointer {
2451
- &:not(*:disabled) {
2452
- cursor: pointer;
2453
- }
2454
- }
2455
- .not-disabled\:text-text-primary-normal {
2456
- &:not(*:disabled) {
2457
- color: var(--color-text-primary-normal);
2458
- }
2459
- }
2460
2447
  .group-hover\:block {
2461
2448
  &:is(:where(.group):hover *) {
2462
2449
  @media (hover: hover) {
@@ -3002,15 +2989,6 @@
3002
2989
  }
3003
2990
  }
3004
2991
  }
3005
- .not-disabled\:hover\:underline {
3006
- &:not(*:disabled) {
3007
- &:hover {
3008
- @media (hover: hover) {
3009
- text-decoration-line: underline;
3010
- }
3011
- }
3012
- }
3013
- }
3014
2992
  .focus\:border-background-action-critical-primary-hover {
3015
2993
  &:focus {
3016
2994
  border-color: var(--color-background-action-critical-primary-hover);
@@ -3,57 +3,57 @@ import {
3
3
  } from "../chunk-3WNXMCZV.js";
4
4
  import {
5
5
  Select
6
- } from "../chunk-XH65MD2C.js";
6
+ } from "../chunk-33W2KSCB.js";
7
7
  import {
8
8
  Checkbox
9
- } from "../chunk-WFQEE2OO.js";
9
+ } from "../chunk-E3UOI2D2.js";
10
10
  import {
11
11
  DataCellHeader,
12
12
  DataGridCell,
13
13
  DragAlongCell,
14
14
  DraggableCellHeader
15
- } from "../chunk-SDQPZQTI.js";
15
+ } from "../chunk-RXPS5GVE.js";
16
16
  import {
17
17
  Menu
18
- } from "../chunk-ESTHTAR5.js";
19
- import "../chunk-AEDQLVKH.js";
18
+ } from "../chunk-2JRZCC2K.js";
19
+ import "../chunk-WE55TGZZ.js";
20
20
  import {
21
21
  MenuOption
22
- } from "../chunk-OZKCUKBS.js";
22
+ } from "../chunk-WXHRJSDG.js";
23
23
  import {
24
24
  useInfiniteScroll
25
25
  } from "../chunk-WNQ53SVY.js";
26
26
  import "../chunk-6LN6QT6M.js";
27
27
  import {
28
28
  Search
29
- } from "../chunk-PMBEIP24.js";
29
+ } from "../chunk-2WRRRPEB.js";
30
30
  import {
31
31
  Input
32
- } from "../chunk-4T3DRGLF.js";
32
+ } from "../chunk-7W4I2NK3.js";
33
33
  import "../chunk-5UH6QUFB.js";
34
34
  import {
35
35
  Label
36
- } from "../chunk-JWCT72WR.js";
36
+ } from "../chunk-CJVTFYI4.js";
37
37
  import "../chunk-WVUIIBRR.js";
38
38
  import {
39
39
  Subheader
40
- } from "../chunk-CYZL57LH.js";
40
+ } from "../chunk-KGVKHWUK.js";
41
41
  import {
42
42
  Accordion
43
- } from "../chunk-WSS2DFTP.js";
44
- import "../chunk-N6JVLYEE.js";
43
+ } from "../chunk-ARC7FOL2.js";
44
+ import "../chunk-BOWQUDUU.js";
45
45
  import {
46
46
  Card
47
- } from "../chunk-4LXG6QNT.js";
47
+ } from "../chunk-TJWGFGWX.js";
48
48
  import {
49
49
  Paragraph
50
- } from "../chunk-HVI3CL7Y.js";
50
+ } from "../chunk-CJELWEO2.js";
51
51
  import {
52
52
  Button
53
- } from "../chunk-FKMKHLQH.js";
53
+ } from "../chunk-SK742QNF.js";
54
54
  import {
55
55
  Icon
56
- } from "../chunk-NKUETCDA.js";
56
+ } from "../chunk-UAPWR2KE.js";
57
57
  import {
58
58
  componentGap,
59
59
  componentPadding
@@ -62,7 +62,7 @@ import {
62
62
  __objRest,
63
63
  __spreadProps,
64
64
  __spreadValues
65
- } from "../chunk-ORMEWXMH.js";
65
+ } from "../chunk-BBZEL7EG.js";
66
66
 
67
67
  // src/components/DataGrid/index.tsx
68
68
  import React3, { useCallback, useId, useState as useState3 } from "react";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  useMenuPosition,
4
4
  useSubMenuSystem
5
- } from "../chunk-AEDQLVKH.js";
5
+ } from "../chunk-WE55TGZZ.js";
6
6
  import "../chunk-WNQ53SVY.js";
7
- import "../chunk-ORMEWXMH.js";
7
+ import "../chunk-BBZEL7EG.js";
8
8
  export {
9
9
  useMenuPosition,
10
10
  useSubMenuSystem
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  useMounted
4
4
  } from "../chunk-4RJKB7LC.js";
5
- import "../chunk-ORMEWXMH.js";
5
+ import "../chunk-BBZEL7EG.js";
6
6
  export {
7
7
  useMounted
8
8
  };
@@ -4,7 +4,7 @@ import {
4
4
  useMatchesMedia,
5
5
  useMatchesMobile
6
6
  } from "../chunk-WNQ53SVY.js";
7
- import "../chunk-ORMEWXMH.js";
7
+ import "../chunk-BBZEL7EG.js";
8
8
  export {
9
9
  useInfiniteScroll,
10
10
  useKeydown,
package/dist/index.css CHANGED
@@ -1965,9 +1965,6 @@
1965
1965
  .text-heading-3-mobile {
1966
1966
  font-size: var(--text-heading-3-mobile);
1967
1967
  }
1968
- .text-label-desktop {
1969
- font-size: var(--text-label-desktop);
1970
- }
1971
1968
  .text-label-mobile {
1972
1969
  font-size: var(--text-label-mobile);
1973
1970
  }
@@ -2425,16 +2422,6 @@
2425
2422
  padding-block: var(--spacing-mobile-component-padding);
2426
2423
  }
2427
2424
  }
2428
- .not-disabled\:cursor-pointer {
2429
- &:not(*:disabled) {
2430
- cursor: pointer;
2431
- }
2432
- }
2433
- .not-disabled\:text-text-primary-normal {
2434
- &:not(*:disabled) {
2435
- color: var(--color-text-primary-normal);
2436
- }
2437
- }
2438
2425
  .group-hover\:block {
2439
2426
  &:is(:where(.group):hover *) {
2440
2427
  @media (hover: hover) {
@@ -2980,15 +2967,6 @@
2980
2967
  }
2981
2968
  }
2982
2969
  }
2983
- .not-disabled\:hover\:underline {
2984
- &:not(*:disabled) {
2985
- &:hover {
2986
- @media (hover: hover) {
2987
- text-decoration-line: underline;
2988
- }
2989
- }
2990
- }
2991
- }
2992
2970
  .focus\:border-background-action-critical-primary-hover {
2993
2971
  &:focus {
2994
2972
  border-color: var(--color-background-action-critical-primary-hover);
@@ -18,7 +18,7 @@ import {
18
18
  formatDecimalValue,
19
19
  getDecimalPlaceholder
20
20
  } from "../chunk-5UH6QUFB.js";
21
- import "../chunk-ORMEWXMH.js";
21
+ import "../chunk-BBZEL7EG.js";
22
22
  export {
23
23
  calculateCursorPosition,
24
24
  countDigitsUpToCursor,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.203",
4
+ "version": "0.0.205",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  import { usePdf } from "@mikecousins/react-pdf";
4
- import { useCallback, useRef, useState } from "react";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
5
5
  import { Modal } from "./Modal";
6
6
  import { Button } from "./Button";
7
7
  import { Icon } from "./Icon";
8
8
  import { Stack } from "./Stack";
9
- import { Caption } from "./Caption";
10
9
  import { Spinner } from "./Spinner";
11
10
  import { Paragraph } from "./Paragraph";
12
11
  import { Heading3 } from "./Heading";
12
+ import { PDFDocumentProxy } from "pdfjs-dist";
13
13
 
14
14
  type PDFViewerProps = {
15
15
  isOpen: boolean;
@@ -97,13 +97,6 @@ export function PDFViewer(props: PDFViewerProps) {
97
97
  >
98
98
  <Stack sizing="layout" items="center">
99
99
  <PDFElement testid={testid} b64={encodedPdfs[currentIndex].base64} />
100
- {!!encodedPdfs[currentIndex].fileName && (
101
- <Paragraph>
102
- {encodedPdfs[currentIndex].fileName.endsWith(".pdf")
103
- ? encodedPdfs[currentIndex].fileName
104
- : `${encodedPdfs[currentIndex].fileName}.pdf`}
105
- </Paragraph>
106
- )}
107
100
  </Stack>
108
101
  </Modal>
109
102
  );
@@ -130,15 +123,25 @@ function DownloadIcon({
130
123
  }
131
124
 
132
125
  function PDFElement({ b64, testid }: { b64: string; testid?: string }) {
133
- const [page, setPage] = useState(1);
134
- const canvasRef = useRef(null);
126
+ const canvasRef = useRef<HTMLCanvasElement>(null);
127
+ const [pages, setPages] = useState<React.ReactNode[]>([]);
128
+
129
+ useEffect(() => {
130
+ setPages([]);
131
+ }, [b64]);
135
132
 
136
133
  const { pdfDocument } = usePdf({
137
134
  file: `data:application/pdf;base64,${b64}`,
138
135
  workerSrc: "/scripts/pdf.worker.min.mjs",
139
- page,
136
+ page: 1,
140
137
  canvasRef,
141
138
  scale: 1.1,
139
+ onDocumentLoadSuccess: async (pdf) => {
140
+ if (pdf.numPages === 1) return;
141
+ // Page loader
142
+ const pages = await renderPages(pdf, testid || "pdf-viewer");
143
+ setPages(pages);
144
+ },
142
145
  });
143
146
 
144
147
  return (
@@ -150,10 +153,22 @@ function PDFElement({ b64, testid }: { b64: string; testid?: string }) {
150
153
  }}
151
154
  >
152
155
  {!!pdfDocument && !!b64 ? (
153
- <canvas
154
- data-testid={testid ? `${testid}-pdf-content` : undefined}
155
- ref={canvasRef}
156
- />
156
+ <Stack sizing="layout-group">
157
+ <div className="flex justify-center border border-border-primary-normal">
158
+ <canvas
159
+ data-testid={testid ? `${testid}-pdf-content` : undefined}
160
+ ref={canvasRef}
161
+ />
162
+ </div>
163
+ {pages.map((page, index) => (
164
+ <div
165
+ key={`${testid}-pdf-page-${index}`}
166
+ className="flex justify-center border border-border-primary-normal"
167
+ >
168
+ {page}
169
+ </div>
170
+ ))}
171
+ </Stack>
157
172
  ) : (
158
173
  <Stack
159
174
  justify="center"
@@ -165,63 +180,6 @@ function PDFElement({ b64, testid }: { b64: string; testid?: string }) {
165
180
  <Spinner size="large" />
166
181
  </Stack>
167
182
  )}
168
- {pdfDocument?.numPages && pdfDocument.numPages > 1 && (
169
- <ul
170
- className="flex flex-row justify-between items-center"
171
- data-testid={testid ? `${testid}-pdf-pagination` : undefined}
172
- >
173
- <li className="previous">
174
- <button
175
- data-testid={
176
- testid ? `${testid}-pdf-pagination-previous-button` : undefined
177
- }
178
- disabled={page === 1}
179
- onClick={() => setPage(page - 1)}
180
- className="not-disabled:cursor-pointer not-disabled:hover:underline "
181
- >
182
- <Caption className="not-disabled:cursor-pointer not-disabled:hover:underline not-disabled:text-text-primary-normal">
183
- Previous
184
- </Caption>
185
- </button>
186
- </li>
187
- <li
188
- data-testid={testid ? `${testid}-pdf-pagination-text` : undefined}
189
- className="text-label-desktop text-text-primary-normal"
190
- >
191
- Page{" "}
192
- <span
193
- data-testid={
194
- testid ? `${testid}-pdf-pagination-page-${page}` : undefined
195
- }
196
- >
197
- {page}
198
- </span>{" "}
199
- of{" "}
200
- <span
201
- data-testid={
202
- testid
203
- ? `${testid}-pdf-pagination-total-page-${pdfDocument!.numPages}`
204
- : undefined
205
- }
206
- >
207
- {pdfDocument!.numPages}
208
- </span>
209
- </li>
210
- <li className="next">
211
- <button
212
- data-testid={
213
- testid ? `${testid}-pdf-pagination-next-button` : undefined
214
- }
215
- disabled={page === pdfDocument!.numPages}
216
- onClick={() => setPage(page + 1)}
217
- >
218
- <Caption className="not-disabled:cursor-pointer not-disabled:hover:underline not-disabled:text-text-primary-normal">
219
- Next
220
- </Caption>
221
- </button>
222
- </li>
223
- </ul>
224
- )}
225
183
  </div>
226
184
  );
227
185
  }
@@ -287,3 +245,33 @@ function PdfNavigation({
287
245
  </div>
288
246
  );
289
247
  }
248
+
249
+ function renderPages(pdf: PDFDocumentProxy, testid: string) {
250
+ const pagesPromises = Array.from(
251
+ // Skip the first page as it is already rendered
252
+ { length: pdf.numPages - 1 },
253
+ async (_, i) => {
254
+ const page = await pdf.getPage(i + 2);
255
+ return (
256
+ <canvas
257
+ key={`${testid}-pdf_page_${page.pageNumber}`}
258
+ ref={(el) => {
259
+ if (el) {
260
+ const ctx = el.getContext("2d");
261
+ el.width = page.getViewport({ scale: 1.1 }).width;
262
+ el.height = page.getViewport({ scale: 1.1 }).height;
263
+
264
+ if (ctx) {
265
+ page.render({
266
+ canvasContext: ctx,
267
+ viewport: page.getViewport({ scale: 1.1 }),
268
+ });
269
+ }
270
+ }
271
+ }}
272
+ />
273
+ );
274
+ },
275
+ );
276
+ return Promise.all(pagesPromises);
277
+ }
@@ -1,134 +0,0 @@
1
- import {
2
- Icon
3
- } from "./chunk-NKUETCDA.js";
4
- import {
5
- typography
6
- } from "./chunk-RDLEIAQU.js";
7
- import {
8
- __objRest,
9
- __spreadProps,
10
- __spreadValues
11
- } from "./chunk-ORMEWXMH.js";
12
-
13
- // src/components/Caption.tsx
14
- import clsx from "clsx";
15
- import { jsx, jsxs } from "react/jsx-runtime";
16
- var Caption = (_a) => {
17
- var _b = _a, {
18
- className,
19
- children,
20
- as = "span",
21
- style = "default",
22
- color,
23
- align,
24
- id,
25
- testid
26
- } = _b, props = __objRest(_b, [
27
- "className",
28
- "children",
29
- "as",
30
- "style",
31
- "color",
32
- "align",
33
- "id",
34
- "testid"
35
- ]);
36
- const Element = as;
37
- return /* @__PURE__ */ jsxs("div", { id, "data-testid": testid, className: "flex gap-1", children: [
38
- /* @__PURE__ */ jsx(
39
- WhichIcon,
40
- {
41
- id,
42
- testid,
43
- style,
44
- size: 16,
45
- className: "mt-[3px] desktop:mt-0"
46
- }
47
- ),
48
- /* @__PURE__ */ jsx(
49
- Element,
50
- __spreadProps(__spreadValues({
51
- id: id ? `${id}-text` : void 0,
52
- "data-testid": testid ? `${testid}-text` : void 0,
53
- className: clsx(
54
- typography.caption.replace("text-text-primary-normal", ""),
55
- (style === "default" || style === "info") && "text-text-secondary-normal",
56
- style === "success" && "text-text-success-normal",
57
- style === "warning" && "text-text-warning-normal",
58
- style === "error" && "text-text-critical-normal",
59
- align === "left" && "text-left",
60
- align === "center" && "text-center",
61
- align === "right" && "text-right",
62
- className
63
- )
64
- }, props), {
65
- style: {
66
- color: color ? `var(--color-${color})` : void 0
67
- },
68
- children
69
- })
70
- )
71
- ] });
72
- };
73
- var WhichIcon = ({
74
- style,
75
- size,
76
- className,
77
- id,
78
- testid
79
- }) => {
80
- if (style === "success") {
81
- return /* @__PURE__ */ jsx("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ jsx(
82
- Icon,
83
- {
84
- id: id ? `${id}-icon` : void 0,
85
- testid: testid ? `${testid}-icon` : void 0,
86
- className,
87
- name: "check_circle",
88
- size
89
- }
90
- ) });
91
- }
92
- if (style === "warning") {
93
- return /* @__PURE__ */ jsx("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ jsx(
94
- Icon,
95
- {
96
- id: id ? `${id}-icon` : void 0,
97
- testid: testid ? `${testid}-icon` : void 0,
98
- className,
99
- name: "warning",
100
- size
101
- }
102
- ) });
103
- }
104
- if (style === "error") {
105
- return /* @__PURE__ */ jsx("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ jsx(
106
- Icon,
107
- {
108
- id: id ? `${id}-icon` : void 0,
109
- testid: testid ? `${testid}-icon` : void 0,
110
- className,
111
- name: "info",
112
- size
113
- }
114
- ) });
115
- }
116
- if (style === "info") {
117
- return /* @__PURE__ */ jsx("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ jsx(
118
- Icon,
119
- {
120
- id: id ? `${id}-icon` : void 0,
121
- testid: testid ? `${testid}-icon` : void 0,
122
- className,
123
- name: "info",
124
- size
125
- }
126
- ) });
127
- }
128
- return null;
129
- };
130
- Caption.displayName = "Caption";
131
-
132
- export {
133
- Caption
134
- };