Skip to content

Commit

Permalink
chore: Merge prerelease/minor into prerelease/major (#2824)
Browse files Browse the repository at this point in the history
Co-authored-by: @NicholasBoll <[email protected]>
Co-authored-by: manuel.carrera <[email protected]>
Co-authored-by: @NicholasBoll <[email protected]>
Co-authored-by: @mannycarrera4 <[email protected]>
Co-authored-by: @snyk-bot <[email protected]>
Co-authored-by: @williamjstanton <[email protected]>
Co-authored-by: @mannycarrera4 <[email protected]>
Co-authored-by: @josh-bagwell <[email protected]>
  • Loading branch information
7 people authored Jul 19, 2024
2 parents 92573a5 + e11fd83 commit fb8e6d3
Show file tree
Hide file tree
Showing 28 changed files with 275 additions and 150 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [v11.0.18](https://github.com/Workday/canvas-kit/releases/tag/v11.0.18) (2024-07-18)

### Components

- fix(avatar): Lazy load avatar images ([#2833](https://github.com/Workday/canvas-kit/pull/2833)) ([@NicholasBoll](https://github.com/NicholasBoll))


## [v11.0.17](https://github.com/Workday/canvas-kit/releases/tag/v11.0.17) (2024-07-17)

### Documentation

- docs: Fixing and updating the AriaLiveRegion storybook examples ([#2818](https://github.com/Workday/canvas-kit/pull/2818)) ([@williamjstanton](https://github.com/williamjstanton), William Stanton, [@mannycarrera4](https://github.com/mannycarrera4), [@josh-bagwell](https://github.com/josh-bagwell), manuel.carrera)


## [v11.0.16](https://github.com/Workday/canvas-kit/releases/tag/v11.0.16) (2024-07-17)

### Infrastructure

- chore: SNYK Security upgrade markdown-to-jsx from 6.11.4 to 7.2.0 ([#2826](https://github.com/Workday/canvas-kit/pull/2826)) ([@mannycarrera4](https://github.com/mannycarrera4), [@snyk-bot](https://github.com/snyk-bot), manuel.carrera)


## [v11.0.15](https://github.com/Workday/canvas-kit/releases/tag/v11.0.15) (2024-07-11)

### Components

- fix(select): Add conditional for Select in React.StrictMode ([#2822](https://github.com/Workday/canvas-kit/pull/2822)) ([@NicholasBoll](https://github.com/NicholasBoll))


## [v10.3.44](https://github.com/Workday/canvas-kit/releases/tag/v10.3.44) (2024-07-10)

### Components

- fix(select): Add conditional for Select in React.StrictMode ([#2822](https://github.com/Workday/canvas-kit/pull/2822)) ([@NicholasBoll](https://github.com/NicholasBoll))
## [v11.0.14](https://github.com/Workday/canvas-kit/releases/tag/v11.0.14) (2024-07-10)

### Components
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"modules/**"
],
"version": "11.0.14",
"version": "11.0.18",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
2 changes: 1 addition & 1 deletion modules/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@workday/canvas-kit-codemod",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
"version": "11.0.14",
"version": "11.0.18",
"description": "A collection of codemods for use on Workday Canvas Kit packages.",
"main": "dist/es6/index.js",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion modules/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-css",
"version": "11.0.14",
"version": "11.0.18",
"description": "The parent module that contains all Workday Canvas Kit CSS components",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down
12 changes: 6 additions & 6 deletions modules/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-docs",
"version": "11.0.14",
"version": "11.0.18",
"description": "Documentation components of Canvas Kit components",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -44,13 +44,13 @@
"dependencies": {
"@emotion/styled": "^11.6.0",
"@storybook/csf": "0.0.1",
"@workday/canvas-kit-labs-react": "^11.0.14",
"@workday/canvas-kit-preview-react": "^11.0.14",
"@workday/canvas-kit-react": "^11.0.14",
"@workday/canvas-kit-styling": "^11.0.14",
"@workday/canvas-kit-labs-react": "^11.0.18",
"@workday/canvas-kit-preview-react": "^11.0.18",
"@workday/canvas-kit-react": "^11.0.18",
"@workday/canvas-kit-styling": "^11.0.18",
"@workday/canvas-system-icons-web": "^3.0.0",
"@workday/canvas-tokens-web": "^2.0.0",
"markdown-to-jsx": "^6.10.3",
"markdown-to-jsx": "^7.2.0",
"ts-node": "^10.9.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion modules/labs-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-labs-css",
"version": "11.0.14",
"version": "11.0.18",
"description": "The parent module that contains all Workday Canvas Kit Labs CSS components",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions modules/labs-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-labs-react",
"version": "11.0.14",
"version": "11.0.18",
"description": "Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functionality. The Labs modules allow us to do that as needed.",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@workday/canvas-kit-react": "^11.0.14",
"@workday/canvas-kit-react": "^11.0.18",
"@workday/canvas-system-icons-web": "^3.0.0",
"@workday/design-assets-types": "^0.2.8",
"chroma-js": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/popup-stack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-popup-stack",
"version": "11.0.14",
"version": "11.0.18",
"description": "Stack for managing popup UIs to coordinate global concerns like escape key handling and rendering order",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/preview-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-preview-css",
"version": "11.0.14",
"version": "11.0.18",
"description": "The parent module that contains all Workday Canvas Kit Preview CSS components",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down
6 changes: 3 additions & 3 deletions modules/preview-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-preview-react",
"version": "11.0.14",
"version": "11.0.18",
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -46,8 +46,8 @@
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@workday/canvas-kit-react": "^11.0.14",
"@workday/canvas-kit-styling": "^11.0.14",
"@workday/canvas-kit-react": "^11.0.18",
"@workday/canvas-kit-styling": "^11.0.18",
"@workday/canvas-system-icons-web": "^3.0.0",
"@workday/canvas-tokens-web": "^2.0.0",
"@workday/design-assets-types": "^0.2.8"
Expand Down
2 changes: 1 addition & 1 deletion modules/react-fonts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workday/canvas-kit-react-fonts",
"version": "11.0.14",
"version": "11.0.18",
"description": "Fonts for canvas-kit-react",
"author": "Workday, Inc. (https://www.workday.com)",
"license": "Apache-2.0",
Expand Down
16 changes: 10 additions & 6 deletions modules/react/_examples/stories/AriaLiveRegions.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
import {FilterListWithLiveStatus} from './examples/common/FilterListWithLiveStatus';
import {VisibleLiveRegion} from './examples/common/VisibleLiveRegion';
import {HiddenLiveRegion} from './examples/common/HiddenLiveRegion';
import {TextInputWithLiveError} from './examples/common/TextInputWithLiveError';
import {IconButtonsWithLiveBadges} from './examples/common/IconButtonsWithLiveBadges';
import {FilterListWithLiveStatus} from './examples/AriaLiveRegions/FilterListWithLiveStatus';
import {VisibleLiveRegion} from './examples/AriaLiveRegions/VisibleLiveRegion';
import {HiddenLiveRegion} from './examples/AriaLiveRegions/HiddenLiveRegion';
import {TextInputWithLiveError} from './examples/AriaLiveRegions/TextInputWithLiveError';

<Meta title="Examples/AriaLiveRegion" component={AriaLiveRegion} />

Expand Down Expand Up @@ -57,7 +56,7 @@ experience when moving the keyboard focus to a new element on screen isn't feasi

In this example, a live region is applied to a short UI text describing the number of items shown in
the list. As you type characters into the input, listen for the screen reader to automatically
describe how many items in the list or shown.
describe how many items in the list are shown.

<ExampleCodeBlock code={FilterListWithLiveStatus} />

Expand All @@ -73,4 +72,9 @@ of error conditions. As forms increase in complexity, live regions on each error
increasingly distracting and disruptive to the experience, especially if users are trying to first
understand the information that is required of them to complete the task.

**Note:** The `<AriaLiveRegion>` component is used inside of the `Hint` to ensure the live
region remains in the browser DOM at all times. The `Hint` is only rendered in the DOM when it
contains content, so it will not work reliably as a live region for screen readers using the
`as={AriaLiveRegion}` prop.

<ExampleCodeBlock code={TextInputWithLiveError} />
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, {useState} from 'react';
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
import {BodyText, Heading} from '@workday/canvas-kit-react/text';

import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
import {Flex} from '@workday/canvas-kit-react/layout';
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
import {TextInput} from '@workday/canvas-kit-react/text-input';
import {system, base} from '@workday/canvas-tokens-web';
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
import {createStyles, cssVar, px2rem} from '@workday/canvas-kit-styling';

const fruits = [
'Apples',
Expand All @@ -23,13 +25,19 @@ const liveRegionStyle = createStyles({
padding: system.space.x2,
});

const listStyles = {paddingLeft: '0px'};
const listStyles = createStyles({
paddingLeft: system.space.zero,
});

const listItemStyles = createStyles({
listStyle: 'none',
paddingLeft: system.space.zero,
});

const flexStyles = createStyles({
gap: system.space.x4,
});

let filteredFruits = fruits;

export const FilterListWithLiveStatus = () => {
Expand All @@ -41,19 +49,19 @@ export const FilterListWithLiveStatus = () => {

return (
<>
<Flex gap="1rem">
<Flex cs={flexStyles}>
<Heading size="small">Fruits</Heading>
<AriaLiveRegion>
<BodyText size="small" cs={liveRegionStyle}>
{`Showing ${filteredFruits.length} of ${fruits.length}`}
</BodyText>
</AriaLiveRegion>
</Flex>
<TextInput orientation="vertical">
<TextInput.Label>Filter Items:</TextInput.Label>
<TextInput.Field value={filter} onChange={handleFilter} />
</TextInput>
<ul style={listStyles}>
<FormField>
<FormField.Label>Filter Items:</FormField.Label>
<FormField.Input as={TextInput} value={filter} onChange={handleFilter} />
</FormField>
<ul className={listStyles}>
{filteredFruits.map(i => (
<BodyText size="small" as="li" cs={listItemStyles} key={i}>
{i}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';

import {AccessibleHide, AriaLiveRegion} from '@workday/canvas-kit-react/common';
import {PrimaryButton} from '@workday/canvas-kit-react/button';
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
import {Flex} from '@workday/canvas-kit-react/layout';
import {Text} from '@workday/canvas-kit-react/text';
import {TextInput} from '@workday/canvas-kit-react/text-input';
import {createStyles} from '@workday/canvas-kit-styling';
import {system} from '@workday/canvas-tokens-web';

let liveRegionStr = '';

const flexStyles = createStyles({
gap: system.space.x4,
alignItems: 'center',
});

export const HiddenLiveRegion = () => {
const [message, setMessage] = React.useState('');

function handleChange(e) {
setMessage(e.target.value);
}

function handleSendMessage(e) {
e.preventDefault();
liveRegionStr = message;
setMessage('');
}

return (
<>
<Flex as="form" aria-label="Hidden Live Region" onSubmit={handleSendMessage} cs={flexStyles}>
<FormField>
<FormField.Label>Type your message:</FormField.Label>
<FormField.Input as={TextInput} onChange={handleChange} value={message} />
</FormField>
<PrimaryButton type="submit">Send Message</PrimaryButton>
</Flex>
<AriaLiveRegion>
<Text as={AccessibleHide}>{liveRegionStr}</Text>
</AriaLiveRegion>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import {AriaLiveRegion, changeFocus} from '@workday/canvas-kit-react/common';
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
import {PrimaryButton} from '@workday/canvas-kit-react/button';
import {TextInput} from '@workday/canvas-kit-react/text-input';
import {system} from '@workday/canvas-tokens-web';
import {createStyles} from '@workday/canvas-kit-styling';

const hintStyles = createStyles({
height: system.space.x6,
});
export const TextInputWithLiveError = () => {
const errMsg = 'Error: First name is required.';
const [hasError, setHasError] = React.useState('no');
const inputRef = React.useRef(null);
const handleBlur = e => setHasError(e.target.value.trim().length === 0 ? 'error' : 'no');
const handleSubmit = () => hasError && changeFocus(inputRef.current);

return (
<>
<FormField error={hasError === 'error' ? 'error' : undefined} isRequired={true}>
<FormField.Label>First Name:</FormField.Label>
<FormField.Input as={TextInput} onBlur={handleBlur} ref={inputRef} />
<FormField.Hint cs={hintStyles}>
<AriaLiveRegion>{hasError === 'error' && errMsg}</AriaLiveRegion>
</FormField.Hint>
</FormField>
<PrimaryButton onClick={handleSubmit}>Continue</PrimaryButton>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';

import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
import {PrimaryButton} from '@workday/canvas-kit-react/button';
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
import {Flex} from '@workday/canvas-kit-react/layout';
import {Text} from '@workday/canvas-kit-react/text';
import {TextInput} from '@workday/canvas-kit-react/text-input';
import {system, base} from '@workday/canvas-tokens-web';
import {createStyles, px2rem, calc} from '@workday/canvas-kit-styling';

const liveRegionStyle = createStyles({
border: `${px2rem(1)} solid ${system.color.border.caution.default}`,
backgroundColor: system.color.bg.caution.default,
padding: system.space.x4,
display: 'block',
marginBlockStart: system.space.x4,
marginBlockEnd: system.space.x4,
width: calc.multiply(system.space.x16, 7),
});

const flexGapStyles = createStyles({
gap: system.space.x4,
alignItems: 'center',
});

let liveRegionStr = 'This is an ARIA Live Region!';

export const VisibleLiveRegion = () => {
const [message, setMessage] = React.useState('');

function handleChange(e) {
setMessage(e.target.value);
}

function handleSendMessage(e) {
e.preventDefault();
liveRegionStr = message;
setMessage('');
}

return (
<>
<AriaLiveRegion>
<Text cs={liveRegionStyle}>{liveRegionStr}</Text>
</AriaLiveRegion>
<Flex
as="form"
aria-label="Visible Live Region"
onSubmit={handleSendMessage}
cs={flexGapStyles}
>
<FormField>
<FormField.Label>Type your message:</FormField.Label>
<FormField.Input as={TextInput} onChange={handleChange} value={message} />
</FormField>
<PrimaryButton type="submit">Send Message</PrimaryButton>
</Flex>
</>
);
};
Loading

0 comments on commit fb8e6d3

Please sign in to comment.