| 105 | }; |
| 106 | |
| 107 | export const AutoTokenize: Story = args => ( |
| 108 | <TokenField |
| 109 | {...args} |
| 110 | allowsNewlines |
| 111 | defaultValue={TokenizingFieldValue.tokenize( |
| 112 | 'This example automatically tokenizes #hashtags and @usernames in the text.', |
| 113 | /(?<=\s|^)[#@]\S+(?=\s)/g |
| 114 | )}> |
| 115 | {segment => <Token>{segment.text}</Token>} |
| 116 | </TokenField> |
| 117 | ); |
| 118 | |
| 119 | AutoTokenize.args = { |
| 120 | label: 'Message', |