Skip to content

Commit

Permalink
fix(checkbox): expose helpText on CheckboxDisclaimer (#4020)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus authored Aug 6, 2024
1 parent e4135e8 commit 300c6c2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
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

0 comments on commit 300c6c2

Please sign in to comment.