@redsift/design-system 10.0.0-muiv5-alpha.0 → 10.0.0-muiv5-alpha.2
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 +76 -70
- package/index.js +37 -14
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -2438,12 +2438,85 @@ type StyledPillProps = Omit<PillProps, 'color' | 'autoBreak'> & {
|
|
|
2438
2438
|
*/
|
|
2439
2439
|
declare const Pill: Comp<PillProps, HTMLDivElement>;
|
|
2440
2440
|
|
|
2441
|
+
/**
|
|
2442
|
+
* Component variant.
|
|
2443
|
+
*/
|
|
2444
|
+
declare const TextVariant: {
|
|
2445
|
+
readonly body: "body";
|
|
2446
|
+
readonly button: "button";
|
|
2447
|
+
readonly caption: "caption";
|
|
2448
|
+
readonly helper: "helper";
|
|
2449
|
+
readonly inherit: "inherit";
|
|
2450
|
+
};
|
|
2451
|
+
type TextVariant = ValueOf<typeof TextVariant>;
|
|
2452
|
+
declare const TextComponent: {
|
|
2453
|
+
readonly p: "p";
|
|
2454
|
+
readonly b: "b";
|
|
2455
|
+
readonly i: "i";
|
|
2456
|
+
readonly u: "u";
|
|
2457
|
+
readonly abbr: "abbr";
|
|
2458
|
+
readonly cite: "cite";
|
|
2459
|
+
readonly del: "del";
|
|
2460
|
+
readonly em: "em";
|
|
2461
|
+
readonly ins: "ins";
|
|
2462
|
+
readonly kbd: "kbd";
|
|
2463
|
+
readonly mark: "mark";
|
|
2464
|
+
readonly s: "s";
|
|
2465
|
+
readonly samp: "samp";
|
|
2466
|
+
readonly sub: "sub";
|
|
2467
|
+
readonly sup: "sup";
|
|
2468
|
+
};
|
|
2469
|
+
type TextComponent = ValueOf<typeof TextComponent>;
|
|
2470
|
+
/**
|
|
2471
|
+
* Component props.
|
|
2472
|
+
*/
|
|
2473
|
+
interface TextProps extends ComponentProps<'span'>, StylingProps {
|
|
2474
|
+
/** Override component. */
|
|
2475
|
+
as?: TextComponent;
|
|
2476
|
+
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
2477
|
+
color?: NotificationsColorPalette | NeutralColorPalette | (string & {});
|
|
2478
|
+
/** Font family. */
|
|
2479
|
+
fontFamily?: FontFamily;
|
|
2480
|
+
/** Font size. */
|
|
2481
|
+
fontSize?: string;
|
|
2482
|
+
/** Font weight. */
|
|
2483
|
+
fontWeight?: string;
|
|
2484
|
+
/** Line height. */
|
|
2485
|
+
lineHeight?: string;
|
|
2486
|
+
/** Whether the text will truncate with a text overflow ellipsis or wrap. */
|
|
2487
|
+
noWrap?: boolean;
|
|
2488
|
+
/** Theme. */
|
|
2489
|
+
theme?: Theme;
|
|
2490
|
+
/** Variant. */
|
|
2491
|
+
variant?: TextVariant;
|
|
2492
|
+
/** Word break CSS properties */
|
|
2493
|
+
wordBreak?: string;
|
|
2494
|
+
}
|
|
2495
|
+
type StyledTextProps = Omit<TextProps, 'as' | 'color' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'noWrap' | 'variant'> & {
|
|
2496
|
+
$as: TextProps['as'];
|
|
2497
|
+
$color: TextProps['color'];
|
|
2498
|
+
$fontFamily?: TextProps['fontFamily'];
|
|
2499
|
+
$fontSize: TextProps['fontSize'];
|
|
2500
|
+
$fontWeight: TextProps['fontWeight'];
|
|
2501
|
+
$lineHeight: TextProps['lineHeight'];
|
|
2502
|
+
$noWrap: TextProps['noWrap'];
|
|
2503
|
+
$variant: TextProps['variant'];
|
|
2504
|
+
$theme: TextProps['theme'];
|
|
2505
|
+
};
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* The Text component.
|
|
2509
|
+
*/
|
|
2510
|
+
declare const Text: Comp<TextProps, HTMLDivElement>;
|
|
2511
|
+
|
|
2441
2512
|
/**
|
|
2442
2513
|
* Component props.
|
|
2443
2514
|
*/
|
|
2444
2515
|
interface DetailedCardSectionItemProps extends ComponentProps<'div'> {
|
|
2445
2516
|
/** Description */
|
|
2446
2517
|
description?: string | ReactElement;
|
|
2518
|
+
/** TextProps to forward to the description. */
|
|
2519
|
+
descriptionProps?: Omit<TextProps, 'ref'>;
|
|
2447
2520
|
/**
|
|
2448
2521
|
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
2449
2522
|
* Can also be a ReactElement.
|
|
@@ -2498,7 +2571,9 @@ interface DetailedCardHeaderProps extends ComponentProps<'div'> {
|
|
|
2498
2571
|
/** Whether the card is loading or not. */
|
|
2499
2572
|
isLoading?: boolean;
|
|
2500
2573
|
}
|
|
2501
|
-
type StyledDetailedCardHeaderProps = DetailedCardHeaderProps & {
|
|
2574
|
+
type StyledDetailedCardHeaderProps = DetailedCardHeaderProps & {
|
|
2575
|
+
$theme: Theme;
|
|
2576
|
+
};
|
|
2502
2577
|
|
|
2503
2578
|
/**
|
|
2504
2579
|
* The DetailedCardHeader component.
|
|
@@ -2983,75 +3058,6 @@ type StyledLinkButtonProps = Omit<LinkButtonProps, 'isDisabled'> & {
|
|
|
2983
3058
|
*/
|
|
2984
3059
|
declare const LinkButton: Comp<LinkButtonProps, HTMLButtonElement>;
|
|
2985
3060
|
|
|
2986
|
-
/**
|
|
2987
|
-
* Component variant.
|
|
2988
|
-
*/
|
|
2989
|
-
declare const TextVariant: {
|
|
2990
|
-
readonly body: "body";
|
|
2991
|
-
readonly button: "button";
|
|
2992
|
-
readonly caption: "caption";
|
|
2993
|
-
readonly helper: "helper";
|
|
2994
|
-
readonly inherit: "inherit";
|
|
2995
|
-
};
|
|
2996
|
-
type TextVariant = ValueOf<typeof TextVariant>;
|
|
2997
|
-
declare const TextComponent: {
|
|
2998
|
-
readonly p: "p";
|
|
2999
|
-
readonly b: "b";
|
|
3000
|
-
readonly i: "i";
|
|
3001
|
-
readonly u: "u";
|
|
3002
|
-
readonly abbr: "abbr";
|
|
3003
|
-
readonly cite: "cite";
|
|
3004
|
-
readonly del: "del";
|
|
3005
|
-
readonly em: "em";
|
|
3006
|
-
readonly ins: "ins";
|
|
3007
|
-
readonly kbd: "kbd";
|
|
3008
|
-
readonly mark: "mark";
|
|
3009
|
-
readonly s: "s";
|
|
3010
|
-
readonly samp: "samp";
|
|
3011
|
-
readonly sub: "sub";
|
|
3012
|
-
readonly sup: "sup";
|
|
3013
|
-
};
|
|
3014
|
-
type TextComponent = ValueOf<typeof TextComponent>;
|
|
3015
|
-
/**
|
|
3016
|
-
* Component props.
|
|
3017
|
-
*/
|
|
3018
|
-
interface TextProps extends ComponentProps<'span'>, StylingProps {
|
|
3019
|
-
/** Override component. */
|
|
3020
|
-
as?: TextComponent;
|
|
3021
|
-
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
3022
|
-
color?: NotificationsColorPalette | NeutralColorPalette | (string & {});
|
|
3023
|
-
/** Font family. */
|
|
3024
|
-
fontFamily?: FontFamily;
|
|
3025
|
-
/** Font size. */
|
|
3026
|
-
fontSize?: string;
|
|
3027
|
-
/** Font weight. */
|
|
3028
|
-
fontWeight?: string;
|
|
3029
|
-
/** Line height. */
|
|
3030
|
-
lineHeight?: string;
|
|
3031
|
-
/** Whether the text will truncate with a text overflow ellipsis or wrap. */
|
|
3032
|
-
noWrap?: boolean;
|
|
3033
|
-
/** Theme. */
|
|
3034
|
-
theme?: Theme;
|
|
3035
|
-
/** Variant. */
|
|
3036
|
-
variant?: TextVariant;
|
|
3037
|
-
}
|
|
3038
|
-
type StyledTextProps = Omit<TextProps, 'as' | 'color' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'noWrap' | 'variant'> & {
|
|
3039
|
-
$as: TextProps['as'];
|
|
3040
|
-
$color: TextProps['color'];
|
|
3041
|
-
$fontFamily?: TextProps['fontFamily'];
|
|
3042
|
-
$fontSize: TextProps['fontSize'];
|
|
3043
|
-
$fontWeight: TextProps['fontWeight'];
|
|
3044
|
-
$lineHeight: TextProps['lineHeight'];
|
|
3045
|
-
$noWrap: TextProps['noWrap'];
|
|
3046
|
-
$variant: TextProps['variant'];
|
|
3047
|
-
$theme: TextProps['theme'];
|
|
3048
|
-
};
|
|
3049
|
-
|
|
3050
|
-
/**
|
|
3051
|
-
* The Text component.
|
|
3052
|
-
*/
|
|
3053
|
-
declare const Text: Comp<TextProps, HTMLDivElement>;
|
|
3054
|
-
|
|
3055
3061
|
interface NumberFormatOptions {
|
|
3056
3062
|
}
|
|
3057
3063
|
/**
|
package/index.js
CHANGED
|
@@ -2479,6 +2479,15 @@ const StyledText = styled.span`
|
|
|
2479
2479
|
white-space: nowrap;
|
|
2480
2480
|
` : '';
|
|
2481
2481
|
}}
|
|
2482
|
+
|
|
2483
|
+
${_ref5 => {
|
|
2484
|
+
let {
|
|
2485
|
+
wordBreak
|
|
2486
|
+
} = _ref5;
|
|
2487
|
+
return wordBreak ? css`
|
|
2488
|
+
word-break: ${wordBreak};
|
|
2489
|
+
` : '';
|
|
2490
|
+
}}
|
|
2482
2491
|
`;
|
|
2483
2492
|
|
|
2484
2493
|
const _excluded$L = ["as", "children", "className", "color", "fontFamily", "fontSize", "fontWeight", "lineHeight", "noWrap", "theme", "variant"];
|
|
@@ -2903,37 +2912,37 @@ const StyledHeading = styled.span`
|
|
|
2903
2912
|
$theme
|
|
2904
2913
|
} = _ref;
|
|
2905
2914
|
return $variant === 'h1' ? css`
|
|
2906
|
-
color: var(--redsift-${$theme}-
|
|
2915
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2907
2916
|
font-family: var(--redsift-typography-h1-font-family);
|
|
2908
2917
|
font-size: var(--redsift-typography-h1-font-size);
|
|
2909
2918
|
font-weight: var(--redsift-typography-h1-font-weight);
|
|
2910
2919
|
line-height: var(--redsift-typography-h1-line-height);
|
|
2911
2920
|
` : $variant === 'h2' ? css`
|
|
2912
|
-
color: var(--redsift-${$theme}-
|
|
2921
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2913
2922
|
font-family: var(--redsift-typography-h2-font-family);
|
|
2914
2923
|
font-size: var(--redsift-typography-h2-font-size);
|
|
2915
2924
|
font-weight: var(--redsift-typography-h2-font-weight);
|
|
2916
2925
|
line-height: var(--redsift-typography-h2-line-height);
|
|
2917
2926
|
` : $variant === 'h3' ? css`
|
|
2918
|
-
color: var(--redsift-${$theme}-
|
|
2927
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2919
2928
|
font-family: var(--redsift-typography-h3-font-family);
|
|
2920
2929
|
font-size: var(--redsift-typography-h3-font-size);
|
|
2921
2930
|
font-weight: var(--redsift-typography-h3-font-weight);
|
|
2922
2931
|
line-height: var(--redsift-typography-h3-line-height);
|
|
2923
2932
|
` : $variant === 'h4' ? css`
|
|
2924
|
-
color: var(--redsift-${$theme}-
|
|
2933
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2925
2934
|
font-family: var(--redsift-typography-h4-font-family);
|
|
2926
2935
|
font-size: var(--redsift-typography-h4-font-size);
|
|
2927
2936
|
font-weight: var(--redsift-typography-h4-font-weight);
|
|
2928
2937
|
line-height: var(--redsift-typography-h4-line-height);
|
|
2929
2938
|
` : $variant === 'h5' ? css`
|
|
2930
|
-
color: var(--redsift-${$theme}-
|
|
2939
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2931
2940
|
font-family: var(--redsift-typography-h5-font-family);
|
|
2932
2941
|
font-size: var(--redsift-typography-h5-font-size);
|
|
2933
2942
|
font-weight: var(--redsift-typography-h5-font-weight);
|
|
2934
2943
|
line-height: var(--redsift-typography-h5-line-height);
|
|
2935
2944
|
` : css`
|
|
2936
|
-
color: var(--redsift-${$theme}-
|
|
2945
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
2937
2946
|
font-family: var(--redsift-typography-body-font-family);
|
|
2938
2947
|
font-size: var(--redsift-typography-body-font-size);
|
|
2939
2948
|
font-weight: var(--redsift-typography-body-font-weight);
|
|
@@ -3937,7 +3946,12 @@ const StyledAppContainer = styled.div`
|
|
|
3937
3946
|
} = _ref2;
|
|
3938
3947
|
return `var(--redsift-color-${$theme}-components-text-secondary);`;
|
|
3939
3948
|
}};
|
|
3940
|
-
color:
|
|
3949
|
+
color: ${_ref3 => {
|
|
3950
|
+
let {
|
|
3951
|
+
$theme
|
|
3952
|
+
} = _ref3;
|
|
3953
|
+
return `var(--redsift-color-${$theme}-components-text-primary)`;
|
|
3954
|
+
}};
|
|
3941
3955
|
`;
|
|
3942
3956
|
|
|
3943
3957
|
const _excluded$E = ["children", "className", "locale", "product", "theme"];
|
|
@@ -4808,12 +4822,13 @@ const StyledBreadcrumbs = styled.nav`
|
|
|
4808
4822
|
|
|
4809
4823
|
${_ref => {
|
|
4810
4824
|
let {
|
|
4811
|
-
$isDisabled
|
|
4825
|
+
$isDisabled,
|
|
4826
|
+
$theme
|
|
4812
4827
|
} = _ref;
|
|
4813
4828
|
return $isDisabled ? css`
|
|
4814
4829
|
color: var(--redsift-color-neutral-mid-grey);
|
|
4815
4830
|
` : css`
|
|
4816
|
-
color: var(--redsift-color-text-primary);
|
|
4831
|
+
color: var(--redsift-color-${$theme}-components-text-primary);
|
|
4817
4832
|
`;
|
|
4818
4833
|
}}
|
|
4819
4834
|
}
|
|
@@ -6716,7 +6731,12 @@ const StyledDetailedCardHeader = styled.div`
|
|
|
6716
6731
|
margin: 8px 0;
|
|
6717
6732
|
|
|
6718
6733
|
.redsift-detailed-card-header__header {
|
|
6719
|
-
color: var(--redsift-color-neutral
|
|
6734
|
+
color: var(--redsift-color-neutral-${_ref => {
|
|
6735
|
+
let {
|
|
6736
|
+
$theme
|
|
6737
|
+
} = _ref;
|
|
6738
|
+
return $theme === Theme.light ? 'x-dark-grey' : 'white';
|
|
6739
|
+
}});
|
|
6720
6740
|
font-family: var(--redsift-typography-font-family-poppins);
|
|
6721
6741
|
font-size: 32px;
|
|
6722
6742
|
font-weight: 500;
|
|
@@ -6742,9 +6762,11 @@ const DetailedCardHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6742
6762
|
isLoading
|
|
6743
6763
|
} = props,
|
|
6744
6764
|
forwardedProps = _objectWithoutProperties(props, _excluded$i);
|
|
6765
|
+
const theme = useTheme();
|
|
6745
6766
|
return /*#__PURE__*/React__default.createElement(StyledDetailedCardHeader, _extends$1({}, forwardedProps, {
|
|
6746
6767
|
className: classNames(DetailedCardHeader.className, className),
|
|
6747
|
-
ref: ref
|
|
6768
|
+
ref: ref,
|
|
6769
|
+
$theme: theme
|
|
6748
6770
|
}), header ? /*#__PURE__*/React__default.createElement(Skeleton.Text, {
|
|
6749
6771
|
variant: "h2",
|
|
6750
6772
|
isLoaded: !isLoading,
|
|
@@ -6995,7 +7017,7 @@ const StyledDetailedCardSectionItem = styled.div`
|
|
|
6995
7017
|
}
|
|
6996
7018
|
`;
|
|
6997
7019
|
|
|
6998
|
-
const _excluded$g = ["children", "className", "description", "icon", "iconProps", "isLoading", "pill", "pillProps", "shield"];
|
|
7020
|
+
const _excluded$g = ["children", "className", "description", "descriptionProps", "icon", "iconProps", "isLoading", "pill", "pillProps", "shield"];
|
|
6999
7021
|
const COMPONENT_NAME$h = 'DetailedCardSectionItem';
|
|
7000
7022
|
const CLASSNAME$h = 'redsift-detailed-card-section-item';
|
|
7001
7023
|
const DEFAULT_PROPS$h = {};
|
|
@@ -7008,6 +7030,7 @@ const DetailedCardSectionItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7008
7030
|
children,
|
|
7009
7031
|
className,
|
|
7010
7032
|
description,
|
|
7033
|
+
descriptionProps,
|
|
7011
7034
|
icon,
|
|
7012
7035
|
iconProps,
|
|
7013
7036
|
isLoading,
|
|
@@ -7041,7 +7064,7 @@ const DetailedCardSectionItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7041
7064
|
isLoaded: !isLoading
|
|
7042
7065
|
}, pill && /*#__PURE__*/React__default.createElement(Pill, _extends$1({
|
|
7043
7066
|
className: `${DetailedCardSectionItem.className}-header__pill`
|
|
7044
|
-
}, pillProps), pill), typeof description === 'string' ? /*#__PURE__*/React__default.createElement(Text,
|
|
7067
|
+
}, pillProps), pill), typeof description === 'string' ? /*#__PURE__*/React__default.createElement(Text, descriptionProps, description) : description)) : null), children);
|
|
7045
7068
|
});
|
|
7046
7069
|
DetailedCardSectionItem.className = CLASSNAME$h;
|
|
7047
7070
|
DetailedCardSectionItem.defaultProps = DEFAULT_PROPS$h;
|
|
@@ -11056,7 +11079,7 @@ const BaseDetailedCard = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11056
11079
|
const [[header], content] = partitionComponents(React__default.Children.toArray(children), [isComponent('DetailedCardHeader')]);
|
|
11057
11080
|
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
11058
11081
|
value: {
|
|
11059
|
-
theme
|
|
11082
|
+
theme
|
|
11060
11083
|
}
|
|
11061
11084
|
}, /*#__PURE__*/React__default.createElement(StyledDetailedCard, _extends$1({}, forwardedProps, {
|
|
11062
11085
|
className: classNames(BaseDetailedCard.className, className),
|