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(
148
148
)
149
149
` . trim ( ) ;
150
150
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
+
151
200
export const requiredExample = `
152
201
const SslRadioGroup = () => {
153
202
const [value, setValue] = React.useState('on');
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export const meta = {
8
8
9
9
import {Checkbox , CheckboxGroup , CheckboxDisclaimer } from ' @twilio-paste/checkbox' ;
10
10
import {Box } from ' @twilio-paste/box' ;
11
+ import {Badge } from ' @twilio-paste/badge' ;
11
12
import {Text } from ' @twilio-paste/text' ;
12
13
import {Paragraph } from ' @twilio-paste/paragraph' ;
13
14
import {Anchor } from ' @twilio-paste/anchor' ;
@@ -177,6 +178,31 @@ You can provide additional information about the group with the use of help text
177
178
</CheckboxGroup> ` }
178
179
</LivePreview >
179
180
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
+
180
206
### Checkbox Disclaimer
181
207
182
208
<LivePreview scope = { {CheckboxDisclaimer , Text }} language = " jsx" >
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export const meta = {
8
8
9
9
import {Radio , RadioGroup } from ' @twilio-paste/radio-group' ;
10
10
import {Box } from ' @twilio-paste/box' ;
11
+ import {Badge } from ' @twilio-paste/badge' ;
11
12
import {useUID } from ' @twilio-paste/uid-library' ;
12
13
import {Paragraph } from ' @twilio-paste/paragraph' ;
13
14
import {SiteLink } from ' ../../../components/SiteLink' ;
@@ -24,6 +25,7 @@ import {
24
25
uncontrolledRadioGroup ,
25
26
controlledRadioGroup ,
26
27
i18nExample ,
28
+ suffixExample ,
27
29
} from ' ../../../component-examples/RadioGroupExamples' ;
28
30
import packageJson from ' @twilio-paste/radio-group/package.json' ;
29
31
import ComponentPageLayout from ' ../../../layouts/ComponentPageLayout' ;
@@ -137,6 +139,14 @@ Help text appears after the group label but before the first radio option.
137
139
{ defaultExample }
138
140
</LivePreview >
139
141
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
+
140
150
### Required usage
141
151
142
152
Use 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