@obolnetwork/obol-ui 1.0.36 → 1.0.38

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.
@@ -29,6 +29,7 @@ export interface SplitterTableProps extends TableProps {
29
29
  onRemoveRow?(item: string | number): void;
30
30
  onUpdateRow?(id: string, value: string | number, accessorKey: unknown): void;
31
31
  totalSplitFooter?: number;
32
+ addText?: string;
32
33
  }
33
34
  export declare const SplitterTable: React.FC<SplitterTableProps>;
34
35
  export declare const Table: React.FC<TableProps>;
package/dist/index.es.js CHANGED
@@ -1424,7 +1424,10 @@ var TextFieldWithCopy = forwardRef(function (_a, ref) {
1424
1424
  onChange(e);
1425
1425
  }
1426
1426
  };
1427
- return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsx(IconButton, __assign({ onClick: function () { return copyToClipBoard(inputValue); } }, { children: !isCopied ? jsx(CopyIcon, {}) : jsx(CheckIcon, {}) })) })), jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsx(TooltipArrow, {})] }))] }))] })));
1427
+ return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsx(IconButton, __assign({ onClick: function (e) {
1428
+ e.preventDefault();
1429
+ copyToClipBoard(inputValue);
1430
+ } }, { children: !isCopied ? jsx(CopyIcon, {}) : jsx(CheckIcon, {}) })) })), jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsx(TooltipArrow, {})] }))] }))] })));
1428
1431
  });
1429
1432
  TextFieldWithCopy.displayName = "TextFieldWithCopy";
1430
1433
 
@@ -2063,10 +2066,10 @@ var Td = styled("td", {
2063
2066
  borderRadius: 0,
2064
2067
  width: "100%",
2065
2068
  },
2066
- textOverflow: 'ellipsis',
2069
+ textOverflow: "ellipsis",
2067
2070
  maxWidth: 0,
2068
- whiteSpace: 'nowrap',
2069
- overflow: 'hidden',
2071
+ whiteSpace: "nowrap",
2072
+ overflow: "hidden",
2070
2073
  variants: {
2071
2074
  splitter: {
2072
2075
  true: {
@@ -2089,6 +2092,7 @@ var Td = styled("td", {
2089
2092
  });
2090
2093
  var Th = styled("th", {
2091
2094
  border: "2px solid $bg04",
2095
+ minWidth: "20px",
2092
2096
  py: "$sm",
2093
2097
  px: "$sm",
2094
2098
  textAlign: "center",
@@ -2111,8 +2115,12 @@ var BoxBorderTop = styled(Box, {
2111
2115
  px: "$sm",
2112
2116
  });
2113
2117
  var AddNewRow = function (_a) {
2114
- var onAddRow = _a.onAddRow, totalSplitFooter = _a.totalSplitFooter;
2115
- return (jsxs(Tr, { children: [jsx(Td, __assign({ splitter: true }, { children: jsx(BoxBorderTop, {}) })), jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsx(BoxBorderTop, { children: onAddRow && (jsx(Button, __assign({ type: "button", css: {
2118
+ var onAddRow = _a.onAddRow, totalSplitFooter = _a.totalSplitFooter, _b = _a.addText, addText = _b === void 0 ? "+ Add Recipient" : _b;
2119
+ return (jsxs(Tr, { children: [jsx(Td, __assign({ splitter: true }, { children: jsx(BoxBorderTop, {}) })), jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsx(BoxBorderTop, __assign({ css: {
2120
+ "@xs": {
2121
+ px: "$2",
2122
+ },
2123
+ } }, { children: onAddRow && (jsxs(Button, __assign({ type: "button", css: {
2116
2124
  color: "$obolGreen",
2117
2125
  justifyContent: "start",
2118
2126
  borderRadius: 0,
@@ -2122,13 +2130,16 @@ var AddNewRow = function (_a) {
2122
2130
  "&:disabled": {
2123
2131
  borderColor: "transparent",
2124
2132
  },
2133
+ "@xs": {
2134
+ px: "$1",
2135
+ },
2125
2136
  }, fullWidth: true, ghost: true, onClick: function (e) {
2126
2137
  e.preventDefault();
2127
2138
  onAddRow();
2128
- }, disabled: totalSplitFooter === 100 }, { children: "+ Add Signer" }))) }) })), jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsx(BoxBorderTop, { children: jsx(Box, { children: totalSplitFooter && "".concat(totalSplitFooter, "%") }) }) }))] }));
2139
+ }, disabled: totalSplitFooter === 100 }, { children: [jsx(Box, __assign({ css: { display: "none", "@xs": { display: "inline-block" } } }, { children: "+ Recipient" })), " ", jsx(Box, __assign({ css: { "@xs": { display: "none" } } }, { children: addText }))] }))) })) })), jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsx(BoxBorderTop, { children: jsx(Box, { children: totalSplitFooter && "".concat(totalSplitFooter, "%") }) }) }))] }));
2129
2140
  };
2130
2141
  var SplitterTable = function (_a) {
2131
- var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b;
2142
+ var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b, addText = _a.addText;
2132
2143
  return (jsxs(StyledTable, { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(Th, {}), columns.map(function (_a, index) {
2133
2144
  var css = _a.css, column = __rest(_a, ["css"]);
2134
2145
  return (jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
@@ -2180,7 +2191,7 @@ var SplitterTable = function (_a) {
2180
2191
  onUpdateRow(row.id, value, column.accessorKey);
2181
2192
  }, min: (_c = (_b = column.cell) === null || _b === void 0 ? void 0 : _b.config) === null || _c === void 0 ? void 0 : _c.min, max: (_e = (_d = column.cell) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e.max, type: (_g = (_f = column.cell) === null || _f === void 0 ? void 0 : _f.config) === null || _g === void 0 ? void 0 : _g.type, readOnly: !isEditable })) }), "cell ".concat(cellIndex)));
2182
2193
  }), onRemoveRow && isRemovable && (jsx(Td, __assign({ splitter: true, size: "sm", css: { p: "$2" } }, { children: jsx(IconButton, __assign({ ghost: true, onClick: function () { return onRemoveRow(row.id); } }, { children: jsx(TrashIcon, {}) })) })))] }, row.id));
2183
- }), jsx(AddNewRow, { onAddRow: onAddRow, totalSplitFooter: totalSplitFooter })] })] }));
2194
+ }), jsx(AddNewRow, { onAddRow: onAddRow, totalSplitFooter: totalSplitFooter, addText: addText })] })] }));
2184
2195
  };
2185
2196
  var Table = function (_a) {
2186
2197
  var rows = _a.rows, columns = _a.columns;
package/dist/index.js CHANGED
@@ -1458,7 +1458,10 @@ var TextFieldWithCopy = React.forwardRef(function (_a, ref) {
1458
1458
  onChange(e);
1459
1459
  }
1460
1460
  };
1461
- return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxRuntime.jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsxRuntime.jsx(IconButton, __assign({ onClick: function () { return copyToClipBoard(inputValue); } }, { children: !isCopied ? jsxRuntime.jsx(CopyIcon, {}) : jsxRuntime.jsx(CheckIcon, {}) })) })), jsxRuntime.jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsxRuntime.jsx(TooltipArrow, {})] }))] }))] })));
1461
+ return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxRuntime.jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsxRuntime.jsx(IconButton, __assign({ onClick: function (e) {
1462
+ e.preventDefault();
1463
+ copyToClipBoard(inputValue);
1464
+ } }, { children: !isCopied ? jsxRuntime.jsx(CopyIcon, {}) : jsxRuntime.jsx(CheckIcon, {}) })) })), jsxRuntime.jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsxRuntime.jsx(TooltipArrow, {})] }))] }))] })));
1462
1465
  });
1463
1466
  TextFieldWithCopy.displayName = "TextFieldWithCopy";
1464
1467
 
@@ -2097,10 +2100,10 @@ var Td = styled("td", {
2097
2100
  borderRadius: 0,
2098
2101
  width: "100%",
2099
2102
  },
2100
- textOverflow: 'ellipsis',
2103
+ textOverflow: "ellipsis",
2101
2104
  maxWidth: 0,
2102
- whiteSpace: 'nowrap',
2103
- overflow: 'hidden',
2105
+ whiteSpace: "nowrap",
2106
+ overflow: "hidden",
2104
2107
  variants: {
2105
2108
  splitter: {
2106
2109
  true: {
@@ -2123,6 +2126,7 @@ var Td = styled("td", {
2123
2126
  });
2124
2127
  var Th = styled("th", {
2125
2128
  border: "2px solid $bg04",
2129
+ minWidth: "20px",
2126
2130
  py: "$sm",
2127
2131
  px: "$sm",
2128
2132
  textAlign: "center",
@@ -2145,8 +2149,12 @@ var BoxBorderTop = styled(Box, {
2145
2149
  px: "$sm",
2146
2150
  });
2147
2151
  var AddNewRow = function (_a) {
2148
- var onAddRow = _a.onAddRow, totalSplitFooter = _a.totalSplitFooter;
2149
- return (jsxRuntime.jsxs(Tr, { children: [jsxRuntime.jsx(Td, __assign({ splitter: true }, { children: jsxRuntime.jsx(BoxBorderTop, {}) })), jsxRuntime.jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsxRuntime.jsx(BoxBorderTop, { children: onAddRow && (jsxRuntime.jsx(Button, __assign({ type: "button", css: {
2152
+ var onAddRow = _a.onAddRow, totalSplitFooter = _a.totalSplitFooter, _b = _a.addText, addText = _b === void 0 ? "+ Add Recipient" : _b;
2153
+ return (jsxRuntime.jsxs(Tr, { children: [jsxRuntime.jsx(Td, __assign({ splitter: true }, { children: jsxRuntime.jsx(BoxBorderTop, {}) })), jsxRuntime.jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsxRuntime.jsx(BoxBorderTop, __assign({ css: {
2154
+ "@xs": {
2155
+ px: "$2",
2156
+ },
2157
+ } }, { children: onAddRow && (jsxRuntime.jsxs(Button, __assign({ type: "button", css: {
2150
2158
  color: "$obolGreen",
2151
2159
  justifyContent: "start",
2152
2160
  borderRadius: 0,
@@ -2156,13 +2164,16 @@ var AddNewRow = function (_a) {
2156
2164
  "&:disabled": {
2157
2165
  borderColor: "transparent",
2158
2166
  },
2167
+ "@xs": {
2168
+ px: "$1",
2169
+ },
2159
2170
  }, fullWidth: true, ghost: true, onClick: function (e) {
2160
2171
  e.preventDefault();
2161
2172
  onAddRow();
2162
- }, disabled: totalSplitFooter === 100 }, { children: "+ Add Signer" }))) }) })), jsxRuntime.jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsxRuntime.jsx(BoxBorderTop, { children: jsxRuntime.jsx(Box, { children: totalSplitFooter && "".concat(totalSplitFooter, "%") }) }) }))] }));
2173
+ }, disabled: totalSplitFooter === 100 }, { children: [jsxRuntime.jsx(Box, __assign({ css: { display: "none", "@xs": { display: "inline-block" } } }, { children: "+ Recipient" })), " ", jsxRuntime.jsx(Box, __assign({ css: { "@xs": { display: "none" } } }, { children: addText }))] }))) })) })), jsxRuntime.jsx(Td, __assign({ splitter: true, css: { backgroundColor: "$bg03" } }, { children: jsxRuntime.jsx(BoxBorderTop, { children: jsxRuntime.jsx(Box, { children: totalSplitFooter && "".concat(totalSplitFooter, "%") }) }) }))] }));
2163
2174
  };
2164
2175
  var SplitterTable = function (_a) {
2165
- var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b;
2176
+ var rows = _a.rows, columns = _a.columns, onAddRow = _a.onAddRow, onRemoveRow = _a.onRemoveRow, onUpdateRow = _a.onUpdateRow, _b = _a.totalSplitFooter, totalSplitFooter = _b === void 0 ? 100 : _b, addText = _a.addText;
2166
2177
  return (jsxRuntime.jsxs(StyledTable, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx(Th, {}), columns.map(function (_a, index) {
2167
2178
  var css = _a.css, column = __rest(_a, ["css"]);
2168
2179
  return (jsxRuntime.jsx(Th, __assign({ css: __assign({ textAlign: "start" }, css) }, { children: column.header }), "header-".concat(index)));
@@ -2214,7 +2225,7 @@ var SplitterTable = function (_a) {
2214
2225
  onUpdateRow(row.id, value, column.accessorKey);
2215
2226
  }, min: (_c = (_b = column.cell) === null || _b === void 0 ? void 0 : _b.config) === null || _c === void 0 ? void 0 : _c.min, max: (_e = (_d = column.cell) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e.max, type: (_g = (_f = column.cell) === null || _f === void 0 ? void 0 : _f.config) === null || _g === void 0 ? void 0 : _g.type, readOnly: !isEditable })) }), "cell ".concat(cellIndex)));
2216
2227
  }), onRemoveRow && isRemovable && (jsxRuntime.jsx(Td, __assign({ splitter: true, size: "sm", css: { p: "$2" } }, { children: jsxRuntime.jsx(IconButton, __assign({ ghost: true, onClick: function () { return onRemoveRow(row.id); } }, { children: jsxRuntime.jsx(TrashIcon, {}) })) })))] }, row.id));
2217
- }), jsxRuntime.jsx(AddNewRow, { onAddRow: onAddRow, totalSplitFooter: totalSplitFooter })] })] }));
2228
+ }), jsxRuntime.jsx(AddNewRow, { onAddRow: onAddRow, totalSplitFooter: totalSplitFooter, addText: addText })] })] }));
2218
2229
  };
2219
2230
  var Table = function (_a) {
2220
2231
  var rows = _a.rows, columns = _a.columns;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-ui",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "license": "MIT",