@creativecodeco/ui 1.0.3 → 1.0.4
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.
|
@@ -7,7 +7,7 @@ function useSafeButtonProps({ onClick, onSubmit, loading, ...props }) {
|
|
|
7
7
|
if (!props.disabled && !loading) {
|
|
8
8
|
callback(event);
|
|
9
9
|
}
|
|
10
|
-
}, [props.disabled]);
|
|
10
|
+
}, [props.disabled, loading]);
|
|
11
11
|
const handleClick = (0, react_1.useCallback)((event) => {
|
|
12
12
|
if (onClick) {
|
|
13
13
|
wrapper(onClick, event);
|
|
@@ -9,7 +9,7 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
10
|
const Avatar = ({ isOnline = false, ring = false, rounded = false, size = 'md', src, withStatus = false }) => {
|
|
11
11
|
const isUri = (0, react_1.useMemo)(() => (0, utils_1.isValidUrl)(src), [src]);
|
|
12
|
-
const letters = (0, react_1.useMemo)(() => (0, utils_1.getInitials)(src), [src
|
|
12
|
+
const letters = (0, react_1.useMemo)(() => (0, utils_1.getInitials)(src), [src]);
|
|
13
13
|
return ((0, jsx_runtime_1.jsx)("div", { "data-testid": 'avatar', className: (0, classnames_1.default)('avatar', {
|
|
14
14
|
'avatar-online': withStatus && isOnline,
|
|
15
15
|
'avatar-offline': withStatus && !isOnline,
|
|
@@ -28,13 +28,13 @@ const Dropdown = (0, react_1.forwardRef)(({ name, options = [], disabled, onChan
|
|
|
28
28
|
}
|
|
29
29
|
setLabel(option.label);
|
|
30
30
|
setValueFilter(option.label);
|
|
31
|
-
}, [value]);
|
|
31
|
+
}, [value, options]);
|
|
32
32
|
const handleFocus = (0, react_1.useCallback)(() => {
|
|
33
33
|
if (disabled) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
setOpen(true);
|
|
37
|
-
}, [
|
|
37
|
+
}, [disabled]);
|
|
38
38
|
const handleSelect = (0, react_1.useCallback)((option) => {
|
|
39
39
|
onChange?.({
|
|
40
40
|
target: { value: String(option.value) }
|
|
@@ -50,6 +50,6 @@ const Dropdown = (0, react_1.forwardRef)(({ name, options = [], disabled, onChan
|
|
|
50
50
|
const filterOptions = (0, react_1.useMemo)(() => !valueFilter
|
|
51
51
|
? options
|
|
52
52
|
: options.filter(({ label }) => label.includes(valueFilter)), [valueFilter, options]);
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: 'dropdown
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: 'block dropdown', children: [(0, jsx_runtime_1.jsx)(textbox_1.TextBox, { name: name, tabIndex: 0, ref: ref, disabled: disabled, rightButton: true, rightIcon: fa_1.FaSortDown, onFocus: handleFocus, onChange: handleChange, ...otherProps, value: label }), open && ((0, jsx_runtime_1.jsx)("ul", { tabIndex: 0, className: 'z-1 bg-base-100 shadow rounded-box w-full dropdown-content menu', id: `options-${name}`, ref: refOutside, role: 'listitem', "data-testid": `options-${name}`, children: filterOptions.map((option) => ((0, jsx_runtime_1.jsx)("li", { value: option.value, onClick: () => handleSelect(option), children: (0, jsx_runtime_1.jsx)("a", { children: option.label }) }, option.value))) }))] }));
|
|
54
54
|
});
|
|
55
55
|
exports.default = Dropdown;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"framework design",
|
|
11
11
|
"design system"
|
|
12
12
|
],
|
|
13
|
-
"version": "1.0.
|
|
13
|
+
"version": "1.0.4",
|
|
14
14
|
"homepage": "https://github.com/creativecodeco/ui",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "John Toro",
|
|
@@ -79,18 +79,12 @@
|
|
|
79
79
|
"classnames": "2.5.1",
|
|
80
80
|
"cpx2": "8.0.0",
|
|
81
81
|
"daisyui": "5.5.19",
|
|
82
|
-
"eslint": "
|
|
82
|
+
"eslint": "9.39.4",
|
|
83
83
|
"eslint-config-prettier": "10.1.8",
|
|
84
|
-
"eslint-config-standard": "17.1.0",
|
|
85
|
-
"eslint-config-standard-react": "13.0.0",
|
|
86
|
-
"eslint-config-standard-with-typescript": "43.0.1",
|
|
87
84
|
"eslint-plugin-import": "2.32.0",
|
|
88
|
-
"eslint-plugin-n": "16.6.2",
|
|
89
|
-
"eslint-plugin-node": "11.1.0",
|
|
90
85
|
"eslint-plugin-prettier": "5.5.5",
|
|
91
|
-
"eslint-plugin-promise": "6.6.0",
|
|
92
86
|
"eslint-plugin-react": "7.37.5",
|
|
93
|
-
"eslint-plugin-
|
|
87
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
94
88
|
"eslint-plugin-storybook": "10.3.3",
|
|
95
89
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
96
90
|
"globals": "17.4.0",
|
|
@@ -118,6 +112,7 @@
|
|
|
118
112
|
],
|
|
119
113
|
"overrides": {
|
|
120
114
|
"handlebars": "4.7.9",
|
|
121
|
-
"minimatch": "9.0.7"
|
|
115
|
+
"minimatch": "9.0.7",
|
|
116
|
+
"lodash": "4.17.23"
|
|
122
117
|
}
|
|
123
118
|
}
|