@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.
- package/dist/es6/lib/docs.js +180284 -180984
- package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/App.js +2 -8
- package/dist/es6/lib/stackblitzFiles/App.tsx +2 -14
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/15.0-UPGRADE-GUIDE.mdx +197 -1
- package/dist/mdx/labs-react/combobox/examples/RTL.tsx +2 -2
- package/dist/mdx/labs-react/search-form/examples/RTL.tsx +2 -8
- package/dist/mdx/preview-react/information-highlight/InformationHighlight.mdx +48 -29
- package/dist/mdx/preview-react/information-highlight/examples/RTL.tsx +3 -8
- package/dist/mdx/preview-react/loading-sparkles/examples/RTL.tsx +2 -7
- package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +2 -6
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/Density.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +1 -1
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +1 -1
- package/dist/mdx/react/banner/examples/StickyRTL.tsx +2 -13
- package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +1 -1
- package/dist/mdx/react/breadcrumbs/examples/RTL.tsx +2 -8
- package/dist/mdx/react/common/mdx/Theming.mdx +61 -0
- package/dist/mdx/react/expandable/examples/RTL.tsx +2 -7
- package/dist/mdx/react/loading-dots/examples/RTL.tsx +2 -7
- package/dist/mdx/react/pagination/examples/RTL.tsx +2 -2
- package/dist/mdx/react/popup/examples/RTL.tsx +2 -2
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +119 -26
- package/dist/mdx/react/segmented-control/examples/Basic.tsx +32 -28
- package/dist/mdx/{preview-react → react}/segmented-control/examples/Disabled.tsx +1 -1
- package/dist/mdx/{preview-react → react}/segmented-control/examples/Dynamic.tsx +1 -1
- package/dist/mdx/{preview-react → react}/segmented-control/examples/RTL.tsx +3 -3
- package/dist/mdx/{preview-react → react}/segmented-control/examples/Sizes.tsx +1 -1
- package/dist/mdx/{preview-react → react}/segmented-control/examples/TextAndIcon.tsx +1 -1
- package/dist/mdx/{preview-react → react}/segmented-control/examples/TextOnly.tsx +1 -1
- package/dist/mdx/{preview-react → react}/segmented-control/examples/Vertical.tsx +1 -1
- package/dist/mdx/react/table/examples/RightToLeft.tsx +2 -2
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +1 -1
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +2 -2
- package/dist/mdx/react/toast/examples/RTL.tsx +2 -2
- package/lib/stackblitzFiles/App.tsx +2 -14
- package/package.json +6 -6
- package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +0 -139
- package/dist/mdx/preview-react/segmented-control/examples/Basic.tsx +0 -42
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
12
|
+
# Canvas Kit Segmented Control
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
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
|
-
|
|
6
|
-
|
|
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 [
|
|
13
|
-
const handleToggle = (selectedValue: string | number) => {
|
|
14
|
-
setValue(selectedValue);
|
|
15
|
-
};
|
|
13
|
+
const [viewType, setViewType] = React.useState('table');
|
|
16
14
|
|
|
17
15
|
return (
|
|
18
|
-
|
|
19
|
-
<SegmentedControl.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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,14 +1,14 @@
|
|
|
1
|
-
import {CanvasProvider
|
|
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-
|
|
8
|
+
import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
|
|
9
9
|
|
|
10
10
|
export default () => (
|
|
11
|
-
<CanvasProvider
|
|
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-
|
|
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-
|
|
3
|
+
import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
|
|
4
4
|
|
|
5
5
|
export default () => (
|
|
6
6
|
<SegmentedControl>
|
|
@@ -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
|
|
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
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^15.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-react": "^15.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-styling": "^15.0.0-alpha.
|
|
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": "
|
|
64
|
+
"gitHead": "13b3abf5b4752be5738a78f3c37e31b6252077dc"
|
|
65
65
|
}
|