@dloizides/ui-layout 1.44.0 → 1.45.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.
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -618,8 +618,12 @@ interface ConfirmDialogProps {
|
|
|
618
618
|
initialFocus?: ConfirmDialogFocus;
|
|
619
619
|
/** Base testID. Default `confirm-dialog`. Confirm is `${testID}-confirm`, Cancel `${testID}-cancel`. */
|
|
620
620
|
testID?: string;
|
|
621
|
+
/** testID of the Confirm button. Default `${testID}-confirm`. */
|
|
622
|
+
confirmTestID?: string;
|
|
623
|
+
/** testID of the Cancel button. Default `${testID}-cancel`. */
|
|
624
|
+
cancelTestID?: string;
|
|
621
625
|
}
|
|
622
|
-
declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, initialFocus, testID, }: ConfirmDialogProps) => React.ReactElement;
|
|
626
|
+
declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, initialFocus, testID, confirmTestID, cancelTestID, }: ConfirmDialogProps) => React.ReactElement;
|
|
623
627
|
|
|
624
628
|
interface FormDialogProps {
|
|
625
629
|
visible: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -618,8 +618,12 @@ interface ConfirmDialogProps {
|
|
|
618
618
|
initialFocus?: ConfirmDialogFocus;
|
|
619
619
|
/** Base testID. Default `confirm-dialog`. Confirm is `${testID}-confirm`, Cancel `${testID}-cancel`. */
|
|
620
620
|
testID?: string;
|
|
621
|
+
/** testID of the Confirm button. Default `${testID}-confirm`. */
|
|
622
|
+
confirmTestID?: string;
|
|
623
|
+
/** testID of the Cancel button. Default `${testID}-cancel`. */
|
|
624
|
+
cancelTestID?: string;
|
|
621
625
|
}
|
|
622
|
-
declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, initialFocus, testID, }: ConfirmDialogProps) => React.ReactElement;
|
|
626
|
+
declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, initialFocus, testID, confirmTestID, cancelTestID, }: ConfirmDialogProps) => React.ReactElement;
|
|
623
627
|
|
|
624
628
|
interface FormDialogProps {
|
|
625
629
|
visible: boolean;
|
package/dist/index.js
CHANGED
|
@@ -2232,14 +2232,16 @@ var ConfirmDialog = ({
|
|
|
2232
2232
|
onCancel,
|
|
2233
2233
|
busy = false,
|
|
2234
2234
|
initialFocus = "cancel" /* Cancel */,
|
|
2235
|
-
testID = LAYOUT_TEST_IDS.confirmDialog
|
|
2235
|
+
testID = LAYOUT_TEST_IDS.confirmDialog,
|
|
2236
|
+
confirmTestID = `${testID}-confirm`,
|
|
2237
|
+
cancelTestID = `${testID}-cancel`
|
|
2236
2238
|
}) => {
|
|
2237
2239
|
const { theme, t } = uiFeedback.useUi();
|
|
2238
2240
|
const resolvedConfirm = confirmLabel ?? t(LAYOUT_I18N.confirm);
|
|
2239
2241
|
const resolvedCancel = cancelLabel ?? t(LAYOUT_I18N.cancel);
|
|
2240
2242
|
const focusTestID = {
|
|
2241
|
-
["cancel" /* Cancel */]:
|
|
2242
|
-
["confirm" /* Confirm */]:
|
|
2243
|
+
["cancel" /* Cancel */]: cancelTestID,
|
|
2244
|
+
["confirm" /* Confirm */]: confirmTestID,
|
|
2243
2245
|
["none" /* None */]: testID
|
|
2244
2246
|
};
|
|
2245
2247
|
const footer = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -2250,7 +2252,7 @@ var ConfirmDialog = ({
|
|
|
2250
2252
|
accessibilityLabel: resolvedCancel,
|
|
2251
2253
|
disabled: busy,
|
|
2252
2254
|
label: resolvedCancel,
|
|
2253
|
-
testID:
|
|
2255
|
+
testID: cancelTestID,
|
|
2254
2256
|
variant: "secondary",
|
|
2255
2257
|
onPress: onCancel
|
|
2256
2258
|
}
|
|
@@ -2262,7 +2264,7 @@ var ConfirmDialog = ({
|
|
|
2262
2264
|
accessibilityLabel: resolvedConfirm,
|
|
2263
2265
|
label: resolvedConfirm,
|
|
2264
2266
|
loading: busy,
|
|
2265
|
-
testID:
|
|
2267
|
+
testID: confirmTestID,
|
|
2266
2268
|
variant: destructive ? "danger" : "primary",
|
|
2267
2269
|
onPress: onConfirm
|
|
2268
2270
|
}
|