@workday/canvas-kit-docs 7.0.0-alpha.92-next.19 → 7.0.0-alpha.94-next.20

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.
@@ -11,6 +11,7 @@ any questions about the update.
11
11
  - [Buttons](#buttons)
12
12
  - [Segmented Control](#segmented-control)
13
13
  - [Side Panel](#side-panel)
14
+ - [Tabs](#tabs)
14
15
  - [Icons](#icons)
15
16
  - [ActionBar Component Updates](#actionbar-component-updates)
16
17
  - [Status Indicator Width](#status-indicator-width)
@@ -414,6 +415,20 @@ Two props where added to the `SidePanel.ToggleButton`:
414
415
  tooltipTextCollapse?: string;
415
416
  ```
416
417
 
418
+ ## Tabs
419
+
420
+ We've updated the `name` attribute of list items. This effects `Tabs.Item`, `Tabs.Panel`, and
421
+ `Tabs.Menu.Item`. The attribute changed from `name` to `data-id`. We did this to not interfere with
422
+ the HTML `name` attribute.
423
+
424
+ ### Breaking Change
425
+
426
+ 🤖 The codemod will handle all these changes automatically:
427
+
428
+ - `<Tabs.Item name=` becomes `<Tabs.Item data-id=`
429
+ - `<Tabs.Panel name=` becomes `<Tabs.Panel data-id=`
430
+ - `<Tabs.Menu.Item name=` becomes `<Tabs.Menu.Item data-id=`
431
+
417
432
  ## Icons
418
433
 
419
434
  We've updated our lower level icon components such as `AccentIcon`, `AppletIcon`, `Graphic`, `Icon`,
@@ -426,7 +441,7 @@ which allows us to `forwardRef`.
426
441
  This is a breaking change since we've removed `iconRef`. You can now just pass a `ref` to the
427
442
  element.
428
443
 
429
- 🤖 The codemod will handle all these changes automatically:\
444
+ 🤖 The codemod will handle all these changes automatically:
430
445
 
431
446
  - `iconRef` becomes `ref`
432
447
 
@@ -205,8 +205,8 @@ const MyComponent = () => {
205
205
  return (
206
206
  <Tabs shouldSelect={shouldSelect} onSelect={onSelect}>
207
207
  <Tabs.List>
208
- <Tabs.Item name="first">First</Tabs.Item>
209
- <Tabs.Item name="second">Second</Tabs.Item>
208
+ <Tabs.Item data-id="first">First</Tabs.Item>
209
+ <Tabs.Item data-id="second">Second</Tabs.Item>
210
210
  </Tabs.List>
211
211
  </Tabs>
212
212
  );
@@ -180,11 +180,11 @@ Undocumented props are spread to the underlying `<div>` element.
180
180
  #### Usage
181
181
 
182
182
  `Tabs.Item` is a `<button role="tab">` element. Each `Tabs.Item` is associated with a `Tabs.Panel`
183
- either by a `name` attribute or by the position in the list. If a `name` is provided, it must match
184
- the name passed to the corresponding `Tabs.Panel` component.
183
+ either by a `data-id` attribute or by the position in the list. If a `data-id` is provided, it must
184
+ match the `data-id` passed to the corresponding `Tabs.Panel` component.
185
185
 
186
186
  ```tsx
187
- <Tabs.Item name="first">First Tab</Tabs.Item>
187
+ <Tabs.Item data-id="first">First Tab</Tabs.Item>
188
188
  ```
189
189
 
190
190
  #### Props
@@ -198,11 +198,12 @@ Undocumented props are spread to the underlying `button` element.
198
198
  #### Usage
199
199
 
200
200
  `Tabs.Panel` is a `<div role="tabpanel">` element. It is focusable by default. Each `Tabs.Panel` is
201
- controlled by a `Tabs.Item` either by a `name` attribute or by the position in the list. If a `name`
202
- is provided, it must match the name passed to the corresponding `Tabs.Item` component.
201
+ controlled by a `Tabs.Item` either by a `data-id` attribute or by the position in the list. If a
202
+ `data-id` is provided, it must match the `data-id` passed to the corresponding `Tabs.Item`
203
+ component.
203
204
 
204
205
  ```tsx
205
- <Tabs.Panel name="first">{/* Contents of the tab panel */}</Tabs.Panel>
206
+ <Tabs.Panel data-id="first">{/* Contents of the tab panel */}</Tabs.Panel>
206
207
  ```
207
208
 
208
209
  #### Props
@@ -77,7 +77,7 @@ export default () => {
77
77
  <Tabs model={model}>
78
78
  <Tabs.List overflowButton={<Tabs.OverflowButton>More</Tabs.OverflowButton>}>
79
79
  {(item: Tab) => (
80
- <Tabs.Item name={item.id} onKeyDown={onKeyDown(item.id)} onClick={onClick(item.id)}>
80
+ <Tabs.Item onKeyDown={onKeyDown(item.id)} onClick={onClick(item.id)}>
81
81
  {item.tab}
82
82
  </Tabs.Item>
83
83
  )}
@@ -85,16 +85,12 @@ export default () => {
85
85
  <Tabs.Menu.Popper>
86
86
  <Tabs.Menu.Card maxWidth={300} maxHeight={200}>
87
87
  <Tabs.Menu.List>
88
- {(item: Tab) => <Tabs.Menu.Item name={item.id}>{item.tab}</Tabs.Menu.Item>}
88
+ {(item: Tab) => <Tabs.Menu.Item>{item.tab}</Tabs.Menu.Item>}
89
89
  </Tabs.Menu.List>
90
90
  </Tabs.Menu.Card>
91
91
  </Tabs.Menu.Popper>
92
92
  <Tabs.Panels>
93
- {(item: Tab) => (
94
- <Tabs.Panel marginTop="m" data-id={item.id}>
95
- Contents of {item.tab}
96
- </Tabs.Panel>
97
- )}
93
+ {(item: Tab) => <Tabs.Panel marginTop="m">Contents of {item.tab}</Tabs.Panel>}
98
94
  </Tabs.Panels>
99
95
  </Tabs>
100
96
  );
@@ -28,21 +28,17 @@ export default () => {
28
28
  <div style={{width: containerWidth}}>
29
29
  <Tabs model={model}>
30
30
  <Tabs.List overflowButton={<Tabs.OverflowButton>More</Tabs.OverflowButton>}>
31
- {(item: MyTabItem) => <Tabs.Item data-id={item.id}>{item.text}</Tabs.Item>}
31
+ {(item: MyTabItem) => <Tabs.Item>{item.text}</Tabs.Item>}
32
32
  </Tabs.List>
33
33
  <Tabs.Menu.Popper>
34
34
  <Tabs.Menu.Card maxWidth={300} maxHeight={200}>
35
35
  <Tabs.Menu.List>
36
- {(item: MyTabItem) => <Tabs.Menu.Item name={item.id}>{item.text}</Tabs.Menu.Item>}
36
+ {(item: MyTabItem) => <Tabs.Menu.Item>{item.text}</Tabs.Menu.Item>}
37
37
  </Tabs.Menu.List>
38
38
  </Tabs.Menu.Card>
39
39
  </Tabs.Menu.Popper>
40
40
  <Tabs.Panels>
41
- {(item: MyTabItem) => (
42
- <Tabs.Panel marginTop="m" data-id={item.id}>
43
- {item.contents}
44
- </Tabs.Panel>
45
- )}
41
+ {(item: MyTabItem) => <Tabs.Panel marginTop="m">{item.contents}</Tabs.Panel>}
46
42
  </Tabs.Panels>
47
43
  </Tabs>
48
44
  <hr />
@@ -23,13 +23,13 @@ export default () => {
23
23
  return (
24
24
  <Tabs model={model}>
25
25
  <Tabs.List>
26
- <Tabs.Item name="first" aria-controls="mytab-panel">
26
+ <Tabs.Item data-id="first" aria-controls="mytab-panel">
27
27
  First Tab
28
28
  </Tabs.Item>
29
- <Tabs.Item name="second" aria-controls="mytab-panel">
29
+ <Tabs.Item data-id="second" aria-controls="mytab-panel">
30
30
  Second Tab
31
31
  </Tabs.Item>
32
- <Tabs.Item name="third" aria-controls="mytab-panel">
32
+ <Tabs.Item data-id="third" aria-controls="mytab-panel">
33
33
  Third Tab
34
34
  </Tabs.Item>
35
35
  </Tabs.List>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "7.0.0-alpha.92-next.19+e2cad878",
3
+ "version": "7.0.0-alpha.94-next.20+52c47b8b",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@storybook/csf": "0.0.1",
44
- "@workday/canvas-kit-react": "^7.0.0-alpha.92-next.19+e2cad878"
44
+ "@workday/canvas-kit-react": "^7.0.0-alpha.94-next.20+52c47b8b"
45
45
  },
46
46
  "devDependencies": {
47
47
  "fs-extra": "^10.0.0",
@@ -49,5 +49,5 @@
49
49
  "mkdirp": "^1.0.3",
50
50
  "typescript": "4.1"
51
51
  },
52
- "gitHead": "e2cad87834c40633618cb65a95a0271b1256e214"
52
+ "gitHead": "52c47b8bab9c662b97dd1895d23f55af197538ae"
53
53
  }