@olenbetong/synergi-react 4.3.0 → 5.0.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 (81) hide show
  1. package/dist/styles/styles.css +1 -1
  2. package/dist/styles/styles.css.map +1 -1
  3. package/es/components/CodeEditor/CodeEditor.css +6 -6
  4. package/es/components/MergeProgressDialog/MergeProgressDialogDs.d.ts +7 -0
  5. package/es/components/MergeProgressDialog/MergeProgressDialogDs.js +20 -0
  6. package/es/components/MergeProgressDialog/index.d.ts +3 -8
  7. package/es/components/MergeProgressDialog/index.js +4 -113
  8. package/es/components/MergeProgressDialog/useMergeJob.d.ts +36 -0
  9. package/es/components/MergeProgressDialog/useMergeJob.js +141 -0
  10. package/es/components/ProgressBar/index.css +1 -1
  11. package/es/components/Toolbar/Toolbar.css +137 -137
  12. package/es/elements/ElementLookupDialog/BarcodeScanner/BarcodeScanner.css +81 -0
  13. package/es/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.d.ts +2 -2
  14. package/es/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.js +1 -2
  15. package/es/elements/ElementLookupDialog/BarcodeScanner/Error.js +3 -29
  16. package/es/elements/ElementLookupDialog/BarcodeScanner/index.d.ts +1 -0
  17. package/es/elements/ElementLookupDialog/BarcodeScanner/index.js +3 -28
  18. package/es/index.css +1 -1
  19. package/es/index.d.ts +2 -1
  20. package/es/index.js +2 -1
  21. package/es/mui/index.d.ts +1 -0
  22. package/es/mui/index.js +1 -0
  23. package/es/test/setup.d.ts +5 -0
  24. package/package.json +21 -14
  25. package/src/chrome/AppShell/index.tsx +29 -29
  26. package/src/chrome/openReport.ts +34 -34
  27. package/src/colorScheme.ts +125 -125
  28. package/src/components/CodeEditor/CodeEditor.css +6 -6
  29. package/src/components/CodeEditor/CodeEditor.tsx +173 -173
  30. package/src/components/CodeEditor/index.ts +1 -1
  31. package/src/components/DateNavigator/index.tsx +186 -186
  32. package/src/components/FilePond.tsx +312 -312
  33. package/src/components/ImageEditor/ImageEditor.tsx +348 -348
  34. package/src/components/ImageEditor/index.ts +9 -9
  35. package/src/components/ImageEditor/plugins/cropPlugin/CropOverlay.tsx +165 -165
  36. package/src/components/ImageEditor/plugins/cropPlugin/CropToolbar.tsx +48 -48
  37. package/src/components/ImageEditor/plugins/cropPlugin/useCropTool.ts +405 -405
  38. package/src/components/ImageEditor/plugins/redactPlugin/RedactToolbar.tsx +47 -47
  39. package/src/components/ImageEditor/plugins/zoomPlugin/ZoomContext.tsx +23 -23
  40. package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +40 -40
  41. package/src/components/ImageEditor/useActiveTool.ts +21 -21
  42. package/src/components/ImageEditor/useEdgeDetection.ts +319 -319
  43. package/src/components/ImageEditor/useImageHistory.ts +197 -197
  44. package/src/components/ImageEditor/useOpenCV.ts +184 -184
  45. package/src/components/LinkedCardList/index.scss +95 -95
  46. package/src/components/MergeProgressDialog/MergeProgressDialogDs.tsx +91 -0
  47. package/src/components/MergeProgressDialog/index.tsx +5 -136
  48. package/src/components/MergeProgressDialog/useMergeJob.ts +169 -0
  49. package/src/components/PageBanner/index.tsx +80 -80
  50. package/src/components/PdfViewer/PdfViewer.tsx +158 -158
  51. package/src/components/ProgressBar/index.scss +23 -54
  52. package/src/components/SplitContainer/index.tsx +333 -333
  53. package/src/components/Toolbar/Toolbar.css +137 -137
  54. package/src/components/Toolbar/index.tsx +265 -265
  55. package/src/designsystemet-web-types.d.ts +24 -24
  56. package/src/elements/ElementDamage/DamageFormButtons.tsx +35 -35
  57. package/src/elements/ElementDamage/DescriptionInput.tsx +120 -120
  58. package/src/elements/ElementDamage/DuplicateDamage/DesktopView.tsx +82 -82
  59. package/src/elements/ElementDamage/DuplicateDamage/DublicateElementDamageDialog.tsx +67 -67
  60. package/src/elements/ElementDamage/DuplicateDamage/PhoneView.tsx +45 -45
  61. package/src/elements/ElementDamage/ElementNumberTextField.tsx +41 -41
  62. package/src/elements/ElementDamage/RegisterFix.tsx +100 -100
  63. package/src/elements/ElementDamage/SubmitButtons.tsx +40 -40
  64. package/src/elements/ElementDamage/TransportElementSelect.tsx +52 -52
  65. package/src/elements/ElementLookup.tsx +123 -123
  66. package/src/elements/ElementLookupDialog/BarcodeScanner/BarcodeScanner.css +81 -0
  67. package/src/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.tsx +4 -4
  68. package/src/elements/ElementLookupDialog/BarcodeScanner/Error.tsx +7 -36
  69. package/src/elements/ElementLookupDialog/BarcodeScanner/index.tsx +20 -49
  70. package/src/elements/ElementLookupDialog/HIDScanner/index.tsx +67 -67
  71. package/src/elements/ElementLookupDialog/Manual/ManualForm.tsx +141 -141
  72. package/src/elements/ElementLookupDialog/index.tsx +226 -226
  73. package/src/elements/ElementLookupDialog/utils/Giai.ts +209 -209
  74. package/src/elements/ProjectSelect.tsx +130 -130
  75. package/src/elements/index.ts +15 -15
  76. package/src/filter/index.ts +34 -34
  77. package/src/i18n.ts +13 -13
  78. package/src/index.ts +5 -1
  79. package/src/mui/MuiThemeProvider.tsx +135 -135
  80. package/src/mui/index.ts +1 -0
  81. package/src/test/setup.ts +23 -8
@@ -1,9 +1,9 @@
1
- export { defaultPlugins, defaultViewPlugin } from "./defaultPlugins.js";
2
- export type { ImageEditorRef } from "./ImageEditor.js";
3
- export { ImageEditor } from "./ImageEditor.js";
4
- export { cropPlugin } from "./plugins/cropPlugin/index.js";
5
- export { redactPlugin } from "./plugins/redactPlugin/index.js";
6
- export { zoomPlugin } from "./plugins/zoomPlugin/index.js";
7
- export { rotateCcwPlugin, rotateCwPlugin } from "./plugins/rotatePlugin.js";
8
- export type { ActionPlugin, EditAction, Plugin, ToolPlugin, ViewPlugin } from "./types.js";
9
- export { configureOpenCV, DEFAULT_OPENCV_URLS, loadOpenCV } from "./useOpenCV.js";
1
+ export { defaultPlugins, defaultViewPlugin } from "./defaultPlugins.js";
2
+ export type { ImageEditorRef } from "./ImageEditor.js";
3
+ export { ImageEditor } from "./ImageEditor.js";
4
+ export { cropPlugin } from "./plugins/cropPlugin/index.js";
5
+ export { redactPlugin } from "./plugins/redactPlugin/index.js";
6
+ export { zoomPlugin } from "./plugins/zoomPlugin/index.js";
7
+ export { rotateCcwPlugin, rotateCwPlugin } from "./plugins/rotatePlugin.js";
8
+ export type { ActionPlugin, EditAction, Plugin, ToolPlugin, ViewPlugin } from "./types.js";
9
+ export { configureOpenCV, DEFAULT_OPENCV_URLS, loadOpenCV } from "./useOpenCV.js";
@@ -1,165 +1,165 @@
1
- import { Paragraph, Spinner } from "@digdir/designsystemet-react";
2
-
3
- import { CropCanvas } from "../../CropCanvas.js";
4
- import { DragHandle } from "../../DragHandle.js";
5
- import { EdgeHandle } from "../../EdgeHandle.js";
6
- import { useZoomLevel } from "../zoomPlugin/ZoomContext.js";
7
- import { useCropContext } from "./CropContext.js";
8
- import { getLocalizedString } from "../../../../i18n.js";
9
-
10
- /** Canvas-area overlay for the crop tool. Reads all state from CropContext. */
11
- export function CropOverlay() {
12
- let {
13
- imageUrl,
14
- activeCorners,
15
- mode,
16
- hasSelection,
17
- scale,
18
- displaySize,
19
- canvasRef,
20
- cvReady,
21
- cvError,
22
- cropping,
23
- error,
24
- handleCanvasReady,
25
- updateCorner,
26
- startRectDraw,
27
- updateRectDraw,
28
- finishRectDraw,
29
- } = useCropContext();
30
-
31
- let zoom = useZoomLevel();
32
- let showHandles = mode === "corners" && displaySize.width > 0;
33
-
34
- function pointerPosition(e: React.PointerEvent<HTMLDivElement>) {
35
- // getBoundingClientRect() is screen-space (affected by the zoom transform),
36
- // so divide by zoom to get back to the CSS-pixel space the tool expects.
37
- let rect = e.currentTarget.getBoundingClientRect();
38
- return { x: (e.clientX - rect.left) / zoom, y: (e.clientY - rect.top) / zoom };
39
- }
40
-
41
- function onPointerDown(e: React.PointerEvent<HTMLDivElement>) {
42
- e.currentTarget.setPointerCapture(e.pointerId);
43
- let { x, y } = pointerPosition(e);
44
- startRectDraw(x, y);
45
- }
46
-
47
- function onPointerMove(e: React.PointerEvent<HTMLDivElement>) {
48
- if (!(e.buttons & 1)) return;
49
- let { x, y } = pointerPosition(e);
50
- updateRectDraw(x, y);
51
- }
52
-
53
- return (
54
- <div className="crop-root">
55
- <div className="crop-inner">
56
- <CropCanvas ref={canvasRef} imageUrl={imageUrl} corners={activeCorners} onReady={handleCanvasReady} />
57
-
58
- {mode === "rect" && displaySize.width > 0 && (
59
- <div
60
- role="application"
61
- aria-label={getLocalizedString("Drag to draw a rectangle to crop to")}
62
- className="crop-draw-surface"
63
- onPointerDown={onPointerDown}
64
- onPointerMove={onPointerMove}
65
- onPointerUp={finishRectDraw}
66
- onPointerCancel={finishRectDraw}
67
- />
68
- )}
69
-
70
- {showHandles &&
71
- activeCorners.map((corner, i) => (
72
- <DragHandle
73
- key={i}
74
- x={corner.x * scale}
75
- y={corner.y * scale}
76
- onChange={(x, y) => updateCorner(i, x, y)}
77
- containerWidth={displaySize.width}
78
- containerHeight={displaySize.height}
79
- />
80
- ))}
81
-
82
- {showHandles &&
83
- (() => {
84
- let [tl, tr, br, bl] = activeCorners;
85
- let s = scale;
86
- return (
87
- <>
88
- {/* Top edge — moves TL (0) and TR (1) */}
89
- <EdgeHandle
90
- x={((tl.x + tr.x) / 2) * s}
91
- y={((tl.y + tr.y) / 2) * s}
92
- axis="y"
93
- onChange={(dx, dy) => {
94
- updateCorner(0, tl.x * s + dx, tl.y * s + dy);
95
- updateCorner(1, tr.x * s + dx, tr.y * s + dy);
96
- }}
97
- />
98
- {/* Right edge — moves TR (1) and BR (2) */}
99
- <EdgeHandle
100
- x={((tr.x + br.x) / 2) * s}
101
- y={((tr.y + br.y) / 2) * s}
102
- axis="x"
103
- onChange={(dx, dy) => {
104
- updateCorner(1, tr.x * s + dx, tr.y * s + dy);
105
- updateCorner(2, br.x * s + dx, br.y * s + dy);
106
- }}
107
- />
108
- {/* Bottom edge — moves BR (2) and BL (3) */}
109
- <EdgeHandle
110
- x={((br.x + bl.x) / 2) * s}
111
- y={((br.y + bl.y) / 2) * s}
112
- axis="y"
113
- onChange={(dx, dy) => {
114
- updateCorner(2, br.x * s + dx, br.y * s + dy);
115
- updateCorner(3, bl.x * s + dx, bl.y * s + dy);
116
- }}
117
- />
118
- {/* Left edge — moves BL (3) and TL (0) */}
119
- <EdgeHandle
120
- x={((bl.x + tl.x) / 2) * s}
121
- y={((bl.y + tl.y) / 2) * s}
122
- axis="x"
123
- onChange={(dx, dy) => {
124
- updateCorner(3, bl.x * s + dx, bl.y * s + dy);
125
- updateCorner(0, tl.x * s + dx, tl.y * s + dy);
126
- }}
127
- />
128
- </>
129
- );
130
- })()}
131
- </div>
132
-
133
- {/* Status line. OpenCV only powers the border suggestion, so a load failure is
134
- informational — cropping stays available either way. */}
135
- {cropping ? (
136
- <div className="crop-loading">
137
- <Spinner aria-hidden data-size="xs" />
138
- </div>
139
- ) : error ? (
140
- <div className="crop-loading">
141
- <Paragraph data-size="sm">{error}</Paragraph>
142
- </div>
143
- ) : mode === "rect" ? (
144
- <div className="crop-loading">
145
- <Paragraph data-size="sm">
146
- {hasSelection
147
- ? getLocalizedString("Release to use this rectangle")
148
- : getLocalizedString("Drag to draw a rectangle to crop to")}
149
- </Paragraph>
150
- </div>
151
- ) : !cvReady && !cvError ? (
152
- <div className="crop-loading">
153
- <Spinner aria-hidden data-size="xs" />
154
- <Paragraph data-size="sm">{getLocalizedString("Detecting borders…")}</Paragraph>
155
- </div>
156
- ) : cvError ? (
157
- <div className="crop-loading">
158
- <Paragraph data-size="sm">
159
- {getLocalizedString("Automatic border detection is unavailable. Adjust the selection manually.")}
160
- </Paragraph>
161
- </div>
162
- ) : null}
163
- </div>
164
- );
165
- }
1
+ import { Paragraph, Spinner } from "@digdir/designsystemet-react";
2
+
3
+ import { CropCanvas } from "../../CropCanvas.js";
4
+ import { DragHandle } from "../../DragHandle.js";
5
+ import { EdgeHandle } from "../../EdgeHandle.js";
6
+ import { useZoomLevel } from "../zoomPlugin/ZoomContext.js";
7
+ import { useCropContext } from "./CropContext.js";
8
+ import { getLocalizedString } from "../../../../i18n.js";
9
+
10
+ /** Canvas-area overlay for the crop tool. Reads all state from CropContext. */
11
+ export function CropOverlay() {
12
+ let {
13
+ imageUrl,
14
+ activeCorners,
15
+ mode,
16
+ hasSelection,
17
+ scale,
18
+ displaySize,
19
+ canvasRef,
20
+ cvReady,
21
+ cvError,
22
+ cropping,
23
+ error,
24
+ handleCanvasReady,
25
+ updateCorner,
26
+ startRectDraw,
27
+ updateRectDraw,
28
+ finishRectDraw,
29
+ } = useCropContext();
30
+
31
+ let zoom = useZoomLevel();
32
+ let showHandles = mode === "corners" && displaySize.width > 0;
33
+
34
+ function pointerPosition(e: React.PointerEvent<HTMLDivElement>) {
35
+ // getBoundingClientRect() is screen-space (affected by the zoom transform),
36
+ // so divide by zoom to get back to the CSS-pixel space the tool expects.
37
+ let rect = e.currentTarget.getBoundingClientRect();
38
+ return { x: (e.clientX - rect.left) / zoom, y: (e.clientY - rect.top) / zoom };
39
+ }
40
+
41
+ function onPointerDown(e: React.PointerEvent<HTMLDivElement>) {
42
+ e.currentTarget.setPointerCapture(e.pointerId);
43
+ let { x, y } = pointerPosition(e);
44
+ startRectDraw(x, y);
45
+ }
46
+
47
+ function onPointerMove(e: React.PointerEvent<HTMLDivElement>) {
48
+ if (!(e.buttons & 1)) return;
49
+ let { x, y } = pointerPosition(e);
50
+ updateRectDraw(x, y);
51
+ }
52
+
53
+ return (
54
+ <div className="crop-root">
55
+ <div className="crop-inner">
56
+ <CropCanvas ref={canvasRef} imageUrl={imageUrl} corners={activeCorners} onReady={handleCanvasReady} />
57
+
58
+ {mode === "rect" && displaySize.width > 0 && (
59
+ <div
60
+ role="application"
61
+ aria-label={getLocalizedString("Drag to draw a rectangle to crop to")}
62
+ className="crop-draw-surface"
63
+ onPointerDown={onPointerDown}
64
+ onPointerMove={onPointerMove}
65
+ onPointerUp={finishRectDraw}
66
+ onPointerCancel={finishRectDraw}
67
+ />
68
+ )}
69
+
70
+ {showHandles &&
71
+ activeCorners.map((corner, i) => (
72
+ <DragHandle
73
+ key={i}
74
+ x={corner.x * scale}
75
+ y={corner.y * scale}
76
+ onChange={(x, y) => updateCorner(i, x, y)}
77
+ containerWidth={displaySize.width}
78
+ containerHeight={displaySize.height}
79
+ />
80
+ ))}
81
+
82
+ {showHandles &&
83
+ (() => {
84
+ let [tl, tr, br, bl] = activeCorners;
85
+ let s = scale;
86
+ return (
87
+ <>
88
+ {/* Top edge — moves TL (0) and TR (1) */}
89
+ <EdgeHandle
90
+ x={((tl.x + tr.x) / 2) * s}
91
+ y={((tl.y + tr.y) / 2) * s}
92
+ axis="y"
93
+ onChange={(dx, dy) => {
94
+ updateCorner(0, tl.x * s + dx, tl.y * s + dy);
95
+ updateCorner(1, tr.x * s + dx, tr.y * s + dy);
96
+ }}
97
+ />
98
+ {/* Right edge — moves TR (1) and BR (2) */}
99
+ <EdgeHandle
100
+ x={((tr.x + br.x) / 2) * s}
101
+ y={((tr.y + br.y) / 2) * s}
102
+ axis="x"
103
+ onChange={(dx, dy) => {
104
+ updateCorner(1, tr.x * s + dx, tr.y * s + dy);
105
+ updateCorner(2, br.x * s + dx, br.y * s + dy);
106
+ }}
107
+ />
108
+ {/* Bottom edge — moves BR (2) and BL (3) */}
109
+ <EdgeHandle
110
+ x={((br.x + bl.x) / 2) * s}
111
+ y={((br.y + bl.y) / 2) * s}
112
+ axis="y"
113
+ onChange={(dx, dy) => {
114
+ updateCorner(2, br.x * s + dx, br.y * s + dy);
115
+ updateCorner(3, bl.x * s + dx, bl.y * s + dy);
116
+ }}
117
+ />
118
+ {/* Left edge — moves BL (3) and TL (0) */}
119
+ <EdgeHandle
120
+ x={((bl.x + tl.x) / 2) * s}
121
+ y={((bl.y + tl.y) / 2) * s}
122
+ axis="x"
123
+ onChange={(dx, dy) => {
124
+ updateCorner(3, bl.x * s + dx, bl.y * s + dy);
125
+ updateCorner(0, tl.x * s + dx, tl.y * s + dy);
126
+ }}
127
+ />
128
+ </>
129
+ );
130
+ })()}
131
+ </div>
132
+
133
+ {/* Status line. OpenCV only powers the border suggestion, so a load failure is
134
+ informational — cropping stays available either way. */}
135
+ {cropping ? (
136
+ <div className="crop-loading">
137
+ <Spinner aria-hidden data-size="xs" />
138
+ </div>
139
+ ) : error ? (
140
+ <div className="crop-loading">
141
+ <Paragraph data-size="sm">{error}</Paragraph>
142
+ </div>
143
+ ) : mode === "rect" ? (
144
+ <div className="crop-loading">
145
+ <Paragraph data-size="sm">
146
+ {hasSelection
147
+ ? getLocalizedString("Release to use this rectangle")
148
+ : getLocalizedString("Drag to draw a rectangle to crop to")}
149
+ </Paragraph>
150
+ </div>
151
+ ) : !cvReady && !cvError ? (
152
+ <div className="crop-loading">
153
+ <Spinner aria-hidden data-size="xs" />
154
+ <Paragraph data-size="sm">{getLocalizedString("Detecting borders…")}</Paragraph>
155
+ </div>
156
+ ) : cvError ? (
157
+ <div className="crop-loading">
158
+ <Paragraph data-size="sm">
159
+ {getLocalizedString("Automatic border detection is unavailable. Adjust the selection manually.")}
160
+ </Paragraph>
161
+ </div>
162
+ ) : null}
163
+ </div>
164
+ );
165
+ }
@@ -1,48 +1,48 @@
1
- import { Button, Spinner } from "@digdir/designsystemet-react";
2
- import { CheckmarkIcon, ExpandIcon, SquareIcon, XMarkIcon } from "@navikt/aksel-icons";
3
-
4
- import { useCropContext } from "./CropContext.js";
5
- import { getLocalizedString } from "../../../../i18n.js";
6
-
7
- /** Toolbar shown while the crop tool is active. Reads state from CropContext. */
8
- export function CropToolbar() {
9
- let { applyCrop, cropping, mode, hasSelection, startRectMode, cancelRectMode, onApply, onCancel } = useCropContext();
10
- let inRectMode = mode === "rect";
11
-
12
- async function handleApply() {
13
- let result = await applyCrop();
14
- if (result) onApply(result.blob, result.actions);
15
- }
16
-
17
- return (
18
- <>
19
- <div className="image-editor__toolbar-group">
20
- <Button variant="tertiary" data-size="sm" onClick={onCancel} disabled={cropping}>
21
- <XMarkIcon aria-hidden />
22
- {getLocalizedString("Cancel")}
23
- </Button>
24
- </div>
25
- <div className="image-editor__toolbar-group">
26
- <Button
27
- variant="tertiary"
28
- data-size="sm"
29
- aria-pressed={inRectMode}
30
- onClick={inRectMode ? cancelRectMode : startRectMode}
31
- disabled={cropping}
32
- >
33
- {inRectMode ? <ExpandIcon aria-hidden /> : <SquareIcon aria-hidden />}
34
- {inRectMode ? getLocalizedString("Adjust corners") : getLocalizedString("Draw rectangle")}
35
- </Button>
36
- <Button
37
- variant="primary"
38
- data-size="sm"
39
- onClick={handleApply}
40
- disabled={cropping || inRectMode || !hasSelection}
41
- >
42
- {cropping ? <Spinner aria-hidden data-size="xs" /> : <CheckmarkIcon aria-hidden />}
43
- {getLocalizedString("Apply crop")}
44
- </Button>
45
- </div>
46
- </>
47
- );
48
- }
1
+ import { Button, Spinner } from "@digdir/designsystemet-react";
2
+ import { CheckmarkIcon, ExpandIcon, SquareIcon, XMarkIcon } from "@navikt/aksel-icons";
3
+
4
+ import { useCropContext } from "./CropContext.js";
5
+ import { getLocalizedString } from "../../../../i18n.js";
6
+
7
+ /** Toolbar shown while the crop tool is active. Reads state from CropContext. */
8
+ export function CropToolbar() {
9
+ let { applyCrop, cropping, mode, hasSelection, startRectMode, cancelRectMode, onApply, onCancel } = useCropContext();
10
+ let inRectMode = mode === "rect";
11
+
12
+ async function handleApply() {
13
+ let result = await applyCrop();
14
+ if (result) onApply(result.blob, result.actions);
15
+ }
16
+
17
+ return (
18
+ <>
19
+ <div className="image-editor__toolbar-group">
20
+ <Button variant="tertiary" data-size="sm" onClick={onCancel} disabled={cropping}>
21
+ <XMarkIcon aria-hidden />
22
+ {getLocalizedString("Cancel")}
23
+ </Button>
24
+ </div>
25
+ <div className="image-editor__toolbar-group">
26
+ <Button
27
+ variant="tertiary"
28
+ data-size="sm"
29
+ aria-pressed={inRectMode}
30
+ onClick={inRectMode ? cancelRectMode : startRectMode}
31
+ disabled={cropping}
32
+ >
33
+ {inRectMode ? <ExpandIcon aria-hidden /> : <SquareIcon aria-hidden />}
34
+ {inRectMode ? getLocalizedString("Adjust corners") : getLocalizedString("Draw rectangle")}
35
+ </Button>
36
+ <Button
37
+ variant="primary"
38
+ data-size="sm"
39
+ onClick={handleApply}
40
+ disabled={cropping || inRectMode || !hasSelection}
41
+ >
42
+ {cropping ? <Spinner aria-hidden data-size="xs" /> : <CheckmarkIcon aria-hidden />}
43
+ {getLocalizedString("Apply crop")}
44
+ </Button>
45
+ </div>
46
+ </>
47
+ );
48
+ }