@workday/canvas-kit-docs 14.1.18 → 14.2.0-0009-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 (27) hide show
  1. package/dist/es6/lib/docs.js +35 -12
  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/labs-react/combobox/examples/RTL.tsx +2 -2
  8. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +2 -8
  9. package/dist/mdx/preview-react/information-highlight/InformationHighlight.mdx +48 -29
  10. package/dist/mdx/preview-react/information-highlight/examples/RTL.tsx +3 -8
  11. package/dist/mdx/preview-react/loading-sparkles/examples/RTL.tsx +2 -7
  12. package/dist/mdx/preview-react/segmented-control/examples/RTL.tsx +2 -2
  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/banner/examples/StickyRTL.tsx +2 -13
  17. package/dist/mdx/react/breadcrumbs/examples/RTL.tsx +2 -8
  18. package/dist/mdx/react/common/mdx/Theming.mdx +61 -0
  19. package/dist/mdx/react/expandable/examples/RTL.tsx +2 -7
  20. package/dist/mdx/react/loading-dots/examples/RTL.tsx +2 -7
  21. package/dist/mdx/react/pagination/examples/RTL.tsx +2 -2
  22. package/dist/mdx/react/popup/examples/RTL.tsx +2 -2
  23. package/dist/mdx/react/table/examples/RightToLeft.tsx +2 -2
  24. package/dist/mdx/react/tabs/examples/RightToLeft.tsx +2 -2
  25. package/dist/mdx/react/toast/examples/RTL.tsx +2 -2
  26. package/lib/stackblitzFiles/App.tsx +2 -14
  27. package/package.json +6 -6
@@ -94957,7 +94957,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
94957
94957
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/banner/lib/hooks/useThemedPalette.ts"
94958
94958
  }
94959
94959
  ],
94960
- "tags": {},
94960
+ "tags": {
94961
+ "deprecated": "⚠️ `getPaletteColors` is deprecated. Use CSS variables from `@workday/canvas-tokens-web` instead. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
94962
+ },
94961
94963
  "type": {
94962
94964
  "kind": "function",
94963
94965
  "parameters": [
@@ -95069,7 +95071,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
95069
95071
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/banner/lib/hooks/useThemedPalette.ts"
95070
95072
  }
95071
95073
  ],
95072
- "tags": {},
95074
+ "tags": {
95075
+ "deprecated": "⚠️ `useThemedPalette` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
95076
+ },
95073
95077
  "type": {
95074
95078
  "kind": "function",
95075
95079
  "parameters": [
@@ -202378,7 +202382,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
202378
202382
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/CanvasProvider.tsx"
202379
202383
  }
202380
202384
  ],
202381
- "tags": {}
202385
+ "tags": {
202386
+ "deprecated": "⚠️ `theme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
202387
+ }
202382
202388
  },
202383
202389
  {
202384
202390
  "kind": "parameter",
@@ -202478,7 +202484,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
202478
202484
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/CanvasProvider.tsx"
202479
202485
  }
202480
202486
  ],
202481
- "tags": {}
202487
+ "tags": {
202488
+ "deprecated": "⚠️ `theme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
202489
+ }
202482
202490
  }
202483
202491
  ]
202484
202492
  }
@@ -204426,7 +204434,8 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
204426
204434
  }
204427
204435
  ],
204428
204436
  "tags": {
204429
- "param": "target\n \nA partial object with up to the same shape as the `fallback` object\nfallback\n \nA fallback object. If a property to be accessed from the proxy is not available on the target object, the fallback object will be used"
204437
+ "param": "target\n \nA partial object with up to the same shape as the `fallback` object\nfallback\n \nA fallback object. If a property to be accessed from the proxy is not available on the target object, the fallback object will be used",
204438
+ "deprecated": "⚠️ `getObjectProxy` is deprecated. This utility was used for theme object fallbacks. Now that we're shifting to a global theming approach based on CSS variables, this is no longer needed. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
204430
204439
  },
204431
204440
  "type": {
204432
204441
  "kind": "function",
@@ -204795,7 +204804,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
204795
204804
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
204796
204805
  }
204797
204806
  ],
204798
- "tags": {},
204807
+ "tags": {
204808
+ "deprecated": "⚠️ `ContentDirection` is deprecated. Use the `:dir()` CSS pseudo-class selector and CSS logical properties instead. For more information, see [MDN :dir()](https://developer.mozilla.org/en-US/docs/Web/CSS/:dir) and [CSS Logical Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values)."
204809
+ },
204799
204810
  "type": {
204800
204811
  "kind": "object",
204801
204812
  "typeParameters": [],
@@ -204830,7 +204841,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
204830
204841
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
204831
204842
  }
204832
204843
  ],
204833
- "tags": {},
204844
+ "tags": {
204845
+ "deprecated": "⚠️ `CanvasTheme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
204846
+ },
204834
204847
  "type": {
204835
204848
  "kind": "object",
204836
204849
  "properties": [
@@ -205327,7 +205340,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
205327
205340
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
205328
205341
  }
205329
205342
  ],
205330
- "tags": {},
205343
+ "tags": {
205344
+ "deprecated": "⚠️ `PartialCanvasTheme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
205345
+ },
205331
205346
  "type": {
205332
205347
  "kind": "type",
205333
205348
  "typeParameters": [],
@@ -205348,7 +205363,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
205348
205363
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
205349
205364
  }
205350
205365
  ],
205351
- "tags": {},
205366
+ "tags": {
205367
+ "deprecated": "⚠️ `PartialCanvasThemePalette` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
205368
+ },
205352
205369
  "type": {
205353
205370
  "kind": "type",
205354
205371
  "typeParameters": [],
@@ -205369,7 +205386,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
205369
205386
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
205370
205387
  }
205371
205388
  ],
205372
- "tags": {},
205389
+ "tags": {
205390
+ "deprecated": "⚠️ `PartialEmotionCanvasTheme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
205391
+ },
205373
205392
  "type": {
205374
205393
  "kind": "object",
205375
205394
  "properties": [
@@ -205439,7 +205458,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
205439
205458
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
205440
205459
  }
205441
205460
  ],
205442
- "tags": {},
205461
+ "tags": {
205462
+ "deprecated": "⚠️ `EmotionCanvasTheme` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
205463
+ },
205443
205464
  "type": {
205444
205465
  "kind": "object",
205445
205466
  "properties": [
@@ -206354,7 +206375,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
206354
206375
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/utils/colorUtils.ts"
206355
206376
  }
206356
206377
  ],
206357
- "tags": {},
206378
+ "tags": {
206379
+ "deprecated": "⚠️ `pickForegroundColor` is deprecated. In previous versions of Canvas Kit, we allowed teams to pass a theme object, this supported [Emotion's theming](https://emotion.sh/docs/theming). Now that we're shifting to a global theming approach based on CSS variables, we advise to no longer using the theme prop. For more information, view our [Theming Docs](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#-preferred-approach-v14)."
206380
+ },
206358
206381
  "type": {
206359
206382
  "kind": "function",
206360
206383
  "parameters": [
@@ -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.18",
22
- "@workday/canvas-kit-preview-react": "14.1.18",
23
- "@workday/canvas-kit-react": "14.1.18",
24
- "@workday/canvas-kit-react-fonts": "^14.1.18",
25
- "@workday/canvas-kit-styling": "14.1.18",
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",
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.18",
22
- "@workday/canvas-kit-preview-react": "14.1.18",
23
- "@workday/canvas-kit-react": "14.1.18",
24
- "@workday/canvas-kit-react-fonts": "^14.1.18",
25
- "@workday/canvas-kit-styling": "14.1.18",
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",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -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,4 +1,4 @@
1
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
1
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
2
2
  import {
3
3
  gridIcon,
4
4
  listViewIcon,
@@ -8,7 +8,7 @@ import {
8
8
  import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
9
9
 
10
10
  export default () => (
11
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
11
+ <CanvasProvider dir="rtl">
12
12
  <SegmentedControl initialValue="list-detail">
13
13
  <SegmentedControl.List aria-label="View type">
14
14
  <SegmentedControl.Item data-id="table" icon={gridIcon}>
@@ -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} />
@@ -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,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
2
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
3
3
  import {Breadcrumbs} from '@workday/canvas-kit-react/breadcrumbs';
4
4
  import {Box} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -10,12 +10,6 @@ export interface Breadcrumb {
10
10
  }
11
11
 
12
12
  export default () => {
13
- const theme = {
14
- canvas: {
15
- direction: ContentDirection.RTL,
16
- },
17
- };
18
-
19
13
  const [items] = React.useState<Breadcrumb[]>([
20
14
  {id: '1', text: 'תנ״ך', link: '/tanakh'},
21
15
  {id: '2', text: 'כתובים', link: '/ketuvim'},
@@ -26,7 +20,7 @@ export default () => {
26
20
  ]);
27
21
 
28
22
  return (
29
- <CanvasProvider theme={theme}>
23
+ <CanvasProvider dir="rtl">
30
24
  <Box maxWidth="300px">
31
25
  <Breadcrumbs items={items} aria-label="Breadcrumbs">
32
26
  <Breadcrumbs.List overflowButton={<Breadcrumbs.OverflowButton aria-label="More links" />}>
@@ -5,6 +5,8 @@ import Theming from './examples/Theming';
5
5
 
6
6
  # Canvas Kit Theming Guide
7
7
 
8
+ > **Deprecation Notice:** The `theme` prop on `CanvasProvider` and all associated theming utilities (`useTheme`, `getTheme`, `styled`, `defaultCanvasTheme`, etc.) are deprecated. Please use CSS variables from `@workday/canvas-tokens-web` for theming. See the [Preferred Approach](#-preferred-approach-v14) section below.
9
+
8
10
  ## Overview
9
11
 
10
12
  Canvas Kit v14 introduces a significant shift in our approach to theming: we've moved away from
@@ -266,6 +268,65 @@ Canvas Kit supports RTL out of the box. Our components are styled to use
266
268
  If you want to add additional styles based on RTL, you can also use the `:dir`
267
269
  [pseudo selector](https://developer.mozilla.org/en-US/docs/Web/CSS/:dir).
268
270
 
271
+ #### Setting RTL Direction
272
+
273
+ Use the native HTML `dir` attribute to set the text direction. The `CanvasProvider` accepts a `dir` prop which sets this attribute on its wrapper element:
274
+
275
+ ```tsx
276
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
277
+
278
+ // Set RTL direction
279
+ <CanvasProvider dir="rtl">
280
+ <App />
281
+ </CanvasProvider>
282
+ ```
283
+
284
+ You can also set it on any HTML element:
285
+
286
+ ```tsx
287
+ <div dir="rtl">
288
+ <MyComponent />
289
+ </div>
290
+ ```
291
+
292
+ > **Note:** The `dir` attribute is the standard HTML way to set text direction. It's preferred over the deprecated `theme.canvas.direction` approach because it works natively with CSS logical properties and the `:dir()` pseudo-class.
293
+
294
+ #### Using CSS Logical Properties
295
+
296
+ CSS logical properties automatically adapt to the text direction. Use these instead of physical properties:
297
+
298
+ ```css
299
+ /* Physical properties (don't adapt to RTL) */
300
+ .my-component {
301
+ margin-left: 1rem;
302
+ padding-right: 1rem;
303
+ border-left: 1px solid;
304
+ }
305
+
306
+ /* Logical properties (adapt to RTL automatically) */
307
+ .my-component {
308
+ margin-inline-start: 1rem;
309
+ padding-inline-end: 1rem;
310
+ border-inline-start: 1px solid;
311
+ }
312
+ ```
313
+
314
+ #### Conditional RTL Styles with `:dir()`
315
+
316
+ For styles that need to change based on direction (like rotating icons), use the `:dir()` pseudo-class:
317
+
318
+ ```tsx
319
+ import {createStyles} from '@workday/canvas-kit-styling';
320
+
321
+ const rtlButtonStyles = createStyles({
322
+ ':dir(rtl)': {
323
+ svg: {
324
+ transform: 'rotate(180deg)',
325
+ },
326
+ },
327
+ });
328
+ ```
329
+
269
330
  <ExampleCodeBlock code={RTL} />
270
331
 
271
332
  ### Resetting to Default Brand Theme
@@ -1,14 +1,9 @@
1
1
  import {Expandable} from '@workday/canvas-kit-react/expandable';
2
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
2
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
3
3
 
4
4
  export default () => {
5
- const theme = {
6
- canvas: {
7
- direction: ContentDirection.RTL,
8
- },
9
- };
10
5
  return (
11
- <CanvasProvider theme={theme}>
6
+ <CanvasProvider dir="rtl">
12
7
  <Expandable>
13
8
  <Expandable.Target headingLevel="h4">
14
9
  <Expandable.Icon iconPosition="start" />
@@ -1,15 +1,10 @@
1
1
  import React from 'react';
2
2
  import {LoadingDots} from '@workday/canvas-kit-react/loading-dots';
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
  <LoadingDots />
14
9
  </CanvasProvider>
15
10
  );
@@ -7,7 +7,7 @@ import {
7
7
  usePaginationModel,
8
8
  } from '@workday/canvas-kit-react/pagination';
9
9
 
10
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
10
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
11
11
 
12
12
  export default () => {
13
13
  const resultCount = 10;
@@ -15,7 +15,7 @@ export default () => {
15
15
  const lastPage = getLastPage(resultCount, totalCount);
16
16
 
17
17
  return (
18
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
18
+ <CanvasProvider dir="rtl">
19
19
  <Pagination aria-label="Pagination" lastPage={lastPage}>
20
20
  <Pagination.Controls>
21
21
  <Pagination.JumpToFirstButton aria-label="First" />
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {SecondaryButton, DeleteButton} from '@workday/canvas-kit-react/button';
4
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
4
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
5
5
  import {Popup} from '@workday/canvas-kit-react/popup';
6
6
  import {Box, Flex} from '@workday/canvas-kit-react/layout';
7
7
 
8
8
  export default () => {
9
9
  return (
10
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
10
+ <CanvasProvider dir="rtl">
11
11
  <Popup.Card width={400}>
12
12
  <Popup.CloseIcon aria-label="סגור" />
13
13
  <Popup.Heading>למחוק פריט</Popup.Heading>
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {Table} from '@workday/canvas-kit-react/table';
4
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
4
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
5
5
  import {createStyles} from '@workday/canvas-kit-styling';
6
6
  import {system} from '@workday/canvas-tokens-web';
7
7
 
@@ -11,7 +11,7 @@ const tableHeaderStyles = createStyles({
11
11
 
12
12
  export default () => {
13
13
  return (
14
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
14
+ <CanvasProvider dir="rtl">
15
15
  <Table>
16
16
  <Table.Caption>משקאות קפה וגדלים</Table.Caption>
17
17
  <Table.Head>
@@ -1,11 +1,11 @@
1
1
  import {space} from '@workday/canvas-kit-react/tokens';
2
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
2
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
3
3
 
4
4
  import {Tabs} from '@workday/canvas-kit-react/tabs';
5
5
 
6
6
  export default () => {
7
7
  return (
8
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
8
+ <CanvasProvider dir="rtl">
9
9
  <Tabs>
10
10
  <Tabs.List>
11
11
  <Tabs.Item>ראשון</Tabs.Item>
@@ -3,13 +3,13 @@ import React from 'react';
3
3
  import {Toast} from '@workday/canvas-kit-react/toast';
4
4
  import {checkIcon} from '@workday/canvas-system-icons-web';
5
5
  import {colors} from '@workday/canvas-kit-react/tokens';
6
- import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
6
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
7
7
 
8
8
  export default () => {
9
9
  const handleClose = () => console.log('close button clicked');
10
10
 
11
11
  return (
12
- <CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
12
+ <CanvasProvider dir="rtl">
13
13
  <Toast>
14
14
  <Toast.Icon icon={checkIcon} color="greenApple400" />
15
15
  <Toast.Body>
@@ -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 />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "14.1.18",
3
+ "version": "14.2.0-0009-next.0",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -45,10 +45,10 @@
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@stackblitz/sdk": "^1.11.0",
47
47
  "@storybook/csf": "0.0.1",
48
- "@workday/canvas-kit-labs-react": "^14.1.18",
49
- "@workday/canvas-kit-preview-react": "^14.1.18",
50
- "@workday/canvas-kit-react": "^14.1.18",
51
- "@workday/canvas-kit-styling": "^14.1.18",
48
+ "@workday/canvas-kit-labs-react": "^14.2.0-0009-next.0",
49
+ "@workday/canvas-kit-preview-react": "^14.2.0-0009-next.0",
50
+ "@workday/canvas-kit-react": "^14.2.0-0009-next.0",
51
+ "@workday/canvas-kit-styling": "^14.2.0-0009-next.0",
52
52
  "@workday/canvas-system-icons-web": "^3.0.36",
53
53
  "@workday/canvas-tokens-web": "^3.1.1",
54
54
  "markdown-to-jsx": "^7.2.0",
@@ -61,5 +61,5 @@
61
61
  "mkdirp": "^1.0.3",
62
62
  "typescript": "5.0"
63
63
  },
64
- "gitHead": "9b56d0948853d709adac5544e3d00e85bfafb589"
64
+ "gitHead": "818a2267813e8bdc146bc3cdefef5a9a519e918b"
65
65
  }