@redsift/design-system 10.5.0 → 10.6.0

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 CHANGED
@@ -2109,6 +2109,7 @@ type StyledAppBarProps = AppBarProps & {
2109
2109
  $hasBorder: boolean;
2110
2110
  $isLoaded: boolean;
2111
2111
  $isSidePanelCollapsed: boolean;
2112
+ $isAppFullScreen: boolean;
2112
2113
  $theme: AppBarProps['theme'];
2113
2114
  };
2114
2115
 
@@ -2123,6 +2124,7 @@ declare const AppBar: Comp<AppBarProps, HTMLHeadingElement>;
2123
2124
  declare const AppSidePanelVariant: {
2124
2125
  readonly shrinked: "shrinked";
2125
2126
  readonly standard: "standard";
2127
+ readonly hidden: "hidden";
2126
2128
  };
2127
2129
  type AppSidePanelVariant = ValueOf<typeof AppSidePanelVariant>;
2128
2130
  /**
@@ -2392,11 +2394,15 @@ type AppContainerState = {
2392
2394
  setSidePanelVariant: Dispatch<SetStateAction<AppSidePanelVariant>>;
2393
2395
  /** AppContainer ref. */
2394
2396
  appContainerRef: RefObject<HTMLDivElement>;
2397
+ /** Whether the App takes the entire screen or not. */
2398
+ isFullScreen?: boolean;
2395
2399
  };
2396
2400
  /**
2397
2401
  * Component props.
2398
2402
  */
2399
2403
  interface AppContainerProps extends ComponentProps<'div'> {
2404
+ /** Whether the App takes the entire screen or not. */
2405
+ isFullScreen?: boolean;
2400
2406
  /** The locale to apply to the children. */
2401
2407
  locale?: string;
2402
2408
  /** Product theme to apply to everything within. This overrides the CSS variables automatically. */
@@ -2430,6 +2436,7 @@ interface AppContentProps extends ComponentProps<'main'>, StylingProps, Containe
2430
2436
  type StyledAppContentProps = Omit<AppContentProps, 'product'> & {
2431
2437
  $isLoaded: boolean;
2432
2438
  $isSidePanelCollapsed: boolean;
2439
+ $isAppFullScreen: boolean;
2433
2440
  $theme: AppContentProps['theme'];
2434
2441
  };
2435
2442
 
package/index.js CHANGED
@@ -5896,22 +5896,34 @@ const StyledAppBar = styled.header`
5896
5896
  display: flex;
5897
5897
  flex-direction: row;
5898
5898
 
5899
- height: 92px;
5900
- @media (max-width: 1080px) {
5901
- height: 72px;
5902
- }
5899
+ ${_ref2 => {
5900
+ let {
5901
+ $isAppFullScreen
5902
+ } = _ref2;
5903
+ return !$isAppFullScreen ? css`
5904
+ height: 92px;
5905
+ @media (max-width: 1080px) {
5906
+ height: 72px;
5907
+ }
5908
+ ` : css`
5909
+ height: 0;
5910
+ visibility: hidden;
5911
+ @media (max-width: 1080px) {
5912
+ height: 0;
5913
+ }
5914
+ `;
5915
+ }}
5903
5916
 
5904
5917
  justify-content: space-between;
5905
5918
  left: 0;
5906
5919
  position: sticky;
5907
5920
  top: 0;
5908
- z-index: var(--redsift-layout-z-index-header);
5909
5921
 
5910
- ${_ref2 => {
5922
+ ${_ref3 => {
5911
5923
  let {
5912
5924
  $hasBorder,
5913
5925
  $theme
5914
- } = _ref2;
5926
+ } = _ref3;
5915
5927
  return $hasBorder ? css`
5916
5928
  border-bottom: 2px solid var(--redsift-color-${$theme}-components-app-bar-border);
5917
5929
  ` : css`
@@ -5919,11 +5931,14 @@ const StyledAppBar = styled.header`
5919
5931
  `;
5920
5932
  }}
5921
5933
 
5922
- ${_ref3 => {
5934
+ ${_ref4 => {
5923
5935
  let {
5924
- $isSidePanelCollapsed
5925
- } = _ref3;
5926
- return !$isSidePanelCollapsed ? css`
5936
+ $isSidePanelCollapsed,
5937
+ $isAppFullScreen
5938
+ } = _ref4;
5939
+ return $isAppFullScreen ? css`
5940
+ width: calc(100%);
5941
+ ` : !$isSidePanelCollapsed ? css`
5927
5942
  transform: translate(254px);
5928
5943
  width: calc(100% - 254px);
5929
5944
  ` : css`
@@ -5932,12 +5947,12 @@ const StyledAppBar = styled.header`
5932
5947
  `;
5933
5948
  }}
5934
5949
 
5935
- ${_ref4 => {
5950
+ ${_ref5 => {
5936
5951
  let {
5937
5952
  $isLoaded
5938
- } = _ref4;
5953
+ } = _ref5;
5939
5954
  return $isLoaded ? css`
5940
- transition: transform 0.25s ease-out, width 0.25s ease-out;
5955
+ transition: transform 0.25s ease-out, width 0.25s ease-out, height 0.25s ease-out, visibility 0.25s ease-out;
5941
5956
  ` : '';
5942
5957
  }}
5943
5958
 
@@ -5982,10 +5997,10 @@ const StyledAppBar = styled.header`
5982
5997
  font-size: var(--redsift-typography-h1-font-size) !important;
5983
5998
  font-weight: var(--redsift-typography-body-font-weight) !important;
5984
5999
  line-height: var(--redsift-typography-h1-line-height) !important;
5985
- color: ${_ref5 => {
6000
+ color: ${_ref6 => {
5986
6001
  let {
5987
6002
  $theme
5988
- } = _ref5;
6003
+ } = _ref6;
5989
6004
  return css`var(--redsift-color-${$theme}-components-app-bar-breadcrumb-default) !important`;
5990
6005
  }};
5991
6006
  }
@@ -6126,7 +6141,8 @@ Heading.displayName = COMPONENT_NAME$L;
6126
6141
  */
6127
6142
  const AppSidePanelVariant = {
6128
6143
  shrinked: 'shrinked',
6129
- standard: 'standard'
6144
+ standard: 'standard',
6145
+ hidden: 'hidden'
6130
6146
  };
6131
6147
 
6132
6148
  /**
@@ -6181,18 +6197,19 @@ const StyledAppSidePanel = styled.div`
6181
6197
  let {
6182
6198
  $variant
6183
6199
  } = _ref3;
6184
- return $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
6200
+ return $variant === AppSidePanelVariant.hidden ? '0' : $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
6185
6201
  }};
6186
6202
  z-index: var(--redsift-layout-z-index-side-panel);
6187
6203
 
6188
6204
  .redsift-app-side-panel__header {
6189
6205
  box-sizing: border-box;
6190
6206
  transition: padding 300ms ease-out;
6191
- padding: 18px ${_ref4 => {
6207
+ padding: 18px
6208
+ ${_ref4 => {
6192
6209
  let {
6193
6210
  $variant
6194
6211
  } = _ref4;
6195
- return $variant === AppSidePanelVariant.shrinked ? '16px' : '24px';
6212
+ return $variant === AppSidePanelVariant.hidden ? '0' : $variant === AppSidePanelVariant.shrinked ? '16px' : '24px';
6196
6213
  }};
6197
6214
  margin-bottom: 16px;
6198
6215
  width: 100%;
@@ -6346,7 +6363,7 @@ const AppSidePanel = /*#__PURE__*/forwardRef((props, ref) => {
6346
6363
  logo,
6347
6364
  onOpen,
6348
6365
  theme: propsTheme,
6349
- variant = AppSidePanelVariant.standard
6366
+ variant
6350
6367
  } = props,
6351
6368
  forwardedProps = _objectWithoutProperties(props, _excluded$O);
6352
6369
  const {
@@ -7071,7 +7088,7 @@ const StyledAppContainer = styled.div`
7071
7088
  }};
7072
7089
  `;
7073
7090
 
7074
- const _excluded$L = ["children", "className", "locale", "product", "theme"];
7091
+ const _excluded$L = ["children", "className", "locale", "product", "theme", "isFullScreen"];
7075
7092
  const COMPONENT_NAME$H = 'AppContainer';
7076
7093
  const CLASSNAME$H = 'redsift-app-container';
7077
7094
  const RadarSvgLinearGradient = () => /*#__PURE__*/React__default.createElement("svg", {
@@ -7126,12 +7143,20 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
7126
7143
  className,
7127
7144
  locale,
7128
7145
  product,
7129
- theme: propsTheme
7146
+ theme: propsTheme,
7147
+ isFullScreen = false
7130
7148
  } = props,
7131
7149
  forwardedProps = _objectWithoutProperties(props, _excluded$L);
7132
7150
  const theme = useTheme(propsTheme);
7133
- const [sidePanelVariant, setSidePanelVariant] = useState(AppSidePanelVariant.standard);
7151
+ const [sidePanelVariant, setSidePanelVariant] = useState(isFullScreen ? AppSidePanelVariant.hidden : AppSidePanelVariant.standard);
7134
7152
  const [breadcrumbs, setBreadcrumbs] = useState();
7153
+ useEffect(() => {
7154
+ if (isFullScreen && sidePanelVariant !== AppSidePanelVariant.hidden) {
7155
+ setSidePanelVariant(AppSidePanelVariant.hidden);
7156
+ } else if (!isFullScreen && sidePanelVariant !== AppSidePanelVariant.standard) {
7157
+ setSidePanelVariant(AppSidePanelVariant.standard);
7158
+ }
7159
+ }, [isFullScreen]);
7135
7160
  const state = {
7136
7161
  collapseSidePanel() {
7137
7162
  setSidePanelVariant(AppSidePanelVariant.shrinked);
@@ -7146,7 +7171,8 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
7146
7171
  breadcrumbs,
7147
7172
  sidePanelVariant,
7148
7173
  setSidePanelVariant,
7149
- appContainerRef: divRef
7174
+ appContainerRef: divRef,
7175
+ isFullScreen
7150
7176
  };
7151
7177
  return /*#__PURE__*/React__default.createElement(StyledAppContainer, _extends$1({}, forwardedProps, {
7152
7178
  id: "redsift-app-container",
@@ -7630,14 +7656,14 @@ const SideNavigationMenuBar = /*#__PURE__*/forwardRef((props, ref) => {
7630
7656
  const {
7631
7657
  top
7632
7658
  } = useBoundingClientRect(navRef, [children]);
7633
- const [variant, setVariant] = useState(appContainerState ? appContainerState.sidePanelVariant : propsVariant);
7659
+ const [variant, setVariant] = useState(appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden ? SideNavigationMenuBarVariant.shrinked : appContainerState.sidePanelVariant : propsVariant);
7634
7660
  const [currentOpenMenuId, setCurrentOpenMenuId] = useState();
7635
7661
  useEffect(() => {
7636
7662
  setVariant(propsVariant);
7637
7663
  }, [propsVariant]);
7638
7664
  useEffect(() => {
7639
7665
  if (appContainerState && appContainerState.sidePanelVariant && appContainerState.sidePanelVariant !== variant) {
7640
- setVariant(appContainerState.sidePanelVariant);
7666
+ setVariant(appContainerState.sidePanelVariant === AppSidePanelVariant.hidden ? SideNavigationMenuBarVariant.shrinked : appContainerState.sidePanelVariant);
7641
7667
  }
7642
7668
  }, [appContainerState === null || appContainerState === void 0 ? void 0 : appContainerState.sidePanelVariant]);
7643
7669
 
@@ -8069,6 +8095,7 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
8069
8095
  $hasBorder: scroll,
8070
8096
  $isLoaded: isLoaded,
8071
8097
  $isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
8098
+ $isAppFullScreen: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden : false,
8072
8099
  $theme: theme,
8073
8100
  className: classNames(AppBar.className, className),
8074
8101
  ref: ref
@@ -8133,9 +8160,13 @@ const StyledAppContent = styled.main`
8133
8160
 
8134
8161
  ${_ref2 => {
8135
8162
  let {
8136
- $isSidePanelCollapsed
8163
+ $isSidePanelCollapsed,
8164
+ $isAppFullScreen
8137
8165
  } = _ref2;
8138
- return !$isSidePanelCollapsed ? css`
8166
+ return $isAppFullScreen ? css`
8167
+ transform: translate(0px);
8168
+ width: calc(100%);
8169
+ ` : !$isSidePanelCollapsed ? css`
8139
8170
  transform: translate(254px);
8140
8171
  width: calc(100% - 254px);
8141
8172
  ` : css`
@@ -8176,6 +8207,7 @@ const AppContent = /*#__PURE__*/forwardRef((props, ref) => {
8176
8207
  return /*#__PURE__*/React__default.createElement(StyledAppContent, _extends$1({}, forwardedProps, {
8177
8208
  $isLoaded: isLoaded,
8178
8209
  $isSidePanelCollapsed: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked : true,
8210
+ $isAppFullScreen: appContainerState ? appContainerState.sidePanelVariant === AppSidePanelVariant.hidden : false,
8179
8211
  $theme: theme,
8180
8212
  className: classNames(AppContent.className, className),
8181
8213
  ref: ref