@helpdice/ui 2.6.0-beta.0 → 2.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-complete/index.js +113 -103
- package/dist/index.d.ts +1 -1
- package/dist/index.js +119 -112
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +115 -103
- package/dist/input/input-block-label.d.ts +4 -0
- package/dist/select/index.js +26 -9
- package/dist/select/select.d.ts +1 -0
- package/dist/table/index.js +117 -112
- package/dist/textarea/index.js +7 -5
- package/dist/textarea/textarea.d.ts +1 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/input/index.d.ts +1 -0
- package/esm/input/index.js +1 -0
- package/esm/input/input-block-label.d.ts +4 -0
- package/esm/input/input-block-label.js +20 -4
- package/esm/input/input-field.js +14 -22
- package/esm/select/select.d.ts +1 -0
- package/esm/select/select.js +5 -9
- package/esm/textarea/textarea.d.ts +1 -0
- package/esm/textarea/textarea.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1265,88 +1265,6 @@ var withScale = function withScale(Render) {
|
|
|
1265
1265
|
return ScaleFC;
|
|
1266
1266
|
};
|
|
1267
1267
|
|
|
1268
|
-
var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
|
|
1269
|
-
var children = _ref.children,
|
|
1270
|
-
_ref$required = _ref.required,
|
|
1271
|
-
required = _ref$required === void 0 ? false : _ref$required;
|
|
1272
|
-
var theme$1 = theme.useTheme();
|
|
1273
|
-
var _useScale = useScale(),
|
|
1274
|
-
SCALES = _useScale.SCALES;
|
|
1275
|
-
return /*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
1276
|
-
className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]),
|
|
1277
|
-
children: [children, required && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1278
|
-
className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]) + " " + "mark-error",
|
|
1279
|
-
children: "*"
|
|
1280
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1281
|
-
id: "588038827",
|
|
1282
|
-
dynamic: [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)],
|
|
1283
|
-
children: "label.__jsx-style-dynamic-selector{display:".concat(typeof children === "string" ? 'block' : 'flex', ";font-weight:normal;color:").concat(theme$1.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector .mark-error.__jsx-style-dynamic-selector{color:").concat(theme$1.palette.errorDark, ";margin:0px 3px;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;font-size:").concat(SCALES.font(1.2), ";}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")
|
|
1284
|
-
})]
|
|
1285
|
-
});
|
|
1286
|
-
};
|
|
1287
|
-
InputBlockLabelComponent.displayName = 'InputBlockLabel';
|
|
1288
|
-
var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
|
|
1289
|
-
|
|
1290
|
-
var InputIconComponent = function InputIconComponent(_ref) {
|
|
1291
|
-
var icon = _ref.icon,
|
|
1292
|
-
_ref$clickable = _ref.clickable,
|
|
1293
|
-
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
|
1294
|
-
onClick = _ref.onClick;
|
|
1295
|
-
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1296
|
-
onClick: onClick,
|
|
1297
|
-
className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon",
|
|
1298
|
-
children: [icon, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1299
|
-
id: "4247656379",
|
|
1300
|
-
dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none'],
|
|
1301
|
-
children: ".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);}")
|
|
1302
|
-
})]
|
|
1303
|
-
});
|
|
1304
|
-
};
|
|
1305
|
-
InputIconComponent.displayName = 'InputIcon';
|
|
1306
|
-
var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
|
|
1307
|
-
|
|
1308
|
-
var InputIconClear = function InputIconClear(_ref) {
|
|
1309
|
-
var onClick = _ref.onClick,
|
|
1310
|
-
disabled = _ref.disabled,
|
|
1311
|
-
visible = _ref.visible;
|
|
1312
|
-
var theme$1 = theme.useTheme();
|
|
1313
|
-
var classes = theme.useClasses('clear-icon', {
|
|
1314
|
-
visible: visible
|
|
1315
|
-
});
|
|
1316
|
-
var clickHandler = function clickHandler(event) {
|
|
1317
|
-
event.preventDefault();
|
|
1318
|
-
event.stopPropagation();
|
|
1319
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
1320
|
-
onClick && onClick(event);
|
|
1321
|
-
};
|
|
1322
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1323
|
-
onClick: clickHandler,
|
|
1324
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || ""),
|
|
1325
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
1326
|
-
viewBox: "0 0 24 24",
|
|
1327
|
-
stroke: "currentColor",
|
|
1328
|
-
strokeWidth: "1.5",
|
|
1329
|
-
strokeLinecap: "round",
|
|
1330
|
-
strokeLinejoin: "round",
|
|
1331
|
-
fill: "none",
|
|
1332
|
-
shapeRendering: "geometricPrecision",
|
|
1333
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]),
|
|
1334
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
1335
|
-
d: "M18 6L6 18",
|
|
1336
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
1337
|
-
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
1338
|
-
d: "M6 6l12 12",
|
|
1339
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
1340
|
-
})]
|
|
1341
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1342
|
-
id: "1567030211",
|
|
1343
|
-
dynamic: [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground],
|
|
1344
|
-
children: ".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$1.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$1.palette.accents_3 : theme$1.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);}")
|
|
1345
|
-
})]
|
|
1346
|
-
});
|
|
1347
|
-
};
|
|
1348
|
-
var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
|
|
1349
|
-
|
|
1350
1268
|
var _excluded$1n = ["children", "tag", "className", "color"];
|
|
1351
1269
|
var getTypeColor = function getTypeColor(type, palette) {
|
|
1352
1270
|
var colors = {
|
|
@@ -2194,6 +2112,104 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
2194
2112
|
TextComponent.displayName = 'Text';
|
|
2195
2113
|
var Text = withScale(TextComponent);
|
|
2196
2114
|
|
|
2115
|
+
var InputError = function InputError(_ref) {
|
|
2116
|
+
var text = _ref.text,
|
|
2117
|
+
error = _ref.error;
|
|
2118
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Text, {
|
|
2119
|
+
font: 0.8,
|
|
2120
|
+
style: {
|
|
2121
|
+
marginTop: 0.4,
|
|
2122
|
+
marginRight: 0,
|
|
2123
|
+
marginLeft: 0,
|
|
2124
|
+
marginBottom: '0.4rem',
|
|
2125
|
+
textAlign: 'left'
|
|
2126
|
+
},
|
|
2127
|
+
color: error ? "error" : 'default',
|
|
2128
|
+
children: ["\xA0", text]
|
|
2129
|
+
});
|
|
2130
|
+
};
|
|
2131
|
+
var InputBlockLabelComponent = function InputBlockLabelComponent(_ref2) {
|
|
2132
|
+
var children = _ref2.children,
|
|
2133
|
+
_ref2$required = _ref2.required,
|
|
2134
|
+
required = _ref2$required === void 0 ? false : _ref2$required;
|
|
2135
|
+
var theme$1 = theme.useTheme();
|
|
2136
|
+
var _useScale = useScale(),
|
|
2137
|
+
SCALES = _useScale.SCALES;
|
|
2138
|
+
return /*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
2139
|
+
className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]),
|
|
2140
|
+
children: [children, required && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2141
|
+
className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]) + " " + "mark-error",
|
|
2142
|
+
children: "*"
|
|
2143
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2144
|
+
id: "588038827",
|
|
2145
|
+
dynamic: [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)],
|
|
2146
|
+
children: "label.__jsx-style-dynamic-selector{display:".concat(typeof children === "string" ? 'block' : 'flex', ";font-weight:normal;color:").concat(theme$1.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector .mark-error.__jsx-style-dynamic-selector{color:").concat(theme$1.palette.errorDark, ";margin:0px 3px;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;font-size:").concat(SCALES.font(1.2), ";}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")
|
|
2147
|
+
})]
|
|
2148
|
+
});
|
|
2149
|
+
};
|
|
2150
|
+
InputBlockLabelComponent.displayName = 'InputBlockLabel';
|
|
2151
|
+
var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
|
|
2152
|
+
|
|
2153
|
+
var InputIconComponent = function InputIconComponent(_ref) {
|
|
2154
|
+
var icon = _ref.icon,
|
|
2155
|
+
_ref$clickable = _ref.clickable,
|
|
2156
|
+
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
|
2157
|
+
onClick = _ref.onClick;
|
|
2158
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2159
|
+
onClick: onClick,
|
|
2160
|
+
className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon",
|
|
2161
|
+
children: [icon, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2162
|
+
id: "4247656379",
|
|
2163
|
+
dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none'],
|
|
2164
|
+
children: ".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);}")
|
|
2165
|
+
})]
|
|
2166
|
+
});
|
|
2167
|
+
};
|
|
2168
|
+
InputIconComponent.displayName = 'InputIcon';
|
|
2169
|
+
var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
|
|
2170
|
+
|
|
2171
|
+
var InputIconClear = function InputIconClear(_ref) {
|
|
2172
|
+
var onClick = _ref.onClick,
|
|
2173
|
+
disabled = _ref.disabled,
|
|
2174
|
+
visible = _ref.visible;
|
|
2175
|
+
var theme$1 = theme.useTheme();
|
|
2176
|
+
var classes = theme.useClasses('clear-icon', {
|
|
2177
|
+
visible: visible
|
|
2178
|
+
});
|
|
2179
|
+
var clickHandler = function clickHandler(event) {
|
|
2180
|
+
event.preventDefault();
|
|
2181
|
+
event.stopPropagation();
|
|
2182
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
2183
|
+
onClick && onClick(event);
|
|
2184
|
+
};
|
|
2185
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2186
|
+
onClick: clickHandler,
|
|
2187
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || ""),
|
|
2188
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
2189
|
+
viewBox: "0 0 24 24",
|
|
2190
|
+
stroke: "currentColor",
|
|
2191
|
+
strokeWidth: "1.5",
|
|
2192
|
+
strokeLinecap: "round",
|
|
2193
|
+
strokeLinejoin: "round",
|
|
2194
|
+
fill: "none",
|
|
2195
|
+
shapeRendering: "geometricPrecision",
|
|
2196
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]),
|
|
2197
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2198
|
+
d: "M18 6L6 18",
|
|
2199
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
2200
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2201
|
+
d: "M6 6l12 12",
|
|
2202
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
2203
|
+
})]
|
|
2204
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2205
|
+
id: "1567030211",
|
|
2206
|
+
dynamic: [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground],
|
|
2207
|
+
children: ".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$1.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$1.palette.accents_3 : theme$1.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);}")
|
|
2208
|
+
})]
|
|
2209
|
+
});
|
|
2210
|
+
};
|
|
2211
|
+
var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
|
|
2212
|
+
|
|
2197
2213
|
var getColors$7 = function getColors(palette, status) {
|
|
2198
2214
|
var colors = {
|
|
2199
2215
|
"default": {
|
|
@@ -2301,7 +2317,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2301
2317
|
}, [icon, iconRight]);
|
|
2302
2318
|
var _useMemo = React.useMemo(function () {
|
|
2303
2319
|
return getColors$7(theme$1.palette, _color);
|
|
2304
|
-
}, [theme$1.palette,
|
|
2320
|
+
}, [theme$1.palette, _color]),
|
|
2305
2321
|
color = _useMemo.color,
|
|
2306
2322
|
borderColor = _useMemo.borderColor,
|
|
2307
2323
|
hoverBorder = _useMemo.hoverBorder;
|
|
@@ -2356,16 +2372,16 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2356
2372
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
2357
2373
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
2358
2374
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2359
|
-
className: _JSXStyle.dynamic([["
|
|
2375
|
+
className: _JSXStyle.dynamic([["2371903369", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + "with-label",
|
|
2360
2376
|
children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
2361
2377
|
required: required,
|
|
2362
2378
|
children: children
|
|
2363
2379
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2364
|
-
className: _JSXStyle.dynamic([["
|
|
2380
|
+
className: _JSXStyle.dynamic([["2371903369", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-container', className) || ""),
|
|
2365
2381
|
children: [label && /*#__PURE__*/jsxRuntime.jsx(MemoInputLabel, {
|
|
2366
2382
|
children: label
|
|
2367
2383
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2368
|
-
className: _JSXStyle.dynamic([["
|
|
2384
|
+
className: _JSXStyle.dynamic([["2371903369", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-wrapper', {
|
|
2369
2385
|
hover: hover,
|
|
2370
2386
|
disabled: disabled
|
|
2371
2387
|
}, labelClasses) || ""),
|
|
@@ -2383,7 +2399,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2383
2399
|
autoComplete: autoComplete,
|
|
2384
2400
|
onKeyDown: handleKeyDown
|
|
2385
2401
|
}, inputProps), {}, {
|
|
2386
|
-
className: _JSXStyle.dynamic([["
|
|
2402
|
+
className: _JSXStyle.dynamic([["2371903369", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
2387
2403
|
disabled: disabled
|
|
2388
2404
|
}, iconClasses) || "")
|
|
2389
2405
|
})), clearable && /*#__PURE__*/jsxRuntime.jsx(MemoInputIconClear, {
|
|
@@ -2397,23 +2413,15 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2397
2413
|
isRight: true,
|
|
2398
2414
|
children: labelRight
|
|
2399
2415
|
}), /*#__PURE__*/jsxRuntime.jsx("br", {
|
|
2400
|
-
className: _JSXStyle.dynamic([["
|
|
2416
|
+
className: _JSXStyle.dynamic([["2371903369", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color]]])
|
|
2401
2417
|
})]
|
|
2402
|
-
}), helperText && /*#__PURE__*/jsxRuntime.
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
marginTop: 0.4,
|
|
2406
|
-
marginRight: 0,
|
|
2407
|
-
marginLeft: 0,
|
|
2408
|
-
marginBottom: '0.4rem',
|
|
2409
|
-
textAlign: 'left'
|
|
2410
|
-
},
|
|
2411
|
-
color: error ? "error" : 'default',
|
|
2412
|
-
children: ["\xA0", helperText]
|
|
2418
|
+
}), helperText && /*#__PURE__*/jsxRuntime.jsx(InputError, {
|
|
2419
|
+
text: helperText,
|
|
2420
|
+
error: error
|
|
2413
2421
|
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2414
|
-
id: "
|
|
2415
|
-
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875),
|
|
2416
|
-
children: ".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, defaultWidth), ";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-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, defaultWidth), ";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(variant === 'normal' ? theme$1.layout.radius : '', ";").concat(variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "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$1.palette.accents_1, ";border-color:").concat(theme$1.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(
|
|
2422
|
+
id: "2371903369",
|
|
2423
|
+
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), theme$1.palette.foreground, theme$1.palette.accents_3, theme$1.palette.background, color],
|
|
2424
|
+
children: ".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, defaultWidth), ";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-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, defaultWidth), ";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(variant === 'normal' ? theme$1.layout.radius : '', ";").concat(variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "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$1.palette.accents_1, ";border-color:").concat(theme$1.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(theme$1.palette.foreground, ";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$1.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$1.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$1.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$1.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$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")
|
|
2417
2425
|
})]
|
|
2418
2426
|
});
|
|
2419
2427
|
});
|
|
@@ -2441,7 +2449,7 @@ tuple('hover', 'click');
|
|
|
2441
2449
|
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
2442
2450
|
tuple('start', 'center', 'end', 'left', 'right');
|
|
2443
2451
|
|
|
2444
|
-
var _excluded$1h = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
|
|
2452
|
+
var _excluded$1h = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "required", "resize"];
|
|
2445
2453
|
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
2446
2454
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2447
2455
|
var _ref$type = _ref.type,
|
|
@@ -2462,6 +2470,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2462
2470
|
helperText = _ref.helperText,
|
|
2463
2471
|
error = _ref.error,
|
|
2464
2472
|
label = _ref.label,
|
|
2473
|
+
required = _ref.required,
|
|
2465
2474
|
_ref$resize = _ref.resize,
|
|
2466
2475
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
2467
2476
|
props = _objectWithoutProperties(_ref, _excluded$1h);
|
|
@@ -2520,6 +2529,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2520
2529
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2521
2530
|
className: "with-label",
|
|
2522
2531
|
children: [label && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
2532
|
+
required: required,
|
|
2523
2533
|
children: label
|
|
2524
2534
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2525
2535
|
className: _JSXStyle.dynamic([["12276481", [theme$1.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$1.palette.accents_1, theme$1.palette.accents_2, theme$1.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme$1.palette.background]]]) + " " + (classes || ""),
|
|
@@ -17190,7 +17200,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
|
|
|
17190
17200
|
});
|
|
17191
17201
|
SelectInput.displayName = 'SelectInput';
|
|
17192
17202
|
|
|
17193
|
-
var _excluded$f = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "fullWidth", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "helperText", "error", "getPopupContainer", "onDropdownVisibleChange"];
|
|
17203
|
+
var _excluded$f = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "fullWidth", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "helperText", "error", "required", "getPopupContainer", "onDropdownVisibleChange"];
|
|
17194
17204
|
var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
17195
17205
|
var children = _ref.children,
|
|
17196
17206
|
label = _ref.label,
|
|
@@ -17220,6 +17230,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
17220
17230
|
disableMatchWidth = _ref$disableMatchWidt === void 0 ? false : _ref$disableMatchWidt,
|
|
17221
17231
|
helperText = _ref.helperText,
|
|
17222
17232
|
error = _ref.error,
|
|
17233
|
+
required = _ref.required,
|
|
17223
17234
|
getPopupContainer = _ref.getPopupContainer,
|
|
17224
17235
|
_ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
|
|
17225
17236
|
onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
|
|
@@ -17347,14 +17358,8 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
17347
17358
|
}, className);
|
|
17348
17359
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
17349
17360
|
className: _JSXStyle.dynamic([["1795507141", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, fullWidth ? '100%' : 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]),
|
|
17350
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsx(
|
|
17351
|
-
|
|
17352
|
-
display: 'block',
|
|
17353
|
-
marginBottom: '0.4rem',
|
|
17354
|
-
fontSize: '14px',
|
|
17355
|
-
fontWeight: 'light'
|
|
17356
|
-
},
|
|
17357
|
-
className: _JSXStyle.dynamic([["1795507141", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, fullWidth ? '100%' : 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]),
|
|
17361
|
+
children: [label && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
17362
|
+
required: required,
|
|
17358
17363
|
children: label
|
|
17359
17364
|
}), /*#__PURE__*/jsxRuntime.jsx(SelectContext.Provider, {
|
|
17360
17365
|
value: initialValue,
|
|
@@ -42529,6 +42534,8 @@ exports.Grid = Grid;
|
|
|
42529
42534
|
exports.HtmlRenderer = HtmlRenderer;
|
|
42530
42535
|
exports.Image = Image;
|
|
42531
42536
|
exports.Input = Input;
|
|
42537
|
+
exports.InputError = InputError;
|
|
42538
|
+
exports.InputLabel = InputBlockLabel;
|
|
42532
42539
|
exports.KeyCode = KeyCode;
|
|
42533
42540
|
exports.KeyMod = KeyMod;
|
|
42534
42541
|
exports.Keyboard = Keyboard;
|
package/dist/input/index.d.ts
CHANGED
|
@@ -14,5 +14,6 @@ export type { InputProps } from './input-field';
|
|
|
14
14
|
export type { InputTypes } from './input-props';
|
|
15
15
|
export type { InputPasswordProps } from './password';
|
|
16
16
|
export type { TextareaProps } from '../textarea';
|
|
17
|
+
export { default as InputLabel, InputError } from "./input-block-label";
|
|
17
18
|
declare const _default: InputComponentType;
|
|
18
19
|
export default _default;
|