Skip to content

Commit a1a01f8

Browse files
shaurya-harnessHarness
authored andcommitted
fix: [UUI-773]: accept title and delete btn text in DeleteAlertDialog (#11019)
* 63e19a fix: [UUI-773]: accept title and delete btn text in DeleteAlertDialog * 0034f9 fix: [UUI-773]: accept title and delete btn text in DeleteAlertDialog
1 parent 91a2227 commit a1a01f8

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

packages/ui/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@harnessio/ui",
33
"description": "Harness Canary UI component library",
4-
"version": "0.5.4",
4+
"version": "0.5.5",
55
"private": false,
66
"type": "module",
77
"main": "./dist/index.js",
@@ -28,12 +28,14 @@
2828
"./shared-style-variables.css": "./src/styles/shared-style-variables.css",
2929
"./markdown-preview-styles.css": "./src/components/markdown-viewer/style.css",
3030
"./context": "./dist/context.js",
31-
"./types": "./dist/types.js"
31+
"./types": "./dist/types.js",
32+
"./.claude/manifest.json": "./.claude/manifest.json"
3233
},
3334
"files": [
3435
"dist",
3536
"src/shared-style-variables.css",
36-
"src/components/markdown-viewer/style.css"
37+
"src/components/markdown-viewer/style.css",
38+
".claude"
3739
],
3840
"scripts": {
3941
"dev": "vite",

packages/ui/src/components/dialogs/delete-alert-dialog.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ export interface DeleteAlertDialogProps {
1414
error?: { type?: string; message: string } | null
1515
withForm?: boolean
1616
message?: React.ReactChild
17+
title?: string
1718
deletionItemName?: string
1819
deletionKeyword?: string
20+
deleteConfirmText?: string
1921
violation?: boolean
2022
bypassable?: boolean
2123
}
@@ -30,7 +32,9 @@ export const DeleteAlertDialog: FC<DeleteAlertDialogProps> = ({
3032
error,
3133
withForm = false,
3234
message,
35+
title,
3336
deletionItemName,
37+
deleteConfirmText,
3438
deletionKeyword = 'DELETE',
3539
violation = false,
3640
bypassable = false
@@ -106,7 +110,7 @@ export const DeleteAlertDialog: FC<DeleteAlertDialogProps> = ({
106110
onConfirm={handleDelete}
107111
loading={isLoading}
108112
>
109-
<AlertDialog.Content title={t('component:deleteDialog.title', 'Are you sure?')}>
113+
<AlertDialog.Content title={title ?? t('component:deleteDialog.title', 'Are you sure?')}>
110114
<Text className="break-words" wrap="wrap">
111115
{displayMessageContent}
112116
</Text>
@@ -155,7 +159,7 @@ export const DeleteAlertDialog: FC<DeleteAlertDialogProps> = ({
155159

156160
<AlertDialog.Cancel />
157161
<AlertDialog.Confirm disabled={violation && !bypassable}>
158-
{violation && bypassable ? `Bypass rules and delete` : `Yes`}
162+
{violation && bypassable ? `Bypass rules and delete` : deleteConfirmText || `Yes`}
159163
</AlertDialog.Confirm>
160164
</AlertDialog.Content>
161165
</AlertDialog.Root>

0 commit comments

Comments
 (0)