@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,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,29 +1,21 @@
1
- import {
2
- ExampleCodeBlock,
3
- StorybookStatusIndicator,
4
- SymbolDoc,
5
- Specifications,
6
- } from '@workday/canvas-kit-docs';
7
-
8
- import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
9
-
1
+ import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
10
2
  import Basic from './examples/Basic';
3
+ import Disabled from './examples/Disabled';
4
+ import TextAndIcon from './examples/TextAndIcon';
5
+ import TextOnly from './examples/TextOnly';
6
+ import Sizes from './examples/Sizes';
7
+ import Vertical from './examples/Vertical';
8
+ import RTL from './examples/RTL';
9
+ import Dynamic from './examples/Dynamic';
10
+
11
11
 
12
- # Canvas Kit Segmented Control <StorybookStatusIndicator type="deprecated" />
12
+ # Canvas Kit Segmented Control
13
13
 
14
- <InformationHighlight className="sb-unstyled" variant="caution" cs={{p: {marginBlock: 0}}}>
15
- <InformationHighlight.Icon />
16
- <InformationHighlight.Body>
17
- `SegmentedControl` in Main has been deprecated and will be removed in a future major version.
18
- Please use `Segmented Control` in Preview instead.
19
- </InformationHighlight.Body>
20
- <InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-segmented-control--docs">
21
- Segmented Control Docs
22
- </InformationHighlight.Link>
23
- </InformationHighlight>
14
+ Segmented Control is a
15
+ [compound component](/getting-started/for-developers/resources/compound-components/) that represents
16
+ a linear group of multiple buttons allowing the selection of a specific value.
24
17
 
25
- A linear set of two or more segments, each of which functions as a mutually exclusive button. This
26
- is a [_controlled_](https://reactjs.org/docs/forms.html#controlled-components) component.
18
+ [> Workday Design Reference](https://design.workday.com/components/buttons/segmented-control)
27
19
 
28
20
  ## Installation
29
21
 
@@ -35,12 +27,113 @@ yarn add @workday/canvas-kit-react
35
27
 
36
28
  ### Basic Example
37
29
 
38
- Here is a basic example of a Segmented Control with multiple nested `Button`s. **Note:** while
39
- managing state using a unique `value` for each `Button` child is encouraged, you can also use
40
- indexes and omit the `value` field. It is strongly recommended to not mix these two methods.
30
+ `SegmentedControl` includes a container `SegmentedControl` component and the following
31
+ subcomponents: `SegmentedControl.List` and `SegmentedControl.Item`.
32
+
33
+ The example below contains a `SegmentedControl` with four icon-only buttons. Each button is rendered
34
+ using a `SegmentedControl.Item` and is paired with a tooltip describing the button's function. Only
35
+ one button can be active at a time.
41
36
 
42
37
  <ExampleCodeBlock code={Basic} />
43
38
 
39
+ We **strongly** discourage including more than four buttons in a single `SegmentedControl`.
40
+
41
+ ### Accessibility
42
+
43
+ Our `SegmentedControl` component renders semantic HTML `<button>` elements to the browser DOM,
44
+ wrapped inside of a `<div>` with an explicit ARIA `role="group"`. This is equivalent to an HTML
45
+ `<fieldset>` element, and useful for screen readers to describe the relationship between the
46
+ buttons.
47
+
48
+ - Each button is a 2-state toggle button with `aria-pressed={true | false}` to indicate the current
49
+ state to screen readers.
50
+ - Providing your own `aria-label` string to `SegmentedControl.List` is recommended for describing the
51
+ purpose of the component.
52
+
53
+ #### Screen Reader Experience
54
+
55
+ When users interact with a `SegmentedControl` using screen readers:
56
+
57
+ - The group context is announced (e.g., "View options, group" when using
58
+ `aria-label="View options"`)
59
+ - Each button announces its text/label, "toggle button" role, and pressed/unpressed state (e.g.,
60
+ "List view, toggle button, pressed" or "Grid view, toggle button, not pressed")
61
+ - For icon-only buttons with tooltips, the tooltip text is announced along with the button role and
62
+ state
63
+ - When a button is activated, screen readers should announce the new state
64
+
65
+ Refer to [Button](?path=/docs/components-buttons--docs#accessibility) for more information about
66
+ accessibility of these components.
67
+
68
+ ### Variations
69
+
70
+ `SegmentedControl` supports three variations based on whether or not its `SegmentedControl.Item`
71
+ components have an `icon` prop and/or text content: icon-only, text-only, and text-and-icon.
72
+
73
+ All `SegmentedControl.Item` components within a given `SegmentedControl` must be of the same
74
+ variation.
75
+
76
+ #### Icon-Only
77
+
78
+ To render an icon-only `SegmentedControl`, apply the `icon` prop to `SegmentedControl.Item` and do
79
+ not provide it with text content. Refer to the [basic example](#basic-example) above for an instance
80
+ of an icon-only `SegmentedControl`.
81
+
82
+ The icon-only variation is the only variation which supports a vertical orientation in addition to
83
+ the default horizontal orientation. Set the `orientation` prop of `SegmentedControl` to `vertical`
84
+ to configure the component to render vertically.
85
+
86
+ <ExampleCodeBlock code={Vertical} />
87
+
88
+ #### Text-Only
89
+
90
+ To render a text-only `SegmentedControl`, omit the `icon` prop from `SegmentedControl.Item` and
91
+ provide it with text content.
92
+
93
+ <ExampleCodeBlock code={TextOnly} />
94
+
95
+ #### Text-and-Icon
96
+
97
+ To render a text-and-icon `SegmentedControl`, apply the `icon` prop to `SegmentedControl.Item` and
98
+ provide it with text content.
99
+
100
+ <ExampleCodeBlock code={TextAndIcon} />
101
+
102
+ ### Sizes
103
+
104
+ `SegmentedControl` accepts a `size` prop which supports the following values:
105
+
106
+ - `small`
107
+ - `medium` (Default)
108
+ - `large`
109
+
110
+ <ExampleCodeBlock code={Sizes} />
111
+
112
+ ### Disabled
113
+
114
+ Set the `disabled` prop of `SegmentedControl` to disable the entire component including its buttons.
115
+
116
+ <ExampleCodeBlock code={Disabled} />
117
+
118
+ ### Right-to-Left (RTL)
119
+
120
+ `SegmentedControl` supports right-to-left languages when specified in the `CanvasProvider` `theme`.
121
+
122
+ <ExampleCodeBlock code={RTL} />
123
+
124
+ ### Dynamic Items
125
+
126
+ `SegmentedControl` supports a
127
+ [dynamic API](/getting-started/for-developers/resources/collection-api/#dynamic-items) where instead
128
+ of statically providing the JSX for each `SegmentedControl.Item`, you pass an array of `items` in
129
+ the `model` state and provide a render function to display the items.
130
+
131
+ <ExampleCodeBlock code={Dynamic} />
132
+
44
133
  ## Component API
45
134
 
46
- <SymbolDoc name="SegmentedControl" fileName="/react/" />
135
+ <SymbolDoc name="SegmentedControl" fileName="/react/" />
136
+
137
+ ## Specifications
138
+
139
+ <Specifications file="SegmentedControl.spec.ts" name="SegmentedControl" />
@@ -1,38 +1,42 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
 
3
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
4
+ import {BodyText} from '@workday/canvas-kit-react/text';
3
5
  import {
6
+ gridIcon,
4
7
  listViewIcon,
5
- worksheetsIcon,
6
- deviceTabletIcon,
7
- percentageIcon,
8
+ listDetailIcon,
9
+ pieChartIcon,
8
10
  } from '@workday/canvas-system-icons-web';
9
- import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
10
11
 
11
12
  export default () => {
12
- const [value, setValue] = React.useState<string | number>();
13
- const handleToggle = (selectedValue: string | number) => {
14
- setValue(selectedValue);
15
- };
13
+ const [viewType, setViewType] = React.useState('table');
16
14
 
17
15
  return (
18
- <SegmentedControl value={value} onChange={handleToggle}>
19
- <SegmentedControl.Button
20
- icon={listViewIcon}
21
- value="list-view"
22
- onClick={e => console.log('Existing TertiaryButton onClick callback')}
23
- id="test"
24
- />
25
- <SegmentedControl.Button icon={worksheetsIcon} value="table-view" disabled={true} />
26
- <SegmentedControl.Button
27
- icon={deviceTabletIcon}
28
- value="device-view"
29
- aria-label="Device View"
30
- />
31
- <SegmentedControl.Button
32
- icon={percentageIcon}
33
- value="percent-view"
34
- aria-label="Percent View"
35
- />
36
- </SegmentedControl>
16
+ <>
17
+ <SegmentedControl initialValue={viewType} onSelect={data => setViewType(data.id)}>
18
+ <SegmentedControl.List aria-label="View type">
19
+ <SegmentedControl.Item data-id="table" icon={gridIcon} tooltipProps={{title: 'Table'}} />
20
+ <SegmentedControl.Item
21
+ data-id="list-view"
22
+ icon={listViewIcon}
23
+ tooltipProps={{title: 'List'}}
24
+ />
25
+ <SegmentedControl.Item
26
+ data-id="list-detail"
27
+ icon={listDetailIcon}
28
+ tooltipProps={{title: 'Detail'}}
29
+ />
30
+ <SegmentedControl.Item
31
+ data-id="diagrams"
32
+ icon={pieChartIcon}
33
+ tooltipProps={{title: 'Diagram'}}
34
+ />
35
+ </SegmentedControl.List>
36
+ </SegmentedControl>
37
+ <BodyText size="small" marginTop="s">
38
+ Selected: {viewType}
39
+ </BodyText>
40
+ </>
37
41
  );
38
42
  };
@@ -1,4 +1,4 @@
1
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
1
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
2
2
  import {
3
3
  gridIcon,
4
4
  listViewIcon,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import {
3
3
  SegmentedControl,
4
4
  useSegmentedControlModel,
5
- } from '@workday/canvas-kit-preview-react/segmented-control';
5
+ } from '@workday/canvas-kit-react/segmented-control';
6
6
  import {
7
7
  gridIcon,
8
8
  listViewIcon,
@@ -1,14 +1,14 @@
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,
5
5
  listDetailIcon,
6
6
  pieChartIcon,
7
7
  } from '@workday/canvas-system-icons-web';
8
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
8
+ import {SegmentedControl} from '@workday/canvas-kit-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}>
@@ -6,7 +6,7 @@ import {
6
6
  listDetailIcon,
7
7
  pieChartIcon,
8
8
  } from '@workday/canvas-system-icons-web';
9
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
9
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
10
10
  import {BodyText} from '@workday/canvas-kit-react/text';
11
11
 
12
12
  export default () => (
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import {gridIcon, listViewIcon, pieChartIcon} from '@workday/canvas-system-icons-web';
3
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
3
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
4
4
 
5
5
  export default () => (
6
6
  <SegmentedControl>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
2
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
3
3
 
4
4
  export default () => (
5
5
  <SegmentedControl>
@@ -1,4 +1,4 @@
1
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
1
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
2
2
  import {
3
3
  gridIcon,
4
4
  listViewIcon,
@@ -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,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {Tabs, useTabsModel} from '@workday/canvas-kit-react/tabs';
4
- import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
4
+ import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
5
5
  import {Box} from '@workday/canvas-kit-react/layout';
6
6
 
7
7
  type MyTabItem = {
@@ -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": "15.0.0-alpha.0008-next.0",
3
+ "version": "15.0.0-alpha.0023-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": "^15.0.0-alpha.0008-next.0",
49
- "@workday/canvas-kit-preview-react": "^15.0.0-alpha.0008-next.0",
50
- "@workday/canvas-kit-react": "^15.0.0-alpha.0008-next.0",
51
- "@workday/canvas-kit-styling": "^15.0.0-alpha.0008-next.0",
48
+ "@workday/canvas-kit-labs-react": "^15.0.0-alpha.0023-next.0",
49
+ "@workday/canvas-kit-preview-react": "^15.0.0-alpha.0023-next.0",
50
+ "@workday/canvas-kit-react": "^15.0.0-alpha.0023-next.0",
51
+ "@workday/canvas-kit-styling": "^15.0.0-alpha.0023-next.0",
52
52
  "@workday/canvas-system-icons-web": "^3.0.36",
53
53
  "@workday/canvas-tokens-web": "4.0.0-alpha.3",
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": "26a8bc06dba5ae759ca62ae8922aeaa7bba7015c"
64
+ "gitHead": "13b3abf5b4752be5738a78f3c37e31b6252077dc"
65
65
  }