@redsift/design-system 9.0.0-alpha.1 → 9.0.0-alpha.10
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/index.d.ts +26 -14
- package/index.js +176 -90
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/style/index.css +4 -0
- package/style/redsift-reset.css +4 -0
- package/style/redsift.css +4 -0
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useLocalizedStringFormatter, I18nProvider, useNumberFormatter } from '@react-aria/i18n';
|
|
2
2
|
export { I18nProvider, useCollator, useDateFormatter, useFilter, useListFormatter, useLocale, useLocalizedStringFormatter, useNumberFormatter } from '@react-aria/i18n';
|
|
3
3
|
export { SSRProvider, useIsSSR } from '@react-aria/ssr';
|
|
4
|
-
import {
|
|
4
|
+
import { rsiAsmHorizontal, rsiBrandTrustHorizontal, rsiCertificatesHorizontal, rsiOndmarcHorizontal, rsiPulseHorizontal, rsiRadarHorizontal, rsiRojoDsHorizontal, rsiVendorSecureHorizontal, rsiRedSiftHorizontal, mdiClose as mdiClose$1, mdiAlert, mdiCheckCircle, mdiAlertCircle, mdiInformation, mdiMenu, mdiCircleMedium as mdiCircleMedium$1, mdiChevronDown, mdiMenuOpen, mdiChevronUp, mdiCheckboxMarked, mdiMinusBox, mdiCheckboxBlankOutline, mdiPageLast, mdiKeyboardCaps, mdiRadioboxMarked, mdiRadioboxBlank } from '@redsift/icons';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import React__default, { useState, useEffect, forwardRef, useRef, useCallback, useContext,
|
|
6
|
+
import React__default, { useState, useEffect, forwardRef, useRef, useCallback, useContext, useReducer, useMemo, useLayoutEffect } from 'react';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import styled, { css, keyframes } from 'styled-components';
|
|
9
9
|
import { useFocusRing } from '@react-aria/focus';
|
|
@@ -24,6 +24,7 @@ const Product = {
|
|
|
24
24
|
'brand-trust': 'brand-trust',
|
|
25
25
|
certificates: 'certificates',
|
|
26
26
|
ondmarc: 'ondmarc',
|
|
27
|
+
pulse: 'pulse',
|
|
27
28
|
radar: 'radar',
|
|
28
29
|
'rojo-ds': 'rojo-ds',
|
|
29
30
|
'vendor-secure': 'vendor-secure',
|
|
@@ -34,20 +35,22 @@ const ProductName = {
|
|
|
34
35
|
'brand-trust': 'Brand Trust',
|
|
35
36
|
certificates: 'Certificates',
|
|
36
37
|
ondmarc: 'OnDMARC',
|
|
38
|
+
pulse: 'Pulse',
|
|
37
39
|
radar: 'RADAR',
|
|
38
40
|
'rojo-ds': 'ROJO DS',
|
|
39
41
|
'vendor-secure': 'Vendor Secure',
|
|
40
42
|
website: 'Website'
|
|
41
43
|
};
|
|
42
44
|
const ProductLogo = {
|
|
43
|
-
asm:
|
|
44
|
-
'brand-trust':
|
|
45
|
-
certificates:
|
|
46
|
-
ondmarc:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'
|
|
50
|
-
|
|
45
|
+
asm: rsiAsmHorizontal,
|
|
46
|
+
'brand-trust': rsiBrandTrustHorizontal,
|
|
47
|
+
certificates: rsiCertificatesHorizontal,
|
|
48
|
+
ondmarc: rsiOndmarcHorizontal,
|
|
49
|
+
pulse: rsiPulseHorizontal,
|
|
50
|
+
radar: rsiRadarHorizontal,
|
|
51
|
+
'rojo-ds': rsiRojoDsHorizontal,
|
|
52
|
+
'vendor-secure': rsiVendorSecureHorizontal,
|
|
53
|
+
website: rsiRedSiftHorizontal
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
/**
|
|
@@ -1464,7 +1467,8 @@ const DEFAULT_PROPS$L = {
|
|
|
1464
1467
|
* For a semantic button that looks like a link, please use the LinkButton component.
|
|
1465
1468
|
*/
|
|
1466
1469
|
const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1467
|
-
const
|
|
1470
|
+
const _ref = useRef();
|
|
1471
|
+
const buttonRef = ref || _ref;
|
|
1468
1472
|
const {
|
|
1469
1473
|
children,
|
|
1470
1474
|
className,
|
|
@@ -1973,30 +1977,46 @@ const StyledAppBar = styled.header`
|
|
|
1973
1977
|
color: var(--redsift-color-neutral-darkgrey);
|
|
1974
1978
|
display: flex;
|
|
1975
1979
|
flex-direction: row;
|
|
1980
|
+
|
|
1976
1981
|
height: 92px;
|
|
1982
|
+
@media (max-width: 1080px) {
|
|
1983
|
+
height: 72px;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1977
1986
|
justify-content: space-between;
|
|
1978
1987
|
left: 0;
|
|
1979
|
-
position:
|
|
1988
|
+
position: sticky;
|
|
1980
1989
|
top: 0;
|
|
1981
1990
|
z-index: var(--redsift-layout-z-index-header);
|
|
1982
1991
|
|
|
1983
1992
|
${_ref => {
|
|
1984
1993
|
let {
|
|
1985
|
-
$
|
|
1994
|
+
$hasBorder
|
|
1986
1995
|
} = _ref;
|
|
1996
|
+
return $hasBorder ? css`
|
|
1997
|
+
border-bottom: 2px solid #e1e1e1;
|
|
1998
|
+
` : css`
|
|
1999
|
+
border-bottom: none;
|
|
2000
|
+
`;
|
|
2001
|
+
}}
|
|
2002
|
+
|
|
2003
|
+
${_ref2 => {
|
|
2004
|
+
let {
|
|
2005
|
+
$isSidePanelCollapsed
|
|
2006
|
+
} = _ref2;
|
|
1987
2007
|
return !$isSidePanelCollapsed ? css`
|
|
1988
2008
|
transform: translate(250px);
|
|
1989
|
-
width: calc(
|
|
2009
|
+
width: calc(100vw - 250px);
|
|
1990
2010
|
` : css`
|
|
1991
2011
|
transform: translate(64px);
|
|
1992
2012
|
width: calc(100% - 64px);
|
|
1993
2013
|
`;
|
|
1994
2014
|
}}
|
|
1995
2015
|
|
|
1996
|
-
${
|
|
2016
|
+
${_ref3 => {
|
|
1997
2017
|
let {
|
|
1998
2018
|
$isLoaded
|
|
1999
|
-
} =
|
|
2019
|
+
} = _ref3;
|
|
2000
2020
|
return $isLoaded ? css`
|
|
2001
2021
|
transition: transform 0.25s ease-out, width 0.25s ease-out;
|
|
2002
2022
|
` : '';
|
|
@@ -2213,6 +2233,7 @@ const StyledAppSidePanel = styled.div`
|
|
|
2213
2233
|
align-items: center;
|
|
2214
2234
|
background-color: var(--redsift-side-navigation-color-background);
|
|
2215
2235
|
border-right: 4px solid #e1e1e1;
|
|
2236
|
+
box-sizing: border-box;
|
|
2216
2237
|
flex-direction: column;
|
|
2217
2238
|
height: 100%;
|
|
2218
2239
|
left: 0px;
|
|
@@ -2224,7 +2245,7 @@ const StyledAppSidePanel = styled.div`
|
|
|
2224
2245
|
let {
|
|
2225
2246
|
$variant
|
|
2226
2247
|
} = _ref;
|
|
2227
|
-
return $variant === AppSidePanelVariant.shrinked ? '
|
|
2248
|
+
return $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
|
|
2228
2249
|
}};
|
|
2229
2250
|
z-index: var(--redsift-layout-z-index-side-panel);
|
|
2230
2251
|
|
|
@@ -2239,7 +2260,12 @@ const StyledAppSidePanel = styled.div`
|
|
|
2239
2260
|
}};
|
|
2240
2261
|
margin-bottom: 16px;
|
|
2241
2262
|
width: 100%;
|
|
2263
|
+
|
|
2242
2264
|
height: 92px;
|
|
2265
|
+
@media (max-width: 1080px) {
|
|
2266
|
+
height: 72px;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2243
2269
|
display: grid;
|
|
2244
2270
|
justify-items: start;
|
|
2245
2271
|
align-items: center;
|
|
@@ -2265,11 +2291,18 @@ const StyledAppSidePanel = styled.div`
|
|
|
2265
2291
|
} = _ref3;
|
|
2266
2292
|
return $variant === AppSidePanelVariant.shrinked ? '0' : '1';
|
|
2267
2293
|
}};
|
|
2294
|
+
|
|
2268
2295
|
height: 56px;
|
|
2296
|
+
@media (max-width: 1080px) {
|
|
2297
|
+
height: 36px;
|
|
2298
|
+
}
|
|
2269
2299
|
}
|
|
2270
2300
|
|
|
2271
2301
|
.redsift-app-side-panel-header__logo > img {
|
|
2272
2302
|
max-height: 56px;
|
|
2303
|
+
@media (max-width: 1080px) {
|
|
2304
|
+
max-height: 36px;
|
|
2305
|
+
}
|
|
2273
2306
|
max-width: 195px;
|
|
2274
2307
|
}
|
|
2275
2308
|
|
|
@@ -2357,6 +2390,9 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2357
2390
|
iconButtonRef
|
|
2358
2391
|
} = props,
|
|
2359
2392
|
forwardedProps = _objectWithoutProperties(props, _excluded$F);
|
|
2393
|
+
const {
|
|
2394
|
+
width
|
|
2395
|
+
} = useWindowSize();
|
|
2360
2396
|
const appContainerState = useContext(AppContainerContext);
|
|
2361
2397
|
const stringFormatter = useLocalizedStringFormatter(intlMessages$3);
|
|
2362
2398
|
useEffect(() => {
|
|
@@ -2381,12 +2417,12 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2381
2417
|
}, /*#__PURE__*/React__default.isValidElement(logo) ? logo : logo ? /*#__PURE__*/React__default.createElement("img", {
|
|
2382
2418
|
src: logo.src,
|
|
2383
2419
|
alt: logo.alt
|
|
2384
|
-
}) : product ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
2385
|
-
icon: ProductLogo[product],
|
|
2420
|
+
}) : product && (typeof product === 'string' || product.logo) ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
2421
|
+
icon: typeof product === 'string' ? ProductLogo[product] : product.logo,
|
|
2386
2422
|
size: {
|
|
2387
|
-
height: 41
|
|
2423
|
+
height: width && width > 1080 ? 41 : 36
|
|
2388
2424
|
}
|
|
2389
|
-
}) : null),
|
|
2425
|
+
}) : null), /*#__PURE__*/React__default.createElement(IconButton, _extends$1({
|
|
2390
2426
|
className: `${AppSidePanel.className}-header__expand-button`
|
|
2391
2427
|
}, iconButtonProps, {
|
|
2392
2428
|
"aria-label": stringFormatter.format('expand'),
|
|
@@ -2395,7 +2431,7 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2395
2431
|
ref: iconButtonRef,
|
|
2396
2432
|
color: "question",
|
|
2397
2433
|
isDisabled: computedVariant === 'standard'
|
|
2398
|
-
}))
|
|
2434
|
+
}))), featuredElements ? /*#__PURE__*/React__default.createElement("div", {
|
|
2399
2435
|
className: `${AppSidePanel.className}__featured`
|
|
2400
2436
|
}, featuredElements) : null, children);
|
|
2401
2437
|
});
|
|
@@ -2450,6 +2486,7 @@ const StyledSideNavigationMenuItemIndicatorContainer = styled.div`
|
|
|
2450
2486
|
min-width: 4px;
|
|
2451
2487
|
`;
|
|
2452
2488
|
const StyledSideNavigationMenuItemIndicator = styled.div`
|
|
2489
|
+
position: relative;
|
|
2453
2490
|
width: 4px;
|
|
2454
2491
|
height: 38px;
|
|
2455
2492
|
border-radius: 0px 4px 4px 0px;
|
|
@@ -2568,10 +2605,11 @@ const StyledSideNavigationMenuItem = styled.a`
|
|
|
2568
2605
|
*/
|
|
2569
2606
|
|
|
2570
2607
|
background-color: var(--redsift-side-navigation-color-background);
|
|
2571
|
-
height:
|
|
2608
|
+
height: 38px;
|
|
2572
2609
|
margin-bottom: 16px;
|
|
2610
|
+
margin-left: -4px;
|
|
2573
2611
|
transition: padding 300ms ease-out;
|
|
2574
|
-
padding:
|
|
2612
|
+
padding: 0 16px 0 ${$variant === SideNavigationMenuBarVariant.shrinked ? '16px' : '24px'};
|
|
2575
2613
|
|
|
2576
2614
|
.redsift-icon.first {
|
|
2577
2615
|
box-sizing: unset;
|
|
@@ -2608,6 +2646,7 @@ const BadgeVariant = {
|
|
|
2608
2646
|
*/
|
|
2609
2647
|
const StyledBadge = styled.div`
|
|
2610
2648
|
${baseStyling}
|
|
2649
|
+
box-sizing: content-box;
|
|
2611
2650
|
|
|
2612
2651
|
${_ref => {
|
|
2613
2652
|
let {
|
|
@@ -2833,8 +2872,6 @@ const StyledSideNavigationMenu = styled.div`
|
|
|
2833
2872
|
} = _ref;
|
|
2834
2873
|
return css`
|
|
2835
2874
|
.redsift-side-navigation-menu__menu-container > button {
|
|
2836
|
-
background-color: var(--redsift-side-navigation-color-background);
|
|
2837
|
-
border: none;
|
|
2838
2875
|
${!$isDisabled ? css`
|
|
2839
2876
|
&,
|
|
2840
2877
|
.redsift-icon.first {
|
|
@@ -2847,6 +2884,8 @@ const StyledSideNavigationMenu = styled.div`
|
|
|
2847
2884
|
}
|
|
2848
2885
|
`}
|
|
2849
2886
|
align-items: center;
|
|
2887
|
+
background-color: var(--redsift-side-navigation-color-background);
|
|
2888
|
+
border: none;
|
|
2850
2889
|
border-radius: 0 4px 4px 0;
|
|
2851
2890
|
display: flex;
|
|
2852
2891
|
font-family: var(--redsift-typography-body-font-family);
|
|
@@ -2857,10 +2896,10 @@ const StyledSideNavigationMenu = styled.div`
|
|
|
2857
2896
|
line-height: var(--redsift-typography-body-line-height);
|
|
2858
2897
|
margin-left: -4px;
|
|
2859
2898
|
transition: padding 300ms ease-out;
|
|
2860
|
-
padding:
|
|
2899
|
+
padding: 0 16px 0 ${$variant === SideNavigationMenuBarVariant.shrinked ? '16px' : '24px'};
|
|
2861
2900
|
text-decoration: none;
|
|
2862
2901
|
text-transform: uppercase;
|
|
2863
|
-
width: calc(100% + 4px);
|
|
2902
|
+
width: calc(100% + ${$variant === SideNavigationMenuBarVariant.shrinked ? '0px' : '4px'});
|
|
2864
2903
|
|
|
2865
2904
|
:hover,
|
|
2866
2905
|
:focus-visible {
|
|
@@ -2976,16 +3015,24 @@ const StyledSideNavigationMenu = styled.div`
|
|
|
2976
3015
|
margin: unset;
|
|
2977
3016
|
padding: unset;
|
|
2978
3017
|
margin-left: -4px;
|
|
2979
|
-
|
|
3018
|
+
|
|
3019
|
+
${_ref5 => {
|
|
3020
|
+
let {
|
|
3021
|
+
$variant
|
|
3022
|
+
} = _ref5;
|
|
3023
|
+
return css`
|
|
3024
|
+
width: calc(100% + ${$variant === SideNavigationMenuBarVariant.shrinked ? '0px' : '4px'});
|
|
3025
|
+
`;
|
|
3026
|
+
}}
|
|
2980
3027
|
margin-bottom: 16px;
|
|
2981
3028
|
max-width: 241px;
|
|
2982
3029
|
transition: height 300ms ease-out;
|
|
2983
3030
|
overflow: hidden;
|
|
2984
|
-
${
|
|
3031
|
+
${_ref6 => {
|
|
2985
3032
|
let {
|
|
2986
3033
|
$isExpanded,
|
|
2987
3034
|
$numberOfChildren
|
|
2988
|
-
} =
|
|
3035
|
+
} = _ref6;
|
|
2989
3036
|
return $isExpanded ? css`
|
|
2990
3037
|
height: ${$numberOfChildren * 38}px;
|
|
2991
3038
|
` : css`
|
|
@@ -3019,7 +3066,9 @@ const SideNavigationMenuReducer = (state, action) => {
|
|
|
3019
3066
|
/**
|
|
3020
3067
|
* Component style.
|
|
3021
3068
|
*/
|
|
3022
|
-
const StyledAppContainer = styled.div
|
|
3069
|
+
const StyledAppContainer = styled.div`
|
|
3070
|
+
box-sizing: content-box;
|
|
3071
|
+
`;
|
|
3023
3072
|
|
|
3024
3073
|
const _excluded$C = ["children", "className", "locale", "product"];
|
|
3025
3074
|
const COMPONENT_NAME$C = 'AppContainer';
|
|
@@ -3037,21 +3086,6 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3037
3086
|
product
|
|
3038
3087
|
} = props,
|
|
3039
3088
|
forwardedProps = _objectWithoutProperties(props, _excluded$C);
|
|
3040
|
-
const {
|
|
3041
|
-
hasAppBar,
|
|
3042
|
-
hasAppSidePanel,
|
|
3043
|
-
hasAppContent
|
|
3044
|
-
} = useMemo(() => {
|
|
3045
|
-
const [[appBar], [appSidePanel], [appContent]] = partitionComponents(React__default.Children.toArray(children), [isComponent('AppBar'), isComponent('AppSidePanel'), isComponent('AppContent')]);
|
|
3046
|
-
return {
|
|
3047
|
-
hasAppBar: Boolean(appBar),
|
|
3048
|
-
hasAppSidePanel: Boolean(appSidePanel),
|
|
3049
|
-
hasAppContent: Boolean(appContent)
|
|
3050
|
-
};
|
|
3051
|
-
}, [children]);
|
|
3052
|
-
if ((hasAppBar || hasAppSidePanel || hasAppContent) && !(hasAppBar && hasAppSidePanel && hasAppContent)) {
|
|
3053
|
-
console.warn('Missing AppSidePanel, AppBar or AppContent inside AppContainer. These components are meant to work together.');
|
|
3054
|
-
}
|
|
3055
3089
|
const [sidePanelVariant, setSidePanelVariant] = useState(AppSidePanelVariant.standard);
|
|
3056
3090
|
const [breadcrumbs, setBreadcrumbs] = useState();
|
|
3057
3091
|
const state = {
|
|
@@ -3061,9 +3095,6 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3061
3095
|
expandSidePanel() {
|
|
3062
3096
|
setSidePanelVariant(AppSidePanelVariant.standard);
|
|
3063
3097
|
},
|
|
3064
|
-
hasAppBar,
|
|
3065
|
-
hasAppSidePanel,
|
|
3066
|
-
hasAppContent,
|
|
3067
3098
|
setBreadcrumbs(breadcrumbs) {
|
|
3068
3099
|
setBreadcrumbs(breadcrumbs);
|
|
3069
3100
|
},
|
|
@@ -3428,6 +3459,7 @@ SideNavigationMenu.displayName = COMPONENT_NAME$B;
|
|
|
3428
3459
|
*/
|
|
3429
3460
|
const StyledSideNavigationMenuBar = styled.nav`
|
|
3430
3461
|
background-color: var(--redsift-side-navigation-color-background);
|
|
3462
|
+
box-sizing: content-box;
|
|
3431
3463
|
overflow-x: hidden;
|
|
3432
3464
|
overflow-y: auto;
|
|
3433
3465
|
scrollbar-gutter: stable;
|
|
@@ -3927,6 +3959,7 @@ const DEFAULT_PROPS$x = {};
|
|
|
3927
3959
|
* The AppBar component.
|
|
3928
3960
|
*/
|
|
3929
3961
|
const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3962
|
+
var _breadcrumbs$, _appContainerState$pr;
|
|
3930
3963
|
const {
|
|
3931
3964
|
breadcrumbs,
|
|
3932
3965
|
children,
|
|
@@ -3937,12 +3970,19 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3937
3970
|
title: propsTitle
|
|
3938
3971
|
} = props,
|
|
3939
3972
|
forwardedProps = _objectWithoutProperties(props, _excluded$w);
|
|
3973
|
+
const [scroll, setScroll] = useState(false);
|
|
3974
|
+
useEffect(() => {
|
|
3975
|
+
window.addEventListener('scroll', () => {
|
|
3976
|
+
setScroll(window.scrollY > 8);
|
|
3977
|
+
});
|
|
3978
|
+
}, []);
|
|
3940
3979
|
const {
|
|
3941
3980
|
isLoaded
|
|
3942
3981
|
} = useIsLoaded();
|
|
3943
3982
|
const appContainerState = useContext(AppContainerContext);
|
|
3944
3983
|
const stringFormatter = useLocalizedStringFormatter(intlMessages$4);
|
|
3945
3984
|
return /*#__PURE__*/React__default.createElement(StyledAppBar, _extends$1({}, forwardedProps, {
|
|
3985
|
+
$hasBorder: scroll,
|
|
3946
3986
|
$isLoaded: isLoaded,
|
|
3947
3987
|
$isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
|
|
3948
3988
|
className: classNames(AppBar.className, className),
|
|
@@ -3968,12 +4008,13 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3968
4008
|
}, propsTitle) : breadcrumbs ? /*#__PURE__*/React__default.createElement(Breadcrumbs, {
|
|
3969
4009
|
"aria-label": "Breadcrumb"
|
|
3970
4010
|
}, appContainerState && appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked ? /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, {
|
|
3971
|
-
href: "/"
|
|
3972
|
-
|
|
4011
|
+
href: "/",
|
|
4012
|
+
as: ((_breadcrumbs$ = breadcrumbs[0]) === null || _breadcrumbs$ === void 0 ? void 0 : _breadcrumbs$.as) || 'a'
|
|
4013
|
+
}, typeof appContainerState.product === 'string' ? ProductName[appContainerState.product] : (_appContainerState$pr = appContainerState.product) === null || _appContainerState$pr === void 0 ? void 0 : _appContainerState$pr.name) : null, breadcrumbs.map((breadcrumbItem, index) => /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, _extends$1({
|
|
3973
4014
|
key: index
|
|
3974
4015
|
}, breadcrumbItem, {
|
|
3975
|
-
isDisabled: breadcrumbItem.href === undefined,
|
|
3976
|
-
as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : 'a'
|
|
4016
|
+
isDisabled: breadcrumbItem.isDisabled || breadcrumbItem.href === undefined,
|
|
4017
|
+
as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : breadcrumbItem.as || 'a'
|
|
3977
4018
|
})))) : fallbackTitle ? /*#__PURE__*/React__default.createElement(Heading, {
|
|
3978
4019
|
as: "h1"
|
|
3979
4020
|
}, fallbackTitle) : null), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3988,12 +4029,11 @@ AppBar.displayName = COMPONENT_NAME$x;
|
|
|
3988
4029
|
* Component style.
|
|
3989
4030
|
*/
|
|
3990
4031
|
const StyledAppContent = styled.main`
|
|
4032
|
+
padding: 16px 64px;
|
|
3991
4033
|
${baseContainer}
|
|
3992
4034
|
|
|
3993
4035
|
box-sizing: border-box;
|
|
3994
|
-
margin-top: 92px;
|
|
3995
4036
|
min-height: calc(100vh - 92px);
|
|
3996
|
-
padding: 16px 64px;
|
|
3997
4037
|
|
|
3998
4038
|
@media screen and (max-width: 768px) {
|
|
3999
4039
|
padding: 0px;
|
|
@@ -4004,11 +4044,11 @@ const StyledAppContent = styled.main`
|
|
|
4004
4044
|
$isSidePanelCollapsed
|
|
4005
4045
|
} = _ref;
|
|
4006
4046
|
return !$isSidePanelCollapsed ? css`
|
|
4007
|
-
transform: translate(
|
|
4008
|
-
width: calc(100% -
|
|
4047
|
+
transform: translate(254px);
|
|
4048
|
+
width: calc(100% - 254px);
|
|
4009
4049
|
` : css`
|
|
4010
|
-
transform: translate(
|
|
4011
|
-
width: calc(100% -
|
|
4050
|
+
transform: translate(68px);
|
|
4051
|
+
width: calc(100% - 68px);
|
|
4012
4052
|
`;
|
|
4013
4053
|
}}
|
|
4014
4054
|
|
|
@@ -4022,7 +4062,7 @@ const StyledAppContent = styled.main`
|
|
|
4022
4062
|
}}
|
|
4023
4063
|
`;
|
|
4024
4064
|
|
|
4025
|
-
const _excluded$v = ["children", "className"
|
|
4065
|
+
const _excluded$v = ["children", "className"];
|
|
4026
4066
|
const COMPONENT_NAME$w = 'AppContent';
|
|
4027
4067
|
const CLASSNAME$w = 'redsift-app-content';
|
|
4028
4068
|
const DEFAULT_PROPS$w = {};
|
|
@@ -4033,8 +4073,7 @@ const DEFAULT_PROPS$w = {};
|
|
|
4033
4073
|
const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
4034
4074
|
const {
|
|
4035
4075
|
children,
|
|
4036
|
-
className
|
|
4037
|
-
product
|
|
4076
|
+
className
|
|
4038
4077
|
} = props,
|
|
4039
4078
|
forwardedProps = _objectWithoutProperties(props, _excluded$v);
|
|
4040
4079
|
const {
|
|
@@ -4044,7 +4083,6 @@ const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4044
4083
|
return /*#__PURE__*/React__default.createElement(StyledAppContent, _extends$1({}, forwardedProps, {
|
|
4045
4084
|
$isLoaded: isLoaded,
|
|
4046
4085
|
$isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
|
|
4047
|
-
$product: product,
|
|
4048
4086
|
className: classNames(AppContent.className, className),
|
|
4049
4087
|
ref: ref
|
|
4050
4088
|
}), children);
|
|
@@ -4138,7 +4176,6 @@ const StyledCard = styled.div`
|
|
|
4138
4176
|
|
|
4139
4177
|
display: flex;
|
|
4140
4178
|
flex-direction: column;
|
|
4141
|
-
padding: 16px;
|
|
4142
4179
|
|
|
4143
4180
|
.redsift-card__header {
|
|
4144
4181
|
align-items: flex-start;
|
|
@@ -4183,6 +4220,12 @@ const StyledCard = styled.div`
|
|
|
4183
4220
|
* Component style.
|
|
4184
4221
|
*/
|
|
4185
4222
|
const StyledCardHeader = styled.div`
|
|
4223
|
+
display: flex;
|
|
4224
|
+
flex-direction: column;
|
|
4225
|
+
width: 100%;
|
|
4226
|
+
${baseStyling}
|
|
4227
|
+
${baseFlexbox}
|
|
4228
|
+
|
|
4186
4229
|
color: var(--redsift-color-neutral-black);
|
|
4187
4230
|
|
|
4188
4231
|
.redsift-card-header__header {
|
|
@@ -4194,10 +4237,6 @@ const StyledCardHeader = styled.div`
|
|
|
4194
4237
|
|
|
4195
4238
|
.redsift-icon {
|
|
4196
4239
|
color: var(--redsift-color-neutral-black);
|
|
4197
|
-
padding-right: 8px;
|
|
4198
|
-
font-size: 30px;
|
|
4199
|
-
line-height: 30px;
|
|
4200
|
-
height: 30px;
|
|
4201
4240
|
}
|
|
4202
4241
|
}
|
|
4203
4242
|
|
|
@@ -4238,7 +4277,7 @@ const StyledSkeleton = styled.div`
|
|
|
4238
4277
|
height: fit-content;
|
|
4239
4278
|
width: fit-content;
|
|
4240
4279
|
|
|
4241
|
-
|
|
4280
|
+
* {
|
|
4242
4281
|
visibility: hidden;
|
|
4243
4282
|
}
|
|
4244
4283
|
|
|
@@ -4438,7 +4477,7 @@ const Skeleton = Object.assign(BaseSkeleton, {
|
|
|
4438
4477
|
Text: SkeletonText
|
|
4439
4478
|
});
|
|
4440
4479
|
|
|
4441
|
-
const _excluded$q = ["children", "className", "header", "headingProps", "icon", "isLoading", "subheader"];
|
|
4480
|
+
const _excluded$q = ["children", "className", "header", "headingProps", "icon", "iconProps", "isLoading", "subheader"];
|
|
4442
4481
|
const COMPONENT_NAME$r = 'CardHeader';
|
|
4443
4482
|
const CLASSNAME$r = 'redsift-card-header';
|
|
4444
4483
|
const DEFAULT_PROPS$r = {};
|
|
@@ -4453,6 +4492,7 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4453
4492
|
header,
|
|
4454
4493
|
headingProps,
|
|
4455
4494
|
icon,
|
|
4495
|
+
iconProps,
|
|
4456
4496
|
isLoading,
|
|
4457
4497
|
subheader
|
|
4458
4498
|
} = props,
|
|
@@ -4466,7 +4506,7 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4466
4506
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4467
4507
|
className: `${CardHeader.className}__subheader`
|
|
4468
4508
|
}, subheader)) : null, header ? /*#__PURE__*/React__default.createElement(Skeleton.Text, {
|
|
4469
|
-
variant:
|
|
4509
|
+
variant: (headingProps === null || headingProps === void 0 ? void 0 : headingProps.variant) || 'h2',
|
|
4470
4510
|
isLoaded: !isLoading,
|
|
4471
4511
|
marginTop: "10px",
|
|
4472
4512
|
marginBottom: "10px"
|
|
@@ -4475,10 +4515,11 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4475
4515
|
color: "black",
|
|
4476
4516
|
className: `${CardHeader.className}__header`,
|
|
4477
4517
|
variant: "h2"
|
|
4478
|
-
}, headingProps), icon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
4518
|
+
}, headingProps), icon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
|
|
4479
4519
|
icon: icon,
|
|
4480
|
-
"aria-hidden": "true"
|
|
4481
|
-
|
|
4520
|
+
"aria-hidden": "true",
|
|
4521
|
+
size: "large"
|
|
4522
|
+
}, iconProps)) : null, header)) : null, children);
|
|
4482
4523
|
});
|
|
4483
4524
|
CardHeader.className = CLASSNAME$r;
|
|
4484
4525
|
CardHeader.defaultProps = DEFAULT_PROPS$r;
|
|
@@ -5353,7 +5394,7 @@ const StyledDetailedCardSection = styled.div`
|
|
|
5353
5394
|
|
|
5354
5395
|
.redsift-detailed-card-section-header__title {
|
|
5355
5396
|
font-size: 18px;
|
|
5356
|
-
font-weight:
|
|
5397
|
+
font-weight: 500;
|
|
5357
5398
|
lineheight: 22px;
|
|
5358
5399
|
padding: 6px 0px;
|
|
5359
5400
|
}
|
|
@@ -5478,6 +5519,7 @@ const StyledDetailedCard = styled.div`
|
|
|
5478
5519
|
background-color: var(--redsift-color-neutral-white);
|
|
5479
5520
|
border-radius: 4px;
|
|
5480
5521
|
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5);
|
|
5522
|
+
box-sizing: content-box;
|
|
5481
5523
|
padding: 16px;
|
|
5482
5524
|
|
|
5483
5525
|
.redsift-detailed-card__banner {
|
|
@@ -5556,11 +5598,16 @@ const StyledPill = styled.div`
|
|
|
5556
5598
|
|
|
5557
5599
|
padding: 2px 8px;
|
|
5558
5600
|
text-align: center;
|
|
5559
|
-
|
|
5601
|
+
|
|
5602
|
+
${_ref => {
|
|
5560
5603
|
let {
|
|
5561
5604
|
$autoBreak
|
|
5562
5605
|
} = _ref;
|
|
5563
|
-
return
|
|
5606
|
+
return !$autoBreak ? css`
|
|
5607
|
+
text-wrap: nowrap;
|
|
5608
|
+
` : css`
|
|
5609
|
+
word-break: break-word;
|
|
5610
|
+
`;
|
|
5564
5611
|
}};
|
|
5565
5612
|
|
|
5566
5613
|
${_ref2 => {
|
|
@@ -9743,9 +9790,9 @@ const FocusWithinGroupReducer = (state, action) => {
|
|
|
9743
9790
|
const currentTabStop = state.tabStops[index];
|
|
9744
9791
|
return currentTabStop.isDisabled ? _objectSpread2(_objectSpread2({}, state), {}, {
|
|
9745
9792
|
delayedAction: undefined
|
|
9746
|
-
}) : selectTabStop(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
9793
|
+
}, action.payload) : selectTabStop(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
9747
9794
|
delayedAction: undefined
|
|
9748
|
-
}), currentTabStop, undefined, state.focusOnClick);
|
|
9795
|
+
}, action.payload), currentTabStop, undefined, state.focusOnClick);
|
|
9749
9796
|
}
|
|
9750
9797
|
case FocusWithinGroupActionType.BLUR_ON_LIST:
|
|
9751
9798
|
{
|
|
@@ -9778,8 +9825,7 @@ const FocusWithinGroupReducer = (state, action) => {
|
|
|
9778
9825
|
return _objectSpread2(_objectSpread2({}, state), action.payload);
|
|
9779
9826
|
case FocusWithinGroupActionType.FILTER_LIST:
|
|
9780
9827
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
9781
|
-
selectedId: null
|
|
9782
|
-
activedescendant: ['', '']
|
|
9828
|
+
selectedId: null
|
|
9783
9829
|
}, action.payload);
|
|
9784
9830
|
case FocusWithinGroupActionType.DELAY_ACTION:
|
|
9785
9831
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
@@ -10301,10 +10347,43 @@ const StyledGrid = styled.div`
|
|
|
10301
10347
|
} = _ref;
|
|
10302
10348
|
return inline ? 'inline-grid' : 'grid';
|
|
10303
10349
|
}};
|
|
10350
|
+
flex: 1;
|
|
10304
10351
|
|
|
10305
10352
|
${baseStyling}
|
|
10306
10353
|
${baseInternalSpacing}
|
|
10307
10354
|
${baseGrid}
|
|
10355
|
+
|
|
10356
|
+
${_ref2 => {
|
|
10357
|
+
let {
|
|
10358
|
+
$divider
|
|
10359
|
+
} = _ref2;
|
|
10360
|
+
return $divider ? css`
|
|
10361
|
+
overflow: hidden;
|
|
10362
|
+
.redsift-grid-item {
|
|
10363
|
+
position: relative;
|
|
10364
|
+
|
|
10365
|
+
::before {
|
|
10366
|
+
content: '';
|
|
10367
|
+
position: absolute;
|
|
10368
|
+
background-color: var(--redsift-color-neutral-lightgrey);
|
|
10369
|
+
inline-size: 1px;
|
|
10370
|
+
block-size: 100%;
|
|
10371
|
+
inset-inline-start: calc(${Math.max(1, $divider.colGap / 2)}px * -1);
|
|
10372
|
+
}
|
|
10373
|
+
|
|
10374
|
+
::after {
|
|
10375
|
+
content: '';
|
|
10376
|
+
position: absolute;
|
|
10377
|
+
background-color: var(--redsift-color-neutral-lightgrey);
|
|
10378
|
+
inline-size: 100vw;
|
|
10379
|
+
block-size: 1px;
|
|
10380
|
+
inset-inline-start: 0;
|
|
10381
|
+
inset-block-start: calc(${Math.max(1, $divider.rowGap / 2)}px * -1);
|
|
10382
|
+
z-index: 0;
|
|
10383
|
+
}
|
|
10384
|
+
}
|
|
10385
|
+
` : '';
|
|
10386
|
+
}}
|
|
10308
10387
|
`;
|
|
10309
10388
|
|
|
10310
10389
|
/**
|
|
@@ -10340,7 +10419,7 @@ GridItem.className = CLASSNAME$b;
|
|
|
10340
10419
|
GridItem.defaultProps = DEFAULT_PROPS$b;
|
|
10341
10420
|
GridItem.displayName = COMPONENT_NAME$b;
|
|
10342
10421
|
|
|
10343
|
-
const _excluded$c = ["children", "className"];
|
|
10422
|
+
const _excluded$c = ["children", "className", "divider", "gap"];
|
|
10344
10423
|
const COMPONENT_NAME$a = 'Grid';
|
|
10345
10424
|
const CLASSNAME$a = 'redsift-grid';
|
|
10346
10425
|
const DEFAULT_PROPS$a = {};
|
|
@@ -10351,12 +10430,16 @@ const DEFAULT_PROPS$a = {};
|
|
|
10351
10430
|
const BaseGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10352
10431
|
const {
|
|
10353
10432
|
children,
|
|
10354
|
-
className
|
|
10433
|
+
className,
|
|
10434
|
+
divider,
|
|
10435
|
+
gap
|
|
10355
10436
|
} = props,
|
|
10356
10437
|
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
10357
10438
|
return /*#__PURE__*/React__default.createElement(StyledGrid, _extends$1({}, forwardedProps, {
|
|
10439
|
+
gap: divider ? `${divider.rowGap}px ${divider.colGap}px` : gap,
|
|
10358
10440
|
className: classNames(BaseGrid.className, className),
|
|
10359
|
-
ref: ref
|
|
10441
|
+
ref: ref,
|
|
10442
|
+
$divider: divider
|
|
10360
10443
|
}), children);
|
|
10361
10444
|
});
|
|
10362
10445
|
BaseGrid.className = CLASSNAME$a;
|
|
@@ -10370,9 +10453,9 @@ const Grid = Object.assign(BaseGrid, {
|
|
|
10370
10453
|
* Component style.
|
|
10371
10454
|
*/
|
|
10372
10455
|
const StyledItem = styled.div`
|
|
10373
|
-
height:
|
|
10456
|
+
height: 36px;
|
|
10374
10457
|
position: relative;
|
|
10375
|
-
width:
|
|
10458
|
+
width: 100%;
|
|
10376
10459
|
padding: 8px 16px;
|
|
10377
10460
|
|
|
10378
10461
|
${baseStyling}
|
|
@@ -10380,6 +10463,7 @@ const StyledItem = styled.div`
|
|
|
10380
10463
|
align-items: center;
|
|
10381
10464
|
background: none;
|
|
10382
10465
|
border: none;
|
|
10466
|
+
box-sizing: border-box;
|
|
10383
10467
|
display: inline-flex;
|
|
10384
10468
|
|
|
10385
10469
|
${_ref => {
|
|
@@ -12171,7 +12255,7 @@ const StyledTextField = styled.div`
|
|
|
12171
12255
|
}}
|
|
12172
12256
|
`;
|
|
12173
12257
|
|
|
12174
|
-
const _excluded = ["aria-label", "aria-labelledby", "autoFocus", "className", "defaultValue", "hasClearButton", "after", "internal", "inputProps", "inputRef", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "label", "leftIcon", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "value", "variant"];
|
|
12258
|
+
const _excluded = ["aria-label", "aria-labelledby", "autoFocus", "className", "defaultValue", "hasClearButton", "after", "internal", "inputProps", "inputRef", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "label", "leftIcon", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "type", "value", "variant"];
|
|
12175
12259
|
const COMPONENT_NAME = 'TextField';
|
|
12176
12260
|
const CLASSNAME = 'redsift-text-field';
|
|
12177
12261
|
const DEFAULT_PROPS = {
|
|
@@ -12209,6 +12293,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12209
12293
|
onClear,
|
|
12210
12294
|
onFocus: onFocusProps,
|
|
12211
12295
|
placeholder,
|
|
12296
|
+
type,
|
|
12212
12297
|
value: propsValue,
|
|
12213
12298
|
variant
|
|
12214
12299
|
} = props,
|
|
@@ -12240,8 +12325,9 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12240
12325
|
}
|
|
12241
12326
|
if (onChange) {
|
|
12242
12327
|
onChange(event.target.value, name, event);
|
|
12328
|
+
} else {
|
|
12329
|
+
setValue(event.target.value);
|
|
12243
12330
|
}
|
|
12244
|
-
setValue(event.target.value);
|
|
12245
12331
|
}, [onChange]);
|
|
12246
12332
|
const handleClear = useCallback(() => {
|
|
12247
12333
|
if (isDisabled || isReadOnly) {
|
|
@@ -12299,7 +12385,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12299
12385
|
onChange: handleChange,
|
|
12300
12386
|
placeholder: placeholder,
|
|
12301
12387
|
ref: inputRef,
|
|
12302
|
-
type:
|
|
12388
|
+
type: type,
|
|
12303
12389
|
value: value
|
|
12304
12390
|
})), hasClearButton || internal || after ? /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
12305
12391
|
className: `${TextField.className}-input-wrapper__toolbar`,
|