File tree Expand file tree Collapse file tree 3 files changed +85
-0
lines changed
packages/paste-website/src Expand file tree Collapse file tree 3 files changed +85
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,55 @@ render(
148148)
149149` . trim ( ) ;
150150
151+ export const suffixExample = `
152+ const DateRadioGroup = () => {
153+ const [value, setValue] = React.useState('lowest');
154+ return (
155+ <RadioGroup
156+ name="date"
157+ value={value}
158+ legend="Select date"
159+ onChange={newValue => {
160+ setValue(newValue);
161+ }}
162+ >
163+ <Radio
164+ id="today"
165+ value="today"
166+ name="date"
167+ >
168+ Today
169+ </Radio>
170+ <Radio
171+ id="last-15-days"
172+ value="last-15-days"
173+ name="date"
174+ >
175+ Last 15 days
176+ </Radio>
177+ <Radio
178+ id="last-month"
179+ value="last-month"
180+ name="date"
181+ >
182+ Last month
183+ </Radio>
184+ <Radio
185+ id="custom"
186+ value="custom"
187+ name="date"
188+ >
189+ <Box display="flex" columnGap="space30">Custom <Badge variant="success" size="small">Premium</Badge></Box>
190+ </Radio>
191+ </RadioGroup>
192+ );
193+ };
194+
195+ render(
196+ <DateRadioGroup />
197+ )
198+ ` . trim ( ) ;
199+
151200export const requiredExample = `
152201const SslRadioGroup = () => {
153202 const [value, setValue] = React.useState('on');
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export const meta = {
88
99import {Checkbox , CheckboxGroup , CheckboxDisclaimer } from ' @twilio-paste/checkbox' ;
1010import {Box } from ' @twilio-paste/box' ;
11+ import {Badge } from ' @twilio-paste/badge' ;
1112import {Text } from ' @twilio-paste/text' ;
1213import {Paragraph } from ' @twilio-paste/paragraph' ;
1314import {Anchor } from ' @twilio-paste/anchor' ;
@@ -177,6 +178,31 @@ You can provide additional information about the group with the use of help text
177178</CheckboxGroup> ` }
178179</LivePreview >
179180
181+ ### Checkbox with suffix
182+
183+ You can provide additional information about an individual item by adding a non-string element as a suffix. The suffix can be any non-string element that is not interactive.
184+
185+ <LivePreview scope = { {Checkbox , CheckboxGroup , Badge , Box }} language = " jsx" >
186+ { ` <CheckboxGroup
187+ name="call logs status"
188+ legend="Call logs status"
189+ helpText="Select at least 1 status to view results"
190+ >
191+ <Checkbox id="busy" value="busy">
192+ <Box display="flex" columnGap="space30">Busy <Badge variant="new" size="small">New</Badge></Box>
193+ </Checkbox>
194+ <Checkbox id="canceled" value="canceled">
195+ Canceled
196+ </Checkbox>
197+ <Checkbox id="completed" value="completed">
198+ Completed
199+ </Checkbox>
200+ <Checkbox id="queued" value="queued">
201+ Queued
202+ </Checkbox>
203+ </CheckboxGroup> ` }
204+ </LivePreview >
205+
180206### Checkbox Disclaimer
181207
182208<LivePreview scope = { {CheckboxDisclaimer , Text }} language = " jsx" >
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export const meta = {
88
99import {Radio , RadioGroup } from ' @twilio-paste/radio-group' ;
1010import {Box } from ' @twilio-paste/box' ;
11+ import {Badge } from ' @twilio-paste/badge' ;
1112import {useUID } from ' @twilio-paste/uid-library' ;
1213import {Paragraph } from ' @twilio-paste/paragraph' ;
1314import {SiteLink } from ' ../../../components/SiteLink' ;
@@ -24,6 +25,7 @@ import {
2425 uncontrolledRadioGroup ,
2526 controlledRadioGroup ,
2627 i18nExample ,
28+ suffixExample ,
2729} from ' ../../../component-examples/RadioGroupExamples' ;
2830import packageJson from ' @twilio-paste/radio-group/package.json' ;
2931import ComponentPageLayout from ' ../../../layouts/ComponentPageLayout' ;
@@ -137,6 +139,14 @@ Help text appears after the group label but before the first radio option.
137139 { defaultExample }
138140</LivePreview >
139141
142+ ### With suffix
143+
144+ You can provide additional information about an individual item by adding a non-string element as a suffix. The suffix can be any non-string element that is not interactive.
145+
146+ <LivePreview scope = { {Radio , RadioGroup , Box , Badge }} noInline >
147+ { suffixExample }
148+ </LivePreview >
149+
140150### Required usage
141151
142152Use the required dot to denote a required field. The required dot appears before the fieldset legend.
You can’t perform that action at this time.
0 commit comments