@workday/canvas-kit-docs 12.0.0-alpha.841-next.0 → 12.0.0-alpha.852-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.
- package/dist/es6/lib/docs.js +9890 -2490
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +159 -1
- package/dist/mdx/react/_examples/AriaLiveRegions.mdx +10 -6
- package/dist/mdx/react/_examples/examples/{common → AriaLiveRegions}/FilterListWithLiveStatus.tsx +18 -10
- package/dist/mdx/react/_examples/examples/AriaLiveRegions/HiddenLiveRegion.tsx +46 -0
- package/dist/mdx/react/_examples/examples/AriaLiveRegions/TextInputWithLiveError.tsx +31 -0
- package/dist/mdx/react/_examples/examples/AriaLiveRegions/VisibleLiveRegion.tsx +61 -0
- package/dist/mdx/react/popup/Popup.mdx +13 -2
- package/dist/mdx/react/popup/examples/Basic.tsx +1 -1
- package/dist/mdx/react/popup/examples/ExternalWindow.tsx +177 -0
- package/package.json +7 -7
- package/dist/mdx/react/_examples/examples/common/HiddenLiveRegion.tsx +0 -30
- package/dist/mdx/react/_examples/examples/common/TextInputWithLiveError.tsx +0 -25
- package/dist/mdx/react/_examples/examples/common/VisibleLiveRegion.tsx +0 -40
- /package/dist/mdx/react/_examples/examples/{common → AriaLiveRegions}/IconButtonsWithLiveBadges.tsx +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React, {useState, useRef} from 'react';
|
|
2
|
-
import {AriaLiveRegion, AccessibleHide} 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 {system} from '@workday/canvas-tokens-web';
|
|
7
|
-
|
|
8
|
-
export default () => {
|
|
9
|
-
const [message, setMessage] = useState('This is an ARIA Live Region!');
|
|
10
|
-
const inputRef = useRef();
|
|
11
|
-
function handleSendMessage() {
|
|
12
|
-
setMessage(inputRef.current.value);
|
|
13
|
-
inputRef.current.value = '';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
|
|
19
|
-
<TextInput orientation="vertical">
|
|
20
|
-
<TextInput.Label>Type your message:</TextInput.Label>
|
|
21
|
-
<TextInput.Field ref={inputRef} />
|
|
22
|
-
</TextInput>
|
|
23
|
-
<PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
|
|
24
|
-
</Flex>
|
|
25
|
-
<AriaLiveRegion>
|
|
26
|
-
<AccessibleHide>{message}</AccessibleHide>
|
|
27
|
-
</AriaLiveRegion>
|
|
28
|
-
</>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, {useState, useRef} from 'react';
|
|
2
|
-
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
3
|
-
import {AriaLiveRegion, changeFocus} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
const errMsg = 'Error: First name is required.';
|
|
8
|
-
const [hasError, setHasError] = useState(false);
|
|
9
|
-
const inputRef = useRef();
|
|
10
|
-
const handleBlur = e => setHasError(e.target.value.trim().length === 0);
|
|
11
|
-
const handleSubmit = () => hasError && changeFocus(inputRef.current);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<>
|
|
15
|
-
<TextInput orientation="vertical" hasError={hasError} isRequired={true}>
|
|
16
|
-
<TextInput.Label>First Name:</TextInput.Label>
|
|
17
|
-
<TextInput.Field onBlur={handleBlur} ref={inputRef} />
|
|
18
|
-
<TextInput.Hint height={'16px'}>
|
|
19
|
-
<AriaLiveRegion>{hasError && errMsg}</AriaLiveRegion>
|
|
20
|
-
</TextInput.Hint>
|
|
21
|
-
</TextInput>
|
|
22
|
-
<PrimaryButton onClick={handleSubmit}>Continue</PrimaryButton>
|
|
23
|
-
</>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -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
|
-
};
|
/package/dist/mdx/react/_examples/examples/{common → AriaLiveRegions}/IconButtonsWithLiveBadges.tsx
RENAMED
|
File without changes
|