@workday/canvas-kit-docs 12.0.0-alpha.846-next.0 → 12.0.0-alpha.855-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +0,0 @@
1
- import React, {useState, useRef} from 'react';
2
- import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
3
- import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
- import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
5
- import {Flex} from '@workday/canvas-kit-react/layout';
6
- import {Text} from '@workday/canvas-kit-react/text';
7
- import {system, base} from '@workday/canvas-tokens-web';
8
- import {createStyles, px2rem} from '@workday/canvas-kit-styling';
9
-
10
- const liveRegionStyle = createStyles({
11
- border: `${px2rem(1)} solid ${base.cantaloupe400}`,
12
- backgroundColor: base.cantaloupe100,
13
- padding: system.space.x4,
14
- display: 'block',
15
- margin: system.space.x4 + ' 0',
16
- });
17
-
18
- export default () => {
19
- const [message, setMessage] = useState('This is an ARIA Live Region!');
20
- const inputRef = useRef();
21
- function handleSendMessage() {
22
- setMessage(inputRef.current.value);
23
- inputRef.current.value = '';
24
- }
25
-
26
- return (
27
- <>
28
- <AriaLiveRegion>
29
- <Text cs={liveRegionStyle}>{message}</Text>
30
- </AriaLiveRegion>
31
- <Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
32
- <TextInput orientation="vertical">
33
- <TextInput.Label>Type your message:</TextInput.Label>
34
- <TextInput.Field ref={inputRef} />
35
- </TextInput>
36
- <PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
37
- </Flex>
38
- </>
39
- );
40
- };