@graupl/navigation-shelf 1.0.0-beta.16
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/css/component/navigation-shelf.css +36 -0
- package/dist/css/component/navigation-shelf.css.map +1 -0
- package/dist/css/component.css +36 -0
- package/dist/css/component.css.map +1 -0
- package/dist/css/navigation-shelf.css +36 -0
- package/dist/css/navigation-shelf.css.map +1 -0
- package/dist/css/utilities/shelf-aware.css +2 -0
- package/dist/css/utilities/shelf-aware.css.map +1 -0
- package/dist/css/utilities/width.css +2 -0
- package/dist/css/utilities/width.css.map +1 -0
- package/dist/css/utilities.css +2 -0
- package/dist/css/utilities.css.map +1 -0
- package/dist/js/component/navigation-shelf.cjs.js +5 -0
- package/dist/js/component/navigation-shelf.cjs.js.map +1 -0
- package/dist/js/component/navigation-shelf.es.js +5 -0
- package/dist/js/component/navigation-shelf.es.js.map +1 -0
- package/dist/js/component/navigation-shelf.iife.js +5 -0
- package/dist/js/component/navigation-shelf.iife.js.map +1 -0
- package/dist/js/generator/navigation-shelf.cjs.js +5 -0
- package/dist/js/generator/navigation-shelf.cjs.js.map +1 -0
- package/dist/js/generator/navigation-shelf.es.js +5 -0
- package/dist/js/generator/navigation-shelf.es.js.map +1 -0
- package/dist/js/generator/navigation-shelf.iife.js +5 -0
- package/dist/js/generator/navigation-shelf.iife.js.map +1 -0
- package/dist/js/navigation-shelf.js +5 -0
- package/dist/js/navigation-shelf.js.map +1 -0
- package/package.json +71 -0
- package/scss/component/navigation-shelf.scss +3 -0
- package/scss/component.scss +3 -0
- package/scss/navigation-shelf.scss +3 -0
- package/scss/utilities/shelf-aware.scss +3 -0
- package/scss/utilities/width.scss +3 -0
- package/scss/utilities.scss +3 -0
- package/src/js/navigation-shelf/NavigationShelf.js +1912 -0
- package/src/js/navigation-shelf/generator.js +38 -0
- package/src/js/navigation-shelf/index.js +5 -0
- package/src/js/validate.js +46 -0
- package/src/scss/_index.scss +2 -0
- package/src/scss/component/_index.scss +1 -0
- package/src/scss/component/navigation-shelf/_defaults.scss +85 -0
- package/src/scss/component/navigation-shelf/_index.scss +228 -0
- package/src/scss/component/navigation-shelf/_variables.scss +196 -0
- package/src/scss/utilities/_index.scss +2 -0
- package/src/scss/utilities/shelf-aware/_defaults.scss +31 -0
- package/src/scss/utilities/shelf-aware/_index.scss +383 -0
- package/src/scss/utilities/shelf-aware/_variables.scss +6 -0
- package/src/scss/utilities/width/_defaults.scss +58 -0
- package/src/scss/utilities/width/_index.scss +290 -0
- package/src/scss/utilities/width/_variables.scss +6 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import NavigationShelf from "./NavigationShelf.js";
|
|
2
|
+
import once from "@drupal/once";
|
|
3
|
+
|
|
4
|
+
const generate = (
|
|
5
|
+
options = {},
|
|
6
|
+
context = document,
|
|
7
|
+
navigationShelfSelector = ".navigation-shelf"
|
|
8
|
+
) => {
|
|
9
|
+
once(
|
|
10
|
+
"graupl-navigation-shelf-generator",
|
|
11
|
+
navigationShelfSelector,
|
|
12
|
+
context
|
|
13
|
+
).forEach((shelfElement) => {
|
|
14
|
+
const navigationShelfOptions = shelfElement.dataset
|
|
15
|
+
.grauplNavigationShelfOptions
|
|
16
|
+
? JSON.parse(
|
|
17
|
+
shelfElement.dataset.grauplNavigationShelfOptions.replace(/'/g, '"')
|
|
18
|
+
) || {}
|
|
19
|
+
: {};
|
|
20
|
+
|
|
21
|
+
new NavigationShelf({
|
|
22
|
+
shelfElement,
|
|
23
|
+
controllerElement:
|
|
24
|
+
context.querySelector(".navigation-shelf-toggle") || null,
|
|
25
|
+
lockControllerElement:
|
|
26
|
+
context.querySelector(".navigation-shelf-lock-toggle") || null,
|
|
27
|
+
hoverControllerElement:
|
|
28
|
+
context.querySelector(".navigation-shelf-hover-toggle") || null,
|
|
29
|
+
sideControllerElement:
|
|
30
|
+
context.querySelector(".navigation-shelf-side-toggle") || null,
|
|
31
|
+
initialize: true,
|
|
32
|
+
...options,
|
|
33
|
+
...navigationShelfOptions,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default generate;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check to see if the provided values are valid side types.
|
|
3
|
+
*
|
|
4
|
+
* Available types are: `"left"` and `"right"`.
|
|
5
|
+
*
|
|
6
|
+
* The values must be provided inside of an object
|
|
7
|
+
* so the variable name can be retrieved in case of errors.
|
|
8
|
+
*
|
|
9
|
+
* Will return `{ status: true }` if the check is successful.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object<string>} values - The value(s) to check.
|
|
12
|
+
* @return {Object<boolean, string>} - The result of the check.
|
|
13
|
+
*/
|
|
14
|
+
export function isValidSideType(values) {
|
|
15
|
+
try {
|
|
16
|
+
if (typeof values !== "object") {
|
|
17
|
+
const type = typeof values;
|
|
18
|
+
|
|
19
|
+
throw new TypeError(
|
|
20
|
+
`Values given to isValidSideType() must be inside of an object. "${type}" given.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const validTypes = ["left", "right"];
|
|
25
|
+
|
|
26
|
+
for (const key in values) {
|
|
27
|
+
if (!validTypes.includes(values[key])) {
|
|
28
|
+
throw new TypeError(
|
|
29
|
+
`${key} must be one of the following values: ${validTypes.join(
|
|
30
|
+
", "
|
|
31
|
+
)}. "${values[key]}" given.`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
status: true,
|
|
38
|
+
error: null,
|
|
39
|
+
};
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
status: false,
|
|
43
|
+
error,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use "navigation-shelf";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// @graupl/navigation-shelf navigation shelf component default values.
|
|
2
|
+
//
|
|
3
|
+
// Generally, these should not be used directly when styling components unless a static value is needed.
|
|
4
|
+
// They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
|
|
5
|
+
//
|
|
6
|
+
// They should not be used to define direct property values (i.e. font-size, color, etc.).
|
|
7
|
+
// Those should be defined as custom properties in the `_variables.scss` file.
|
|
8
|
+
|
|
9
|
+
@use "pkg:@graupl/core/src/defaults" as root-defaults;
|
|
10
|
+
@use "sass:map";
|
|
11
|
+
|
|
12
|
+
// Navigation shelf selectors.
|
|
13
|
+
$selector-base: root-defaults.$component-selector-base !default;
|
|
14
|
+
$modifier-selector-base: root-defaults.$modifier-selector-base !default;
|
|
15
|
+
$navigation-shelf-selector-base: $selector-base !default;
|
|
16
|
+
$navigation-shelf-selector: "navigation-shelf" !default;
|
|
17
|
+
$navigation-shelf-header-selector-base: $selector-base !default;
|
|
18
|
+
$navigation-shelf-header-selector: "navigation-shelf-header" !default;
|
|
19
|
+
$navigation-shelf-footer-selector-base: $selector-base !default;
|
|
20
|
+
$navigation-shelf-footer-selector: "navigation-shelf-footer" !default;
|
|
21
|
+
$navigation-shelf-content-selector-base: $selector-base !default;
|
|
22
|
+
$navigation-shelf-content-selector: "navigation-shelf-content" !default;
|
|
23
|
+
$navigation-shelf-side-toggle-selector-base: $selector-base !default;
|
|
24
|
+
$navigation-shelf-side-toggle-selector: "navigation-shelf-side-toggle" !default;
|
|
25
|
+
$navigation-shelf-lock-toggle-selector-base: $selector-base !default;
|
|
26
|
+
$navigation-shelf-lock-toggle-selector: "navigation-shelf-lock-toggle" !default;
|
|
27
|
+
$navigation-shelf-hover-toggle-selector-base: $selector-base !default;
|
|
28
|
+
$navigation-shelf-hover-toggle-selector: "navigation-shelf-hover-toggle" !default;
|
|
29
|
+
$navigation-shelf-side-selector-base: $modifier-selector-base !default;
|
|
30
|
+
$navigation-shelf-left-side-selector: "left" !default;
|
|
31
|
+
$navigation-shelf-right-side-selector: "right" !default;
|
|
32
|
+
$navigation-shelf-side-selector-suffix: "-side" !default;
|
|
33
|
+
$navigation-shelf-locked-selector-base: $modifier-selector-base !default;
|
|
34
|
+
$navigation-shelf-locked-selector: "locked" !default;
|
|
35
|
+
$navigation-shelf-unlocked-selector-base: $modifier-selector-base !default;
|
|
36
|
+
$navigation-shelf-unlocked-selector: "unlocked" !default;
|
|
37
|
+
$navigation-shelf-hoverable-selector-base: $modifier-selector-base !default;
|
|
38
|
+
$navigation-shelf-hoverable-selector: "hoverable" !default;
|
|
39
|
+
$navigation-shelf-not-hoverable-selector-base: $modifier-selector-base !default;
|
|
40
|
+
$navigation-shelf-not-hoverable-selector: "not-hoverable" !default;
|
|
41
|
+
$navigation-shelf-open-selector-base: $modifier-selector-base !default;
|
|
42
|
+
$navigation-shelf-open-selector: "show" !default;
|
|
43
|
+
$navigation-shelf-closed-selector-base: $modifier-selector-base !default;
|
|
44
|
+
$navigation-shelf-closed-selector: "hide" !default;
|
|
45
|
+
$navigation-shelf-transitioning-selector-base: $modifier-selector-base !default;
|
|
46
|
+
$navigation-shelf-transitioning-selector: "transitioning" !default;
|
|
47
|
+
|
|
48
|
+
// Navigation shelf properties.
|
|
49
|
+
$navigation-shelf-side-toggle-pseudo-element: "before" !default;
|
|
50
|
+
$navigation-shelf-lock-toggle-pseudo-element: "before" !default;
|
|
51
|
+
$navigation-shelf-hover-toggle-pseudo-element: "before" !default;
|
|
52
|
+
$navigation-shelf-z-index: 2 !default;
|
|
53
|
+
$-navigation-shelf-icons: (
|
|
54
|
+
// "Highlight Mouse Cursor" icon from fonts.google.com/icons
|
|
55
|
+
"enable-hover":
|
|
56
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M516-82q-9 2-18 2h-18q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480v18q0 9-2 18l-78-24v-12q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93h12l24 78Zm305 22L650-231 600-80 480-480l400 120-151 50 171 171-79 79Z'/%3E%3C/svg%3E"),
|
|
57
|
+
// "Left Click" icon from fonts.google.com/icons
|
|
58
|
+
"disable-hover":
|
|
59
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M468-240q-96-5-162-74t-66-166q0-100 70-170t170-70q97 0 166 66t74 162l-84-25q-13-54-56-88.5T480-640q-66 0-113 47t-47 113q0 57 34.5 100t88.5 56l25 84ZM821-60 650-231 600-80 480-480l400 120-151 50 171 171-79 79Z'/%3E%3C/svg%3E"),
|
|
60
|
+
// "Dock To Left" icon from fonts.google.com/icons
|
|
61
|
+
"shelf-left":
|
|
62
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z'/%3E%3C/svg%3E"),
|
|
63
|
+
// "Left Panel Open" icon from fonts.google.com/icons
|
|
64
|
+
"lock-left":
|
|
65
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M460-320v-320L300-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm440-80h120v-560H640v560Zm-80 0v-560H200v560h360Zm80 0h120-120Z'/%3E%3C/svg%3E"),
|
|
66
|
+
// "Left Panel Close" icon from fonts.google.com/icons
|
|
67
|
+
"unlock-left":
|
|
68
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M300-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm440-80h120v-560H640v560Zm-80 0v-560H200v560h360Zm80 0h120-120Z'/%3E%3C/svg%3E"),
|
|
69
|
+
// "Dock To Right" icon from fonts.google.com/icons
|
|
70
|
+
"shelf-right":
|
|
71
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm440-80h120v-560H640v560Zm-80 0v-560H200v560h360Zm80 0h120-120Z'/%3E%3C/svg%3E"),
|
|
72
|
+
// "Right Panel Open" icon from fonts.google.com/icons
|
|
73
|
+
"lock-right":
|
|
74
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M500-640v320l160-160-160-160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z'/%3E%3C/svg%3E"),
|
|
75
|
+
// "Right Panel Close" icon from fonts.google.com/icons
|
|
76
|
+
"unlock-right":
|
|
77
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%235f6368'%3E%3Cpath d='M660-320v-320L500-480l160 160ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Zm-80 0H200h120Z'/%3E%3C/svg%3E")
|
|
78
|
+
);
|
|
79
|
+
$navigation-shelf-icons: () !default;
|
|
80
|
+
$navigation-shelf-icons: map.merge(
|
|
81
|
+
$-navigation-shelf-icons,
|
|
82
|
+
$navigation-shelf-icons
|
|
83
|
+
);
|
|
84
|
+
$navigation-shelf-min-width: 3.5rem !default;
|
|
85
|
+
$navigation-shelf-max-width: 36ch !default;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
@use "pkg:@graupl/icons/src/component/icon/mixins" as icon-mixins;
|
|
2
|
+
@use "pkg:@graupl/core/src/defaults" as root-defaults;
|
|
3
|
+
@use "pkg:@graupl/core/src/mixins/animation";
|
|
4
|
+
@use "defaults";
|
|
5
|
+
@use "variables" as *;
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@warn "The `@graupl/navigation-shelf` component is under active development and is highly experimental. It is not recommended for production use at this time.";
|
|
8
|
+
|
|
9
|
+
// `.navigation-shelf`
|
|
10
|
+
#{defaults.$navigation-shelf-selector-base}#{defaults.$navigation-shelf-selector} {
|
|
11
|
+
--#{root-defaults.$prefix}navigation-shelf-current-width: #{$navigation-shelf-width};
|
|
12
|
+
|
|
13
|
+
display: $navigation-shelf-display;
|
|
14
|
+
position: fixed;
|
|
15
|
+
z-index: $navigation-shelf-z-index;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
grid-template-columns: [header-start content-start footer-start] $navigation-shelf-width [footer-end content-end header-end];
|
|
19
|
+
grid-template-rows: [header-start] auto [header-end content-start] 1fr [content-end footer-start] auto [footer-end];
|
|
20
|
+
width: $navigation-shelf-width;
|
|
21
|
+
overflow-x: hidden;
|
|
22
|
+
transform: $navigation-shelf-transform;
|
|
23
|
+
transition: $navigation-shelf-transition;
|
|
24
|
+
border-width: $navigation-shelf-border-width;
|
|
25
|
+
border-style: $navigation-shelf-border-style;
|
|
26
|
+
border-color: $navigation-shelf-border-color;
|
|
27
|
+
opacity: $navigation-shelf-opacity;
|
|
28
|
+
background: $navigation-shelf-background;
|
|
29
|
+
color: $navigation-shelf-color;
|
|
30
|
+
isolation: isolate;
|
|
31
|
+
|
|
32
|
+
@starting-style {
|
|
33
|
+
display: $navigation-shelf-starting-display;
|
|
34
|
+
width: $navigation-shelf-starting-width;
|
|
35
|
+
transform: $navigation-shelf-starting-transform;
|
|
36
|
+
opacity: $navigation-shelf-starting-opacity;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@include animation.off {
|
|
40
|
+
--#{root-defaults.$prefix}navigation-shelf-transition: #{$navigation-shelf-transition-reduced-motion};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// `&,`
|
|
44
|
+
// `&.left-side`
|
|
45
|
+
&,
|
|
46
|
+
&#{defaults.$navigation-shelf-side-selector-base}#{defaults.$navigation-shelf-left-side-selector}#{defaults.$navigation-shelf-side-selector-suffix} {
|
|
47
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-content: var(
|
|
48
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-shelf-right-content,
|
|
49
|
+
#{map.get(defaults.$navigation-shelf-icons, "shelf-right")}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
right: auto;
|
|
53
|
+
left: 0;
|
|
54
|
+
|
|
55
|
+
// `&.locked`
|
|
56
|
+
&#{defaults.$navigation-shelf-locked-selector-base}#{defaults.$navigation-shelf-locked-selector} {
|
|
57
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-content: var(
|
|
58
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-unlock-right-content,
|
|
59
|
+
#{map.get(defaults.$navigation-shelf-icons, "unlock-right")}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// `&.unlocked`
|
|
64
|
+
&#{defaults.$navigation-shelf-unlocked-selector-base}#{defaults.$navigation-shelf-unlocked-selector} {
|
|
65
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-content: var(
|
|
66
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-lock-right-content,
|
|
67
|
+
#{map.get(defaults.$navigation-shelf-icons, "lock-right")}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// `&.right-side`
|
|
73
|
+
&#{defaults.$navigation-shelf-side-selector-base}#{defaults.$navigation-shelf-right-side-selector}#{defaults.$navigation-shelf-side-selector-suffix} {
|
|
74
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-content: var(
|
|
75
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-shelf-left-content,
|
|
76
|
+
#{map.get(defaults.$navigation-shelf-icons, "shelf-left")}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
right: 0;
|
|
80
|
+
left: auto;
|
|
81
|
+
|
|
82
|
+
// `&.locked`
|
|
83
|
+
&#{defaults.$navigation-shelf-locked-selector-base}#{defaults.$navigation-shelf-locked-selector} {
|
|
84
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-content: var(
|
|
85
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-unlock-left-content,
|
|
86
|
+
#{map.get(defaults.$navigation-shelf-icons, "unlock-left")}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// `&.unlocked`
|
|
91
|
+
&#{defaults.$navigation-shelf-unlocked-selector-base}#{defaults.$navigation-shelf-unlocked-selector} {
|
|
92
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-content: var(
|
|
93
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-lock-left-content,
|
|
94
|
+
#{map.get(defaults.$navigation-shelf-icons, "lock-left")}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// `&.hoverable`
|
|
100
|
+
&#{defaults.$navigation-shelf-hoverable-selector-base}#{defaults.$navigation-shelf-hoverable-selector} {
|
|
101
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-content: var(
|
|
102
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-disable-hover-content,
|
|
103
|
+
#{map.get(defaults.$navigation-shelf-icons, "disable-hover")}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// `&.not-hoverable`
|
|
108
|
+
&#{defaults.$navigation-shelf-not-hoverable-selector-base}#{defaults.$navigation-shelf-not-hoverable-selector} {
|
|
109
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-content: var(
|
|
110
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-enable-hover-content,
|
|
111
|
+
#{map.get(defaults.$navigation-shelf-icons, "enable-hover")}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// `&.hide`
|
|
116
|
+
&#{defaults.$navigation-shelf-closed-selector-base}#{defaults.$navigation-shelf-closed-selector} {
|
|
117
|
+
--#{root-defaults.$prefix}navigation-shelf-current-width: #{$navigation-shelf-closed-width};
|
|
118
|
+
|
|
119
|
+
display: $navigation-shelf-closed-display;
|
|
120
|
+
grid-template-columns: [header-start content-start footer-start] $navigation-shelf-closed-width [footer-end content-end header-end];
|
|
121
|
+
width: $navigation-shelf-closed-width;
|
|
122
|
+
transform: $navigation-shelf-closed-transform;
|
|
123
|
+
opacity: $navigation-shelf-closed-opacity;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// `&.transitioning`
|
|
127
|
+
&#{defaults.$navigation-shelf-transitioning-selector-base}#{defaults.$navigation-shelf-transitioning-selector} {
|
|
128
|
+
--#{root-defaults.$prefix}navigation-shelf-current-width: #{$navigation-shelf-transitioning-width};
|
|
129
|
+
|
|
130
|
+
display: $navigation-shelf-transitioning-display;
|
|
131
|
+
grid-template-columns: [header-start content-start footer-start] $navigation-shelf-transitioning-width [footer-end content-end header-end];
|
|
132
|
+
width: $navigation-shelf-transitioning-width;
|
|
133
|
+
transform: $navigation-shelf-transitioning-transform;
|
|
134
|
+
opacity: $navigation-shelf-transitioning-opacity;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// `&.show`
|
|
138
|
+
&#{defaults.$navigation-shelf-open-selector-base}#{defaults.$navigation-shelf-open-selector} {
|
|
139
|
+
--#{root-defaults.$prefix}navigation-shelf-current-width: #{$navigation-shelf-open-width};
|
|
140
|
+
|
|
141
|
+
display: $navigation-shelf-open-display;
|
|
142
|
+
grid-template-columns: [header-start content-start footer-start] $navigation-shelf-max-width [footer-end content-end header-end];
|
|
143
|
+
width: $navigation-shelf-open-width;
|
|
144
|
+
transform: $navigation-shelf-open-transform;
|
|
145
|
+
opacity: $navigation-shelf-open-opacity;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// `.navigation-shelf-header`
|
|
149
|
+
#{defaults.$navigation-shelf-header-selector-base}#{defaults.$navigation-shelf-header-selector} {
|
|
150
|
+
grid-area: header;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// `.navigation-shelf-content`
|
|
154
|
+
#{defaults.$navigation-shelf-content-selector-base}#{defaults.$navigation-shelf-content-selector} {
|
|
155
|
+
grid-area: content;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// `.navigation-shelf-footer`
|
|
159
|
+
#{defaults.$navigation-shelf-footer-selector-base}#{defaults.$navigation-shelf-footer-selector} {
|
|
160
|
+
grid-area: footer;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// `.navigation-shelf-side-toggle`
|
|
164
|
+
#{defaults.$navigation-shelf-side-toggle-selector-base}#{defaults.$navigation-shelf-side-toggle-selector} {
|
|
165
|
+
--#{root-defaults.$prefix}icon: var(
|
|
166
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-content,
|
|
167
|
+
var(
|
|
168
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-shelf-right-content,
|
|
169
|
+
#{map.get(defaults.$navigation-shelf-icons, "shelf-right")}
|
|
170
|
+
)
|
|
171
|
+
);
|
|
172
|
+
--#{root-defaults.$prefix}icon-spacer: var(
|
|
173
|
+
--#{root-defaults.$prefix}navigation-shelf-side-toggle-spacer,
|
|
174
|
+
0
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
@include icon-mixins.apply-component(
|
|
178
|
+
#{defaults.$navigation-shelf-side-toggle-pseudo-element}
|
|
179
|
+
);
|
|
180
|
+
@include icon-mixins.apply-theme(
|
|
181
|
+
#{defaults.$navigation-shelf-side-toggle-pseudo-element}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// `.navigation-shelf-lock-toggle`
|
|
186
|
+
#{defaults.$navigation-shelf-lock-toggle-selector-base}#{defaults.$navigation-shelf-lock-toggle-selector} {
|
|
187
|
+
--#{root-defaults.$prefix}icon: var(
|
|
188
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-content,
|
|
189
|
+
var(
|
|
190
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-lock-content,
|
|
191
|
+
#{map.get(defaults.$navigation-shelf-icons, "lock-right")}
|
|
192
|
+
)
|
|
193
|
+
);
|
|
194
|
+
--#{root-defaults.$prefix}icon-spacer: var(
|
|
195
|
+
--#{root-defaults.$prefix}navigation-shelf-lock-toggle-spacer,
|
|
196
|
+
0
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
@include icon-mixins.apply-component(
|
|
200
|
+
#{defaults.$navigation-shelf-lock-toggle-pseudo-element}
|
|
201
|
+
);
|
|
202
|
+
@include icon-mixins.apply-theme(
|
|
203
|
+
#{defaults.$navigation-shelf-lock-toggle-pseudo-element}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// `.navigation-shelf-hover-toggle`
|
|
208
|
+
#{defaults.$navigation-shelf-hover-toggle-selector-base}#{defaults.$navigation-shelf-hover-toggle-selector} {
|
|
209
|
+
--#{root-defaults.$prefix}icon: var(
|
|
210
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-content,
|
|
211
|
+
var(
|
|
212
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-enable-hover-content,
|
|
213
|
+
#{map.get(defaults.$navigation-shelf-icons, "enable-hover")}
|
|
214
|
+
)
|
|
215
|
+
);
|
|
216
|
+
--#{root-defaults.$prefix}icon-spacer: var(
|
|
217
|
+
--#{root-defaults.$prefix}navigation-shelf-hover-toggle-spacer,
|
|
218
|
+
0
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
@include icon-mixins.apply-component(
|
|
222
|
+
#{defaults.$navigation-shelf-hover-toggle-pseudo-element}
|
|
223
|
+
);
|
|
224
|
+
@include icon-mixins.apply-theme(
|
|
225
|
+
#{defaults.$navigation-shelf-hover-toggle-pseudo-element}
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// @graupl/navigation-shelf navigation shelf component variables.
|
|
2
|
+
//
|
|
3
|
+
// These values are to be used to directly style components and provide a
|
|
4
|
+
// cleaner way to reference custom properties.
|
|
5
|
+
|
|
6
|
+
@use "defaults";
|
|
7
|
+
@use "pkg:@graupl/core/src/variables" as root-variables;
|
|
8
|
+
@use "pkg:@graupl/core/src/defaults" as root-defaults;
|
|
9
|
+
@use "pkg:@graupl/core/src/theme/color/variables" as color;
|
|
10
|
+
@use "sass:map";
|
|
11
|
+
|
|
12
|
+
// Navigation shelf properties.
|
|
13
|
+
$navigation-shelf-background: var(
|
|
14
|
+
--#{root-defaults.$prefix}navigation-shelf-background,
|
|
15
|
+
#{color.$background}
|
|
16
|
+
);
|
|
17
|
+
$navigation-shelf-color: var(
|
|
18
|
+
--#{root-defaults.$prefix}navigation-shelf-color,
|
|
19
|
+
#{color.$color}
|
|
20
|
+
);
|
|
21
|
+
$navigation-shelf-z-index: var(
|
|
22
|
+
--#{root-defaults.$prefix}navigation-shelf-z-index,
|
|
23
|
+
#{defaults.$navigation-shelf-z-index}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Border properties.
|
|
27
|
+
$navigation-shelf-border-top-style: var(
|
|
28
|
+
--#{root-defaults.$prefix}navigation-shelf-border-top-style,
|
|
29
|
+
#{root-variables.$border-top-style}
|
|
30
|
+
);
|
|
31
|
+
$navigation-shelf-border-right-style: var(
|
|
32
|
+
--#{root-defaults.$prefix}navigation-shelf-border-right-style,
|
|
33
|
+
#{root-variables.$border-right-style}
|
|
34
|
+
);
|
|
35
|
+
$navigation-shelf-border-bottom-style: var(
|
|
36
|
+
--#{root-defaults.$prefix}navigation-shelf-border-bottom-style,
|
|
37
|
+
#{root-variables.$border-bottom-style}
|
|
38
|
+
);
|
|
39
|
+
$navigation-shelf-border-left-style: var(
|
|
40
|
+
--#{root-defaults.$prefix}navigation-shelf-border-left-style,
|
|
41
|
+
#{root-variables.$border-left-style}
|
|
42
|
+
);
|
|
43
|
+
$navigation-shelf-border-style: var(
|
|
44
|
+
--#{root-defaults.$prefix}navigation-shelf-border-style,
|
|
45
|
+
#{$navigation-shelf-border-top-style} #{$navigation-shelf-border-right-style}
|
|
46
|
+
#{$navigation-shelf-border-bottom-style}
|
|
47
|
+
#{$navigation-shelf-border-left-style}
|
|
48
|
+
);
|
|
49
|
+
$navigation-shelf-border-top-width: var(
|
|
50
|
+
--#{root-defaults.$prefix}navigation-shelf-border-top-width,
|
|
51
|
+
0
|
|
52
|
+
);
|
|
53
|
+
$navigation-shelf-border-right-width: var(
|
|
54
|
+
--#{root-defaults.$prefix}navigation-shelf-border-right-width,
|
|
55
|
+
0
|
|
56
|
+
);
|
|
57
|
+
$navigation-shelf-border-bottom-width: var(
|
|
58
|
+
--#{root-defaults.$prefix}navigation-shelf-border-bottom-width,
|
|
59
|
+
0
|
|
60
|
+
);
|
|
61
|
+
$navigation-shelf-border-left-width: var(
|
|
62
|
+
--#{root-defaults.$prefix}navigation-shelf-border-left-width,
|
|
63
|
+
0
|
|
64
|
+
);
|
|
65
|
+
$navigation-shelf-border-width: var(
|
|
66
|
+
--#{root-defaults.$prefix}navigation-shelf-border-width,
|
|
67
|
+
#{$navigation-shelf-border-top-width} #{$navigation-shelf-border-right-width}
|
|
68
|
+
#{$navigation-shelf-border-bottom-width}
|
|
69
|
+
#{$navigation-shelf-border-left-width}
|
|
70
|
+
);
|
|
71
|
+
$navigation-shelf-border-color: var(
|
|
72
|
+
--#{root-defaults.$prefix}navigation-shelf-border-color,
|
|
73
|
+
#{$navigation-shelf-color}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
// Transform properties.
|
|
77
|
+
$navigation-shelf-closed-transform: var(
|
|
78
|
+
--#{root-defaults.$prefix}navigation-shelf-closed-transform,
|
|
79
|
+
null
|
|
80
|
+
);
|
|
81
|
+
$navigation-shelf-open-transform: var(
|
|
82
|
+
--#{root-defaults.$prefix}navigation-shelf-open-transform,
|
|
83
|
+
null
|
|
84
|
+
);
|
|
85
|
+
$navigation-shelf-transitioning-transform: var(
|
|
86
|
+
--#{root-defaults.$prefix}navigation-shelf-transitioning-transform,
|
|
87
|
+
null
|
|
88
|
+
);
|
|
89
|
+
$navigation-shelf-transform: var(
|
|
90
|
+
--#{root-defaults.$prefix}navigation-shelf-transform,
|
|
91
|
+
#{$navigation-shelf-closed-transform}
|
|
92
|
+
);
|
|
93
|
+
$navigation-shelf-starting-transform: var(
|
|
94
|
+
--#{root-defaults.$prefix}navigation-shelf-starting-transform,
|
|
95
|
+
#{$navigation-shelf-transform}
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Width properties.
|
|
99
|
+
$navigation-shelf-min-width: var(
|
|
100
|
+
--#{root-defaults.$prefix}navigation-shelf-min-width,
|
|
101
|
+
#{defaults.$navigation-shelf-min-width}
|
|
102
|
+
);
|
|
103
|
+
$navigation-shelf-max-width: var(
|
|
104
|
+
--#{root-defaults.$prefix}navigation-shelf-max-width,
|
|
105
|
+
#{defaults.$navigation-shelf-max-width}
|
|
106
|
+
);
|
|
107
|
+
$navigation-shelf-closed-width: var(
|
|
108
|
+
--#{root-defaults.$prefix}navigation-shelf-closed-width,
|
|
109
|
+
#{$navigation-shelf-min-width}
|
|
110
|
+
);
|
|
111
|
+
$navigation-shelf-open-width: var(
|
|
112
|
+
--#{root-defaults.$prefix}navigation-shelf-open-width,
|
|
113
|
+
#{$navigation-shelf-max-width}
|
|
114
|
+
);
|
|
115
|
+
$navigation-shelf-transitioning-width: var(
|
|
116
|
+
--#{root-defaults.$prefix}navigation-shelf-transitioning-width,
|
|
117
|
+
#{$navigation-shelf-min-width}
|
|
118
|
+
);
|
|
119
|
+
$navigation-shelf-width: var(
|
|
120
|
+
--#{root-defaults.$prefix}navigation-shelf-width,
|
|
121
|
+
#{$navigation-shelf-closed-width}
|
|
122
|
+
);
|
|
123
|
+
$navigation-shelf-starting-width: var(
|
|
124
|
+
--#{root-defaults.$prefix}navigation-shelf-starting-width,
|
|
125
|
+
#{$navigation-shelf-width}
|
|
126
|
+
);
|
|
127
|
+
$navigation-shelf-current-width: var(
|
|
128
|
+
--#{root-defaults.$prefix}navigation-shelf-current-width,
|
|
129
|
+
#{$navigation-shelf-width}
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
// Display properties.
|
|
133
|
+
$navigation-shelf-closed-display: var(
|
|
134
|
+
--#{root-defaults.$prefix}navigation-shelf-closed-display,
|
|
135
|
+
grid
|
|
136
|
+
);
|
|
137
|
+
$navigation-shelf-open-display: var(
|
|
138
|
+
--#{root-defaults.$prefix}navigation-shelf-open-display,
|
|
139
|
+
grid
|
|
140
|
+
);
|
|
141
|
+
$navigation-shelf-transitioning-display: var(
|
|
142
|
+
--#{root-defaults.$prefix}navigation-shelf-transitioning-display,
|
|
143
|
+
grid
|
|
144
|
+
);
|
|
145
|
+
$navigation-shelf-display: var(
|
|
146
|
+
--#{root-defaults.$prefix}navigation-shelf-display,
|
|
147
|
+
#{$navigation-shelf-closed-display}
|
|
148
|
+
);
|
|
149
|
+
$navigation-shelf-starting-display: var(
|
|
150
|
+
--#{root-defaults.$prefix}navigation-shelf-starting-display,
|
|
151
|
+
#{$navigation-shelf-display}
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
// Opacity properties.
|
|
155
|
+
$navigation-shelf-closed-opacity: var(
|
|
156
|
+
--#{root-defaults.$prefix}navigation-shelf-closed-opacity,
|
|
157
|
+
1
|
|
158
|
+
);
|
|
159
|
+
$navigation-shelf-open-opacity: var(
|
|
160
|
+
--#{root-defaults.$prefix}navigation-shelf-open-opacity,
|
|
161
|
+
1
|
|
162
|
+
);
|
|
163
|
+
$navigation-shelf-transitioning-opacity: var(
|
|
164
|
+
--#{root-defaults.$prefix}navigation-shelf-transitioning-opacity,
|
|
165
|
+
1
|
|
166
|
+
);
|
|
167
|
+
$navigation-shelf-opacity: var(
|
|
168
|
+
--#{root-defaults.$prefix}navigation-shelf-opacity,
|
|
169
|
+
#{$navigation-shelf-closed-opacity}
|
|
170
|
+
);
|
|
171
|
+
$navigation-shelf-starting-opacity: var(
|
|
172
|
+
--#{root-defaults.$prefix}navigation-shelf-starting-opacity,
|
|
173
|
+
#{$navigation-shelf-opacity}
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
// Transition properties.
|
|
177
|
+
$navigation-shelf-transition-duration: var(
|
|
178
|
+
--#{root-defaults.$prefix}navigation-shelf-transition-duration,
|
|
179
|
+
#{map.get(root-variables.$transition-durations, fast)}
|
|
180
|
+
);
|
|
181
|
+
$navigation-shelf-transition: var(
|
|
182
|
+
--#{root-defaults.$prefix}navigation-shelf-transition,
|
|
183
|
+
width #{$navigation-shelf-transition-duration}
|
|
184
|
+
#{root-variables.$transition-timing-function},
|
|
185
|
+
transform #{$navigation-shelf-transition-duration}
|
|
186
|
+
#{root-variables.$transition-timing-function},
|
|
187
|
+
opacity #{$navigation-shelf-transition-duration}
|
|
188
|
+
#{root-variables.$transition-timing-function},
|
|
189
|
+
display #{$navigation-shelf-transition-duration} allow-discrete
|
|
190
|
+
);
|
|
191
|
+
$navigation-shelf-transition-reduced-motion: var(
|
|
192
|
+
--#{root-defaults.$prefix}navigation-shelf-transition-reduced-motion,
|
|
193
|
+
opacity #{$navigation-shelf-transition-duration}
|
|
194
|
+
#{root-variables.$transition-timing-function},
|
|
195
|
+
display #{$navigation-shelf-transition-duration} allow-discrete
|
|
196
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @graupl/navigation-shelf shelf aware utilities default values.
|
|
2
|
+
//
|
|
3
|
+
// Generally, these should not be used directly when styling components unless a static value is needed.
|
|
4
|
+
// They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
|
|
5
|
+
//
|
|
6
|
+
// They should not be used to define direct property values (i.e. font-size, color, etc.).
|
|
7
|
+
// Those should be defined as custom properties in the `_variables.scss` file.
|
|
8
|
+
|
|
9
|
+
@use "pkg:@graupl/core/src/defaults" as root-defaults;
|
|
10
|
+
@use "sass:map";
|
|
11
|
+
|
|
12
|
+
// Utility modifiers.
|
|
13
|
+
$selector-base: root-defaults.$utility-selector-base !default;
|
|
14
|
+
$use-important: root-defaults.$use-important !default;
|
|
15
|
+
$generate-base-utilities: root-defaults.$generate-base-utilities !default;
|
|
16
|
+
$screen-aware: false !default;
|
|
17
|
+
$theme-aware: false !default;
|
|
18
|
+
$state-aware: false !default;
|
|
19
|
+
$container-aware: false !default;
|
|
20
|
+
$screen-aware-separator: root-defaults.$utility-screen-aware-separator !default;
|
|
21
|
+
$theme-aware-separator: root-defaults.$utility-theme-aware-separator !default;
|
|
22
|
+
$state-aware-separator: root-defaults.$utility-state-aware-separator !default;
|
|
23
|
+
$container-aware-separator: root-defaults.$utility-container-aware-separator !default;
|
|
24
|
+
$screen-aware-selector-prefix: root-defaults.$utility-screen-aware-selector-prefix !default;
|
|
25
|
+
$theme-aware-selector-prefix: root-defaults.$utility-theme-aware-selector-prefix !default;
|
|
26
|
+
$state-aware-selector-prefix: root-defaults.$utility-state-aware-selector-prefix !default;
|
|
27
|
+
$container-aware-selector-prefix: root-defaults.$utility-container-aware-selector-prefix !default;
|
|
28
|
+
|
|
29
|
+
// Shelf aware properties.
|
|
30
|
+
|
|
31
|
+
$shelf-aware-selector: "shelf-aware" !default;
|