@workday/canvas-kit-docs 16.0.0-alpha.0465-next.0 → 16.0.0-alpha.0475-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.
@@ -0,0 +1,45 @@
1
+ import {Tabs, useTabsModel} from '@workday/canvas-kit-preview-react/tabs';
2
+ import {slugify} from '@workday/canvas-kit-react/common';
3
+ import {system} from '@workday/canvas-tokens-web';
4
+
5
+ export default () => {
6
+ const model = useTabsModel();
7
+
8
+ const message = (
9
+ <p>
10
+ This example shows how to use a single tab panel. You must manually set the{' '}
11
+ <code>hidden</code>, <code>aria-controls</code>, and <code>id</code> attributes of Tab item
12
+ and Tab panel components
13
+ </p>
14
+ );
15
+
16
+ const contents = {
17
+ first: <div>Contents of First Tab {message}</div>,
18
+ second: <div>Contents of Second Tab {message}</div>,
19
+ third: <div>Contents of Third Tab {message}</div>,
20
+ };
21
+
22
+ return (
23
+ <Tabs model={model}>
24
+ <Tabs.List>
25
+ <Tabs.Item data-id="first" aria-controls="mytab-panel">
26
+ First Tab
27
+ </Tabs.Item>
28
+ <Tabs.Item data-id="second" aria-controls="mytab-panel">
29
+ Second Tab
30
+ </Tabs.Item>
31
+ <Tabs.Item data-id="third" aria-controls="mytab-panel">
32
+ Third Tab
33
+ </Tabs.Item>
34
+ </Tabs.List>
35
+ <Tabs.Panel
36
+ cs={{marginBlockStart: system.gap.lg}}
37
+ hidden={undefined}
38
+ id="mytab-panel"
39
+ aria-labelledby={slugify(`${model.state.id}-${model.state.selectedIds[0]}`)}
40
+ >
41
+ {contents[model.state.selectedIds[0]]}
42
+ </Tabs.Panel>
43
+ </Tabs>
44
+ );
45
+ };
@@ -69,7 +69,7 @@ trigger an event to change the active tab.
69
69
  ### Named Tabs
70
70
 
71
71
  `Tabs.Item` and `Tabs.Panel` both take an optional `data-id` attribute that is used for the
72
- `onActivate` callback. This example is identical to the Basic Example, but with tabs named using
72
+ `onSelect` callback. This example is identical to the Basic Example, but with tabs named using
73
73
  `data-id` for the `Tabs.Item` and `Tabs.Panel` subcomponents.
74
74
 
75
75
  <ExampleCodeBlock code={NamedTabs} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "16.0.0-alpha.0465-next.0",
3
+ "version": "16.0.0-alpha.0475-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",
@@ -47,10 +47,10 @@
47
47
  "@stackblitz/sdk": "^1.11.0",
48
48
  "@storybook/csf": "0.0.1",
49
49
  "@workday/canvas-expressive-icons-web": "1.0.2",
50
- "@workday/canvas-kit-labs-react": "^16.0.0-alpha.0465-next.0",
51
- "@workday/canvas-kit-preview-react": "^16.0.0-alpha.0465-next.0",
52
- "@workday/canvas-kit-react": "^16.0.0-alpha.0465-next.0",
53
- "@workday/canvas-kit-styling": "^16.0.0-alpha.0465-next.0",
50
+ "@workday/canvas-kit-labs-react": "^16.0.0-alpha.0475-next.0",
51
+ "@workday/canvas-kit-preview-react": "^16.0.0-alpha.0475-next.0",
52
+ "@workday/canvas-kit-react": "^16.0.0-alpha.0475-next.0",
53
+ "@workday/canvas-kit-styling": "^16.0.0-alpha.0475-next.0",
54
54
  "@workday/canvas-system-icons-web": "4.0.4",
55
55
  "@workday/canvas-tokens-web": "4.4.0-beta.6",
56
56
  "markdown-to-jsx": "^7.2.0",
@@ -63,5 +63,5 @@
63
63
  "mkdirp": "^1.0.3",
64
64
  "typescript": "5.0"
65
65
  },
66
- "gitHead": "02dd284d77ccf92991d5526190f453d442ccebcc"
66
+ "gitHead": "82422d46f689844113866ba99ffad38956bde57c"
67
67
  }