@helpdice/ui 1.6.1 → 1.6.3
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 +15 -7
- package/dist/index.js +50 -40
- 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 +15 -7
- 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/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,7 +80,13 @@ var CheckboxComponent = function CheckboxComponent(_ref) {
|
|
|
78
80
|
setSelfChecked(checked);
|
|
79
81
|
}, [checked]);
|
|
80
82
|
return /*#__PURE__*/React.createElement("label", {
|
|
81
|
-
|
|
83
|
+
style: block ? {
|
|
84
|
+
backgroundColor: '#efefef',
|
|
85
|
+
padding: '20px 15px',
|
|
86
|
+
height: '2.5rem',
|
|
87
|
+
width: '100%'
|
|
88
|
+
} : {},
|
|
89
|
+
className: _JSXStyle.dynamic([["204928356", [SCALES.font(1.1), 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
90
|
}, /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
83
91
|
fill: fill,
|
|
84
92
|
bg: bg,
|
|
@@ -90,13 +98,13 @@ var CheckboxComponent = function CheckboxComponent(_ref) {
|
|
|
90
98
|
checked: selfChecked,
|
|
91
99
|
onChange: changeHandle
|
|
92
100
|
}, props, {
|
|
93
|
-
className: _JSXStyle.dynamic([["
|
|
101
|
+
className: _JSXStyle.dynamic([["204928356", [SCALES.font(1.1), 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']]]) + " " + (props && props.className != null && props.className || "")
|
|
94
102
|
})), /*#__PURE__*/React.createElement("span", {
|
|
95
|
-
className: _JSXStyle.dynamic([["
|
|
103
|
+
className: _JSXStyle.dynamic([["204928356", [SCALES.font(1.1), 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']]]) + " " + "text"
|
|
96
104
|
}, children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
97
|
-
id: "
|
|
98
|
-
dynamic: [SCALES.font(
|
|
99
|
-
}, ".checkbox.__jsx-style-dynamic-selector{--checkbox-size:".concat(SCALES.font(
|
|
105
|
+
id: "204928356",
|
|
106
|
+
dynamic: [SCALES.font(1.1), 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']
|
|
107
|
+
}, ".checkbox.__jsx-style-dynamic-selector{--checkbox-size:".concat(SCALES.font(1.1), ";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;cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";opacity:").concat(isDisabled ? 0.75 : 1, ";line-height:var(--checkbox-size);width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'var(--checkbox-size)'), ";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), ";}.text.__jsx-style-dynamic-selector{font-size:var(--checkbox-size);line-height:var(--checkbox-size);padding-left:calc(var(--checkbox-size) * 0.5);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";}input.__jsx-style-dynamic-selector{opacity:0;outline:none;position:absolute;width:0;height:0;margin:0;padding:0;z-index:-1;font-size:0;background-color:transparent;}")));
|
|
100
108
|
};
|
|
101
109
|
CheckboxComponent.displayName = 'Checkbox';
|
|
102
110
|
var Checkbox = withScale(CheckboxComponent);
|
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
|
@@ -103,7 +103,7 @@ var TableHead = function TableHead(props) {
|
|
|
103
103
|
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
104
104
|
// id={`filter-date-${filterName}`}
|
|
105
105
|
, {
|
|
106
|
-
|
|
106
|
+
type: "date"
|
|
107
107
|
// name={filterName}
|
|
108
108
|
,
|
|
109
109
|
value: filters[filterName],
|
|
@@ -113,7 +113,7 @@ var TableHead = function TableHead(props) {
|
|
|
113
113
|
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
114
114
|
// id={`filter-search-${filterName}`}
|
|
115
115
|
, {
|
|
116
|
-
|
|
116
|
+
type: "text",
|
|
117
117
|
autoComplete: "off"
|
|
118
118
|
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
119
119
|
// name={filterName}
|
|
@@ -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.3",
|
|
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",
|