You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/web-components/src/components/cbp-drawer/cbp-drawer.specs.mdx
+11
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,9 @@ The Drawer is a container that may be hidden and revealed, sliding in from eithe
16
16
* The Drawer may slide in from either the left or right side of the viewport, taking up the full height of the viewport.
17
17
* A backdrop covers the visible portion of the page behind the drawer.
18
18
* Clicking the backdrop or the designated close button will close (hide) the drawer.
19
+
* In some instances, it may be desirable for a panel to "mobilize" into a drawer at a certain smaller screen size.
20
+
* In this case the drawer acts as a block element while persistent.
21
+
* While persistent, the Drawer cannot be closed.
19
22
20
23
## Technical Specifications
21
24
@@ -29,6 +32,10 @@ The Drawer is a container that may be hidden and revealed, sliding in from eithe
29
32
30
33
* Under 600px (37.5rem), the Drawer takes 100% of the width of the viewport.
31
34
* At larger viewport sizes, the Drawer renders at 25rem (400px at default font sizing) wide.
35
+
* In some instances, it may be desirable for a panel to "mobilize" into a drawer at a certain smaller screen size.
36
+
* In this case, the drawer is considered "persistent" above a specified media query breakpoint and rendered as a block-level element..
37
+
* The media query breakpoint is set via the `persistAt` property.
38
+
* When this functionality is implemented, the drawer control should be hidden using the `cbp-hide` component with the same breakpoint as the `hideAt` value.
32
39
33
40
### Accessibility
34
41
@@ -39,6 +46,10 @@ The Drawer is a container that may be hidden and revealed, sliding in from eithe
39
46
* When the drawer appears on the screen, keyboard focus should be moved to the default focusable control inside the drawer.
40
47
* After the drawer is dismissed, keyboard focus should be moved back to where it was before it moved into the drawer.
41
48
* The expected behavior is that the drawer's tab order wraps.
49
+
* When a drawer is persistent on-screen (not an overlay):
50
+
* Its `role` is changed to "region"
51
+
* The `aria-modal` attribute is removed.
52
+
* The "close" button is not rendered (and the drawer cannot be closed).
/** Creates an accessible label for the drawer (dialog). */
24
24
@Prop()accessibilityText: string;
25
25
26
+
/** Specifies a valid CSS media query (preferably using relative units), when met will hide the wrapped content using display: none. E.g., `min-width:64em` */
27
+
@Prop()persistAt: string;
28
+
26
29
/** Specifies the context of the component as it applies to the visual design and whether it inverts when light/dark mode is toggled. Default behavior is "light-inverts" and does not have to be specified. */
0 commit comments