@workday/canvas-kit-docs 15.0.0-alpha.0008-next.0 → 15.0.0-alpha.0023-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.
Files changed (44) hide show
  1. package/dist/es6/lib/docs.js +180284 -180984
  2. package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -1
  3. package/dist/es6/lib/stackblitzFiles/App.js +2 -8
  4. package/dist/es6/lib/stackblitzFiles/App.tsx +2 -14
  5. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
  6. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
  7. package/dist/mdx/15.0-UPGRADE-GUIDE.mdx +197 -1
  8. package/dist/mdx/labs-react/combobox/examples/RTL.tsx +2 -2
  9. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +2 -8
  10. package/dist/mdx/preview-react/information-highlight/InformationHighlight.mdx +48 -29
  11. package/dist/mdx/preview-react/information-highlight/examples/RTL.tsx +3 -8
  12. package/dist/mdx/preview-react/loading-sparkles/examples/RTL.tsx +2 -7
  13. package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +2 -6
  14. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
  15. package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +1 -1
  16. package/dist/mdx/react/_examples/mdx/examples/Density.tsx +1 -1
  17. package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +1 -1
  18. package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +1 -1
  19. package/dist/mdx/react/banner/examples/StickyRTL.tsx +2 -13
  20. package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +1 -1
  21. package/dist/mdx/react/breadcrumbs/examples/RTL.tsx +2 -8
  22. package/dist/mdx/react/common/mdx/Theming.mdx +61 -0
  23. package/dist/mdx/react/expandable/examples/RTL.tsx +2 -7
  24. package/dist/mdx/react/loading-dots/examples/RTL.tsx +2 -7
  25. package/dist/mdx/react/pagination/examples/RTL.tsx +2 -2
  26. package/dist/mdx/react/popup/examples/RTL.tsx +2 -2
  27. package/dist/mdx/react/segmented-control/SegmentedControl.mdx +119 -26
  28. package/dist/mdx/react/segmented-control/examples/Basic.tsx +32 -28
  29. package/dist/mdx/{preview-react → react}/segmented-control/examples/Disabled.tsx +1 -1
  30. package/dist/mdx/{preview-react → react}/segmented-control/examples/Dynamic.tsx +1 -1
  31. package/dist/mdx/{preview-react → react}/segmented-control/examples/RTL.tsx +3 -3
  32. package/dist/mdx/{preview-react → react}/segmented-control/examples/Sizes.tsx +1 -1
  33. package/dist/mdx/{preview-react → react}/segmented-control/examples/TextAndIcon.tsx +1 -1
  34. package/dist/mdx/{preview-react → react}/segmented-control/examples/TextOnly.tsx +1 -1
  35. package/dist/mdx/{preview-react → react}/segmented-control/examples/Vertical.tsx +1 -1
  36. package/dist/mdx/react/table/examples/RightToLeft.tsx +2 -2
  37. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +1 -1
  38. package/dist/mdx/react/tabs/examples/RightToLeft.tsx +2 -2
  39. package/dist/mdx/react/toast/examples/RTL.tsx +2 -2
  40. package/lib/stackblitzFiles/App.tsx +2 -14
  41. package/package.json +6 -6
  42. package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +0 -139
  43. package/dist/mdx/preview-react/segmented-control/examples/Basic.tsx +0 -42
  44. package/dist/mdx/react/_examples/mdx/examples/SegmentControlWithText.tsx +0 -119
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../lib/stackblitzFiles/App.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,GAAG,+CAiBf,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../lib/stackblitzFiles/App.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,GAAG,+CAUf,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { CanvasProvider, ContentDirection, useTheme, } from '@workday/canvas-kit-react/common';
2
+ import { CanvasProvider } from '@workday/canvas-kit-react/common';
3
3
  import { createStyles } from '@workday/canvas-kit-styling';
4
4
  import { Demo } from './Demo';
5
5
  import { system } from '@workday/canvas-tokens-web';
@@ -7,11 +7,5 @@ const mainContentStyles = createStyles({
7
7
  padding: system.space.x4,
8
8
  });
9
9
  export const App = () => {
10
- // useTheme is filling in the Canvas theme object if any keys are missing
11
- const canvasTheme = useTheme({
12
- canvas: {
13
- direction: ContentDirection.LTR,
14
- },
15
- });
16
- return (_jsx(CanvasProvider, { theme: canvasTheme, children: _jsx(_Fragment, { children: _jsx("main", { className: mainContentStyles, children: _jsx(Demo, {}) }) }) }));
10
+ return (_jsx(CanvasProvider, { children: _jsx(_Fragment, { children: _jsx("main", { className: mainContentStyles, children: _jsx(Demo, {}) }) }) }));
17
11
  };
@@ -1,9 +1,4 @@
1
- import {
2
- CanvasProvider,
3
- ContentDirection,
4
- PartialEmotionCanvasTheme,
5
- useTheme,
6
- } from '@workday/canvas-kit-react/common';
1
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
7
2
  import {createStyles} from '@workday/canvas-kit-styling';
8
3
 
9
4
  import {Demo} from './Demo';
@@ -14,15 +9,8 @@ const mainContentStyles = createStyles({
14
9
  });
15
10
 
16
11
  export const App = () => {
17
- // useTheme is filling in the Canvas theme object if any keys are missing
18
- const canvasTheme: PartialEmotionCanvasTheme = useTheme({
19
- canvas: {
20
- direction: ContentDirection.LTR,
21
- },
22
- });
23
-
24
12
  return (
25
- <CanvasProvider theme={canvasTheme}>
13
+ <CanvasProvider>
26
14
  <>
27
15
  <main className={mainContentStyles}>
28
16
  <Demo />
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "14.1.19",
22
- "@workday/canvas-kit-preview-react": "14.1.19",
23
- "@workday/canvas-kit-react": "14.1.19",
24
- "@workday/canvas-kit-react-fonts": "^14.1.19",
25
- "@workday/canvas-kit-styling": "14.1.19",
21
+ "@workday/canvas-kit-labs-react": "14.1.21",
22
+ "@workday/canvas-kit-preview-react": "14.1.21",
23
+ "@workday/canvas-kit-react": "14.1.21",
24
+ "@workday/canvas-kit-react-fonts": "^14.1.21",
25
+ "@workday/canvas-kit-styling": "14.1.21",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "14.1.19",
22
- "@workday/canvas-kit-preview-react": "14.1.19",
23
- "@workday/canvas-kit-react": "14.1.19",
24
- "@workday/canvas-kit-react-fonts": "^14.1.19",
25
- "@workday/canvas-kit-styling": "14.1.19",
21
+ "@workday/canvas-kit-labs-react": "14.1.21",
22
+ "@workday/canvas-kit-preview-react": "14.1.21",
23
+ "@workday/canvas-kit-react": "14.1.21",
24
+ "@workday/canvas-kit-react-fonts": "^14.1.21",
25
+ "@workday/canvas-kit-styling": "14.1.21",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -15,8 +15,179 @@ space tokens, the new tokens aim to add more semantic meaning to allow for bette
15
15
 
16
16
  ## Table of Contents
17
17
 
18
+ - [Codemod](#codemod)
19
+ - [Instructions](#instructions)
20
+ - [Component Promotions](#component-promotions)
21
+ - [Segmented Control](#segmented-control-)
18
22
  - [Component Updates](#component-updates)
19
23
  - [Buttons](#buttons)
24
+ - [Removals](#removals)
25
+ - [Segmented Control (Deprecated)](#segmented-control-deprecated)
26
+ - [Glossary](#glossary)
27
+ - [Main](#main)
28
+ - [Preview](#preview)
29
+
30
+ ## Codemod
31
+
32
+ We've provided a [codemod](https://github.com/Workday/canvas-kit/tree/master/modules/codemod) to
33
+ automatically update your code to work with most of the breaking changes in v15. **Breaking changes
34
+ handled by the codemod are marked with 🤖 in the Upgrade Guide.**
35
+
36
+ A codemod is a script that makes programmatic transformations on your codebase by traversing the
37
+ AST, identifying patterns, and making prescribed changes. This greatly decreases opportunities for
38
+ error and reduces the number of manual updates, which allows you to focus on changes that need your
39
+ attention. **We highly recommend you use the codemod for these reasons.**
40
+
41
+ If you're new to running codemods or if it's been a minute since you've used one, there are a few
42
+ things you'll want to keep in mind.
43
+
44
+ - Our codemods are meant to be run sequentially. For example, if you're using v13 of Canvas Kit,
45
+ you'll need to run the v14 codemod before you run v15.
46
+ - The codemod will update your code to be compatible with the specified version, but it will **not**
47
+ remove outdated dependencies or upgrade dependencies to the latest version. You'll need to upgrade
48
+ dependencies on your own.
49
+ - We recommend upgrading dependencies before running the codemod.
50
+ - Always review your `package.json` files to make sure your dependency versions look correct.
51
+ - The codemod will not handle every breaking change in v15. You will likely need to make some manual
52
+ changes to be compatible. Use our Upgrade Guide as a checklist.
53
+ - Codemods are not bulletproof.
54
+ - Conduct a thorough PR and QA review of all changes to ensure no regressions were introduced.
55
+ - As a safety precaution, we recommend committing the changes from the codemod as a single
56
+ isolated commit (separate from other changes) so you can roll back more easily if necessary.
57
+
58
+ We're here to help! Automatic changes to your codebase can feel scary. You can always reach out to
59
+ our team. We'd be very happy to walk you through the process to set you up for success.
60
+
61
+ ### Instructions
62
+
63
+ The easiest way to run our codemod is to use `npx` in your terminal.
64
+
65
+ ```sh
66
+ npx @workday/canvas-kit-codemod v15 [path]
67
+ ```
68
+
69
+ Be sure to provide specific directories that need to be updated via the `[path]` argument. This
70
+ decreases the amount of AST the codemod needs to traverse and reduces the chances of the script
71
+ having an error. For example, if your source code lives in `src/`, use `src/` as your `[path]`. Or,
72
+ if you have a monorepo with three packages using Canvas Kit, provide those specific packages as your
73
+ `[path]`.
74
+
75
+ Alternatively, if you're unable to run the codemod successfully using `npx`, you can install the
76
+ codemod package as a dev dependency, run it with `yarn`, and then remove the package after you're
77
+ finished.
78
+
79
+ ```sh
80
+ yarn add @workday/canvas-kit-codemod --dev
81
+ yarn canvas-kit-codemod v15 [path]
82
+ yarn remove @workday/canvas-kit-codemod
83
+ ```
84
+
85
+ > **Note:** The codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` files. You'll need to
86
+ > manually edit other file types (`.json`, `.mdx`, `.md`, etc.). You may need to run your linter
87
+ > after executing the codemod, as its resulting formatting (spacing, quotes, etc.) may not match
88
+ > your project conventions.
89
+
90
+ ## Component Promotions
91
+
92
+ ### Segmented Control ⚡️
93
+
94
+ We've promoted `SegmentedControl` from [Preview](/components/buttons/segmented-control/) to [Main](#main). This replaces the deprecated `SegmentedControl` that was previously in Main.
95
+
96
+ **Before in v14**
97
+
98
+ ```tsx
99
+ import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
100
+ ```
101
+
102
+ **After in v15**
103
+
104
+ ```tsx
105
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
106
+ ```
107
+
108
+ > 🤖 The codemod will handle the change of imports as shown above.
109
+
110
+ #### API Differences
111
+
112
+ The new `SegmentedControl` is a [compound component](/getting-started/for-developers/resources/compound-components/)
113
+ with a different API than the deprecated version.
114
+
115
+ ##### Structure Changes
116
+
117
+ | Deprecated (Old Main) | New (Promoted from Preview) |
118
+ | --------------------- | ----------------------------------- |
119
+ | `SegmentedControl` | `SegmentedControl` |
120
+ | `SegmentedControl.Button` | `SegmentedControl.List` + `SegmentedControl.Item` |
121
+
122
+ ##### Prop Changes
123
+
124
+ | Feature | Deprecated (Old Main) | New (Promoted from Preview) |
125
+ | ---------------- | ------------------------------------------ | ------------------------------------------------ |
126
+ | Selection | `value` prop on container | `initialValue` prop on container |
127
+ | Change handler | `onChange={(value) => {}}` | `onSelect={(data) => setSelected(data.id)}` |
128
+ | Item identifier | `value` prop on Button | `data-id` prop on Item |
129
+ | Disabled (all) | Not supported | `disabled` prop on container model |
130
+ | Size | Not supported | `size` prop (`small`, `medium`, `large`) |
131
+ | Orientation | Not supported | `orientation` prop (`horizontal`, `vertical`) |
132
+ | Text labels | Not supported | `children` on Item |
133
+ | Tooltips | Not supported | `tooltipProps` on Item |
134
+ | Accessibility | Manual | Built-in `aria-label` on List |
135
+
136
+ ##### Code Migration
137
+
138
+ **Deprecated API (Old Main)**
139
+
140
+ ```tsx
141
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
142
+
143
+ const [value, setValue] = React.useState<string | number>('list-view');
144
+
145
+ <SegmentedControl value={value} onChange={setValue}>
146
+ <SegmentedControl.Button icon={listViewIcon} value="list-view" />
147
+ <SegmentedControl.Button icon={worksheetsIcon} value="table-view" />
148
+ <SegmentedControl.Button icon={deviceTabletIcon} value="device-view" />
149
+ </SegmentedControl>
150
+ ```
151
+
152
+ **New API (v15)**
153
+
154
+ ```tsx
155
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
156
+
157
+ const [value, setValue] = React.useState('list-view');
158
+
159
+ <SegmentedControl initialValue={value} onSelect={data => setValue(data.id)}>
160
+ <SegmentedControl.List aria-label="View type">
161
+ <SegmentedControl.Item data-id="list-view" icon={listViewIcon} tooltipProps={{title: 'List'}} />
162
+ <SegmentedControl.Item data-id="table-view" icon={worksheetsIcon} tooltipProps={{title: 'Table'}} />
163
+ <SegmentedControl.Item data-id="device-view" icon={deviceTabletIcon} tooltipProps={{title: 'Device'}} />
164
+ </SegmentedControl.List>
165
+ </SegmentedControl>
166
+ ```
167
+
168
+ ##### New Features
169
+
170
+ The promoted `SegmentedControl` includes several new features:
171
+
172
+ - **Text and icon support**: Items can display text, icons, or both
173
+ - **Size variants**: `small`, `medium`, and `large` sizes
174
+ - **Vertical orientation**: Use `orientation="vertical"` for vertical layouts
175
+ - **Built-in tooltips**: Add tooltips via `tooltipProps` on items
176
+ - **Disabled state**: Disable all items via the model or individual items
177
+ - **Dynamic items**: Render items dynamically using the collection API
178
+
179
+ ```tsx
180
+ // Text only
181
+ <SegmentedControl.Item data-id="yearly">Yearly</SegmentedControl.Item>
182
+
183
+ // Icon with text
184
+ <SegmentedControl.Item data-id="list" icon={listViewIcon}>List View</SegmentedControl.Item>
185
+
186
+ // With size and orientation
187
+ <SegmentedControl size="large" orientation="vertical">
188
+ ...
189
+ </SegmentedControl>
190
+ ```
20
191
 
21
192
  ## Component Updates
22
193
 
@@ -28,4 +199,29 @@ The Following components have been updated to use our new `size`, `padding`, `ga
28
199
  tokens. These changes are **only visual**.
29
200
 
30
201
  `PrimaryButton`, `SecondaryButton`, `DeleteButton`, `TertiaryButton`, `ToolbarButton`,
31
- `ToolbarDropdownButton`, `Hyperlink`, `ExternalHyperlink`, and `ActionBar`.
202
+ `ToolbarDropdownButton`, `Hyperlink`, `ExternalHyperlink`, and `ActionBar`.
203
+
204
+ ## Removals
205
+
206
+ ### Segmented Control (Deprecated)
207
+
208
+ The deprecated `SegmentedControl` that was previously in `@workday/canvas-kit-react/segmented-control`
209
+ has been removed. This was the older implementation that used `SegmentedControl.Button` subcomponents.
210
+
211
+ Please migrate to the new `SegmentedControl` component (promoted from Preview) which uses a compound
212
+ component pattern with `SegmentedControl.List` and `SegmentedControl.Item`. See the
213
+ [API Differences](#api-differences) section above for migration guidance.
214
+
215
+ ## Glossary
216
+
217
+ For an overview of the different packages we provide, please view our docs
218
+ [here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
219
+
220
+ ### Main
221
+
222
+ Components in the Main package are stable and ready for production use.
223
+
224
+ ### Preview
225
+
226
+ Components in the Preview package are mostly stable but may still receive breaking changes before
227
+ being promoted to Main.
@@ -7,7 +7,7 @@ import {
7
7
  import {FormField} from '@workday/canvas-kit-react/form-field';
8
8
  import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
9
9
  import {TextInput} from '@workday/canvas-kit-react/text-input';
10
- import {CanvasProvider, ContentDirection, ExtractProps} from '@workday/canvas-kit-react/common';
10
+ import {CanvasProvider, ExtractProps} from '@workday/canvas-kit-react/common';
11
11
 
12
12
  const autocompleteResult = (
13
13
  textModifier: number,
@@ -78,7 +78,7 @@ const Autocomplete: FC<
78
78
 
79
79
  export default () => {
80
80
  return (
81
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
81
+ <CanvasProvider dir="rtl">
82
82
  <FormField id="rtl-autocomplete-123">
83
83
  <FormField.Label>RTL Autocomplete example</FormField.Label>
84
84
  <FormField.Field>
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
3
3
  import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
5
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
6
6
 
7
7
  const initialWineList = [
8
8
  'Beaujolais',
@@ -52,14 +52,8 @@ export default () => {
52
52
  console.log(`Searching for: ${searchInput}`);
53
53
  };
54
54
 
55
- const theme = {
56
- canvas: {
57
- direction: ContentDirection.RTL,
58
- },
59
- };
60
-
61
55
  return (
62
- <CanvasProvider theme={theme}>
56
+ <CanvasProvider dir="rtl">
63
57
  <Flex minHeight={200} alignItems="flex-start" padding="xs">
64
58
  <SearchForm
65
59
  autocompleteItems={menuItems}
@@ -1,8 +1,4 @@
1
- import {
2
- ExampleCodeBlock,
3
- SymbolDoc,
4
- Specifications,
5
- } from '@workday/canvas-kit-docs';
1
+ import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
6
2
 
7
3
  import * as InformationHighlight from './InformationHighlight.stories.ts';
8
4
  import Basic from './examples/Basic';
@@ -17,7 +13,8 @@ import RTL from './examples/RTL';
17
13
 
18
14
  # Canvas Kit Information Highlight
19
15
 
20
- A container to call out important information on a page or a section of a page that the user should be aware of.
16
+ A container to call out important information on a page or a section of a page that the user should
17
+ be aware of.
21
18
 
22
19
  ## Installation
23
20
 
@@ -27,59 +24,76 @@ yarn add @workday/canvas-kit-preview-react
27
24
 
28
25
  ## Usage
29
26
 
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.
27
+ `InformationHighlight` should be used to call out important information to the user and are paired
28
+ with a meaningful icon and color to differentiate information type. It should not be removed from
29
+ the interface until some system or admin level action has been taken to do so.
32
30
 
33
31
  You can use an `InformationHighlight` to:
32
+
34
33
  - Prevent unwanted consequences from destructive actions
35
34
  - Reassure users in their next steps
36
35
  - Provide detail into information on the page
37
36
  - Show changes in page content
38
37
 
39
38
  ### 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.
39
+
40
+ - Consider a
41
+ [Banner](https://workday.github.io/canvas-kit/?path=/docs/components-indicators-banner--docs) if
42
+ the message is about system-wide errors or alerts, or if the message appears in response to user
43
+ action.
44
+ - Consider a
45
+ [Dialog](https://workday.github.io/canvas-kit/?path=/docs/components-popups-dialog--docs) if the
46
+ message is critical and requires user action or decision before proceeding
47
+ - Consider a [Toast](https://workday.github.io/canvas-kit/?path=/docs/components-popups-toast--docs)
48
+ if the message is timely, such as communicating updates on the process of an application.
49
+
43
50
  ### Basic Example
44
- <ExampleCodeBlock code={Basic} />
45
51
 
52
+ <ExampleCodeBlock code={Basic} />
46
53
 
47
54
  ## Variants
48
- `InformationHighlight` has three variants and each `variant` has two types of `emphasis`.
49
55
 
56
+ `InformationHighlight` has three variants and each `variant` has two types of `emphasis`.
50
57
 
51
58
  Variants: `informational`, `caution`, `critical`
52
59
 
53
60
  Emphasis: `low`, `high`
54
61
 
62
+ The variants have different icons and colors to convey severity and the emphasis changes the
63
+ background color to have a lower or higher contrast. If no `variant` or `emphasis` is selected the
64
+ layout will default to `Variant: informational, Emphasis: low`.
55
65
 
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`.
66
+ The following examples will show the `low` and `high` emphasis of the three variants. `low` Emphasis
67
+ will be shown first and should be used when there is other more important information on the page.
68
+ `high` Emphasis will be shown second, and should be used when the highlight is not competing with
69
+ other, more important information.
59
70
 
71
+ ### Informational
60
72
 
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.
73
+ The informational variant is for _nice to have_ information, such as related features or
74
+ opportunities.
64
75
 
65
- ### Informational
66
- The informational variant is for _nice to have_ information, such as related features or opportunities.
67
76
  <ExampleCodeBlock code={Informational} />
68
77
 
69
78
  ### Caution
70
- The caution variant is for _important to know_ information, such as the potential consequences of specific actions.
71
79
 
72
- <ExampleCodeBlock code={Caution} />
80
+ The caution variant is for _important to know_ information, such as the potential consequences of
81
+ specific actions.
73
82
 
83
+ <ExampleCodeBlock code={Caution} />
74
84
 
75
85
  ### Critical
76
- The critical variant is for _must know_ information that could otherwise cause failure if the user is unaware
77
86
 
78
- <ExampleCodeBlock code={Critical} />
87
+ The critical variant is for _must know_ information that could otherwise cause failure if the user
88
+ is unaware
79
89
 
90
+ <ExampleCodeBlock code={Critical} />
80
91
 
81
92
  ### RTL Example
82
- Information Highlight also supports RTL Languages. To enable RTL, add a custom theme with direction set to 'ContentDirection.RTL'
93
+
94
+ Information Highlight also supports RTL Languages. To enable RTL, set the `dir` attribute on the
95
+ parent dom element that renders your application.
96
+
83
97
  <ExampleCodeBlock code={RTL} />
84
98
 
85
99
  ## Partial and Custom Information Highlights
@@ -87,18 +101,23 @@ The critical variant is for _must know_ information that could otherwise cause f
87
101
  `InformationHighlight` can use custom icons or be designed to only use some of its components.
88
102
 
89
103
  ### Custom Icon: Critical
104
+
90
105
  <ExampleCodeBlock code={IconCritical} />
91
106
 
92
107
  ### Body Only Example
108
+
93
109
  <ExampleCodeBlock code={Body} />
94
110
 
95
111
  ### Heading Only Example
112
+
96
113
  <ExampleCodeBlock code={Heading} />
97
114
 
98
115
  ### 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.
116
+
117
+ Like many of our components, `InformationHighlight` and it's subcomponents accept an `as` prop,
118
+ which lets you change the underlying semantic element. For `InformationHighlight.Heading`, you can
119
+ change the heading level if you were needing to define a different level of importance. This should
120
+ be done with caution to ensure the best accessibility.
102
121
 
103
122
  ## Component API
104
123
 
@@ -1,17 +1,12 @@
1
1
  import React from 'react';
2
2
  import {Flex} from '@workday/canvas-kit-react/layout';
3
3
  import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
4
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
4
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
5
5
  import {system} from '@workday/canvas-tokens-web';
6
6
  export default () => {
7
- const theme = {
8
- canvas: {
9
- direction: ContentDirection.RTL,
10
- },
11
- };
12
7
  return (
13
8
  <Flex flexDirection={'column'} gap={system.space.x2}>
14
- <CanvasProvider theme={theme}>
9
+ <CanvasProvider dir="rtl">
15
10
  <InformationHighlight variant={'caution'} emphasis={'low'}>
16
11
  <InformationHighlight.Icon />
17
12
  <InformationHighlight.Heading>
@@ -24,7 +19,7 @@ export default () => {
24
19
  <InformationHighlight.Link href="#hyperlink">وثائق</InformationHighlight.Link>
25
20
  </InformationHighlight>
26
21
  </CanvasProvider>
27
- <CanvasProvider theme={theme}>
22
+ <CanvasProvider dir="rtl">
28
23
  <InformationHighlight variant={'caution'} emphasis={'high'}>
29
24
  <InformationHighlight.Icon />
30
25
  <InformationHighlight.Heading>
@@ -1,15 +1,10 @@
1
1
  import React from 'react';
2
2
  import {LoadingSparkles} from '@workday/canvas-kit-preview-react/loading-sparkles';
3
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
3
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
4
4
 
5
5
  export default () => {
6
- const theme = {
7
- canvas: {
8
- direction: ContentDirection.RTL,
9
- },
10
- };
11
6
  return (
12
- <CanvasProvider theme={theme}>
7
+ <CanvasProvider dir="rtl">
13
8
  <LoadingSparkles />
14
9
  </CanvasProvider>
15
10
  );
@@ -1,10 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
3
- import {
4
- SidePanel,
5
- useSidePanel,
6
- SidePanelTransitionStates,
7
- } from '@workday/canvas-kit-preview-react/side-panel';
3
+ import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
8
4
  import {Flex} from '@workday/canvas-kit-react/layout';
9
5
  import {Heading, Text} from '@workday/canvas-kit-react/text';
10
6
  import {CanvasProvider} from '@workday/canvas-kit-react/common';
@@ -40,7 +36,7 @@ export default () => {
40
36
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
41
37
 
42
38
  return (
43
- <CanvasProvider theme={{canvas: {direction}}}>
39
+ <CanvasProvider dir={direction}>
44
40
  <Flex cs={stylesOverride.viewPortContainer}>
45
41
  <SidePanel {...panelProps}>
46
42
  <SidePanel.ToggleButton {...controlProps} />
@@ -51,7 +51,7 @@ export default () => {
51
51
  const {direction, toggleDirection} = useDirection();
52
52
 
53
53
  return (
54
- <CanvasProvider theme={{canvas: {direction}}}>
54
+ <CanvasProvider dir={direction}>
55
55
  <Flex cs={stylesOverride.viewport}>
56
56
  <Flex as="main" cs={stylesOverride.main}>
57
57
  <Text as="p" typeLevel="body.large">
@@ -34,7 +34,7 @@ export default () => {
34
34
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
35
35
 
36
36
  return (
37
- <CanvasProvider theme={{canvas: {direction}}}>
37
+ <CanvasProvider dir={direction}>
38
38
  <Flex cs={stylesOverride.viewport}>
39
39
  <SidePanel {...panelProps} variant="alternate">
40
40
  <SidePanel.ToggleButton {...controlProps} />
@@ -4,7 +4,7 @@ import {TextInput} from '@workday/canvas-kit-react/text-input';
4
4
  import {Select} from '@workday/canvas-kit-react/select';
5
5
  import {Switch} from '@workday/canvas-kit-react/switch';
6
6
  import {Heading, Text} from '@workday/canvas-kit-react/text';
7
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
7
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
8
8
  import {calc, createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
9
9
  import {system} from '@workday/canvas-tokens-web';
10
10
 
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
 
3
3
  import {Grid, Box} from '@workday/canvas-kit-react/layout';
4
4
  import {BodyText, Heading} from '@workday/canvas-kit-react/text';
5
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
5
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
6
6
 
7
7
  export default () => {
8
8
  const [screen, setScreen] = React.useState('100%');
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import {breakpoints} from '@workday/canvas-kit-react/common';
3
3
  import {ActionBar, useActionBarModel} from '@workday/canvas-kit-react/action-bar';
4
4
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
5
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
5
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
6
6
  import {Box} from '@workday/canvas-kit-react/layout';
7
7
 
8
8
  type MyActionItem = {
@@ -1,20 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {Box} from '@workday/canvas-kit-react/layout';
4
- import {
5
- CanvasProvider,
6
- ContentDirection,
7
- PartialEmotionCanvasTheme,
8
- styled,
9
- } from '@workday/canvas-kit-react/common';
4
+ import {CanvasProvider, styled} from '@workday/canvas-kit-react/common';
10
5
  import {Banner} from '@workday/canvas-kit-react/banner';
11
6
 
12
- const theme: PartialEmotionCanvasTheme = {
13
- canvas: {
14
- direction: ContentDirection.RTL,
15
- },
16
- };
17
-
18
7
  const StyledStickyBanner = styled(Banner)({
19
8
  position: 'absolute',
20
9
  right: 0,
@@ -22,7 +11,7 @@ const StyledStickyBanner = styled(Banner)({
22
11
 
23
12
  export default () => {
24
13
  return (
25
- <CanvasProvider theme={theme}>
14
+ <CanvasProvider dir="rtl">
26
15
  <Box height={64}>
27
16
  <StyledStickyBanner isSticky={true}>
28
17
  <Banner.Icon />
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import {Breadcrumbs, useBreadcrumbsModel} from '@workday/canvas-kit-react/breadcrumbs';
3
3
  import {Box} from '@workday/canvas-kit-react/layout';
4
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
4
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
5
5
 
6
6
  export interface Breadcrumb {
7
7
  id: string;