@workday/canvas-kit-docs 16.0.0-alpha.0492-next.0 → 16.0.0-alpha.0494-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 +12 -8
- package/dist/mdx/16.0-UPGRADE-GUIDE.mdx +70 -7
- package/dist/mdx/react/side-panel/SidePanel.mdx +85 -21
- package/dist/mdx/react/side-panel/examples/Basic.tsx +2 -2
- package/dist/mdx/react/side-panel/examples/RightOrigin.tsx +0 -2
- package/dist/mdx/react/side-panel/examples/Variant.tsx +17 -2
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -392762,7 +392762,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
392762
392762
|
},
|
|
392763
392763
|
{
|
|
392764
392764
|
"kind": "string",
|
|
392765
|
-
"value": "
|
|
392765
|
+
"value": "alternative"
|
|
392766
|
+
},
|
|
392767
|
+
{
|
|
392768
|
+
"kind": "string",
|
|
392769
|
+
"value": "overlay"
|
|
392766
392770
|
}
|
|
392767
392771
|
]
|
|
392768
392772
|
}
|
|
@@ -393578,7 +393582,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
393578
393582
|
"name": "SidePanelVariant",
|
|
393579
393583
|
"value": "SidePanelVariant"
|
|
393580
393584
|
},
|
|
393581
|
-
"description": "The style variant of the side panel
|
|
393585
|
+
"description": "The style variant of the side panel.\n- `'standard'`: navigation surface background (`system.legacy.color.surface.navigation`), no depth.\n- `'alternative'`: raised surface background (`system.legacy.color.surface.raised`), no depth.\n- `'overlay'`: default surface background (`system.legacy.color.surface.default`) with level 6 depth, for panels that need to look lifted off the page. This is a visual treatment only — it adds no dialog semantics, focus trapping, or backdrop.",
|
|
393582
393586
|
"declarations": [
|
|
393583
393587
|
{
|
|
393584
393588
|
"name": "variant",
|
|
@@ -393732,7 +393736,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
393732
393736
|
{
|
|
393733
393737
|
"name": "ToggleButton",
|
|
393734
393738
|
"symbol": "SidePanelToggleButton",
|
|
393735
|
-
"description": "`SidePanel.ToggleButton` is a control that toggles between expanded and collapsed states.\nIt must be used within the `SidePanel` component as a child. For accessibility purposes,\nit should be the first focusable element in the panel.\n\nThe button automatically receives `aria-controls
|
|
393739
|
+
"description": "`SidePanel.ToggleButton` is a control that toggles between expanded and collapsed states.\nIt must be used within the `SidePanel` component as a child. For accessibility purposes,\nit should be the first focusable element in the panel.\n\nThe button automatically receives `aria-controls` (the panel's `id`), `aria-pressed` (`true`\nwhen the panel is collapsed), and `aria-describedby` (the heading's `id`) from the model.\nProvide a static `aria-label` for the button's accessible name — `aria-pressed` already\nconveys the state, so the label should not change between states.",
|
|
393736
393740
|
"declarations": [
|
|
393737
393741
|
{
|
|
393738
393742
|
"name": "ToggleButton",
|
|
@@ -395515,7 +395519,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
395515
395519
|
{
|
|
395516
395520
|
"name": "useSidePanelToggleButton",
|
|
395517
395521
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/side-panel/lib/SidePanelToggleButton.tsx",
|
|
395518
|
-
"description": "",
|
|
395522
|
+
"description": "Adds the necessary ARIA attributes to the SidePanel's toggle button.\nThis includes `aria-controls` pointing at the panel, `aria-pressed` to convey the collapsed\nstate, and `aria-describedby` pointing at the panel's heading.",
|
|
395519
395523
|
"declarations": [
|
|
395520
395524
|
{
|
|
395521
395525
|
"name": "useSidePanelToggleButton",
|
|
@@ -395829,7 +395833,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
395829
395833
|
"value": "string"
|
|
395830
395834
|
},
|
|
395831
395835
|
"required": false,
|
|
395832
|
-
"description": "The unique ID for the panel's label element. If not provided, a unique ID will be generated.\nThis ID is used for the `aria-labelledby` attribute on
|
|
395836
|
+
"description": "The unique ID for the panel's label element. If not provided, a unique ID will be generated.\nThis ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`\nattribute on the toggle button.",
|
|
395833
395837
|
"declarations": [
|
|
395834
395838
|
{
|
|
395835
395839
|
"name": "labelId",
|
|
@@ -395925,7 +395929,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
395925
395929
|
"kind": "primitive",
|
|
395926
395930
|
"value": "string"
|
|
395927
395931
|
},
|
|
395928
|
-
"description": "The unique ID for the panel's label element. Used for `aria-labelledby` on the panel\
|
|
395932
|
+
"description": "The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to\nprovide its accessible name, and for `aria-describedby` on the toggle button.",
|
|
395929
395933
|
"declarations": [
|
|
395930
395934
|
{
|
|
395931
395935
|
"name": "labelId",
|
|
@@ -396270,7 +396274,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
396270
396274
|
"value": "string"
|
|
396271
396275
|
},
|
|
396272
396276
|
"required": false,
|
|
396273
|
-
"description": "The unique ID for the panel's label element. If not provided, a unique ID will be generated.\nThis ID is used for the `aria-labelledby` attribute on
|
|
396277
|
+
"description": "The unique ID for the panel's label element. If not provided, a unique ID will be generated.\nThis ID is used for the `aria-labelledby` attribute on the panel and the `aria-describedby`\nattribute on the toggle button.",
|
|
396274
396278
|
"declarations": [
|
|
396275
396279
|
{
|
|
396276
396280
|
"name": "labelId",
|
|
@@ -396701,7 +396705,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
396701
396705
|
"kind": "primitive",
|
|
396702
396706
|
"value": "string"
|
|
396703
396707
|
},
|
|
396704
|
-
"description": "The unique ID for the panel's label element. Used for `aria-labelledby` on the panel\
|
|
396708
|
+
"description": "The unique ID for the panel's label element. Used for `aria-labelledby` on the panel to\nprovide its accessible name, and for `aria-describedby` on the toggle button.",
|
|
396705
396709
|
"declarations": [
|
|
396706
396710
|
{
|
|
396707
396711
|
"name": "labelId",
|
|
@@ -20,8 +20,8 @@ Soon to be...
|
|
|
20
20
|
- [Avatar](#avatar)
|
|
21
21
|
- [Buttons](#buttons)
|
|
22
22
|
- [Delete Button Outline Variant](#delete-button-outline-variant)
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
- [Container Components](#container-components)
|
|
24
|
+
- [Card](#card)
|
|
25
25
|
- [Expandable](#expandable)
|
|
26
26
|
- [Indicators](#indicators)
|
|
27
27
|
- [Banner](#banner)
|
|
@@ -50,6 +50,7 @@ Soon to be...
|
|
|
50
50
|
- [Pagination](#pagination)
|
|
51
51
|
- [Popup](#popup)
|
|
52
52
|
- [Segmented Control](#segmented-control)
|
|
53
|
+
- [Side Panel](#side-panel)
|
|
53
54
|
- [Table](#table)
|
|
54
55
|
- [Toast](#toast)
|
|
55
56
|
- [Tooltip](#tooltip)
|
|
@@ -261,7 +262,8 @@ import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
|
261
262
|
|
|
262
263
|
#### Alt Variant Support
|
|
263
264
|
|
|
264
|
-
Several container components now support an `alt` variant that provides an elevated surface
|
|
265
|
+
Several container components now support an `alt` variant that provides an elevated surface
|
|
266
|
+
appearance:
|
|
265
267
|
|
|
266
268
|
- `Menu.Card` - Can use `variant="alt"` for elevated menu styling
|
|
267
269
|
- `Dialog.Card` - Can use `variant="alt"` for elevated dialog styling
|
|
@@ -269,7 +271,8 @@ Several container components now support an `alt` variant that provides an eleva
|
|
|
269
271
|
- `Toast` - Can use `variant="alt"` for elevated toast styling
|
|
270
272
|
- `Tooltip` - Can use `variant="alt"` for elevated tooltip styling
|
|
271
273
|
|
|
272
|
-
The `alt` variant uses `system.sana.color.surface.elevated` background with inverse borders,
|
|
274
|
+
The `alt` variant uses `system.sana.color.surface.elevated` background with inverse borders,
|
|
275
|
+
providing visual hierarchy and depth to these components when placed on an alt background.
|
|
273
276
|
|
|
274
277
|
```tsx
|
|
275
278
|
// Examples of using the alt variant
|
|
@@ -291,17 +294,20 @@ The `alt` variant uses `system.sana.color.surface.elevated` background with inve
|
|
|
291
294
|
|
|
292
295
|
#### Card
|
|
293
296
|
|
|
294
|
-
**PR:** [#4014](https://github.com/Workday/canvas-kit/pull/4014),
|
|
297
|
+
**PR:** [#4014](https://github.com/Workday/canvas-kit/pull/4014),
|
|
298
|
+
[#4088](https://github.com/Workday/canvas-kit/pull/4088)
|
|
295
299
|
|
|
296
300
|
##### Variant Changes
|
|
297
301
|
|
|
298
302
|
The `Card` component's variants have been updated:
|
|
303
|
+
|
|
299
304
|
- **Removed:** The `borderless` variant has been removed and replaced with `alt`
|
|
300
305
|
- **New:** The `alt` variant provides an elevated surface with inverse borders
|
|
301
306
|
- **Updated:** The default variant now has a visible border
|
|
302
307
|
- The `tonal` variant now uses a `system.legacy.color.surface.alt.strong` background.
|
|
303
308
|
|
|
304
|
-
**Note:** If you were previously using `variant="borderless"`, you should use `variant="alt"`
|
|
309
|
+
**Note:** If you were previously using `variant="borderless"`, you should use `variant="alt"`
|
|
310
|
+
instead. While the styles are different, both where intended to be used on an `alt` background.
|
|
305
311
|
|
|
306
312
|
🤖 The codemod will automatically update `variant="borderless"` to `variant="alt"`.
|
|
307
313
|
|
|
@@ -326,7 +332,8 @@ The `Card` component's variants have been updated:
|
|
|
326
332
|
- Card's border radius is now managed via the new `cornerShapeStencil` (see
|
|
327
333
|
[New Utilities](#new-utilities)).
|
|
328
334
|
- The default variant now includes a visible border (`system.color.border.default`).
|
|
329
|
-
- The `alt` variant uses an elevated surface color (`system.sana.color.surface.elevated`) with
|
|
335
|
+
- The `alt` variant uses an elevated surface color (`system.sana.color.surface.elevated`) with
|
|
336
|
+
inverse borders.
|
|
330
337
|
|
|
331
338
|
#### Expandable
|
|
332
339
|
|
|
@@ -815,6 +822,62 @@ Run the Canvas Kit v16 codemod (`updateHyperlinkProps`) to migrate automatically
|
|
|
815
822
|
- Container padding changed to `padding.md` (16px) including for mobile devices.
|
|
816
823
|
- On mobile devices, the container padding remains `padding.md` (16px).
|
|
817
824
|
|
|
825
|
+
### Side Panel
|
|
826
|
+
|
|
827
|
+
**PR:** [#4107](https://github.com/Workday/canvas-kit/pull/4107)
|
|
828
|
+
|
|
829
|
+
#### Breaking Changes
|
|
830
|
+
|
|
831
|
+
The `variant` prop on `SidePanel` no longer accepts `alternate`. It has been renamed to `overlay` to
|
|
832
|
+
describe what the variant is for — a panel that floats above page content — because a second
|
|
833
|
+
non-overlay variant now occupies the "alternative surface" role.
|
|
834
|
+
|
|
835
|
+
```tsx
|
|
836
|
+
import {SidePanel} from '@workday/canvas-kit-react/side-panel';
|
|
837
|
+
|
|
838
|
+
// Before
|
|
839
|
+
<SidePanel variant="alternate">{/* ... */}</SidePanel>
|
|
840
|
+
|
|
841
|
+
// After
|
|
842
|
+
<SidePanel variant="overlay">{/* ... */}</SidePanel>
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
> 🤖 The `v16` codemod will rename `variant="alternate"` to `variant="overlay"` as shown above. It
|
|
846
|
+
> only transforms `SidePanel` imported from `@workday/canvas-kit-react`; the deprecated `SidePanel`
|
|
847
|
+
> in `@workday/canvas-kit-preview-react` is left alone.
|
|
848
|
+
|
|
849
|
+
If you were using `alternate` for a panel that sits inline with page content rather than over it,
|
|
850
|
+
switch to the new `alternative` variant instead of `overlay` to avoid picking up the elevation
|
|
851
|
+
shadow.
|
|
852
|
+
|
|
853
|
+
#### New API
|
|
854
|
+
|
|
855
|
+
- `variant="alternative"` — uses a raised surface (`system.legacy.color.surface.raised`) with no
|
|
856
|
+
depth. Use it for panels that need to stand out from the page background while remaining part of
|
|
857
|
+
the page layout.
|
|
858
|
+
|
|
859
|
+
The full set of variants is now:
|
|
860
|
+
|
|
861
|
+
| Variant | Surface | Depth |
|
|
862
|
+
| ------------- | ---------------------------------------- | ----- |
|
|
863
|
+
| `standard` | `system.legacy.color.surface.navigation` | None |
|
|
864
|
+
| `alternative` | `system.legacy.color.surface.raised` | None |
|
|
865
|
+
| `overlay` | `system.legacy.color.surface.default` | 6 |
|
|
866
|
+
|
|
867
|
+
#### Visual Updates
|
|
868
|
+
|
|
869
|
+
- The `overlay` variant's box-shadow updated from `system.depth[3]` to `system.depth[6]`.
|
|
870
|
+
- `SidePanel.ToggleButton`'s default icon changed from `extendIcon` to `sidebarLeftIcon`. The icon
|
|
871
|
+
no longer rotates as the panel expands and collapses: it keeps a single orientation in LTR and is
|
|
872
|
+
mirrored horizontally in RTL.
|
|
873
|
+
- `SidePanel.ToggleButton`'s width changed from `gap.lg` (24px) to `size.md` (40px), and its top
|
|
874
|
+
offset changed from `gap.lg` (24px) to `12px`.
|
|
875
|
+
- `SidePanel.Heading` padding changed from a symmetric `padding.xs` (8px) to `padding.sm` (12px)
|
|
876
|
+
with a `paddingInlineStart` of `padding.md` (16px), and it now has a `minHeight` of `size.xxl`
|
|
877
|
+
(64px) so the heading lines up with the toggle button and the collapsed panel width.
|
|
878
|
+
- `SidePanel.Heading` now lays out its children with flexbox and centers them vertically, so an icon
|
|
879
|
+
passed alongside the heading text aligns without extra styling.
|
|
880
|
+
|
|
818
881
|
### Table
|
|
819
882
|
|
|
820
883
|
#### Visual Updates
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExampleCodeBlock,
|
|
3
|
-
SymbolDoc,
|
|
4
3
|
Specifications,
|
|
4
|
+
StorybookStatusIndicator,
|
|
5
|
+
SymbolDoc,
|
|
5
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
+
|
|
8
|
+
import AlwaysOpen from './examples/AlwaysOpen';
|
|
6
9
|
import Basic from './examples/Basic';
|
|
7
|
-
import Heading from './examples/Heading';
|
|
8
|
-
import AlternatePanel from './examples/Variant';
|
|
9
10
|
import ExternalControl from './examples/ExternalControl';
|
|
10
|
-
import
|
|
11
|
-
import AlwaysOpen from './examples/AlwaysOpen';
|
|
11
|
+
import Heading from './examples/Heading';
|
|
12
12
|
import OnStateTransition from './examples/OnStateTransition';
|
|
13
|
+
import RightOrigin from './examples/RightOrigin';
|
|
14
|
+
import {AlternativePanel, OverlayPanel} from './examples/Variant';
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
# Canvas Kit Side Panel
|
|
@@ -54,15 +56,16 @@ import {SidePanel, useSidePanelModel} from '@workday/canvas-kit-react/side-panel
|
|
|
54
56
|
|
|
55
57
|
### Component API Changes
|
|
56
58
|
|
|
57
|
-
| Preview | Main
|
|
58
|
-
| ---------------------------------------------- |
|
|
59
|
-
| `<SidePanel {...panelProps}>` | `<SidePanel model={model}>` or just `<SidePanel>`
|
|
60
|
-
| `<SidePanel.ToggleButton {...controlProps} />` | `<SidePanel.ToggleButton />`
|
|
61
|
-
| `<Heading {...labelProps}>` | `<SidePanel.Heading>Panel Title</SidePanel.Heading>`
|
|
62
|
-
| `expanded` prop on SidePanel | Managed by model's `transitionState`
|
|
63
|
-
| `touched` prop on SidePanel | Managed internally
|
|
64
|
-
| `onExpandedChange` callback | Use `onStateTransition` and derive expanded state
|
|
65
|
-
| `onStateTransition` on component | `onStateTransition` on model config
|
|
59
|
+
| Preview | Main |
|
|
60
|
+
| ---------------------------------------------- | ---------------------------------------------------- |
|
|
61
|
+
| `<SidePanel {...panelProps}>` | `<SidePanel model={model}>` or just `<SidePanel>` |
|
|
62
|
+
| `<SidePanel.ToggleButton {...controlProps} />` | `<SidePanel.ToggleButton />` |
|
|
63
|
+
| `<Heading {...labelProps}>` | `<SidePanel.Heading>Panel Title</SidePanel.Heading>` |
|
|
64
|
+
| `expanded` prop on SidePanel | Managed by model's `transitionState` |
|
|
65
|
+
| `touched` prop on SidePanel | Managed internally |
|
|
66
|
+
| `onExpandedChange` callback | Use `onStateTransition` and derive expanded state |
|
|
67
|
+
| `onStateTransition` on component | `onStateTransition` on model config |
|
|
68
|
+
| `variant="alternate"` | `variant="overlay"` (rename only, same styling) |
|
|
66
69
|
|
|
67
70
|
### Code Migration Example
|
|
68
71
|
|
|
@@ -140,13 +143,74 @@ heading while keeping it accessible to screen readers.
|
|
|
140
143
|
|
|
141
144
|
<ExampleCodeBlock code={Heading} />
|
|
142
145
|
|
|
143
|
-
###
|
|
146
|
+
### Variants
|
|
147
|
+
|
|
148
|
+
`SidePanel` supports three variants, which you supply as a top-level `variant` prop. They differ
|
|
149
|
+
only in surface color and depth — the layout, animation, and accessibility behavior is identical.
|
|
150
|
+
|
|
151
|
+
| Variant | Surface | Depth | Use for |
|
|
152
|
+
| ------------- | ---------------------------------------- | ----- | ----------------------------------------------------------------------------- |
|
|
153
|
+
| `standard` | `system.legacy.color.surface.navigation` | None | The default. Panels that are part of the page layout, such as navigation. |
|
|
154
|
+
| `alternative` | `system.legacy.color.surface.raised` | None | Panels that need to stand out from the page background while staying in-flow. |
|
|
155
|
+
| `overlay` | `system.legacy.color.surface.default` | 6 | Panels that need to look lifted off the page. Styling only — see below. |
|
|
156
|
+
|
|
157
|
+
#### Alternative
|
|
158
|
+
|
|
159
|
+
The `alternative` variant uses a raised surface color with no depth. Because it doesn't cast a
|
|
160
|
+
shadow, it remains part of the page layout and is a good fit when the panel sits next to content on
|
|
161
|
+
a tinted or gray background.
|
|
162
|
+
|
|
163
|
+
<ExampleCodeBlock code={AlternativePanel} />
|
|
164
|
+
|
|
165
|
+
#### Overlay
|
|
166
|
+
|
|
167
|
+
The `overlay` variant is a **visual treatment only**. It gives the panel the default surface color
|
|
168
|
+
and depth 6 so it reads as floating above the page, which is the same elevation `Modal.Card` uses.
|
|
169
|
+
The name describes how the panel looks; it does not turn `SidePanel` into a dialog. This variant is
|
|
170
|
+
the `alternate` variant from `@workday/canvas-kit-preview-react`, renamed — it has never carried any
|
|
171
|
+
behavior beyond the surface and shadow.
|
|
172
|
+
|
|
173
|
+
Reach for it when a panel needs to look lifted off the page — for example an overlay menu or a
|
|
174
|
+
filter panel you position over content with your own CSS. `SidePanel` still renders a `<section>`
|
|
175
|
+
that participates in the page and the tab order exactly like `standard` and `alternative` do.
|
|
176
|
+
|
|
177
|
+
Setting `variant="overlay"` does **not** add any of the following, and `SidePanel` has no props to
|
|
178
|
+
opt into them:
|
|
179
|
+
|
|
180
|
+
- `role="dialog"` or `aria-modal` — the element stays a plain `<section>` named by its heading
|
|
181
|
+
- A focus trap, initial focus, or return focus
|
|
182
|
+
- A backdrop / overlay element
|
|
183
|
+
- Close on **Escape** or close on outside click
|
|
184
|
+
- `aria-hidden` on sibling content, or body scroll locking
|
|
185
|
+
- Positioning — the panel is in normal flow until you position it yourself
|
|
186
|
+
|
|
187
|
+
> **Accessibility Note**: If you need a panel that genuinely blocks the rest of the page, use
|
|
188
|
+
> [`Modal`](https://workday.github.io/canvas-kit/?path=/docs/components-popups-modal--docs) instead
|
|
189
|
+
> of assembling that behavior around `SidePanel`. `Modal` composes `useInitialFocus`,
|
|
190
|
+
> `useReturnFocus`, `useFocusTrap`, `useCloseOnEscape`, `useCloseOnOverlayClick`,
|
|
191
|
+
> `useAssistiveHideSiblings`, and `useDisableBodyScroll` and is tested as a unit. Those hooks are
|
|
192
|
+
> built on `usePopupModel` and cannot be added to `useSidePanelModel`, so a hand-rolled version on
|
|
193
|
+
> top of `SidePanel` will not get you the same guarantees.
|
|
194
|
+
|
|
195
|
+
**Keyboard and focus behavior:** because the variant adds no dialog semantics, keyboard behavior is
|
|
196
|
+
identical to the other two variants and no focus management is expected of you:
|
|
197
|
+
|
|
198
|
+
- **Tab** / **Shift + Tab** move through the panel's focusable elements in DOM order and then
|
|
199
|
+
continue into the rest of the page. Focus is **not** trapped.
|
|
200
|
+
- Focus does not move when the panel expands or collapses. It stays on `SidePanel.ToggleButton`,
|
|
201
|
+
which reports the new state through `aria-pressed`.
|
|
202
|
+
- **Escape** does nothing. Collapsing happens only through the toggle button or
|
|
203
|
+
`model.events.collapse()`.
|
|
204
|
+
- Collapsing hides the panel's content visually but does not remove it from the DOM. Keep the toggle
|
|
205
|
+
button as the first focusable element in the panel — see [Accessibility](#accessibility) — so
|
|
206
|
+
keyboard users reach the control before the content it hides.
|
|
144
207
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
208
|
+
If you do position this variant over other content, treat it as a non-modal region: the content
|
|
209
|
+
behind it stays reachable by keyboard and by screen reader, and users can tab out of the panel while
|
|
210
|
+
it visually covers the page. That mismatch between what the panel looks like and how it behaves is
|
|
211
|
+
the reason to prefer `Modal` for anything the user must dismiss before continuing.
|
|
148
212
|
|
|
149
|
-
<ExampleCodeBlock code={
|
|
213
|
+
<ExampleCodeBlock code={OverlayPanel} />
|
|
150
214
|
|
|
151
215
|
### External Control
|
|
152
216
|
|
|
@@ -276,8 +340,8 @@ element, including `id`, `aria-labelledby`, and `onTransitionEnd`.
|
|
|
276
340
|
|
|
277
341
|
### useSidePanelToggleButton
|
|
278
342
|
|
|
279
|
-
The `useSidePanelToggleButton` elemProps hook provides ARIA attributes for the toggle
|
|
280
|
-
|
|
343
|
+
The `useSidePanelToggleButton` elemProps hook provides ARIA attributes for the toggle button,
|
|
344
|
+
including `aria-controls`, `aria-pressed`, and `aria-describedby`.
|
|
281
345
|
|
|
282
346
|
<SymbolDoc name="useSidePanelToggleButton" fileName="/react/" />
|
|
283
347
|
|
|
@@ -18,9 +18,9 @@ export default () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<Flex cs={viewPortStyles}>
|
|
20
20
|
<SidePanel>
|
|
21
|
-
<SidePanel.Heading
|
|
21
|
+
<SidePanel.Heading>
|
|
22
22
|
<Flex cs={flexHeadingStyles}>
|
|
23
|
-
<ExpressiveIcon icon={rocketIcon} />
|
|
23
|
+
<ExpressiveIcon icon={rocketIcon} size="xs" />
|
|
24
24
|
Tasks Panel
|
|
25
25
|
</Flex>
|
|
26
26
|
</SidePanel.Heading>
|
|
@@ -4,7 +4,6 @@ import {Flex} from '@workday/canvas-kit-react/layout';
|
|
|
4
4
|
import {SidePanel, useSidePanelModel} from '@workday/canvas-kit-react/side-panel';
|
|
5
5
|
import {Text} from '@workday/canvas-kit-react/text';
|
|
6
6
|
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
8
7
|
|
|
9
8
|
// local helper hook for setting content direction;
|
|
10
9
|
import {useDirection} from './useDirection';
|
|
@@ -19,7 +18,6 @@ const stylesOverride = {
|
|
|
19
18
|
panel: createStyles({
|
|
20
19
|
alignItems: 'center',
|
|
21
20
|
justifyContent: 'flex-end',
|
|
22
|
-
padding: system.padding.md,
|
|
23
21
|
}),
|
|
24
22
|
main: createStyles({
|
|
25
23
|
alignItems: 'center',
|
|
@@ -33,9 +33,9 @@ export default () => {
|
|
|
33
33
|
return (
|
|
34
34
|
<CanvasProvider dir={direction}>
|
|
35
35
|
<Flex cs={stylesOverride.viewport}>
|
|
36
|
-
<SidePanel variant="
|
|
36
|
+
<SidePanel variant="overlay">
|
|
37
37
|
<SidePanel.ToggleButton aria-label="Collapse View" />
|
|
38
|
-
<SidePanel.Heading size="small">
|
|
38
|
+
<SidePanel.Heading size="small">Overlay Panel</SidePanel.Heading>
|
|
39
39
|
</SidePanel>
|
|
40
40
|
<Flex as="main" cs={stylesOverride.main}>
|
|
41
41
|
<Text as="p" typeLevel="body.large">
|
|
@@ -49,3 +49,18 @@ export default () => {
|
|
|
49
49
|
</CanvasProvider>
|
|
50
50
|
);
|
|
51
51
|
};
|
|
52
|
+
|
|
53
|
+
const viewportStyles = createStyles({
|
|
54
|
+
height: px2rem(320),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default () => {
|
|
58
|
+
return (
|
|
59
|
+
<Flex cs={viewportStyles}>
|
|
60
|
+
<SidePanel variant="alternative">
|
|
61
|
+
<SidePanel.ToggleButton aria-label="Collapse View" />
|
|
62
|
+
<SidePanel.Heading size="small">Alternative Panel</SidePanel.Heading>
|
|
63
|
+
</SidePanel>
|
|
64
|
+
</Flex>
|
|
65
|
+
);
|
|
66
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "16.0.0-alpha.
|
|
3
|
+
"version": "16.0.0-alpha.0494-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.
|
|
51
|
-
"@workday/canvas-kit-preview-react": "^16.0.0-alpha.
|
|
52
|
-
"@workday/canvas-kit-react": "^16.0.0-alpha.
|
|
53
|
-
"@workday/canvas-kit-styling": "^16.0.0-alpha.
|
|
50
|
+
"@workday/canvas-kit-labs-react": "^16.0.0-alpha.0494-next.0",
|
|
51
|
+
"@workday/canvas-kit-preview-react": "^16.0.0-alpha.0494-next.0",
|
|
52
|
+
"@workday/canvas-kit-react": "^16.0.0-alpha.0494-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^16.0.0-alpha.0494-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "5.0.1",
|
|
55
55
|
"@workday/canvas-tokens-web": "4.4.0-beta.13",
|
|
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": "
|
|
66
|
+
"gitHead": "7bde57a5a6d4e41fd4a2e08f9f035c609ff4a8f0"
|
|
67
67
|
}
|