@redsift/design-system 7.6.0 → 7.7.0-alpha.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
@@ -925,7 +925,7 @@ interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, P
925
925
  /** Whether the badge should automatically break content. */
926
926
  autoBreak?: boolean;
927
927
  /** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */
928
- color?: ColorPalette | ProductColorPalette;
928
+ color?: ColorPalette | DataVizColorPalette | ProductColorPalette;
929
929
  /** Whether the Badge has its colors reversed or not. */
930
930
  isReversed?: boolean;
931
931
  /** Badge variant. */
@@ -1597,8 +1597,12 @@ declare const DetailedCardSectionItem: Comp<DetailedCardSectionItemProps, HTMLDi
1597
1597
  interface DetailedCardCollapsibleSectionItemsProps extends ComponentProps<'div'> {
1598
1598
  /** Small caption at the bottom right corner of the collapsible area. */
1599
1599
  caption?: string;
1600
+ /** Whether the background should be hidden or not. */
1601
+ hideBackground?: boolean;
1600
1602
  }
1601
- type StyledDetailedCardCollapsibleSectionItemsProps = DetailedCardCollapsibleSectionItemsProps & {};
1603
+ type StyledDetailedCardCollapsibleSectionItemsProps = Omit<DetailedCardCollapsibleSectionItemsProps, 'hideBackground'> & {
1604
+ $hideBackground: DetailedCardCollapsibleSectionItemsProps['hideBackground'];
1605
+ };
1602
1606
 
1603
1607
  /**
1604
1608
  * The DetailedCardCollapsibleSectionItems Section component.
@@ -1627,6 +1631,8 @@ declare const DetailedCardHeader: Comp<DetailedCardHeaderProps, HTMLDivElement>;
1627
1631
  * Component props.
1628
1632
  */
1629
1633
  interface DetailedCardSectionProps extends ComponentProps<'div'> {
1634
+ /** Props to pass to the badge displayed next to the title. */
1635
+ badge?: Omit<BadgeProps, 'ref'>;
1630
1636
  /** Header. */
1631
1637
  header?: string;
1632
1638
  /** Whether the section is collapsed or not. */
package/index.js CHANGED
@@ -2362,15 +2362,14 @@ const StyledBadge = styled.div`
2362
2362
 
2363
2363
  &,
2364
2364
  .redsift-icon {
2365
- color: var(--redsift-color-${$color}-primary);
2365
+ color: ${Object.keys(DataVizColorPalette).includes($color) ? `var(--redsift-data-viz-color-${$color}-darker);` : `var(--redsift-color-${$color}-primary);`};
2366
2366
  }
2367
2367
  `;
2368
2368
  } else {
2369
2369
  return css`
2370
- background-color: var(--redsift-color-${$color}-primary);
2371
-
2372
- &,
2373
- .redsift-icon {
2370
+ background-color: ${Object.keys(DataVizColorPalette).includes($color) ? `var(--redsift-data-viz-color-${$color}-darker);` : `var(--redsift-color-${$color}-primary);`}
2371
+ &,
2372
+ .redsift-icon {
2374
2373
  color: var(--redsift-color-neutral-white);
2375
2374
  }
2376
2375
  `;
@@ -4682,9 +4681,18 @@ var intlMessages = {
4682
4681
  * Component style.
4683
4682
  */
4684
4683
  const StyledDetailedCardCollapsibleSectionItems = styled.div`
4685
- background-color: var(--redsift-color-neutral-xlightgrey);
4686
- margin: 8px -16px;
4687
- padding: 8px 16px;
4684
+ ${_ref => {
4685
+ let {
4686
+ $hideBackground
4687
+ } = _ref;
4688
+ return $hideBackground ? css`
4689
+ background: none;
4690
+ ` : css`
4691
+ background-color: var(--redsift-color-neutral-xlightgrey);
4692
+ margin: 8px -16px;
4693
+ padding: 8px 16px;
4694
+ `;
4695
+ }}
4688
4696
 
4689
4697
  .redsift-detailed-card-collapsible-section-items__caption {
4690
4698
  color: var(--redsift-color-neutral-black);
@@ -4698,7 +4706,7 @@ const StyledDetailedCardCollapsibleSectionItems = styled.div`
4698
4706
  }
4699
4707
  `;
4700
4708
 
4701
- const _excluded$f = ["caption", "children", "className"];
4709
+ const _excluded$f = ["caption", "children", "className", "hideBackground"];
4702
4710
  const COMPONENT_NAME$i = 'DetailedCardCollapsibleSectionItems';
4703
4711
  const CLASSNAME$i = 'redsift-detailed-card-collapsible-section-items';
4704
4712
  const DEFAULT_PROPS$i = {};
@@ -4710,12 +4718,14 @@ const DetailedCardCollapsibleSectionItems = /*#__PURE__*/forwardRef((props, ref)
4710
4718
  const {
4711
4719
  caption,
4712
4720
  children,
4713
- className
4721
+ className,
4722
+ hideBackground
4714
4723
  } = props,
4715
4724
  forwardedProps = _objectWithoutProperties(props, _excluded$f);
4716
4725
  return /*#__PURE__*/React__default.createElement(StyledDetailedCardCollapsibleSectionItems, _extends$1({}, forwardedProps, {
4717
4726
  className: classNames(DetailedCardCollapsibleSectionItems.className, className),
4718
- ref: ref
4727
+ ref: ref,
4728
+ $hideBackground: hideBackground
4719
4729
  }), children, caption ? /*#__PURE__*/React__default.createElement("div", {
4720
4730
  className: `${DetailedCardCollapsibleSectionItems.className}__caption`
4721
4731
  }, caption) : null);
@@ -4763,17 +4773,14 @@ const StyledDetailedCardSection = styled.div`
4763
4773
  } = _ref3;
4764
4774
  return !$isCollapsed ? 'auto' : '0px';
4765
4775
  }};
4766
- margin: ${_ref4 => {
4776
+ ${_ref4 => {
4767
4777
  let {
4768
4778
  $isCollapsed
4769
4779
  } = _ref4;
4770
- return !$isCollapsed ? '8px -16px' : 'unset';
4771
- }};
4772
- padding: ${_ref5 => {
4773
- let {
4774
- $isCollapsed
4775
- } = _ref5;
4776
- return !$isCollapsed ? '8px 16px' : 'unset';
4780
+ return $isCollapsed ? css`
4781
+ margin: unset;
4782
+ padding: unset;
4783
+ ` : '';
4777
4784
  }};
4778
4785
  }
4779
4786
  `;
@@ -4936,7 +4943,7 @@ Text.className = CLASSNAME$h;
4936
4943
  Text.defaultProps = DEFAULT_PROPS$h;
4937
4944
  Text.displayName = COMPONENT_NAME$h;
4938
4945
 
4939
- const _excluded$d = ["children", "className", "header", "isCollapsed", "isCollapsible", "isLoading"];
4946
+ const _excluded$d = ["badge", "children", "className", "header", "isCollapsed", "isCollapsible", "isLoading"];
4940
4947
  const COMPONENT_NAME$g = 'DetailedCardSection';
4941
4948
  const CLASSNAME$g = 'redsift-detailed-card-section';
4942
4949
  const DEFAULT_PROPS$g = {
@@ -4957,6 +4964,7 @@ const hasCollapsibleChildren = children => {
4957
4964
  */
4958
4965
  const DetailedCardSection = /*#__PURE__*/forwardRef((props, ref) => {
4959
4966
  const {
4967
+ badge,
4960
4968
  children,
4961
4969
  className,
4962
4970
  header,
@@ -4982,13 +4990,18 @@ const DetailedCardSection = /*#__PURE__*/forwardRef((props, ref) => {
4982
4990
  lineHeight: "22px",
4983
4991
  marginTop: "6px",
4984
4992
  marginBottom: "12px"
4993
+ }, /*#__PURE__*/React__default.createElement(Flexbox, {
4994
+ alignItems: "center",
4995
+ gap: "8px"
4985
4996
  }, /*#__PURE__*/React__default.createElement(Text, {
4986
4997
  className: `${DetailedCardSection.className}-header__title`,
4987
4998
  color: "black",
4988
4999
  fontFamily: "raleway",
4989
5000
  fontSize: "18px",
4990
5001
  lineHeight: "22px"
4991
- }, header)) : null, isCollapsible && !isLoading ? /*#__PURE__*/React__default.createElement(IconButton, {
5002
+ }, header), badge ? /*#__PURE__*/React__default.createElement(Badge, _extends$1({
5003
+ variant: BadgeVariant.standard
5004
+ }, badge)) : null)) : null, isCollapsible && !isLoading ? /*#__PURE__*/React__default.createElement(IconButton, {
4992
5005
  "aria-label": stringFormatter.format(isCollapsed ? 'expand' : 'collapse'),
4993
5006
  className: `${DetailedCardSection.className}-header__collapse-button`,
4994
5007
  color: "question",
@@ -9314,11 +9327,7 @@ const DEFAULT_PROPS$4 = {
9314
9327
  unitDisplay: 'short',
9315
9328
  roundingMode: 'halfExpand',
9316
9329
  roundingPriority: 'auto',
9317
- trailingZeroDisplay: 'auto',
9318
- minimumIntegerDigits: 1,
9319
- minimumFractionDigits: 0,
9320
- minimumSignificantDigits: 1,
9321
- maximumSignificantDigits: 21
9330
+ trailingZeroDisplay: 'auto'
9322
9331
  };
9323
9332
 
9324
9333
  /**
@@ -9357,17 +9366,23 @@ const Number$1 = /*#__PURE__*/forwardRef((props, ref) => {
9357
9366
  variant
9358
9367
  } = props,
9359
9368
  forwardedProps = _objectWithoutProperties(props, _excluded$4);
9360
- const formatter = useNumberFormatter({
9369
+ const formatter = useNumberFormatter(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
9361
9370
  compactDisplay,
9362
9371
  currency,
9363
9372
  currencyDisplay,
9364
9373
  currencySign,
9365
- localeMatcher,
9366
- maximumFractionDigits,
9367
- maximumSignificantDigits,
9368
- minimumFractionDigits,
9369
- minimumIntegerDigits,
9370
- minimumSignificantDigits,
9374
+ localeMatcher
9375
+ }, maximumFractionDigits !== undefined && {
9376
+ maximumFractionDigits
9377
+ }), maximumSignificantDigits !== undefined && {
9378
+ maximumSignificantDigits
9379
+ }), minimumFractionDigits !== undefined && {
9380
+ minimumFractionDigits
9381
+ }), minimumIntegerDigits !== undefined && {
9382
+ minimumIntegerDigits
9383
+ }), minimumSignificantDigits !== undefined && {
9384
+ minimumSignificantDigits
9385
+ }), {}, {
9371
9386
  notation,
9372
9387
  numberingSystem,
9373
9388
  // @ts-ignore
@@ -9383,7 +9398,7 @@ const Number$1 = /*#__PURE__*/forwardRef((props, ref) => {
9383
9398
  unit,
9384
9399
  unitDisplay,
9385
9400
  useGrouping
9386
- });
9401
+ }));
9387
9402
  return /*#__PURE__*/React__default.createElement(StyledNumber, _extends$1({
9388
9403
  as: as
9389
9404
  }, forwardedProps, {