@helpdice/ui 1.6.1 → 1.6.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/auto-complete.d.ts +2 -1
- package/dist/auto-complete/index.js +11 -9
- package/dist/button/button.d.ts +2 -2
- package/dist/button/index.js +13 -13
- package/dist/button/styles.d.ts +2 -2
- package/dist/checkbox/checkbox.d.ts +1 -0
- package/dist/checkbox/index.js +8 -1
- package/dist/index.js +43 -34
- package/dist/input/index.js +8 -8
- package/dist/input/input-props.d.ts +2 -2
- package/dist/input/password.d.ts +2 -2
- package/dist/modal/index.js +13 -13
- package/dist/table/index.js +31 -31
- package/dist/ui-provider/index.js +14 -14
- package/esm/auto-complete/auto-complete.d.ts +2 -1
- package/esm/auto-complete/auto-complete.js +3 -1
- package/esm/button/button.d.ts +2 -2
- package/esm/button/button.js +6 -6
- package/esm/button/styles.d.ts +2 -2
- package/esm/button/styles.js +8 -8
- package/esm/checkbox/checkbox.d.ts +1 -0
- package/esm/checkbox/checkbox.js +8 -1
- package/esm/input/input-props.d.ts +2 -2
- package/esm/input/input.js +7 -7
- package/esm/input/password.d.ts +2 -2
- package/esm/input/password.js +1 -1
- package/esm/table/data-table.js +8 -8
- package/esm/table/table-head.js +2 -2
- package/esm/use-toasts/helpers.js +1 -1
- package/package.json +1 -2
package/dist/modal/index.js
CHANGED
|
@@ -1592,7 +1592,7 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
|
1592
1592
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
1593
1593
|
};
|
|
1594
1594
|
|
|
1595
|
-
var getButtonGhostColors = function getButtonGhostColors(palette,
|
|
1595
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
1596
1596
|
var colors = {
|
|
1597
1597
|
secondary: {
|
|
1598
1598
|
bg: palette.background,
|
|
@@ -1615,10 +1615,10 @@ var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
|
1615
1615
|
color: palette.error
|
|
1616
1616
|
}
|
|
1617
1617
|
};
|
|
1618
|
-
return colors[
|
|
1618
|
+
return colors[_color] || null;
|
|
1619
1619
|
};
|
|
1620
1620
|
var getButtonColors = function getButtonColors(palette, props) {
|
|
1621
|
-
var
|
|
1621
|
+
var color = props.color,
|
|
1622
1622
|
disabled = props.disabled,
|
|
1623
1623
|
ghost = props.ghost;
|
|
1624
1624
|
var colors = {
|
|
@@ -1666,12 +1666,12 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
1666
1666
|
* Color['success'] === Color['success-light']
|
|
1667
1667
|
* Color['warning'] === Color['warning-light']
|
|
1668
1668
|
*/
|
|
1669
|
-
var withoutLightType =
|
|
1669
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
1670
1670
|
var defaultColor = colors["default"];
|
|
1671
1671
|
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
1672
1672
|
return colors[withoutLightType] || defaultColor;
|
|
1673
1673
|
};
|
|
1674
|
-
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette,
|
|
1674
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
1675
1675
|
var colors = {
|
|
1676
1676
|
secondary: {
|
|
1677
1677
|
bg: palette.foreground,
|
|
@@ -1694,11 +1694,11 @@ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type
|
|
|
1694
1694
|
color: 'white'
|
|
1695
1695
|
}
|
|
1696
1696
|
};
|
|
1697
|
-
var withoutLightType =
|
|
1697
|
+
var withoutLightType = _color.replace('-light', '');
|
|
1698
1698
|
return colors[withoutLightType] || null;
|
|
1699
1699
|
};
|
|
1700
1700
|
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
1701
|
-
var
|
|
1701
|
+
var color = props.color,
|
|
1702
1702
|
disabled = props.disabled,
|
|
1703
1703
|
loading = props.loading,
|
|
1704
1704
|
shadow = props.shadow,
|
|
@@ -1753,7 +1753,7 @@ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
|
1753
1753
|
color: 'transparent'
|
|
1754
1754
|
});
|
|
1755
1755
|
if (shadow) return defaultColor;
|
|
1756
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette,
|
|
1756
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
1757
1757
|
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
1758
1758
|
color: hoverColor.color || hoverColor.border
|
|
1759
1759
|
});
|
|
@@ -1779,7 +1779,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
1779
1779
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1780
1780
|
};
|
|
1781
1781
|
|
|
1782
|
-
var _excluded$6 = ["children", "disabled", "
|
|
1782
|
+
var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1783
1783
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1784
1784
|
var theme = useTheme();
|
|
1785
1785
|
var _useScale = useScale(),
|
|
@@ -1806,7 +1806,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1806
1806
|
var children = filteredProps.children,
|
|
1807
1807
|
_filteredProps$disabl = filteredProps.disabled,
|
|
1808
1808
|
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
1809
|
-
filteredProps.
|
|
1809
|
+
filteredProps.color;
|
|
1810
1810
|
var _filteredProps$loadin = filteredProps.loading,
|
|
1811
1811
|
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
1812
1812
|
_filteredProps$shadow = filteredProps.shadow,
|
|
@@ -1821,8 +1821,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1821
1821
|
_filteredProps$auto = filteredProps.auto,
|
|
1822
1822
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
1823
1823
|
icon = filteredProps.icon,
|
|
1824
|
-
_filteredProps$
|
|
1825
|
-
|
|
1824
|
+
_filteredProps$type = filteredProps.type,
|
|
1825
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
1826
1826
|
iconRight = filteredProps.iconRight,
|
|
1827
1827
|
_filteredProps$classN = filteredProps.className,
|
|
1828
1828
|
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
@@ -1876,7 +1876,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1876
1876
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1877
1877
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
1878
1878
|
ref: buttonRef,
|
|
1879
|
-
type:
|
|
1879
|
+
type: type,
|
|
1880
1880
|
disabled: disabled,
|
|
1881
1881
|
onClick: clickHandler
|
|
1882
1882
|
}, props, {
|
package/dist/table/index.js
CHANGED
|
@@ -1363,7 +1363,7 @@ var withScale = function withScale(Render) {
|
|
|
1363
1363
|
return ScaleFC;
|
|
1364
1364
|
};
|
|
1365
1365
|
|
|
1366
|
-
var _excluded$l = ["label", "labelRight", "
|
|
1366
|
+
var _excluded$l = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
|
|
1367
1367
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1368
1368
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1369
1369
|
target: el,
|
|
@@ -1373,11 +1373,11 @@ var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
|
1373
1373
|
var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1374
1374
|
var label = _ref.label,
|
|
1375
1375
|
labelRight = _ref.labelRight,
|
|
1376
|
-
_ref$
|
|
1377
|
-
|
|
1376
|
+
_ref$color = _ref.color,
|
|
1377
|
+
_color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
1378
1378
|
error = _ref.error,
|
|
1379
|
-
_ref$
|
|
1380
|
-
|
|
1379
|
+
_ref$type = _ref.type,
|
|
1380
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1381
1381
|
icon = _ref.icon,
|
|
1382
1382
|
iconRight = _ref.iconRight,
|
|
1383
1383
|
_ref$iconClickable = _ref.iconClickable,
|
|
@@ -1429,7 +1429,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1429
1429
|
return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
|
|
1430
1430
|
}, [icon, iconRight]);
|
|
1431
1431
|
var _useMemo = React.useMemo(function () {
|
|
1432
|
-
return getColors$2(theme.palette,
|
|
1432
|
+
return getColors$2(theme.palette, _color);
|
|
1433
1433
|
}, [theme.palette, type]),
|
|
1434
1434
|
color = _useMemo.color,
|
|
1435
1435
|
borderColor = _useMemo.borderColor,
|
|
@@ -1490,7 +1490,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1490
1490
|
}, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
|
|
1491
1491
|
icon: icon
|
|
1492
1492
|
}, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
|
|
1493
|
-
type:
|
|
1493
|
+
type: type,
|
|
1494
1494
|
ref: inputRef,
|
|
1495
1495
|
placeholder: placeholder,
|
|
1496
1496
|
disabled: disabled,
|
|
@@ -1694,7 +1694,7 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
1694
1694
|
ref: inputRef,
|
|
1695
1695
|
iconClickable: true,
|
|
1696
1696
|
onIconClick: iconClickHandler,
|
|
1697
|
-
|
|
1697
|
+
type: visible ? 'text' : 'password'
|
|
1698
1698
|
});
|
|
1699
1699
|
}, [props, iconClickHandler, visible, inputRef]);
|
|
1700
1700
|
var icon = React.useMemo(function () {
|
|
@@ -2738,7 +2738,7 @@ var TableHead = function TableHead(props) {
|
|
|
2738
2738
|
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
2739
2739
|
// id={`filter-date-${filterName}`}
|
|
2740
2740
|
, {
|
|
2741
|
-
|
|
2741
|
+
type: "date"
|
|
2742
2742
|
// name={filterName}
|
|
2743
2743
|
,
|
|
2744
2744
|
value: filters[filterName],
|
|
@@ -2748,7 +2748,7 @@ var TableHead = function TableHead(props) {
|
|
|
2748
2748
|
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
2749
2749
|
// id={`filter-search-${filterName}`}
|
|
2750
2750
|
, {
|
|
2751
|
-
|
|
2751
|
+
type: "text",
|
|
2752
2752
|
autoComplete: "off"
|
|
2753
2753
|
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
2754
2754
|
// name={filterName}
|
|
@@ -30710,7 +30710,7 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
|
30710
30710
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
30711
30711
|
};
|
|
30712
30712
|
|
|
30713
|
-
var getButtonGhostColors = function getButtonGhostColors(palette,
|
|
30713
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
30714
30714
|
var colors = {
|
|
30715
30715
|
secondary: {
|
|
30716
30716
|
bg: palette.background,
|
|
@@ -30733,10 +30733,10 @@ var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
|
30733
30733
|
color: palette.error
|
|
30734
30734
|
}
|
|
30735
30735
|
};
|
|
30736
|
-
return colors[
|
|
30736
|
+
return colors[_color] || null;
|
|
30737
30737
|
};
|
|
30738
30738
|
var getButtonColors = function getButtonColors(palette, props) {
|
|
30739
|
-
var
|
|
30739
|
+
var color = props.color,
|
|
30740
30740
|
disabled = props.disabled,
|
|
30741
30741
|
ghost = props.ghost;
|
|
30742
30742
|
var colors = {
|
|
@@ -30784,12 +30784,12 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
30784
30784
|
* Color['success'] === Color['success-light']
|
|
30785
30785
|
* Color['warning'] === Color['warning-light']
|
|
30786
30786
|
*/
|
|
30787
|
-
var withoutLightType =
|
|
30787
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
30788
30788
|
var defaultColor = colors["default"];
|
|
30789
30789
|
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
30790
30790
|
return colors[withoutLightType] || defaultColor;
|
|
30791
30791
|
};
|
|
30792
|
-
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette,
|
|
30792
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
30793
30793
|
var colors = {
|
|
30794
30794
|
secondary: {
|
|
30795
30795
|
bg: palette.foreground,
|
|
@@ -30812,11 +30812,11 @@ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type
|
|
|
30812
30812
|
color: 'white'
|
|
30813
30813
|
}
|
|
30814
30814
|
};
|
|
30815
|
-
var withoutLightType =
|
|
30815
|
+
var withoutLightType = _color.replace('-light', '');
|
|
30816
30816
|
return colors[withoutLightType] || null;
|
|
30817
30817
|
};
|
|
30818
30818
|
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
30819
|
-
var
|
|
30819
|
+
var color = props.color,
|
|
30820
30820
|
disabled = props.disabled,
|
|
30821
30821
|
loading = props.loading,
|
|
30822
30822
|
shadow = props.shadow,
|
|
@@ -30871,7 +30871,7 @@ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
|
30871
30871
|
color: 'transparent'
|
|
30872
30872
|
});
|
|
30873
30873
|
if (shadow) return defaultColor;
|
|
30874
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette,
|
|
30874
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
30875
30875
|
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
30876
30876
|
color: hoverColor.color || hoverColor.border
|
|
30877
30877
|
});
|
|
@@ -30897,7 +30897,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
30897
30897
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
30898
30898
|
};
|
|
30899
30899
|
|
|
30900
|
-
var _excluded$8 = ["children", "disabled", "
|
|
30900
|
+
var _excluded$8 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
30901
30901
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
30902
30902
|
var theme = useTheme();
|
|
30903
30903
|
var _useScale = useScale(),
|
|
@@ -30924,7 +30924,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
30924
30924
|
var children = filteredProps.children,
|
|
30925
30925
|
_filteredProps$disabl = filteredProps.disabled,
|
|
30926
30926
|
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
30927
|
-
filteredProps.
|
|
30927
|
+
filteredProps.color;
|
|
30928
30928
|
var _filteredProps$loadin = filteredProps.loading,
|
|
30929
30929
|
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
30930
30930
|
_filteredProps$shadow = filteredProps.shadow,
|
|
@@ -30939,8 +30939,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
30939
30939
|
_filteredProps$auto = filteredProps.auto,
|
|
30940
30940
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
30941
30941
|
icon = filteredProps.icon,
|
|
30942
|
-
_filteredProps$
|
|
30943
|
-
|
|
30942
|
+
_filteredProps$type = filteredProps.type,
|
|
30943
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
30944
30944
|
iconRight = filteredProps.iconRight,
|
|
30945
30945
|
_filteredProps$classN = filteredProps.className,
|
|
30946
30946
|
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
@@ -30994,7 +30994,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
30994
30994
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
30995
30995
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
30996
30996
|
ref: buttonRef,
|
|
30997
|
-
type:
|
|
30997
|
+
type: type,
|
|
30998
30998
|
disabled: disabled,
|
|
30999
30999
|
onClick: clickHandler
|
|
31000
31000
|
}, props, {
|
|
@@ -31751,7 +31751,7 @@ function DataTable(_ref) {
|
|
|
31751
31751
|
// <Input
|
|
31752
31752
|
// // id={`filter-date-${filterName}`}
|
|
31753
31753
|
// // key={filterName}
|
|
31754
|
-
//
|
|
31754
|
+
// type="date"
|
|
31755
31755
|
// name={filterName}
|
|
31756
31756
|
// value={filterValues[filterName]}
|
|
31757
31757
|
// onChange={(e) => handleFilterChange(filterName, e.target.value)}
|
|
@@ -31761,7 +31761,7 @@ function DataTable(_ref) {
|
|
|
31761
31761
|
// <Input
|
|
31762
31762
|
// // id={`filter-search-${filterName}`}
|
|
31763
31763
|
// // key={filterName}
|
|
31764
|
-
//
|
|
31764
|
+
// type="text"
|
|
31765
31765
|
// autoComplete="off"
|
|
31766
31766
|
// // ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
31767
31767
|
// name={filterName}
|
|
@@ -31824,7 +31824,7 @@ function DataTable(_ref) {
|
|
|
31824
31824
|
fontSize: 'larger'
|
|
31825
31825
|
}
|
|
31826
31826
|
}, children && /*#__PURE__*/React.createElement(Button, {
|
|
31827
|
-
|
|
31827
|
+
type: "button",
|
|
31828
31828
|
auto: true,
|
|
31829
31829
|
scale: 2 / 3,
|
|
31830
31830
|
px: 0.6,
|
|
@@ -31854,7 +31854,7 @@ function DataTable(_ref) {
|
|
|
31854
31854
|
},
|
|
31855
31855
|
iconRight: /*#__PURE__*/React.createElement(Edit, null),
|
|
31856
31856
|
auto: true,
|
|
31857
|
-
|
|
31857
|
+
type: "button",
|
|
31858
31858
|
scale: 2 / 3,
|
|
31859
31859
|
px: 0.6
|
|
31860
31860
|
})) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -31871,7 +31871,7 @@ function DataTable(_ref) {
|
|
|
31871
31871
|
auto: true,
|
|
31872
31872
|
scale: 2 / 3,
|
|
31873
31873
|
px: 0.6,
|
|
31874
|
-
|
|
31874
|
+
type: "button",
|
|
31875
31875
|
iconRight: /*#__PURE__*/React.createElement(Delete$1, null)
|
|
31876
31876
|
})) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
31877
31877
|
text: "Refresh",
|
|
@@ -31881,7 +31881,7 @@ function DataTable(_ref) {
|
|
|
31881
31881
|
py: 0.4,
|
|
31882
31882
|
type: "dark"
|
|
31883
31883
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31884
|
-
|
|
31884
|
+
type: "button",
|
|
31885
31885
|
onClick: function onClick() {
|
|
31886
31886
|
return onRefresh();
|
|
31887
31887
|
},
|
|
@@ -31897,7 +31897,7 @@ function DataTable(_ref) {
|
|
|
31897
31897
|
py: 0.4,
|
|
31898
31898
|
type: "dark"
|
|
31899
31899
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31900
|
-
|
|
31900
|
+
type: "button",
|
|
31901
31901
|
onClick: handleShowFilter,
|
|
31902
31902
|
auto: true,
|
|
31903
31903
|
scale: 2 / 3,
|
|
@@ -31915,7 +31915,7 @@ function DataTable(_ref) {
|
|
|
31915
31915
|
placement: "bottomEnd",
|
|
31916
31916
|
child: content
|
|
31917
31917
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31918
|
-
|
|
31918
|
+
type: "button",
|
|
31919
31919
|
onClick: function onClick() {},
|
|
31920
31920
|
auto: true,
|
|
31921
31921
|
scale: 2 / 3,
|
|
@@ -1585,7 +1585,7 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
|
1585
1585
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
|
-
var getButtonGhostColors = function getButtonGhostColors(palette,
|
|
1588
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
1589
1589
|
var colors = {
|
|
1590
1590
|
secondary: {
|
|
1591
1591
|
bg: palette.background,
|
|
@@ -1608,10 +1608,10 @@ var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
|
1608
1608
|
color: palette.error
|
|
1609
1609
|
}
|
|
1610
1610
|
};
|
|
1611
|
-
return colors[
|
|
1611
|
+
return colors[_color] || null;
|
|
1612
1612
|
};
|
|
1613
1613
|
var getButtonColors = function getButtonColors(palette, props) {
|
|
1614
|
-
var
|
|
1614
|
+
var color = props.color,
|
|
1615
1615
|
disabled = props.disabled,
|
|
1616
1616
|
ghost = props.ghost;
|
|
1617
1617
|
var colors = {
|
|
@@ -1659,12 +1659,12 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
1659
1659
|
* Color['success'] === Color['success-light']
|
|
1660
1660
|
* Color['warning'] === Color['warning-light']
|
|
1661
1661
|
*/
|
|
1662
|
-
var withoutLightType =
|
|
1662
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
1663
1663
|
var defaultColor = colors["default"];
|
|
1664
1664
|
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
1665
1665
|
return colors[withoutLightType] || defaultColor;
|
|
1666
1666
|
};
|
|
1667
|
-
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette,
|
|
1667
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
1668
1668
|
var colors = {
|
|
1669
1669
|
secondary: {
|
|
1670
1670
|
bg: palette.foreground,
|
|
@@ -1687,11 +1687,11 @@ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type
|
|
|
1687
1687
|
color: 'white'
|
|
1688
1688
|
}
|
|
1689
1689
|
};
|
|
1690
|
-
var withoutLightType =
|
|
1690
|
+
var withoutLightType = _color.replace('-light', '');
|
|
1691
1691
|
return colors[withoutLightType] || null;
|
|
1692
1692
|
};
|
|
1693
1693
|
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
1694
|
-
var
|
|
1694
|
+
var color = props.color,
|
|
1695
1695
|
disabled = props.disabled,
|
|
1696
1696
|
loading = props.loading,
|
|
1697
1697
|
shadow = props.shadow,
|
|
@@ -1746,7 +1746,7 @@ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
|
1746
1746
|
color: 'transparent'
|
|
1747
1747
|
});
|
|
1748
1748
|
if (shadow) return defaultColor;
|
|
1749
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette,
|
|
1749
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
1750
1750
|
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
1751
1751
|
color: hoverColor.color || hoverColor.border
|
|
1752
1752
|
});
|
|
@@ -1772,7 +1772,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
1772
1772
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1773
1773
|
};
|
|
1774
1774
|
|
|
1775
|
-
var _excluded = ["children", "disabled", "
|
|
1775
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1776
1776
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1777
1777
|
var theme = useTheme();
|
|
1778
1778
|
var _useScale = useScale(),
|
|
@@ -1799,7 +1799,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1799
1799
|
var children = filteredProps.children,
|
|
1800
1800
|
_filteredProps$disabl = filteredProps.disabled,
|
|
1801
1801
|
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
1802
|
-
filteredProps.
|
|
1802
|
+
filteredProps.color;
|
|
1803
1803
|
var _filteredProps$loadin = filteredProps.loading,
|
|
1804
1804
|
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
1805
1805
|
_filteredProps$shadow = filteredProps.shadow,
|
|
@@ -1814,8 +1814,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1814
1814
|
_filteredProps$auto = filteredProps.auto,
|
|
1815
1815
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
1816
1816
|
icon = filteredProps.icon,
|
|
1817
|
-
_filteredProps$
|
|
1818
|
-
|
|
1817
|
+
_filteredProps$type = filteredProps.type,
|
|
1818
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
1819
1819
|
iconRight = filteredProps.iconRight,
|
|
1820
1820
|
_filteredProps$classN = filteredProps.className,
|
|
1821
1821
|
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
@@ -1869,7 +1869,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1869
1869
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1870
1870
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
1871
1871
|
ref: buttonRef,
|
|
1872
|
-
type:
|
|
1872
|
+
type: type,
|
|
1873
1873
|
disabled: disabled,
|
|
1874
1874
|
onClick: clickHandler
|
|
1875
1875
|
}, props, {
|
|
@@ -1914,7 +1914,7 @@ var makeToastActions = function makeToastActions(actions, cancelHandle) {
|
|
|
1914
1914
|
auto: true,
|
|
1915
1915
|
scale: 1 / 3,
|
|
1916
1916
|
font: "13px",
|
|
1917
|
-
|
|
1917
|
+
color: action.passive ? 'default' : 'secondary',
|
|
1918
1918
|
key: "action-".concat(index),
|
|
1919
1919
|
onClick: function onClick(event) {
|
|
1920
1920
|
return handler(event, action.handler);
|
|
@@ -9,7 +9,8 @@ export type AutoCompleteOption = {
|
|
|
9
9
|
export type AutoCompleteOptions = Array<typeof AutoCompleteItem | AutoCompleteOption | React.ReactElement<AutoCompleteItemProps>>;
|
|
10
10
|
interface Props {
|
|
11
11
|
options?: Array<AutoCompleteOption>;
|
|
12
|
-
|
|
12
|
+
color?: AutoCompleteTypes;
|
|
13
|
+
type?: string;
|
|
13
14
|
initialValue?: string;
|
|
14
15
|
value?: string;
|
|
15
16
|
onChange?: (value: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["options", "initialValue", "onSelect", "onSearch", "onChange", "searching", "children", "type", "value", "clearable", "disabled", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "disableFreeSolo", "getPopupContainer"];
|
|
4
|
+
var _excluded = ["options", "initialValue", "onSelect", "onSearch", "onChange", "searching", "children", "type", "color", "value", "clearable", "disabled", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "disableFreeSolo", "getPopupContainer"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* "use client" */
|
|
7
7
|
|
|
@@ -52,6 +52,7 @@ var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRe
|
|
|
52
52
|
searching = _ref.searching,
|
|
53
53
|
children = _ref.children,
|
|
54
54
|
type = _ref.type,
|
|
55
|
+
color = _ref.color,
|
|
55
56
|
value = _ref.value,
|
|
56
57
|
_ref$clearable = _ref.clearable,
|
|
57
58
|
clearable = _ref$clearable === void 0 ? false : _ref$clearable,
|
|
@@ -176,6 +177,7 @@ var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRe
|
|
|
176
177
|
fullWidth: true,
|
|
177
178
|
ref: inputRef,
|
|
178
179
|
type: type,
|
|
180
|
+
color: color,
|
|
179
181
|
onChange: onInputChange,
|
|
180
182
|
onFocus: function onFocus() {
|
|
181
183
|
return toggleFocusHandler(true);
|
package/esm/button/button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonTypes } from '../utils/prop-types';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
4
|
+
color?: ButtonTypes;
|
|
5
5
|
ghost?: boolean;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
shadow?: boolean;
|
|
@@ -9,7 +9,7 @@ interface Props {
|
|
|
9
9
|
auto?: boolean;
|
|
10
10
|
effect?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
-
|
|
12
|
+
type?: React.ButtonHTMLAttributes<any>['type'];
|
|
13
13
|
icon?: React.ReactNode;
|
|
14
14
|
iconRight?: React.ReactNode;
|
|
15
15
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
package/esm/button/button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
var _excluded = ["children", "disabled", "
|
|
4
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* "use client" */
|
|
7
7
|
|
|
@@ -40,8 +40,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
40
40
|
var children = filteredProps.children,
|
|
41
41
|
_filteredProps$disabl = filteredProps.disabled,
|
|
42
42
|
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl,
|
|
43
|
-
_filteredProps$
|
|
44
|
-
|
|
43
|
+
_filteredProps$color = filteredProps.color,
|
|
44
|
+
_color = _filteredProps$color === void 0 ? 'default' : _filteredProps$color,
|
|
45
45
|
_filteredProps$loadin = filteredProps.loading,
|
|
46
46
|
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
47
47
|
_filteredProps$shadow = filteredProps.shadow,
|
|
@@ -56,8 +56,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
56
56
|
_filteredProps$auto = filteredProps.auto,
|
|
57
57
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
58
58
|
icon = filteredProps.icon,
|
|
59
|
-
_filteredProps$
|
|
60
|
-
|
|
59
|
+
_filteredProps$type = filteredProps.type,
|
|
60
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
61
61
|
iconRight = filteredProps.iconRight,
|
|
62
62
|
_filteredProps$classN = filteredProps.className,
|
|
63
63
|
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN,
|
|
@@ -112,7 +112,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
112
112
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
113
113
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
114
114
|
ref: buttonRef,
|
|
115
|
-
type:
|
|
115
|
+
type: type,
|
|
116
116
|
disabled: disabled,
|
|
117
117
|
onClick: clickHandler
|
|
118
118
|
}, props, {
|
package/esm/button/styles.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export interface ButtonColorGroup {
|
|
|
6
6
|
border: string;
|
|
7
7
|
color: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const getButtonGhostColors: (palette: HUIThemesPalette,
|
|
9
|
+
export declare const getButtonGhostColors: (palette: HUIThemesPalette, _color: ButtonTypes) => ButtonColorGroup | null;
|
|
10
10
|
export declare const getButtonColors: (palette: HUIThemesPalette, props: ButtonProps) => ButtonColorGroup;
|
|
11
|
-
export declare const getButtonGhostHoverColors: (palette: HUIThemesPalette,
|
|
11
|
+
export declare const getButtonGhostHoverColors: (palette: HUIThemesPalette, _color: ButtonTypes) => ButtonColorGroup | null;
|
|
12
12
|
export declare const getButtonHoverColors: (palette: HUIThemesPalette, props: ButtonProps) => ButtonColorGroup;
|
|
13
13
|
export interface ButtonCursorGroup {
|
|
14
14
|
cursor: string;
|
package/esm/button/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { addColorAlpha } from '../utils/color';
|
|
3
|
-
export var getButtonGhostColors = function getButtonGhostColors(palette,
|
|
3
|
+
export var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
4
4
|
var colors = {
|
|
5
5
|
secondary: {
|
|
6
6
|
bg: palette.background,
|
|
@@ -23,10 +23,10 @@ export var getButtonGhostColors = function getButtonGhostColors(palette, type) {
|
|
|
23
23
|
color: palette.error
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return colors[
|
|
26
|
+
return colors[_color] || null;
|
|
27
27
|
};
|
|
28
28
|
export var getButtonColors = function getButtonColors(palette, props) {
|
|
29
|
-
var
|
|
29
|
+
var color = props.color,
|
|
30
30
|
disabled = props.disabled,
|
|
31
31
|
ghost = props.ghost;
|
|
32
32
|
var colors = {
|
|
@@ -74,12 +74,12 @@ export var getButtonColors = function getButtonColors(palette, props) {
|
|
|
74
74
|
* Color['success'] === Color['success-light']
|
|
75
75
|
* Color['warning'] === Color['warning-light']
|
|
76
76
|
*/
|
|
77
|
-
var withoutLightType =
|
|
77
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
78
78
|
var defaultColor = colors["default"];
|
|
79
79
|
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
80
80
|
return colors[withoutLightType] || defaultColor;
|
|
81
81
|
};
|
|
82
|
-
export var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette,
|
|
82
|
+
export var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
83
83
|
var colors = {
|
|
84
84
|
secondary: {
|
|
85
85
|
bg: palette.foreground,
|
|
@@ -102,11 +102,11 @@ export var getButtonGhostHoverColors = function getButtonGhostHoverColors(palett
|
|
|
102
102
|
color: 'white'
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
var withoutLightType =
|
|
105
|
+
var withoutLightType = _color.replace('-light', '');
|
|
106
106
|
return colors[withoutLightType] || null;
|
|
107
107
|
};
|
|
108
108
|
export var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
109
|
-
var
|
|
109
|
+
var color = props.color,
|
|
110
110
|
disabled = props.disabled,
|
|
111
111
|
loading = props.loading,
|
|
112
112
|
shadow = props.shadow,
|
|
@@ -161,7 +161,7 @@ export var getButtonHoverColors = function getButtonHoverColors(palette, props)
|
|
|
161
161
|
color: 'transparent'
|
|
162
162
|
});
|
|
163
163
|
if (shadow) return defaultColor;
|
|
164
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette,
|
|
164
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
165
165
|
return _extends({}, hoverColor, {
|
|
166
166
|
color: hoverColor.color || hoverColor.border
|
|
167
167
|
});
|
package/esm/checkbox/checkbox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["checked", "initialChecked", "disabled", "onChange", "className", "children", "type", "value"];
|
|
4
|
+
var _excluded = ["checked", "initialChecked", "disabled", "onChange", "className", "children", "type", "value", "block"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* "use client" */
|
|
7
7
|
|
|
@@ -27,6 +27,8 @@ var CheckboxComponent = function CheckboxComponent(_ref) {
|
|
|
27
27
|
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
28
28
|
_ref$value = _ref.value,
|
|
29
29
|
value = _ref$value === void 0 ? '' : _ref$value,
|
|
30
|
+
_ref$block = _ref.block,
|
|
31
|
+
block = _ref$block === void 0 ? false : _ref$block,
|
|
30
32
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
33
|
var theme = useTheme();
|
|
32
34
|
var _useScale = useScale(),
|
|
@@ -78,6 +80,11 @@ var CheckboxComponent = function CheckboxComponent(_ref) {
|
|
|
78
80
|
setSelfChecked(checked);
|
|
79
81
|
}, [checked]);
|
|
80
82
|
return /*#__PURE__*/React.createElement("label", {
|
|
83
|
+
style: block ? {
|
|
84
|
+
backgroundColor: '#efefef',
|
|
85
|
+
padding: '15px',
|
|
86
|
+
height: '2.5rem'
|
|
87
|
+
} : {},
|
|
81
88
|
className: _JSXStyle.dynamic([["4126727675", [SCALES.font(0.875), isDisabled ? 'not-allowed' : 'pointer', isDisabled ? 0.75 : 1, SCALES.width(1, 'auto'), SCALES.height(1, 'var(--checkbox-size)'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? 'not-allowed' : 'pointer']]]) + " " + (classes || "")
|
|
82
89
|
}, /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
83
90
|
fill: fill,
|