@helpdice/ui 1.6.0 → 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 +56 -46
- 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 +828 -827
- 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 +15 -15
- package/esm/use-toasts/helpers.js +1 -1
- package/package.json +1 -2
|
@@ -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,
|
package/esm/input/input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["label", "labelRight", "
|
|
4
|
+
var _excluded = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
/* eslint-disable react/jsx-no-undef */
|
|
@@ -25,11 +25,11 @@ var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
|
25
25
|
var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
26
26
|
var label = _ref.label,
|
|
27
27
|
labelRight = _ref.labelRight,
|
|
28
|
-
_ref$
|
|
29
|
-
|
|
28
|
+
_ref$color = _ref.color,
|
|
29
|
+
_color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
30
30
|
error = _ref.error,
|
|
31
|
-
_ref$
|
|
32
|
-
|
|
31
|
+
_ref$type = _ref.type,
|
|
32
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
33
33
|
icon = _ref.icon,
|
|
34
34
|
iconRight = _ref.iconRight,
|
|
35
35
|
_ref$iconClickable = _ref.iconClickable,
|
|
@@ -81,7 +81,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
81
81
|
return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
|
|
82
82
|
}, [icon, iconRight]);
|
|
83
83
|
var _useMemo = useMemo(function () {
|
|
84
|
-
return getColors(theme.palette,
|
|
84
|
+
return getColors(theme.palette, _color);
|
|
85
85
|
}, [theme.palette, type]),
|
|
86
86
|
color = _useMemo.color,
|
|
87
87
|
borderColor = _useMemo.borderColor,
|
|
@@ -142,7 +142,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
142
142
|
}, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
|
|
143
143
|
icon: icon
|
|
144
144
|
}, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
|
|
145
|
-
type:
|
|
145
|
+
type: type,
|
|
146
146
|
ref: inputRef,
|
|
147
147
|
placeholder: placeholder,
|
|
148
148
|
disabled: disabled,
|
package/esm/input/password.d.ts
CHANGED
package/esm/input/password.js
CHANGED
|
@@ -36,7 +36,7 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
36
36
|
ref: inputRef,
|
|
37
37
|
iconClickable: true,
|
|
38
38
|
onIconClick: iconClickHandler,
|
|
39
|
-
|
|
39
|
+
type: visible ? 'text' : 'password'
|
|
40
40
|
});
|
|
41
41
|
}, [props, iconClickHandler, visible, inputRef]);
|
|
42
42
|
var icon = useMemo(function () {
|
package/esm/table/data-table.js
CHANGED
|
@@ -199,7 +199,7 @@ function DataTable(_ref) {
|
|
|
199
199
|
// <Input
|
|
200
200
|
// // id={`filter-date-${filterName}`}
|
|
201
201
|
// // key={filterName}
|
|
202
|
-
//
|
|
202
|
+
// type="date"
|
|
203
203
|
// name={filterName}
|
|
204
204
|
// value={filterValues[filterName]}
|
|
205
205
|
// onChange={(e) => handleFilterChange(filterName, e.target.value)}
|
|
@@ -209,7 +209,7 @@ function DataTable(_ref) {
|
|
|
209
209
|
// <Input
|
|
210
210
|
// // id={`filter-search-${filterName}`}
|
|
211
211
|
// // key={filterName}
|
|
212
|
-
//
|
|
212
|
+
// type="text"
|
|
213
213
|
// autoComplete="off"
|
|
214
214
|
// // ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
215
215
|
// name={filterName}
|
|
@@ -272,7 +272,7 @@ function DataTable(_ref) {
|
|
|
272
272
|
fontSize: 'larger'
|
|
273
273
|
}
|
|
274
274
|
}, children && /*#__PURE__*/React.createElement(Button, {
|
|
275
|
-
|
|
275
|
+
type: "button",
|
|
276
276
|
auto: true,
|
|
277
277
|
scale: 2 / 3,
|
|
278
278
|
px: 0.6,
|
|
@@ -302,7 +302,7 @@ function DataTable(_ref) {
|
|
|
302
302
|
},
|
|
303
303
|
iconRight: /*#__PURE__*/React.createElement(Edit, null),
|
|
304
304
|
auto: true,
|
|
305
|
-
|
|
305
|
+
type: "button",
|
|
306
306
|
scale: 2 / 3,
|
|
307
307
|
px: 0.6
|
|
308
308
|
})) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -319,7 +319,7 @@ function DataTable(_ref) {
|
|
|
319
319
|
auto: true,
|
|
320
320
|
scale: 2 / 3,
|
|
321
321
|
px: 0.6,
|
|
322
|
-
|
|
322
|
+
type: "button",
|
|
323
323
|
iconRight: /*#__PURE__*/React.createElement(Delete, null)
|
|
324
324
|
})) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
325
325
|
text: "Refresh",
|
|
@@ -329,7 +329,7 @@ function DataTable(_ref) {
|
|
|
329
329
|
py: 0.4,
|
|
330
330
|
type: "dark"
|
|
331
331
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
332
|
-
|
|
332
|
+
type: "button",
|
|
333
333
|
onClick: function onClick() {
|
|
334
334
|
return onRefresh();
|
|
335
335
|
},
|
|
@@ -345,7 +345,7 @@ function DataTable(_ref) {
|
|
|
345
345
|
py: 0.4,
|
|
346
346
|
type: "dark"
|
|
347
347
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
348
|
-
|
|
348
|
+
type: "button",
|
|
349
349
|
onClick: handleShowFilter,
|
|
350
350
|
auto: true,
|
|
351
351
|
scale: 2 / 3,
|
|
@@ -363,7 +363,7 @@ function DataTable(_ref) {
|
|
|
363
363
|
placement: "bottomEnd",
|
|
364
364
|
child: content
|
|
365
365
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
366
|
-
|
|
366
|
+
type: "button",
|
|
367
367
|
onClick: function onClick() {},
|
|
368
368
|
auto: true,
|
|
369
369
|
scale: 2 / 3,
|
package/esm/table/table-head.js
CHANGED
|
@@ -6,7 +6,8 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
import useTheme from '../use-theme';
|
|
7
7
|
import Input from '../input';
|
|
8
8
|
import Select from '../select';
|
|
9
|
-
import Button from '../button'
|
|
9
|
+
// import Button from '../button'
|
|
10
|
+
|
|
10
11
|
var makeColgroup = function makeColgroup(width, columns) {
|
|
11
12
|
var unsetWidthCount = columns.filter(function (c) {
|
|
12
13
|
return !c.width;
|
|
@@ -49,17 +50,22 @@ var TableHead = function TableHead(props) {
|
|
|
49
50
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
51
|
filters = _React$useState2[0],
|
|
51
52
|
setFilters = _React$useState2[1];
|
|
53
|
+
|
|
54
|
+
// const applyFilters = () => {
|
|
55
|
+
// if (onFilters) {
|
|
56
|
+
// onFilters(filters);
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
|
+
|
|
52
60
|
var handleFilterChange = function handleFilterChange(name, value) {
|
|
53
61
|
setFilters(function (prevFilters) {
|
|
54
62
|
var updatedFilters = _extends({}, prevFilters, _defineProperty({}, name, value));
|
|
63
|
+
if (onFilters) {
|
|
64
|
+
onFilters(filters);
|
|
65
|
+
}
|
|
55
66
|
return updatedFilters;
|
|
56
67
|
});
|
|
57
68
|
};
|
|
58
|
-
var applyFilters = function applyFilters() {
|
|
59
|
-
if (onFilters) {
|
|
60
|
-
onFilters(filters);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
69
|
var generateFilterInputs = function generateFilterInputs() {
|
|
64
70
|
return columns.map(function (col) {
|
|
65
71
|
var _String, _filters$filterName;
|
|
@@ -97,7 +103,7 @@ var TableHead = function TableHead(props) {
|
|
|
97
103
|
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
98
104
|
// id={`filter-date-${filterName}`}
|
|
99
105
|
, {
|
|
100
|
-
|
|
106
|
+
type: "date"
|
|
101
107
|
// name={filterName}
|
|
102
108
|
,
|
|
103
109
|
value: filters[filterName],
|
|
@@ -107,7 +113,7 @@ var TableHead = function TableHead(props) {
|
|
|
107
113
|
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
108
114
|
// id={`filter-search-${filterName}`}
|
|
109
115
|
, {
|
|
110
|
-
|
|
116
|
+
type: "text",
|
|
111
117
|
autoComplete: "off"
|
|
112
118
|
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
113
119
|
// name={filterName}
|
|
@@ -158,13 +164,7 @@ var TableHead = function TableHead(props) {
|
|
|
158
164
|
}, column.text)));
|
|
159
165
|
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
160
166
|
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
161
|
-
}, generateFilterInputs(), /*#__PURE__*/React.createElement(
|
|
162
|
-
className: _JSXStyle.dynamic([["2156261549", [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
163
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
164
|
-
onClick: function onClick() {
|
|
165
|
-
return applyFilters();
|
|
166
|
-
}
|
|
167
|
-
}, "Apply")))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
167
|
+
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
168
168
|
id: "2156261549",
|
|
169
169
|
dynamic: [stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
170
170
|
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:#fff;font-size:inherit;".concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:").concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
@@ -11,7 +11,7 @@ export var makeToastActions = function makeToastActions(actions, cancelHandle) {
|
|
|
11
11
|
auto: true,
|
|
12
12
|
scale: 1 / 3,
|
|
13
13
|
font: "13px",
|
|
14
|
-
|
|
14
|
+
color: action.passive ? 'default' : 'secondary',
|
|
15
15
|
key: "action-".concat(index),
|
|
16
16
|
onClick: function onClick(event) {
|
|
17
17
|
return handler(event, action.handler);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
"react-is": "^19.0.0",
|
|
111
111
|
"react-syntax-highlighter": "^15.6.1",
|
|
112
112
|
"react-transition-group": "^4.4.5",
|
|
113
|
-
"release": "^6.3.1",
|
|
114
113
|
"rollup-plugin-local-resolve": "^1.0.7",
|
|
115
114
|
"styled-components": "^6.1.14",
|
|
116
115
|
"tiny-warning": "^1.0.3",
|