@commonsku/styles 1.17.7 → 1.17.9
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/dist/index.cjs +73 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +73 -33
- package/dist/index.mjs.map +1 -1
- package/dist/styles/icons/EmptyStateArrow.d.ts +6 -0
- package/dist/styles/icons/EmptyStateArrow.d.ts.map +1 -0
- package/dist/styles/icons/index.d.ts +1 -0
- package/dist/styles/icons/index.d.ts.map +1 -1
- package/dist/styles/tables/SelectionTable.d.ts +4 -3
- package/dist/styles/tables/SelectionTable.d.ts.map +1 -1
- package/dist/styles/tables/VirtualTable.d.ts +14 -18
- package/dist/styles/tables/VirtualTable.d.ts.map +1 -1
- package/dist/styles/tables/types.d.ts +7 -2
- package/dist/styles/tables/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2810,6 +2810,45 @@ function SlideInIcon(_a) {
|
|
|
2810
2810
|
React__default.default.createElement("path", { d: "M3 20.99L21 20.99C22.1 20.99 23 20.09 23 18.99L23 15L21 15L21 19.01L3 19.01L3 4.97999L21 4.97999L21 8.99999L23 8.99999L23 4.98999C23 3.88999 22.1 3.00999 21 3.00999L3 3.00999C1.9 3.00999 1 3.88999 1 4.98999L1 18.99C1 20.1 1.9 20.99 3 20.99ZM13 7.99999L9 12L13 16L13 13L23 13L23 11L13 11L13 7.99999ZM3 20.99L21 20.99C22.1 20.99 23 20.09 23 18.99L23 15L21 15L21 19.01L3 19.01L3 4.97999L21 4.97999L21 8.99999L23 8.99999L23 4.98999C23 3.88999 22.1 3.00999 21 3.00999L3 3.00999C1.9 3.00999 1 3.88999 1 4.98999L1 18.99C1 20.1 1.9 20.99 3 20.99ZM13 7.99999L9 12L13 16L13 13L23 13L23 11L13 11L13 7.99999Z", fill: color }));
|
|
2811
2811
|
}
|
|
2812
2812
|
|
|
2813
|
+
function EmptyStateArrowIcon(_a) {
|
|
2814
|
+
var _b = _a.direction, direction = _b === void 0 ? "Up" : _b; _a.altText; var props = __rest(_a, ["direction", "altText"]);
|
|
2815
|
+
var d1, d2, x1, x2, y1, y2;
|
|
2816
|
+
var arrowColor = teal['30'];
|
|
2817
|
+
switch (direction) {
|
|
2818
|
+
case "down":
|
|
2819
|
+
d1 = "m9.239 20.009 2.704.784c.037.011.077.011.114 0l2.704-.784c.164-.048.304.114.207.24l-2.818 3.68a.196.196 0 0 1-.3 0l-2.818-3.68c-.097-.125.043-.288.207-.24Z";
|
|
2820
|
+
d2 = "M5.15 0c5.411 2.2 6.084 16.033 6.084 21h1.57c0-5.275 0-18.5 6.246-21H5.15Z";
|
|
2821
|
+
x1 = 12.636;
|
|
2822
|
+
x2 = 12.636;
|
|
2823
|
+
y1 = 19.98;
|
|
2824
|
+
y2 = 0;
|
|
2825
|
+
break;
|
|
2826
|
+
case "up":
|
|
2827
|
+
d1 = "m14.761 3.991-2.704-.784a.205.205 0 0 0-.114 0L9.24 3.99c-.164.048-.304-.115-.207-.24L11.85.07a.196.196 0 0 1 .3 0l2.818 3.68c.097.126-.043.288-.207.24Z";
|
|
2828
|
+
d2 = "M18.85 24c-5.411-2.2-6.084-16.033-6.084-21h-1.57c0 5.276 0 18.5-6.246 21h13.9Z";
|
|
2829
|
+
x1 = 11.364;
|
|
2830
|
+
x2 = 11.364;
|
|
2831
|
+
y1 = 4.02;
|
|
2832
|
+
y2 = 24;
|
|
2833
|
+
break;
|
|
2834
|
+
case "up-right":
|
|
2835
|
+
d1 = "m22.406 2.203-1.173-.394a.145.145 0 0 0-.092 0l-1.173.394c-.134.044-.247-.108-.169-.227l1.266-1.91a.146.146 0 0 1 .244 0l1.265 1.91c.079.119-.035.271-.168.227Z";
|
|
2836
|
+
d2 = "M6.389 23.515C16.608 15.176 21.225 7.772 21.657 1.721l-.877-.064c.357 2.992-8.819 10.581-19.247 15.372l4.856 6.486Z";
|
|
2837
|
+
x1 = 21.05;
|
|
2838
|
+
x2 = 14.656;
|
|
2839
|
+
y1 = 2.11;
|
|
2840
|
+
y2 = 12.611;
|
|
2841
|
+
break;
|
|
2842
|
+
}
|
|
2843
|
+
return React__default.default.createElement(SVG$1, __assign({ height: 500, width: 500, viewBox: "0 0 633 633", "aria-labelledby": "Arrow" }, props),
|
|
2844
|
+
React__default.default.createElement("path", { fill: arrowColor, d: d1 }),
|
|
2845
|
+
React__default.default.createElement("path", { fill: "url(#a)", d: d2 }),
|
|
2846
|
+
React__default.default.createElement("defs", null,
|
|
2847
|
+
React__default.default.createElement("linearGradient", { id: "a", x1: x1, x2: x2, y1: y1, y2: y2, gradientUnits: "userSpaceOnUse" },
|
|
2848
|
+
React__default.default.createElement("stop", { stopColor: arrowColor }),
|
|
2849
|
+
React__default.default.createElement("stop", { offset: 1, stopColor: arrowColor, stopOpacity: 0 }))));
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2813
2852
|
function TagIcon(_a) {
|
|
2814
2853
|
var _b = _a.color, color = _b === void 0 ? teal.main : _b, _c = _a.size, size = _c === void 0 ? "medium" : _c; _a.altText; var props = __rest(_a, ["color", "size", "altText"]);
|
|
2815
2854
|
return React__default.default.createElement(SVG$1, __assign({ size: size, "aria-labelledby": "TagIcon" }, props),
|
|
@@ -3653,7 +3692,7 @@ var LabeledIconInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
3653
3692
|
}, style: __assign(__assign(__assign(__assign({}, activeStyles), errorStyles), disabledStyles), (props.style || {})), onMouseOver: function () { return setIsHovering(true); }, onMouseLeave: function () { return setIsHovering(false); } }),
|
|
3654
3693
|
iconPosition !== 'right' ? React__default.default.createElement(InputIconLabel, { style: __assign({ marginBottom: 0 }, iconLabelStyles), isActive: isActive, isDisabled: disabled, isHover: isHovering }, NewIcon) : null,
|
|
3655
3694
|
React__default.default.createElement(Input, { hasIcon: true, ref: ref, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, readOnly: readOnly, required: required, style: { marginBottom: 0, }, noMargin: noMargin, error: error, disabled: disabled, onFocus: onFocus, onChange: onChange, onBlur: onBlur }),
|
|
3656
|
-
iconPosition === 'right' ? React__default.default.createElement(InputIconLabel, { style: { marginBottom: 0, padding: 6
|
|
3695
|
+
iconPosition === 'right' ? React__default.default.createElement(InputIconLabel, { style: __assign({ marginBottom: 0, padding: 6 }, iconLabelStyles), isActive: isActive, isDisabled: disabled, isHover: isHovering, iconPosition: iconPosition }, NewIcon) : null)));
|
|
3657
3696
|
});
|
|
3658
3697
|
var CheckboxLabel = styled__default.default.label(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["\n &&& {\n display: inline-flex;\n position: relative;\n margin-bottom: 12px;\n margin-right: 24px;\n cursor: ", ";\n font-size: ", ";\n color: ", ";\n font-family: ", ";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n font-weight: normal;\n line-height: ", ";\n box-sizing: border-box;\n opacity: ", ";\n &:focus {\n outline: 0;\n }\n }\n"], ["\n &&& {\n display: inline-flex;\n position: relative;\n margin-bottom: 12px;\n margin-right: 24px;\n cursor: ", ";\n font-size: ", ";\n color: ", ";\n font-family: ", ";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n font-weight: normal;\n line-height: ", ";\n box-sizing: border-box;\n opacity: ", ";\n &:focus {\n outline: 0;\n }\n }\n"])), function (props) { return props.disabled ? 'default' : 'pointer'; }, fontStyles.label.fontSize, neutrals.darkest, fontStyles.label.fontFamily, fontStyles.label.lineHeight, function (props) { return props.disabled ? 0.7 : 1; });
|
|
3659
3698
|
var RadioLabel = styled__default.default(CheckboxLabel)(templateObject_5$7 || (templateObject_5$7 = __makeTemplateObject(["\n &&& {\n padding-left: 32px;\n }\n"], ["\n &&& {\n padding-left: 32px;\n }\n"])));
|
|
@@ -6800,50 +6839,51 @@ var VirtualTableStyles = styled__default.default.div(templateObject_1$a || (temp
|
|
|
6800
6839
|
var templateObject_1$a;
|
|
6801
6840
|
|
|
6802
6841
|
var SelectionTable = function (props) {
|
|
6803
|
-
var columns = props.columns,
|
|
6804
|
-
var _a = React.useState(props.data.map(function (row) { return (__assign({ selected: false }, row)); })), data = _a[0], setData = _a[1];
|
|
6842
|
+
var columns = props.columns, data = props.data, selectedRows = props.selectedRows, onSelectionChange = props.onSelectionChange;
|
|
6805
6843
|
var selectionState = React.useMemo(function () {
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6844
|
+
if (selectedRows == null)
|
|
6845
|
+
return "none";
|
|
6846
|
+
switch (selectedRows.length) {
|
|
6847
|
+
case 0:
|
|
6848
|
+
return 'none';
|
|
6849
|
+
case data.length:
|
|
6850
|
+
return 'all';
|
|
6851
|
+
default:
|
|
6852
|
+
return 'some';
|
|
6853
|
+
}
|
|
6854
|
+
}, [data.length, selectedRows]);
|
|
6855
|
+
var handleSelectRows = React.useCallback(function (rows) {
|
|
6856
|
+
if (onSelectionChange == null)
|
|
6857
|
+
return;
|
|
6858
|
+
if (selectedRows == null) {
|
|
6859
|
+
onSelectionChange(rows);
|
|
6860
|
+
return;
|
|
6861
|
+
}
|
|
6862
|
+
var newSelection = selectedRows.filter(function (row) { return !rows.includes(row); });
|
|
6863
|
+
newSelection.push.apply(newSelection, rows.filter(function (row) { return !selectedRows.includes(row); }));
|
|
6864
|
+
onSelectionChange(newSelection);
|
|
6865
|
+
}, [selectedRows, onSelectionChange]);
|
|
6812
6866
|
var handleSelectHeader = React.useCallback(function () {
|
|
6867
|
+
if (onSelectionChange == null)
|
|
6868
|
+
return;
|
|
6813
6869
|
switch (selectionState) {
|
|
6814
6870
|
case 'none':
|
|
6815
|
-
|
|
6871
|
+
onSelectionChange(__spreadArray([], data, true));
|
|
6816
6872
|
break;
|
|
6817
6873
|
case 'all':
|
|
6818
|
-
case '
|
|
6819
|
-
|
|
6874
|
+
case 'some':
|
|
6875
|
+
onSelectionChange([]);
|
|
6820
6876
|
break;
|
|
6821
6877
|
}
|
|
6822
|
-
}, [data,
|
|
6823
|
-
var
|
|
6824
|
-
setData(function (prev) { return prev.map(function (row, index) {
|
|
6825
|
-
if (rowIndex !== index)
|
|
6826
|
-
return row;
|
|
6827
|
-
if (onSelectRow != null) {
|
|
6828
|
-
onSelectRow(row, rowIndex);
|
|
6829
|
-
}
|
|
6830
|
-
return __assign(__assign({}, row), { selected: rowIndex === index
|
|
6831
|
-
? !row.selected
|
|
6832
|
-
: row.selected });
|
|
6833
|
-
}); });
|
|
6834
|
-
}, [onSelectRow]);
|
|
6835
|
-
var selectionHeader = React.useMemo(function () { return (React__default.default.createElement(LabeledCheckbox, { label: "", checked: selectionState === 'all', indeterminate: selectionState === 'indeterminate', onChange: handleSelectHeader })); }, [selectionState, handleSelectHeader]);
|
|
6878
|
+
}, [selectionState, data, onSelectionChange]);
|
|
6879
|
+
var selectionHeader = React.useMemo(function () { return (React__default.default.createElement(LabeledCheckbox, { label: "", checked: selectionState === 'all', indeterminate: selectionState === 'some', onChange: handleSelectHeader })); }, [selectionState, handleSelectHeader]);
|
|
6836
6880
|
var selectionColumn = React.useMemo(function () { return ({
|
|
6837
6881
|
Header: selectionHeader,
|
|
6838
6882
|
accessor: 'selected',
|
|
6839
|
-
Cell: function (
|
|
6840
|
-
return (React__default.default.createElement(LabeledCheckbox, { label: "", checked: cellObj.row.original.selected, onChange: function () { return handleSelectRow(cellObj.row.index); } }));
|
|
6841
|
-
},
|
|
6842
|
-
sticky: 'left',
|
|
6843
|
-
noDrag: true,
|
|
6883
|
+
Cell: function (cell) { return (React__default.default.createElement(LabeledCheckbox, { label: "", checked: selectedRows != null && selectedRows.includes(cell.row.original), onChange: function () { return handleSelectRows([cell.row.original]); } })); },
|
|
6844
6884
|
width: 40,
|
|
6845
6885
|
disableSortBy: true,
|
|
6846
|
-
}); }, [
|
|
6886
|
+
}); }, [selectedRows, selectionHeader, handleSelectRows]);
|
|
6847
6887
|
return (React__default.default.createElement(VirtualTable, __assign({}, props, { columns: __spreadArray([selectionColumn], columns, true), data: data, minWidth: 40 })));
|
|
6848
6888
|
};
|
|
6849
6889
|
|
|
@@ -7972,6 +8012,7 @@ exports.DropzonedPreviews = DropzonedPreviews;
|
|
|
7972
8012
|
exports.EPOIcon = EPOIcon;
|
|
7973
8013
|
exports.EditIcon = EditIcon;
|
|
7974
8014
|
exports.EllipsisIcon = EllipsisIcon;
|
|
8015
|
+
exports.EmptyStateArrow = EmptyStateArrowIcon;
|
|
7975
8016
|
exports.EpsIcon = EpsIcon;
|
|
7976
8017
|
exports.ErrorBoundary = ErrorBoundary;
|
|
7977
8018
|
exports.EstimateCircleIcon = EstimateCircleIcon;
|