@redsift/design-system 9.0.0-alpha.6 → 9.0.0-alpha.8

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
@@ -1964,8 +1964,15 @@ declare function useFocusOnList(): UseFocusGroupProps;
1964
1964
  * Component props.
1965
1965
  */
1966
1966
  interface GridProps extends ComponentProps<'div'>, StylingProps, InternalSpacingProps, GridLayoutProps {
1967
+ /** Whether the grid has divider or not. The number of pixels defining the gap between columns and rows is mandatory. This replaces the grid gap property. */
1968
+ divider?: {
1969
+ colGap: number;
1970
+ rowGap: number;
1971
+ };
1967
1972
  }
1968
- type StyledGridProps = GridProps;
1973
+ type StyledGridProps = GridProps & {
1974
+ $divider: GridProps['divider'];
1975
+ };
1969
1976
 
1970
1977
  /**
1971
1978
  * Component props.
@@ -2682,6 +2689,8 @@ interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, Stylin
2682
2689
  onClear?(): void;
2683
2690
  /** Placeholder. */
2684
2691
  placeholder?: string;
2692
+ /** Input type. */
2693
+ type?: HTMLInputElement['type'];
2685
2694
  /**
2686
2695
  * Input value.
2687
2696
  * Used for controlled version.
package/index.js CHANGED
@@ -2214,7 +2214,7 @@ const StyledAppSidePanel = styled.div`
2214
2214
  align-items: center;
2215
2215
  background-color: var(--redsift-side-navigation-color-background);
2216
2216
  border-right: 4px solid #e1e1e1;
2217
- box-sizing: content-box;
2217
+ box-sizing: border-box;
2218
2218
  flex-direction: column;
2219
2219
  height: 100%;
2220
2220
  left: 0px;
@@ -2226,7 +2226,7 @@ const StyledAppSidePanel = styled.div`
2226
2226
  let {
2227
2227
  $variant
2228
2228
  } = _ref;
2229
- return $variant === AppSidePanelVariant.shrinked ? '64px' : '250px';
2229
+ return $variant === AppSidePanelVariant.shrinked ? '68px' : '254px';
2230
2230
  }};
2231
2231
  z-index: var(--redsift-layout-z-index-side-panel);
2232
2232
 
@@ -3924,6 +3924,7 @@ const DEFAULT_PROPS$x = {};
3924
3924
  * The AppBar component.
3925
3925
  */
3926
3926
  const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
3927
+ var _breadcrumbs$;
3927
3928
  const {
3928
3929
  breadcrumbs,
3929
3930
  children,
@@ -3965,12 +3966,13 @@ const AppBar = /*#__PURE__*/forwardRef((props, ref) => {
3965
3966
  }, propsTitle) : breadcrumbs ? /*#__PURE__*/React__default.createElement(Breadcrumbs, {
3966
3967
  "aria-label": "Breadcrumb"
3967
3968
  }, appContainerState && appContainerState.sidePanelVariant === AppSidePanelVariant.shrinked ? /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, {
3968
- href: "/"
3969
+ href: "/",
3970
+ as: ((_breadcrumbs$ = breadcrumbs[0]) === null || _breadcrumbs$ === void 0 ? void 0 : _breadcrumbs$.as) || 'a'
3969
3971
  }, ProductName[appContainerState.product]) : null, breadcrumbs.map((breadcrumbItem, index) => /*#__PURE__*/React__default.createElement(Breadcrumbs.Item, _extends$1({
3970
3972
  key: index
3971
3973
  }, breadcrumbItem, {
3972
- isDisabled: breadcrumbItem.href === undefined,
3973
- as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : 'a'
3974
+ isDisabled: breadcrumbItem.isDisabled || breadcrumbItem.href === undefined,
3975
+ as: index === breadcrumbs.length - 1 ? 'h1' : breadcrumbItem.href === undefined ? 'span' : breadcrumbItem.as || 'a'
3974
3976
  })))) : fallbackTitle ? /*#__PURE__*/React__default.createElement(Heading, {
3975
3977
  as: "h1"
3976
3978
  }, fallbackTitle) : null), /*#__PURE__*/React__default.createElement("div", {
@@ -3985,11 +3987,11 @@ AppBar.displayName = COMPONENT_NAME$x;
3985
3987
  * Component style.
3986
3988
  */
3987
3989
  const StyledAppContent = styled.main`
3990
+ padding: 16px 64px;
3988
3991
  ${baseContainer}
3989
3992
 
3990
3993
  box-sizing: border-box;
3991
3994
  min-height: calc(100vh - 92px);
3992
- padding: 16px 64px;
3993
3995
 
3994
3996
  @media screen and (max-width: 768px) {
3995
3997
  padding: 0px;
@@ -4000,11 +4002,11 @@ const StyledAppContent = styled.main`
4000
4002
  $isSidePanelCollapsed
4001
4003
  } = _ref;
4002
4004
  return !$isSidePanelCollapsed ? css`
4003
- transform: translate(250px);
4004
- width: calc(100% - 250px);
4005
+ transform: translate(254px);
4006
+ width: calc(100% - 254px);
4005
4007
  ` : css`
4006
- transform: translate(64px);
4007
- width: calc(100% - 64px);
4008
+ transform: translate(68px);
4009
+ width: calc(100% - 68px);
4008
4010
  `;
4009
4011
  }}
4010
4012
 
@@ -4132,7 +4134,6 @@ const StyledCard = styled.div`
4132
4134
 
4133
4135
  display: flex;
4134
4136
  flex-direction: column;
4135
- padding: 16px;
4136
4137
 
4137
4138
  .redsift-card__header {
4138
4139
  align-items: flex-start;
@@ -5555,11 +5556,16 @@ const StyledPill = styled.div`
5555
5556
 
5556
5557
  padding: 2px 8px;
5557
5558
  text-align: center;
5558
- word-break: ${_ref => {
5559
+
5560
+ ${_ref => {
5559
5561
  let {
5560
5562
  $autoBreak
5561
5563
  } = _ref;
5562
- return $autoBreak ? 'break-word' : 'normal';
5564
+ return !$autoBreak ? css`
5565
+ text-wrap: nowrap;
5566
+ ` : css`
5567
+ word-break: break-word;
5568
+ `;
5563
5569
  }};
5564
5570
 
5565
5571
  ${_ref2 => {
@@ -10300,10 +10306,44 @@ const StyledGrid = styled.div`
10300
10306
  } = _ref;
10301
10307
  return inline ? 'inline-grid' : 'grid';
10302
10308
  }};
10309
+ flex: 1;
10310
+ max-width: fit-content;
10303
10311
 
10304
10312
  ${baseStyling}
10305
10313
  ${baseInternalSpacing}
10306
10314
  ${baseGrid}
10315
+
10316
+ ${_ref2 => {
10317
+ let {
10318
+ $divider
10319
+ } = _ref2;
10320
+ return $divider ? css`
10321
+ overflow: hidden;
10322
+ .redsift-grid-item {
10323
+ position: relative;
10324
+
10325
+ ::before {
10326
+ content: '';
10327
+ position: absolute;
10328
+ background-color: var(--redsift-color-neutral-lightgrey);
10329
+ inline-size: 1px;
10330
+ block-size: 100%;
10331
+ inset-inline-start: calc(${$divider.colGap / 2}px * -1);
10332
+ }
10333
+
10334
+ ::after {
10335
+ content: '';
10336
+ position: absolute;
10337
+ background-color: var(--redsift-color-neutral-lightgrey);
10338
+ inline-size: 100vw;
10339
+ block-size: 1px;
10340
+ inset-inline-start: 0;
10341
+ inset-block-start: calc(${$divider.rowGap / 2}px * -1);
10342
+ z-index: 0;
10343
+ }
10344
+ }
10345
+ ` : '';
10346
+ }}
10307
10347
  `;
10308
10348
 
10309
10349
  /**
@@ -10339,7 +10379,7 @@ GridItem.className = CLASSNAME$b;
10339
10379
  GridItem.defaultProps = DEFAULT_PROPS$b;
10340
10380
  GridItem.displayName = COMPONENT_NAME$b;
10341
10381
 
10342
- const _excluded$c = ["children", "className"];
10382
+ const _excluded$c = ["children", "className", "divider", "gap"];
10343
10383
  const COMPONENT_NAME$a = 'Grid';
10344
10384
  const CLASSNAME$a = 'redsift-grid';
10345
10385
  const DEFAULT_PROPS$a = {};
@@ -10350,12 +10390,16 @@ const DEFAULT_PROPS$a = {};
10350
10390
  const BaseGrid = /*#__PURE__*/forwardRef((props, ref) => {
10351
10391
  const {
10352
10392
  children,
10353
- className
10393
+ className,
10394
+ divider,
10395
+ gap
10354
10396
  } = props,
10355
10397
  forwardedProps = _objectWithoutProperties(props, _excluded$c);
10356
10398
  return /*#__PURE__*/React__default.createElement(StyledGrid, _extends$1({}, forwardedProps, {
10399
+ gap: divider ? `${divider.rowGap}px ${divider.colGap}px` : gap,
10357
10400
  className: classNames(BaseGrid.className, className),
10358
- ref: ref
10401
+ ref: ref,
10402
+ $divider: divider
10359
10403
  }), children);
10360
10404
  });
10361
10405
  BaseGrid.className = CLASSNAME$a;
@@ -12171,7 +12215,7 @@ const StyledTextField = styled.div`
12171
12215
  }}
12172
12216
  `;
12173
12217
 
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"];
12218
+ 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
12219
  const COMPONENT_NAME = 'TextField';
12176
12220
  const CLASSNAME = 'redsift-text-field';
12177
12221
  const DEFAULT_PROPS = {
@@ -12209,6 +12253,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
12209
12253
  onClear,
12210
12254
  onFocus: onFocusProps,
12211
12255
  placeholder,
12256
+ type,
12212
12257
  value: propsValue,
12213
12258
  variant
12214
12259
  } = props,
@@ -12240,8 +12285,9 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
12240
12285
  }
12241
12286
  if (onChange) {
12242
12287
  onChange(event.target.value, name, event);
12288
+ } else {
12289
+ setValue(event.target.value);
12243
12290
  }
12244
- setValue(event.target.value);
12245
12291
  }, [onChange]);
12246
12292
  const handleClear = useCallback(() => {
12247
12293
  if (isDisabled || isReadOnly) {
@@ -12299,7 +12345,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
12299
12345
  onChange: handleChange,
12300
12346
  placeholder: placeholder,
12301
12347
  ref: inputRef,
12302
- type: "text",
12348
+ type: type,
12303
12349
  value: value
12304
12350
  })), hasClearButton || internal || after ? /*#__PURE__*/React__default.createElement(Flexbox, {
12305
12351
  className: `${TextField.className}-input-wrapper__toolbar`,