@redsift/design-system 9.0.0-alpha.1 → 9.0.0-alpha.3
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 +6 -12
- package/index.js +28 -45
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -914,7 +914,7 @@ interface SideNavigationMenuProps extends ComponentProps<'div'> {
|
|
|
914
914
|
*/
|
|
915
915
|
icon?: IconProps['icon'];
|
|
916
916
|
/** Custom props to pass to the Icon component. */
|
|
917
|
-
iconProps?: Omit<IconProps, 'icon'>;
|
|
917
|
+
iconProps?: Omit<IconProps, 'ref' | 'icon'>;
|
|
918
918
|
/** Custom ref to pass to the Icon component. */
|
|
919
919
|
iconRef?: MutableRefObject<HTMLElement>;
|
|
920
920
|
/** Whether the component is disabled or not. */
|
|
@@ -989,7 +989,7 @@ interface SideNavigationMenuItemProps extends ComponentProps<'a'> {
|
|
|
989
989
|
*/
|
|
990
990
|
icon?: IconProps['icon'];
|
|
991
991
|
/** Custom props to pass to the Icon component. */
|
|
992
|
-
iconProps?: Omit<IconProps, 'icon'>;
|
|
992
|
+
iconProps?: Omit<IconProps, 'ref' | 'icon'>;
|
|
993
993
|
/** Custom ref to pass to the Icon component. */
|
|
994
994
|
iconRef?: RefObject<HTMLElement>;
|
|
995
995
|
/** Whether the component is active or not. */
|
|
@@ -1087,12 +1087,6 @@ type AppContainerState = {
|
|
|
1087
1087
|
collapseSidePanel(): void;
|
|
1088
1088
|
/** Expandes the side panel. */
|
|
1089
1089
|
expandSidePanel(): void;
|
|
1090
|
-
/** Whether the container contains an AppBar or not. */
|
|
1091
|
-
hasAppBar: boolean;
|
|
1092
|
-
/** Whether the container contains an AppSidePanel or not. */
|
|
1093
|
-
hasAppSidePanel: boolean;
|
|
1094
|
-
/** Whether the container contains an AppContent or not. */
|
|
1095
|
-
hasAppContent: boolean;
|
|
1096
1090
|
/** Product theme. */
|
|
1097
1091
|
product?: AppContainerProps['product'];
|
|
1098
1092
|
/** Set breadcrumbs of the page. */
|
|
@@ -1128,8 +1122,6 @@ declare const AppContainer: Comp<AppContainerProps, HTMLDivElement>;
|
|
|
1128
1122
|
* Component props.
|
|
1129
1123
|
*/
|
|
1130
1124
|
interface AppContentProps extends ComponentProps<'main'>, StylingProps, ContainerProps {
|
|
1131
|
-
/** Product theme to apply to everything within. This overrides the CSS variables automatically. */
|
|
1132
|
-
product?: Product;
|
|
1133
1125
|
}
|
|
1134
1126
|
type StyledAppContentProps = Omit<AppContentProps, 'product'> & {
|
|
1135
1127
|
$isLoaded: boolean;
|
|
@@ -1372,11 +1364,11 @@ declare const Heading: Comp<HeadingProps, HTMLDivElement>;
|
|
|
1372
1364
|
/**
|
|
1373
1365
|
* Component props.
|
|
1374
1366
|
*/
|
|
1375
|
-
interface CardHeaderProps extends ComponentProps<'div'> {
|
|
1367
|
+
interface CardHeaderProps extends ComponentProps<'div'>, StylingProps, Omit<FlexLayoutProps, 'inline'> {
|
|
1376
1368
|
/** Header. */
|
|
1377
1369
|
header?: string;
|
|
1378
1370
|
/** Heading props allowing to override the component rendered by the heading without changing its style. */
|
|
1379
|
-
headingProps?: Pick<HeadingProps, 'as' | 'noWrap'>;
|
|
1371
|
+
headingProps?: Pick<HeadingProps, 'as' | 'noWrap' | 'variant'>;
|
|
1380
1372
|
/** Subheader */
|
|
1381
1373
|
subheader?: string;
|
|
1382
1374
|
/**
|
|
@@ -1384,6 +1376,8 @@ interface CardHeaderProps extends ComponentProps<'div'> {
|
|
|
1384
1376
|
* Can also be a ReactElement.
|
|
1385
1377
|
*/
|
|
1386
1378
|
icon?: IconProps['icon'];
|
|
1379
|
+
/** Custom props to pass to the Icon component. */
|
|
1380
|
+
iconProps?: Omit<IconProps, 'ref' | 'icon'>;
|
|
1387
1381
|
/** Whether the card is loading or not. */
|
|
1388
1382
|
isLoading?: boolean;
|
|
1389
1383
|
}
|
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, 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';
|
|
@@ -40,14 +40,14 @@ const ProductName = {
|
|
|
40
40
|
website: 'Website'
|
|
41
41
|
};
|
|
42
42
|
const ProductLogo = {
|
|
43
|
-
asm:
|
|
44
|
-
'brand-trust':
|
|
45
|
-
certificates:
|
|
46
|
-
ondmarc:
|
|
47
|
-
radar:
|
|
48
|
-
'rojo-ds':
|
|
49
|
-
'vendor-secure':
|
|
50
|
-
website:
|
|
43
|
+
asm: rsiAsmHorizontal,
|
|
44
|
+
'brand-trust': rsiBrandTrustHorizontal,
|
|
45
|
+
certificates: rsiCertificatesHorizontal,
|
|
46
|
+
ondmarc: rsiOndmarcHorizontal,
|
|
47
|
+
radar: rsiRadarHorizontal,
|
|
48
|
+
'rojo-ds': rsiRojoDsHorizontal,
|
|
49
|
+
'vendor-secure': rsiVendorSecureHorizontal,
|
|
50
|
+
website: rsiRedSiftHorizontal
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -1976,7 +1976,7 @@ const StyledAppBar = styled.header`
|
|
|
1976
1976
|
height: 92px;
|
|
1977
1977
|
justify-content: space-between;
|
|
1978
1978
|
left: 0;
|
|
1979
|
-
position:
|
|
1979
|
+
position: sticky;
|
|
1980
1980
|
top: 0;
|
|
1981
1981
|
z-index: var(--redsift-layout-z-index-header);
|
|
1982
1982
|
|
|
@@ -2386,7 +2386,7 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2386
2386
|
size: {
|
|
2387
2387
|
height: 41
|
|
2388
2388
|
}
|
|
2389
|
-
}) : null),
|
|
2389
|
+
}) : null), /*#__PURE__*/React__default.createElement(IconButton, _extends$1({
|
|
2390
2390
|
className: `${AppSidePanel.className}-header__expand-button`
|
|
2391
2391
|
}, iconButtonProps, {
|
|
2392
2392
|
"aria-label": stringFormatter.format('expand'),
|
|
@@ -2395,7 +2395,7 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2395
2395
|
ref: iconButtonRef,
|
|
2396
2396
|
color: "question",
|
|
2397
2397
|
isDisabled: computedVariant === 'standard'
|
|
2398
|
-
}))
|
|
2398
|
+
}))), featuredElements ? /*#__PURE__*/React__default.createElement("div", {
|
|
2399
2399
|
className: `${AppSidePanel.className}__featured`
|
|
2400
2400
|
}, featuredElements) : null, children);
|
|
2401
2401
|
});
|
|
@@ -3037,21 +3037,6 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3037
3037
|
product
|
|
3038
3038
|
} = props,
|
|
3039
3039
|
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
3040
|
const [sidePanelVariant, setSidePanelVariant] = useState(AppSidePanelVariant.standard);
|
|
3056
3041
|
const [breadcrumbs, setBreadcrumbs] = useState();
|
|
3057
3042
|
const state = {
|
|
@@ -3061,9 +3046,6 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3061
3046
|
expandSidePanel() {
|
|
3062
3047
|
setSidePanelVariant(AppSidePanelVariant.standard);
|
|
3063
3048
|
},
|
|
3064
|
-
hasAppBar,
|
|
3065
|
-
hasAppSidePanel,
|
|
3066
|
-
hasAppContent,
|
|
3067
3049
|
setBreadcrumbs(breadcrumbs) {
|
|
3068
3050
|
setBreadcrumbs(breadcrumbs);
|
|
3069
3051
|
},
|
|
@@ -3991,7 +3973,6 @@ const StyledAppContent = styled.main`
|
|
|
3991
3973
|
${baseContainer}
|
|
3992
3974
|
|
|
3993
3975
|
box-sizing: border-box;
|
|
3994
|
-
margin-top: 92px;
|
|
3995
3976
|
min-height: calc(100vh - 92px);
|
|
3996
3977
|
padding: 16px 64px;
|
|
3997
3978
|
|
|
@@ -4022,7 +4003,7 @@ const StyledAppContent = styled.main`
|
|
|
4022
4003
|
}}
|
|
4023
4004
|
`;
|
|
4024
4005
|
|
|
4025
|
-
const _excluded$v = ["children", "className"
|
|
4006
|
+
const _excluded$v = ["children", "className"];
|
|
4026
4007
|
const COMPONENT_NAME$w = 'AppContent';
|
|
4027
4008
|
const CLASSNAME$w = 'redsift-app-content';
|
|
4028
4009
|
const DEFAULT_PROPS$w = {};
|
|
@@ -4033,8 +4014,7 @@ const DEFAULT_PROPS$w = {};
|
|
|
4033
4014
|
const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
4034
4015
|
const {
|
|
4035
4016
|
children,
|
|
4036
|
-
className
|
|
4037
|
-
product
|
|
4017
|
+
className
|
|
4038
4018
|
} = props,
|
|
4039
4019
|
forwardedProps = _objectWithoutProperties(props, _excluded$v);
|
|
4040
4020
|
const {
|
|
@@ -4044,7 +4024,6 @@ const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4044
4024
|
return /*#__PURE__*/React__default.createElement(StyledAppContent, _extends$1({}, forwardedProps, {
|
|
4045
4025
|
$isLoaded: isLoaded,
|
|
4046
4026
|
$isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
|
|
4047
|
-
$product: product,
|
|
4048
4027
|
className: classNames(AppContent.className, className),
|
|
4049
4028
|
ref: ref
|
|
4050
4029
|
}), children);
|
|
@@ -4183,6 +4162,12 @@ const StyledCard = styled.div`
|
|
|
4183
4162
|
* Component style.
|
|
4184
4163
|
*/
|
|
4185
4164
|
const StyledCardHeader = styled.div`
|
|
4165
|
+
display: flex;
|
|
4166
|
+
flex-direction: column;
|
|
4167
|
+
width: 100%;
|
|
4168
|
+
${baseStyling}
|
|
4169
|
+
${baseFlexbox}
|
|
4170
|
+
|
|
4186
4171
|
color: var(--redsift-color-neutral-black);
|
|
4187
4172
|
|
|
4188
4173
|
.redsift-card-header__header {
|
|
@@ -4194,10 +4179,6 @@ const StyledCardHeader = styled.div`
|
|
|
4194
4179
|
|
|
4195
4180
|
.redsift-icon {
|
|
4196
4181
|
color: var(--redsift-color-neutral-black);
|
|
4197
|
-
padding-right: 8px;
|
|
4198
|
-
font-size: 30px;
|
|
4199
|
-
line-height: 30px;
|
|
4200
|
-
height: 30px;
|
|
4201
4182
|
}
|
|
4202
4183
|
}
|
|
4203
4184
|
|
|
@@ -4438,7 +4419,7 @@ const Skeleton = Object.assign(BaseSkeleton, {
|
|
|
4438
4419
|
Text: SkeletonText
|
|
4439
4420
|
});
|
|
4440
4421
|
|
|
4441
|
-
const _excluded$q = ["children", "className", "header", "headingProps", "icon", "isLoading", "subheader"];
|
|
4422
|
+
const _excluded$q = ["children", "className", "header", "headingProps", "icon", "iconProps", "isLoading", "subheader"];
|
|
4442
4423
|
const COMPONENT_NAME$r = 'CardHeader';
|
|
4443
4424
|
const CLASSNAME$r = 'redsift-card-header';
|
|
4444
4425
|
const DEFAULT_PROPS$r = {};
|
|
@@ -4453,6 +4434,7 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4453
4434
|
header,
|
|
4454
4435
|
headingProps,
|
|
4455
4436
|
icon,
|
|
4437
|
+
iconProps,
|
|
4456
4438
|
isLoading,
|
|
4457
4439
|
subheader
|
|
4458
4440
|
} = props,
|
|
@@ -4466,7 +4448,7 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4466
4448
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4467
4449
|
className: `${CardHeader.className}__subheader`
|
|
4468
4450
|
}, subheader)) : null, header ? /*#__PURE__*/React__default.createElement(Skeleton.Text, {
|
|
4469
|
-
variant:
|
|
4451
|
+
variant: (headingProps === null || headingProps === void 0 ? void 0 : headingProps.variant) || 'h2',
|
|
4470
4452
|
isLoaded: !isLoading,
|
|
4471
4453
|
marginTop: "10px",
|
|
4472
4454
|
marginBottom: "10px"
|
|
@@ -4475,10 +4457,11 @@ const CardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4475
4457
|
color: "black",
|
|
4476
4458
|
className: `${CardHeader.className}__header`,
|
|
4477
4459
|
variant: "h2"
|
|
4478
|
-
}, headingProps), icon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
4460
|
+
}, headingProps), icon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
|
|
4479
4461
|
icon: icon,
|
|
4480
|
-
"aria-hidden": "true"
|
|
4481
|
-
|
|
4462
|
+
"aria-hidden": "true",
|
|
4463
|
+
size: "large"
|
|
4464
|
+
}, iconProps)) : null, header)) : null, children);
|
|
4482
4465
|
});
|
|
4483
4466
|
CardHeader.className = CLASSNAME$r;
|
|
4484
4467
|
CardHeader.defaultProps = DEFAULT_PROPS$r;
|