Skip to content

on-confirm-disabled-rename #3909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/three-carrots-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/alert-dialog": patch
"@twilio-paste/core": patch
---

Changing the property name, onConfirmDisabled, in AlertDialog component. The property is called isConfirmDisabled. Non breaking change.
14 changes: 7 additions & 7 deletions packages/paste-core/components/account-switcher/type-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -2997,7 +2997,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -4855,7 +4855,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -6714,7 +6714,7 @@
"description": "Overrides the default element name to apply unique styles with the Customization Provider"
},
"enterKeyHint": {
"type": "| \"next\"\n | \"previous\"\n | \"search\"\n | \"enter\"\n | \"done\"\n | \"go\"\n | \"send\"",
"type": "| \"search\"\n | \"next\"\n | \"previous\"\n | \"enter\"\n | \"done\"\n | \"go\"\n | \"send\"",
"defaultValue": null,
"required": false,
"externalProp": true
Expand Down Expand Up @@ -6802,7 +6802,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -8610,7 +8610,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -10205,7 +10205,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down
14 changes: 12 additions & 2 deletions packages/paste-core/components/alert-dialog/src/AlertDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,22 @@ export interface AlertDialogProps extends HTMLPasteProps<"div"> {
*/
onDismissLabel: string;
/**
* Disable the confirm button
* Disable the confirm button. Use isConfirmDisabled
* @deprecated This prop has been deprecated in favor of the `isConfirmDisabled` prop.
*
* @default false
* @type {boolean}
* @memberof AlertDialogProps
*/
onConfirmDisabled?: boolean;
/**
* Disable the confirm button
*
* @default false
* @type {boolean}
* @memberof AlertDialogProps
*/
isConfirmDisabled?: boolean;
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
Expand All @@ -105,6 +114,7 @@ export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
onDismiss,
onDismissLabel,
onConfirmDisabled,
isConfirmDisabled,
...props
},
ref,
Expand Down Expand Up @@ -143,7 +153,7 @@ export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
onDismissLabel={onDismissLabel}
onConfirm={onConfirm}
onConfirmLabel={onConfirmLabel}
onConfirmDisabled={onConfirmDisabled}
isConfirmDisabled={isConfirmDisabled || onConfirmDisabled}
/>
</Box>
</ModalDialogOverlay>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface AlertDialogFooterProps extends HTMLPasteProps<"div">, Pick<BoxP
onConfirmLabel: string;
onDismiss: () => void;
onDismissLabel: string;
isConfirmDisabled?: boolean;
/** @deprecated This prop has been deprecated in favor of the `isConfirmDisabled` prop. */
onConfirmDisabled?: boolean;
}

Expand All @@ -23,7 +25,8 @@ export const AlertDialogFooter = React.forwardRef<HTMLDivElement, AlertDialogFoo
onConfirmLabel,
onDismiss,
onDismissLabel,
onConfirmDisabled = false,
onConfirmDisabled,
isConfirmDisabled = onConfirmDisabled || false,
...props
},
ref,
Expand All @@ -47,7 +50,7 @@ export const AlertDialogFooter = React.forwardRef<HTMLDivElement, AlertDialogFoo
<Button variant="secondary" onClick={onDismiss}>
{onDismissLabel}
</Button>
<Button variant={primaryVariant} onClick={onConfirm} disabled={destructive && onConfirmDisabled}>
<Button variant={primaryVariant} onClick={onConfirm} disabled={destructive && isConfirmDisabled}>
{onConfirmLabel}
</Button>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const DisabledButtonDestructiveAlertDialog = ({ dialogIsOpen = false }):
onDismiss={handleDismiss}
onDismissLabel="Cancel"
destructive
onConfirmDisabled={isDisabled}
isConfirmDisabled={isDisabled}
>
You&apos;re about to delete &ldquo;Toyota TCB Automobile (Gevelsberg)&ldquo; and all data associated with it.
This regulatory bundle will be deleted immediately. You can&apos;t undo this action.
Expand Down
11 changes: 9 additions & 2 deletions packages/paste-core/components/alert-dialog/type-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand All @@ -502,6 +502,13 @@
"externalProp": true,
"description": "Specify that a standard HTML element should behave like a defined custom built-in element"
},
"isConfirmDisabled": {
"type": "boolean",
"defaultValue": false,
"required": false,
"externalProp": false,
"description": "Disable the confirm button"
},
"itemID": {
"type": "string",
"defaultValue": null,
Expand Down Expand Up @@ -723,7 +730,7 @@
"defaultValue": false,
"required": false,
"externalProp": false,
"description": "Disable the confirm button"
"description": "Disable the confirm button. Use isConfirmDisabled"
},
"onContextMenu": {
"type": "MouseEventHandler<HTMLDivElement>",
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-core/components/alert/type-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"\n | \"search\"",
"type": "| \"text\"\n | \"search\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down
81 changes: 58 additions & 23 deletions packages/paste-core/components/button/type-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@
"externalProp": true,
"description": "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made."
},
"aria-braillelabel": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Defines a string value that labels the current element, which is intended to be converted into Braille."
},
"aria-brailleroledescription": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille."
},
"aria-busy": {
"type": "Booleanish",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user."
"externalProp": true
},
"aria-checked": {
"type": "boolean | \"true\" | \"false\" | \"mixed\"",
Expand All @@ -68,6 +81,13 @@
"externalProp": true,
"description": "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid."
},
"aria-colindextext": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Defines a human readable text alternative of aria-colindex."
},
"aria-colspan": {
"type": "number",
"defaultValue": null,
Expand Down Expand Up @@ -96,6 +116,13 @@
"externalProp": true,
"description": "Identifies the element (or elements) that describes the object."
},
"aria-description": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Defines a string value that describes or annotates the current element."
},
"aria-details": {
"type": "string",
"defaultValue": null,
Expand Down Expand Up @@ -299,6 +326,13 @@
"externalProp": true,
"description": "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid."
},
"aria-rowindextext": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Defines a human readable text alternative of aria-rowindex."
},
"aria-rowspan": {
"type": "number",
"defaultValue": null,
Expand Down Expand Up @@ -386,8 +420,15 @@
"required": false,
"externalProp": true
},
"content": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true,
"description": "Style prop for the CSS `content` property"
},
"contentEditable": {
"type": "Booleanish | \"inherit\"",
"type": "Booleanish | \"inherit\" | \"plaintext-only\"",
"defaultValue": null,
"required": false,
"externalProp": true
Expand All @@ -399,7 +440,7 @@
"externalProp": true
},
"dangerouslySetInnerHTML": {
"type": "{ __html: string }",
"type": "{ __html: string | TrustedHTML }",
"defaultValue": null,
"required": false,
"externalProp": true
Expand Down Expand Up @@ -524,7 +565,7 @@
"externalProp": true
},
"inputMode": {
"type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"type": "| \"search\"\n | \"text\"\n | \"none\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"",
"defaultValue": null,
"required": false,
"externalProp": true,
Expand Down Expand Up @@ -1264,24 +1305,12 @@
"required": false,
"externalProp": true
},
"onPointerEnterCapture": {
"type": "PointerEventHandler<HTMLButtonElement>",
"defaultValue": null,
"required": false,
"externalProp": true
},
"onPointerLeave": {
"type": "PointerEventHandler<HTMLButtonElement>",
"defaultValue": null,
"required": false,
"externalProp": true
},
"onPointerLeaveCapture": {
"type": "PointerEventHandler<HTMLButtonElement>",
"defaultValue": null,
"required": false,
"externalProp": true
},
"onPointerMove": {
"type": "PointerEventHandler<HTMLButtonElement>",
"defaultValue": null,
Expand Down Expand Up @@ -1570,12 +1599,6 @@
"required": false,
"externalProp": true
},
"placeholder": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true
},
"prefix": {
"type": "string",
"defaultValue": null,
Expand All @@ -1601,6 +1624,12 @@
"required": false,
"externalProp": true
},
"rel": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true
},
"resource": {
"type": "string",
"defaultValue": null,
Expand All @@ -1613,6 +1642,12 @@
"required": false,
"externalProp": true
},
"rev": {
"type": "string",
"defaultValue": null,
"required": false,
"externalProp": true
},
"role": {
"type": "AriaRole",
"defaultValue": null,
Expand Down
Loading
Loading