@redsift/design-system 11.6.0-muiv5-alpha.5 → 11.6.0-muiv5-alpha.7
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/_internal/Alert2.js +182 -39
- package/_internal/AppBar.js +240 -29
- package/_internal/AppContainer.js +132 -86
- package/_internal/AppContent.js +84 -17
- package/_internal/Badge2.js +137 -4
- package/_internal/BreadcrumbItem.js +85 -3
- package/_internal/Breadcrumbs2.js +86 -21
- package/_internal/Button2.js +81 -20
- package/_internal/ButtonGroup.js +165 -25
- package/_internal/ButtonLink.js +74 -18
- package/_internal/Card2.js +151 -29
- package/_internal/CardActions.js +38 -3
- package/_internal/CardBody.js +36 -3
- package/_internal/CardHeader.js +77 -3
- package/_internal/Checkbox2.js +234 -58
- package/_internal/CheckboxGroup.js +182 -4
- package/_internal/ConditionalWrapper.js +11 -12
- package/_internal/DetailedCard.js +6912 -48
- package/_internal/DetailedCardCollapsibleSectionItems.js +58 -3
- package/_internal/DetailedCardHeader.js +61 -3
- package/_internal/DetailedCardSection.js +166 -3
- package/_internal/DetailedCardSectionItem.js +88 -3
- package/_internal/Flexbox2.js +85 -22
- package/_internal/Grid2.js +87 -24
- package/_internal/GridItem.js +34 -3
- package/_internal/Heading2.js +107 -3
- package/_internal/Icon2.js +206 -5
- package/_internal/IconButton.js +71 -3
- package/_internal/IconButtonLink.js +65 -18
- package/_internal/Item2.js +390 -73
- package/_internal/Link2.js +56 -15
- package/_internal/LinkButton.js +56 -13
- package/_internal/Number2.js +103 -61
- package/_internal/NumberField.js +3959 -65
- package/_internal/Pill2.js +400 -4
- package/_internal/ProgressBar.js +61 -18
- package/_internal/Radio2.js +227 -56
- package/_internal/RadioGroup.js +170 -4
- package/_internal/Shield2.js +220 -4
- package/_internal/SideNavigationMenu.js +586 -4
- package/_internal/SideNavigationMenuItem.js +299 -4
- package/_internal/Skeleton2.js +36 -9
- package/_internal/SkeletonCircle.js +52 -3
- package/_internal/SkeletonText.js +71 -3
- package/_internal/Spinner2.js +319 -29
- package/_internal/Switch2.js +310 -56
- package/_internal/SwitchGroup.js +182 -4
- package/_internal/Text2.js +45 -3
- package/_internal/TextArea.js +430 -20
- package/_internal/TextField.js +463 -19
- package/_internal/alert.js +2 -5
- package/_internal/app-bar.js +2 -8
- package/_internal/app-container.js +3 -9
- package/_internal/app-content.js +2 -5
- package/_internal/app-side-panel.js +3 -11
- package/_internal/badge.js +2 -6
- package/_internal/breadcrumb-item.js +1 -4
- package/_internal/breadcrumbs.js +2 -6
- package/_internal/button-group.js +2 -5
- package/_internal/button-link.js +2 -8
- package/_internal/button.js +3 -8
- package/_internal/card-actions.js +1 -4
- package/_internal/card-body.js +1 -4
- package/_internal/card-header.js +1 -8
- package/_internal/card.js +2 -11
- package/_internal/checkbox-group.js +2 -6
- package/_internal/checkbox.js +2 -6
- package/_internal/colors.js +87 -91
- package/_internal/conditional-wrapper.js +2 -2
- package/_internal/detailed-card-collapsible-section-items.js +1 -3
- package/_internal/detailed-card-header.js +1 -7
- package/_internal/detailed-card-section-item.js +1 -10
- package/_internal/detailed-card-section.js +1 -6
- package/_internal/detailed-card.js +2 -16
- package/_internal/flexbox.js +2 -5
- package/_internal/focus-within-group.js +3 -3
- package/_internal/fonts.js +4 -6
- package/_internal/gradient-border.js +35 -16
- package/_internal/grid-item.js +1 -4
- package/_internal/grid.js +2 -6
- package/_internal/heading.js +2 -6
- package/_internal/icon-button-link.js +2 -8
- package/_internal/icon-button.js +2 -6
- package/_internal/icon.js +2 -6
- package/_internal/item.js +2 -8
- package/_internal/link-button.js +2 -8
- package/_internal/link.js +3 -8
- package/_internal/listbox.js +3 -6
- package/_internal/number-field.js +2 -9
- package/_internal/number.js +2 -7
- package/_internal/pill.js +2 -6
- package/_internal/progress-bar.js +2 -5
- package/_internal/radio-group.js +2 -6
- package/_internal/radio.js +2 -6
- package/_internal/shared.js +2 -5
- package/_internal/shield.js +2 -6
- package/_internal/side-navigation-menu-bar.js +3 -9
- package/_internal/side-navigation-menu-item.js +2 -8
- package/_internal/side-navigation-menu.js +2 -8
- package/_internal/skeleton-circle.js +1 -6
- package/_internal/skeleton-text.js +2 -6
- package/_internal/skeleton.js +1 -7
- package/_internal/spinner.js +2 -5
- package/_internal/styles.js +235 -17
- package/_internal/styles2.js +44 -280
- package/_internal/switch-group.js +2 -6
- package/_internal/switch.js +2 -6
- package/_internal/text-area.js +2 -9
- package/_internal/text-field.js +2 -10
- package/_internal/text.js +2 -6
- package/_internal/theme.js +1 -3
- package/_internal/types.js +7 -31
- package/_internal/types2.js +18 -29
- package/_internal/types3.js +15 -18
- package/_internal/useAppSidePanel.js +331 -6
- package/_internal/useFocusOnList.js +502 -44
- package/_internal/useListboxItem.js +120 -23
- package/_internal/useSideNavigationMenuBar.js +371 -7
- package/_internal/useTheme.js +10 -8
- package/index.d.ts +4667 -0
- package/index.js +523 -1674
- package/package.json +2 -2
- package/_internal/SideNavigationMenuBar.js +0 -9
- package/_internal/helpers.js +0 -23
- package/_internal/types10.js +0 -20
- package/_internal/types11.js +0 -27
- package/_internal/types12.js +0 -35
- package/_internal/types13.js +0 -143
- package/_internal/types14.js +0 -11
- package/_internal/types15.js +0 -62
- package/_internal/types16.js +0 -56
- package/_internal/types17.js +0 -57
- package/_internal/types18.js +0 -40
- package/_internal/types19.js +0 -101
- package/_internal/types20.js +0 -47
- package/_internal/types21.js +0 -68
- package/_internal/types22.js +0 -52
- package/_internal/types23.js +0 -174
- package/_internal/types24.js +0 -18
- package/_internal/types25.js +0 -12
- package/_internal/types26.js +0 -36
- package/_internal/types27.js +0 -72
- package/_internal/types28.js +0 -73
- package/_internal/types29.js +0 -99
- package/_internal/types4.js +0 -67
- package/_internal/types5.js +0 -11
- package/_internal/types6.js +0 -11
- package/_internal/types7.js +0 -28
- package/_internal/types8.js +0 -72
- package/_internal/types9.js +0 -16
package/_internal/theme.js
CHANGED
package/_internal/types.js
CHANGED
|
@@ -1,39 +1,15 @@
|
|
|
1
|
-
import { ComponentProps, ReactElement, RefObject, MouseEvent } from 'react';
|
|
2
|
-
import { b as IconButtonProps } from './types16.js';
|
|
3
|
-
import { V as ValueOf } from './helpers.js';
|
|
4
|
-
import { T as Theme } from './colors.js';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Component variant.
|
|
8
3
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const AppSidePanelVariant = {
|
|
5
|
+
shrinked: 'shrinked',
|
|
6
|
+
standard: 'standard',
|
|
7
|
+
hidden: 'hidden'
|
|
13
8
|
};
|
|
14
|
-
|
|
9
|
+
|
|
15
10
|
/**
|
|
16
11
|
* Component props.
|
|
17
12
|
*/
|
|
18
|
-
interface AppSidePanelProps extends ComponentProps<'div'> {
|
|
19
|
-
/** Elements to display on top of the navigation menu. Usually a button. */
|
|
20
|
-
featuredElements?: ReactElement | ReactElement[];
|
|
21
|
-
/** Custom props to pass to the IconButton used to collapse the side panel. */
|
|
22
|
-
iconButtonProps?: Omit<IconButtonProps, 'icon'>;
|
|
23
|
-
/** Custom ref to pass to the IconButton used to collapse the side panel. */
|
|
24
|
-
iconButtonRef?: RefObject<HTMLButtonElement>;
|
|
25
|
-
/** Place to display the logo app. */
|
|
26
|
-
logo?: ReactElement | ComponentProps<'img'>;
|
|
27
|
-
/** Method called when a click occurs on the top open button - which is displayed only in shrinked variant. */
|
|
28
|
-
onOpen?: (e: MouseEvent) => void;
|
|
29
|
-
/** Theme. */
|
|
30
|
-
theme?: Theme;
|
|
31
|
-
/** Variant. */
|
|
32
|
-
variant?: AppSidePanelVariant;
|
|
33
|
-
}
|
|
34
|
-
type StyledAppSidePanelProps = Omit<AppSidePanelProps, 'isCollapsed' | 'logo'> & {
|
|
35
|
-
$variant: AppSidePanelProps['variant'];
|
|
36
|
-
$theme: AppSidePanelProps['theme'];
|
|
37
|
-
};
|
|
38
13
|
|
|
39
|
-
export { AppSidePanelVariant as A
|
|
14
|
+
export { AppSidePanelVariant as A };
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
package/_internal/types2.js
CHANGED
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import { N as NotificationsColorPalette, c as PresentationColorPalette, T as Theme } from './colors.js';
|
|
3
|
-
import { V as ValueOf } from './helpers.js';
|
|
4
|
-
import { L as LayoutProps, S as SpacingProps, P as PositioningProps } from './styles2.js';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Component variant.
|
|
8
3
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const HeadingVariant = {
|
|
5
|
+
h1: 'h1',
|
|
6
|
+
h2: 'h2',
|
|
7
|
+
h3: 'h3',
|
|
8
|
+
h4: 'h4',
|
|
9
|
+
h5: 'h5',
|
|
10
|
+
body: 'body'
|
|
11
|
+
};
|
|
12
|
+
const HeadingComponent = {
|
|
13
|
+
h1: 'h1',
|
|
14
|
+
h2: 'h2',
|
|
15
|
+
h3: 'h3',
|
|
16
|
+
h4: 'h4',
|
|
17
|
+
h5: 'h5',
|
|
18
|
+
span: 'span'
|
|
12
19
|
};
|
|
13
|
-
|
|
20
|
+
|
|
14
21
|
/**
|
|
15
22
|
* Component props.
|
|
16
23
|
*/
|
|
17
|
-
interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, PositioningProps {
|
|
18
|
-
/** Whether the badge should automatically break content. */
|
|
19
|
-
autoBreak?: boolean;
|
|
20
|
-
/** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */
|
|
21
|
-
color?: NotificationsColorPalette | PresentationColorPalette;
|
|
22
|
-
/** Whether the Badge has its colors reversed or not. */
|
|
23
|
-
isReversed?: boolean;
|
|
24
|
-
/** Theme. */
|
|
25
|
-
theme?: Theme;
|
|
26
|
-
/** Badge variant. */
|
|
27
|
-
variant?: BadgeVariant;
|
|
28
|
-
}
|
|
29
|
-
type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {
|
|
30
|
-
$autoBreak: BadgeProps['autoBreak'];
|
|
31
|
-
$color: BadgeProps['color'];
|
|
32
|
-
$isReversed: BadgeProps['isReversed'];
|
|
33
|
-
$variant: BadgeProps['variant'];
|
|
34
|
-
$theme: BadgeProps['theme'];
|
|
35
|
-
};
|
|
36
24
|
|
|
37
|
-
export {
|
|
25
|
+
export { HeadingVariant as H, HeadingComponent as a };
|
|
26
|
+
//# sourceMappingURL=types2.js.map
|
package/_internal/types3.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Component variant.
|
|
3
|
+
*/
|
|
4
|
+
const SkeletonTextVariant = {
|
|
5
|
+
h1: 'h1',
|
|
6
|
+
h2: 'h2',
|
|
7
|
+
h3: 'h3',
|
|
8
|
+
h4: 'h4',
|
|
9
|
+
h5: 'h5',
|
|
10
|
+
body: 'body',
|
|
11
|
+
button: 'button',
|
|
12
|
+
caption: 'caption'
|
|
13
|
+
};
|
|
3
14
|
|
|
4
15
|
/**
|
|
5
16
|
* Component props.
|
|
6
17
|
*/
|
|
7
|
-
interface BreadcrumbItemProps extends ComponentProps<'a'> {
|
|
8
|
-
/** Prop to pass a custom react component instead of a simple HTML anchor (useful for Nextjs or React Router Link component). */
|
|
9
|
-
as?: 'a' | ElementType;
|
|
10
|
-
/** Whether the breadcrumb item is the current page. */
|
|
11
|
-
isCurrent?: boolean;
|
|
12
|
-
/** Whether the component is disabled or not. */
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
/** Theme. */
|
|
15
|
-
theme?: Theme;
|
|
16
|
-
}
|
|
17
|
-
type StyledBreadcrumbItemProps = Omit<BreadcrumbItemProps, 'isDisabled' | 'isCurrent'> & {
|
|
18
|
-
$isCurrent: BreadcrumbItemProps['isCurrent'];
|
|
19
|
-
$isDisabled: BreadcrumbItemProps['isDisabled'];
|
|
20
|
-
$theme: BreadcrumbItemProps['theme'];
|
|
21
|
-
};
|
|
22
18
|
|
|
23
|
-
export {
|
|
19
|
+
export { SkeletonTextVariant as S };
|
|
20
|
+
//# sourceMappingURL=types3.js.map
|
|
@@ -1,12 +1,337 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { useState, useEffect, forwardRef, useContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { A as AppContainerContext } from './context.js';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { A as AppSidePanelVariant } from './types.js';
|
|
7
|
+
import { mdiMenu } from '@redsift/icons';
|
|
8
|
+
import { u as useMessageFormatter } from './useMessageFormatter.js';
|
|
9
|
+
import { b as ProductLogo } from './colors.js';
|
|
10
|
+
import { u as useTheme } from './useTheme.js';
|
|
11
|
+
import { a as Icon } from './Icon2.js';
|
|
12
|
+
import { I as IconButton } from './IconButton.js';
|
|
13
|
+
import { a as useSideNavigationMenuBar, S as SideNavigationMenuBar } from './useSideNavigationMenuBar.js';
|
|
14
|
+
|
|
15
|
+
const useWindowSize = () => {
|
|
16
|
+
const [windowSize, setWindowSize] = useState({
|
|
17
|
+
width: undefined,
|
|
18
|
+
height: undefined,
|
|
19
|
+
size: undefined
|
|
20
|
+
});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
function handleResize() {
|
|
23
|
+
setWindowSize(windowSize => {
|
|
24
|
+
if (window.innerWidth === windowSize.width && window.innerHeight === windowSize.height) {
|
|
25
|
+
return windowSize;
|
|
26
|
+
}
|
|
27
|
+
let size;
|
|
28
|
+
if (window.innerWidth <= 480) {
|
|
29
|
+
size = 'xs';
|
|
30
|
+
} else if (window.innerWidth <= 768) {
|
|
31
|
+
size = 'sm';
|
|
32
|
+
} else if (window.innerWidth <= 1024) {
|
|
33
|
+
size = 'md';
|
|
34
|
+
} else if (window.innerWidth <= 1200) {
|
|
35
|
+
size = 'lg';
|
|
36
|
+
} else {
|
|
37
|
+
size = 'xl';
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
width: window.innerWidth,
|
|
41
|
+
height: window.innerHeight,
|
|
42
|
+
size
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
window.addEventListener('resize', handleResize);
|
|
47
|
+
handleResize();
|
|
48
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
49
|
+
}, []);
|
|
50
|
+
return windowSize;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var expand$1 = "Expand left side panel";
|
|
54
|
+
var collapse$1 = "Collapse left side panel";
|
|
55
|
+
var enUS = {
|
|
56
|
+
expand: expand$1,
|
|
57
|
+
collapse: collapse$1
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var expand = "Développer le panneau latéral gauche";
|
|
61
|
+
var collapse = "Réduire le panneau latéral gauche";
|
|
62
|
+
var frFR = {
|
|
63
|
+
expand: expand,
|
|
64
|
+
collapse: collapse
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var intlMessages = {
|
|
68
|
+
'en-US': enUS,
|
|
69
|
+
'fr-FR': frFR
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Component style.
|
|
74
|
+
*/
|
|
75
|
+
const StyledAppSidePanel = styled.div`
|
|
76
|
+
align-items: center;
|
|
77
|
+
background-color: ${_ref => {
|
|
78
|
+
let {
|
|
79
|
+
$theme
|
|
80
|
+
} = _ref;
|
|
81
|
+
return css`var(--redsift-color-${$theme}-components-side-navigation-background)`;
|
|
82
|
+
}};
|
|
83
|
+
border-right: 4px solid ${_ref2 => {
|
|
84
|
+
let {
|
|
85
|
+
$theme
|
|
86
|
+
} = _ref2;
|
|
87
|
+
return css`var(--redsift-color-${$theme}-components-side-navigation-right-line)`;
|
|
88
|
+
}};
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
height: 100%;
|
|
92
|
+
left: 0px;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
position: fixed;
|
|
95
|
+
top: 0;
|
|
96
|
+
transition: width 300ms ease-out;
|
|
97
|
+
width: ${_ref3 => {
|
|
98
|
+
let {
|
|
99
|
+
$variant
|
|
100
|
+
} = _ref3;
|
|
101
|
+
return $variant === AppSidePanelVariant.hidden ? '0' : $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
|
|
102
|
+
}};
|
|
103
|
+
z-index: var(--redsift-layout-z-index-side-panel);
|
|
104
|
+
|
|
105
|
+
.redsift-app-side-panel__header {
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
transition: padding 300ms ease-out;
|
|
108
|
+
padding: 18px
|
|
109
|
+
${_ref4 => {
|
|
110
|
+
let {
|
|
111
|
+
$variant
|
|
112
|
+
} = _ref4;
|
|
113
|
+
return $variant === AppSidePanelVariant.hidden ? '0' : $variant === AppSidePanelVariant.shrinked ? '16px' : '24px';
|
|
114
|
+
}};
|
|
115
|
+
margin-bottom: 16px;
|
|
116
|
+
width: 100%;
|
|
117
|
+
|
|
118
|
+
height: 92px;
|
|
119
|
+
@media (max-width: 1080px) {
|
|
120
|
+
height: 72px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
display: grid;
|
|
124
|
+
justify-items: start;
|
|
125
|
+
align-items: center;
|
|
126
|
+
|
|
127
|
+
.redsift-icon-button {
|
|
128
|
+
> span,
|
|
129
|
+
> span > svg {
|
|
130
|
+
width: 24px;
|
|
131
|
+
height: 24px;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.redsift-app-side-panel-header__logo {
|
|
137
|
+
align-items: center;
|
|
138
|
+
display: flex;
|
|
139
|
+
grid-column: 1;
|
|
140
|
+
grid-row: 1;
|
|
141
|
+
transition: opacity 300ms ease-out;
|
|
142
|
+
opacity: ${_ref5 => {
|
|
143
|
+
let {
|
|
144
|
+
$variant
|
|
145
|
+
} = _ref5;
|
|
146
|
+
return $variant === AppSidePanelVariant.shrinked ? '0' : '1';
|
|
147
|
+
}};
|
|
148
|
+
|
|
149
|
+
height: 56px;
|
|
150
|
+
@media (max-width: 1080px) {
|
|
151
|
+
height: 36px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.redsift-app-side-panel-header__logo > img {
|
|
156
|
+
max-height: 56px;
|
|
157
|
+
@media (max-width: 1080px) {
|
|
158
|
+
max-height: 36px;
|
|
159
|
+
}
|
|
160
|
+
max-width: 195px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.redsift-app-side-panel-header__expand-button {
|
|
164
|
+
grid-column: 1;
|
|
165
|
+
grid-row: 1;
|
|
166
|
+
transition: opacity 300ms ease-out;
|
|
167
|
+
opacity: ${_ref6 => {
|
|
168
|
+
let {
|
|
169
|
+
$variant
|
|
170
|
+
} = _ref6;
|
|
171
|
+
return $variant === AppSidePanelVariant.shrinked ? '1' : '0';
|
|
172
|
+
}};
|
|
173
|
+
padding: 2px;
|
|
174
|
+
margin-left: -1px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.redsift-app-side-panel__featured {
|
|
178
|
+
box-sizing: border-box;
|
|
179
|
+
border-left: 4px solid #e1e1e1;
|
|
180
|
+
border-right: unset;
|
|
181
|
+
margin-bottom: 16px;
|
|
182
|
+
padding: 0px 16px;
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[dir='rtl'] & {
|
|
187
|
+
left: unset;
|
|
188
|
+
right: 0px;
|
|
189
|
+
transform: unset;
|
|
190
|
+
transition: unset;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
scrollbar-color: ${_ref7 => {
|
|
194
|
+
let {
|
|
195
|
+
$theme
|
|
196
|
+
} = _ref7;
|
|
197
|
+
return css`var(--redsift-color-${$theme}-components-side-navigation-scrollbar-resting) transparent`;
|
|
198
|
+
}};
|
|
199
|
+
scrollbar-width: thin;
|
|
200
|
+
|
|
201
|
+
&::-webkit-scrollbar {
|
|
202
|
+
block-size: 9px;
|
|
203
|
+
inline-size: 9px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&::-webkit-scrollbar-thumb {
|
|
207
|
+
background-clip: padding-box;
|
|
208
|
+
background-color: ${_ref8 => {
|
|
209
|
+
let {
|
|
210
|
+
$theme
|
|
211
|
+
} = _ref8;
|
|
212
|
+
return css`var(--redsift-color-${$theme}-components-side-navigation-scrollbar-resting)`;
|
|
213
|
+
}};
|
|
214
|
+
border-radius: 0px;
|
|
215
|
+
border-left: 2px solid transparent;
|
|
216
|
+
border-right: 2px solid transparent;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&::-webkit-scrollbar-track {
|
|
220
|
+
background-color: transparent;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&::-webkit-scrollbar-thumb:horizontal,
|
|
224
|
+
&::-webkit-scrollbar-thumb:vertical {
|
|
225
|
+
&:hover {
|
|
226
|
+
background-color: ${_ref9 => {
|
|
227
|
+
let {
|
|
228
|
+
$theme
|
|
229
|
+
} = _ref9;
|
|
230
|
+
return css`var(--redsift-color-${$theme}-components-side-navigation-scrollbar-hover)`;
|
|
231
|
+
}};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&::-webkit-scrollbar-corner {
|
|
236
|
+
visibility: hidden;
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
// --redsift-color-${$theme}-components-side-navigation-background
|
|
241
|
+
// --redsift-color-${$theme}-components-side-navigation-right-line
|
|
242
|
+
// --redsift-color-${$theme}-components-side-navigation-current-marker
|
|
243
|
+
// --redsift-color-${$theme}-components-side-navigation-text
|
|
244
|
+
// --redsift-color-${$theme}-components-side-navigation-icon
|
|
245
|
+
// --redsift-color-${$theme}-components-side-navigation-chat-background-hover
|
|
246
|
+
// --redsift-color-${$theme}-components-side-navigation-chat-background-down
|
|
247
|
+
|
|
248
|
+
// ${({ $theme }) => css`var(--redsift-color-${$theme}-components-side-navigation-background)`};
|
|
249
|
+
|
|
250
|
+
const _excluded = ["children", "className", "featuredElements", "iconButtonProps", "iconButtonRef", "logo", "onOpen", "theme", "variant"];
|
|
251
|
+
const COMPONENT_NAME = 'AppSidePanel';
|
|
252
|
+
const CLASSNAME = 'redsift-app-side-panel';
|
|
4
253
|
|
|
5
254
|
/**
|
|
6
255
|
* The AppSidePanel component.
|
|
7
256
|
*/
|
|
8
|
-
|
|
257
|
+
const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
258
|
+
const {
|
|
259
|
+
children,
|
|
260
|
+
className,
|
|
261
|
+
featuredElements,
|
|
262
|
+
iconButtonProps,
|
|
263
|
+
iconButtonRef,
|
|
264
|
+
logo,
|
|
265
|
+
onOpen,
|
|
266
|
+
theme: propsTheme,
|
|
267
|
+
variant
|
|
268
|
+
} = props,
|
|
269
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
270
|
+
const {
|
|
271
|
+
width
|
|
272
|
+
} = useWindowSize();
|
|
273
|
+
const appContainerState = useContext(AppContainerContext);
|
|
274
|
+
const theme = useTheme(propsTheme);
|
|
275
|
+
const format = useMessageFormatter(intlMessages);
|
|
276
|
+
useEffect(() => {
|
|
277
|
+
if (appContainerState && variant && appContainerState.sidePanelVariant !== variant) {
|
|
278
|
+
appContainerState.setSidePanelVariant(variant);
|
|
279
|
+
}
|
|
280
|
+
}, [variant]);
|
|
281
|
+
const handleClose = event => {
|
|
282
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(event);
|
|
283
|
+
appContainerState === null || appContainerState === void 0 ? void 0 : appContainerState.expandSidePanel();
|
|
284
|
+
};
|
|
285
|
+
const computedVariant = appContainerState ? appContainerState.sidePanelVariant : variant;
|
|
286
|
+
const product = appContainerState && appContainerState.product;
|
|
287
|
+
return /*#__PURE__*/React__default.createElement(StyledAppSidePanel, _extends({}, forwardedProps, {
|
|
288
|
+
$theme: theme,
|
|
289
|
+
$variant: computedVariant,
|
|
290
|
+
className: classNames(AppSidePanel.className, className),
|
|
291
|
+
ref: ref
|
|
292
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
293
|
+
className: `${AppSidePanel.className}__header`
|
|
294
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
295
|
+
className: `${AppSidePanel.className}-header__logo`
|
|
296
|
+
}, /*#__PURE__*/React__default.isValidElement(logo) ? logo : logo ? /*#__PURE__*/React__default.createElement("img", {
|
|
297
|
+
src: logo.src,
|
|
298
|
+
alt: logo.alt
|
|
299
|
+
}) : product && (typeof product === 'string' || product.logo) ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
300
|
+
icon: typeof product === 'string' ? ProductLogo[product] : product.logo,
|
|
301
|
+
size: {
|
|
302
|
+
height: width && width > 1080 ? 41 : 36
|
|
303
|
+
}
|
|
304
|
+
}) : null), /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
|
305
|
+
className: `${AppSidePanel.className}-header__expand-button`
|
|
306
|
+
}, iconButtonProps, {
|
|
307
|
+
"aria-label": format('expand'),
|
|
308
|
+
icon: mdiMenu,
|
|
309
|
+
onClick: handleClose,
|
|
310
|
+
ref: iconButtonRef,
|
|
311
|
+
color: "grey",
|
|
312
|
+
isDisabled: computedVariant === 'standard'
|
|
313
|
+
}))), featuredElements ? /*#__PURE__*/React__default.createElement("div", {
|
|
314
|
+
className: `${AppSidePanel.className}__featured`
|
|
315
|
+
}, featuredElements) : null, children);
|
|
316
|
+
});
|
|
317
|
+
AppSidePanel.className = CLASSNAME;
|
|
318
|
+
AppSidePanel.displayName = COMPONENT_NAME;
|
|
9
319
|
|
|
10
|
-
|
|
320
|
+
const useAppSidePanel = _ref => {
|
|
321
|
+
let {
|
|
322
|
+
items,
|
|
323
|
+
isActive
|
|
324
|
+
} = _ref;
|
|
325
|
+
const sideNavigationMenuBarProps = useSideNavigationMenuBar({
|
|
326
|
+
items,
|
|
327
|
+
isActive
|
|
328
|
+
});
|
|
329
|
+
return {
|
|
330
|
+
children: /*#__PURE__*/React__default.createElement(SideNavigationMenuBar, _extends({}, sideNavigationMenuBarProps, {
|
|
331
|
+
"aria-label": "Navigation"
|
|
332
|
+
}))
|
|
333
|
+
};
|
|
334
|
+
};
|
|
11
335
|
|
|
12
|
-
export { AppSidePanel as A, useAppSidePanel as u };
|
|
336
|
+
export { AppSidePanel as A, useAppSidePanel as a, useWindowSize as u };
|
|
337
|
+
//# sourceMappingURL=useAppSidePanel.js.map
|