@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.
@@ -934,88 +934,6 @@ var withScale = function withScale(Render) {
934
934
  return ScaleFC;
935
935
  };
936
936
 
937
- var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
938
- var children = _ref.children,
939
- _ref$required = _ref.required,
940
- required = _ref$required === void 0 ? false : _ref$required;
941
- var theme$1 = theme.useTheme();
942
- var _useScale = useScale(),
943
- SCALES = _useScale.SCALES;
944
- return /*#__PURE__*/jsxRuntime.jsxs("label", {
945
- className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]),
946
- children: [children, required && /*#__PURE__*/jsxRuntime.jsx("span", {
947
- className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]) + " " + "mark-error",
948
- children: "*"
949
- }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
950
- id: "588038827",
951
- dynamic: [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)],
952
- 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;}")
953
- })]
954
- });
955
- };
956
- InputBlockLabelComponent.displayName = 'InputBlockLabel';
957
- var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
958
-
959
- var InputIconComponent = function InputIconComponent(_ref) {
960
- var icon = _ref.icon,
961
- _ref$clickable = _ref.clickable,
962
- clickable = _ref$clickable === void 0 ? false : _ref$clickable,
963
- onClick = _ref.onClick;
964
- return /*#__PURE__*/jsxRuntime.jsxs("span", {
965
- onClick: onClick,
966
- className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon",
967
- children: [icon, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
968
- id: "4247656379",
969
- dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none'],
970
- 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);}")
971
- })]
972
- });
973
- };
974
- InputIconComponent.displayName = 'InputIcon';
975
- var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
976
-
977
- var InputIconClear = function InputIconClear(_ref) {
978
- var onClick = _ref.onClick,
979
- disabled = _ref.disabled,
980
- visible = _ref.visible;
981
- var theme$1 = theme.useTheme();
982
- var classes = theme.useClasses('clear-icon', {
983
- visible: visible
984
- });
985
- var clickHandler = function clickHandler(event) {
986
- event.preventDefault();
987
- event.stopPropagation();
988
- event.nativeEvent.stopImmediatePropagation();
989
- onClick && onClick(event);
990
- };
991
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
992
- onClick: clickHandler,
993
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || ""),
994
- children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
995
- viewBox: "0 0 24 24",
996
- stroke: "currentColor",
997
- strokeWidth: "1.5",
998
- strokeLinecap: "round",
999
- strokeLinejoin: "round",
1000
- fill: "none",
1001
- shapeRendering: "geometricPrecision",
1002
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]),
1003
- children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1004
- d: "M18 6L6 18",
1005
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
1006
- }), /*#__PURE__*/jsxRuntime.jsx("path", {
1007
- d: "M6 6l12 12",
1008
- className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
1009
- })]
1010
- }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1011
- id: "1567030211",
1012
- dynamic: [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground],
1013
- 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);}")
1014
- })]
1015
- });
1016
- };
1017
- var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
1018
-
1019
937
  var _excluded$9 = ["children", "tag", "className", "color"];
1020
938
  var getTypeColor = function getTypeColor(type, palette) {
1021
939
  var colors = {
@@ -1863,6 +1781,104 @@ var TextComponent = function TextComponent(_ref) {
1863
1781
  TextComponent.displayName = 'Text';
1864
1782
  var Text = withScale(TextComponent);
1865
1783
 
1784
+ var InputError = function InputError(_ref) {
1785
+ var text = _ref.text,
1786
+ error = _ref.error;
1787
+ return /*#__PURE__*/jsxRuntime.jsxs(Text, {
1788
+ font: 0.8,
1789
+ style: {
1790
+ marginTop: 0.4,
1791
+ marginRight: 0,
1792
+ marginLeft: 0,
1793
+ marginBottom: '0.4rem',
1794
+ textAlign: 'left'
1795
+ },
1796
+ color: error ? "error" : 'default',
1797
+ children: ["\xA0", text]
1798
+ });
1799
+ };
1800
+ var InputBlockLabelComponent = function InputBlockLabelComponent(_ref2) {
1801
+ var children = _ref2.children,
1802
+ _ref2$required = _ref2.required,
1803
+ required = _ref2$required === void 0 ? false : _ref2$required;
1804
+ var theme$1 = theme.useTheme();
1805
+ var _useScale = useScale(),
1806
+ SCALES = _useScale.SCALES;
1807
+ return /*#__PURE__*/jsxRuntime.jsxs("label", {
1808
+ className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]),
1809
+ children: [children, required && /*#__PURE__*/jsxRuntime.jsx("span", {
1810
+ className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)]]]) + " " + "mark-error",
1811
+ children: "*"
1812
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1813
+ id: "588038827",
1814
+ dynamic: [typeof children === "string" ? 'block' : 'flex', theme$1.palette.accents_6, theme$1.palette.errorDark, SCALES.font(1.2)],
1815
+ 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;}")
1816
+ })]
1817
+ });
1818
+ };
1819
+ InputBlockLabelComponent.displayName = 'InputBlockLabel';
1820
+ var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
1821
+
1822
+ var InputIconComponent = function InputIconComponent(_ref) {
1823
+ var icon = _ref.icon,
1824
+ _ref$clickable = _ref.clickable,
1825
+ clickable = _ref$clickable === void 0 ? false : _ref$clickable,
1826
+ onClick = _ref.onClick;
1827
+ return /*#__PURE__*/jsxRuntime.jsxs("span", {
1828
+ onClick: onClick,
1829
+ className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon",
1830
+ children: [icon, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1831
+ id: "4247656379",
1832
+ dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none'],
1833
+ 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);}")
1834
+ })]
1835
+ });
1836
+ };
1837
+ InputIconComponent.displayName = 'InputIcon';
1838
+ var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
1839
+
1840
+ var InputIconClear = function InputIconClear(_ref) {
1841
+ var onClick = _ref.onClick,
1842
+ disabled = _ref.disabled,
1843
+ visible = _ref.visible;
1844
+ var theme$1 = theme.useTheme();
1845
+ var classes = theme.useClasses('clear-icon', {
1846
+ visible: visible
1847
+ });
1848
+ var clickHandler = function clickHandler(event) {
1849
+ event.preventDefault();
1850
+ event.stopPropagation();
1851
+ event.nativeEvent.stopImmediatePropagation();
1852
+ onClick && onClick(event);
1853
+ };
1854
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1855
+ onClick: clickHandler,
1856
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || ""),
1857
+ children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
1858
+ viewBox: "0 0 24 24",
1859
+ stroke: "currentColor",
1860
+ strokeWidth: "1.5",
1861
+ strokeLinecap: "round",
1862
+ strokeLinejoin: "round",
1863
+ fill: "none",
1864
+ shapeRendering: "geometricPrecision",
1865
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]),
1866
+ children: [/*#__PURE__*/jsxRuntime.jsx("path", {
1867
+ d: "M18 6L6 18",
1868
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
1869
+ }), /*#__PURE__*/jsxRuntime.jsx("path", {
1870
+ d: "M6 6l12 12",
1871
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
1872
+ })]
1873
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1874
+ id: "1567030211",
1875
+ dynamic: [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground],
1876
+ 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);}")
1877
+ })]
1878
+ });
1879
+ };
1880
+ var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
1881
+
1866
1882
  var getColors = function getColors(palette, status) {
1867
1883
  var colors = {
1868
1884
  "default": {
@@ -1970,7 +1986,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1970
1986
  }, [icon, iconRight]);
1971
1987
  var _useMemo = React.useMemo(function () {
1972
1988
  return getColors(theme$1.palette, _color);
1973
- }, [theme$1.palette, type]),
1989
+ }, [theme$1.palette, _color]),
1974
1990
  color = _useMemo.color,
1975
1991
  borderColor = _useMemo.borderColor,
1976
1992
  hoverBorder = _useMemo.hoverBorder;
@@ -2025,16 +2041,16 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2025
2041
  var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
2026
2042
  var defaultWidth = fullWidth ? '100%' : 'initial';
2027
2043
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2028
- className: _JSXStyle.dynamic([["1343268165", [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), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + "with-label",
2044
+ 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",
2029
2045
  children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
2030
2046
  required: required,
2031
2047
  children: children
2032
2048
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2033
- className: _JSXStyle.dynamic([["1343268165", [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), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-container', className) || ""),
2049
+ 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) || ""),
2034
2050
  children: [label && /*#__PURE__*/jsxRuntime.jsx(MemoInputLabel, {
2035
2051
  children: label
2036
2052
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2037
- className: _JSXStyle.dynamic([["1343268165", [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), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-wrapper', {
2053
+ 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', {
2038
2054
  hover: hover,
2039
2055
  disabled: disabled
2040
2056
  }, labelClasses) || ""),
@@ -2052,7 +2068,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2052
2068
  autoComplete: autoComplete,
2053
2069
  onKeyDown: handleKeyDown
2054
2070
  }, inputProps), {}, {
2055
- className: _JSXStyle.dynamic([["1343268165", [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), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
2071
+ 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({
2056
2072
  disabled: disabled
2057
2073
  }, iconClasses) || "")
2058
2074
  })), clearable && /*#__PURE__*/jsxRuntime.jsx(MemoInputIconClear, {
@@ -2066,23 +2082,15 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2066
2082
  isRight: true,
2067
2083
  children: labelRight
2068
2084
  }), /*#__PURE__*/jsxRuntime.jsx("br", {
2069
- className: _JSXStyle.dynamic([["1343268165", [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), color, theme$1.palette.accents_3, theme$1.palette.background, color]]])
2085
+ 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]]])
2070
2086
  })]
2071
- }), helperText && /*#__PURE__*/jsxRuntime.jsxs(Text, {
2072
- font: 0.8,
2073
- style: {
2074
- marginTop: 0.4,
2075
- marginRight: 0,
2076
- marginLeft: 0,
2077
- marginBottom: '0.4rem',
2078
- textAlign: 'left'
2079
- },
2080
- color: error ? "error" : 'default',
2081
- children: ["\xA0", helperText]
2087
+ }), helperText && /*#__PURE__*/jsxRuntime.jsx(InputError, {
2088
+ text: helperText,
2089
+ error: error
2082
2090
  }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
2083
- id: "1343268165",
2084
- 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), color, theme$1.palette.accents_3, theme$1.palette.background, color],
2085
- 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(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$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;}")
2091
+ id: "2371903369",
2092
+ 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],
2093
+ 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;}")
2086
2094
  })]
2087
2095
  });
2088
2096
  });
@@ -2104,7 +2112,7 @@ tuple('hover', 'click');
2104
2112
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
2105
2113
  tuple('start', 'center', 'end', 'left', 'right');
2106
2114
 
2107
- var _excluded$3 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
2115
+ var _excluded$3 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "required", "resize"];
2108
2116
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
2109
2117
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2110
2118
  var _ref$type = _ref.type,
@@ -2125,6 +2133,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2125
2133
  helperText = _ref.helperText,
2126
2134
  error = _ref.error,
2127
2135
  label = _ref.label,
2136
+ required = _ref.required,
2128
2137
  _ref$resize = _ref.resize,
2129
2138
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
2130
2139
  props = _objectWithoutProperties(_ref, _excluded$3);
@@ -2183,6 +2192,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2183
2192
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2184
2193
  className: "with-label",
2185
2194
  children: [label && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
2195
+ required: required,
2186
2196
  children: label
2187
2197
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
2188
2198
  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 || ""),
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ export { default as Container } from './container';
42
42
  export { default as HtmlRenderer } from './html-renderer';
43
43
  export { default as Image } from './image';
44
44
  export type { ImageProps, ImageBrowserProps } from './image';
45
- export { default as Input, getColors } from './input';
45
+ export { default as Input, getColors, InputLabel, InputError } from './input';
46
46
  export type { InputProps, InputPasswordProps } from './input';
47
47
  export { default as Keyboard } from './keyboard';
48
48
  export type { KeyboardProps } from './keyboard';