@obolnetwork/obol-ui 1.0.30 → 1.0.31
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.
|
@@ -6,8 +6,9 @@ export declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrim
|
|
|
6
6
|
export declare const TooltipContent: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
8
8
|
export interface TooltipComponentProps extends TooltipPrimitive.TooltipProps {
|
|
9
|
+
content: React.ReactNode | string;
|
|
9
10
|
side?: "top" | "bottom" | "right" | "left";
|
|
10
11
|
sideOffset?: number;
|
|
11
|
-
|
|
12
|
+
showOnClick?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const TooltipComponent: React.FC<TooltipComponentProps>;
|
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createStitches } from '@stitches/react';
|
|
|
2
2
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useState, forwardRef, useRef, useImperativeHandle, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
7
7
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
8
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
@@ -1134,11 +1134,10 @@ var TeamMemberCard = function (props) { return (jsxs(Box, __assign({ className:
|
|
|
1134
1134
|
borderRadius: "$3",
|
|
1135
1135
|
backgroundColor: "$bg04",
|
|
1136
1136
|
alignItems: "center",
|
|
1137
|
-
justifyItems: "center",
|
|
1138
1137
|
width: "288px",
|
|
1139
1138
|
gap: "$lg",
|
|
1140
1139
|
py: "$xl",
|
|
1141
|
-
"@sm": { gridTemplateColumns: "1fr 2fr", p: "$sm" },
|
|
1140
|
+
"@sm": { gridTemplateColumns: "1fr 2fr", p: "$sm", height: "116px" },
|
|
1142
1141
|
} }, { children: [jsx(Box, __assign({ css: {
|
|
1143
1142
|
$$size: "160px",
|
|
1144
1143
|
width: "$$size",
|
|
@@ -1160,7 +1159,7 @@ var TeamMemberCard = function (props) { return (jsxs(Box, __assign({ className:
|
|
|
1160
1159
|
} }, { children: jsx(Image, { placeholder: "blur", alt: props.heading, css: { borderRadius: "$round" }, src: props.image, width: 160, height: 160 }) })), jsxs(Box, __assign({ css: {
|
|
1161
1160
|
display: "grid",
|
|
1162
1161
|
justifyContent: "center",
|
|
1163
|
-
"@sm": { justifyContent: "start" },
|
|
1162
|
+
"@sm": { justifyContent: "start", gridTemplateRows: "3fr 1fr" },
|
|
1164
1163
|
gap: "$sm",
|
|
1165
1164
|
} }, { children: [jsxs(Box, __assign({ css: {
|
|
1166
1165
|
display: "flex",
|
|
@@ -1316,8 +1315,10 @@ var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
|
1316
1315
|
var TooltipContent = TooltipPrimitive.Content;
|
|
1317
1316
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
1318
1317
|
var TooltipComponent = function (_a) {
|
|
1319
|
-
var _b = _a.side, side = _b === void 0 ? "bottom" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 5 : _c, children = _a.children, content = _a.content, props = __rest(_a, ["side", "sideOffset", "children", "content"]);
|
|
1320
|
-
|
|
1318
|
+
var _b = _a.side, side = _b === void 0 ? "bottom" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 5 : _c, children = _a.children, content = _a.content, showOnClick = _a.showOnClick, props = __rest(_a, ["side", "sideOffset", "children", "content", "showOnClick"]);
|
|
1319
|
+
var _d = useState(false), open = _d[0], setOpen = _d[1];
|
|
1320
|
+
var StyledContentComp = (jsxs(StyledContent$1, __assign({ className: "tooltip-content", side: side, sideOffset: sideOffset }, { children: [content, jsx(StyledArrow, { className: "arrow" })] })));
|
|
1321
|
+
return (jsx(Provider, __assign({ delayDuration: 0, skipDelayDuration: 100 }, { children: showOnClick ? (jsxs(Tooltip, __assign({}, props, { open: open, onOpenChange: function () { return setOpen(false); } }, { children: [jsx(TooltipTrigger, __assign({ onClick: function () { return setOpen(true); }, asChild: true }, { children: children })), StyledContentComp] }))) : (jsxs(Tooltip, __assign({}, props, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: children })), StyledContentComp] }))) })));
|
|
1321
1322
|
};
|
|
1322
1323
|
TooltipComponent.displayName = "Tooltip";
|
|
1323
1324
|
|
package/dist/index.js
CHANGED
|
@@ -1166,11 +1166,10 @@ var TeamMemberCard = function (props) { return (jsxRuntime.jsxs(Box, __assign({
|
|
|
1166
1166
|
borderRadius: "$3",
|
|
1167
1167
|
backgroundColor: "$bg04",
|
|
1168
1168
|
alignItems: "center",
|
|
1169
|
-
justifyItems: "center",
|
|
1170
1169
|
width: "288px",
|
|
1171
1170
|
gap: "$lg",
|
|
1172
1171
|
py: "$xl",
|
|
1173
|
-
"@sm": { gridTemplateColumns: "1fr 2fr", p: "$sm" },
|
|
1172
|
+
"@sm": { gridTemplateColumns: "1fr 2fr", p: "$sm", height: "116px" },
|
|
1174
1173
|
} }, { children: [jsxRuntime.jsx(Box, __assign({ css: {
|
|
1175
1174
|
$$size: "160px",
|
|
1176
1175
|
width: "$$size",
|
|
@@ -1192,7 +1191,7 @@ var TeamMemberCard = function (props) { return (jsxRuntime.jsxs(Box, __assign({
|
|
|
1192
1191
|
} }, { children: jsxRuntime.jsx(Image, { placeholder: "blur", alt: props.heading, css: { borderRadius: "$round" }, src: props.image, width: 160, height: 160 }) })), jsxRuntime.jsxs(Box, __assign({ css: {
|
|
1193
1192
|
display: "grid",
|
|
1194
1193
|
justifyContent: "center",
|
|
1195
|
-
"@sm": { justifyContent: "start" },
|
|
1194
|
+
"@sm": { justifyContent: "start", gridTemplateRows: "3fr 1fr" },
|
|
1196
1195
|
gap: "$sm",
|
|
1197
1196
|
} }, { children: [jsxRuntime.jsxs(Box, __assign({ css: {
|
|
1198
1197
|
display: "flex",
|
|
@@ -1348,8 +1347,10 @@ var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
|
1348
1347
|
var TooltipContent = TooltipPrimitive__namespace.Content;
|
|
1349
1348
|
var TooltipArrow = TooltipPrimitive__namespace.Arrow;
|
|
1350
1349
|
var TooltipComponent = function (_a) {
|
|
1351
|
-
var _b = _a.side, side = _b === void 0 ? "bottom" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 5 : _c, children = _a.children, content = _a.content, props = __rest(_a, ["side", "sideOffset", "children", "content"]);
|
|
1352
|
-
|
|
1350
|
+
var _b = _a.side, side = _b === void 0 ? "bottom" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 5 : _c, children = _a.children, content = _a.content, showOnClick = _a.showOnClick, props = __rest(_a, ["side", "sideOffset", "children", "content", "showOnClick"]);
|
|
1351
|
+
var _d = React.useState(false), open = _d[0], setOpen = _d[1];
|
|
1352
|
+
var StyledContentComp = (jsxRuntime.jsxs(StyledContent$1, __assign({ className: "tooltip-content", side: side, sideOffset: sideOffset }, { children: [content, jsxRuntime.jsx(StyledArrow, { className: "arrow" })] })));
|
|
1353
|
+
return (jsxRuntime.jsx(Provider, __assign({ delayDuration: 0, skipDelayDuration: 100 }, { children: showOnClick ? (jsxRuntime.jsxs(Tooltip, __assign({}, props, { open: open, onOpenChange: function () { return setOpen(false); } }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ onClick: function () { return setOpen(true); }, asChild: true }, { children: children })), StyledContentComp] }))) : (jsxRuntime.jsxs(Tooltip, __assign({}, props, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: children })), StyledContentComp] }))) })));
|
|
1353
1354
|
};
|
|
1354
1355
|
TooltipComponent.displayName = "Tooltip";
|
|
1355
1356
|
|