@helpdice/ui 1.2.9 → 1.3.0

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.
@@ -989,112 +989,47 @@ var useTheme = function useTheme() {
989
989
  return React.useContext(ThemeContext);
990
990
  };
991
991
 
992
- var makeColgroup = function makeColgroup(width, columns) {
993
- var unsetWidthCount = columns.filter(function (c) {
994
- return !c.width;
995
- }).length;
996
- var customWidthTotal = columns.reduce(function (pre, current) {
997
- return current.width ? pre + current.width : pre;
998
- }, 0);
999
- var averageWidth = (width - customWidthTotal) / unsetWidthCount;
1000
- if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
1001
- return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
1002
- return /*#__PURE__*/React.createElement("col", {
1003
- key: "colgroup-".concat(index),
1004
- width: column.width || averageWidth
1005
- });
1006
- }));
1007
- };
1008
- var TableHead = function TableHead(props) {
992
+ var InputLabel = function InputLabel(_ref) {
993
+ var children = _ref.children,
994
+ isRight = _ref.isRight;
1009
995
  var theme = useTheme();
1010
- var _ref = props,
1011
- columns = _ref.columns,
1012
- width = _ref.width;
1013
- var isScalableWidth = React.useMemo(function () {
1014
- return columns.find(function (item) {
1015
- return !!item.width;
1016
- });
1017
- }, [columns]);
1018
- var colgroup = React.useMemo(function () {
1019
- if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
1020
- return makeColgroup(width, columns);
1021
- }, [isScalableWidth, width]);
1022
- return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
1023
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
1024
- }, /*#__PURE__*/React.createElement("tr", {
1025
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
1026
- }, columns.map(function (column, index) {
1027
- return /*#__PURE__*/React.createElement("th", {
1028
- style: {
1029
- // textAlign: `${column?.align} !important`,
1030
- // paddingLeft: '0.3rem',
1031
- // paddingRight: '0.3rem',
1032
- // color: `${column?.color}`,
1033
- whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
1034
- },
1035
- key: "table-th-".concat(column.prop.toString(), "-").concat(index),
1036
- "data-column": column.label,
1037
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
1038
- }, /*#__PURE__*/React.createElement("div", {
1039
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
1040
- }, column.label, /*#__PURE__*/React.createElement("br", {
1041
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
1042
- }), /*#__PURE__*/React.createElement("span", {
1043
- style: {
1044
- textAlign: 'center'
1045
- },
1046
- className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
1047
- }, column.text)));
1048
- }))), /*#__PURE__*/React.createElement(_JSXStyle, {
1049
- id: "134865897",
1050
- dynamic: [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
1051
- }, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:".concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
996
+ return /*#__PURE__*/React.createElement("span", {
997
+ className: _JSXStyle.dynamic([["3089782703", [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]]]) + " " + ((isRight ? 'right' : '') || "")
998
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
999
+ id: "3089782703",
1000
+ dynamic: [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]
1001
+ }, "span.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:initial;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;margin:0;padding:0 ".concat(theme.layout.gapHalf, ";color:").concat(theme.palette.accents_4, ";background-color:").concat(theme.palette.accents_1, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";border-top:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-bottom:1px solid ").concat(theme.palette.border, ";font-size:inherit;line-height:1;}span.right.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";border-left:0;border-right:1px solid ").concat(theme.palette.border, ";}")));
1052
1002
  };
1053
- TableHead.displayName = 'TableHead';
1003
+ var MemoInputLabel = /*#__PURE__*/React.memo(InputLabel);
1054
1004
 
1055
- var TableCell = function TableCell(_ref) {
1056
- var columns = _ref.columns,
1057
- row = _ref.row,
1058
- rowIndex = _ref.rowIndex,
1059
- emptyText = _ref.emptyText,
1060
- onCellClick = _ref.onCellClick;
1061
- /* eslint-disable react/jsx-no-useless-fragment */
1062
- return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
1063
- var currentRowValue = row[column.prop];
1064
- var cellValue = currentRowValue || emptyText;
1065
- var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
1066
- return /*#__PURE__*/React.createElement("td", {
1067
- style: _objectSpread2({
1068
- fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
1069
- textAlign: "".concat(column === null || column === undefined ? undefined : column.align, " !important"),
1070
- paddingLeft: '0.3rem',
1071
- paddingRight: '0.3rem',
1072
- color: "".concat(column === null || column === undefined ? undefined : column.color),
1073
- whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
1074
- }, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
1075
- "data-column": column.label,
1076
- key: "row-td-".concat(index, "-").concat(column.prop.toString()),
1077
- onClick: function onClick() {
1078
- return onCellClick && onCellClick(currentRowValue, rowIndex, index);
1079
- },
1080
- className: column.className
1081
- }, /*#__PURE__*/React.createElement("div", {
1082
- className: "cell"
1083
- }, shouldBeRenderElement ? shouldBeRenderElement : cellValue));
1084
- }));
1085
- /* eslint-enable */
1005
+ var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
1006
+ var children = _ref.children;
1007
+ var theme = useTheme();
1008
+ return /*#__PURE__*/React.createElement("label", {
1009
+ className: _JSXStyle.dynamic([["1278828862", [theme.palette.accents_6]]])
1010
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
1011
+ id: "1278828862",
1012
+ dynamic: [theme.palette.accents_6]
1013
+ }, "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
1086
1014
  };
1015
+ InputBlockLabelComponent.displayName = 'GeistInputBlockLabel';
1016
+ var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
1087
1017
 
1088
- /* "use client" */
1089
-
1090
- var defaultContext$3 = {
1091
- columns: [],
1092
- updateColumn: function updateColumn() {}
1093
- };
1094
- var TableContext = /*#__PURE__*/React.createContext(defaultContext$3);
1095
- var useTableContext = function useTableContext() {
1096
- return React.useContext(TableContext);
1018
+ var InputIconComponent = function InputIconComponent(_ref) {
1019
+ var icon = _ref.icon,
1020
+ _ref$clickable = _ref.clickable,
1021
+ clickable = _ref$clickable === undefined ? false : _ref$clickable,
1022
+ onClick = _ref.onClick;
1023
+ return /*#__PURE__*/React.createElement("span", {
1024
+ onClick: onClick,
1025
+ className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon"
1026
+ }, icon, /*#__PURE__*/React.createElement(_JSXStyle, {
1027
+ id: "4247656379",
1028
+ dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']
1029
+ }, ".input-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;line-height:1;position:relative;cursor:".concat(clickable ? 'pointer' : 'default', ";pointer-events:").concat(clickable ? 'auto' : 'none', ";}.input-icon.__jsx-style-dynamic-selector svg{width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
1097
1030
  };
1031
+ InputIconComponent.displayName = 'GeistInputIcon';
1032
+ var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
1098
1033
 
1099
1034
  /* "use client" */
1100
1035
 
@@ -1129,31 +1064,663 @@ var useClasses = function useClasses() {
1129
1064
  return classes.trim();
1130
1065
  };
1131
1066
 
1132
- var lodash$1 = {exports: {}};
1067
+ var InputIconClear = function InputIconClear(_ref) {
1068
+ var onClick = _ref.onClick,
1069
+ disabled = _ref.disabled,
1070
+ visible = _ref.visible;
1071
+ var theme = useTheme();
1072
+ var classes = useClasses('clear-icon', {
1073
+ visible: visible
1074
+ });
1075
+ var clickHandler = function clickHandler(event) {
1076
+ event.preventDefault();
1077
+ event.stopPropagation();
1078
+ event.nativeEvent.stopImmediatePropagation();
1079
+ onClick && onClick(event);
1080
+ };
1081
+ return /*#__PURE__*/React.createElement("div", {
1082
+ onClick: clickHandler,
1083
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]]) + " " + (classes || "")
1084
+ }, /*#__PURE__*/React.createElement("svg", {
1085
+ viewBox: "0 0 24 24",
1086
+ stroke: "currentColor",
1087
+ strokeWidth: "1.5",
1088
+ strokeLinecap: "round",
1089
+ strokeLinejoin: "round",
1090
+ fill: "none",
1091
+ shapeRendering: "geometricPrecision",
1092
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
1093
+ }, /*#__PURE__*/React.createElement("path", {
1094
+ d: "M18 6L6 18",
1095
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
1096
+ }), /*#__PURE__*/React.createElement("path", {
1097
+ d: "M6 6l12 12",
1098
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
1099
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
1100
+ id: "1567030211",
1101
+ dynamic: [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]
1102
+ }, ".clear-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;margin:0;padding:0;color:").concat(theme.palette.accents_3, ";visibility:hidden;opacity:0;}.visible.__jsx-style-dynamic-selector{visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(disabled ? theme.palette.accents_3 : theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
1103
+ };
1104
+ var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
1133
1105
 
1134
- /**
1135
- * @license
1136
- * Lodash <https://lodash.com/>
1137
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1138
- * Released under MIT license <https://lodash.com/license>
1139
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1140
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1141
- */
1142
- var lodash = lodash$1.exports;
1106
+ var getColors$2 = function getColors(palette, status) {
1107
+ var colors = {
1108
+ "default": {
1109
+ color: palette.foreground,
1110
+ borderColor: palette.border,
1111
+ hoverBorder: palette.accents_5
1112
+ },
1113
+ secondary: {
1114
+ color: palette.foreground,
1115
+ borderColor: palette.secondary,
1116
+ hoverBorder: palette.secondary
1117
+ },
1118
+ success: {
1119
+ color: palette.foreground,
1120
+ borderColor: palette.successLight,
1121
+ hoverBorder: palette.success
1122
+ },
1123
+ warning: {
1124
+ color: palette.foreground,
1125
+ borderColor: palette.warningLight,
1126
+ hoverBorder: palette.warning
1127
+ },
1128
+ error: {
1129
+ color: palette.error,
1130
+ borderColor: palette.error,
1131
+ hoverBorder: palette.errorDark
1132
+ }
1133
+ };
1134
+ if (!status) return colors["default"];
1135
+ return colors[status];
1136
+ };
1143
1137
 
1144
- var hasRequiredLodash;
1138
+ /* "use client" */
1145
1139
 
1146
- function requireLodash () {
1147
- if (hasRequiredLodash) return lodash$1.exports;
1148
- hasRequiredLodash = 1;
1149
- (function (module, exports) {
1150
- (function() {
1140
+ var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'pl', 'pr', 'pt', 'pb', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'ml', 'mr', 'mt', 'mb', 'px', 'py', 'mx', 'my', 'font', 'unit', 'scale'];
1141
+ var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
1142
+ return "".concat(scale1x);
1143
+ };
1144
+ var defaultContext$3 = {
1145
+ getScaleProps: function getScaleProps() {
1146
+ return undefined;
1147
+ },
1148
+ getAllScaleProps: function getAllScaleProps() {
1149
+ return {};
1150
+ },
1151
+ SCALES: {
1152
+ pl: defaultDynamicLayoutPipe,
1153
+ pr: defaultDynamicLayoutPipe,
1154
+ pb: defaultDynamicLayoutPipe,
1155
+ pt: defaultDynamicLayoutPipe,
1156
+ px: defaultDynamicLayoutPipe,
1157
+ py: defaultDynamicLayoutPipe,
1158
+ mb: defaultDynamicLayoutPipe,
1159
+ ml: defaultDynamicLayoutPipe,
1160
+ mr: defaultDynamicLayoutPipe,
1161
+ mt: defaultDynamicLayoutPipe,
1162
+ mx: defaultDynamicLayoutPipe,
1163
+ my: defaultDynamicLayoutPipe,
1164
+ width: defaultDynamicLayoutPipe,
1165
+ height: defaultDynamicLayoutPipe,
1166
+ font: defaultDynamicLayoutPipe
1167
+ },
1168
+ unit: '16px'
1169
+ };
1170
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$3);
1171
+ var useScale = function useScale() {
1172
+ return React.useContext(ScaleContext);
1173
+ };
1151
1174
 
1152
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
1153
- var undefined$1;
1175
+ /* "use client" */
1154
1176
 
1155
- /** Used as the semantic version number. */
1156
- var VERSION = '4.17.21';
1177
+ var getId = function getId() {
1178
+ return Math.random().toString(32).slice(2, 10);
1179
+ };
1180
+ var pickChildByProps = function pickChildByProps(children, key, value) {
1181
+ var target = [];
1182
+ var isArray = Array.isArray(value);
1183
+ var withoutPropChildren = React.Children.map(children, function (item) {
1184
+ if (! /*#__PURE__*/React.isValidElement(item)) return null;
1185
+ if (!item.props) return item;
1186
+ if (isArray) {
1187
+ if (value.includes(item.props[key])) {
1188
+ target.push(item);
1189
+ return null;
1190
+ }
1191
+ return item;
1192
+ }
1193
+ if (item.props[key] === value) {
1194
+ target.push(item);
1195
+ return null;
1196
+ }
1197
+ return item;
1198
+ });
1199
+ var targetChildren = target.length >= 0 ? target : undefined;
1200
+ return [withoutPropChildren, targetChildren];
1201
+ };
1202
+ var isBrowser = function isBrowser() {
1203
+ return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1204
+ };
1205
+ var isCSSNumberValue = function isCSSNumberValue(value) {
1206
+ return value !== undefined && !Number.isNaN(+value);
1207
+ };
1208
+
1209
+ var generateGetScaleProps = function generateGetScaleProps(props) {
1210
+ var getScaleProps = function getScaleProps(keyOrKeys) {
1211
+ if (!Array.isArray(keyOrKeys)) return props[keyOrKeys];
1212
+ var value = undefined;
1213
+ var _iterator = _createForOfIteratorHelper(keyOrKeys),
1214
+ _step;
1215
+ try {
1216
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1217
+ var key = _step.value;
1218
+ var currentValue = props[key];
1219
+ if (typeof currentValue !== 'undefined') {
1220
+ value = currentValue;
1221
+ }
1222
+ }
1223
+ } catch (err) {
1224
+ _iterator.e(err);
1225
+ } finally {
1226
+ _iterator.f();
1227
+ }
1228
+ return value;
1229
+ };
1230
+ return getScaleProps;
1231
+ };
1232
+ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
1233
+ var getAllScaleProps = function getAllScaleProps() {
1234
+ var scaleProps = {};
1235
+ var _iterator2 = _createForOfIteratorHelper(ScalePropKeys),
1236
+ _step2;
1237
+ try {
1238
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1239
+ var key = _step2.value;
1240
+ var value = props[key];
1241
+ if (typeof value !== 'undefined') {
1242
+ scaleProps[key] = value;
1243
+ }
1244
+ }
1245
+ } catch (err) {
1246
+ _iterator2.e(err);
1247
+ } finally {
1248
+ _iterator2.f();
1249
+ }
1250
+ return scaleProps;
1251
+ };
1252
+ return getAllScaleProps;
1253
+ };
1254
+
1255
+ var _excluded$e = ["children"];
1256
+ var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1257
+ if (scale === 1) return scale;
1258
+ var diff = Math.abs((scale - 1) / 2);
1259
+ return scale > 1 ? 1 + diff : 1 - diff;
1260
+ };
1261
+ var withScale = function withScale(Render) {
1262
+ var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1263
+ var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
1264
+ var children = _ref.children,
1265
+ props = _objectWithoutProperties(_ref, _excluded$e);
1266
+ var _useTheme = useTheme(),
1267
+ layout = _useTheme.layout;
1268
+ var paddingLeft = props.paddingLeft,
1269
+ pl = props.pl,
1270
+ paddingRight = props.paddingRight,
1271
+ pr = props.pr,
1272
+ paddingTop = props.paddingTop,
1273
+ pt = props.pt,
1274
+ paddingBottom = props.paddingBottom,
1275
+ pb = props.pb,
1276
+ marginTop = props.marginTop,
1277
+ mt = props.mt,
1278
+ marginRight = props.marginRight,
1279
+ mr = props.mr,
1280
+ marginBottom = props.marginBottom,
1281
+ mb = props.mb,
1282
+ marginLeft = props.marginLeft,
1283
+ ml = props.ml,
1284
+ px = props.px,
1285
+ py = props.py,
1286
+ mx = props.mx,
1287
+ my = props.my,
1288
+ width = props.width,
1289
+ height = props.height,
1290
+ font = props.font,
1291
+ w = props.w,
1292
+ h = props.h,
1293
+ margin = props.margin,
1294
+ padding = props.padding,
1295
+ _props$unit = props.unit,
1296
+ unit = _props$unit === undefined ? layout.unit : _props$unit,
1297
+ _props$scale = props.scale,
1298
+ scale = _props$scale === undefined ? 1 : _props$scale;
1299
+ var makeScaleHandler = function makeScaleHandler(attrValue) {
1300
+ return function (scale1x, defaultValue) {
1301
+ // 0 means disable scale and the default value is 0
1302
+ if (scale1x === 0) {
1303
+ scale1x = 1;
1304
+ defaultValue = defaultValue || 0;
1305
+ }
1306
+ var factor = reduceScaleCoefficient(scale) * scale1x;
1307
+ if (typeof attrValue === 'undefined') {
1308
+ if (typeof defaultValue !== 'undefined') return "".concat(defaultValue);
1309
+ return "calc(".concat(factor, " * ").concat(unit, ")");
1310
+ }
1311
+ if (!isCSSNumberValue(attrValue)) return "".concat(attrValue);
1312
+ var customFactor = factor * Number(attrValue);
1313
+ return "calc(".concat(customFactor, " * ").concat(unit, ")");
1314
+ };
1315
+ };
1316
+ var value = {
1317
+ unit: unit,
1318
+ SCALES: {
1319
+ pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== undefined ? paddingTop : pt) !== null && _ref3 !== undefined ? _ref3 : py) !== null && _ref2 !== undefined ? _ref2 : padding),
1320
+ pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== undefined ? paddingRight : pr) !== null && _ref5 !== undefined ? _ref5 : px) !== null && _ref4 !== undefined ? _ref4 : padding),
1321
+ pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : pb) !== null && _ref7 !== undefined ? _ref7 : py) !== null && _ref6 !== undefined ? _ref6 : padding),
1322
+ pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : pl) !== null && _ref9 !== undefined ? _ref9 : px) !== null && _ref8 !== undefined ? _ref8 : padding),
1323
+ px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== undefined ? px : paddingLeft) !== null && _ref13 !== undefined ? _ref13 : paddingRight) !== null && _ref12 !== undefined ? _ref12 : pl) !== null && _ref11 !== undefined ? _ref11 : pr) !== null && _ref10 !== undefined ? _ref10 : padding),
1324
+ py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== undefined ? py : paddingTop) !== null && _ref17 !== undefined ? _ref17 : paddingBottom) !== null && _ref16 !== undefined ? _ref16 : pt) !== null && _ref15 !== undefined ? _ref15 : pb) !== null && _ref14 !== undefined ? _ref14 : padding),
1325
+ mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== undefined ? marginTop : mt) !== null && _ref19 !== undefined ? _ref19 : my) !== null && _ref18 !== undefined ? _ref18 : margin),
1326
+ mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== undefined ? marginRight : mr) !== null && _ref21 !== undefined ? _ref21 : mx) !== null && _ref20 !== undefined ? _ref20 : margin),
1327
+ mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== undefined ? marginBottom : mb) !== null && _ref23 !== undefined ? _ref23 : my) !== null && _ref22 !== undefined ? _ref22 : margin),
1328
+ ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== undefined ? marginLeft : ml) !== null && _ref25 !== undefined ? _ref25 : mx) !== null && _ref24 !== undefined ? _ref24 : margin),
1329
+ mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== undefined ? mx : marginLeft) !== null && _ref29 !== undefined ? _ref29 : marginRight) !== null && _ref28 !== undefined ? _ref28 : ml) !== null && _ref27 !== undefined ? _ref27 : mr) !== null && _ref26 !== undefined ? _ref26 : margin),
1330
+ my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== undefined ? my : marginTop) !== null && _ref33 !== undefined ? _ref33 : marginBottom) !== null && _ref32 !== undefined ? _ref32 : mt) !== null && _ref31 !== undefined ? _ref31 : mb) !== null && _ref30 !== undefined ? _ref30 : margin),
1331
+ width: makeScaleHandler(width !== null && width !== undefined ? width : w),
1332
+ height: makeScaleHandler(height !== null && height !== undefined ? height : h),
1333
+ font: makeScaleHandler(font)
1334
+ },
1335
+ getScaleProps: generateGetScaleProps(props),
1336
+ getAllScaleProps: generateGetAllScaleProps(props)
1337
+ };
1338
+ return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
1339
+ value: value
1340
+ }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
1341
+ ref: ref
1342
+ }), children));
1343
+ });
1344
+ ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
1345
+ return ScaleFC;
1346
+ };
1347
+
1348
+ var _excluded$d = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1349
+ var simulateChangeEvent = function simulateChangeEvent(el, event) {
1350
+ return _objectSpread2(_objectSpread2({}, event), {}, {
1351
+ target: el,
1352
+ currentTarget: el
1353
+ });
1354
+ };
1355
+ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1356
+ var label = _ref.label,
1357
+ labelRight = _ref.labelRight,
1358
+ _ref$type = _ref.type,
1359
+ type = _ref$type === undefined ? 'default' : _ref$type,
1360
+ error = _ref.error,
1361
+ _ref$htmlType = _ref.htmlType,
1362
+ htmlType = _ref$htmlType === undefined ? 'text' : _ref$htmlType,
1363
+ icon = _ref.icon,
1364
+ iconRight = _ref.iconRight,
1365
+ _ref$iconClickable = _ref.iconClickable,
1366
+ iconClickable = _ref$iconClickable === undefined ? false : _ref$iconClickable,
1367
+ onIconClick = _ref.onIconClick,
1368
+ _ref$initialValue = _ref.initialValue,
1369
+ initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
1370
+ onChange = _ref.onChange,
1371
+ _ref$readOnly = _ref.readOnly,
1372
+ readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
1373
+ value = _ref.value,
1374
+ onClearClick = _ref.onClearClick,
1375
+ _ref$clearable = _ref.clearable,
1376
+ clearable = _ref$clearable === undefined ? false : _ref$clearable,
1377
+ _ref$className = _ref.className,
1378
+ className = _ref$className === undefined ? '' : _ref$className,
1379
+ onBlur = _ref.onBlur,
1380
+ onFocus = _ref.onFocus,
1381
+ _ref$autoComplete = _ref.autoComplete,
1382
+ autoComplete = _ref$autoComplete === undefined ? 'off' : _ref$autoComplete,
1383
+ _ref$placeholder = _ref.placeholder,
1384
+ placeholder = _ref$placeholder === undefined ? '' : _ref$placeholder,
1385
+ children = _ref.children,
1386
+ _ref$disabled = _ref.disabled,
1387
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
1388
+ props = _objectWithoutProperties(_ref, _excluded$d);
1389
+ var theme = useTheme();
1390
+ var _useScale = useScale(),
1391
+ SCALES = _useScale.SCALES;
1392
+ var inputRef = React.useRef(null);
1393
+ React.useImperativeHandle(ref, function () {
1394
+ return inputRef.current;
1395
+ });
1396
+ var _useState = React.useState(initialValue),
1397
+ _useState2 = _slicedToArray(_useState, 2),
1398
+ selfValue = _useState2[0],
1399
+ setSelfValue = _useState2[1];
1400
+ var _useState3 = React.useState(false),
1401
+ _useState4 = _slicedToArray(_useState3, 2),
1402
+ hover = _useState4[0],
1403
+ setHover = _useState4[1];
1404
+ var isControlledComponent = React.useMemo(function () {
1405
+ return value !== undefined;
1406
+ }, [value]);
1407
+ var labelClasses = React.useMemo(function () {
1408
+ return labelRight ? 'right-label' : label ? 'left-label' : '';
1409
+ }, [label, labelRight]);
1410
+ var iconClasses = React.useMemo(function () {
1411
+ return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
1412
+ }, [icon, iconRight]);
1413
+ var _useMemo = React.useMemo(function () {
1414
+ return getColors$2(theme.palette, type);
1415
+ }, [theme.palette, type]),
1416
+ color = _useMemo.color,
1417
+ borderColor = _useMemo.borderColor,
1418
+ hoverBorder = _useMemo.hoverBorder;
1419
+ var changeHandler = function changeHandler(event) {
1420
+ if (disabled || readOnly) return;
1421
+ setSelfValue(event.target.value);
1422
+ onChange && onChange(event);
1423
+ };
1424
+ var clearHandler = function clearHandler(event) {
1425
+ setSelfValue('');
1426
+ onClearClick && onClearClick(event);
1427
+ /* istanbul ignore next */
1428
+ if (!inputRef.current) return;
1429
+ var changeEvent = simulateChangeEvent(inputRef.current, event);
1430
+ changeEvent.target.value = '';
1431
+ onChange && onChange(changeEvent);
1432
+ inputRef.current.focus();
1433
+ };
1434
+ var focusHandler = function focusHandler(e) {
1435
+ setHover(true);
1436
+ onFocus && onFocus(e);
1437
+ };
1438
+ var blurHandler = function blurHandler(e) {
1439
+ setHover(false);
1440
+ onBlur && onBlur(e);
1441
+ };
1442
+ var iconClickHandler = function iconClickHandler(e) {
1443
+ if (disabled) return;
1444
+ onIconClick && onIconClick(e);
1445
+ };
1446
+ var iconProps = React.useMemo(function () {
1447
+ return {
1448
+ clickable: iconClickable,
1449
+ onClick: iconClickHandler
1450
+ };
1451
+ }, [iconClickable, iconClickHandler]);
1452
+ React.useEffect(function () {
1453
+ if (isControlledComponent) {
1454
+ setSelfValue(value);
1455
+ }
1456
+ });
1457
+ var controlledValue = isControlledComponent ? {
1458
+ value: selfValue
1459
+ } : {
1460
+ defaultValue: initialValue
1461
+ };
1462
+ var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
1463
+ return /*#__PURE__*/React.createElement("div", {
1464
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "with-label"
1465
+ }, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
1466
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-container', className) || "")
1467
+ }, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
1468
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-wrapper', {
1469
+ hover: hover,
1470
+ disabled: disabled
1471
+ }, labelClasses) || "")
1472
+ }, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
1473
+ icon: icon
1474
+ }, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
1475
+ type: htmlType,
1476
+ ref: inputRef,
1477
+ placeholder: placeholder,
1478
+ disabled: disabled,
1479
+ readOnly: readOnly,
1480
+ onFocus: focusHandler,
1481
+ onBlur: blurHandler,
1482
+ onChange: changeHandler,
1483
+ autoComplete: autoComplete
1484
+ }, inputProps, {
1485
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
1486
+ disabled: disabled
1487
+ }, iconClasses) || "")
1488
+ })), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
1489
+ visible: Boolean(inputRef.current && inputRef.current.value !== ''),
1490
+ disabled: disabled || readOnly,
1491
+ onClick: clearHandler
1492
+ }), iconRight && /*#__PURE__*/React.createElement(InputIcon, _extends({
1493
+ icon: iconRight
1494
+ }, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
1495
+ isRight: true
1496
+ }, labelRight), /*#__PURE__*/React.createElement("br", {
1497
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]])
1498
+ })), error && /*#__PURE__*/React.createElement("p", {
1499
+ style: {
1500
+ marginTop: 0.4,
1501
+ marginRight: 0,
1502
+ marginLeft: 0,
1503
+ marginBottom: '0.4rem',
1504
+ textAlign: 'left'
1505
+ },
1506
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "input-error"
1507
+ }, error), /*#__PURE__*/React.createElement(_JSXStyle, {
1508
+ id: "1424341926",
1509
+ dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]
1510
+ }, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'initial'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, 'initial'), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
1511
+ });
1512
+ InputComponent.displayName = 'Input';
1513
+ var Input = withScale(InputComponent);
1514
+
1515
+ var tuple = function tuple() {
1516
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1517
+ args[_key] = arguments[_key];
1518
+ }
1519
+ return args;
1520
+ };
1521
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1522
+ tuple('default', 'secondary', 'success', 'warning', 'error');
1523
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1524
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1525
+ tuple('default', 'silent', 'prevent');
1526
+ tuple('hover', 'click');
1527
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1528
+ tuple('start', 'center', 'end', 'left', 'right');
1529
+
1530
+ var _excluded$c = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1531
+ tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1532
+ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1533
+ var _ref$type = _ref.type,
1534
+ type = _ref$type === undefined ? 'default' : _ref$type,
1535
+ _ref$disabled = _ref.disabled,
1536
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
1537
+ _ref$readOnly = _ref.readOnly,
1538
+ readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
1539
+ onFocus = _ref.onFocus,
1540
+ onBlur = _ref.onBlur,
1541
+ _ref$className = _ref.className,
1542
+ className = _ref$className === undefined ? '' : _ref$className,
1543
+ _ref$initialValue = _ref.initialValue,
1544
+ initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
1545
+ onChange = _ref.onChange,
1546
+ value = _ref.value,
1547
+ placeholder = _ref.placeholder,
1548
+ _ref$resize = _ref.resize,
1549
+ resize = _ref$resize === undefined ? 'none' : _ref$resize,
1550
+ props = _objectWithoutProperties(_ref, _excluded$c);
1551
+ var theme = useTheme();
1552
+ var _useScale = useScale(),
1553
+ SCALES = _useScale.SCALES;
1554
+ var textareaRef = React.useRef(null);
1555
+ React.useImperativeHandle(ref, function () {
1556
+ return textareaRef.current;
1557
+ });
1558
+ var isControlledComponent = React.useMemo(function () {
1559
+ return value !== undefined;
1560
+ }, [value]);
1561
+ var _useState = React.useState(initialValue),
1562
+ _useState2 = _slicedToArray(_useState, 2),
1563
+ selfValue = _useState2[0],
1564
+ setSelfValue = _useState2[1];
1565
+ var _useState3 = React.useState(false),
1566
+ _useState4 = _slicedToArray(_useState3, 2),
1567
+ hover = _useState4[0],
1568
+ setHover = _useState4[1];
1569
+ var _useMemo = React.useMemo(function () {
1570
+ return getColors$2(theme.palette, type);
1571
+ }, [theme.palette, type]),
1572
+ color = _useMemo.color,
1573
+ borderColor = _useMemo.borderColor,
1574
+ hoverBorder = _useMemo.hoverBorder;
1575
+ var classes = useClasses('wrapper', {
1576
+ hover: hover,
1577
+ disabled: disabled
1578
+ }, className);
1579
+ var changeHandler = function changeHandler(event) {
1580
+ if (disabled || readOnly) return;
1581
+ setSelfValue(event.target.value);
1582
+ onChange && onChange(event);
1583
+ };
1584
+ var focusHandler = function focusHandler(e) {
1585
+ setHover(true);
1586
+ onFocus && onFocus(e);
1587
+ };
1588
+ var blurHandler = function blurHandler(e) {
1589
+ setHover(false);
1590
+ onBlur && onBlur(e);
1591
+ };
1592
+ React.useEffect(function () {
1593
+ if (isControlledComponent) {
1594
+ setSelfValue(value);
1595
+ }
1596
+ });
1597
+ var controlledValue = isControlledComponent ? {
1598
+ value: selfValue
1599
+ } : {
1600
+ defaultValue: initialValue
1601
+ };
1602
+ var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
1603
+ return /*#__PURE__*/React.createElement("div", {
1604
+ className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (classes || "")
1605
+ }, /*#__PURE__*/React.createElement("textarea", _extends({
1606
+ ref: textareaRef,
1607
+ disabled: disabled,
1608
+ placeholder: placeholder,
1609
+ readOnly: readOnly,
1610
+ onFocus: focusHandler,
1611
+ onBlur: blurHandler,
1612
+ onChange: changeHandler
1613
+ }, textareaProps, {
1614
+ className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (textareaProps && textareaProps.className != null && textareaProps.className || "")
1615
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
1616
+ id: "12276481",
1617
+ dynamic: [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]
1618
+ }, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}")));
1619
+ });
1620
+ TextareaComponent.displayName = 'Textarea';
1621
+ var Textarea = withScale(TextareaComponent);
1622
+
1623
+ var PasswordIcon = function PasswordIcon(_ref) {
1624
+ var visible = _ref.visible;
1625
+ return /*#__PURE__*/React.createElement("svg", {
1626
+ viewBox: "0 0 24 24",
1627
+ stroke: "currentColor",
1628
+ strokeWidth: "1.5",
1629
+ strokeLinecap: "round",
1630
+ strokeLinejoin: "round",
1631
+ fill: "none",
1632
+ shapeRendering: "geometricPrecision",
1633
+ style: {
1634
+ color: 'currentColor'
1635
+ }
1636
+ }, !visible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
1637
+ d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
1638
+ }), /*#__PURE__*/React.createElement("circle", {
1639
+ cx: "12",
1640
+ cy: "12",
1641
+ r: "3"
1642
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
1643
+ d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
1644
+ }), /*#__PURE__*/React.createElement("path", {
1645
+ d: "M1 1l22 22"
1646
+ })));
1647
+ };
1648
+ var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1649
+
1650
+ var _excluded$b = ["hideToggle", "children"];
1651
+ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1652
+ var hideToggle = _ref.hideToggle,
1653
+ children = _ref.children,
1654
+ props = _objectWithoutProperties(_ref, _excluded$b);
1655
+ var _useScale = useScale(),
1656
+ getAllScaleProps = _useScale.getAllScaleProps;
1657
+ var inputRef = React.useRef(null);
1658
+ var _useState = React.useState(false),
1659
+ _useState2 = _slicedToArray(_useState, 2),
1660
+ visible = _useState2[0],
1661
+ setVisible = _useState2[1];
1662
+ React.useImperativeHandle(ref, function () {
1663
+ return inputRef.current;
1664
+ });
1665
+ var iconClickHandler = function iconClickHandler() {
1666
+ setVisible(function (v) {
1667
+ return !v;
1668
+ });
1669
+ /* istanbul ignore next */
1670
+ if (inputRef && inputRef.current) {
1671
+ inputRef.current.focus();
1672
+ }
1673
+ };
1674
+ var inputProps = React.useMemo(function () {
1675
+ return _objectSpread2(_objectSpread2({}, props), {}, {
1676
+ ref: inputRef,
1677
+ iconClickable: true,
1678
+ onIconClick: iconClickHandler,
1679
+ htmlType: visible ? 'text' : 'password'
1680
+ });
1681
+ }, [props, iconClickHandler, visible, inputRef]);
1682
+ var icon = React.useMemo(function () {
1683
+ if (hideToggle) return null;
1684
+ return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
1685
+ visible: visible
1686
+ });
1687
+ }, [hideToggle, visible]);
1688
+ return /*#__PURE__*/React.createElement(Input, _extends({
1689
+ iconRight: icon
1690
+ }, getAllScaleProps(), inputProps), children);
1691
+ });
1692
+ InputPasswordComponent.displayName = 'InputPassword';
1693
+ var InputPassword = withScale(InputPasswordComponent);
1694
+
1695
+ /* "use client" */
1696
+ Input.Textarea = Textarea;
1697
+ Input.Password = InputPassword;
1698
+
1699
+ var lodash$1 = {exports: {}};
1700
+
1701
+ /**
1702
+ * @license
1703
+ * Lodash <https://lodash.com/>
1704
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1705
+ * Released under MIT license <https://lodash.com/license>
1706
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1707
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1708
+ */
1709
+ var lodash = lodash$1.exports;
1710
+
1711
+ var hasRequiredLodash;
1712
+
1713
+ function requireLodash () {
1714
+ if (hasRequiredLodash) return lodash$1.exports;
1715
+ hasRequiredLodash = 1;
1716
+ (function (module, exports) {
1717
+ (function() {
1718
+
1719
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
1720
+ var undefined$1;
1721
+
1722
+ /** Used as the semantic version number. */
1723
+ var VERSION = '4.17.21';
1157
1724
 
1158
1725
  /** Used as the size to enable large array optimizations. */
1159
1726
  var LARGE_ARRAY_SIZE = 200;
@@ -18146,674 +18713,200 @@ function requireLodash () {
18146
18713
 
18147
18714
  // Add `LazyWrapper` methods for `_.head` and `_.last`.
18148
18715
  arrayEach(['head', 'last'], function(methodName, index) {
18149
- var takeName = 'take' + (index ? 'Right' : '');
18150
-
18151
- LazyWrapper.prototype[methodName] = function() {
18152
- return this[takeName](1).value()[0];
18153
- };
18154
- });
18155
-
18156
- // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
18157
- arrayEach(['initial', 'tail'], function(methodName, index) {
18158
- var dropName = 'drop' + (index ? '' : 'Right');
18159
-
18160
- LazyWrapper.prototype[methodName] = function() {
18161
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
18162
- };
18163
- });
18164
-
18165
- LazyWrapper.prototype.compact = function() {
18166
- return this.filter(identity);
18167
- };
18168
-
18169
- LazyWrapper.prototype.find = function(predicate) {
18170
- return this.filter(predicate).head();
18171
- };
18172
-
18173
- LazyWrapper.prototype.findLast = function(predicate) {
18174
- return this.reverse().find(predicate);
18175
- };
18176
-
18177
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
18178
- if (typeof path == 'function') {
18179
- return new LazyWrapper(this);
18180
- }
18181
- return this.map(function(value) {
18182
- return baseInvoke(value, path, args);
18183
- });
18184
- });
18185
-
18186
- LazyWrapper.prototype.reject = function(predicate) {
18187
- return this.filter(negate(getIteratee(predicate)));
18188
- };
18189
-
18190
- LazyWrapper.prototype.slice = function(start, end) {
18191
- start = toInteger(start);
18192
-
18193
- var result = this;
18194
- if (result.__filtered__ && (start > 0 || end < 0)) {
18195
- return new LazyWrapper(result);
18196
- }
18197
- if (start < 0) {
18198
- result = result.takeRight(-start);
18199
- } else if (start) {
18200
- result = result.drop(start);
18201
- }
18202
- if (end !== undefined$1) {
18203
- end = toInteger(end);
18204
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
18205
- }
18206
- return result;
18207
- };
18208
-
18209
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
18210
- return this.reverse().takeWhile(predicate).reverse();
18211
- };
18212
-
18213
- LazyWrapper.prototype.toArray = function() {
18214
- return this.take(MAX_ARRAY_LENGTH);
18215
- };
18216
-
18217
- // Add `LazyWrapper` methods to `lodash.prototype`.
18218
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18219
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
18220
- isTaker = /^(?:head|last)$/.test(methodName),
18221
- lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
18222
- retUnwrapped = isTaker || /^find/.test(methodName);
18223
-
18224
- if (!lodashFunc) {
18225
- return;
18226
- }
18227
- lodash.prototype[methodName] = function() {
18228
- var value = this.__wrapped__,
18229
- args = isTaker ? [1] : arguments,
18230
- isLazy = value instanceof LazyWrapper,
18231
- iteratee = args[0],
18232
- useLazy = isLazy || isArray(value);
18233
-
18234
- var interceptor = function(value) {
18235
- var result = lodashFunc.apply(lodash, arrayPush([value], args));
18236
- return (isTaker && chainAll) ? result[0] : result;
18237
- };
18238
-
18239
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
18240
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
18241
- isLazy = useLazy = false;
18242
- }
18243
- var chainAll = this.__chain__,
18244
- isHybrid = !!this.__actions__.length,
18245
- isUnwrapped = retUnwrapped && !chainAll,
18246
- onlyLazy = isLazy && !isHybrid;
18247
-
18248
- if (!retUnwrapped && useLazy) {
18249
- value = onlyLazy ? value : new LazyWrapper(this);
18250
- var result = func.apply(value, args);
18251
- result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
18252
- return new LodashWrapper(result, chainAll);
18253
- }
18254
- if (isUnwrapped && onlyLazy) {
18255
- return func.apply(this, args);
18256
- }
18257
- result = this.thru(interceptor);
18258
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
18259
- };
18260
- });
18261
-
18262
- // Add `Array` methods to `lodash.prototype`.
18263
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
18264
- var func = arrayProto[methodName],
18265
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
18266
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
18267
-
18268
- lodash.prototype[methodName] = function() {
18269
- var args = arguments;
18270
- if (retUnwrapped && !this.__chain__) {
18271
- var value = this.value();
18272
- return func.apply(isArray(value) ? value : [], args);
18273
- }
18274
- return this[chainName](function(value) {
18275
- return func.apply(isArray(value) ? value : [], args);
18276
- });
18277
- };
18278
- });
18279
-
18280
- // Map minified method names to their real names.
18281
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18282
- var lodashFunc = lodash[methodName];
18283
- if (lodashFunc) {
18284
- var key = lodashFunc.name + '';
18285
- if (!hasOwnProperty.call(realNames, key)) {
18286
- realNames[key] = [];
18287
- }
18288
- realNames[key].push({ 'name': methodName, 'func': lodashFunc });
18289
- }
18290
- });
18291
-
18292
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
18293
- 'name': 'wrapper',
18294
- 'func': undefined$1
18295
- }];
18296
-
18297
- // Add methods to `LazyWrapper`.
18298
- LazyWrapper.prototype.clone = lazyClone;
18299
- LazyWrapper.prototype.reverse = lazyReverse;
18300
- LazyWrapper.prototype.value = lazyValue;
18301
-
18302
- // Add chain sequence methods to the `lodash` wrapper.
18303
- lodash.prototype.at = wrapperAt;
18304
- lodash.prototype.chain = wrapperChain;
18305
- lodash.prototype.commit = wrapperCommit;
18306
- lodash.prototype.next = wrapperNext;
18307
- lodash.prototype.plant = wrapperPlant;
18308
- lodash.prototype.reverse = wrapperReverse;
18309
- lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
18310
-
18311
- // Add lazy aliases.
18312
- lodash.prototype.first = lodash.prototype.head;
18313
-
18314
- if (symIterator) {
18315
- lodash.prototype[symIterator] = wrapperToIterator;
18316
- }
18317
- return lodash;
18318
- });
18319
-
18320
- /*--------------------------------------------------------------------------*/
18321
-
18322
- // Export lodash.
18323
- var _ = runInContext();
18716
+ var takeName = 'take' + (index ? 'Right' : '');
18324
18717
 
18325
- // Some AMD build optimizers, like r.js, check for condition patterns like:
18326
- if (freeModule) {
18327
- // Export for Node.js.
18328
- (freeModule.exports = _)._ = _;
18329
- // Export for CommonJS support.
18330
- freeExports._ = _;
18331
- }
18332
- else {
18333
- // Export to the global object.
18334
- root._ = _;
18335
- }
18336
- }.call(lodash));
18337
- } (lodash$1, lodash$1.exports));
18338
- return lodash$1.exports;
18339
- }
18718
+ LazyWrapper.prototype[methodName] = function() {
18719
+ return this[takeName](1).value()[0];
18720
+ };
18721
+ });
18340
18722
 
18341
- var lodashExports = requireLodash();
18342
- var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
18723
+ // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
18724
+ arrayEach(['initial', 'tail'], function(methodName, index) {
18725
+ var dropName = 'drop' + (index ? '' : 'Right');
18343
18726
 
18344
- var TableBody = function TableBody(_ref) {
18345
- var data = _ref.data,
18346
- emptyText = _ref.emptyText,
18347
- onRow = _ref.onRow,
18348
- onCell = _ref.onCell,
18349
- rowClassName = _ref.rowClassName,
18350
- _ref$rowDraggable = _ref.rowDraggable,
18351
- rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
18352
- _ref$readOnly = _ref.readOnly,
18353
- readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
18354
- onSelected = _ref.onSelected;
18355
- var theme = useTheme();
18356
- var _useState = React.useState([]),
18357
- _useState2 = _slicedToArray(_useState, 2),
18358
- selected = _useState2[0],
18359
- setSelected = _useState2[1];
18360
- var _useTableContext = useTableContext(),
18361
- columns = _useTableContext.columns;
18362
- // const rowClickHandler = (row: TableDataItem, index: number) => {
18363
- // onRow && onRow(row, index)
18364
- // }
18727
+ LazyWrapper.prototype[methodName] = function() {
18728
+ return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
18729
+ };
18730
+ });
18365
18731
 
18366
- var handleClick = function handleClick(_event, id) {
18367
- if (readOnly) {
18368
- return true;
18369
- }
18370
- var selectedIndex = selected.indexOf(id);
18371
- var newSelected = [];
18372
- if (selectedIndex === -1) {
18373
- newSelected = newSelected.concat(selected, id);
18374
- } else if (selectedIndex === 0) {
18375
- newSelected = newSelected.concat(selected.slice(1));
18376
- } else if (selectedIndex === selected.length - 1) {
18377
- newSelected = newSelected.concat(selected.slice(0, -1));
18378
- } else if (selectedIndex > 0) {
18379
- newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
18380
- }
18381
- setSelected(newSelected);
18382
- };
18732
+ LazyWrapper.prototype.compact = function() {
18733
+ return this.filter(identity);
18734
+ };
18383
18735
 
18384
- // const handleSelectAllClick = (event: { target: { checked: any } }) => {
18385
- // if (event.target.checked) {
18386
- // const newSelecteds = data.map((n: any) => n._id);
18387
- // setSelected(newSelecteds as never[]);
18388
- // return;
18389
- // }
18390
- // setSelected([]);
18391
- // };
18736
+ LazyWrapper.prototype.find = function(predicate) {
18737
+ return this.filter(predicate).head();
18738
+ };
18392
18739
 
18393
- // Push Selected Rows
18394
- React.useEffect(function () {
18395
- if (selected.length > 0 && onSelected) {
18396
- onSelected(selected);
18397
- }
18398
- }, [selected]);
18399
- function renderRow(cols, row, index) {
18400
- var _row$style;
18401
- var urid = _.uniqueId();
18402
- var className = rowClassName(row, index);
18403
- var rw = _objectSpread2({}, row);
18404
- var rowStyle = (_row$style = row === null || row === undefined ? undefined : row.style) !== null && _row$style !== undefined ? _row$style : {};
18405
- var onDragStart = row === null || row === undefined ? undefined : row.onDragStart;
18406
- delete rw.table;
18407
- delete rw.style;
18408
- delete rw.onDragStart;
18409
- // console.log(row);
18410
- // const frow = Object.fromEntries(
18411
- // Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
18412
- // ) as unknown as TableDataItem
18413
- // console.log(frow);
18414
- var isRowSelected = selected.indexOf(row) !== -1;
18415
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
18416
- draggable: rowDraggable,
18417
- role: "checkbox",
18418
- onDragStart: onDragStart,
18419
- "aria-checked": selected.indexOf(row) !== -1,
18420
- tabIndex: -1,
18421
- key: urid,
18422
- style: _objectSpread2({
18423
- cursor: 'pointer',
18424
- backgroundColor: isRowSelected ? '#efefef' : ''
18425
- }, rowStyle),
18426
- onClick: function onClick(e) {
18427
- if (!rowDraggable) {
18428
- if (onRow) {
18429
- onRow(row, index);
18430
- } else {
18431
- handleClick(e, row);
18432
- }
18433
- }
18434
- },
18435
- className: _JSXStyle.dynamic([["2019708038", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
18436
- }, /*#__PURE__*/React.createElement(TableCell, {
18437
- columns: cols,
18438
- row: rw,
18439
- rowIndex: index,
18440
- emptyText: emptyText,
18441
- onCellClick: onCell
18442
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
18443
- id: "2019708038",
18444
- dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
18445
- }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
18446
- }
18447
- return /*#__PURE__*/React.createElement("tbody", {
18448
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
18449
- }, data.map(function (row, index) {
18450
- var qid = _.uniqueId();
18451
- if (row === null || row === undefined) {
18452
- var uid = _.uniqueId();
18453
- return /*#__PURE__*/React.createElement("tr", {
18454
- key: uid,
18455
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
18456
- }, /*#__PURE__*/React.createElement("td", {
18457
- colSpan: columns.length,
18458
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
18459
- }, "\u2003"));
18460
- }
18461
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === undefined ? undefined : row.table) && /*#__PURE__*/React.createElement("tr", {
18462
- key: qid,
18463
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
18464
- }, /*#__PURE__*/React.createElement("td", {
18465
- style: {
18466
- padding: '1rem'
18467
- },
18468
- colSpan: columns.length,
18469
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
18470
- })));
18740
+ LazyWrapper.prototype.findLast = function(predicate) {
18741
+ return this.reverse().find(predicate);
18742
+ };
18471
18743
 
18472
- // return (
18473
- // <tr
18474
- // key={`tbody-row-${index}`}
18475
- // className={useClasses({ hover }, className)}
18476
- // onClick={() => rowClickHandler(row, index)}>
18477
- // <TableCell<TableDataItem>
18478
- // columns={columns}
18479
- // row={row}
18480
- // rowIndex={index}
18481
- // emptyText={emptyText}
18482
- // onCellClick={onCell}
18483
- // />
18484
- // </tr>
18485
- // )
18486
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
18487
- id: "1422656197",
18488
- dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
18489
- }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
18490
- };
18491
- TableBody.displayName = 'TableBody';
18744
+ LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
18745
+ if (typeof path == 'function') {
18746
+ return new LazyWrapper(this);
18747
+ }
18748
+ return this.map(function(value) {
18749
+ return baseInvoke(value, path, args);
18750
+ });
18751
+ });
18492
18752
 
18493
- var getRealShape = function getRealShape(el) {
18494
- var defaultShape = {
18495
- width: 0,
18496
- height: 0
18497
- };
18498
- if (!el || typeof window === 'undefined') return defaultShape;
18499
- var rect = el.getBoundingClientRect();
18500
- var _window$getComputedSt = window.getComputedStyle(el),
18501
- width = _window$getComputedSt.width,
18502
- height = _window$getComputedSt.height;
18503
- var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
18504
- if (!str) return 0;
18505
- var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
18506
- return Number.isNaN(+strVal) ? 0 : +strVal;
18507
- };
18508
- return {
18509
- width: getCSSStyleVal("".concat(width), rect.width),
18510
- height: getCSSStyleVal("".concat(height), rect.height)
18511
- };
18512
- };
18513
- var useRealShape = function useRealShape(ref) {
18514
- var _useState = React.useState({
18515
- width: 0,
18516
- height: 0
18517
- }),
18518
- _useState2 = _slicedToArray(_useState, 2),
18519
- state = _useState2[0],
18520
- setState = _useState2[1];
18521
- var update = function update() {
18522
- var _getRealShape = getRealShape(ref.current),
18523
- width = _getRealShape.width,
18524
- height = _getRealShape.height;
18525
- setState({
18526
- width: width,
18527
- height: height
18528
- });
18529
- };
18530
- React.useEffect(function () {
18531
- return update();
18532
- }, [ref.current]);
18533
- return [state, update];
18534
- };
18753
+ LazyWrapper.prototype.reject = function(predicate) {
18754
+ return this.filter(negate(getIteratee(predicate)));
18755
+ };
18535
18756
 
18536
- /* "use client" */
18757
+ LazyWrapper.prototype.slice = function(start, end) {
18758
+ start = toInteger(start);
18537
18759
 
18538
- var useResize = function useResize(callback) {
18539
- var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
18540
- React.useEffect(function () {
18541
- var fn = function fn() {
18542
- return callback();
18543
- };
18544
- if (immediatelyInvoke) {
18545
- fn();
18546
- }
18547
- window.addEventListener('resize', fn);
18548
- return function () {
18549
- return window.removeEventListener('resize', fn);
18550
- };
18551
- }, []);
18552
- };
18760
+ var result = this;
18761
+ if (result.__filtered__ && (start > 0 || end < 0)) {
18762
+ return new LazyWrapper(result);
18763
+ }
18764
+ if (start < 0) {
18765
+ result = result.takeRight(-start);
18766
+ } else if (start) {
18767
+ result = result.drop(start);
18768
+ }
18769
+ if (end !== undefined$1) {
18770
+ end = toInteger(end);
18771
+ result = end < 0 ? result.dropRight(-end) : result.take(end - start);
18772
+ }
18773
+ return result;
18774
+ };
18553
18775
 
18554
- /* "use client" */
18776
+ LazyWrapper.prototype.takeRightWhile = function(predicate) {
18777
+ return this.reverse().takeWhile(predicate).reverse();
18778
+ };
18555
18779
 
18556
- var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'pl', 'pr', 'pt', 'pb', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'ml', 'mr', 'mt', 'mb', 'px', 'py', 'mx', 'my', 'font', 'unit', 'scale'];
18557
- var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
18558
- return "".concat(scale1x);
18559
- };
18560
- var defaultContext$2 = {
18561
- getScaleProps: function getScaleProps() {
18562
- return undefined;
18563
- },
18564
- getAllScaleProps: function getAllScaleProps() {
18565
- return {};
18566
- },
18567
- SCALES: {
18568
- pl: defaultDynamicLayoutPipe,
18569
- pr: defaultDynamicLayoutPipe,
18570
- pb: defaultDynamicLayoutPipe,
18571
- pt: defaultDynamicLayoutPipe,
18572
- px: defaultDynamicLayoutPipe,
18573
- py: defaultDynamicLayoutPipe,
18574
- mb: defaultDynamicLayoutPipe,
18575
- ml: defaultDynamicLayoutPipe,
18576
- mr: defaultDynamicLayoutPipe,
18577
- mt: defaultDynamicLayoutPipe,
18578
- mx: defaultDynamicLayoutPipe,
18579
- my: defaultDynamicLayoutPipe,
18580
- width: defaultDynamicLayoutPipe,
18581
- height: defaultDynamicLayoutPipe,
18582
- font: defaultDynamicLayoutPipe
18583
- },
18584
- unit: '16px'
18585
- };
18586
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$2);
18587
- var useScale = function useScale() {
18588
- return React.useContext(ScaleContext);
18589
- };
18780
+ LazyWrapper.prototype.toArray = function() {
18781
+ return this.take(MAX_ARRAY_LENGTH);
18782
+ };
18590
18783
 
18591
- /* "use client" */
18784
+ // Add `LazyWrapper` methods to `lodash.prototype`.
18785
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18786
+ var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
18787
+ isTaker = /^(?:head|last)$/.test(methodName),
18788
+ lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
18789
+ retUnwrapped = isTaker || /^find/.test(methodName);
18592
18790
 
18593
- var getId = function getId() {
18594
- return Math.random().toString(32).slice(2, 10);
18595
- };
18596
- var pickChildByProps = function pickChildByProps(children, key, value) {
18597
- var target = [];
18598
- var isArray = Array.isArray(value);
18599
- var withoutPropChildren = React.Children.map(children, function (item) {
18600
- if (! /*#__PURE__*/React.isValidElement(item)) return null;
18601
- if (!item.props) return item;
18602
- if (isArray) {
18603
- if (value.includes(item.props[key])) {
18604
- target.push(item);
18605
- return null;
18606
- }
18607
- return item;
18608
- }
18609
- if (item.props[key] === value) {
18610
- target.push(item);
18611
- return null;
18612
- }
18613
- return item;
18614
- });
18615
- var targetChildren = target.length >= 0 ? target : undefined;
18616
- return [withoutPropChildren, targetChildren];
18617
- };
18618
- var isBrowser = function isBrowser() {
18619
- return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
18620
- };
18621
- var isCSSNumberValue = function isCSSNumberValue(value) {
18622
- return value !== undefined && !Number.isNaN(+value);
18623
- };
18791
+ if (!lodashFunc) {
18792
+ return;
18793
+ }
18794
+ lodash.prototype[methodName] = function() {
18795
+ var value = this.__wrapped__,
18796
+ args = isTaker ? [1] : arguments,
18797
+ isLazy = value instanceof LazyWrapper,
18798
+ iteratee = args[0],
18799
+ useLazy = isLazy || isArray(value);
18624
18800
 
18625
- var generateGetScaleProps = function generateGetScaleProps(props) {
18626
- var getScaleProps = function getScaleProps(keyOrKeys) {
18627
- if (!Array.isArray(keyOrKeys)) return props[keyOrKeys];
18628
- var value = undefined;
18629
- var _iterator = _createForOfIteratorHelper(keyOrKeys),
18630
- _step;
18631
- try {
18632
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
18633
- var key = _step.value;
18634
- var currentValue = props[key];
18635
- if (typeof currentValue !== 'undefined') {
18636
- value = currentValue;
18637
- }
18638
- }
18639
- } catch (err) {
18640
- _iterator.e(err);
18641
- } finally {
18642
- _iterator.f();
18643
- }
18644
- return value;
18645
- };
18646
- return getScaleProps;
18647
- };
18648
- var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
18649
- var getAllScaleProps = function getAllScaleProps() {
18650
- var scaleProps = {};
18651
- var _iterator2 = _createForOfIteratorHelper(ScalePropKeys),
18652
- _step2;
18653
- try {
18654
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
18655
- var key = _step2.value;
18656
- var value = props[key];
18657
- if (typeof value !== 'undefined') {
18658
- scaleProps[key] = value;
18659
- }
18660
- }
18661
- } catch (err) {
18662
- _iterator2.e(err);
18663
- } finally {
18664
- _iterator2.f();
18665
- }
18666
- return scaleProps;
18667
- };
18668
- return getAllScaleProps;
18669
- };
18801
+ var interceptor = function(value) {
18802
+ var result = lodashFunc.apply(lodash, arrayPush([value], args));
18803
+ return (isTaker && chainAll) ? result[0] : result;
18804
+ };
18670
18805
 
18671
- var _excluded$e = ["children"];
18672
- var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
18673
- if (scale === 1) return scale;
18674
- var diff = Math.abs((scale - 1) / 2);
18675
- return scale > 1 ? 1 + diff : 1 - diff;
18676
- };
18677
- var withScale = function withScale(Render) {
18678
- var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18679
- var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
18680
- var children = _ref.children,
18681
- props = _objectWithoutProperties(_ref, _excluded$e);
18682
- var _useTheme = useTheme(),
18683
- layout = _useTheme.layout;
18684
- var paddingLeft = props.paddingLeft,
18685
- pl = props.pl,
18686
- paddingRight = props.paddingRight,
18687
- pr = props.pr,
18688
- paddingTop = props.paddingTop,
18689
- pt = props.pt,
18690
- paddingBottom = props.paddingBottom,
18691
- pb = props.pb,
18692
- marginTop = props.marginTop,
18693
- mt = props.mt,
18694
- marginRight = props.marginRight,
18695
- mr = props.mr,
18696
- marginBottom = props.marginBottom,
18697
- mb = props.mb,
18698
- marginLeft = props.marginLeft,
18699
- ml = props.ml,
18700
- px = props.px,
18701
- py = props.py,
18702
- mx = props.mx,
18703
- my = props.my,
18704
- width = props.width,
18705
- height = props.height,
18706
- font = props.font,
18707
- w = props.w,
18708
- h = props.h,
18709
- margin = props.margin,
18710
- padding = props.padding,
18711
- _props$unit = props.unit,
18712
- unit = _props$unit === undefined ? layout.unit : _props$unit,
18713
- _props$scale = props.scale,
18714
- scale = _props$scale === undefined ? 1 : _props$scale;
18715
- var makeScaleHandler = function makeScaleHandler(attrValue) {
18716
- return function (scale1x, defaultValue) {
18717
- // 0 means disable scale and the default value is 0
18718
- if (scale1x === 0) {
18719
- scale1x = 1;
18720
- defaultValue = defaultValue || 0;
18721
- }
18722
- var factor = reduceScaleCoefficient(scale) * scale1x;
18723
- if (typeof attrValue === 'undefined') {
18724
- if (typeof defaultValue !== 'undefined') return "".concat(defaultValue);
18725
- return "calc(".concat(factor, " * ").concat(unit, ")");
18726
- }
18727
- if (!isCSSNumberValue(attrValue)) return "".concat(attrValue);
18728
- var customFactor = factor * Number(attrValue);
18729
- return "calc(".concat(customFactor, " * ").concat(unit, ")");
18730
- };
18731
- };
18732
- var value = {
18733
- unit: unit,
18734
- SCALES: {
18735
- pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== undefined ? paddingTop : pt) !== null && _ref3 !== undefined ? _ref3 : py) !== null && _ref2 !== undefined ? _ref2 : padding),
18736
- pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== undefined ? paddingRight : pr) !== null && _ref5 !== undefined ? _ref5 : px) !== null && _ref4 !== undefined ? _ref4 : padding),
18737
- pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : pb) !== null && _ref7 !== undefined ? _ref7 : py) !== null && _ref6 !== undefined ? _ref6 : padding),
18738
- pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : pl) !== null && _ref9 !== undefined ? _ref9 : px) !== null && _ref8 !== undefined ? _ref8 : padding),
18739
- px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== undefined ? px : paddingLeft) !== null && _ref13 !== undefined ? _ref13 : paddingRight) !== null && _ref12 !== undefined ? _ref12 : pl) !== null && _ref11 !== undefined ? _ref11 : pr) !== null && _ref10 !== undefined ? _ref10 : padding),
18740
- py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== undefined ? py : paddingTop) !== null && _ref17 !== undefined ? _ref17 : paddingBottom) !== null && _ref16 !== undefined ? _ref16 : pt) !== null && _ref15 !== undefined ? _ref15 : pb) !== null && _ref14 !== undefined ? _ref14 : padding),
18741
- mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== undefined ? marginTop : mt) !== null && _ref19 !== undefined ? _ref19 : my) !== null && _ref18 !== undefined ? _ref18 : margin),
18742
- mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== undefined ? marginRight : mr) !== null && _ref21 !== undefined ? _ref21 : mx) !== null && _ref20 !== undefined ? _ref20 : margin),
18743
- mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== undefined ? marginBottom : mb) !== null && _ref23 !== undefined ? _ref23 : my) !== null && _ref22 !== undefined ? _ref22 : margin),
18744
- ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== undefined ? marginLeft : ml) !== null && _ref25 !== undefined ? _ref25 : mx) !== null && _ref24 !== undefined ? _ref24 : margin),
18745
- mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== undefined ? mx : marginLeft) !== null && _ref29 !== undefined ? _ref29 : marginRight) !== null && _ref28 !== undefined ? _ref28 : ml) !== null && _ref27 !== undefined ? _ref27 : mr) !== null && _ref26 !== undefined ? _ref26 : margin),
18746
- my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== undefined ? my : marginTop) !== null && _ref33 !== undefined ? _ref33 : marginBottom) !== null && _ref32 !== undefined ? _ref32 : mt) !== null && _ref31 !== undefined ? _ref31 : mb) !== null && _ref30 !== undefined ? _ref30 : margin),
18747
- width: makeScaleHandler(width !== null && width !== undefined ? width : w),
18748
- height: makeScaleHandler(height !== null && height !== undefined ? height : h),
18749
- font: makeScaleHandler(font)
18750
- },
18751
- getScaleProps: generateGetScaleProps(props),
18752
- getAllScaleProps: generateGetAllScaleProps(props)
18753
- };
18754
- return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
18755
- value: value
18756
- }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
18757
- ref: ref
18758
- }), children));
18759
- });
18760
- ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
18761
- return ScaleFC;
18762
- };
18806
+ if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
18807
+ // Avoid lazy use if the iteratee has a "length" value other than `1`.
18808
+ isLazy = useLazy = false;
18809
+ }
18810
+ var chainAll = this.__chain__,
18811
+ isHybrid = !!this.__actions__.length,
18812
+ isUnwrapped = retUnwrapped && !chainAll,
18813
+ onlyLazy = isLazy && !isHybrid;
18814
+
18815
+ if (!retUnwrapped && useLazy) {
18816
+ value = onlyLazy ? value : new LazyWrapper(this);
18817
+ var result = func.apply(value, args);
18818
+ result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
18819
+ return new LodashWrapper(result, chainAll);
18820
+ }
18821
+ if (isUnwrapped && onlyLazy) {
18822
+ return func.apply(this, args);
18823
+ }
18824
+ result = this.thru(interceptor);
18825
+ return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
18826
+ };
18827
+ });
18763
18828
 
18764
- var warningStack = {};
18765
- var useWarning = function useWarning(message, component) {
18766
- var tag = component ? " [".concat(component, "]") : ' ';
18767
- var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
18768
- if (typeof console === 'undefined') return;
18769
- if (warningStack[log]) return;
18770
- warningStack[log] = true;
18771
- if (process.env.NODE_ENV !== 'production') {
18772
- return console.error(log);
18773
- }
18774
- console.warn(log);
18775
- };
18829
+ // Add `Array` methods to `lodash.prototype`.
18830
+ arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
18831
+ var func = arrayProto[methodName],
18832
+ chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
18833
+ retUnwrapped = /^(?:pop|shift)$/.test(methodName);
18776
18834
 
18777
- /* "use client" */
18835
+ lodash.prototype[methodName] = function() {
18836
+ var args = arguments;
18837
+ if (retUnwrapped && !this.__chain__) {
18838
+ var value = this.value();
18839
+ return func.apply(isArray(value) ? value : [], args);
18840
+ }
18841
+ return this[chainName](function(value) {
18842
+ return func.apply(isArray(value) ? value : [], args);
18843
+ });
18844
+ };
18845
+ });
18778
18846
 
18779
- var TableColumn = function TableColumn(columnProps) {
18780
- var _ref = columnProps,
18781
- children = _ref.children,
18782
- prop = _ref.prop,
18783
- label = _ref.label,
18784
- width = _ref.width,
18785
- filter = _ref.filter,
18786
- options = _ref.options,
18787
- noWrap = _ref.noWrap,
18788
- align = _ref.align,
18789
- _ref$fontSize = _ref.fontSize,
18790
- fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
18791
- _ref$className = _ref.className,
18792
- className = _ref$className === undefined ? '' : _ref$className,
18793
- renderHandler = _ref.render;
18794
- var _useTableContext = useTableContext(),
18795
- updateColumn = _useTableContext.updateColumn;
18796
- var safeProp = "".concat(prop.toString()).trim();
18797
- if (!safeProp) {
18798
- useWarning('The props "prop" is required.', 'Table.Column');
18799
- }
18800
- React.useEffect(function () {
18801
- updateColumn({
18802
- label: children || label,
18803
- filter: filter,
18804
- noWrap: noWrap,
18805
- options: options,
18806
- prop: safeProp,
18807
- width: width,
18808
- align: align,
18809
- fontSize: fontSize,
18810
- className: className,
18811
- renderHandler: function renderHandler() {}
18812
- });
18813
- }, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
18814
- return null;
18815
- };
18816
- TableColumn.displayName = 'TableColumn';
18847
+ // Map minified method names to their real names.
18848
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18849
+ var lodashFunc = lodash[methodName];
18850
+ if (lodashFunc) {
18851
+ var key = lodashFunc.name + '';
18852
+ if (!hasOwnProperty.call(realNames, key)) {
18853
+ realNames[key] = [];
18854
+ }
18855
+ realNames[key].push({ 'name': methodName, 'func': lodashFunc });
18856
+ }
18857
+ });
18858
+
18859
+ realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
18860
+ 'name': 'wrapper',
18861
+ 'func': undefined$1
18862
+ }];
18863
+
18864
+ // Add methods to `LazyWrapper`.
18865
+ LazyWrapper.prototype.clone = lazyClone;
18866
+ LazyWrapper.prototype.reverse = lazyReverse;
18867
+ LazyWrapper.prototype.value = lazyValue;
18868
+
18869
+ // Add chain sequence methods to the `lodash` wrapper.
18870
+ lodash.prototype.at = wrapperAt;
18871
+ lodash.prototype.chain = wrapperChain;
18872
+ lodash.prototype.commit = wrapperCommit;
18873
+ lodash.prototype.next = wrapperNext;
18874
+ lodash.prototype.plant = wrapperPlant;
18875
+ lodash.prototype.reverse = wrapperReverse;
18876
+ lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
18877
+
18878
+ // Add lazy aliases.
18879
+ lodash.prototype.first = lodash.prototype.head;
18880
+
18881
+ if (symIterator) {
18882
+ lodash.prototype[symIterator] = wrapperToIterator;
18883
+ }
18884
+ return lodash;
18885
+ });
18886
+
18887
+ /*--------------------------------------------------------------------------*/
18888
+
18889
+ // Export lodash.
18890
+ var _ = runInContext();
18891
+
18892
+ // Some AMD build optimizers, like r.js, check for condition patterns like:
18893
+ if (freeModule) {
18894
+ // Export for Node.js.
18895
+ (freeModule.exports = _)._ = _;
18896
+ // Export for CommonJS support.
18897
+ freeExports._ = _;
18898
+ }
18899
+ else {
18900
+ // Export to the global object.
18901
+ root._ = _;
18902
+ }
18903
+ }.call(lodash));
18904
+ } (lodash$1, lodash$1.exports));
18905
+ return lodash$1.exports;
18906
+ }
18907
+
18908
+ var lodashExports = requireLodash();
18909
+ var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
18817
18910
 
18818
18911
  var useCurrentState = function useCurrentState(initialState) {
18819
18912
  var _useState = React.useState(function () {
@@ -18855,11 +18948,11 @@ var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
18855
18948
 
18856
18949
  /* "use client" */
18857
18950
 
18858
- var defaultContext$1 = {
18951
+ var defaultContext$2 = {
18859
18952
  visible: false,
18860
18953
  disableAll: false
18861
18954
  };
18862
- var SelectContext = /*#__PURE__*/React.createContext(defaultContext$1);
18955
+ var SelectContext = /*#__PURE__*/React.createContext(defaultContext$2);
18863
18956
  var useSelectContext = function useSelectContext() {
18864
18957
  return React.useContext(SelectContext);
18865
18958
  };
@@ -18906,7 +18999,25 @@ var usePortal = function usePortal() {
18906
18999
  return elSnapshot;
18907
19000
  };
18908
19001
 
18909
- var _excluded$d = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
19002
+ /* "use client" */
19003
+
19004
+ var useResize = function useResize(callback) {
19005
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
19006
+ React.useEffect(function () {
19007
+ var fn = function fn() {
19008
+ return callback();
19009
+ };
19010
+ if (immediatelyInvoke) {
19011
+ fn();
19012
+ }
19013
+ window.addEventListener('resize', fn);
19014
+ return function () {
19015
+ return window.removeEventListener('resize', fn);
19016
+ };
19017
+ }, []);
19018
+ };
19019
+
19020
+ var _excluded$a = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
18910
19021
  var CssTransition = function CssTransition(_ref) {
18911
19022
  var children = _ref.children,
18912
19023
  _ref$className = _ref.className,
@@ -18921,7 +19032,7 @@ var CssTransition = function CssTransition(_ref) {
18921
19032
  clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
18922
19033
  _ref$name = _ref.name,
18923
19034
  name = _ref$name === undefined ? 'transition' : _ref$name,
18924
- props = _objectWithoutProperties(_ref, _excluded$d);
19035
+ props = _objectWithoutProperties(_ref, _excluded$a);
18925
19036
  var _useState = React.useState(''),
18926
19037
  _useState2 = _slicedToArray(_useState, 2),
18927
19038
  classes = _useState2[0],
@@ -19004,6 +19115,19 @@ var useDOMObserver = function useDOMObserver(ref) {
19004
19115
  }, [ref]);
19005
19116
  };
19006
19117
 
19118
+ var warningStack = {};
19119
+ var useWarning = function useWarning(message, component) {
19120
+ var tag = component ? " [".concat(component, "]") : ' ';
19121
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
19122
+ if (typeof console === 'undefined') return;
19123
+ if (warningStack[log]) return;
19124
+ warningStack[log] = true;
19125
+ if (process.env.NODE_ENV !== 'production') {
19126
+ return console.error(log);
19127
+ }
19128
+ console.warn(log);
19129
+ };
19130
+
19007
19131
  var getElementOffset = function getElementOffset(el) {
19008
19132
  if (!el) return {
19009
19133
  top: 0,
@@ -19164,7 +19288,7 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
19164
19288
  });
19165
19289
  SelectDropdown.displayName = 'SelectDropdown';
19166
19290
 
19167
- var _excluded$c = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
19291
+ var _excluded$9 = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
19168
19292
  var getItemLayout = function getItemLayout(val) {
19169
19293
  var display = val === 0 ? 'display: none;' : 'display: inherit;';
19170
19294
  if (typeof val === 'number') {
@@ -19202,7 +19326,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
19202
19326
  children = _ref.children,
19203
19327
  _ref$className = _ref.className,
19204
19328
  className = _ref$className === undefined ? '' : _ref$className,
19205
- props = _objectWithoutProperties(_ref, _excluded$c);
19329
+ props = _objectWithoutProperties(_ref, _excluded$9);
19206
19330
  var theme = useTheme();
19207
19331
  var _useScale = useScale(),
19208
19332
  SCALES = _useScale.SCALES;
@@ -19242,12 +19366,12 @@ var GridBasicItem = function GridBasicItem(_ref) {
19242
19366
  };
19243
19367
  GridBasicItem.displayName = 'GridBasicItem';
19244
19368
 
19245
- var _excluded$b = ["children", "className"];
19369
+ var _excluded$8 = ["children", "className"];
19246
19370
  var GridComponent = function GridComponent(_ref) {
19247
19371
  var children = _ref.children,
19248
19372
  _ref$className = _ref.className,
19249
19373
  className = _ref$className === undefined ? '' : _ref$className,
19250
- props = _objectWithoutProperties(_ref, _excluded$b);
19374
+ props = _objectWithoutProperties(_ref, _excluded$8);
19251
19375
  var _useScale = useScale(),
19252
19376
  SCALES = _useScale.SCALES;
19253
19377
  var _styles$className = {
@@ -19267,7 +19391,7 @@ var GridComponent = function GridComponent(_ref) {
19267
19391
  GridComponent.displayName = 'Grid';
19268
19392
  var Grid = withScale(GridComponent);
19269
19393
 
19270
- var _excluded$a = ["gap", "wrap", "children", "className"];
19394
+ var _excluded$7 = ["gap", "wrap", "children", "className"];
19271
19395
  var GridContainerComponent = function GridContainerComponent(_ref) {
19272
19396
  var _ref$gap = _ref.gap,
19273
19397
  gap = _ref$gap === undefined ? 0 : _ref$gap,
@@ -19276,7 +19400,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
19276
19400
  children = _ref.children,
19277
19401
  _ref$className = _ref.className,
19278
19402
  className = _ref$className === undefined ? '' : _ref$className,
19279
- props = _objectWithoutProperties(_ref, _excluded$a);
19403
+ props = _objectWithoutProperties(_ref, _excluded$7);
19280
19404
  var _useScale = useScale(),
19281
19405
  unit = _useScale.unit,
19282
19406
  SCALES = _useScale.SCALES;
@@ -19352,7 +19476,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
19352
19476
  };
19353
19477
  SelectMultipleValue.displayName = 'GeistSelectMultipleValue';
19354
19478
 
19355
- var getColors$2 = function getColors(palette, status) {
19479
+ var getColors$1 = function getColors(palette, status) {
19356
19480
  var colors = {
19357
19481
  "default": {
19358
19482
  border: palette.border,
@@ -19432,7 +19556,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
19432
19556
  });
19433
19557
  SelectInput.displayName = 'GeistSelectInput';
19434
19558
 
19435
- var _excluded$9 = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
19559
+ var _excluded$6 = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
19436
19560
  var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19437
19561
  var children = _ref.children,
19438
19562
  label = _ref.label,
@@ -19461,7 +19585,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19461
19585
  getPopupContainer = _ref.getPopupContainer,
19462
19586
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
19463
19587
  onDropdownVisibleChange = _ref$onDropdownVisibl === undefined ? function () {} : _ref$onDropdownVisibl,
19464
- props = _objectWithoutProperties(_ref, _excluded$9);
19588
+ props = _objectWithoutProperties(_ref, _excluded$6);
19465
19589
  var theme = useTheme();
19466
19590
  var _useScale = useScale(),
19467
19591
  SCALES = _useScale.SCALES;
@@ -19490,7 +19614,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19490
19614
  return value.length === 0;
19491
19615
  }, [value]);
19492
19616
  var _useMemo = React.useMemo(function () {
19493
- return getColors$2(theme.palette, type);
19617
+ return getColors$1(theme.palette, type);
19494
19618
  }, [theme.palette, type]),
19495
19619
  border = _useMemo.border,
19496
19620
  borderActive = _useMemo.borderActive,
@@ -19633,7 +19757,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19633
19757
  SelectComponent.displayName = 'Select';
19634
19758
  var Select = withScale(SelectComponent);
19635
19759
 
19636
- var _excluded$8 = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
19760
+ var _excluded$5 = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
19637
19761
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
19638
19762
  var identValue = _ref.value,
19639
19763
  _ref$className = _ref.className,
@@ -19647,7 +19771,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
19647
19771
  label = _ref$label === undefined ? false : _ref$label,
19648
19772
  _ref$preventAllEvents = _ref.preventAllEvents,
19649
19773
  preventAllEvents = _ref$preventAllEvents === undefined ? false : _ref$preventAllEvents,
19650
- props = _objectWithoutProperties(_ref, _excluded$8);
19774
+ props = _objectWithoutProperties(_ref, _excluded$5);
19651
19775
  var theme = useTheme();
19652
19776
  var _useScale = useScale(),
19653
19777
  SCALES = _useScale.SCALES;
@@ -19706,476 +19830,954 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
19706
19830
  dynamic: [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]
19707
19831
  }, ".option.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;max-width:100%;box-sizing:border-box;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:normal;background-color:".concat(bgColor, ";color:").concat(color, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";-webkit-transition:background 0.2s ease 0s,border-color 0.2s ease 0s;transition:background 0.2s ease 0s,border-color 0.2s ease 0s;--select-font-size:").concat(SCALES.font(0.75), ";font-size:var(--select-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(2.25), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.667), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.option.__jsx-style-dynamic-selector:hover{background-color:").concat(hoverBgColor, ";color:").concat(theme.palette.accents_7, ";}.divider.__jsx-style-dynamic-selector{line-height:0;overflow:hidden;border-top:1px solid ").concat(theme.palette.border, ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0.5), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0.5), " ").concat(SCALES.ml(0), ";}.label.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_7, ";border-bottom:1px solid ").concat(theme.palette.border, ";text-transform:capitalize;cursor:default;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, '100%'), ";font-weight:500;}")));
19708
19832
  };
19709
- SelectOptionComponent.displayName = 'SelectOption';
19710
- var SelectOption = withScale(SelectOptionComponent);
19833
+ SelectOptionComponent.displayName = 'SelectOption';
19834
+ var SelectOption = withScale(SelectOptionComponent);
19835
+
19836
+ Select.Option = SelectOption;
19837
+
19838
+ var ButtonDrip = function ButtonDrip(_ref) {
19839
+ var _ref$x = _ref.x,
19840
+ x = _ref$x === undefined ? 0 : _ref$x,
19841
+ _ref$y = _ref.y,
19842
+ y = _ref$y === undefined ? 0 : _ref$y,
19843
+ color = _ref.color,
19844
+ onCompleted = _ref.onCompleted;
19845
+ var dripRef = React.useRef(null);
19846
+ /* istanbul ignore next */
19847
+ var top = Number.isNaN(+y) ? 0 : y - 10;
19848
+ /* istanbul ignore next */
19849
+ var left = Number.isNaN(+x) ? 0 : x - 10;
19850
+ React.useEffect(function () {
19851
+ /* istanbul ignore next */
19852
+ if (!dripRef.current) return;
19853
+ dripRef.current.addEventListener('animationend', onCompleted);
19854
+ return function () {
19855
+ /* istanbul ignore next */
19856
+ if (!dripRef.current) return;
19857
+ dripRef.current.removeEventListener('animationend', onCompleted);
19858
+ };
19859
+ });
19860
+ return /*#__PURE__*/React.createElement("div", {
19861
+ ref: dripRef,
19862
+ className: "jsx-3424889537" + " " + "drip"
19863
+ }, /*#__PURE__*/React.createElement("svg", {
19864
+ width: "20",
19865
+ height: "20",
19866
+ viewBox: "0 0 20 20",
19867
+ style: {
19868
+ top: top,
19869
+ left: left
19870
+ },
19871
+ className: "jsx-3424889537"
19872
+ }, /*#__PURE__*/React.createElement("g", {
19873
+ stroke: "none",
19874
+ strokeWidth: "1",
19875
+ fill: "none",
19876
+ fillRule: "evenodd",
19877
+ className: "jsx-3424889537"
19878
+ }, /*#__PURE__*/React.createElement("g", {
19879
+ fill: color,
19880
+ className: "jsx-3424889537"
19881
+ }, /*#__PURE__*/React.createElement("rect", {
19882
+ width: "100%",
19883
+ height: "100%",
19884
+ rx: "10",
19885
+ className: "jsx-3424889537"
19886
+ })))), /*#__PURE__*/React.createElement(_JSXStyle, {
19887
+ id: "3424889537"
19888
+ }, ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"));
19889
+ };
19890
+ ButtonDrip.displayName = 'ButtonDrip';
19891
+
19892
+ var _excluded$4 = ["children", "type", "color", "className", "spaceRatio"];
19893
+ var getIconBgColor = function getIconBgColor(type, palette, color) {
19894
+ var colors = {
19895
+ "default": palette.accents_6,
19896
+ secondary: palette.secondary,
19897
+ success: palette.success,
19898
+ warning: palette.warning,
19899
+ error: palette.error
19900
+ };
19901
+ return color ? color : colors[type];
19902
+ };
19903
+ var LoadingComponent = function LoadingComponent(_ref) {
19904
+ var children = _ref.children,
19905
+ _ref$type = _ref.type,
19906
+ type = _ref$type === undefined ? 'default' : _ref$type,
19907
+ color = _ref.color,
19908
+ _ref$className = _ref.className,
19909
+ className = _ref$className === undefined ? '' : _ref$className,
19910
+ _ref$spaceRatio = _ref.spaceRatio,
19911
+ spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
19912
+ props = _objectWithoutProperties(_ref, _excluded$4);
19913
+ var theme = useTheme();
19914
+ var _useScale = useScale(),
19915
+ SCALES = _useScale.SCALES;
19916
+ var classes = useClasses('loading-container', className);
19917
+ var bgColor = React.useMemo(function () {
19918
+ return getIconBgColor(type, theme.palette, color);
19919
+ }, [type, theme.palette, color]);
19920
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
19921
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
19922
+ }), /*#__PURE__*/React.createElement("span", {
19923
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
19924
+ }, children && /*#__PURE__*/React.createElement("label", {
19925
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
19926
+ }, children), /*#__PURE__*/React.createElement("i", {
19927
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
19928
+ }), /*#__PURE__*/React.createElement("i", {
19929
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
19930
+ }), /*#__PURE__*/React.createElement("i", {
19931
+ className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
19932
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
19933
+ id: "2201634259",
19934
+ dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]
19935
+ }, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
19936
+ };
19937
+ LoadingComponent.displayName = 'Loading';
19938
+ var Loading = withScale(LoadingComponent);
19711
19939
 
19712
- Select.Option = SelectOption;
19940
+ var ButtonLoading = function ButtonLoading(_ref) {
19941
+ var color = _ref.color;
19942
+ return /*#__PURE__*/React.createElement("div", {
19943
+ className: "jsx-212623367" + " " + "btn-loading"
19944
+ }, /*#__PURE__*/React.createElement(Loading, {
19945
+ color: color
19946
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
19947
+ id: "212623367"
19948
+ }, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
19949
+ };
19950
+ ButtonLoading.displayName = 'GeistButtonLoading';
19713
19951
 
19714
- var InputLabel = function InputLabel(_ref) {
19715
- var children = _ref.children,
19716
- isRight = _ref.isRight;
19717
- var theme = useTheme();
19718
- return /*#__PURE__*/React.createElement("span", {
19719
- className: _JSXStyle.dynamic([["3089782703", [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]]]) + " " + ((isRight ? 'right' : '') || "")
19720
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19721
- id: "3089782703",
19722
- dynamic: [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]
19723
- }, "span.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:initial;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;margin:0;padding:0 ".concat(theme.layout.gapHalf, ";color:").concat(theme.palette.accents_4, ";background-color:").concat(theme.palette.accents_1, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";border-top:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-bottom:1px solid ").concat(theme.palette.border, ";font-size:inherit;line-height:1;}span.right.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";border-left:0;border-right:1px solid ").concat(theme.palette.border, ";}")));
19952
+ var _excluded$3 = ["isRight", "isSingle", "children", "className"];
19953
+ var ButtonIcon = function ButtonIcon(_ref) {
19954
+ var _ref$isRight = _ref.isRight,
19955
+ isRight = _ref$isRight === undefined ? false : _ref$isRight,
19956
+ isSingle = _ref.isSingle,
19957
+ children = _ref.children,
19958
+ _ref$className = _ref.className,
19959
+ className = _ref$className === undefined ? '' : _ref$className,
19960
+ props = _objectWithoutProperties(_ref, _excluded$3);
19961
+ var classes = useClasses('icon', {
19962
+ right: isRight,
19963
+ single: isSingle
19964
+ }, className);
19965
+ return /*#__PURE__*/React.createElement("span", _extends({}, props, {
19966
+ className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
19967
+ }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
19968
+ id: "2467502931"
19969
+ }, ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"));
19724
19970
  };
19725
- var MemoInputLabel = /*#__PURE__*/React.memo(InputLabel);
19971
+ ButtonIcon.displayName = 'ButtonIcon';
19726
19972
 
19727
- var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
19728
- var children = _ref.children;
19729
- var theme = useTheme();
19730
- return /*#__PURE__*/React.createElement("label", {
19731
- className: _JSXStyle.dynamic([["1278828862", [theme.palette.accents_6]]])
19973
+ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
19974
+ var icon = icons.icon,
19975
+ iconRight = icons.iconRight;
19976
+ var hasIcon = icon || iconRight;
19977
+ var isRight = Boolean(iconRight);
19978
+ var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
19979
+ var classes = useClasses('text', isRight ? 'right' : 'left');
19980
+ if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
19981
+ className: "text"
19982
+ }, children);
19983
+ if (React.Children.count(children) === 0) {
19984
+ return /*#__PURE__*/React.createElement(ButtonIcon, {
19985
+ isRight: isRight,
19986
+ isSingle: true
19987
+ }, hasIcon);
19988
+ }
19989
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
19990
+ isRight: isRight
19991
+ }, hasIcon), /*#__PURE__*/React.createElement("div", {
19992
+ className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
19732
19993
  }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19733
- id: "1278828862",
19734
- dynamic: [theme.palette.accents_6]
19735
- }, "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
19994
+ id: "3568181479",
19995
+ dynamic: [paddingForAutoMode, paddingForAutoMode]
19996
+ }, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
19997
+ };
19998
+ var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
19999
+ if (!config.isButtonGroup) return props;
20000
+ return _objectSpread2(_objectSpread2({}, props), {}, {
20001
+ auto: true,
20002
+ shadow: false,
20003
+ ghost: config.ghost || props.ghost,
20004
+ type: config.type || props.type,
20005
+ disabled: config.disabled || props.disabled
20006
+ });
19736
20007
  };
19737
- InputBlockLabelComponent.displayName = 'GeistInputBlockLabel';
19738
- var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
19739
20008
 
19740
- var InputIconComponent = function InputIconComponent(_ref) {
19741
- var icon = _ref.icon,
19742
- _ref$clickable = _ref.clickable,
19743
- clickable = _ref$clickable === undefined ? false : _ref$clickable,
19744
- onClick = _ref.onClick;
19745
- return /*#__PURE__*/React.createElement("span", {
19746
- onClick: onClick,
19747
- className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon"
19748
- }, icon, /*#__PURE__*/React.createElement(_JSXStyle, {
19749
- id: "4247656379",
19750
- dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']
19751
- }, ".input-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;line-height:1;position:relative;cursor:".concat(clickable ? 'pointer' : 'default', ";pointer-events:").concat(clickable ? 'auto' : 'none', ";}.input-icon.__jsx-style-dynamic-selector svg{width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
20009
+ /* "use client" */
20010
+
20011
+ var defaultContext$1 = {
20012
+ isButtonGroup: false,
20013
+ disabled: false
20014
+ };
20015
+ var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$1);
20016
+ var useButtonGroupContext = function useButtonGroupContext() {
20017
+ return React.useContext(ButtonGroupContext);
19752
20018
  };
19753
- InputIconComponent.displayName = 'GeistInputIcon';
19754
- var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
19755
20019
 
19756
- var InputIconClear = function InputIconClear(_ref) {
19757
- var onClick = _ref.onClick,
19758
- disabled = _ref.disabled,
19759
- visible = _ref.visible;
19760
- var theme = useTheme();
19761
- var classes = useClasses('clear-icon', {
19762
- visible: visible
20020
+ var hexToRgb = function hexToRgb(color) {
20021
+ var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
20022
+ var full = color.replace(fullReg, function (_, r, g, b) {
20023
+ return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
19763
20024
  });
19764
- var clickHandler = function clickHandler(event) {
19765
- event.preventDefault();
19766
- event.stopPropagation();
19767
- event.nativeEvent.stopImmediatePropagation();
19768
- onClick && onClick(event);
20025
+ var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
20026
+ if (!values) {
20027
+ throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
20028
+ }
20029
+ return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
20030
+ };
20031
+ var colorToRgbValues = function colorToRgbValues(color) {
20032
+ if (color.charAt(0) === '#') return hexToRgb(color);
20033
+ var safeColor = color.replace(/ /g, '');
20034
+ var colorType = color.substr(0, 4);
20035
+ var regArray = safeColor.match(/\((.+)\)/);
20036
+ if (!colorType.startsWith('rgb') || !regArray) {
20037
+ console.log(color);
20038
+ throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
20039
+ }
20040
+ return regArray[1].split(',').map(function (str) {
20041
+ return Number.parseFloat(str);
20042
+ });
20043
+ };
20044
+ var addColorAlpha = function addColorAlpha(color, alpha) {
20045
+ if (!/^#|rgb|RGB/.test(color)) return color;
20046
+ var _colorToRgbValues = colorToRgbValues(color),
20047
+ _colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
20048
+ r = _colorToRgbValues2[0],
20049
+ g = _colorToRgbValues2[1],
20050
+ b = _colorToRgbValues2[2];
20051
+ var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
20052
+ return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
20053
+ };
20054
+
20055
+ var getButtonGhostColors = function getButtonGhostColors(palette, type) {
20056
+ var colors = {
20057
+ secondary: {
20058
+ bg: palette.background,
20059
+ border: palette.foreground,
20060
+ color: palette.foreground
20061
+ },
20062
+ success: {
20063
+ bg: palette.background,
20064
+ border: palette.success,
20065
+ color: palette.success
20066
+ },
20067
+ warning: {
20068
+ bg: palette.background,
20069
+ border: palette.warning,
20070
+ color: palette.warning
20071
+ },
20072
+ error: {
20073
+ bg: palette.background,
20074
+ border: palette.error,
20075
+ color: palette.error
20076
+ }
20077
+ };
20078
+ return colors[type] || null;
20079
+ };
20080
+ var getButtonColors = function getButtonColors(palette, props) {
20081
+ var type = props.type,
20082
+ disabled = props.disabled,
20083
+ ghost = props.ghost;
20084
+ var colors = {
20085
+ "default": {
20086
+ bg: palette.background,
20087
+ border: palette.border,
20088
+ color: palette.accents_5
20089
+ },
20090
+ secondary: {
20091
+ bg: palette.foreground,
20092
+ border: palette.foreground,
20093
+ color: palette.background
20094
+ },
20095
+ success: {
20096
+ bg: palette.success,
20097
+ border: palette.success,
20098
+ color: '#fff'
20099
+ },
20100
+ warning: {
20101
+ bg: palette.warning,
20102
+ border: palette.warning,
20103
+ color: '#fff'
20104
+ },
20105
+ error: {
20106
+ bg: palette.error,
20107
+ border: palette.error,
20108
+ color: '#fff'
20109
+ },
20110
+ abort: {
20111
+ bg: 'transparent',
20112
+ border: 'transparent',
20113
+ color: palette.accents_5
20114
+ }
20115
+ };
20116
+ if (disabled) return {
20117
+ bg: palette.accents_1,
20118
+ border: palette.accents_2,
20119
+ color: '#ccc'
20120
+ };
20121
+
20122
+ /**
20123
+ * The '-light' type is the same color as the common type,
20124
+ * only hover's color is different.
20125
+ * e.g.
20126
+ * Color['success'] === Color['success-light']
20127
+ * Color['warning'] === Color['warning-light']
20128
+ */
20129
+ var withoutLightType = type === null || type === undefined ? undefined : type.replace('-light', '');
20130
+ var defaultColor = colors["default"];
20131
+ if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
20132
+ return colors[withoutLightType] || defaultColor;
20133
+ };
20134
+ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type) {
20135
+ var colors = {
20136
+ secondary: {
20137
+ bg: palette.foreground,
20138
+ border: palette.background,
20139
+ color: palette.background
20140
+ },
20141
+ success: {
20142
+ bg: palette.success,
20143
+ border: palette.background,
20144
+ color: 'white'
20145
+ },
20146
+ warning: {
20147
+ bg: palette.warning,
20148
+ border: palette.background,
20149
+ color: 'white'
20150
+ },
20151
+ error: {
20152
+ bg: palette.error,
20153
+ border: palette.background,
20154
+ color: 'white'
20155
+ }
19769
20156
  };
19770
- return /*#__PURE__*/React.createElement("div", {
19771
- onClick: clickHandler,
19772
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]]) + " " + (classes || "")
19773
- }, /*#__PURE__*/React.createElement("svg", {
19774
- viewBox: "0 0 24 24",
19775
- stroke: "currentColor",
19776
- strokeWidth: "1.5",
19777
- strokeLinecap: "round",
19778
- strokeLinejoin: "round",
19779
- fill: "none",
19780
- shapeRendering: "geometricPrecision",
19781
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19782
- }, /*#__PURE__*/React.createElement("path", {
19783
- d: "M18 6L6 18",
19784
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19785
- }), /*#__PURE__*/React.createElement("path", {
19786
- d: "M6 6l12 12",
19787
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19788
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
19789
- id: "1567030211",
19790
- dynamic: [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]
19791
- }, ".clear-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;margin:0;padding:0;color:").concat(theme.palette.accents_3, ";visibility:hidden;opacity:0;}.visible.__jsx-style-dynamic-selector{visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(disabled ? theme.palette.accents_3 : theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
20157
+ var withoutLightType = type.replace('-light', '');
20158
+ return colors[withoutLightType] || null;
19792
20159
  };
19793
- var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
19794
-
19795
- var getColors$1 = function getColors(palette, status) {
20160
+ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
20161
+ var type = props.type,
20162
+ disabled = props.disabled,
20163
+ loading = props.loading,
20164
+ shadow = props.shadow,
20165
+ ghost = props.ghost;
20166
+ var defaultColor = getButtonColors(palette, props);
20167
+ var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
19796
20168
  var colors = {
19797
20169
  "default": {
19798
- color: palette.foreground,
19799
- borderColor: palette.border,
19800
- hoverBorder: palette.accents_5
20170
+ bg: palette.background,
20171
+ border: palette.foreground
19801
20172
  },
19802
20173
  secondary: {
19803
- color: palette.foreground,
19804
- borderColor: palette.secondary,
19805
- hoverBorder: palette.secondary
20174
+ bg: palette.background,
20175
+ border: palette.foreground
19806
20176
  },
19807
20177
  success: {
19808
- color: palette.foreground,
19809
- borderColor: palette.successLight,
19810
- hoverBorder: palette.success
20178
+ bg: palette.background,
20179
+ border: palette.success
19811
20180
  },
19812
20181
  warning: {
19813
- color: palette.foreground,
19814
- borderColor: palette.warningLight,
19815
- hoverBorder: palette.warning
20182
+ bg: palette.background,
20183
+ border: palette.warning
19816
20184
  },
19817
20185
  error: {
19818
- color: palette.error,
19819
- borderColor: palette.error,
19820
- hoverBorder: palette.errorDark
19821
- }
20186
+ bg: palette.background,
20187
+ border: palette.error
20188
+ },
20189
+ abort: {
20190
+ bg: 'transparent',
20191
+ border: 'transparent',
20192
+ color: palette.accents_5
20193
+ },
20194
+ 'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
20195
+ bg: alphaBackground
20196
+ }),
20197
+ 'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
20198
+ bg: alphaBackground
20199
+ }),
20200
+ 'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
20201
+ bg: alphaBackground
20202
+ }),
20203
+ 'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
20204
+ bg: alphaBackground
20205
+ })
19822
20206
  };
19823
- if (!status) return colors["default"];
19824
- return colors[status];
19825
- };
19826
-
19827
- var _excluded$7 = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
19828
- var simulateChangeEvent = function simulateChangeEvent(el, event) {
19829
- return _objectSpread2(_objectSpread2({}, event), {}, {
19830
- target: el,
19831
- currentTarget: el
20207
+ if (disabled) return {
20208
+ bg: palette.accents_1,
20209
+ border: palette.accents_2,
20210
+ color: '#ccc'
20211
+ };
20212
+ if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
20213
+ color: 'transparent'
20214
+ });
20215
+ if (shadow) return defaultColor;
20216
+ var hoverColor = (ghost ? getButtonGhostHoverColors(palette, type) : colors[type]) || colors["default"];
20217
+ return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
20218
+ color: hoverColor.color || hoverColor.border
19832
20219
  });
19833
20220
  };
19834
- var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
19835
- var label = _ref.label,
19836
- labelRight = _ref.labelRight,
19837
- _ref$type = _ref.type,
19838
- type = _ref$type === undefined ? 'default' : _ref$type,
19839
- error = _ref.error,
19840
- _ref$htmlType = _ref.htmlType,
19841
- htmlType = _ref$htmlType === undefined ? 'text' : _ref$htmlType,
19842
- icon = _ref.icon,
19843
- iconRight = _ref.iconRight,
19844
- _ref$iconClickable = _ref.iconClickable,
19845
- iconClickable = _ref$iconClickable === undefined ? false : _ref$iconClickable,
19846
- onIconClick = _ref.onIconClick,
19847
- _ref$initialValue = _ref.initialValue,
19848
- initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
19849
- onChange = _ref.onChange,
19850
- _ref$readOnly = _ref.readOnly,
19851
- readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
19852
- value = _ref.value,
19853
- onClearClick = _ref.onClearClick,
19854
- _ref$clearable = _ref.clearable,
19855
- clearable = _ref$clearable === undefined ? false : _ref$clearable,
19856
- _ref$className = _ref.className,
19857
- className = _ref$className === undefined ? '' : _ref$className,
19858
- onBlur = _ref.onBlur,
19859
- onFocus = _ref.onFocus,
19860
- _ref$autoComplete = _ref.autoComplete,
19861
- autoComplete = _ref$autoComplete === undefined ? 'off' : _ref$autoComplete,
19862
- _ref$placeholder = _ref.placeholder,
19863
- placeholder = _ref$placeholder === undefined ? '' : _ref$placeholder,
19864
- children = _ref.children,
19865
- _ref$disabled = _ref.disabled,
19866
- disabled = _ref$disabled === undefined ? false : _ref$disabled,
19867
- props = _objectWithoutProperties(_ref, _excluded$7);
20221
+ var getButtonCursor = function getButtonCursor(disabled, loading) {
20222
+ if (disabled) return {
20223
+ cursor: 'not-allowed',
20224
+ events: 'auto'
20225
+ };
20226
+ if (loading) return {
20227
+ cursor: 'default',
20228
+ events: 'none'
20229
+ };
20230
+ return {
20231
+ cursor: 'pointer',
20232
+ events: 'auto'
20233
+ };
20234
+ };
20235
+ var getButtonDripColor = function getButtonDripColor(palette, props) {
20236
+ var type = props.type;
20237
+ var isLightHover = type ? type.endsWith('light') : false;
20238
+ var hoverColors = getButtonHoverColors(palette, props);
20239
+ return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
20240
+ };
20241
+
20242
+ var _excluded$2 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
20243
+ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
19868
20244
  var theme = useTheme();
19869
20245
  var _useScale = useScale(),
19870
20246
  SCALES = _useScale.SCALES;
19871
- var inputRef = React.useRef(null);
20247
+ var buttonRef = React.useRef(null);
19872
20248
  React.useImperativeHandle(ref, function () {
19873
- return inputRef.current;
20249
+ return buttonRef.current;
19874
20250
  });
19875
- var _useState = React.useState(initialValue),
20251
+ var _useState = React.useState(false),
19876
20252
  _useState2 = _slicedToArray(_useState, 2),
19877
- selfValue = _useState2[0],
19878
- setSelfValue = _useState2[1];
19879
- var _useState3 = React.useState(false),
20253
+ dripShow = _useState2[0],
20254
+ setDripShow = _useState2[1];
20255
+ var _useState3 = React.useState(0),
19880
20256
  _useState4 = _slicedToArray(_useState3, 2),
19881
- hover = _useState4[0],
19882
- setHover = _useState4[1];
19883
- var isControlledComponent = React.useMemo(function () {
19884
- return value !== undefined;
19885
- }, [value]);
19886
- var labelClasses = React.useMemo(function () {
19887
- return labelRight ? 'right-label' : label ? 'left-label' : '';
19888
- }, [label, labelRight]);
19889
- var iconClasses = React.useMemo(function () {
19890
- return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
19891
- }, [icon, iconRight]);
20257
+ dripX = _useState4[0],
20258
+ setDripX = _useState4[1];
20259
+ var _useState5 = React.useState(0),
20260
+ _useState6 = _slicedToArray(_useState5, 2),
20261
+ dripY = _useState6[0],
20262
+ setDripY = _useState6[1];
20263
+ var groupConfig = useButtonGroupContext();
20264
+ var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
20265
+ /* eslint-disable @typescript-eslint/no-unused-vars */
20266
+ var children = filteredProps.children,
20267
+ _filteredProps$disabl = filteredProps.disabled,
20268
+ disabled = _filteredProps$disabl === undefined ? false : _filteredProps$disabl;
20269
+ filteredProps.type;
20270
+ var _filteredProps$loadin = filteredProps.loading,
20271
+ loading = _filteredProps$loadin === undefined ? false : _filteredProps$loadin,
20272
+ _filteredProps$shadow = filteredProps.shadow,
20273
+ shadow = _filteredProps$shadow === undefined ? false : _filteredProps$shadow,
20274
+ _filteredProps$ghost = filteredProps.ghost,
20275
+ ghost = _filteredProps$ghost === undefined ? false : _filteredProps$ghost,
20276
+ _filteredProps$effect = filteredProps.effect,
20277
+ effect = _filteredProps$effect === undefined ? true : _filteredProps$effect,
20278
+ onClick = filteredProps.onClick,
20279
+ _filteredProps$auto = filteredProps.auto,
20280
+ auto = _filteredProps$auto === undefined ? false : _filteredProps$auto,
20281
+ icon = filteredProps.icon,
20282
+ _filteredProps$htmlTy = filteredProps.htmlType,
20283
+ htmlType = _filteredProps$htmlTy === undefined ? 'button' : _filteredProps$htmlTy,
20284
+ iconRight = filteredProps.iconRight,
20285
+ _filteredProps$classN = filteredProps.className,
20286
+ className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
20287
+ filteredProps.crossOrigin;
20288
+ var props = _objectWithoutProperties(filteredProps, _excluded$2);
20289
+ /* eslint-enable @typescript-eslint/no-unused-vars */
20290
+
19892
20291
  var _useMemo = React.useMemo(function () {
19893
- return getColors$1(theme.palette, type);
19894
- }, [theme.palette, type]),
19895
- color = _useMemo.color,
19896
- borderColor = _useMemo.borderColor,
19897
- hoverBorder = _useMemo.hoverBorder;
19898
- var changeHandler = function changeHandler(event) {
19899
- if (disabled || readOnly) return;
19900
- setSelfValue(event.target.value);
19901
- onChange && onChange(event);
20292
+ return getButtonColors(theme.palette, filteredProps);
20293
+ }, [theme.palette, filteredProps]),
20294
+ bg = _useMemo.bg,
20295
+ border = _useMemo.border,
20296
+ color = _useMemo.color;
20297
+ var hover = React.useMemo(function () {
20298
+ return getButtonHoverColors(theme.palette, filteredProps);
20299
+ }, [theme.palette, filteredProps]);
20300
+ var _useMemo2 = React.useMemo(function () {
20301
+ return getButtonCursor(disabled, loading);
20302
+ }, [disabled, loading]),
20303
+ cursor = _useMemo2.cursor,
20304
+ events = _useMemo2.events;
20305
+ var dripColor = React.useMemo(function () {
20306
+ return getButtonDripColor(theme.palette, filteredProps);
20307
+ }, [theme.palette, filteredProps]);
20308
+
20309
+ /* istanbul ignore next */
20310
+ var dripCompletedHandle = function dripCompletedHandle() {
20311
+ setDripShow(false);
20312
+ setDripX(0);
20313
+ setDripY(0);
19902
20314
  };
19903
- var clearHandler = function clearHandler(event) {
19904
- setSelfValue('');
19905
- onClearClick && onClearClick(event);
20315
+ var clickHandler = function clickHandler(event) {
20316
+ if (disabled || loading) return;
20317
+ var showDrip = !shadow && !ghost && effect;
19906
20318
  /* istanbul ignore next */
19907
- if (!inputRef.current) return;
19908
- var changeEvent = simulateChangeEvent(inputRef.current, event);
19909
- changeEvent.target.value = '';
19910
- onChange && onChange(changeEvent);
19911
- inputRef.current.focus();
19912
- };
19913
- var focusHandler = function focusHandler(e) {
19914
- setHover(true);
19915
- onFocus && onFocus(e);
19916
- };
19917
- var blurHandler = function blurHandler(e) {
19918
- setHover(false);
19919
- onBlur && onBlur(e);
19920
- };
19921
- var iconClickHandler = function iconClickHandler(e) {
19922
- if (disabled) return;
19923
- onIconClick && onIconClick(e);
19924
- };
19925
- var iconProps = React.useMemo(function () {
19926
- return {
19927
- clickable: iconClickable,
19928
- onClick: iconClickHandler
19929
- };
19930
- }, [iconClickable, iconClickHandler]);
19931
- React.useEffect(function () {
19932
- if (isControlledComponent) {
19933
- setSelfValue(value);
20319
+ if (showDrip && buttonRef.current) {
20320
+ var rect = buttonRef.current.getBoundingClientRect();
20321
+ setDripShow(true);
20322
+ setDripX(event.clientX - rect.left);
20323
+ setDripY(event.clientY - rect.top);
19934
20324
  }
19935
- });
19936
- var controlledValue = isControlledComponent ? {
19937
- value: selfValue
19938
- } : {
19939
- defaultValue: initialValue
20325
+ onClick && onClick(event);
19940
20326
  };
19941
- var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
19942
- return /*#__PURE__*/React.createElement("div", {
19943
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "with-label"
19944
- }, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
19945
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-container', className) || "")
19946
- }, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
19947
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-wrapper', {
19948
- hover: hover,
19949
- disabled: disabled
19950
- }, labelClasses) || "")
19951
- }, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
19952
- icon: icon
19953
- }, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
20327
+ var childrenWithIcon = React.useMemo(function () {
20328
+ return getButtonChildrenWithIcon(auto, children, {
20329
+ icon: icon,
20330
+ iconRight: iconRight
20331
+ });
20332
+ }, [auto, children, icon, iconRight]);
20333
+ var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
20334
+ paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
20335
+ return /*#__PURE__*/React.createElement("button", _extends({
20336
+ ref: buttonRef,
19954
20337
  type: htmlType,
19955
- ref: inputRef,
19956
- placeholder: placeholder,
19957
20338
  disabled: disabled,
19958
- readOnly: readOnly,
19959
- onFocus: focusHandler,
19960
- onBlur: blurHandler,
19961
- onChange: changeHandler,
19962
- autoComplete: autoComplete
19963
- }, inputProps, {
19964
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
19965
- disabled: disabled
19966
- }, iconClasses) || "")
19967
- })), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
19968
- visible: Boolean(inputRef.current && inputRef.current.value !== ''),
19969
- disabled: disabled || readOnly,
19970
- onClick: clearHandler
19971
- }), iconRight && /*#__PURE__*/React.createElement(InputIcon, _extends({
19972
- icon: iconRight
19973
- }, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
19974
- isRight: true
19975
- }, labelRight), /*#__PURE__*/React.createElement("br", {
19976
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]])
19977
- })), error && /*#__PURE__*/React.createElement("p", {
19978
- style: {
19979
- marginTop: 0.4,
19980
- marginRight: 0,
19981
- marginLeft: 0,
19982
- marginBottom: '0.4rem',
19983
- textAlign: 'left'
19984
- },
19985
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "input-error"
19986
- }, error), /*#__PURE__*/React.createElement(_JSXStyle, {
19987
- id: "1424341926",
19988
- dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]
19989
- }, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'initial'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, 'initial'), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
20339
+ onClick: clickHandler
20340
+ }, props, {
20341
+ className: _JSXStyle.dynamic([["22324076", [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
20342
+ }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
20343
+ color: color
20344
+ }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
20345
+ x: dripX,
20346
+ y: dripY,
20347
+ color: dripColor,
20348
+ onCompleted: dripCompletedHandle
20349
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
20350
+ id: "22324076",
20351
+ dynamic: [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
20352
+ }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(theme.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}")));
19990
20353
  });
19991
- InputComponent.displayName = 'Input';
19992
- var Input = withScale(InputComponent);
20354
+ ButtonComponent.displayName = 'Button';
20355
+ var Button = withScale(ButtonComponent);
20356
+
20357
+ var makeColgroup = function makeColgroup(width, columns) {
20358
+ var unsetWidthCount = columns.filter(function (c) {
20359
+ return !c.width;
20360
+ }).length;
20361
+ var customWidthTotal = columns.reduce(function (pre, current) {
20362
+ return current.width ? pre + current.width : pre;
20363
+ }, 0);
20364
+ var averageWidth = (width - customWidthTotal) / unsetWidthCount;
20365
+ if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
20366
+ return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
20367
+ return /*#__PURE__*/React.createElement("col", {
20368
+ key: "colgroup-".concat(index),
20369
+ width: column.width || averageWidth
20370
+ });
20371
+ }));
20372
+ };
20373
+ var TableHead = function TableHead(props) {
20374
+ var theme = useTheme();
20375
+ var _React$useState = React.useState({}),
20376
+ _React$useState2 = _slicedToArray(_React$useState, 2),
20377
+ filters = _React$useState2[0],
20378
+ setFilters = _React$useState2[1];
20379
+ var _ref = props,
20380
+ columns = _ref.columns,
20381
+ width = _ref.width,
20382
+ onFilters = _ref.onFilters,
20383
+ showFilters = _ref.showFilters;
20384
+ var isScalableWidth = React.useMemo(function () {
20385
+ return columns.find(function (item) {
20386
+ return !!item.width;
20387
+ });
20388
+ }, [columns]);
20389
+ var colgroup = React.useMemo(function () {
20390
+ if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
20391
+ return makeColgroup(width, columns);
20392
+ }, [isScalableWidth, width]);
20393
+ var handleFilterChange = function handleFilterChange(name, value) {
20394
+ setFilters(function (prevFilters) {
20395
+ var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
20396
+ return updatedFilters;
20397
+ });
20398
+ };
20399
+ var applyFilters = function applyFilters() {
20400
+ if (onFilters) {
20401
+ onFilters(filters);
20402
+ }
20403
+ };
20404
+ var generateFilterInputs = function generateFilterInputs() {
20405
+ return columns.map(function (col) {
20406
+ var _String, _filters$filterName;
20407
+ var Header = col.label,
20408
+ accessor = col.filter,
20409
+ options = col.options;
20410
+ var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
20411
+ var unq_accessor = _.uniqueId(filterName);
20412
+ return /*#__PURE__*/React.createElement("th", {
20413
+ style: {
20414
+ margin: '3px'
20415
+ },
20416
+ "data-column": Header,
20417
+ key: unq_accessor
20418
+ }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
20419
+ key: unq_accessor,
20420
+ name: filterName,
20421
+ value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
20422
+ onChange: function onChange(newValue) {
20423
+ return handleFilterChange(filterName, newValue);
20424
+ }
20425
+ }, /*#__PURE__*/React.createElement(Select.Option, {
20426
+ value: "All"
20427
+ }, "All ", Header), options ? options.map(function (option) {
20428
+ return /*#__PURE__*/React.createElement(Select.Option, {
20429
+ value: option.value
20430
+ }, option.name);
20431
+ }) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
20432
+ id: "filter-date-".concat(filterName),
20433
+ htmlType: "date",
20434
+ name: filterName,
20435
+ value: filters[filterName],
20436
+ onChange: function onChange(e) {
20437
+ return handleFilterChange(filterName, e.target.value);
20438
+ }
20439
+ }), accessor === 'search' && /*#__PURE__*/React.createElement(Input, {
20440
+ id: "filter-search-".concat(filterName),
20441
+ htmlType: "text",
20442
+ autoComplete: "off"
20443
+ // ref={filterRefs.current[filterName]} // Dynamically set ref}
20444
+ ,
20445
+ name: filterName,
20446
+ style: {
20447
+ height: 30,
20448
+ minWidth: 160
20449
+ },
20450
+ value: filters[filterName],
20451
+ onChange: function onChange(e) {
20452
+ return handleFilterChange(filterName, e.target.value);
20453
+ },
20454
+ placeholder: "Search...",
20455
+ fullWidth: true
20456
+ }));
20457
+ });
20458
+ };
20459
+ return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
20460
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20461
+ }, /*#__PURE__*/React.createElement("tr", {
20462
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20463
+ }, columns.map(function (column, index) {
20464
+ return /*#__PURE__*/React.createElement("th", {
20465
+ style: {
20466
+ // textAlign: `${column?.align} !important`,
20467
+ // paddingLeft: '0.3rem',
20468
+ // paddingRight: '0.3rem',
20469
+ // color: `${column?.color}`,
20470
+ whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
20471
+ },
20472
+ key: "table-th-".concat(column.prop.toString(), "-").concat(index),
20473
+ "data-column": column.label,
20474
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
20475
+ }, /*#__PURE__*/React.createElement("div", {
20476
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
20477
+ }, column.label, /*#__PURE__*/React.createElement("br", {
20478
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20479
+ }), /*#__PURE__*/React.createElement("span", {
20480
+ style: {
20481
+ textAlign: 'center'
20482
+ },
20483
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20484
+ }, column.text)));
20485
+ }), /*#__PURE__*/React.createElement("th", {
20486
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20487
+ })), showFilters && /*#__PURE__*/React.createElement("tr", {
20488
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20489
+ }, generateFilterInputs(), /*#__PURE__*/React.createElement("th", {
20490
+ className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
20491
+ }, /*#__PURE__*/React.createElement(Button, {
20492
+ onClick: applyFilters,
20493
+ auto: true,
20494
+ px: 0.6,
20495
+ scale: 2 / 3
20496
+ }, "Apply")))), /*#__PURE__*/React.createElement(_JSXStyle, {
20497
+ id: "134865897",
20498
+ dynamic: [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
20499
+ }, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:".concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
20500
+ };
20501
+ TableHead.displayName = 'TableHead';
19993
20502
 
19994
- var tuple = function tuple() {
19995
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19996
- args[_key] = arguments[_key];
19997
- }
19998
- return args;
20503
+ var TableCell = function TableCell(_ref) {
20504
+ var columns = _ref.columns,
20505
+ row = _ref.row,
20506
+ rowIndex = _ref.rowIndex,
20507
+ emptyText = _ref.emptyText,
20508
+ onCellClick = _ref.onCellClick;
20509
+ /* eslint-disable react/jsx-no-useless-fragment */
20510
+ return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
20511
+ var currentRowValue = row[column.prop];
20512
+ var cellValue = currentRowValue || emptyText;
20513
+ var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
20514
+ return /*#__PURE__*/React.createElement("td", {
20515
+ style: _objectSpread2({
20516
+ fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
20517
+ textAlign: "".concat(column === null || column === undefined ? undefined : column.align, " !important"),
20518
+ paddingLeft: '0.3rem',
20519
+ paddingRight: '0.3rem',
20520
+ color: "".concat(column === null || column === undefined ? undefined : column.color),
20521
+ whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
20522
+ }, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
20523
+ "data-column": column.label,
20524
+ key: "row-td-".concat(index, "-").concat(column.prop.toString()),
20525
+ onClick: function onClick() {
20526
+ return onCellClick && onCellClick(currentRowValue, rowIndex, index);
20527
+ },
20528
+ className: column.className
20529
+ }, /*#__PURE__*/React.createElement("div", {
20530
+ className: "cell"
20531
+ }, shouldBeRenderElement ? shouldBeRenderElement : cellValue));
20532
+ }));
20533
+ /* eslint-enable */
19999
20534
  };
20000
- tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
20001
- tuple('default', 'secondary', 'success', 'warning', 'error');
20002
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
20003
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
20004
- tuple('default', 'silent', 'prevent');
20005
- tuple('hover', 'click');
20006
- tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
20007
- tuple('start', 'center', 'end', 'left', 'right');
20008
20535
 
20009
- var _excluded$6 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
20010
- tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
20011
- var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20012
- var _ref$type = _ref.type,
20013
- type = _ref$type === undefined ? 'default' : _ref$type,
20014
- _ref$disabled = _ref.disabled,
20015
- disabled = _ref$disabled === undefined ? false : _ref$disabled,
20536
+ /* "use client" */
20537
+
20538
+ var defaultContext = {
20539
+ columns: [],
20540
+ updateColumn: function updateColumn() {}
20541
+ };
20542
+ var TableContext = /*#__PURE__*/React.createContext(defaultContext);
20543
+ var useTableContext = function useTableContext() {
20544
+ return React.useContext(TableContext);
20545
+ };
20546
+
20547
+ var TableBody = function TableBody(_ref) {
20548
+ var data = _ref.data,
20549
+ emptyText = _ref.emptyText,
20550
+ onRow = _ref.onRow,
20551
+ onCell = _ref.onCell,
20552
+ rowClassName = _ref.rowClassName,
20553
+ _ref$rowDraggable = _ref.rowDraggable,
20554
+ rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
20016
20555
  _ref$readOnly = _ref.readOnly,
20017
20556
  readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
20018
- onFocus = _ref.onFocus,
20019
- onBlur = _ref.onBlur,
20020
- _ref$className = _ref.className,
20021
- className = _ref$className === undefined ? '' : _ref$className,
20022
- _ref$initialValue = _ref.initialValue,
20023
- initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
20024
- onChange = _ref.onChange,
20025
- value = _ref.value,
20026
- placeholder = _ref.placeholder,
20027
- _ref$resize = _ref.resize,
20028
- resize = _ref$resize === undefined ? 'none' : _ref$resize,
20029
- props = _objectWithoutProperties(_ref, _excluded$6);
20557
+ onSelected = _ref.onSelected;
20030
20558
  var theme = useTheme();
20031
- var _useScale = useScale(),
20032
- SCALES = _useScale.SCALES;
20033
- var textareaRef = React.useRef(null);
20034
- React.useImperativeHandle(ref, function () {
20035
- return textareaRef.current;
20036
- });
20037
- var isControlledComponent = React.useMemo(function () {
20038
- return value !== undefined;
20039
- }, [value]);
20040
- var _useState = React.useState(initialValue),
20559
+ var _useState = React.useState([]),
20041
20560
  _useState2 = _slicedToArray(_useState, 2),
20042
- selfValue = _useState2[0],
20043
- setSelfValue = _useState2[1];
20044
- var _useState3 = React.useState(false),
20045
- _useState4 = _slicedToArray(_useState3, 2),
20046
- hover = _useState4[0],
20047
- setHover = _useState4[1];
20048
- var _useMemo = React.useMemo(function () {
20049
- return getColors$1(theme.palette, type);
20050
- }, [theme.palette, type]),
20051
- color = _useMemo.color,
20052
- borderColor = _useMemo.borderColor,
20053
- hoverBorder = _useMemo.hoverBorder;
20054
- var classes = useClasses('wrapper', {
20055
- hover: hover,
20056
- disabled: disabled
20057
- }, className);
20058
- var changeHandler = function changeHandler(event) {
20059
- if (disabled || readOnly) return;
20060
- setSelfValue(event.target.value);
20061
- onChange && onChange(event);
20561
+ selected = _useState2[0],
20562
+ setSelected = _useState2[1];
20563
+ var _useTableContext = useTableContext(),
20564
+ columns = _useTableContext.columns;
20565
+ // const rowClickHandler = (row: TableDataItem, index: number) => {
20566
+ // onRow && onRow(row, index)
20567
+ // }
20568
+
20569
+ var handleClick = function handleClick(_event, id) {
20570
+ if (readOnly) {
20571
+ return true;
20572
+ }
20573
+ var selectedIndex = selected.indexOf(id);
20574
+ var newSelected = [];
20575
+ if (selectedIndex === -1) {
20576
+ newSelected = newSelected.concat(selected, id);
20577
+ } else if (selectedIndex === 0) {
20578
+ newSelected = newSelected.concat(selected.slice(1));
20579
+ } else if (selectedIndex === selected.length - 1) {
20580
+ newSelected = newSelected.concat(selected.slice(0, -1));
20581
+ } else if (selectedIndex > 0) {
20582
+ newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
20583
+ }
20584
+ setSelected(newSelected);
20062
20585
  };
20063
- var focusHandler = function focusHandler(e) {
20064
- setHover(true);
20065
- onFocus && onFocus(e);
20586
+
20587
+ // const handleSelectAllClick = (event: { target: { checked: any } }) => {
20588
+ // if (event.target.checked) {
20589
+ // const newSelecteds = data.map((n: any) => n._id);
20590
+ // setSelected(newSelecteds as never[]);
20591
+ // return;
20592
+ // }
20593
+ // setSelected([]);
20594
+ // };
20595
+
20596
+ // Push Selected Rows
20597
+ React.useEffect(function () {
20598
+ if (selected.length > 0 && onSelected) {
20599
+ onSelected(selected);
20600
+ }
20601
+ }, [selected]);
20602
+ function renderRow(cols, row, index) {
20603
+ var _row$style;
20604
+ var urid = _.uniqueId();
20605
+ var className = rowClassName(row, index);
20606
+ var rw = _objectSpread2({}, row);
20607
+ var rowStyle = (_row$style = row === null || row === undefined ? undefined : row.style) !== null && _row$style !== undefined ? _row$style : {};
20608
+ var onDragStart = row === null || row === undefined ? undefined : row.onDragStart;
20609
+ delete rw.table;
20610
+ delete rw.style;
20611
+ delete rw.onDragStart;
20612
+ // console.log(row);
20613
+ // const frow = Object.fromEntries(
20614
+ // Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
20615
+ // ) as unknown as TableDataItem
20616
+ // console.log(frow);
20617
+ var isRowSelected = selected.indexOf(row) !== -1;
20618
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
20619
+ draggable: rowDraggable,
20620
+ role: "checkbox",
20621
+ onDragStart: onDragStart,
20622
+ "aria-checked": selected.indexOf(row) !== -1,
20623
+ tabIndex: -1,
20624
+ key: urid,
20625
+ style: _objectSpread2({
20626
+ cursor: 'pointer',
20627
+ backgroundColor: isRowSelected ? '#efefef' : ''
20628
+ }, rowStyle),
20629
+ onClick: function onClick(e) {
20630
+ if (!rowDraggable) {
20631
+ if (onRow) {
20632
+ onRow(row, index);
20633
+ } else {
20634
+ handleClick(e, row);
20635
+ }
20636
+ }
20637
+ },
20638
+ className: _JSXStyle.dynamic([["2019708038", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
20639
+ }, /*#__PURE__*/React.createElement(TableCell, {
20640
+ columns: cols,
20641
+ row: rw,
20642
+ rowIndex: index,
20643
+ emptyText: emptyText,
20644
+ onCellClick: onCell
20645
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
20646
+ id: "2019708038",
20647
+ dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
20648
+ }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
20649
+ }
20650
+ return /*#__PURE__*/React.createElement("tbody", {
20651
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20652
+ }, data.map(function (row, index) {
20653
+ var qid = _.uniqueId();
20654
+ if (row === null || row === undefined) {
20655
+ var uid = _.uniqueId();
20656
+ return /*#__PURE__*/React.createElement("tr", {
20657
+ key: uid,
20658
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20659
+ }, /*#__PURE__*/React.createElement("td", {
20660
+ colSpan: columns.length,
20661
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20662
+ }, "\u2003"));
20663
+ }
20664
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === undefined ? undefined : row.table) && /*#__PURE__*/React.createElement("tr", {
20665
+ key: qid,
20666
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20667
+ }, /*#__PURE__*/React.createElement("td", {
20668
+ style: {
20669
+ padding: '1rem'
20670
+ },
20671
+ colSpan: columns.length,
20672
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20673
+ })));
20674
+
20675
+ // return (
20676
+ // <tr
20677
+ // key={`tbody-row-${index}`}
20678
+ // className={useClasses({ hover }, className)}
20679
+ // onClick={() => rowClickHandler(row, index)}>
20680
+ // <TableCell<TableDataItem>
20681
+ // columns={columns}
20682
+ // row={row}
20683
+ // rowIndex={index}
20684
+ // emptyText={emptyText}
20685
+ // onCellClick={onCell}
20686
+ // />
20687
+ // </tr>
20688
+ // )
20689
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
20690
+ id: "1422656197",
20691
+ dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
20692
+ }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
20693
+ };
20694
+ TableBody.displayName = 'TableBody';
20695
+
20696
+ var getRealShape = function getRealShape(el) {
20697
+ var defaultShape = {
20698
+ width: 0,
20699
+ height: 0
20066
20700
  };
20067
- var blurHandler = function blurHandler(e) {
20068
- setHover(false);
20069
- onBlur && onBlur(e);
20701
+ if (!el || typeof window === 'undefined') return defaultShape;
20702
+ var rect = el.getBoundingClientRect();
20703
+ var _window$getComputedSt = window.getComputedStyle(el),
20704
+ width = _window$getComputedSt.width,
20705
+ height = _window$getComputedSt.height;
20706
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
20707
+ if (!str) return 0;
20708
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
20709
+ return Number.isNaN(+strVal) ? 0 : +strVal;
20070
20710
  };
20071
- React.useEffect(function () {
20072
- if (isControlledComponent) {
20073
- setSelfValue(value);
20074
- }
20075
- });
20076
- var controlledValue = isControlledComponent ? {
20077
- value: selfValue
20078
- } : {
20079
- defaultValue: initialValue
20711
+ return {
20712
+ width: getCSSStyleVal("".concat(width), rect.width),
20713
+ height: getCSSStyleVal("".concat(height), rect.height)
20080
20714
  };
20081
- var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
20082
- return /*#__PURE__*/React.createElement("div", {
20083
- className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (classes || "")
20084
- }, /*#__PURE__*/React.createElement("textarea", _extends({
20085
- ref: textareaRef,
20086
- disabled: disabled,
20087
- placeholder: placeholder,
20088
- readOnly: readOnly,
20089
- onFocus: focusHandler,
20090
- onBlur: blurHandler,
20091
- onChange: changeHandler
20092
- }, textareaProps, {
20093
- className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (textareaProps && textareaProps.className != null && textareaProps.className || "")
20094
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
20095
- id: "12276481",
20096
- dynamic: [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]
20097
- }, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}")));
20098
- });
20099
- TextareaComponent.displayName = 'Textarea';
20100
- var Textarea = withScale(TextareaComponent);
20101
-
20102
- var PasswordIcon = function PasswordIcon(_ref) {
20103
- var visible = _ref.visible;
20104
- return /*#__PURE__*/React.createElement("svg", {
20105
- viewBox: "0 0 24 24",
20106
- stroke: "currentColor",
20107
- strokeWidth: "1.5",
20108
- strokeLinecap: "round",
20109
- strokeLinejoin: "round",
20110
- fill: "none",
20111
- shapeRendering: "geometricPrecision",
20112
- style: {
20113
- color: 'currentColor'
20114
- }
20115
- }, !visible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
20116
- d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
20117
- }), /*#__PURE__*/React.createElement("circle", {
20118
- cx: "12",
20119
- cy: "12",
20120
- r: "3"
20121
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
20122
- d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
20123
- }), /*#__PURE__*/React.createElement("path", {
20124
- d: "M1 1l22 22"
20125
- })));
20126
20715
  };
20127
- var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
20128
-
20129
- var _excluded$5 = ["hideToggle", "children"];
20130
- var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20131
- var hideToggle = _ref.hideToggle,
20132
- children = _ref.children,
20133
- props = _objectWithoutProperties(_ref, _excluded$5);
20134
- var _useScale = useScale(),
20135
- getAllScaleProps = _useScale.getAllScaleProps;
20136
- var inputRef = React.useRef(null);
20137
- var _useState = React.useState(false),
20716
+ var useRealShape = function useRealShape(ref) {
20717
+ var _useState = React.useState({
20718
+ width: 0,
20719
+ height: 0
20720
+ }),
20138
20721
  _useState2 = _slicedToArray(_useState, 2),
20139
- visible = _useState2[0],
20140
- setVisible = _useState2[1];
20141
- React.useImperativeHandle(ref, function () {
20142
- return inputRef.current;
20143
- });
20144
- var iconClickHandler = function iconClickHandler() {
20145
- setVisible(function (v) {
20146
- return !v;
20722
+ state = _useState2[0],
20723
+ setState = _useState2[1];
20724
+ var update = function update() {
20725
+ var _getRealShape = getRealShape(ref.current),
20726
+ width = _getRealShape.width,
20727
+ height = _getRealShape.height;
20728
+ setState({
20729
+ width: width,
20730
+ height: height
20147
20731
  });
20148
- /* istanbul ignore next */
20149
- if (inputRef && inputRef.current) {
20150
- inputRef.current.focus();
20151
- }
20152
20732
  };
20153
- var inputProps = React.useMemo(function () {
20154
- return _objectSpread2(_objectSpread2({}, props), {}, {
20155
- ref: inputRef,
20156
- iconClickable: true,
20157
- onIconClick: iconClickHandler,
20158
- htmlType: visible ? 'text' : 'password'
20159
- });
20160
- }, [props, iconClickHandler, visible, inputRef]);
20161
- var icon = React.useMemo(function () {
20162
- if (hideToggle) return null;
20163
- return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
20164
- visible: visible
20165
- });
20166
- }, [hideToggle, visible]);
20167
- return /*#__PURE__*/React.createElement(Input, _extends({
20168
- iconRight: icon
20169
- }, getAllScaleProps(), inputProps), children);
20170
- });
20171
- InputPasswordComponent.displayName = 'InputPassword';
20172
- var InputPassword = withScale(InputPasswordComponent);
20733
+ React.useEffect(function () {
20734
+ return update();
20735
+ }, [ref.current]);
20736
+ return [state, update];
20737
+ };
20173
20738
 
20174
20739
  /* "use client" */
20175
- Input.Textarea = Textarea;
20176
- Input.Password = InputPassword;
20177
20740
 
20178
- var _excluded$4 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "showFilters", "onSelected", "className", "rowClassName"];
20741
+ var TableColumn = function TableColumn(columnProps) {
20742
+ var _ref = columnProps,
20743
+ children = _ref.children,
20744
+ prop = _ref.prop,
20745
+ label = _ref.label,
20746
+ width = _ref.width,
20747
+ filter = _ref.filter,
20748
+ options = _ref.options,
20749
+ noWrap = _ref.noWrap,
20750
+ align = _ref.align,
20751
+ _ref$fontSize = _ref.fontSize,
20752
+ fontSize = _ref$fontSize === undefined ? 'smaller' : _ref$fontSize,
20753
+ _ref$className = _ref.className,
20754
+ className = _ref$className === undefined ? '' : _ref$className,
20755
+ renderHandler = _ref.render;
20756
+ var _useTableContext = useTableContext(),
20757
+ updateColumn = _useTableContext.updateColumn;
20758
+ var safeProp = "".concat(prop.toString()).trim();
20759
+ if (!safeProp) {
20760
+ useWarning('The props "prop" is required.', 'Table.Column');
20761
+ }
20762
+ React.useEffect(function () {
20763
+ updateColumn({
20764
+ label: children || label,
20765
+ filter: filter,
20766
+ noWrap: noWrap,
20767
+ options: options,
20768
+ prop: safeProp,
20769
+ width: width,
20770
+ align: align,
20771
+ fontSize: fontSize,
20772
+ className: className,
20773
+ renderHandler: function renderHandler() {}
20774
+ });
20775
+ }, [children, noWrap, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
20776
+ return null;
20777
+ };
20778
+ TableColumn.displayName = 'TableColumn';
20779
+
20780
+ var _excluded$1 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "showFilters", "onSelected", "className", "rowClassName"];
20179
20781
  function TableComponent(tableProps) {
20180
20782
  /* eslint-disable @typescript-eslint/no-unused-vars */
20181
20783
  var _ref = tableProps,
@@ -20204,7 +20806,7 @@ function TableComponent(tableProps) {
20204
20806
  rowClassName = _ref$rowClassName === undefined ? function () {
20205
20807
  return '';
20206
20808
  } : _ref$rowClassName,
20207
- props = _objectWithoutProperties(_ref, _excluded$4);
20809
+ props = _objectWithoutProperties(_ref, _excluded$1);
20208
20810
  /* eslint-enable @typescript-eslint/no-unused-vars */
20209
20811
  var _useScale = useScale(),
20210
20812
  SCALES = _useScale.SCALES;
@@ -20238,87 +20840,15 @@ function TableComponent(tableProps) {
20238
20840
  columns: columns,
20239
20841
  updateColumn: updateColumn
20240
20842
  };
20241
- }, [columns]);
20242
- var _React$useState = React.useState({}),
20243
- _React$useState2 = _slicedToArray(_React$useState, 2),
20244
- filters = _React$useState2[0],
20245
- setFilters = _React$useState2[1];
20246
- React.useEffect(function () {
20247
- if (typeof customData === 'undefined') return;
20248
- setData(customData);
20249
- }, [customData]);
20250
- useResize(function () {
20251
- return updateShape();
20252
- });
20253
- var handleFilterChange = function handleFilterChange(name, value) {
20254
- setFilters(function (prevFilters) {
20255
- var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
20256
- // Call onFiltersChange to propagate filter changes to the parent
20257
- if (onFilters) {
20258
- onFilters(updatedFilters);
20259
- }
20260
- return updatedFilters;
20261
- });
20262
- };
20263
- var generateFilterInputs = function generateFilterInputs() {
20264
- return columns.map(function (col) {
20265
- var _String, _filters$filterName;
20266
- var Header = col.label,
20267
- accessor = col.filter,
20268
- options = col.options;
20269
- var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
20270
- var unq_accessor = _.uniqueId(filterName);
20271
- return /*#__PURE__*/React.createElement("div", {
20272
- style: {
20273
- margin: '3px'
20274
- },
20275
- "data-column": Header,
20276
- key: unq_accessor
20277
- }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
20278
- key: unq_accessor,
20279
- name: filterName,
20280
- value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
20281
- onChange: function onChange(newValue) {
20282
- return handleFilterChange(filterName, newValue);
20283
- }
20284
- }, /*#__PURE__*/React.createElement(Select.Option, {
20285
- value: "All"
20286
- }, "All ", Header), options ? options.map(function (option) {
20287
- return /*#__PURE__*/React.createElement(Select.Option, {
20288
- value: option.value
20289
- }, option.name);
20290
- }) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
20291
- id: "filter-date-".concat(filterName),
20292
- htmlType: "date",
20293
- name: filterName,
20294
- value: filters[filterName],
20295
- onChange: function onChange(e) {
20296
- return handleFilterChange(filterName, e.target.value);
20297
- }
20298
- }), accessor === 'search' && /*#__PURE__*/React.createElement(Input, {
20299
- id: "filter-search-".concat(filterName),
20300
- htmlType: "text",
20301
- autoComplete: "off",
20302
- name: filterName,
20303
- style: {
20304
- height: 30,
20305
- minWidth: 160
20306
- },
20307
- value: filters[filterName],
20308
- onChange: function onChange(e) {
20309
- return handleFilterChange(filterName, e.target.value);
20310
- },
20311
- placeholder: "Search...",
20312
- fullWidth: true
20313
- }));
20314
- });
20315
- };
20316
- return /*#__PURE__*/React.createElement("div", null, showFilters && /*#__PURE__*/React.createElement("div", {
20317
- style: {
20318
- display: 'flex',
20319
- gap: 6
20320
- }
20321
- }, generateFilterInputs()), /*#__PURE__*/React.createElement(TableContext.Provider, {
20843
+ }, [columns]);
20844
+ React.useEffect(function () {
20845
+ if (typeof customData === 'undefined') return;
20846
+ setData(customData);
20847
+ }, [customData]);
20848
+ useResize(function () {
20849
+ return updateShape();
20850
+ });
20851
+ return /*#__PURE__*/React.createElement(TableContext.Provider, {
20322
20852
  value: contextValue
20323
20853
  }, /*#__PURE__*/React.createElement("table", _extends({
20324
20854
  ref: ref
@@ -20326,6 +20856,8 @@ function TableComponent(tableProps) {
20326
20856
  className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
20327
20857
  }), /*#__PURE__*/React.createElement(TableHead, {
20328
20858
  columns: columns,
20859
+ onFilters: onFilters,
20860
+ showFilters: showFilters,
20329
20861
  width: width
20330
20862
  }), /*#__PURE__*/React.createElement(TableBody, {
20331
20863
  data: data,
@@ -20340,7 +20872,7 @@ function TableComponent(tableProps) {
20340
20872
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
20341
20873
  id: "2132340556",
20342
20874
  dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
20343
- }, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")))));
20875
+ }, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}"))));
20344
20876
  }
20345
20877
  TableComponent.displayName = 'Table';
20346
20878
  TableComponent.Column = TableColumn;
@@ -29896,255 +30428,12 @@ createIcon(Github);
29896
30428
 
29897
30429
  const CodeSandbox = ({ color, strokeWidth, set }) => {
29898
30430
  const Outline = () => (React.createElement("g", null,
29899
- React.createElement("path", { d: "M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z", stroke: color, strokeWidth: strokeWidth }),
29900
- React.createElement("path", { d: "M7.5 4.21l4.5 2.6 4.5-2.6", stroke: color, strokeWidth: strokeWidth }),
29901
- React.createElement("path", { d: "M7.5 19.79V14.6L3 12", stroke: color, strokeWidth: strokeWidth }),
29902
- React.createElement("path", { d: "M21 12l-4.5 2.6v5.19", stroke: color, strokeWidth: strokeWidth }),
29903
- React.createElement("path", { d: "M3.27 6.96L12 12.01l8.73-5.05", stroke: color, strokeWidth: strokeWidth }),
29904
- React.createElement("path", { d: "M12 22.08V12", stroke: color, strokeWidth: strokeWidth })));
29905
- switch (set) {
29906
- case "broken":
29907
- return "";
29908
- case "curved":
29909
- return "";
29910
- case "duotone":
29911
- return "";
29912
- case "outline":
29913
- return React.createElement(Outline, null);
29914
- default:
29915
- return React.createElement(Outline, null);
29916
- }
29917
- };
29918
- CodeSandbox.displayName = "CodeSandbox";
29919
- createIcon(CodeSandbox);
29920
-
29921
- const FileFunctionFill = ({ color, strokeWidth, set }) => {
29922
- const Outline = () => (React.createElement("g", null,
29923
- React.createElement("path", { d: "M4.055 2.055A2.75 2.75 0 016 1.25h12A2.75 2.75 0 0120.75 4v16A2.75 2.75 0 0118 22.75H6A2.75 2.75 0 013.25 20V4c0-.73.29-1.429.805-1.945zM15.116 5.31c-1.237-.194-2.29.086-3.02.83-.709.722-.998 1.758-.998 2.844v1.502H9a.75.75 0 100 1.5h2.098v3.22c0 .78-.197 1.257-.48 1.543-.283.284-.773.501-1.618.501a.75.75 0 000 1.5c1.088 0 2.023-.281 2.681-.944.658-.662.918-1.582.918-2.6v-3.22h2.062a.75.75 0 000-1.5h-2.063V8.984c0-.851.229-1.447.567-1.792.315-.32.838-.538 1.719-.4a.75.75 0 00.232-1.482z", stroke: color, strokeWidth: strokeWidth })));
29924
- switch (set) {
29925
- case "broken":
29926
- return "";
29927
- case "curved":
29928
- return "";
29929
- case "duotone":
29930
- return "";
29931
- case "outline":
29932
- return React.createElement(Outline, null);
29933
- default:
29934
- return React.createElement(Outline, null);
29935
- }
29936
- };
29937
- FileFunctionFill.displayName = "FileFunctionFill";
29938
- createIcon(FileFunctionFill);
29939
-
29940
- const Lambda = ({ color, strokeWidth, set }) => {
29941
- const Outline = () => (React.createElement("g", null,
29942
- React.createElement("path", { d: "M1.99799968,0.500003998 C1.78162411,0.500869509 1.63364907,0.642137248 1.63364907,0.814271399 C1.63364907,0.985218642 1.78032508,1.1285428 1.97131342,1.12856172 L2.19867872,1.13056263 C3.10118421,1.14702589 3.60939673,1.26556347 4.03249851,1.568379 C4.44848628,1.86630467 4.81555118,2.36599046 5.30914132,3.29234706 L5.53635444,3.7319218 L7.127422,7.27537654 L6.98962107,7.5004737 L0.544625394,18.0283431 C0.486884418,18.1227208 0.485083442,18.2383317 0.539767758,18.3342249 C0.596620657,18.4339208 0.706568325,18.4981484 0.828403729,18.4999606 C0.950391011,18.501775 1.0625816,18.4406875 1.12276173,18.342323 L7.45742934,7.99500773 L7.84867238,8.84715959 L10.8910664,15.4738335 L11.3866691,16.600051 L11.4963288,16.8355567 C11.6974732,17.2598124 11.8703886,17.5497167 12.0716373,17.7798218 C12.5006231,18.2692457 13.0516354,18.4715747 13.9517354,18.4967326 L14.1338876,18.5007429 L14.2140555,18.4965687 C14.3788402,18.4747246 14.5,18.3402281 14.5,18.1853946 C14.5,18.0144473 14.353324,17.8711232 14.159766,17.8710753 L13.9667577,17.8683457 C13.23949,17.8471739 12.8730841,17.7079192 12.5747116,17.3670263 L12.5148848,17.2937701 C12.3862775,17.1267414 12.2591138,16.9035538 12.1043882,16.5789995 C12.0565097,16.4787037 12.0069781,16.3709095 11.9496307,16.2425932 L11.5034339,15.2259235 L7.80746029,7.17411382 L6.14520282,3.47634226 L5.9868176,3.16569971 C5.41304784,2.06259444 4.97093878,1.45201729 4.43388865,1.06822222 C3.88266741,0.671861393 3.24308245,0.52047405 2.2259303,0.50220525 L1.99799968,0.500003998 Z", transform: "translate(5 3)", stroke: color, strokeWidth: strokeWidth })));
29943
- switch (set) {
29944
- case "broken":
29945
- return "";
29946
- case "curved":
29947
- return "";
29948
- case "duotone":
29949
- return "";
29950
- case "outline":
29951
- return React.createElement(Outline, null);
29952
- default:
29953
- return React.createElement(Outline, null);
29954
- }
29955
- };
29956
- Lambda.displayName = "Lambda";
29957
- createIcon(Lambda);
29958
-
29959
- const Layout = ({ color, strokeWidth, set }) => {
29960
- const Outline = () => (React.createElement("g", null,
29961
- React.createElement("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2", stroke: color, strokeWidth: strokeWidth }),
29962
- React.createElement("path", { d: "M3 9h18", stroke: color, strokeWidth: strokeWidth }),
29963
- React.createElement("path", { d: "M9 21V9", stroke: color, strokeWidth: strokeWidth })));
29964
- switch (set) {
29965
- case "broken":
29966
- return "";
29967
- case "curved":
29968
- return "";
29969
- case "duotone":
29970
- return "";
29971
- case "outline":
29972
- return React.createElement(Outline, null);
29973
- default:
29974
- return React.createElement(Outline, null);
29975
- }
29976
- };
29977
- Layout.displayName = "Layout";
29978
- createIcon(Layout);
29979
-
29980
- const Menu = ({ color, strokeWidth, set }) => {
29981
- const Outline = () => (React.createElement("g", null,
29982
- React.createElement("path", { d: "M3 12h18", stroke: color, strokeWidth: strokeWidth }),
29983
- React.createElement("path", { d: "M3 6h18", stroke: color, strokeWidth: strokeWidth }),
29984
- React.createElement("path", { d: "M3 18h18", stroke: color, strokeWidth: strokeWidth })));
29985
- switch (set) {
29986
- case "broken":
29987
- return "";
29988
- case "curved":
29989
- return "";
29990
- case "duotone":
29991
- return "";
29992
- case "outline":
29993
- return React.createElement(Outline, null);
29994
- default:
29995
- return React.createElement(Outline, null);
29996
- }
29997
- };
29998
- Menu.displayName = "Menu";
29999
- createIcon(Menu);
30000
-
30001
- const Box = ({ color, strokeWidth, set }) => {
30002
- const Outline = () => (React.createElement("g", null,
30003
- React.createElement("path", { d: "M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z", stroke: color, strokeWidth: strokeWidth }),
30004
- React.createElement("path", { d: "M3.27 6.96L12 12.01l8.73-5.05", stroke: color, strokeWidth: strokeWidth }),
30005
- React.createElement("path", { d: "M12 22.08V12", stroke: color, strokeWidth: strokeWidth })));
30006
- switch (set) {
30007
- case "broken":
30008
- return "";
30009
- case "curved":
30010
- return "";
30011
- case "duotone":
30012
- return "";
30013
- case "outline":
30014
- return React.createElement(Outline, null);
30015
- default:
30016
- return React.createElement(Outline, null);
30017
- }
30018
- };
30019
- Box.displayName = "Box";
30020
- createIcon(Box);
30021
-
30022
- const Database = ({ color, strokeWidth, set }) => {
30023
- const Outline = () => (React.createElement("g", null,
30024
- React.createElement("ellipse", { stroke: color, strokeWidth: strokeWidth, cx: "12", cy: "5", rx: "9", ry: "3" }),
30025
- React.createElement("path", { d: "M21 12c0 1.66-4 3-9 3s-9-1.34-9-3", stroke: color, strokeWidth: strokeWidth }),
30026
- React.createElement("path", { d: "M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5", stroke: color, strokeWidth: strokeWidth })));
30027
- switch (set) {
30028
- case "broken":
30029
- return "";
30030
- case "curved":
30031
- return "";
30032
- case "duotone":
30033
- return "";
30034
- case "outline":
30035
- return React.createElement(Outline, null);
30036
- default:
30037
- return React.createElement(Outline, null);
30038
- }
30039
- };
30040
- Database.displayName = "Database";
30041
- createIcon(Database);
30042
-
30043
- const RotateCcw = ({ color, strokeWidth, set }) => {
30044
- const Outline = () => (React.createElement("g", null,
30045
- React.createElement("path", { d: "M1 4v6h6", stroke: color, strokeWidth: strokeWidth }),
30046
- React.createElement("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10", stroke: color, strokeWidth: strokeWidth })));
30047
- switch (set) {
30048
- case "broken":
30049
- return "";
30050
- case "curved":
30051
- return "";
30052
- case "duotone":
30053
- return "";
30054
- case "outline":
30055
- return React.createElement(Outline, null);
30056
- default:
30057
- return React.createElement(Outline, null);
30058
- }
30059
- };
30060
- RotateCcw.displayName = "RotateCcw";
30061
- createIcon(RotateCcw);
30062
-
30063
- const Type = ({ color, strokeWidth, set }) => {
30064
- const Outline = () => (React.createElement("g", null,
30065
- React.createElement("path", { d: "M4 7V4h16v3", stroke: color, strokeWidth: strokeWidth }),
30066
- React.createElement("path", { d: "M9 20h6", stroke: color, strokeWidth: strokeWidth }),
30067
- React.createElement("path", { d: "M12 4v16", stroke: color, strokeWidth: strokeWidth })));
30068
- switch (set) {
30069
- case "broken":
30070
- return "";
30071
- case "curved":
30072
- return "";
30073
- case "duotone":
30074
- return "";
30075
- case "outline":
30076
- return React.createElement(Outline, null);
30077
- default:
30078
- return React.createElement(Outline, null);
30079
- }
30080
- };
30081
- Type.displayName = "Type";
30082
- createIcon(Type);
30083
-
30084
- const UserX = ({ color, strokeWidth, set }) => {
30085
- const Outline = () => (React.createElement("g", null,
30086
- React.createElement("path", { d: "M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2", stroke: color, strokeWidth: strokeWidth }),
30087
- React.createElement("circle", { cx: "8.5", cy: "7", r: "4", stroke: color, strokeWidth: strokeWidth }),
30088
- React.createElement("path", { d: "M18 8l5 5", stroke: color, strokeWidth: strokeWidth }),
30089
- React.createElement("path", { d: "M23 8l-5 5", stroke: color, strokeWidth: strokeWidth })));
30090
- switch (set) {
30091
- case "broken":
30092
- return "";
30093
- case "curved":
30094
- return "";
30095
- case "duotone":
30096
- return "";
30097
- case "outline":
30098
- return React.createElement(Outline, null);
30099
- default:
30100
- return React.createElement(Outline, null);
30101
- }
30102
- };
30103
- UserX.displayName = "UserX";
30104
- createIcon(UserX);
30105
-
30106
- const Columns = ({ color, strokeWidth, set }) => {
30107
- const Outline = () => (React.createElement("g", null,
30108
- React.createElement("path", { d: "M12 3h7a2 2 0 012 2v14a2 2 0 01-2 2h-7m0-18H5a2 2 0 00-2 2v14a2 2 0 002 2h7m0-18v18", stroke: color, strokeWidth: strokeWidth })));
30109
- switch (set) {
30110
- case "broken":
30111
- return "";
30112
- case "curved":
30113
- return "";
30114
- case "duotone":
30115
- return "";
30116
- case "outline":
30117
- return React.createElement(Outline, null);
30118
- default:
30119
- return React.createElement(Outline, null);
30120
- }
30121
- };
30122
- Columns.displayName = "Columns";
30123
- var Columns$1 = createIcon(Columns);
30124
-
30125
- const Folder = ({ color, strokeWidth, set }) => {
30126
- const Outline = () => (React.createElement("g", null,
30127
- React.createElement("path", { d: "M2.707 7.454V5.62C2.707 4.725 3.469 4 4.409 4h4.843c.451 0 .884.17 1.204.474l.49.467c.126.12.296.186.473.186h8.399c.94 0 1.55.695 1.55 1.59v.737m-18.661 0h-.354a.344.344 0 00-.353.35l.508 11.587c.015.34.31.609.668.609h17.283c.358 0 .652-.269.667-.61L22 7.805a.344.344 0 00-.353-.35h-.278m-18.662 0h18.662", stroke: color, strokeWidth: strokeWidth })));
30128
- switch (set) {
30129
- case "broken":
30130
- return "";
30131
- case "curved":
30132
- return "";
30133
- case "duotone":
30134
- return "";
30135
- case "outline":
30136
- return React.createElement(Outline, null);
30137
- default:
30138
- return React.createElement(Outline, null);
30139
- }
30140
- };
30141
- Folder.displayName = "Folder";
30142
- createIcon(Folder);
30143
-
30144
- const File = ({ color, strokeWidth, set }) => {
30145
- const Outline = () => (React.createElement("g", null,
30146
- React.createElement("path", { d: "M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z", stroke: color, strokeWidth: strokeWidth }),
30147
- React.createElement("path", { d: "M13 2v7h7", stroke: color, strokeWidth: strokeWidth })));
30431
+ React.createElement("path", { d: "M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z", stroke: color, strokeWidth: strokeWidth }),
30432
+ React.createElement("path", { d: "M7.5 4.21l4.5 2.6 4.5-2.6", stroke: color, strokeWidth: strokeWidth }),
30433
+ React.createElement("path", { d: "M7.5 19.79V14.6L3 12", stroke: color, strokeWidth: strokeWidth }),
30434
+ React.createElement("path", { d: "M21 12l-4.5 2.6v5.19", stroke: color, strokeWidth: strokeWidth }),
30435
+ React.createElement("path", { d: "M3.27 6.96L12 12.01l8.73-5.05", stroke: color, strokeWidth: strokeWidth }),
30436
+ React.createElement("path", { d: "M12 22.08V12", stroke: color, strokeWidth: strokeWidth })));
30148
30437
  switch (set) {
30149
30438
  case "broken":
30150
30439
  return "";
@@ -30158,14 +30447,12 @@ const File = ({ color, strokeWidth, set }) => {
30158
30447
  return React.createElement(Outline, null);
30159
30448
  }
30160
30449
  };
30161
- File.displayName = "File";
30162
- createIcon(File);
30450
+ CodeSandbox.displayName = "CodeSandbox";
30451
+ createIcon(CodeSandbox);
30163
30452
 
30164
- const Printer = ({ color, strokeWidth, set }) => {
30453
+ const FileFunctionFill = ({ color, strokeWidth, set }) => {
30165
30454
  const Outline = () => (React.createElement("g", null,
30166
- React.createElement("path", { d: "M6 9V2h12v7", stroke: color, strokeWidth: strokeWidth }),
30167
- React.createElement("path", { d: "M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2", stroke: color, strokeWidth: strokeWidth }),
30168
- React.createElement("path", { d: "M6 14h12v8H6z", stroke: color, strokeWidth: strokeWidth })));
30455
+ React.createElement("path", { d: "M4.055 2.055A2.75 2.75 0 016 1.25h12A2.75 2.75 0 0120.75 4v16A2.75 2.75 0 0118 22.75H6A2.75 2.75 0 013.25 20V4c0-.73.29-1.429.805-1.945zM15.116 5.31c-1.237-.194-2.29.086-3.02.83-.709.722-.998 1.758-.998 2.844v1.502H9a.75.75 0 100 1.5h2.098v3.22c0 .78-.197 1.257-.48 1.543-.283.284-.773.501-1.618.501a.75.75 0 000 1.5c1.088 0 2.023-.281 2.681-.944.658-.662.918-1.582.918-2.6v-3.22h2.062a.75.75 0 000-1.5h-2.063V8.984c0-.851.229-1.447.567-1.792.315-.32.838-.538 1.719-.4a.75.75 0 00.232-1.482z", stroke: color, strokeWidth: strokeWidth })));
30169
30456
  switch (set) {
30170
30457
  case "broken":
30171
30458
  return "";
@@ -30179,13 +30466,12 @@ const Printer = ({ color, strokeWidth, set }) => {
30179
30466
  return React.createElement(Outline, null);
30180
30467
  }
30181
30468
  };
30182
- Printer.displayName = "Printer";
30183
- createIcon(Printer);
30469
+ FileFunctionFill.displayName = "FileFunctionFill";
30470
+ createIcon(FileFunctionFill);
30184
30471
 
30185
- const Lock = ({ color, strokeWidth, set }) => {
30472
+ const Lambda = ({ color, strokeWidth, set }) => {
30186
30473
  const Outline = () => (React.createElement("g", null,
30187
- React.createElement("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2", stroke: color, strokeWidth: strokeWidth }),
30188
- React.createElement("path", { d: "M7 11V7a5 5 0 0110 0v4", stroke: color, strokeWidth: strokeWidth })));
30474
+ React.createElement("path", { d: "M1.99799968,0.500003998 C1.78162411,0.500869509 1.63364907,0.642137248 1.63364907,0.814271399 C1.63364907,0.985218642 1.78032508,1.1285428 1.97131342,1.12856172 L2.19867872,1.13056263 C3.10118421,1.14702589 3.60939673,1.26556347 4.03249851,1.568379 C4.44848628,1.86630467 4.81555118,2.36599046 5.30914132,3.29234706 L5.53635444,3.7319218 L7.127422,7.27537654 L6.98962107,7.5004737 L0.544625394,18.0283431 C0.486884418,18.1227208 0.485083442,18.2383317 0.539767758,18.3342249 C0.596620657,18.4339208 0.706568325,18.4981484 0.828403729,18.4999606 C0.950391011,18.501775 1.0625816,18.4406875 1.12276173,18.342323 L7.45742934,7.99500773 L7.84867238,8.84715959 L10.8910664,15.4738335 L11.3866691,16.600051 L11.4963288,16.8355567 C11.6974732,17.2598124 11.8703886,17.5497167 12.0716373,17.7798218 C12.5006231,18.2692457 13.0516354,18.4715747 13.9517354,18.4967326 L14.1338876,18.5007429 L14.2140555,18.4965687 C14.3788402,18.4747246 14.5,18.3402281 14.5,18.1853946 C14.5,18.0144473 14.353324,17.8711232 14.159766,17.8710753 L13.9667577,17.8683457 C13.23949,17.8471739 12.8730841,17.7079192 12.5747116,17.3670263 L12.5148848,17.2937701 C12.3862775,17.1267414 12.2591138,16.9035538 12.1043882,16.5789995 C12.0565097,16.4787037 12.0069781,16.3709095 11.9496307,16.2425932 L11.5034339,15.2259235 L7.80746029,7.17411382 L6.14520282,3.47634226 L5.9868176,3.16569971 C5.41304784,2.06259444 4.97093878,1.45201729 4.43388865,1.06822222 C3.88266741,0.671861393 3.24308245,0.52047405 2.2259303,0.50220525 L1.99799968,0.500003998 Z", transform: "translate(5 3)", stroke: color, strokeWidth: strokeWidth })));
30189
30475
  switch (set) {
30190
30476
  case "broken":
30191
30477
  return "";
@@ -30199,14 +30485,14 @@ const Lock = ({ color, strokeWidth, set }) => {
30199
30485
  return React.createElement(Outline, null);
30200
30486
  }
30201
30487
  };
30202
- Lock.displayName = "Lock";
30203
- createIcon(Lock);
30488
+ Lambda.displayName = "Lambda";
30489
+ createIcon(Lambda);
30204
30490
 
30205
- const HelpCircle = ({ color, strokeWidth, set }) => {
30491
+ const Layout = ({ color, strokeWidth, set }) => {
30206
30492
  const Outline = () => (React.createElement("g", null,
30207
- React.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: strokeWidth }),
30208
- React.createElement("path", { d: "M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3", stroke: color, strokeWidth: strokeWidth }),
30209
- React.createElement("path", { d: "M12 17h.01", stroke: color, strokeWidth: strokeWidth })));
30493
+ React.createElement("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2", stroke: color, strokeWidth: strokeWidth }),
30494
+ React.createElement("path", { d: "M3 9h18", stroke: color, strokeWidth: strokeWidth }),
30495
+ React.createElement("path", { d: "M9 21V9", stroke: color, strokeWidth: strokeWidth })));
30210
30496
  switch (set) {
30211
30497
  case "broken":
30212
30498
  return "";
@@ -30220,527 +30506,254 @@ const HelpCircle = ({ color, strokeWidth, set }) => {
30220
30506
  return React.createElement(Outline, null);
30221
30507
  }
30222
30508
  };
30223
- HelpCircle.displayName = "HelpCircle";
30224
- createIcon(HelpCircle);
30225
-
30226
- var ButtonDrip = function ButtonDrip(_ref) {
30227
- var _ref$x = _ref.x,
30228
- x = _ref$x === undefined ? 0 : _ref$x,
30229
- _ref$y = _ref.y,
30230
- y = _ref$y === undefined ? 0 : _ref$y,
30231
- color = _ref.color,
30232
- onCompleted = _ref.onCompleted;
30233
- var dripRef = React.useRef(null);
30234
- /* istanbul ignore next */
30235
- var top = Number.isNaN(+y) ? 0 : y - 10;
30236
- /* istanbul ignore next */
30237
- var left = Number.isNaN(+x) ? 0 : x - 10;
30238
- React.useEffect(function () {
30239
- /* istanbul ignore next */
30240
- if (!dripRef.current) return;
30241
- dripRef.current.addEventListener('animationend', onCompleted);
30242
- return function () {
30243
- /* istanbul ignore next */
30244
- if (!dripRef.current) return;
30245
- dripRef.current.removeEventListener('animationend', onCompleted);
30246
- };
30247
- });
30248
- return /*#__PURE__*/React.createElement("div", {
30249
- ref: dripRef,
30250
- className: "jsx-3424889537" + " " + "drip"
30251
- }, /*#__PURE__*/React.createElement("svg", {
30252
- width: "20",
30253
- height: "20",
30254
- viewBox: "0 0 20 20",
30255
- style: {
30256
- top: top,
30257
- left: left
30258
- },
30259
- className: "jsx-3424889537"
30260
- }, /*#__PURE__*/React.createElement("g", {
30261
- stroke: "none",
30262
- strokeWidth: "1",
30263
- fill: "none",
30264
- fillRule: "evenodd",
30265
- className: "jsx-3424889537"
30266
- }, /*#__PURE__*/React.createElement("g", {
30267
- fill: color,
30268
- className: "jsx-3424889537"
30269
- }, /*#__PURE__*/React.createElement("rect", {
30270
- width: "100%",
30271
- height: "100%",
30272
- rx: "10",
30273
- className: "jsx-3424889537"
30274
- })))), /*#__PURE__*/React.createElement(_JSXStyle, {
30275
- id: "3424889537"
30276
- }, ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"));
30277
- };
30278
- ButtonDrip.displayName = 'ButtonDrip';
30279
-
30280
- var _excluded$3 = ["children", "type", "color", "className", "spaceRatio"];
30281
- var getIconBgColor = function getIconBgColor(type, palette, color) {
30282
- var colors = {
30283
- "default": palette.accents_6,
30284
- secondary: palette.secondary,
30285
- success: palette.success,
30286
- warning: palette.warning,
30287
- error: palette.error
30288
- };
30289
- return color ? color : colors[type];
30290
- };
30291
- var LoadingComponent = function LoadingComponent(_ref) {
30292
- var children = _ref.children,
30293
- _ref$type = _ref.type,
30294
- type = _ref$type === undefined ? 'default' : _ref$type,
30295
- color = _ref.color,
30296
- _ref$className = _ref.className,
30297
- className = _ref$className === undefined ? '' : _ref$className,
30298
- _ref$spaceRatio = _ref.spaceRatio,
30299
- spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
30300
- props = _objectWithoutProperties(_ref, _excluded$3);
30301
- var theme = useTheme();
30302
- var _useScale = useScale(),
30303
- SCALES = _useScale.SCALES;
30304
- var classes = useClasses('loading-container', className);
30305
- var bgColor = React.useMemo(function () {
30306
- return getIconBgColor(type, theme.palette, color);
30307
- }, [type, theme.palette, color]);
30308
- return /*#__PURE__*/React.createElement("div", _extends({}, props, {
30309
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
30310
- }), /*#__PURE__*/React.createElement("span", {
30311
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
30312
- }, children && /*#__PURE__*/React.createElement("label", {
30313
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
30314
- }, children), /*#__PURE__*/React.createElement("i", {
30315
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
30316
- }), /*#__PURE__*/React.createElement("i", {
30317
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
30318
- }), /*#__PURE__*/React.createElement("i", {
30319
- className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]]])
30320
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
30321
- id: "2201634259",
30322
- dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.accents_5, bgColor, spaceRatio]
30323
- }, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
30324
- };
30325
- LoadingComponent.displayName = 'Loading';
30326
- var Loading = withScale(LoadingComponent);
30327
-
30328
- var ButtonLoading = function ButtonLoading(_ref) {
30329
- var color = _ref.color;
30330
- return /*#__PURE__*/React.createElement("div", {
30331
- className: "jsx-212623367" + " " + "btn-loading"
30332
- }, /*#__PURE__*/React.createElement(Loading, {
30333
- color: color
30334
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
30335
- id: "212623367"
30336
- }, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
30337
- };
30338
- ButtonLoading.displayName = 'GeistButtonLoading';
30339
-
30340
- var _excluded$2 = ["isRight", "isSingle", "children", "className"];
30341
- var ButtonIcon = function ButtonIcon(_ref) {
30342
- var _ref$isRight = _ref.isRight,
30343
- isRight = _ref$isRight === undefined ? false : _ref$isRight,
30344
- isSingle = _ref.isSingle,
30345
- children = _ref.children,
30346
- _ref$className = _ref.className,
30347
- className = _ref$className === undefined ? '' : _ref$className,
30348
- props = _objectWithoutProperties(_ref, _excluded$2);
30349
- var classes = useClasses('icon', {
30350
- right: isRight,
30351
- single: isSingle
30352
- }, className);
30353
- return /*#__PURE__*/React.createElement("span", _extends({}, props, {
30354
- className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
30355
- }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
30356
- id: "2467502931"
30357
- }, ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"));
30358
- };
30359
- ButtonIcon.displayName = 'ButtonIcon';
30360
-
30361
- var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
30362
- var icon = icons.icon,
30363
- iconRight = icons.iconRight;
30364
- var hasIcon = icon || iconRight;
30365
- var isRight = Boolean(iconRight);
30366
- var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
30367
- var classes = useClasses('text', isRight ? 'right' : 'left');
30368
- if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
30369
- className: "text"
30370
- }, children);
30371
- if (React.Children.count(children) === 0) {
30372
- return /*#__PURE__*/React.createElement(ButtonIcon, {
30373
- isRight: isRight,
30374
- isSingle: true
30375
- }, hasIcon);
30376
- }
30377
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
30378
- isRight: isRight
30379
- }, hasIcon), /*#__PURE__*/React.createElement("div", {
30380
- className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
30381
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
30382
- id: "3568181479",
30383
- dynamic: [paddingForAutoMode, paddingForAutoMode]
30384
- }, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
30385
- };
30386
- var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
30387
- if (!config.isButtonGroup) return props;
30388
- return _objectSpread2(_objectSpread2({}, props), {}, {
30389
- auto: true,
30390
- shadow: false,
30391
- ghost: config.ghost || props.ghost,
30392
- type: config.type || props.type,
30393
- disabled: config.disabled || props.disabled
30394
- });
30395
- };
30396
-
30397
- /* "use client" */
30398
-
30399
- var defaultContext = {
30400
- isButtonGroup: false,
30401
- disabled: false
30402
- };
30403
- var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext);
30404
- var useButtonGroupContext = function useButtonGroupContext() {
30405
- return React.useContext(ButtonGroupContext);
30406
- };
30509
+ Layout.displayName = "Layout";
30510
+ createIcon(Layout);
30407
30511
 
30408
- var hexToRgb = function hexToRgb(color) {
30409
- var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
30410
- var full = color.replace(fullReg, function (_, r, g, b) {
30411
- return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
30412
- });
30413
- var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
30414
- if (!values) {
30415
- throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
30416
- }
30417
- return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
30418
- };
30419
- var colorToRgbValues = function colorToRgbValues(color) {
30420
- if (color.charAt(0) === '#') return hexToRgb(color);
30421
- var safeColor = color.replace(/ /g, '');
30422
- var colorType = color.substr(0, 4);
30423
- var regArray = safeColor.match(/\((.+)\)/);
30424
- if (!colorType.startsWith('rgb') || !regArray) {
30425
- console.log(color);
30426
- throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
30427
- }
30428
- return regArray[1].split(',').map(function (str) {
30429
- return Number.parseFloat(str);
30430
- });
30431
- };
30432
- var addColorAlpha = function addColorAlpha(color, alpha) {
30433
- if (!/^#|rgb|RGB/.test(color)) return color;
30434
- var _colorToRgbValues = colorToRgbValues(color),
30435
- _colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
30436
- r = _colorToRgbValues2[0],
30437
- g = _colorToRgbValues2[1],
30438
- b = _colorToRgbValues2[2];
30439
- var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
30440
- return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
30512
+ const Menu = ({ color, strokeWidth, set }) => {
30513
+ const Outline = () => (React.createElement("g", null,
30514
+ React.createElement("path", { d: "M3 12h18", stroke: color, strokeWidth: strokeWidth }),
30515
+ React.createElement("path", { d: "M3 6h18", stroke: color, strokeWidth: strokeWidth }),
30516
+ React.createElement("path", { d: "M3 18h18", stroke: color, strokeWidth: strokeWidth })));
30517
+ switch (set) {
30518
+ case "broken":
30519
+ return "";
30520
+ case "curved":
30521
+ return "";
30522
+ case "duotone":
30523
+ return "";
30524
+ case "outline":
30525
+ return React.createElement(Outline, null);
30526
+ default:
30527
+ return React.createElement(Outline, null);
30528
+ }
30441
30529
  };
30530
+ Menu.displayName = "Menu";
30531
+ createIcon(Menu);
30442
30532
 
30443
- var getButtonGhostColors = function getButtonGhostColors(palette, type) {
30444
- var colors = {
30445
- secondary: {
30446
- bg: palette.background,
30447
- border: palette.foreground,
30448
- color: palette.foreground
30449
- },
30450
- success: {
30451
- bg: palette.background,
30452
- border: palette.success,
30453
- color: palette.success
30454
- },
30455
- warning: {
30456
- bg: palette.background,
30457
- border: palette.warning,
30458
- color: palette.warning
30459
- },
30460
- error: {
30461
- bg: palette.background,
30462
- border: palette.error,
30463
- color: palette.error
30533
+ const Box = ({ color, strokeWidth, set }) => {
30534
+ const Outline = () => (React.createElement("g", null,
30535
+ React.createElement("path", { d: "M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z", stroke: color, strokeWidth: strokeWidth }),
30536
+ React.createElement("path", { d: "M3.27 6.96L12 12.01l8.73-5.05", stroke: color, strokeWidth: strokeWidth }),
30537
+ React.createElement("path", { d: "M12 22.08V12", stroke: color, strokeWidth: strokeWidth })));
30538
+ switch (set) {
30539
+ case "broken":
30540
+ return "";
30541
+ case "curved":
30542
+ return "";
30543
+ case "duotone":
30544
+ return "";
30545
+ case "outline":
30546
+ return React.createElement(Outline, null);
30547
+ default:
30548
+ return React.createElement(Outline, null);
30464
30549
  }
30465
- };
30466
- return colors[type] || null;
30467
30550
  };
30468
- var getButtonColors = function getButtonColors(palette, props) {
30469
- var type = props.type,
30470
- disabled = props.disabled,
30471
- ghost = props.ghost;
30472
- var colors = {
30473
- "default": {
30474
- bg: palette.background,
30475
- border: palette.border,
30476
- color: palette.accents_5
30477
- },
30478
- secondary: {
30479
- bg: palette.foreground,
30480
- border: palette.foreground,
30481
- color: palette.background
30482
- },
30483
- success: {
30484
- bg: palette.success,
30485
- border: palette.success,
30486
- color: '#fff'
30487
- },
30488
- warning: {
30489
- bg: palette.warning,
30490
- border: palette.warning,
30491
- color: '#fff'
30492
- },
30493
- error: {
30494
- bg: palette.error,
30495
- border: palette.error,
30496
- color: '#fff'
30497
- },
30498
- abort: {
30499
- bg: 'transparent',
30500
- border: 'transparent',
30501
- color: palette.accents_5
30551
+ Box.displayName = "Box";
30552
+ createIcon(Box);
30553
+
30554
+ const Database = ({ color, strokeWidth, set }) => {
30555
+ const Outline = () => (React.createElement("g", null,
30556
+ React.createElement("ellipse", { stroke: color, strokeWidth: strokeWidth, cx: "12", cy: "5", rx: "9", ry: "3" }),
30557
+ React.createElement("path", { d: "M21 12c0 1.66-4 3-9 3s-9-1.34-9-3", stroke: color, strokeWidth: strokeWidth }),
30558
+ React.createElement("path", { d: "M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5", stroke: color, strokeWidth: strokeWidth })));
30559
+ switch (set) {
30560
+ case "broken":
30561
+ return "";
30562
+ case "curved":
30563
+ return "";
30564
+ case "duotone":
30565
+ return "";
30566
+ case "outline":
30567
+ return React.createElement(Outline, null);
30568
+ default:
30569
+ return React.createElement(Outline, null);
30502
30570
  }
30503
- };
30504
- if (disabled) return {
30505
- bg: palette.accents_1,
30506
- border: palette.accents_2,
30507
- color: '#ccc'
30508
- };
30571
+ };
30572
+ Database.displayName = "Database";
30573
+ createIcon(Database);
30509
30574
 
30510
- /**
30511
- * The '-light' type is the same color as the common type,
30512
- * only hover's color is different.
30513
- * e.g.
30514
- * Color['success'] === Color['success-light']
30515
- * Color['warning'] === Color['warning-light']
30516
- */
30517
- var withoutLightType = type === null || type === undefined ? undefined : type.replace('-light', '');
30518
- var defaultColor = colors["default"];
30519
- if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
30520
- return colors[withoutLightType] || defaultColor;
30575
+ const RotateCcw = ({ color, strokeWidth, set }) => {
30576
+ const Outline = () => (React.createElement("g", null,
30577
+ React.createElement("path", { d: "M1 4v6h6", stroke: color, strokeWidth: strokeWidth }),
30578
+ React.createElement("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10", stroke: color, strokeWidth: strokeWidth })));
30579
+ switch (set) {
30580
+ case "broken":
30581
+ return "";
30582
+ case "curved":
30583
+ return "";
30584
+ case "duotone":
30585
+ return "";
30586
+ case "outline":
30587
+ return React.createElement(Outline, null);
30588
+ default:
30589
+ return React.createElement(Outline, null);
30590
+ }
30521
30591
  };
30522
- var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type) {
30523
- var colors = {
30524
- secondary: {
30525
- bg: palette.foreground,
30526
- border: palette.background,
30527
- color: palette.background
30528
- },
30529
- success: {
30530
- bg: palette.success,
30531
- border: palette.background,
30532
- color: 'white'
30533
- },
30534
- warning: {
30535
- bg: palette.warning,
30536
- border: palette.background,
30537
- color: 'white'
30538
- },
30539
- error: {
30540
- bg: palette.error,
30541
- border: palette.background,
30542
- color: 'white'
30592
+ RotateCcw.displayName = "RotateCcw";
30593
+ createIcon(RotateCcw);
30594
+
30595
+ const Type = ({ color, strokeWidth, set }) => {
30596
+ const Outline = () => (React.createElement("g", null,
30597
+ React.createElement("path", { d: "M4 7V4h16v3", stroke: color, strokeWidth: strokeWidth }),
30598
+ React.createElement("path", { d: "M9 20h6", stroke: color, strokeWidth: strokeWidth }),
30599
+ React.createElement("path", { d: "M12 4v16", stroke: color, strokeWidth: strokeWidth })));
30600
+ switch (set) {
30601
+ case "broken":
30602
+ return "";
30603
+ case "curved":
30604
+ return "";
30605
+ case "duotone":
30606
+ return "";
30607
+ case "outline":
30608
+ return React.createElement(Outline, null);
30609
+ default:
30610
+ return React.createElement(Outline, null);
30543
30611
  }
30544
- };
30545
- var withoutLightType = type.replace('-light', '');
30546
- return colors[withoutLightType] || null;
30547
30612
  };
30548
- var getButtonHoverColors = function getButtonHoverColors(palette, props) {
30549
- var type = props.type,
30550
- disabled = props.disabled,
30551
- loading = props.loading,
30552
- shadow = props.shadow,
30553
- ghost = props.ghost;
30554
- var defaultColor = getButtonColors(palette, props);
30555
- var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
30556
- var colors = {
30557
- "default": {
30558
- bg: palette.background,
30559
- border: palette.foreground
30560
- },
30561
- secondary: {
30562
- bg: palette.background,
30563
- border: palette.foreground
30564
- },
30565
- success: {
30566
- bg: palette.background,
30567
- border: palette.success
30568
- },
30569
- warning: {
30570
- bg: palette.background,
30571
- border: palette.warning
30572
- },
30573
- error: {
30574
- bg: palette.background,
30575
- border: palette.error
30576
- },
30577
- abort: {
30578
- bg: 'transparent',
30579
- border: 'transparent',
30580
- color: palette.accents_5
30581
- },
30582
- 'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30583
- bg: alphaBackground
30584
- }),
30585
- 'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30586
- bg: alphaBackground
30587
- }),
30588
- 'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30589
- bg: alphaBackground
30590
- }),
30591
- 'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30592
- bg: alphaBackground
30593
- })
30594
- };
30595
- if (disabled) return {
30596
- bg: palette.accents_1,
30597
- border: palette.accents_2,
30598
- color: '#ccc'
30599
- };
30600
- if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30601
- color: 'transparent'
30602
- });
30603
- if (shadow) return defaultColor;
30604
- var hoverColor = (ghost ? getButtonGhostHoverColors(palette, type) : colors[type]) || colors["default"];
30605
- return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
30606
- color: hoverColor.color || hoverColor.border
30607
- });
30613
+ Type.displayName = "Type";
30614
+ createIcon(Type);
30615
+
30616
+ const UserX = ({ color, strokeWidth, set }) => {
30617
+ const Outline = () => (React.createElement("g", null,
30618
+ React.createElement("path", { d: "M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2", stroke: color, strokeWidth: strokeWidth }),
30619
+ React.createElement("circle", { cx: "8.5", cy: "7", r: "4", stroke: color, strokeWidth: strokeWidth }),
30620
+ React.createElement("path", { d: "M18 8l5 5", stroke: color, strokeWidth: strokeWidth }),
30621
+ React.createElement("path", { d: "M23 8l-5 5", stroke: color, strokeWidth: strokeWidth })));
30622
+ switch (set) {
30623
+ case "broken":
30624
+ return "";
30625
+ case "curved":
30626
+ return "";
30627
+ case "duotone":
30628
+ return "";
30629
+ case "outline":
30630
+ return React.createElement(Outline, null);
30631
+ default:
30632
+ return React.createElement(Outline, null);
30633
+ }
30608
30634
  };
30609
- var getButtonCursor = function getButtonCursor(disabled, loading) {
30610
- if (disabled) return {
30611
- cursor: 'not-allowed',
30612
- events: 'auto'
30613
- };
30614
- if (loading) return {
30615
- cursor: 'default',
30616
- events: 'none'
30617
- };
30618
- return {
30619
- cursor: 'pointer',
30620
- events: 'auto'
30621
- };
30635
+ UserX.displayName = "UserX";
30636
+ createIcon(UserX);
30637
+
30638
+ const Columns = ({ color, strokeWidth, set }) => {
30639
+ const Outline = () => (React.createElement("g", null,
30640
+ React.createElement("path", { d: "M12 3h7a2 2 0 012 2v14a2 2 0 01-2 2h-7m0-18H5a2 2 0 00-2 2v14a2 2 0 002 2h7m0-18v18", stroke: color, strokeWidth: strokeWidth })));
30641
+ switch (set) {
30642
+ case "broken":
30643
+ return "";
30644
+ case "curved":
30645
+ return "";
30646
+ case "duotone":
30647
+ return "";
30648
+ case "outline":
30649
+ return React.createElement(Outline, null);
30650
+ default:
30651
+ return React.createElement(Outline, null);
30652
+ }
30622
30653
  };
30623
- var getButtonDripColor = function getButtonDripColor(palette, props) {
30624
- var type = props.type;
30625
- var isLightHover = type ? type.endsWith('light') : false;
30626
- var hoverColors = getButtonHoverColors(palette, props);
30627
- return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
30654
+ Columns.displayName = "Columns";
30655
+ var Columns$1 = createIcon(Columns);
30656
+
30657
+ const Folder = ({ color, strokeWidth, set }) => {
30658
+ const Outline = () => (React.createElement("g", null,
30659
+ React.createElement("path", { d: "M2.707 7.454V5.62C2.707 4.725 3.469 4 4.409 4h4.843c.451 0 .884.17 1.204.474l.49.467c.126.12.296.186.473.186h8.399c.94 0 1.55.695 1.55 1.59v.737m-18.661 0h-.354a.344.344 0 00-.353.35l.508 11.587c.015.34.31.609.668.609h17.283c.358 0 .652-.269.667-.61L22 7.805a.344.344 0 00-.353-.35h-.278m-18.662 0h18.662", stroke: color, strokeWidth: strokeWidth })));
30660
+ switch (set) {
30661
+ case "broken":
30662
+ return "";
30663
+ case "curved":
30664
+ return "";
30665
+ case "duotone":
30666
+ return "";
30667
+ case "outline":
30668
+ return React.createElement(Outline, null);
30669
+ default:
30670
+ return React.createElement(Outline, null);
30671
+ }
30628
30672
  };
30673
+ Folder.displayName = "Folder";
30674
+ createIcon(Folder);
30629
30675
 
30630
- var _excluded$1 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
30631
- var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
30632
- var theme = useTheme();
30633
- var _useScale = useScale(),
30634
- SCALES = _useScale.SCALES;
30635
- var buttonRef = React.useRef(null);
30636
- React.useImperativeHandle(ref, function () {
30637
- return buttonRef.current;
30638
- });
30639
- var _useState = React.useState(false),
30640
- _useState2 = _slicedToArray(_useState, 2),
30641
- dripShow = _useState2[0],
30642
- setDripShow = _useState2[1];
30643
- var _useState3 = React.useState(0),
30644
- _useState4 = _slicedToArray(_useState3, 2),
30645
- dripX = _useState4[0],
30646
- setDripX = _useState4[1];
30647
- var _useState5 = React.useState(0),
30648
- _useState6 = _slicedToArray(_useState5, 2),
30649
- dripY = _useState6[0],
30650
- setDripY = _useState6[1];
30651
- var groupConfig = useButtonGroupContext();
30652
- var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
30653
- /* eslint-disable @typescript-eslint/no-unused-vars */
30654
- var children = filteredProps.children,
30655
- _filteredProps$disabl = filteredProps.disabled,
30656
- disabled = _filteredProps$disabl === undefined ? false : _filteredProps$disabl;
30657
- filteredProps.type;
30658
- var _filteredProps$loadin = filteredProps.loading,
30659
- loading = _filteredProps$loadin === undefined ? false : _filteredProps$loadin,
30660
- _filteredProps$shadow = filteredProps.shadow,
30661
- shadow = _filteredProps$shadow === undefined ? false : _filteredProps$shadow,
30662
- _filteredProps$ghost = filteredProps.ghost,
30663
- ghost = _filteredProps$ghost === undefined ? false : _filteredProps$ghost,
30664
- _filteredProps$effect = filteredProps.effect,
30665
- effect = _filteredProps$effect === undefined ? true : _filteredProps$effect,
30666
- onClick = filteredProps.onClick,
30667
- _filteredProps$auto = filteredProps.auto,
30668
- auto = _filteredProps$auto === undefined ? false : _filteredProps$auto,
30669
- icon = filteredProps.icon,
30670
- _filteredProps$htmlTy = filteredProps.htmlType,
30671
- htmlType = _filteredProps$htmlTy === undefined ? 'button' : _filteredProps$htmlTy,
30672
- iconRight = filteredProps.iconRight,
30673
- _filteredProps$classN = filteredProps.className,
30674
- className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
30675
- filteredProps.crossOrigin;
30676
- var props = _objectWithoutProperties(filteredProps, _excluded$1);
30677
- /* eslint-enable @typescript-eslint/no-unused-vars */
30676
+ const File = ({ color, strokeWidth, set }) => {
30677
+ const Outline = () => (React.createElement("g", null,
30678
+ React.createElement("path", { d: "M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z", stroke: color, strokeWidth: strokeWidth }),
30679
+ React.createElement("path", { d: "M13 2v7h7", stroke: color, strokeWidth: strokeWidth })));
30680
+ switch (set) {
30681
+ case "broken":
30682
+ return "";
30683
+ case "curved":
30684
+ return "";
30685
+ case "duotone":
30686
+ return "";
30687
+ case "outline":
30688
+ return React.createElement(Outline, null);
30689
+ default:
30690
+ return React.createElement(Outline, null);
30691
+ }
30692
+ };
30693
+ File.displayName = "File";
30694
+ createIcon(File);
30678
30695
 
30679
- var _useMemo = React.useMemo(function () {
30680
- return getButtonColors(theme.palette, filteredProps);
30681
- }, [theme.palette, filteredProps]),
30682
- bg = _useMemo.bg,
30683
- border = _useMemo.border,
30684
- color = _useMemo.color;
30685
- var hover = React.useMemo(function () {
30686
- return getButtonHoverColors(theme.palette, filteredProps);
30687
- }, [theme.palette, filteredProps]);
30688
- var _useMemo2 = React.useMemo(function () {
30689
- return getButtonCursor(disabled, loading);
30690
- }, [disabled, loading]),
30691
- cursor = _useMemo2.cursor,
30692
- events = _useMemo2.events;
30693
- var dripColor = React.useMemo(function () {
30694
- return getButtonDripColor(theme.palette, filteredProps);
30695
- }, [theme.palette, filteredProps]);
30696
+ const Printer = ({ color, strokeWidth, set }) => {
30697
+ const Outline = () => (React.createElement("g", null,
30698
+ React.createElement("path", { d: "M6 9V2h12v7", stroke: color, strokeWidth: strokeWidth }),
30699
+ React.createElement("path", { d: "M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2", stroke: color, strokeWidth: strokeWidth }),
30700
+ React.createElement("path", { d: "M6 14h12v8H6z", stroke: color, strokeWidth: strokeWidth })));
30701
+ switch (set) {
30702
+ case "broken":
30703
+ return "";
30704
+ case "curved":
30705
+ return "";
30706
+ case "duotone":
30707
+ return "";
30708
+ case "outline":
30709
+ return React.createElement(Outline, null);
30710
+ default:
30711
+ return React.createElement(Outline, null);
30712
+ }
30713
+ };
30714
+ Printer.displayName = "Printer";
30715
+ createIcon(Printer);
30696
30716
 
30697
- /* istanbul ignore next */
30698
- var dripCompletedHandle = function dripCompletedHandle() {
30699
- setDripShow(false);
30700
- setDripX(0);
30701
- setDripY(0);
30702
- };
30703
- var clickHandler = function clickHandler(event) {
30704
- if (disabled || loading) return;
30705
- var showDrip = !shadow && !ghost && effect;
30706
- /* istanbul ignore next */
30707
- if (showDrip && buttonRef.current) {
30708
- var rect = buttonRef.current.getBoundingClientRect();
30709
- setDripShow(true);
30710
- setDripX(event.clientX - rect.left);
30711
- setDripY(event.clientY - rect.top);
30717
+ const Lock = ({ color, strokeWidth, set }) => {
30718
+ const Outline = () => (React.createElement("g", null,
30719
+ React.createElement("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2", stroke: color, strokeWidth: strokeWidth }),
30720
+ React.createElement("path", { d: "M7 11V7a5 5 0 0110 0v4", stroke: color, strokeWidth: strokeWidth })));
30721
+ switch (set) {
30722
+ case "broken":
30723
+ return "";
30724
+ case "curved":
30725
+ return "";
30726
+ case "duotone":
30727
+ return "";
30728
+ case "outline":
30729
+ return React.createElement(Outline, null);
30730
+ default:
30731
+ return React.createElement(Outline, null);
30712
30732
  }
30713
- onClick && onClick(event);
30714
- };
30715
- var childrenWithIcon = React.useMemo(function () {
30716
- return getButtonChildrenWithIcon(auto, children, {
30717
- icon: icon,
30718
- iconRight: iconRight
30719
- });
30720
- }, [auto, children, icon, iconRight]);
30721
- var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
30722
- paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
30723
- return /*#__PURE__*/React.createElement("button", _extends({
30724
- ref: buttonRef,
30725
- type: htmlType,
30726
- disabled: disabled,
30727
- onClick: clickHandler
30728
- }, props, {
30729
- className: _JSXStyle.dynamic([["22324076", [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
30730
- }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
30731
- color: color
30732
- }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
30733
- x: dripX,
30734
- y: dripY,
30735
- color: dripColor,
30736
- onCompleted: dripCompletedHandle
30737
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
30738
- id: "22324076",
30739
- dynamic: [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
30740
- }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(theme.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}")));
30741
- });
30742
- ButtonComponent.displayName = 'Button';
30743
- var Button = withScale(ButtonComponent);
30733
+ };
30734
+ Lock.displayName = "Lock";
30735
+ createIcon(Lock);
30736
+
30737
+ const HelpCircle = ({ color, strokeWidth, set }) => {
30738
+ const Outline = () => (React.createElement("g", null,
30739
+ React.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: strokeWidth }),
30740
+ React.createElement("path", { d: "M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3", stroke: color, strokeWidth: strokeWidth }),
30741
+ React.createElement("path", { d: "M12 17h.01", stroke: color, strokeWidth: strokeWidth })));
30742
+ switch (set) {
30743
+ case "broken":
30744
+ return "";
30745
+ case "curved":
30746
+ return "";
30747
+ case "duotone":
30748
+ return "";
30749
+ case "outline":
30750
+ return React.createElement(Outline, null);
30751
+ default:
30752
+ return React.createElement(Outline, null);
30753
+ }
30754
+ };
30755
+ HelpCircle.displayName = "HelpCircle";
30756
+ createIcon(HelpCircle);
30744
30757
 
30745
30758
  var getColors = function getColors(type, palette) {
30746
30759
  var colors = {