@carbon-labs/react-ui-shell 0.2.0 → 0.3.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/es/components/SideNav.js
CHANGED
|
@@ -44,6 +44,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
44
44
|
onSideNavBlur,
|
|
45
45
|
enterDelayMs = 100,
|
|
46
46
|
isCollapsible = false,
|
|
47
|
+
hideOverlay = false,
|
|
47
48
|
...other
|
|
48
49
|
} = _ref;
|
|
49
50
|
const prefix = usePrefix();
|
|
@@ -82,8 +83,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
82
83
|
});
|
|
83
84
|
const overlayClassName = cx({
|
|
84
85
|
[`${prefix}--side-nav__overlay`]: true,
|
|
85
|
-
[`${prefix}--side-nav__overlay-active`]: expanded || expandedViaHoverState
|
|
86
|
-
[`${prefix}--side-nav__overlay-active--lg`]: isCollapsible && (expanded || expandedViaHoverState)
|
|
86
|
+
[`${prefix}--side-nav__overlay-active`]: expanded || expandedViaHoverState
|
|
87
87
|
});
|
|
88
88
|
let childrenToRender = children;
|
|
89
89
|
|
|
@@ -156,7 +156,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
156
156
|
value: {
|
|
157
157
|
isRail
|
|
158
158
|
}
|
|
159
|
-
}, isFixedNav ? null :
|
|
159
|
+
}, isFixedNav || hideOverlay ? null :
|
|
160
160
|
/*#__PURE__*/
|
|
161
161
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
162
162
|
React.createElement("div", {
|
|
@@ -201,6 +201,10 @@ SideNav.propTypes = {
|
|
|
201
201
|
* Using this prop causes SideNav to become a controled component.
|
|
202
202
|
*/
|
|
203
203
|
expanded: PropTypes.bool,
|
|
204
|
+
/**
|
|
205
|
+
* If `true`, the overlay will be hidden. Defaults to `false`.
|
|
206
|
+
*/
|
|
207
|
+
hideOverlay: PropTypes.bool,
|
|
204
208
|
/**
|
|
205
209
|
* Provide the `href` to the id of the element on your package that is the
|
|
206
210
|
* main content.
|
|
@@ -46,6 +46,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
46
46
|
onSideNavBlur,
|
|
47
47
|
enterDelayMs = 100,
|
|
48
48
|
isCollapsible = false,
|
|
49
|
+
hideOverlay = false,
|
|
49
50
|
...other
|
|
50
51
|
} = _ref;
|
|
51
52
|
const prefix = usePrefix.usePrefix();
|
|
@@ -84,8 +85,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
84
85
|
});
|
|
85
86
|
const overlayClassName = index.default({
|
|
86
87
|
[`${prefix}--side-nav__overlay`]: true,
|
|
87
|
-
[`${prefix}--side-nav__overlay-active`]: expanded || expandedViaHoverState
|
|
88
|
-
[`${prefix}--side-nav__overlay-active--lg`]: isCollapsible && (expanded || expandedViaHoverState)
|
|
88
|
+
[`${prefix}--side-nav__overlay-active`]: expanded || expandedViaHoverState
|
|
89
89
|
});
|
|
90
90
|
let childrenToRender = children;
|
|
91
91
|
|
|
@@ -158,7 +158,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
158
158
|
value: {
|
|
159
159
|
isRail
|
|
160
160
|
}
|
|
161
|
-
}, isFixedNav ? null :
|
|
161
|
+
}, isFixedNav || hideOverlay ? null :
|
|
162
162
|
/*#__PURE__*/
|
|
163
163
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
164
164
|
React.createElement("div", {
|
|
@@ -203,6 +203,10 @@ SideNav.propTypes = {
|
|
|
203
203
|
* Using this prop causes SideNav to become a controled component.
|
|
204
204
|
*/
|
|
205
205
|
expanded: PropTypes.bool,
|
|
206
|
+
/**
|
|
207
|
+
* If `true`, the overlay will be hidden. Defaults to `false`.
|
|
208
|
+
*/
|
|
209
|
+
hideOverlay: PropTypes.bool,
|
|
206
210
|
/**
|
|
207
211
|
* Provide the `href` to the id of the element on your package that is the
|
|
208
212
|
* main content.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon-labs/react-ui-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@carbon-labs/utilities": "canary"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "e2bf601b2e8d4301fa72fdb9a5424f2ac938df14"
|
|
31
31
|
}
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
@use '@carbon/styles/scss/theme' as *;
|
|
9
|
-
@use '@carbon/styles/scss/motion' as *;
|
|
10
8
|
@use '@carbon/styles/scss/utilities/convert' as convert;
|
|
11
9
|
|
|
12
10
|
// $prefix: 'clabs' !default;
|
|
@@ -23,13 +21,3 @@ $prefix: 'cds' !default;
|
|
|
23
21
|
.#{$prefix}--side-nav--collapsible.#{$prefix}--side-nav--expanded {
|
|
24
22
|
inline-size: convert.to-rem(256px);
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
.#{$prefix}--side-nav__overlay-active--lg {
|
|
28
|
-
z-index: z('overlay');
|
|
29
|
-
background-color: $overlay;
|
|
30
|
-
block-size: 100vh;
|
|
31
|
-
inline-size: 100vw;
|
|
32
|
-
opacity: 1;
|
|
33
|
-
transition: opacity $transition-expansion $standard-easing,
|
|
34
|
-
background-color $transition-expansion $standard-easing;
|
|
35
|
-
}
|