Skip to content

fix(checkbox): expose helpText on CheckboxDisclaimer #4020

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

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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/short-years-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/checkbox": patch
"@twilio-paste/core": patch
---

[Checkbox] exposed helpText on CheckboxDisclaimer
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Checkbox } from "./Checkbox";
import type { CheckboxProps } from "./Checkbox";

export interface CheckboxDisclaimerProps
extends Omit<CheckboxProps, "isSelectAll" | "isSelectAllChild" | "indeterminate" | "helpText" | "hasError"> {
extends Omit<CheckboxProps, "isSelectAll" | "isSelectAllChild" | "indeterminate" | "hasError"> {
children: NonNullable<React.ReactNode>;
/**
* Sets the Checkbox Group in error state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,26 @@ export const CheckboxDisclaimerError = (): React.ReactNode => {

CheckboxDisclaimerError.storyName = "Checkbox Disclaimer - Error";

export const CheckboxDisclaimerHelpText = (): React.ReactNode => {
return (
<CheckboxDisclaimer
helpText="This text is designed to provide helpful information."
id={useUID()}
value="foo"
name="foo"
>
<Text as="span">
I declare the information provided above is accurate. I acknowledge that Twilio will process the information
provided above for the purpose of identity verification, and will be sharing it with my local telecomm providers
or authorities where required by local law. I understand that Twilio phone numbers may be taken out of service
for inaccurate or false information.
</Text>
</CheckboxDisclaimer>
);
};

CheckboxDisclaimerHelpText.storyName = "Checkbox Disclaimer - HelpText";

export const CheckboxDisclaimerDisabled = (): React.ReactNode => {
return (
<CheckboxDisclaimer disabled id={useUID()} value="foo" name="foo">
Expand Down
6 changes: 6 additions & 0 deletions packages/paste-core/components/checkbox/type-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3989,6 +3989,12 @@
"required": false,
"externalProp": true
},
"helpText": {
"type": "| string\n | number\n | boolean\n | ReactElement<any, string | JSXElementConstructor<any>>\n | ReactFragment\n | ReactPortal",
"defaultValue": "null",
"required": false,
"externalProp": false
},
"hidden": {
"type": "boolean",
"defaultValue": null,
Expand Down
Loading