Skip to content

Commit 4837714

Browse files
author
sasha kushnir
committed
fixed paddingScale warning
1 parent a162401 commit 4837714

6 files changed

Lines changed: 19 additions & 15 deletions

File tree

dist/cspr-design.es.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35282,13 +35282,14 @@ function P8(e) {
3528235282
});
3528335283
}
3528435284
const A8 = be(M8).withConfig({
35285+
shouldForwardProp: (e) => e !== "paddingScale",
3528535286
displayName: "tooltip__StyledReactTooltip",
3528635287
componentId: "sc-1m82hpm-0"
3528735288
})(({
3528835289
theme: e,
3528935290
lineHeight: o = "sm",
3529035291
scale: g = "sm",
35291-
$paddingScale: C = 2
35292+
paddingScale: C = 2
3529235293
}) => ({
3529335294
zIndex: e.zIndex.tooltip,
3529435295
color: e.styleguideColors.contentPrimary,
@@ -35318,15 +35319,15 @@ const A8 = be(M8).withConfig({
3531835319
monotype: x,
3531935320
lineHeight: r = "sm",
3532035321
scale: c = "sm",
35321-
$paddingScale: n = 2,
35322+
paddingScale: n = 2,
3532235323
...a
3532335324
}, i) => {
3532435325
const m = P8({
3532535326
animated: 250
3532635327
}), t = o ? typeof o == "string" ? o : "500px" : void 0;
3532735328
return e == null ? null : g == null ? /* @__PURE__ */ $(Ct, { children: e }) : /* @__PURE__ */ Pe(Ct, { children: [
3532835329
/* @__PURE__ */ $(E8, { ...m, ref: e.ref, ...e.props, children: (f) => At.cloneElement(e, f) }),
35329-
/* @__PURE__ */ $(A8, { $paddingScale: n, ...m, ...a, children: /* @__PURE__ */ $("div", { style: {
35330+
/* @__PURE__ */ $(A8, { paddingScale: n, ...m, ...a, children: /* @__PURE__ */ $("div", { style: {
3533035331
maxWidth: t
3533135332
}, children: /* @__PURE__ */ Pe(Ut, { itemsSpacing: 8, children: [
3533235333
/* @__PURE__ */ Pe(Ut, { children: [
@@ -39888,7 +39889,7 @@ const Fv = be(no).withConfig({
3988839889
}
3988939890
}));
3989039891
function k_(e) {
39891-
return /* @__PURE__ */ $(lr, { tooltipContent: e.tooltip, limitWidth: !0, lineHeight: e.lineHeight, scale: e.scale, $paddingScale: e.tooltipPaddingScale, children: /* @__PURE__ */ $(Fv, { color: "utility", ...e, children: /* @__PURE__ */ Pe(je, { gap: 3, align: "center", children: [
39892+
return /* @__PURE__ */ $(lr, { tooltipContent: e.tooltip, limitWidth: !0, lineHeight: e.lineHeight, scale: e.scale, paddingScale: e.tooltipPaddingScale, children: /* @__PURE__ */ $(Fv, { color: "utility", ...e, children: /* @__PURE__ */ Pe(je, { gap: 3, align: "center", children: [
3989239893
e.children,
3989339894
e.tooltip && /* @__PURE__ */ $(_t, { width: 17, height: 16, src: Gf })
3989439895
] }) }) });

dist/cspr-design.umd.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/components/tooltip/tooltip.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BaseProps } from '../../types';
33
type StyledReactTooltipProps = {
44
lineHeight?: 'xs' | 'sm';
55
scale?: 'xs' | 'sm';
6-
$paddingScale?: 1 | 2;
6+
paddingScale?: 1 | 2;
77
};
88
export interface TooltipProps extends BaseProps {
99
tooltipContent?: JSX.Element | string | null;

dist/lib/components/tooltip/tooltip.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/tab-menu-item/tab-menu-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function TabMenuItem(props: TabMenuItemProps) {
8989
limitWidth
9090
lineHeight={props.lineHeight}
9191
scale={props.scale}
92-
$paddingScale={props.tooltipPaddingScale}
92+
paddingScale={props.tooltipPaddingScale}
9393
>
9494
<StyledButton color="utility" {...props}>
9595
<FlexRow gap={3} align={'center'}>

src/lib/components/tooltip/tooltip.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Ref = HTMLDivElement;
1616
type StyledReactTooltipProps = {
1717
lineHeight?: 'xs' | 'sm';
1818
scale?: 'xs' | 'sm';
19-
$paddingScale?: 1 | 2;
19+
paddingScale?: 1 | 2;
2020
};
2121

2222
export interface TooltipProps extends BaseProps {
@@ -28,13 +28,16 @@ export interface TooltipProps extends BaseProps {
2828
limitWidth?: boolean | string;
2929
}
3030

31-
const StyledReactTooltip = styled(ReakitTooltip)<StyledReactTooltipProps>(
32-
({ theme, lineHeight = 'sm', scale = 'sm', $paddingScale = 2 }) => ({
31+
const StyledReactTooltip = styled(
32+
ReakitTooltip,
33+
).withConfig<StyledReactTooltipProps>({
34+
shouldForwardProp: (prop) => prop !== 'paddingScale',
35+
})(({ theme, lineHeight = 'sm', scale = 'sm', paddingScale = 2 }) => ({
3336
zIndex: theme.zIndex.tooltip,
3437
color: theme.styleguideColors.contentPrimary,
3538
backgroundColor: theme.styleguideColors.backgroundPrimary,
3639
borderRadius: theme.borderRadius.base,
37-
padding: theme.padding[$paddingScale],
40+
padding: theme.padding[paddingScale],
3841
boxShadow: theme.boxShadow.tooltip,
3942

4043
transition: 'opacity 250ms ease-in-out',
@@ -73,7 +76,7 @@ export const Tooltip = React.forwardRef<
7376
monotype,
7477
lineHeight = 'sm',
7578
scale = 'sm',
76-
$paddingScale = 2,
79+
paddingScale = 2,
7780
...props
7881
},
7982
ref,
@@ -98,7 +101,7 @@ export const Tooltip = React.forwardRef<
98101
<TooltipReference {...tooltip} ref={children.ref} {...children.props}>
99102
{(referenceProps) => React.cloneElement(children, referenceProps)}
100103
</TooltipReference>
101-
<StyledReactTooltip $paddingScale={$paddingScale} {...tooltip} {...props}>
104+
<StyledReactTooltip paddingScale={paddingScale} {...tooltip} {...props}>
102105
<div style={{ maxWidth }}>
103106
<FlexColumn itemsSpacing={8}>
104107
<FlexColumn>

0 commit comments

Comments
 (0)