@redsift/design-system 10.3.0-muiv5-alpha.2 → 10.3.0-muiv5-alpha.4
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 +1 -0
- package/index.js +40 -17
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ declare const PrimaryButtonsColorPalette: {
|
|
|
110
110
|
};
|
|
111
111
|
type PrimaryButtonsColorPalette = ValueOf<typeof PrimaryButtonsColorPalette>;
|
|
112
112
|
declare const ButtonsColorPalette: {
|
|
113
|
+
readonly white: "white";
|
|
113
114
|
readonly black: "black";
|
|
114
115
|
readonly info: "info";
|
|
115
116
|
readonly primary: string;
|
package/index.js
CHANGED
|
@@ -209,6 +209,7 @@ const PrimaryButtonsColorPalette = {
|
|
|
209
209
|
radar: 'radar'
|
|
210
210
|
};
|
|
211
211
|
const ButtonsColorPalette = _objectSpread2(_objectSpread2({}, PrimaryButtonsColorPalette), {}, {
|
|
212
|
+
white: 'white',
|
|
212
213
|
black: 'black',
|
|
213
214
|
info: 'info'
|
|
214
215
|
});
|
|
@@ -4820,7 +4821,7 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4820
4821
|
$theme: theme,
|
|
4821
4822
|
"aria-hidden": ariaLabel ? ariaHidden ? ariaHidden : undefined : true,
|
|
4822
4823
|
"aria-label": ariaLabel,
|
|
4823
|
-
className: classNames(Icon.className, className),
|
|
4824
|
+
className: classNames(Icon.className, className, color ? 'colored' : undefined),
|
|
4824
4825
|
ref: ref
|
|
4825
4826
|
}), /*#__PURE__*/React__default.cloneElement(typeof icon === 'string' || Array.isArray(icon) && icon.every(it => typeof it === 'string') ? /*#__PURE__*/React__default.createElement("svg", {
|
|
4826
4827
|
viewBox: "0 0 24 24"
|
|
@@ -4914,7 +4915,7 @@ const StyledButton = styled.button`
|
|
|
4914
4915
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
4915
4916
|
);
|
|
4916
4917
|
&,
|
|
4917
|
-
.redsift-icon {
|
|
4918
|
+
.redsift-icon:not(.colored) {
|
|
4918
4919
|
color: var(
|
|
4919
4920
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
4920
4921
|
);
|
|
@@ -4926,7 +4927,7 @@ const StyledButton = styled.button`
|
|
|
4926
4927
|
|
|
4927
4928
|
${$variant === ButtonVariant.primary || $isDisabled ? css`
|
|
4928
4929
|
&,
|
|
4929
|
-
.redsift-icon {
|
|
4930
|
+
.redsift-icon:not(.colored) {
|
|
4930
4931
|
color: var(
|
|
4931
4932
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
4932
4933
|
);
|
|
@@ -4977,7 +4978,7 @@ const StyledButton = styled.button`
|
|
|
4977
4978
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : 'hover'}
|
|
4978
4979
|
);
|
|
4979
4980
|
&,
|
|
4980
|
-
.redsift-icon {
|
|
4981
|
+
.redsift-icon:not(.colored) {
|
|
4981
4982
|
color: var(
|
|
4982
4983
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : 'hover'}
|
|
4983
4984
|
);
|
|
@@ -5022,7 +5023,7 @@ const StyledButton = styled.button`
|
|
|
5022
5023
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
5023
5024
|
);
|
|
5024
5025
|
&,
|
|
5025
|
-
.redsift-icon {
|
|
5026
|
+
.redsift-icon:not(.colored) {
|
|
5026
5027
|
color: var(
|
|
5027
5028
|
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
5028
5029
|
);
|
|
@@ -5392,8 +5393,7 @@ const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
5392
5393
|
size: "small",
|
|
5393
5394
|
color: variant === IconButtonVariant.primary ? 'grey-l1' : 'grey-l2'
|
|
5394
5395
|
}) : /*#__PURE__*/React__default.createElement(Icon, _extends$1({}, iconProps, {
|
|
5395
|
-
icon: icon
|
|
5396
|
-
color: color
|
|
5396
|
+
icon: icon
|
|
5397
5397
|
}))));
|
|
5398
5398
|
});
|
|
5399
5399
|
IconButton.className = CLASSNAME$O;
|
|
@@ -11502,10 +11502,11 @@ const StyledPill = styled.div`
|
|
|
11502
11502
|
cursor: pointer;
|
|
11503
11503
|
padding: 5px;
|
|
11504
11504
|
border: none;
|
|
11505
|
+
text-transform: none;
|
|
11505
11506
|
|
|
11506
11507
|
font-size: ${$size === PillSize.small ? css`14px` : css`15px`};
|
|
11507
11508
|
|
|
11508
|
-
> .redsift-icon {
|
|
11509
|
+
> .redsift-icon:not(.colored) {
|
|
11509
11510
|
color: inherit;
|
|
11510
11511
|
}
|
|
11511
11512
|
}
|
|
@@ -11663,7 +11664,7 @@ const StyledPill = styled.div`
|
|
|
11663
11664
|
let {
|
|
11664
11665
|
$size
|
|
11665
11666
|
} = _ref5;
|
|
11666
|
-
return $size === PillSize.
|
|
11667
|
+
return $size === PillSize.xlarge ? '15px' : $size === PillSize.large ? '12px' : '10px';
|
|
11667
11668
|
}};
|
|
11668
11669
|
font-weight: var(--redsift-typography-pill-font-weight);
|
|
11669
11670
|
line-height: ${_ref6 => {
|
|
@@ -11674,9 +11675,23 @@ const StyledPill = styled.div`
|
|
|
11674
11675
|
}};
|
|
11675
11676
|
}
|
|
11676
11677
|
|
|
11678
|
+
.redsift-icon:not(.colored) {
|
|
11679
|
+
color: inherit;
|
|
11680
|
+
}
|
|
11681
|
+
|
|
11677
11682
|
.redsift-icon {
|
|
11678
|
-
width:
|
|
11679
|
-
|
|
11683
|
+
width: ${_ref7 => {
|
|
11684
|
+
let {
|
|
11685
|
+
$size
|
|
11686
|
+
} = _ref7;
|
|
11687
|
+
return $size === PillSize.xlarge ? '17px' : $size === PillSize.large ? '14px' : '12px';
|
|
11688
|
+
}};
|
|
11689
|
+
height: ${_ref8 => {
|
|
11690
|
+
let {
|
|
11691
|
+
$size
|
|
11692
|
+
} = _ref8;
|
|
11693
|
+
return $size === PillSize.xlarge ? '17px' : $size === PillSize.large ? '14px' : '12px';
|
|
11694
|
+
}};
|
|
11680
11695
|
|
|
11681
11696
|
> svg {
|
|
11682
11697
|
width: 1em;
|
|
@@ -11723,6 +11738,7 @@ const Pill = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11723
11738
|
}));
|
|
11724
11739
|
} else if (isComponent('IconButton')(child) || isComponent('Button')(child) || isComponent('ButtonLink')(child)) {
|
|
11725
11740
|
var _key;
|
|
11741
|
+
console.log(child.props.color, pickTextColorBasedOnBgColorAdvanced(color, 'white', 'black'));
|
|
11726
11742
|
childArray.push( /*#__PURE__*/React__default.cloneElement(child, {
|
|
11727
11743
|
key: (_key = child.key) !== null && _key !== void 0 ? _key : index,
|
|
11728
11744
|
className: currentClassName,
|
|
@@ -15647,20 +15663,23 @@ const TooltipTrigger = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15647
15663
|
getReferenceProps,
|
|
15648
15664
|
refs,
|
|
15649
15665
|
tooltipId,
|
|
15650
|
-
triggerClassName
|
|
15666
|
+
triggerClassName,
|
|
15667
|
+
color
|
|
15651
15668
|
} = useTooltipContext();
|
|
15652
15669
|
const childrenRef = children.ref;
|
|
15653
15670
|
const triggerRef = useMergeRefs([refs.setReference, ref, childrenRef]);
|
|
15654
15671
|
if ( /*#__PURE__*/React__default.isValidElement(children)) {
|
|
15655
15672
|
var _children$props$child;
|
|
15656
|
-
return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
15673
|
+
return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2(_objectSpread2({}, getReferenceProps(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
15657
15674
|
ref: triggerRef
|
|
15658
15675
|
}, props), {}, {
|
|
15659
15676
|
'aria-describedby': tooltipId
|
|
15660
15677
|
}, children.props), {}, {
|
|
15661
|
-
children: (_children$props$child = children.props.children) !== null && _children$props$child !== void 0 ? _children$props$child : ''
|
|
15662
|
-
|
|
15663
|
-
|
|
15678
|
+
children: (_children$props$child = children.props.children) !== null && _children$props$child !== void 0 ? _children$props$child : ''
|
|
15679
|
+
}))), {}, {
|
|
15680
|
+
className: classNames(children.props.className, triggerClassName),
|
|
15681
|
+
color: color !== null && color !== void 0 ? color : children.props.color
|
|
15682
|
+
}));
|
|
15664
15683
|
}
|
|
15665
15684
|
return /*#__PURE__*/React__default.createElement("span", _extends$1({
|
|
15666
15685
|
ref: triggerRef
|
|
@@ -15672,6 +15691,7 @@ TooltipTrigger.displayName = COMPONENT_NAME$h;
|
|
|
15672
15691
|
|
|
15673
15692
|
function useTooltip(_ref) {
|
|
15674
15693
|
let {
|
|
15694
|
+
color,
|
|
15675
15695
|
defaultOpen,
|
|
15676
15696
|
delay,
|
|
15677
15697
|
placement,
|
|
@@ -15724,13 +15744,14 @@ function useTooltip(_ref) {
|
|
|
15724
15744
|
});
|
|
15725
15745
|
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
15726
15746
|
return React__default.useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({
|
|
15747
|
+
color,
|
|
15727
15748
|
isOpen,
|
|
15728
15749
|
handleOpen
|
|
15729
15750
|
}, interactions), data), {}, {
|
|
15730
15751
|
arrowRef,
|
|
15731
15752
|
tooltipId,
|
|
15732
15753
|
triggerClassName
|
|
15733
|
-
}), [isOpen, handleOpen, interactions, data, arrowRef, tooltipId, triggerClassName]);
|
|
15754
|
+
}), [color, isOpen, handleOpen, interactions, data, arrowRef, tooltipId, triggerClassName]);
|
|
15734
15755
|
}
|
|
15735
15756
|
|
|
15736
15757
|
const COMPONENT_NAME$g = 'Tooltip';
|
|
@@ -15745,6 +15766,7 @@ const DEFAULT_PROPS$g = {
|
|
|
15745
15766
|
*/
|
|
15746
15767
|
const BaseTooltip = props => {
|
|
15747
15768
|
const {
|
|
15769
|
+
color,
|
|
15748
15770
|
children,
|
|
15749
15771
|
defaultOpen,
|
|
15750
15772
|
delay,
|
|
@@ -15757,6 +15779,7 @@ const BaseTooltip = props => {
|
|
|
15757
15779
|
} = props;
|
|
15758
15780
|
const theme = useTheme ? useTheme(propsTheme) : undefined;
|
|
15759
15781
|
const tooltip = useTooltip({
|
|
15782
|
+
color,
|
|
15760
15783
|
defaultOpen,
|
|
15761
15784
|
delay,
|
|
15762
15785
|
placement,
|