@workday/canvas-kit-docs 13.0.0-alpha.950-next.0 → 13.0.0-alpha.996-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/index.d.ts +0 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -1
- package/dist/es6/lib/docs.js +2058 -189
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +4 -0
- package/dist/es6/mdx/welcomePage.js +1 -1
- package/dist/mdx/10.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +6 -6
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +6 -6
- package/dist/mdx/CONTRIBUTING.mdx +1 -1
- package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +31 -0
- package/dist/mdx/preview-react/InformationHighlight/InformationHighlight.mdx +109 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Basic.tsx +18 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Body.tsx +13 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Caution.tsx +27 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Critical.tsx +33 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/CustomIconCritical.tsx +28 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Heading.tsx +11 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +27 -0
- package/dist/mdx/preview-react/InformationHighlight/examples/RTL.tsx +42 -0
- package/dist/mdx/preview-react/radio/Radio.mdx +2 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +1 -1
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +2 -2
- package/dist/mdx/react/_examples/GlobalHeader.mdx +36 -0
- package/dist/mdx/react/_examples/mdx/CompoundComponent.mdx +2 -2
- package/dist/mdx/react/_examples/mdx/Headers.mdx +26 -0
- package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +267 -37
- package/dist/mdx/react/badge/CountBadge.mdx +2 -2
- package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +13 -4
- package/dist/mdx/react/button/button/Button.mdx +5 -5
- package/dist/mdx/react/card/card.mdx +2 -2
- package/dist/mdx/react/checkbox/Checkbox.mdx +5 -5
- package/dist/mdx/react/combobox/Combobox.mdx +2 -2
- package/dist/mdx/react/form-field/FormField.mdx +2 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +4 -1
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +102 -53
- package/dist/mdx/react/select/Select.mdx +6 -6
- package/dist/mdx/react/switch/Switch.mdx +5 -5
- package/dist/mdx/react/table/Table.mdx +2 -2
- package/dist/mdx/react/text/BodyText.mdx +2 -2
- package/dist/mdx/react/text/Heading.mdx +2 -2
- package/dist/mdx/react/text/Subtext.mdx +2 -2
- package/dist/mdx/react/text/Text.mdx +2 -2
- package/dist/mdx/react/text/Title.mdx +2 -2
- package/dist/mdx/react/tokens/Tokens.mdx +2 -1
- package/dist/mdx/welcome.mdx +3 -3
- package/index.ts +0 -1
- package/package.json +7 -7
- package/dist/es6/lib/InformationHighlight/Base.d.ts +0 -5
- package/dist/es6/lib/InformationHighlight/Base.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Base.js +0 -9
- package/dist/es6/lib/InformationHighlight/Body.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Body.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Body.js +0 -18
- package/dist/es6/lib/InformationHighlight/Heading.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Heading.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Heading.js +0 -17
- package/dist/es6/lib/InformationHighlight/Icon.d.ts +0 -13
- package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Icon.js +0 -44
- package/dist/es6/lib/InformationHighlight/Link.d.ts +0 -2
- package/dist/es6/lib/InformationHighlight/Link.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/Link.js +0 -18
- package/dist/es6/lib/InformationHighlight/index.d.ts +0 -25
- package/dist/es6/lib/InformationHighlight/index.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/index.js +0 -44
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts +0 -19
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +0 -1
- package/dist/es6/lib/InformationHighlight/modelHook.js +0 -13
- package/lib/InformationHighlight/Base.tsx +0 -12
- package/lib/InformationHighlight/Body.tsx +0 -21
- package/lib/InformationHighlight/Heading.tsx +0 -20
- package/lib/InformationHighlight/Icon.tsx +0 -65
- package/lib/InformationHighlight/Link.tsx +0 -20
- package/lib/InformationHighlight/index.tsx +0 -62
- package/lib/InformationHighlight/modelHook.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsE1B,eAAO,MAAM,YAAY,yBAgCxB,CAAC"}
|
|
@@ -9,6 +9,10 @@ const allVersions = [
|
|
|
9
9
|
versionNumber: version,
|
|
10
10
|
documentation: 'https://github.com/Workday/canvas-kit',
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
versionNumber: 11,
|
|
14
|
+
documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v11/?path=/docs/welcome--page',
|
|
15
|
+
},
|
|
12
16
|
{
|
|
13
17
|
versionNumber: 10,
|
|
14
18
|
documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v10/?path=/docs/welcome--page',
|
|
@@ -34,7 +34,7 @@ export const WelcomePage = () => {
|
|
|
34
34
|
React.createElement(Card.Heading, null, "Getting Started"),
|
|
35
35
|
React.createElement(Card.Body, null,
|
|
36
36
|
React.createElement(Text, null, "For all things getting started including helpful guides and docs.")),
|
|
37
|
-
React.createElement(Grid.Item, { as: Hyperlink, alignSelf: "end", marginTop: "xs", href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--
|
|
37
|
+
React.createElement(Grid.Item, { as: Hyperlink, alignSelf: "end", marginTop: "xs", href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs" },
|
|
38
38
|
' ',
|
|
39
39
|
"Getting Started Guide")),
|
|
40
40
|
React.createElement(Grid, { as: Card, gridTemplateRows: "1fr 1fr 2fr 1fr", depth: "none", display: "grid", maxHeight: 320 },
|
|
@@ -48,7 +48,7 @@ If you're using Canvas Kit and not directly using this package, there is nothing
|
|
|
48
48
|
end. The Canvas Kit packages are using the static compilation as part of the build process. If you
|
|
49
49
|
want to use this package for your own styles, you don't need to do anything special to use in
|
|
50
50
|
development; just reference our
|
|
51
|
-
[documentation](https://workday.github.io/canvas-kit/?path=/
|
|
51
|
+
[documentation](https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started--docs) on
|
|
52
52
|
how to get started.
|
|
53
53
|
|
|
54
54
|
For more information on why this package was introduced, please reference our
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {Table} from '@workday/canvas-kit-react/table';
|
|
2
|
-
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
3
|
-
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
-
import {cssVar} from '@workday/canvas-kit-styling';
|
|
5
|
-
import {Box} from '@workday/canvas-kit-react/layout';
|
|
1
|
+
import { Table } from '@workday/canvas-kit-react/table';
|
|
2
|
+
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
3
|
+
import { StatusIndicator } from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
+
import { cssVar } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { Box } from '@workday/canvas-kit-react/layout';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# Canvas Kit 11.0 Upgrade Guide
|
|
@@ -850,7 +850,7 @@ previously in [Main](#main) (for reference, see
|
|
|
850
850
|
in [Main](#main) from v9).
|
|
851
851
|
|
|
852
852
|
`Table` is a
|
|
853
|
-
[compound component](https://workday.github.io/canvas-kit/?path=/docs/guides-compound-components--
|
|
853
|
+
[compound component](https://workday.github.io/canvas-kit/?path=/docs/guides-compound-components--docs)
|
|
854
854
|
which provides a flexible API and access to its internals via its subcomponents.
|
|
855
855
|
|
|
856
856
|
> **Note**: `rowState` prop is no longer a part of the `Table` component.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {Table} from '@workday/canvas-kit-react/table';
|
|
2
|
-
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
3
|
-
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
-
import {cssVar} from '@workday/canvas-kit-styling';
|
|
5
|
-
import {Box} from '@workday/canvas-kit-react/layout';
|
|
1
|
+
import { Table } from '@workday/canvas-kit-react/table';
|
|
2
|
+
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
3
|
+
import { StatusIndicator } from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
+
import { cssVar } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { Box } from '@workday/canvas-kit-react/layout';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# Canvas Kit 12.0 Upgrade Guide
|
|
@@ -361,7 +361,7 @@ made to provide more flexibility and better explicit components when using input
|
|
|
361
361
|
##### Breaking API Change
|
|
362
362
|
|
|
363
363
|
The newly promoted `FormField` is a
|
|
364
|
-
[compound component](https://workday.github.io/canvas-kit/?path=/docs/guides-compound-components--
|
|
364
|
+
[compound component](https://workday.github.io/canvas-kit/?path=/docs/guides-compound-components--docs).
|
|
365
365
|
Due to the different APIs of the component, this change is **not codemodable**. The following shows
|
|
366
366
|
an example of how to **update** your code to match the new compound component API.
|
|
367
367
|
|
|
@@ -155,7 +155,7 @@ Upon commit, [lint-staged](https://github.com/okonet/lint-staged) will run your
|
|
|
155
155
|
### Releases
|
|
156
156
|
|
|
157
157
|
- Releases are prepared by updating package versions with `lerna version`, and updating the
|
|
158
|
-
[changelog](/docs/changelog--
|
|
158
|
+
[changelog](/docs/changelog--docs)
|
|
159
159
|
- A PR is created for the above updates
|
|
160
160
|
- After the release PR is approved and merged, we create a release in GitHub with the contents of
|
|
161
161
|
the changelog updates.
|
|
@@ -7,12 +7,43 @@ document to learn about what a compound component is.
|
|
|
7
7
|
This document will go through building a simplified Disclosure component to help solidify the
|
|
8
8
|
concepts. We will cover:
|
|
9
9
|
|
|
10
|
+
- [Non Coordinated Components](#non-coordinated-components)
|
|
10
11
|
- [Models](#models)
|
|
11
12
|
- [Container Components](#disclosure-component)
|
|
12
13
|
- [Sub-components](#disclosuretarget-component)
|
|
13
14
|
- [Model Composition](#model-composition)
|
|
14
15
|
- [Behavior hooks](#behavior-hooks)
|
|
15
16
|
|
|
17
|
+
## Non Coordinated Components
|
|
18
|
+
|
|
19
|
+
In most cases you'll create compound components that have a model and share information across subcomponents. However, in the case where information doesn't need to be shared, you can create a non
|
|
20
|
+
coordinated component. These components often represent some styled element with no associated role
|
|
21
|
+
or behavior and don't rely on state and events such as a `Card`, `Flex` or `Button` components. Use
|
|
22
|
+
`createComponent` factory function in these scenarios.
|
|
23
|
+
|
|
24
|
+
### `createComponent`
|
|
25
|
+
|
|
26
|
+
Use `createComponent` when you want to create a rendered element with _no behavior_. This is useful
|
|
27
|
+
for elements that you want to use for styling purposes like container elements, or subcomponents
|
|
28
|
+
that are simple rendered elements. This utility function will wrap your component in a
|
|
29
|
+
`React.ForwardRef` and allow you to add subcomponents as well.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
export const Card = createComponent('div')({
|
|
33
|
+
displayName: 'Card',
|
|
34
|
+
subComponents: {
|
|
35
|
+
Heading: CardHeading, // this is also using createComponent
|
|
36
|
+
},
|
|
37
|
+
Component: ({children, ...elemProps}: CardProps, ref, Element) => {
|
|
38
|
+
return (
|
|
39
|
+
<Box as={Element} {...elemProps} ref={ref}>
|
|
40
|
+
{children}
|
|
41
|
+
</Box>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
16
47
|
## Models
|
|
17
48
|
|
|
18
49
|
A model is composed of state and events. The shape of the model used by components looks like this:
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
SymbolDoc,
|
|
4
|
+
Specifications,
|
|
5
|
+
} from '@workday/canvas-kit-docs';
|
|
6
|
+
|
|
7
|
+
import * as InformationHighlight from './InformationHighlight.stories.ts';
|
|
8
|
+
import Basic from './examples/Basic';
|
|
9
|
+
import Body from './examples/Body';
|
|
10
|
+
import Heading from './examples/Heading';
|
|
11
|
+
import Informational from './examples/Informational';
|
|
12
|
+
import Caution from './examples/Caution';
|
|
13
|
+
import Critical from './examples/Critical';
|
|
14
|
+
import IconCritical from './examples/CustomIconCritical';
|
|
15
|
+
import RTL from './examples/RTL';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Canvas Kit Information Highlight
|
|
19
|
+
|
|
20
|
+
A container to call out important information on a page or a section of a page that the user should be aware of.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
yarn add @workday/canvas-kit-preview-react
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
`InformationHighlight` should be used to call out important information to the user and are paired with a meaningful
|
|
31
|
+
icon and color to differentiate information type. It should not be removed from the interface until some system or admin level action has been taken to do so.
|
|
32
|
+
|
|
33
|
+
You can use an `InformationHighlight` to:
|
|
34
|
+
- Prevent unwanted consequences from destructive actions
|
|
35
|
+
- Reassure users in their next steps
|
|
36
|
+
- Provide detail into information on the page
|
|
37
|
+
- Show changes in page content
|
|
38
|
+
|
|
39
|
+
### When to Consider Something Else
|
|
40
|
+
- Consider a [Banner](https://workday.github.io/canvas-kit/?path=/docs/components-indicators-banner--docs) if the message is about system-wide errors or alerts, or if the message appears in response to user action.
|
|
41
|
+
- Consider a [Dialog](https://workday.github.io/canvas-kit/?path=/docs/components-popups-dialog--docs) if the message is critical and requires user action or decision before proceeding
|
|
42
|
+
- Consider a [Toast](https://workday.github.io/canvas-kit/?path=/docs/components-popups-toast--docs) if the message is timely, such as communicating updates on the process of an application.
|
|
43
|
+
### Basic Example
|
|
44
|
+
<ExampleCodeBlock code={Basic} />
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Variants
|
|
48
|
+
`InformationHighlight` has three variants and each `variant` has two types of `emphasis`.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Variants: `informational`, `caution`, `critical`
|
|
52
|
+
|
|
53
|
+
Emphasis: `low`, `high`
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
The variants have different icons and colors to convey severity and the emphasis changes the background color to have a
|
|
57
|
+
lower or higher contrast. If no `variant` or `emphasis` is selected the layout will default to
|
|
58
|
+
`Variant: informational, Emphasis: low`.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
The following examples will show the `low` and `high` emphasis of the three variants.
|
|
62
|
+
`low` Emphasis will be shown first and should be used when there is other more important information on the page.
|
|
63
|
+
`high` Emphasis will be shown second, and should be used when the highlight is not competing with other, more important information.
|
|
64
|
+
|
|
65
|
+
### Informational
|
|
66
|
+
The informational variant is for _nice to have_ information, such as related features or opportunities.
|
|
67
|
+
<ExampleCodeBlock code={Informational} />
|
|
68
|
+
|
|
69
|
+
### Caution
|
|
70
|
+
The caution variant is for _important to know_ information, such as the potential consequences of specific actions.
|
|
71
|
+
|
|
72
|
+
<ExampleCodeBlock code={Caution} />
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Critical
|
|
76
|
+
The critical variant is for _must know_ information that could otherwise cause failure if the user is unaware
|
|
77
|
+
|
|
78
|
+
<ExampleCodeBlock code={Critical} />
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### RTL Example
|
|
82
|
+
Information Highlight also supports RTL Languages. To enable RTL, add a custom theme with direction set to 'ContentDirection.RTL'
|
|
83
|
+
<ExampleCodeBlock code={RTL} />
|
|
84
|
+
|
|
85
|
+
## Partial and Custom Information Highlights
|
|
86
|
+
|
|
87
|
+
`InformationHighlight` can use custom icons or be designed to only use some of its components.
|
|
88
|
+
|
|
89
|
+
### Custom Icon: Critical
|
|
90
|
+
<ExampleCodeBlock code={IconCritical} />
|
|
91
|
+
|
|
92
|
+
### Body Only Example
|
|
93
|
+
<ExampleCodeBlock code={Body} />
|
|
94
|
+
|
|
95
|
+
### Heading Only Example
|
|
96
|
+
<ExampleCodeBlock code={Heading} />
|
|
97
|
+
|
|
98
|
+
### Accessible Use of the `as` Prop
|
|
99
|
+
Like many of our components, `InformationHighlight` and it's subcomponents accept an `as` prop, which lets you change
|
|
100
|
+
the underlying semantic element. For `InformationHighlight.Heading`, you can change the heading level if you were
|
|
101
|
+
needing to define a different level of importance. This should be done with caution to ensure the best accessibility.
|
|
102
|
+
|
|
103
|
+
## Component API
|
|
104
|
+
|
|
105
|
+
<SymbolDoc name="InformationHighlight" fileName="/preview-react/" />
|
|
106
|
+
|
|
107
|
+
## Specifications
|
|
108
|
+
|
|
109
|
+
<Specifications file="InformationHighlight.spec.tsx" name="InformationHighlight" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
return (
|
|
7
|
+
<InformationHighlight>
|
|
8
|
+
<InformationHighlight.Icon />
|
|
9
|
+
<InformationHighlight.Heading>Information Highlight</InformationHighlight.Heading>
|
|
10
|
+
<InformationHighlight.Body>
|
|
11
|
+
{' '}
|
|
12
|
+
This is what an information highlight would look like with with the default settings and
|
|
13
|
+
every field filled in{' '}
|
|
14
|
+
</InformationHighlight.Body>
|
|
15
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
16
|
+
</InformationHighlight>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
return (
|
|
7
|
+
<InformationHighlight>
|
|
8
|
+
<InformationHighlight.Body>
|
|
9
|
+
Only the body of an information highlight
|
|
10
|
+
</InformationHighlight.Body>
|
|
11
|
+
</InformationHighlight>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
return (
|
|
8
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
9
|
+
<InformationHighlight variant={'caution'}>
|
|
10
|
+
<InformationHighlight.Icon />
|
|
11
|
+
<InformationHighlight.Heading> Caution: Highlight Something </InformationHighlight.Heading>
|
|
12
|
+
<InformationHighlight.Body>
|
|
13
|
+
If you select the link below, nothing will happen
|
|
14
|
+
</InformationHighlight.Body>
|
|
15
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
16
|
+
</InformationHighlight>
|
|
17
|
+
<InformationHighlight variant={'caution'} emphasis={'high'}>
|
|
18
|
+
<InformationHighlight.Icon />
|
|
19
|
+
<InformationHighlight.Heading> Caution: Highlight Something </InformationHighlight.Heading>
|
|
20
|
+
<InformationHighlight.Body>
|
|
21
|
+
If you select the link below, nothing will happen
|
|
22
|
+
</InformationHighlight.Body>
|
|
23
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
24
|
+
</InformationHighlight>
|
|
25
|
+
</Flex>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
return (
|
|
8
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
9
|
+
<InformationHighlight variant={'critical'}>
|
|
10
|
+
<InformationHighlight.Icon />
|
|
11
|
+
<InformationHighlight.Heading>
|
|
12
|
+
{' '}
|
|
13
|
+
Attention! Highlight Something{' '}
|
|
14
|
+
</InformationHighlight.Heading>
|
|
15
|
+
<InformationHighlight.Body>
|
|
16
|
+
If you select the link below it will just reroute you back to this page
|
|
17
|
+
</InformationHighlight.Body>
|
|
18
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
19
|
+
</InformationHighlight>
|
|
20
|
+
<InformationHighlight variant={'critical'} emphasis={'high'}>
|
|
21
|
+
<InformationHighlight.Icon />
|
|
22
|
+
<InformationHighlight.Heading>
|
|
23
|
+
{' '}
|
|
24
|
+
Attention! Highlight Something{' '}
|
|
25
|
+
</InformationHighlight.Heading>
|
|
26
|
+
<InformationHighlight.Body>
|
|
27
|
+
If you select the link below it will just reroute you back to this page
|
|
28
|
+
</InformationHighlight.Body>
|
|
29
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
30
|
+
</InformationHighlight>
|
|
31
|
+
</Flex>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
3
|
+
import {chartIcon} from '@workday/canvas-system-icons-web';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
return (
|
|
9
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
10
|
+
<InformationHighlight variant={'critical'} emphasis={'low'}>
|
|
11
|
+
<InformationHighlight.Icon icon={chartIcon} />
|
|
12
|
+
<InformationHighlight.Heading> Attention! Custom Highlight </InformationHighlight.Heading>
|
|
13
|
+
<InformationHighlight.Body>
|
|
14
|
+
A custom Icon can be added to the Information Highlight component
|
|
15
|
+
</InformationHighlight.Body>
|
|
16
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
17
|
+
</InformationHighlight>
|
|
18
|
+
<InformationHighlight variant={'critical'} emphasis={'high'}>
|
|
19
|
+
<InformationHighlight.Icon icon={chartIcon} />
|
|
20
|
+
<InformationHighlight.Heading> Attention! Custom Highlight </InformationHighlight.Heading>
|
|
21
|
+
<InformationHighlight.Body>
|
|
22
|
+
A custom Icon can be added to the Information Highlight component
|
|
23
|
+
</InformationHighlight.Body>
|
|
24
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
25
|
+
</InformationHighlight>
|
|
26
|
+
</Flex>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
return (
|
|
7
|
+
<InformationHighlight>
|
|
8
|
+
<InformationHighlight.Heading> Only Heading </InformationHighlight.Heading>
|
|
9
|
+
</InformationHighlight>
|
|
10
|
+
);
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
return (
|
|
8
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
9
|
+
<InformationHighlight variant={'informational'}>
|
|
10
|
+
<InformationHighlight.Icon />
|
|
11
|
+
<InformationHighlight.Heading> Informational Highlight </InformationHighlight.Heading>
|
|
12
|
+
<InformationHighlight.Body>
|
|
13
|
+
If you select the link below it will just reroute you back to this page
|
|
14
|
+
</InformationHighlight.Body>
|
|
15
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
16
|
+
</InformationHighlight>
|
|
17
|
+
<InformationHighlight variant={'informational'} emphasis={'high'}>
|
|
18
|
+
<InformationHighlight.Icon />
|
|
19
|
+
<InformationHighlight.Heading> Informational Highlight </InformationHighlight.Heading>
|
|
20
|
+
<InformationHighlight.Body>
|
|
21
|
+
If you select the link below it will just reroute you back to this page
|
|
22
|
+
</InformationHighlight.Body>
|
|
23
|
+
<InformationHighlight.Link href="#hyperlink">View the Docs</InformationHighlight.Link>
|
|
24
|
+
</InformationHighlight>
|
|
25
|
+
</Flex>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/InformationHighlight';
|
|
4
|
+
import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
export default () => {
|
|
7
|
+
const theme = {
|
|
8
|
+
canvas: {
|
|
9
|
+
direction: ContentDirection.RTL,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
return (
|
|
13
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
14
|
+
<CanvasProvider theme={theme}>
|
|
15
|
+
<InformationHighlight variant={'caution'} emphasis={'low'}>
|
|
16
|
+
<InformationHighlight.Icon />
|
|
17
|
+
<InformationHighlight.Heading>
|
|
18
|
+
{' '}
|
|
19
|
+
انتباه! من اليمين إلى اليسار{' '}
|
|
20
|
+
</InformationHighlight.Heading>
|
|
21
|
+
<InformationHighlight.Body>
|
|
22
|
+
نحن ندعم اللغات من اليمين إلى اليسار
|
|
23
|
+
</InformationHighlight.Body>
|
|
24
|
+
<InformationHighlight.Link href="#hyperlink">وثائق</InformationHighlight.Link>
|
|
25
|
+
</InformationHighlight>
|
|
26
|
+
</CanvasProvider>
|
|
27
|
+
<CanvasProvider theme={theme}>
|
|
28
|
+
<InformationHighlight variant={'caution'} emphasis={'high'}>
|
|
29
|
+
<InformationHighlight.Icon />
|
|
30
|
+
<InformationHighlight.Heading>
|
|
31
|
+
{' '}
|
|
32
|
+
انتباه! من اليمين إلى اليسار{' '}
|
|
33
|
+
</InformationHighlight.Heading>
|
|
34
|
+
<InformationHighlight.Body>
|
|
35
|
+
نحن ندعم اللغات من اليمين إلى اليسار
|
|
36
|
+
</InformationHighlight.Body>
|
|
37
|
+
<InformationHighlight.Link href="#hyperlink">وثائق</InformationHighlight.Link>
|
|
38
|
+
</InformationHighlight>
|
|
39
|
+
</CanvasProvider>
|
|
40
|
+
</Flex>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
3
|
import Basic from './examples/Basic';
|
|
4
4
|
import Alert from './examples/Alert';
|
|
@@ -139,7 +139,7 @@ how to use `RadioGroup` with React Hook Form.
|
|
|
139
139
|
|
|
140
140
|
Radio and its subcomponents support custom styling via the `cs` prop. For more information, check
|
|
141
141
|
our
|
|
142
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
142
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
143
143
|
|
|
144
144
|
## Component API
|
|
145
145
|
|
|
@@ -7,7 +7,7 @@ import {controlComponent} from '../../../../../../utils/storybook';
|
|
|
7
7
|
|
|
8
8
|
export default () => {
|
|
9
9
|
return (
|
|
10
|
-
<FormField id="select-alert" error="
|
|
10
|
+
<FormField id="select-alert" error="alert">
|
|
11
11
|
<FormField.Label>Label</FormField.Label>
|
|
12
12
|
<FormField.Field>
|
|
13
13
|
{controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock, SymbolDoc } from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
3
|
import Basic from './examples/Basic';
|
|
4
4
|
import Emphasis from './examples/Emphasis';
|
|
@@ -75,7 +75,7 @@ The background color dictated by the `variant` will be dark or light based on th
|
|
|
75
75
|
|
|
76
76
|
Status Indicator and its subcomponents support custom styling via the `cs` prop. For more
|
|
77
77
|
information, check our
|
|
78
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--
|
|
78
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs).
|
|
79
79
|
|
|
80
80
|
## Component API
|
|
81
81
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Basic from './examples/GlobalHeader';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# GlobalHeader Example
|
|
5
|
+
|
|
6
|
+
Developers building internal Workday applications will likely not need to create this component.
|
|
7
|
+
However, if you're building components to be used outside of Workday, this is a helpful reference
|
|
8
|
+
for building a global navigation header that looks like our internal `GlobalHeader`.
|
|
9
|
+
|
|
10
|
+
<ExampleCodeBlock code={Basic} />
|
|
11
|
+
|
|
12
|
+
## Tooltip usage
|
|
13
|
+
|
|
14
|
+
- The `default` variant Tooltip is used on all of the icon buttons, which will automatically set the
|
|
15
|
+
Tooltip's text to the accessible name. (`aria-label`)
|
|
16
|
+
- The `describe` variant Tooltip is used instead on the "MENU" button because this is a text button.
|
|
17
|
+
The Tooltip's text "Global Navigation" will instead be assigned to the accessible description to
|
|
18
|
+
ensure that the visible button text "MENU" is not overriden.
|
|
19
|
+
|
|
20
|
+
## Count badge usage
|
|
21
|
+
|
|
22
|
+
When `<CountBadge>` is used as a sibling component for button, the `aria-describedby` property is
|
|
23
|
+
set on the button referencing the `id` value of the `<CountBadge>`. This practice helps support
|
|
24
|
+
users depending on screen readers to describe both the name of the button and the value of the
|
|
25
|
+
`<CountBadge>`.
|
|
26
|
+
|
|
27
|
+
When a web app dynamically updates count badges in real-time, consider the following accessibility
|
|
28
|
+
enhancements to support live, real-time announcements for screen readers:
|
|
29
|
+
|
|
30
|
+
- The `<CountBadge>` component is rendered as a child of the `<AriaLiveRegion>` container.
|
|
31
|
+
- The `<AriaLiveRegion>` container is assigned a name by using `aria-labelledby` to reference the
|
|
32
|
+
name of the icon button `"Notifications"`.
|
|
33
|
+
- The `<AccessibleHide>` component is used following the `<CountBadge>` to render a hidden word
|
|
34
|
+
"new" that only screen reader users can access.
|
|
35
|
+
- When the `<CountBadge>` is updated, then screen readers can automatically describe (in real-time)
|
|
36
|
+
the name of the live region, "Notifications" and the text updated inside of it, "1 new".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
1
|
+
import { ExampleCodeBlock } from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
3
|
import Template from './examples/compoundComponent/CustomCard';
|
|
4
4
|
|
|
@@ -11,6 +11,6 @@ Component component utilites are a great way to wrap and extend exisitng Canvas
|
|
|
11
11
|
can dramatically simplify state handling and gives you easy access to things like ref forwarding.
|
|
12
12
|
|
|
13
13
|
For more complex examples,
|
|
14
|
-
[see the creating-compound-components guide](https://workday.github.io/canvas-kit/?path=/docs/guides-creating-compound-components--
|
|
14
|
+
[see the creating-compound-components guide](https://workday.github.io/canvas-kit/?path=/docs/guides-creating-compound-components--docs).
|
|
15
15
|
|
|
16
16
|
<ExampleCodeBlock code={Template} />
|
|
@@ -12,6 +12,32 @@ Developers building internal Workday applications will likely not need to create
|
|
|
12
12
|
However, if you're building components to be used outside of Workday, this is a helpful reference
|
|
13
13
|
for building a global navigation header that looks like our internal `GlobalHeader`.
|
|
14
14
|
|
|
15
|
+
## Tooltip usage
|
|
16
|
+
|
|
17
|
+
- The `default` variant Tooltip is used on all of the icon buttons, which will automatically set the
|
|
18
|
+
Tooltip's text to the accessible name. (`aria-label`)
|
|
19
|
+
- The `describe` variant Tooltip is used instead on the "MENU" button because this is a text button.
|
|
20
|
+
The Tooltip's text "Global Navigation" will instead be assigned to the accessible description to
|
|
21
|
+
ensure that the visible button text "MENU" is not overriden.
|
|
22
|
+
|
|
23
|
+
## Count badge usage
|
|
24
|
+
|
|
25
|
+
When `<CountBadge>` is used as a sibling component for button, the `aria-describedby` property is
|
|
26
|
+
set on the button referencing the `id` value of the `<CountBadge>`. This practice helps support
|
|
27
|
+
users depending on screen readers to describe both the name of the button and the value of the
|
|
28
|
+
`<CountBadge>`.
|
|
29
|
+
|
|
30
|
+
When a web app dynamically updates count badges in real-time, consider the following accessibility
|
|
31
|
+
enhancements to support live, real-time announcements for screen readers:
|
|
32
|
+
|
|
33
|
+
- The `<CountBadge>` component is rendered as a child of the `<AriaLiveRegion>` container.
|
|
34
|
+
- The `<AriaLiveRegion>` container is assigned a name by using `aria-labelledby` to reference the
|
|
35
|
+
name of the icon button `"Notifications"`.
|
|
36
|
+
- The `<AccessibleHide>` component is used following the `<CountBadge>` to render a hidden word
|
|
37
|
+
"new" that only screen reader users can access.
|
|
38
|
+
- When the `<CountBadge>` is updated, then screen readers can automatically describe (in real-time)
|
|
39
|
+
the name of the live region, "Notifications" and the text updated inside of it, "1 new".
|
|
40
|
+
|
|
15
41
|
<ExampleCodeBlock code={GlobalHeaderBasic} />
|
|
16
42
|
|
|
17
43
|
## Page Header
|