@infonomic/uikit 2.14.0 → 2.15.0
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/components/calendar/calendar.js +6 -6
- package/dist/components/input/checkbox-group.js +1 -1
- package/dist/components/input/checkbox.js +1 -1
- package/dist/components/input/errors.js +2 -3
- package/dist/components/input/input.js +1 -1
- package/dist/components/input/select.js +1 -1
- package/dist/components/input/text-area.js +1 -1
- package/dist/components/input/utils.js +3 -4
- package/dist/components/overlay/overlay.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/findMatch.js +3 -3
- package/dist/utils/isTouchDevice.js +3 -3
- package/dist/utils/to-kebab-case.js +1 -4
- package/dist/widgets/datepicker/datepicker.js +1 -1
- package/dist/widgets/drawer/drawer.js +1 -1
- package/dist/widgets/modal/modal.js +1 -1
- package/dist/widgets/search/search.js +1 -1
- package/package.json +30 -30
- package/src/components/overlay/overlay.tsx +1 -1
|
@@ -30,17 +30,17 @@ function Calendar({ ref, className, classNames, hideNavigation, showOutsideDays
|
|
|
30
30
|
const _disabledClassName = classnames(calendar_module.disabled, props.disabledClassName);
|
|
31
31
|
const _hiddenClassName = classnames(calendar_module.hidden, props.hiddenClassName);
|
|
32
32
|
const Dropdown = useCallback(({ value, onChange, options })=>{
|
|
33
|
-
const selected =
|
|
33
|
+
const selected = options?.find((option)=>option.value === value);
|
|
34
34
|
const handleChange = (value)=>{
|
|
35
35
|
const changeEvent = {
|
|
36
36
|
target: {
|
|
37
37
|
value
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
onChange?.(changeEvent);
|
|
41
41
|
};
|
|
42
42
|
return /*#__PURE__*/ jsxs(Select.Root, {
|
|
43
|
-
value:
|
|
43
|
+
value: value?.toString(),
|
|
44
44
|
onValueChange: (value)=>{
|
|
45
45
|
handleChange(value);
|
|
46
46
|
},
|
|
@@ -53,7 +53,7 @@ function Calendar({ ref, className, classNames, hideNavigation, showOutsideDays
|
|
|
53
53
|
className: classnames(calendar_module["select-trigger"], props.selectTriggerClassName),
|
|
54
54
|
children: [
|
|
55
55
|
/*#__PURE__*/ jsx(Select.Value, {
|
|
56
|
-
children:
|
|
56
|
+
children: selected?.label
|
|
57
57
|
}),
|
|
58
58
|
/*#__PURE__*/ jsx(ChevronsUpDown, {
|
|
59
59
|
height: "18px",
|
|
@@ -70,9 +70,9 @@ function Calendar({ ref, className, classNames, hideNavigation, showOutsideDays
|
|
|
70
70
|
align: "center",
|
|
71
71
|
children: /*#__PURE__*/ jsx(ScrollArea, {
|
|
72
72
|
className: classnames(calendar_module["scroll-area"]),
|
|
73
|
-
children:
|
|
73
|
+
children: options?.map(({ value, label, disabled }, id)=>/*#__PURE__*/ jsx(Select.Item, {
|
|
74
74
|
className: calendar_module["select-item"],
|
|
75
|
-
value:
|
|
75
|
+
value: value?.toString(),
|
|
76
76
|
disabled: disabled,
|
|
77
77
|
children: label
|
|
78
78
|
}, `${value}-${id}`))
|
|
@@ -25,7 +25,7 @@ const CheckboxGroup = ({ groupName, checkBoxes, defaultValues, controlledValue,
|
|
|
25
25
|
if (-1 !== index) s.splice(index, 1);
|
|
26
26
|
}
|
|
27
27
|
setSelected(s);
|
|
28
|
-
|
|
28
|
+
onChange?.(s);
|
|
29
29
|
};
|
|
30
30
|
return /*#__PURE__*/ jsx("div", {
|
|
31
31
|
className: "space-y-2",
|
|
@@ -39,7 +39,7 @@ const checkbox_Checkbox = function({ ref, id, name, label, variant = 'outlined',
|
|
|
39
39
|
error ? /*#__PURE__*/ jsx(ErrorText, {
|
|
40
40
|
id: `error-for-${id}`,
|
|
41
41
|
text: errorText ?? helpText
|
|
42
|
-
}) :
|
|
42
|
+
}) : helpText?.length > 0 && /*#__PURE__*/ jsx(HelpText, {
|
|
43
43
|
text: helpText
|
|
44
44
|
})
|
|
45
45
|
]
|
|
@@ -9,7 +9,7 @@ function Error(props) {
|
|
|
9
9
|
function ServerError({ name, errors }) {
|
|
10
10
|
if (null != errors) {
|
|
11
11
|
const error = errors[name];
|
|
12
|
-
return
|
|
12
|
+
return error?._errors != null ? /*#__PURE__*/ jsx(Error, {
|
|
13
13
|
id: `error-for-${name}`,
|
|
14
14
|
children: error._errors.join(' ')
|
|
15
15
|
}) : null;
|
|
@@ -17,8 +17,7 @@ function ServerError({ name, errors }) {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
function FieldError({ name, errors }) {
|
|
20
|
-
|
|
21
|
-
const message = null == (_errors_name = errors[name]) ? void 0 : _errors_name.message;
|
|
20
|
+
const message = errors[name]?.message;
|
|
22
21
|
if (null != message) return /*#__PURE__*/ jsx(Error, {
|
|
23
22
|
id: `error-for-${name}`,
|
|
24
23
|
children: message
|
|
@@ -52,7 +52,7 @@ const Input = ({ ref, id, name, type = 'text', variant = 'outlined', inputSize =
|
|
|
52
52
|
error ? /*#__PURE__*/ jsx(ErrorText, {
|
|
53
53
|
id: `error-for-${id}`,
|
|
54
54
|
text: errorText ?? helpText
|
|
55
|
-
}) :
|
|
55
|
+
}) : helpText?.length > 0 && /*#__PURE__*/ jsx(HelpText, {
|
|
56
56
|
text: helpText
|
|
57
57
|
})
|
|
58
58
|
]
|
|
@@ -60,7 +60,7 @@ function select_Select({ id, children, placeholder, disabledValue, intent, varia
|
|
|
60
60
|
})
|
|
61
61
|
]
|
|
62
62
|
}),
|
|
63
|
-
null != helpText &&
|
|
63
|
+
null != helpText && helpText?.length > 0 && /*#__PURE__*/ jsx(HelpText, {
|
|
64
64
|
text: helpText
|
|
65
65
|
})
|
|
66
66
|
]
|
|
@@ -36,7 +36,7 @@ const text_area_TextArea = function({ ref, id, name, label, rows = 4, required =
|
|
|
36
36
|
error ? /*#__PURE__*/ jsx(ErrorText, {
|
|
37
37
|
id: `error-for-${id}`,
|
|
38
38
|
text: errorText ?? helpText
|
|
39
|
-
}) :
|
|
39
|
+
}) : helpText?.length > 0 && /*#__PURE__*/ jsx(HelpText, {
|
|
40
40
|
text: helpText
|
|
41
41
|
})
|
|
42
42
|
]
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
function hasErrors(name, clientErrors, serverErrors) {
|
|
2
|
-
return Boolean(
|
|
2
|
+
return Boolean(serverErrors?.[name] ?? clientErrors[name]);
|
|
3
3
|
}
|
|
4
4
|
function getErrorText(name, clientErrors, serverErrors) {
|
|
5
|
-
|
|
6
|
-
const message = null == (_clientErrors_name = clientErrors[name]) ? void 0 : _clientErrors_name.message;
|
|
5
|
+
const message = clientErrors[name]?.message;
|
|
7
6
|
if (null != message) return message;
|
|
8
7
|
const error = null != serverErrors ? serverErrors[name] : void 0;
|
|
9
|
-
if (
|
|
8
|
+
if (error?._errors != null) return error._errors.join(' ');
|
|
10
9
|
}
|
|
11
10
|
export { getErrorText, hasErrors };
|
|
@@ -23,7 +23,7 @@ const BodyLock = ()=>{
|
|
|
23
23
|
if (null != appBar) appBar.classList.remove('app-bar-overlay-shown');
|
|
24
24
|
if (mediaMatch.matches) {
|
|
25
25
|
classList.remove('overlay-shown--desktop');
|
|
26
|
-
if (null != appBar) appBar.classList.remove('app-bar-overlay-shown app-bar-overlay-shown--desktop');
|
|
26
|
+
if (null != appBar) appBar.classList.remove('app-bar-overlay-shown', 'app-bar-overlay-shown--desktop');
|
|
27
27
|
} else {
|
|
28
28
|
classList.remove('overlay-shown--mobile');
|
|
29
29
|
if (null != appBar) appBar.classList.remove('app-bar-overlay-shown--mobile');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.9.
|
|
1
|
+
{"version":"5.9.3"}
|
package/dist/utils/findMatch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function findMatch(data, find, defaultValue) {
|
|
2
2
|
const founded = data.findIndex((el)=>el === find);
|
|
3
3
|
return founded >= 0 ? find : defaultValue;
|
|
4
4
|
}
|
|
5
|
-
const
|
|
6
|
-
export {
|
|
5
|
+
const utils_findMatch = findMatch;
|
|
6
|
+
export { utils_findMatch as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
export {
|
|
1
|
+
const isTouchDevice = ()=>'undefined' != typeof window && ('ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2
|
+
const utils_isTouchDevice = isTouchDevice;
|
|
3
|
+
export { utils_isTouchDevice as default };
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
const toKebabCase = (string)=>
|
|
2
|
-
var _this;
|
|
3
|
-
return null == (_this = string ?? '') ? void 0 : _this.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\s+/g, '-').toLowerCase();
|
|
4
|
-
};
|
|
1
|
+
const toKebabCase = (string)=>(string ?? '')?.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\s+/g, '-').toLowerCase();
|
|
5
2
|
export { toKebabCase };
|
|
@@ -25,7 +25,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
|
|
|
25
25
|
const inputRef = useRef(null);
|
|
26
26
|
const hasInitialized = useRef(false);
|
|
27
27
|
const handleClear = ()=>{
|
|
28
|
-
if (
|
|
28
|
+
if (inputRef?.current != null) inputRef.current.value = '';
|
|
29
29
|
setDate(null);
|
|
30
30
|
onDateChange(null);
|
|
31
31
|
onClear();
|
|
@@ -24,7 +24,7 @@ const Drawer = ({ id, isOpen, onDismiss, closeOnOverlayClick, children, width =
|
|
|
24
24
|
const handleOverlayDismiss = (e)=>{
|
|
25
25
|
e.stopPropagation();
|
|
26
26
|
e.preventDefault();
|
|
27
|
-
if (true === closeOnOverlayClick)
|
|
27
|
+
if (true === closeOnOverlayClick) onDismiss?.();
|
|
28
28
|
};
|
|
29
29
|
useEffect(()=>{
|
|
30
30
|
if (isOpen) addDrawer(id);
|
|
@@ -34,7 +34,7 @@ function Modal({ isOpen, onDismiss, closeOnOverlayClick, children, ...rest }) {
|
|
|
34
34
|
const handleOverlayDismiss = (e)=>{
|
|
35
35
|
e.stopPropagation();
|
|
36
36
|
e.preventDefault();
|
|
37
|
-
if (true === closeOnOverlayClick)
|
|
37
|
+
if (true === closeOnOverlayClick) onDismiss?.();
|
|
38
38
|
};
|
|
39
39
|
const portal = getPortalRoot();
|
|
40
40
|
if (false === portal) return null;
|
|
@@ -18,7 +18,7 @@ function Search({ variant, inputSize, inputClassName, intent, className, onClear
|
|
|
18
18
|
setSearch(null);
|
|
19
19
|
if (null != onClear) onClear();
|
|
20
20
|
else fallbackSearchHandler('');
|
|
21
|
-
if (
|
|
21
|
+
if (inputRef?.current != null) inputRef.current.value = '';
|
|
22
22
|
};
|
|
23
23
|
const handleKeyDown = (event)=>{
|
|
24
24
|
if ('Enter' === event.key) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@infonomic/uikit",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.15.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
|
|
8
8
|
"keywords": [
|
|
@@ -50,49 +50,49 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mantine/hooks": "^8.3.
|
|
53
|
+
"@mantine/hooks": "^8.3.6",
|
|
54
54
|
"@radix-ui/react-icons": "^1.3.2",
|
|
55
55
|
"@radix-ui/react-slot": "^1.2.3",
|
|
56
56
|
"classnames": "^2.5.1",
|
|
57
57
|
"date-fns": "^4.1.0",
|
|
58
58
|
"material-ripple-effects": "^2.0.1",
|
|
59
|
-
"motion": "^12.23.
|
|
59
|
+
"motion": "^12.23.24",
|
|
60
60
|
"npm-run-all": "^4.1.5",
|
|
61
61
|
"prism-react-renderer": "^2.4.1",
|
|
62
62
|
"radix-ui": "^1.4.3",
|
|
63
|
-
"react": "19.
|
|
64
|
-
"react-day-picker": "^9.
|
|
65
|
-
"react-dom": "19.
|
|
66
|
-
"zod": "^4.1.
|
|
63
|
+
"react": "19.2.0",
|
|
64
|
+
"react-day-picker": "^9.11.1",
|
|
65
|
+
"react-dom": "19.2.0",
|
|
66
|
+
"zod": "^4.1.12",
|
|
67
67
|
"zod-form-data": "^3.0.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@astrojs/check": "0.9.
|
|
71
|
-
"@astrojs/node": "9.
|
|
72
|
-
"@biomejs/biome": "2.2
|
|
73
|
-
"@rsbuild/plugin-react": "^1.4.
|
|
74
|
-
"@rslib/core": "^0.
|
|
75
|
-
"@storybook/addon-a11y": "^
|
|
76
|
-
"@storybook/addon-docs": "^
|
|
77
|
-
"@storybook/addon-links": "^
|
|
78
|
-
"@storybook/addon-themes": "^
|
|
79
|
-
"@storybook/react-vite": "^
|
|
70
|
+
"@astrojs/check": "0.9.5",
|
|
71
|
+
"@astrojs/node": "9.5.0",
|
|
72
|
+
"@biomejs/biome": "2.3.2",
|
|
73
|
+
"@rsbuild/plugin-react": "^1.4.1",
|
|
74
|
+
"@rslib/core": "^0.17.0",
|
|
75
|
+
"@storybook/addon-a11y": "^10.0.2",
|
|
76
|
+
"@storybook/addon-docs": "^10.0.2",
|
|
77
|
+
"@storybook/addon-links": "^10.0.2",
|
|
78
|
+
"@storybook/addon-themes": "^10.0.2",
|
|
79
|
+
"@storybook/react-vite": "^10.0.2",
|
|
80
80
|
"@types/lodash": "^4.17.20",
|
|
81
|
-
"@types/node": "^24.
|
|
82
|
-
"@types/react": "19.
|
|
83
|
-
"@types/react-dom": "19.
|
|
84
|
-
"@vitejs/plugin-react": "^5.0
|
|
85
|
-
"astro": "5.
|
|
81
|
+
"@types/node": "^24.9.2",
|
|
82
|
+
"@types/react": "19.2.2",
|
|
83
|
+
"@types/react-dom": "19.2.2",
|
|
84
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
85
|
+
"astro": "5.15.3",
|
|
86
86
|
"chokidar": "^4.0.3",
|
|
87
|
-
"eslint-plugin-storybook": "^
|
|
88
|
-
"lightningcss": "^1.30.
|
|
89
|
-
"lightningcss-cli": "^1.30.
|
|
90
|
-
"rimraf": "^6.0
|
|
91
|
-
"storybook": "^
|
|
92
|
-
"typescript": "5.9.
|
|
87
|
+
"eslint-plugin-storybook": "^10.0.2",
|
|
88
|
+
"lightningcss": "^1.30.2",
|
|
89
|
+
"lightningcss-cli": "^1.30.2",
|
|
90
|
+
"rimraf": "^6.1.0",
|
|
91
|
+
"storybook": "^10.0.2",
|
|
92
|
+
"typescript": "5.9.3",
|
|
93
93
|
"typescript-plugin-css-modules": "^5.2.0",
|
|
94
|
-
"vite": "^7.1.
|
|
95
|
-
"vitest": "^
|
|
94
|
+
"vite": "^7.1.12",
|
|
95
|
+
"vitest": "^4.0.6"
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public",
|
|
@@ -38,7 +38,7 @@ const BodyLock = (): null => {
|
|
|
38
38
|
if(appBar != null) appBar.classList.remove('app-bar-overlay-shown')
|
|
39
39
|
if (mediaMatch.matches) {
|
|
40
40
|
classList.remove('overlay-shown--desktop')
|
|
41
|
-
if (appBar != null) appBar.classList.remove('app-bar-overlay-shown app-bar-overlay-shown--desktop')
|
|
41
|
+
if (appBar != null) appBar.classList.remove('app-bar-overlay-shown', 'app-bar-overlay-shown--desktop')
|
|
42
42
|
} else {
|
|
43
43
|
classList.remove('overlay-shown--mobile')
|
|
44
44
|
if (appBar != null) appBar.classList.remove('app-bar-overlay-shown--mobile')
|