@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.
@@ -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 = null == options ? void 0 : options.find((option)=>option.value === value);
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
- null == onChange || onChange(changeEvent);
40
+ onChange?.(changeEvent);
41
41
  };
42
42
  return /*#__PURE__*/ jsxs(Select.Root, {
43
- value: null == value ? void 0 : value.toString(),
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: null == selected ? void 0 : selected.label
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: null == options ? void 0 : options.map(({ value, label, disabled }, id)=>/*#__PURE__*/ jsx(Select.Item, {
73
+ children: options?.map(({ value, label, disabled }, id)=>/*#__PURE__*/ jsx(Select.Item, {
74
74
  className: calendar_module["select-item"],
75
- value: null == value ? void 0 : value.toString(),
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
- null == onChange || onChange(s);
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
- }) : (null == helpText ? void 0 : helpText.length) > 0 && /*#__PURE__*/ jsx(HelpText, {
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 (null == error ? void 0 : error._errors) != null ? /*#__PURE__*/ jsx(Error, {
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
- var _errors_name;
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
- }) : (null == helpText ? void 0 : helpText.length) > 0 && /*#__PURE__*/ jsx(HelpText, {
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 && (null == helpText ? void 0 : helpText.length) > 0 && /*#__PURE__*/ jsx(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
- }) : (null == helpText ? void 0 : helpText.length) > 0 && /*#__PURE__*/ jsx(HelpText, {
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((null == serverErrors ? void 0 : serverErrors[name]) ?? clientErrors[name]);
2
+ return Boolean(serverErrors?.[name] ?? clientErrors[name]);
3
3
  }
4
4
  function getErrorText(name, clientErrors, serverErrors) {
5
- var _clientErrors_name;
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 ((null == error ? void 0 : error._errors) != null) return error._errors.join(' ');
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.2"}
1
+ {"version":"5.9.3"}
@@ -1,6 +1,6 @@
1
- function findMatch_findMatch(data, find, defaultValue) {
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 findMatch = findMatch_findMatch;
6
- export { findMatch as default };
5
+ const utils_findMatch = findMatch;
6
+ export { utils_findMatch as default };
@@ -1,3 +1,3 @@
1
- const isTouchDevice_isTouchDevice = ()=>'undefined' != typeof window && ('ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
2
- const isTouchDevice = isTouchDevice_isTouchDevice;
3
- export { isTouchDevice as default };
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 ((null == inputRef ? void 0 : inputRef.current) != null) inputRef.current.value = '';
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) null == onDismiss || onDismiss();
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) null == onDismiss || onDismiss();
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 ((null == inputRef ? void 0 : inputRef.current) != null) inputRef.current.value = '';
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.14.0",
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.1",
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.12",
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.1.1",
64
- "react-day-picker": "^9.10.0",
65
- "react-dom": "19.1.1",
66
- "zod": "^4.1.8",
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.4",
71
- "@astrojs/node": "9.4.3",
72
- "@biomejs/biome": "2.2.4",
73
- "@rsbuild/plugin-react": "^1.4.0",
74
- "@rslib/core": "^0.13.2",
75
- "@storybook/addon-a11y": "^9.1.6",
76
- "@storybook/addon-docs": "^9.1.6",
77
- "@storybook/addon-links": "^9.1.6",
78
- "@storybook/addon-themes": "^9.1.6",
79
- "@storybook/react-vite": "^9.1.6",
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.5.0",
82
- "@types/react": "19.1.13",
83
- "@types/react-dom": "19.1.9",
84
- "@vitejs/plugin-react": "^5.0.2",
85
- "astro": "5.13.7",
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": "^9.1.6",
88
- "lightningcss": "^1.30.1",
89
- "lightningcss-cli": "^1.30.1",
90
- "rimraf": "^6.0.1",
91
- "storybook": "^9.1.6",
92
- "typescript": "5.9.2",
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.5",
95
- "vitest": "^3.2.4"
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')