@redsift/design-system 9.0.0-alpha.7 → 9.0.0-alpha.9
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 +4 -0
- package/index.js +91 -36
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -832,6 +832,7 @@ interface AppBarProps extends Omit<ComponentProps<'header'>, 'title'> {
|
|
|
832
832
|
title?: string | ReactElement;
|
|
833
833
|
}
|
|
834
834
|
type StyledAppBarProps = AppBarProps & {
|
|
835
|
+
$hasBorder: boolean;
|
|
835
836
|
$isLoaded: boolean;
|
|
836
837
|
$isSidePanelCollapsed: boolean;
|
|
837
838
|
};
|
|
@@ -1842,6 +1843,7 @@ type BaseFocusWithinGroupAction = {
|
|
|
1842
1843
|
type: FocusWithinGroupActionType.FOCUS_ON_LIST;
|
|
1843
1844
|
payload: {
|
|
1844
1845
|
id: TabStop['id'];
|
|
1846
|
+
filter?: FocusWithinGroupState['filter'];
|
|
1845
1847
|
};
|
|
1846
1848
|
} | {
|
|
1847
1849
|
type: FocusWithinGroupActionType.BLUR_ON_LIST;
|
|
@@ -2689,6 +2691,8 @@ interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, Stylin
|
|
|
2689
2691
|
onClear?(): void;
|
|
2690
2692
|
/** Placeholder. */
|
|
2691
2693
|
placeholder?: string;
|
|
2694
|
+
/** Input type. */
|
|
2695
|
+
type?: HTMLInputElement['type'];
|
|
2692
2696
|
/**
|
|
2693
2697
|
* Input value.
|
|
2694
2698
|
* Used for controlled version.
|
package/index.js
CHANGED
|
@@ -1974,7 +1974,12 @@ const StyledAppBar = styled.header`
|
|
|
1974
1974
|
color: var(--redsift-color-neutral-darkgrey);
|
|
1975
1975
|
display: flex;
|
|
1976
1976
|
flex-direction: row;
|
|
1977
|
+
|
|
1977
1978
|
height: 92px;
|
|
1979
|
+
@media (max-width: 1080px) {
|
|
1980
|
+
height: 72px;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1978
1983
|
justify-content: space-between;
|
|
1979
1984
|
left: 0;
|
|
1980
1985
|
position: sticky;
|
|
@@ -1983,21 +1988,32 @@ const StyledAppBar = styled.header`
|
|
|
1983
1988
|
|
|
1984
1989
|
${_ref => {
|
|
1985
1990
|
let {
|
|
1986
|
-
$
|
|
1991
|
+
$hasBorder
|
|
1987
1992
|
} = _ref;
|
|
1993
|
+
return $hasBorder ? css`
|
|
1994
|
+
border-bottom: 2px solid #e1e1e1;
|
|
1995
|
+
` : css`
|
|
1996
|
+
border-bottom: none;
|
|
1997
|
+
`;
|
|
1998
|
+
}}
|
|
1999
|
+
|
|
2000
|
+
${_ref2 => {
|
|
2001
|
+
let {
|
|
2002
|
+
$isSidePanelCollapsed
|
|
2003
|
+
} = _ref2;
|
|
1988
2004
|
return !$isSidePanelCollapsed ? css`
|
|
1989
2005
|
transform: translate(250px);
|
|
1990
|
-
width: calc(
|
|
2006
|
+
width: calc(100vw - 250px);
|
|
1991
2007
|
` : css`
|
|
1992
2008
|
transform: translate(64px);
|
|
1993
2009
|
width: calc(100% - 64px);
|
|
1994
2010
|
`;
|
|
1995
2011
|
}}
|
|
1996
2012
|
|
|
1997
|
-
${
|
|
2013
|
+
${_ref3 => {
|
|
1998
2014
|
let {
|
|
1999
2015
|
$isLoaded
|
|
2000
|
-
} =
|
|
2016
|
+
} = _ref3;
|
|
2001
2017
|
return $isLoaded ? css`
|
|
2002
2018
|
transition: transform 0.25s ease-out, width 0.25s ease-out;
|
|
2003
2019
|
` : '';
|
|
@@ -2214,7 +2230,7 @@ const StyledAppSidePanel = styled.div`
|
|
|
2214
2230
|
align-items: center;
|
|
2215
2231
|
background-color: var(--redsift-side-navigation-color-background);
|
|
2216
2232
|
border-right: 4px solid #e1e1e1;
|
|
2217
|
-
box-sizing:
|
|
2233
|
+
box-sizing: border-box;
|
|
2218
2234
|
flex-direction: column;
|
|
2219
2235
|
height: 100%;
|
|
2220
2236
|
left: 0px;
|
|
@@ -2226,7 +2242,7 @@ const StyledAppSidePanel = styled.div`
|
|
|
2226
2242
|
let {
|
|
2227
2243
|
$variant
|
|
2228
2244
|
} = _ref;
|
|
2229
|
-
return $variant === AppSidePanelVariant.shrinked ? '
|
|
2245
|
+
return $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
|
|
2230
2246
|
}};
|
|
2231
2247
|
z-index: var(--redsift-layout-z-index-side-panel);
|
|
2232
2248
|
|
|
@@ -2241,7 +2257,12 @@ const StyledAppSidePanel = styled.div`
|
|
|
2241
2257
|
}};
|
|
2242
2258
|
margin-bottom: 16px;
|
|
2243
2259
|
width: 100%;
|
|
2260
|
+
|
|
2244
2261
|
height: 92px;
|
|
2262
|
+
@media (max-width: 1080px) {
|
|
2263
|
+
height: 72px;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2245
2266
|
display: grid;
|
|
2246
2267
|
justify-items: start;
|
|
2247
2268
|
align-items: center;
|
|
@@ -2267,11 +2288,18 @@ const StyledAppSidePanel = styled.div`
|
|
|
2267
2288
|
} = _ref3;
|
|
2268
2289
|
return $variant === AppSidePanelVariant.shrinked ? '0' : '1';
|
|
2269
2290
|
}};
|
|
2291
|
+
|
|
2270
2292
|
height: 56px;
|
|
2293
|
+
@media (max-width: 1080px) {
|
|
2294
|
+
height: 36px;
|
|
2295
|
+
}
|
|
2271
2296
|
}
|
|
2272
2297
|
|
|
2273
2298
|
.redsift-app-side-panel-header__logo > img {
|
|
2274
2299
|
max-height: 56px;
|
|
2300
|
+
@media (max-width: 1080px) {
|
|
2301
|
+
max-height: 36px;
|
|
2302
|
+
}
|
|
2275
2303
|
max-width: 195px;
|
|
2276
2304
|
}
|
|
2277
2305
|
|
|
@@ -2359,6 +2387,9 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2359
2387
|
iconButtonRef
|
|
2360
2388
|
} = props,
|
|
2361
2389
|
forwardedProps = _objectWithoutProperties(props, _excluded$F);
|
|
2390
|
+
const {
|
|
2391
|
+
width
|
|
2392
|
+
} = useWindowSize();
|
|
2362
2393
|
const appContainerState = useContext(AppContainerContext);
|
|
2363
2394
|
const stringFormatter = useLocalizedStringFormatter(intlMessages$3);
|
|
2364
2395
|
useEffect(() => {
|
|
@@ -2386,7 +2417,7 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2386
2417
|
}) : product ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
2387
2418
|
icon: ProductLogo[product],
|
|
2388
2419
|
size: {
|
|
2389
|
-
height: 41
|
|
2420
|
+
height: width && width > 1080 ? 41 : 36
|
|
2390
2421
|
}
|
|
2391
2422
|
}) : null), /*#__PURE__*/React__default.createElement(IconButton, _extends$1({
|
|
2392
2423
|
className: `${AppSidePanel.className}-header__expand-button`
|
|
@@ -2452,6 +2483,7 @@ const StyledSideNavigationMenuItemIndicatorContainer = styled.div`
|
|
|
2452
2483
|
min-width: 4px;
|
|
2453
2484
|
`;
|
|
2454
2485
|
const StyledSideNavigationMenuItemIndicator = styled.div`
|
|
2486
|
+
position: relative;
|
|
2455
2487
|
width: 4px;
|
|
2456
2488
|
height: 38px;
|
|
2457
2489
|
border-radius: 0px 4px 4px 0px;
|
|
@@ -2574,7 +2606,7 @@ const StyledSideNavigationMenuItem = styled.a`
|
|
|
2574
2606
|
margin-bottom: 16px;
|
|
2575
2607
|
margin-left: -4px;
|
|
2576
2608
|
transition: padding 300ms ease-out;
|
|
2577
|
-
padding:
|
|
2609
|
+
padding: 0 16px 0 ${$variant === SideNavigationMenuBarVariant.shrinked ? '16px' : '24px'};
|
|
2578
2610
|
|
|
2579
2611
|
.redsift-icon.first {
|
|
2580
2612
|
box-sizing: unset;
|
|
@@ -2861,7 +2893,7 @@ const StyledSideNavigationMenu = styled.div`
|
|
|
2861
2893
|
line-height: var(--redsift-typography-body-line-height);
|
|
2862
2894
|
margin-left: -4px;
|
|
2863
2895
|
transition: padding 300ms ease-out;
|
|
2864
|
-
padding:
|
|
2896
|
+
padding: 0 16px 0 ${$variant === SideNavigationMenuBarVariant.shrinked ? '16px' : '24px'};
|
|
2865
2897
|
text-decoration: none;
|
|
2866
2898
|
text-transform: uppercase;
|
|
2867
2899
|
width: calc(100% + ${$variant === SideNavigationMenuBarVariant.shrinked ? '0px' : '4px'});
|
|
@@ -3924,6 +3956,7 @@ const DEFAULT_PROPS$x = {};
|
|
|
3924
3956
|
* The AppBar component.
|
|
3925
3957
|
*/
|
|
3926
3958
|
const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3959
|
+
var _breadcrumbs$;
|
|
3927
3960
|
const {
|
|
3928
3961
|
breadcrumbs,
|
|
3929
3962
|
children,
|
|
@@ -3934,12 +3967,19 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3934
3967
|
title: propsTitle
|
|
3935
3968
|
} = props,
|
|
3936
3969
|
forwardedProps = _objectWithoutProperties(props, _excluded$w);
|
|
3970
|
+
const [scroll, setScroll] = useState(false);
|
|
3971
|
+
useEffect(() => {
|
|
3972
|
+
window.addEventListener('scroll', () => {
|
|
3973
|
+
setScroll(window.scrollY > 8);
|
|
3974
|
+
});
|
|
3975
|
+
}, []);
|
|
3937
3976
|
const {
|
|
3938
3977
|
isLoaded
|
|
3939
3978
|
} = useIsLoaded();
|
|
3940
3979
|
const appContainerState = useContext(AppContainerContext);
|
|
3941
3980
|
const stringFormatter = useLocalizedStringFormatter(intlMessages$4);
|
|
3942
3981
|
return /*#__PURE__*/React__default.createElement(StyledAppBar, _extends$1({}, forwardedProps, {
|
|
3982
|
+
$hasBorder: scroll,
|
|
3943
3983
|
$isLoaded: isLoaded,
|
|
3944
3984
|
$isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
|
|
3945
3985
|
className: classNames(AppBar.className, className),
|
|
@@ -3965,12 +4005,13 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3965
4005
|
}, propsTitle) : breadcrumbs ? /*#__PURE__*/React__default.createElement(Breadcrumbs, {
|
|
3966
4006
|
"aria-label": "Breadcrumb"
|
|
3967
4007
|
}, appContainerState && appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked ? /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, {
|
|
3968
|
-
href: "/"
|
|
4008
|
+
href: "/",
|
|
4009
|
+
as: ((_breadcrumbs$ = breadcrumbs[0]) === null || _breadcrumbs$ === void 0 ? void 0 : _breadcrumbs$.as) || 'a'
|
|
3969
4010
|
}, ProductName[appContainerState.product]) : null, breadcrumbs.map((breadcrumbItem, index) => /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, _extends$1({
|
|
3970
4011
|
key: index
|
|
3971
4012
|
}, breadcrumbItem, {
|
|
3972
|
-
isDisabled: breadcrumbItem.href === undefined,
|
|
3973
|
-
as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : 'a'
|
|
4013
|
+
isDisabled: breadcrumbItem.isDisabled || breadcrumbItem.href === undefined,
|
|
4014
|
+
as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : breadcrumbItem.as || 'a'
|
|
3974
4015
|
})))) : fallbackTitle ? /*#__PURE__*/React__default.createElement(Heading, {
|
|
3975
4016
|
as: "h1"
|
|
3976
4017
|
}, fallbackTitle) : null), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3985,11 +4026,11 @@ AppBar.displayName = COMPONENT_NAME$x;
|
|
|
3985
4026
|
* Component style.
|
|
3986
4027
|
*/
|
|
3987
4028
|
const StyledAppContent = styled.main`
|
|
4029
|
+
padding: 16px 64px;
|
|
3988
4030
|
${baseContainer}
|
|
3989
4031
|
|
|
3990
4032
|
box-sizing: border-box;
|
|
3991
4033
|
min-height: calc(100vh - 92px);
|
|
3992
|
-
padding: 16px 64px;
|
|
3993
4034
|
|
|
3994
4035
|
@media screen and (max-width: 768px) {
|
|
3995
4036
|
padding: 0px;
|
|
@@ -4000,11 +4041,11 @@ const StyledAppContent = styled.main`
|
|
|
4000
4041
|
$isSidePanelCollapsed
|
|
4001
4042
|
} = _ref;
|
|
4002
4043
|
return !$isSidePanelCollapsed ? css`
|
|
4003
|
-
transform: translate(
|
|
4004
|
-
width: calc(100% -
|
|
4044
|
+
transform: translate(254px);
|
|
4045
|
+
width: calc(100% - 254px);
|
|
4005
4046
|
` : css`
|
|
4006
|
-
transform: translate(
|
|
4007
|
-
width: calc(100% -
|
|
4047
|
+
transform: translate(68px);
|
|
4048
|
+
width: calc(100% - 68px);
|
|
4008
4049
|
`;
|
|
4009
4050
|
}}
|
|
4010
4051
|
|
|
@@ -4132,7 +4173,6 @@ const StyledCard = styled.div`
|
|
|
4132
4173
|
|
|
4133
4174
|
display: flex;
|
|
4134
4175
|
flex-direction: column;
|
|
4135
|
-
padding: 16px;
|
|
4136
4176
|
|
|
4137
4177
|
.redsift-card__header {
|
|
4138
4178
|
align-items: flex-start;
|
|
@@ -5351,7 +5391,7 @@ const StyledDetailedCardSection = styled.div`
|
|
|
5351
5391
|
|
|
5352
5392
|
.redsift-detailed-card-section-header__title {
|
|
5353
5393
|
font-size: 18px;
|
|
5354
|
-
font-weight:
|
|
5394
|
+
font-weight: 500;
|
|
5355
5395
|
lineheight: 22px;
|
|
5356
5396
|
padding: 6px 0px;
|
|
5357
5397
|
}
|
|
@@ -5555,11 +5595,16 @@ const StyledPill = styled.div`
|
|
|
5555
5595
|
|
|
5556
5596
|
padding: 2px 8px;
|
|
5557
5597
|
text-align: center;
|
|
5558
|
-
|
|
5598
|
+
|
|
5599
|
+
${_ref => {
|
|
5559
5600
|
let {
|
|
5560
5601
|
$autoBreak
|
|
5561
5602
|
} = _ref;
|
|
5562
|
-
return
|
|
5603
|
+
return !$autoBreak ? css`
|
|
5604
|
+
text-wrap: nowrap;
|
|
5605
|
+
` : css`
|
|
5606
|
+
word-break: break-word;
|
|
5607
|
+
`;
|
|
5563
5608
|
}};
|
|
5564
5609
|
|
|
5565
5610
|
${_ref2 => {
|
|
@@ -9742,9 +9787,9 @@ const FocusWithinGroupReducer = (state, action) => {
|
|
|
9742
9787
|
const currentTabStop = state.tabStops[index];
|
|
9743
9788
|
return currentTabStop.isDisabled ? _objectSpread2(_objectSpread2({}, state), {}, {
|
|
9744
9789
|
delayedAction: undefined
|
|
9745
|
-
}) : selectTabStop(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
9790
|
+
}, action.payload) : selectTabStop(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
9746
9791
|
delayedAction: undefined
|
|
9747
|
-
}), currentTabStop, undefined, state.focusOnClick);
|
|
9792
|
+
}, action.payload), currentTabStop, undefined, state.focusOnClick);
|
|
9748
9793
|
}
|
|
9749
9794
|
case FocusWithinGroupActionType.BLUR_ON_LIST:
|
|
9750
9795
|
{
|
|
@@ -9777,8 +9822,7 @@ const FocusWithinGroupReducer = (state, action) => {
|
|
|
9777
9822
|
return _objectSpread2(_objectSpread2({}, state), action.payload);
|
|
9778
9823
|
case FocusWithinGroupActionType.FILTER_LIST:
|
|
9779
9824
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
9780
|
-
selectedId: null
|
|
9781
|
-
activedescendant: ['', '']
|
|
9825
|
+
selectedId: null
|
|
9782
9826
|
}, action.payload);
|
|
9783
9827
|
case FocusWithinGroupActionType.DELAY_ACTION:
|
|
9784
9828
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
@@ -10313,17 +10357,26 @@ const StyledGrid = styled.div`
|
|
|
10313
10357
|
return $divider ? css`
|
|
10314
10358
|
overflow: hidden;
|
|
10315
10359
|
.redsift-grid-item {
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10360
|
+
position: relative;
|
|
10361
|
+
|
|
10362
|
+
::before {
|
|
10363
|
+
content: '';
|
|
10364
|
+
position: absolute;
|
|
10365
|
+
background-color: var(--redsift-color-neutral-lightgrey);
|
|
10366
|
+
inline-size: 1px;
|
|
10367
|
+
block-size: 100%;
|
|
10368
|
+
inset-inline-start: calc(${$divider.colGap / 2}px * -1);
|
|
10369
|
+
}
|
|
10319
10370
|
|
|
10320
10371
|
::after {
|
|
10321
10372
|
content: '';
|
|
10373
|
+
position: absolute;
|
|
10322
10374
|
background-color: var(--redsift-color-neutral-lightgrey);
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10375
|
+
inline-size: 100vw;
|
|
10376
|
+
block-size: 1px;
|
|
10377
|
+
inset-inline-start: 0;
|
|
10378
|
+
inset-block-start: calc(${$divider.rowGap / 2}px * -1);
|
|
10379
|
+
z-index: 0;
|
|
10327
10380
|
}
|
|
10328
10381
|
}
|
|
10329
10382
|
` : '';
|
|
@@ -10380,7 +10433,7 @@ const BaseGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10380
10433
|
} = props,
|
|
10381
10434
|
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
10382
10435
|
return /*#__PURE__*/React__default.createElement(StyledGrid, _extends$1({}, forwardedProps, {
|
|
10383
|
-
gap: divider ?
|
|
10436
|
+
gap: divider ? `${divider.rowGap}px ${divider.colGap}px` : gap,
|
|
10384
10437
|
className: classNames(BaseGrid.className, className),
|
|
10385
10438
|
ref: ref,
|
|
10386
10439
|
$divider: divider
|
|
@@ -12199,7 +12252,7 @@ const StyledTextField = styled.div`
|
|
|
12199
12252
|
}}
|
|
12200
12253
|
`;
|
|
12201
12254
|
|
|
12202
|
-
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"];
|
|
12255
|
+
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"];
|
|
12203
12256
|
const COMPONENT_NAME = 'TextField';
|
|
12204
12257
|
const CLASSNAME = 'redsift-text-field';
|
|
12205
12258
|
const DEFAULT_PROPS = {
|
|
@@ -12237,6 +12290,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12237
12290
|
onClear,
|
|
12238
12291
|
onFocus: onFocusProps,
|
|
12239
12292
|
placeholder,
|
|
12293
|
+
type,
|
|
12240
12294
|
value: propsValue,
|
|
12241
12295
|
variant
|
|
12242
12296
|
} = props,
|
|
@@ -12268,8 +12322,9 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12268
12322
|
}
|
|
12269
12323
|
if (onChange) {
|
|
12270
12324
|
onChange(event.target.value, name, event);
|
|
12325
|
+
} else {
|
|
12326
|
+
setValue(event.target.value);
|
|
12271
12327
|
}
|
|
12272
|
-
setValue(event.target.value);
|
|
12273
12328
|
}, [onChange]);
|
|
12274
12329
|
const handleClear = useCallback(() => {
|
|
12275
12330
|
if (isDisabled || isReadOnly) {
|
|
@@ -12327,7 +12382,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12327
12382
|
onChange: handleChange,
|
|
12328
12383
|
placeholder: placeholder,
|
|
12329
12384
|
ref: inputRef,
|
|
12330
|
-
type:
|
|
12385
|
+
type: type,
|
|
12331
12386
|
value: value
|
|
12332
12387
|
})), hasClearButton || internal || after ? /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
12333
12388
|
className: `${TextField.className}-input-wrapper__toolbar`,
|