@react-fabric/form 1.0.0-beta.60 → 1.0.0-beta.62

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.
Files changed (91) hide show
  1. package/dist/cjs/builder/FileField.js +10 -7
  2. package/dist/cjs/builder/components/AddSchemaFields.js +2 -1
  3. package/dist/cjs/builder/components/SchemaArrayForm.js +4 -4
  4. package/dist/cjs/builder/components/SchemaField.js +4 -4
  5. package/dist/cjs/form/Form.js +44 -22
  6. package/dist/cjs/hooks/useFileUploader.js +40 -28
  7. package/dist/cjs/hooks/useFormBuilder.js +10 -3
  8. package/dist/cjs/i18n/index.js +4 -4
  9. package/dist/cjs/input/ArrayInput.js +3 -3
  10. package/dist/cjs/input/AvatarInput.js +17 -12
  11. package/dist/cjs/input/Checkbox.js +2 -2
  12. package/dist/cjs/input/ColorInput.js +2 -2
  13. package/dist/cjs/input/File.js +1 -1
  14. package/dist/cjs/input/Hidden.js +1 -10
  15. package/dist/cjs/input/Password.js +1 -1
  16. package/dist/cjs/input/Radio.js +2 -2
  17. package/dist/cjs/input/RadioGroup.js +3 -1
  18. package/dist/cjs/input/Search.js +2 -3
  19. package/dist/cjs/internal/ErrorIcon.js +1 -1
  20. package/dist/cjs/internal/InputWrapper.js +3 -3
  21. package/dist/cjs/select/AutoComplete.js +1 -2
  22. package/dist/cjs/select/DualList.js +5 -5
  23. package/dist/cjs/select/List.js +8 -24
  24. package/dist/cjs/select/Select.js +9 -28
  25. package/dist/esm/builder/FileField.js +11 -8
  26. package/dist/esm/builder/components/AddSchemaFields.js +2 -1
  27. package/dist/esm/builder/components/SchemaArrayForm.js +5 -5
  28. package/dist/esm/builder/components/SchemaField.js +5 -5
  29. package/dist/esm/form/Form.js +44 -22
  30. package/dist/esm/hooks/useFileUploader.js +41 -29
  31. package/dist/esm/hooks/useFormBuilder.js +10 -3
  32. package/dist/esm/i18n/index.js +2 -2
  33. package/dist/esm/input/ArrayInput.js +4 -4
  34. package/dist/esm/input/AvatarInput.js +18 -13
  35. package/dist/esm/input/Checkbox.js +3 -3
  36. package/dist/esm/input/ColorInput.js +3 -3
  37. package/dist/esm/input/File.js +2 -2
  38. package/dist/esm/input/Hidden.js +2 -11
  39. package/dist/esm/input/Password.js +2 -2
  40. package/dist/esm/input/Radio.js +3 -3
  41. package/dist/esm/input/RadioGroup.js +3 -1
  42. package/dist/esm/input/Search.js +3 -4
  43. package/dist/esm/internal/ErrorIcon.js +2 -2
  44. package/dist/esm/internal/InputWrapper.js +4 -4
  45. package/dist/esm/select/AutoComplete.js +2 -3
  46. package/dist/esm/select/DualList.js +6 -6
  47. package/dist/esm/select/List.js +8 -24
  48. package/dist/esm/select/Select.js +10 -29
  49. package/dist/types/builder/FileField.d.ts +2 -1
  50. package/dist/types/form/Form.d.ts +11 -10
  51. package/dist/types/hooks/useFileUploader.d.ts +4 -2
  52. package/dist/types/hooks/useFormBuilder.d.ts +6 -0
  53. package/dist/types/input/AvatarInput.d.ts +2 -2
  54. package/dist/types/input/Hidden.d.ts +3 -11
  55. package/dist/types/input/RadioGroup.d.ts +5 -1
  56. package/dist/types/select/DualList.d.ts +5 -6
  57. package/dist/types/select/Options.d.ts +1 -1
  58. package/dist/types/types/index.d.ts +7 -8
  59. package/package.json +5 -5
  60. package/src/builder/FileField.tsx +8 -12
  61. package/src/builder/components/AddSchemaFields.tsx +2 -1
  62. package/src/builder/components/SchemaArrayForm.tsx +5 -11
  63. package/src/builder/components/SchemaField.tsx +4 -5
  64. package/src/form/Form.tsx +30 -24
  65. package/src/hooks/useFileUploader.ts +41 -29
  66. package/src/hooks/useFormBuilder.tsx +12 -4
  67. package/src/i18n/index.ts +2 -2
  68. package/src/input/ArrayInput.tsx +4 -10
  69. package/src/input/AvatarInput.tsx +16 -16
  70. package/src/input/Checkbox.tsx +6 -3
  71. package/src/input/ColorInput.tsx +3 -7
  72. package/src/input/File.tsx +2 -2
  73. package/src/input/Hidden.tsx +4 -22
  74. package/src/input/Password.tsx +4 -2
  75. package/src/input/Radio.tsx +3 -3
  76. package/src/input/RadioGroup.tsx +6 -0
  77. package/src/input/Search.tsx +3 -3
  78. package/src/internal/ErrorIcon.tsx +2 -2
  79. package/src/internal/InputWrapper.tsx +8 -4
  80. package/src/select/AutoComplete.tsx +2 -3
  81. package/src/select/DualList.tsx +15 -12
  82. package/src/select/List.tsx +3 -3
  83. package/src/select/Options.tsx +1 -1
  84. package/src/select/Select.tsx +7 -8
  85. package/src/types/index.ts +8 -7
  86. /package/dist/cjs/i18n/{ar.json.js → ar/form.json.js} +0 -0
  87. /package/dist/cjs/i18n/{en.json.js → en/form.json.js} +0 -0
  88. /package/dist/esm/i18n/{ar.json.js → ar/form.json.js} +0 -0
  89. /package/dist/esm/i18n/{en.json.js → en/form.json.js} +0 -0
  90. /package/src/i18n/{ar.json → ar/form.json} +0 -0
  91. /package/src/i18n/{en.json → en/form.json} +0 -0
@@ -6,7 +6,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
7
  import _regeneratorRuntime from '@babel/runtime/regenerator';
8
8
  import { isString, uuid, isObject, isArray } from '@react-fabric/utilities';
9
- import { useReducer, useCallback } from 'react';
9
+ import { useReducer, useEffect, useCallback } from 'react';
10
10
 
11
11
  var _excluded = ["progress", "abort"],
12
12
  _excluded2 = ["file", "progress", "abort"];
@@ -29,7 +29,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
29
29
  * ```
30
30
  */
31
31
  var useFileUploader = function useFileUploader(uploader, initialList) {
32
- var multiple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
32
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
33
+ _ref$multiple = _ref.multiple,
34
+ multiple = _ref$multiple === void 0 ? true : _ref$multiple,
35
+ onChange = _ref.onChange;
33
36
  var _useReducer = useReducer(function (state, action) {
34
37
  if (action.type === "start") {
35
38
  if (!multiple) state.files.clear();
@@ -76,40 +79,26 @@ var useFileUploader = function useFileUploader(uploader, initialList) {
76
79
  if (action.type === "remove") {
77
80
  state.files["delete"](action.key);
78
81
  }
79
- state.list = Array.from(state.files.values()).map(function (file) {
80
- return !file.progress && !file.error && {
81
- key: file.key,
82
- path: file.path,
83
- mime: file.mime,
84
- size: file.size,
85
- uploaded: file.uploaded,
86
- filename: file.filename
87
- };
88
- }).filter(Boolean);
89
- return _objectSpread({}, state);
90
- }, {
91
- files: new Map(),
92
- count: 0
93
- }, function (state) {
94
- if (initialList) {
95
- if (isString(initialList)) {
82
+ if (action.type === "init") {
83
+ state.files = new Map();
84
+ if (isString(action.initialList)) {
96
85
  var key = uuid();
97
86
  state.files.set(key, {
98
87
  key: key,
99
- path: initialList,
88
+ path: action.initialList,
100
89
  filename: "",
101
90
  size: 0,
102
91
  mime: ""
103
92
  });
104
93
  }
105
- if (isObject(initialList)) {
94
+ if (isObject(action.initialList)) {
106
95
  var _key = uuid();
107
- state.files.set(_key, _objectSpread(_objectSpread({}, initialList), {}, {
96
+ state.files.set(_key, _objectSpread(_objectSpread({}, action.initialList), {}, {
108
97
  key: _key
109
98
  }));
110
99
  }
111
- if (isArray(initialList)) {
112
- initialList.forEach(function (file) {
100
+ if (isArray(action.initialList)) {
101
+ action.initialList.forEach(function (file) {
113
102
  var key = uuid();
114
103
  state.files.set(key, _objectSpread(_objectSpread({}, file), {}, {
115
104
  key: key
@@ -117,14 +106,38 @@ var useFileUploader = function useFileUploader(uploader, initialList) {
117
106
  });
118
107
  }
119
108
  }
120
- state.list = Array.from(state.files.values());
121
- return state;
109
+ state.list = Array.from(state.files.values()).map(function (file) {
110
+ return !file.progress && !file.error && {
111
+ key: file.key,
112
+ path: file.path,
113
+ mime: file.mime,
114
+ size: file.size,
115
+ uploaded: file.uploaded,
116
+ filename: file.filename
117
+ };
118
+ }).filter(Boolean);
119
+ if (action.type === "remove" || action.type === "stop") {
120
+ setTimeout(function () {
121
+ var _state$list$;
122
+ onChange === null || onChange === void 0 || onChange(multiple ? state.list : (_state$list$ = state.list[0]) !== null && _state$list$ !== void 0 ? _state$list$ : null);
123
+ }, 100);
124
+ }
125
+ return _objectSpread({}, state);
126
+ }, {
127
+ files: new Map(),
128
+ count: 0
122
129
  }),
123
130
  _useReducer2 = _slicedToArray(_useReducer, 2),
124
131
  state = _useReducer2[0],
125
132
  dispatch = _useReducer2[1];
133
+ useEffect(function () {
134
+ dispatch({
135
+ type: "init",
136
+ initialList: initialList
137
+ });
138
+ }, [initialList]);
126
139
  var doUpload = useCallback( /*#__PURE__*/function () {
127
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(key, file) {
140
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(key, file) {
128
141
  var data, _abort2;
129
142
  return _regeneratorRuntime.wrap(function _callee$(_context) {
130
143
  while (1) switch (_context.prev = _context.next) {
@@ -185,7 +198,7 @@ var useFileUploader = function useFileUploader(uploader, initialList) {
185
198
  }, _callee);
186
199
  }));
187
200
  return function (_x, _x2) {
188
- return _ref.apply(this, arguments);
201
+ return _ref2.apply(this, arguments);
189
202
  };
190
203
  }(), []);
191
204
  var upload = useCallback(function (files) {
@@ -212,7 +225,6 @@ var useFileUploader = function useFileUploader(uploader, initialList) {
212
225
  remove: remove,
213
226
  retry: retry,
214
227
  pending: state.count,
215
- list: state.list,
216
228
  files: Array.from(state.files.values())
217
229
  };
218
230
  };
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import { yupResolver } from '@hookform/resolvers/yup';
4
5
  import { EmptyContent } from '@react-fabric/core';
5
6
  import { yup, isNil, isEmpty } from '@react-fabric/utilities';
6
7
  import { useMemo, Fragment } from 'react';
@@ -100,9 +101,14 @@ var useFormBuilder = function useFormBuilder(schema) {
100
101
  return !!schm.id;
101
102
  })) !== null && _schema$filter !== void 0 ? _schema$filter : [];
102
103
  }, [schema]);
103
- var schemaDef = yup.object(Object.fromEntries(filteredSchema.map(function (field) {
104
- return [field.id, makeYupField(field)];
105
- })));
104
+ var schemaDef = useMemo(function () {
105
+ return yup.object(Object.fromEntries(filteredSchema.map(function (field) {
106
+ return [field.id, makeYupField(field)];
107
+ })));
108
+ }, [filteredSchema]);
109
+ var resolver = useMemo(function () {
110
+ return yupResolver(schemaDef);
111
+ }, [schemaDef]);
106
112
  var formDef = /*#__PURE__*/jsxs(Fragment, {
107
113
  children: [filteredSchema.map(function (field, idx) {
108
114
  return /*#__PURE__*/jsx("div", {
@@ -122,6 +128,7 @@ var useFormBuilder = function useFormBuilder(schema) {
122
128
  });
123
129
  return {
124
130
  formDef: formDef,
131
+ resolver: resolver,
125
132
  schemaDef: schemaDef
126
133
  };
127
134
  };
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { addTranslationBundle } from '@react-fabric/core';
4
- import ar from './ar.json.js';
5
- import en from './en.json.js';
4
+ import ar from './ar/form.json.js';
5
+ import en from './en/form.json.js';
6
6
 
7
7
  /*
8
8
  * React Fabric
@@ -5,7 +5,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
6
  import { DndContext } from '@dnd-kit/core';
7
7
  import { SortableContext, useSortable } from '@dnd-kit/sortable';
8
- import { Icon, CoreIcons, Tooltip, Button, cloneChildren } from '@react-fabric/core';
8
+ import { Icon, Tooltip, Button, cloneChildren } from '@react-fabric/core';
9
9
  import { isFalse, isString } from '@react-fabric/utilities';
10
10
  import classNames from 'classnames';
11
11
  import { useState, useEffect, useMemo, useCallback, useImperativeHandle, cloneElement } from 'react';
@@ -196,7 +196,7 @@ var ArrayInput = function ArrayInput(_ref) {
196
196
  },
197
197
  children: [/*#__PURE__*/jsx(Icon, _objectSpread(_objectSpread({
198
198
  className: isDragging ? "cursor-grabbing" : "cursor-grab",
199
- icon: CoreIcons.dragHandle
199
+ icon: "icon-[mdi--drag-vertical]"
200
200
  }, attributes), listeners)), children]
201
201
  });
202
202
  }
@@ -219,7 +219,7 @@ var ArrayInput = function ArrayInput(_ref) {
219
219
  children: /*#__PURE__*/jsx(Button, {
220
220
  size: "sm",
221
221
  "aria-label": "Add item",
222
- icon: CoreIcons.insert,
222
+ icon: "icon-[mdi--plus-circle-outline]",
223
223
  onClick: function onClick() {
224
224
  return handleAdd(onAdd === null || onAdd === void 0 ? void 0 : onAdd());
225
225
  },
@@ -260,7 +260,7 @@ var ArrayInput = function ArrayInput(_ref) {
260
260
  }));
261
261
  }), canRemove !== false && /*#__PURE__*/jsx(Button, {
262
262
  "aria-label": "Remove item",
263
- icon: CoreIcons.remove,
263
+ icon: "icon-[mdi--minus-circle-outline]",
264
264
  color: "danger",
265
265
  variant: "link",
266
266
  className: "self-end",
@@ -5,14 +5,14 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
6
6
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
7
7
  import _regeneratorRuntime from '@babel/runtime/regenerator';
8
- import { Avatar, Icon, CoreIcons, ProgressBar } from '@react-fabric/core';
8
+ import { Avatar, Icon, ProgressBar } from '@react-fabric/core';
9
+ import classNames from 'classnames';
9
10
  import { useState, useEffect } from 'react';
10
11
  import { useFileUploader } from '../hooks/useFileUploader.js';
11
12
  import { HiddenInput } from './Hidden.js';
12
- import classNames from 'classnames';
13
13
  import { jsxs, jsx } from 'react/jsx-runtime';
14
14
 
15
- var _excluded = ["size", "avatarName", "avatarClassName", "value", "rounded", "defaultValue", "fallbackIcon", "variant", "fileUrl", "uploadHandler"];
15
+ var _excluded = ["size", "avatarName", "avatarClassName", "value", "rounded", "defaultValue", "fallbackIcon", "variant", "fileUrl", "uploadHandler", "onChange"];
16
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
18
  /**
@@ -24,7 +24,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
24
24
  * @returns {JSX.Element} - The rendered AvatarInput component.
25
25
  */
26
26
  var AvatarInput = function AvatarInput(_ref) {
27
- var _list$;
27
+ var _files$2;
28
28
  var _ref$size = _ref.size,
29
29
  size = _ref$size === void 0 ? "6rem" : _ref$size,
30
30
  avatarName = _ref.avatarName,
@@ -36,6 +36,7 @@ var AvatarInput = function AvatarInput(_ref) {
36
36
  variant = _ref.variant,
37
37
  fileUrl = _ref.fileUrl,
38
38
  uploadHandler = _ref.uploadHandler,
39
+ _onChange = _ref.onChange,
39
40
  rest = _objectWithoutProperties(_ref, _excluded);
40
41
  var _useFileUploader = useFileUploader( /*#__PURE__*/function () {
41
42
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data, config) {
@@ -55,9 +56,14 @@ var AvatarInput = function AvatarInput(_ref) {
55
56
  return function (_x, _x2) {
56
57
  return _ref2.apply(this, arguments);
57
58
  };
58
- }(), value, false),
59
+ }(), value !== null && value !== void 0 ? value : defaultValue, {
60
+ multiple: false,
61
+ onChange: function onChange(files) {
62
+ var _files$path;
63
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange((_files$path = files === null || files === void 0 ? void 0 : files.path) !== null && _files$path !== void 0 ? _files$path : null);
64
+ }
65
+ }),
59
66
  files = _useFileUploader.files,
60
- list = _useFileUploader.list,
61
67
  upload = _useFileUploader.upload,
62
68
  remove = _useFileUploader.remove;
63
69
  var _useState = useState(""),
@@ -65,7 +71,7 @@ var AvatarInput = function AvatarInput(_ref) {
65
71
  base64 = _useState2[0],
66
72
  setBase64 = _useState2[1];
67
73
  useEffect(function () {
68
- if (list !== null && list !== void 0 && list.length) {
74
+ if (files !== null && files !== void 0 && files.length) {
69
75
  var _files$;
70
76
  var file = files === null || files === void 0 || (_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.file;
71
77
  void (file && new Response(file).blob().then(function (blob) {
@@ -82,14 +88,14 @@ var AvatarInput = function AvatarInput(_ref) {
82
88
  var _ref3, _fileUrl;
83
89
  setBase64((_ref3 = (_fileUrl = fileUrl === null || fileUrl === void 0 ? void 0 : fileUrl(defaultValue !== null && defaultValue !== void 0 ? defaultValue : "")) !== null && _fileUrl !== void 0 ? _fileUrl : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : "");
84
90
  }
85
- }, [files, list, defaultValue]);
91
+ }, [files, defaultValue]);
86
92
  useEffect(function () {
87
93
  var _fileUrl2, _fileUrl3;
88
94
  !value && defaultValue && setBase64((_fileUrl2 = fileUrl === null || fileUrl === void 0 ? void 0 : fileUrl(defaultValue)) !== null && _fileUrl2 !== void 0 ? _fileUrl2 : defaultValue);
89
95
  value && setBase64((_fileUrl3 = fileUrl === null || fileUrl === void 0 ? void 0 : fileUrl(value)) !== null && _fileUrl3 !== void 0 ? _fileUrl3 : value);
90
96
  }, [value, defaultValue]);
91
97
  return /*#__PURE__*/jsxs("div", {
92
- className: "flex flex-nowrap items-end overflow-hidden",
98
+ className: "flex flex-nowrap items-end overflow-hidden p-px",
93
99
  children: [/*#__PURE__*/jsxs("div", {
94
100
  className: classNames("inline-block leading-none relative outline overflow-hidden", rounded && "rounded-full", !rounded && "rounded"),
95
101
  children: [/*#__PURE__*/jsx(Avatar, {
@@ -114,8 +120,7 @@ var AvatarInput = function AvatarInput(_ref) {
114
120
  })]
115
121
  })]
116
122
  }), /*#__PURE__*/jsx(HiddenInput, _objectSpread({
117
- hiddenValue: list === null || list === void 0 || (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.path,
118
- defaultValue: defaultValue
123
+ value: files === null || files === void 0 || (_files$2 = files[0]) === null || _files$2 === void 0 ? void 0 : _files$2.path
119
124
  }, rest)), files.map(function (file, idx) {
120
125
  return /*#__PURE__*/jsxs("div", {
121
126
  className: "px-2 py-1 flex-1 overflow-hidden",
@@ -128,7 +133,7 @@ var AvatarInput = function AvatarInput(_ref) {
128
133
  children: file.error
129
134
  })
130
135
  }), file.progress && /*#__PURE__*/jsx(Icon, {
131
- icon: CoreIcons.stop,
136
+ icon: "icon-[mdi--stop]",
132
137
  bg: "danger",
133
138
  color: "white",
134
139
  size: "sm",
@@ -139,7 +144,7 @@ var AvatarInput = function AvatarInput(_ref) {
139
144
  return (_file$abort = file.abort) === null || _file$abort === void 0 ? void 0 : _file$abort.call(file);
140
145
  }
141
146
  }), !file.progress && /*#__PURE__*/jsx(Icon, {
142
- icon: CoreIcons.trash,
147
+ icon: "icon-[mdi--trash-can-outline]",
143
148
  color: "danger",
144
149
  size: "sm",
145
150
  className: "flex-content",
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
- import { CoreIcons, Icon } from '@react-fabric/core';
6
+ import { Icon } from '@react-fabric/core';
7
7
  import classNames from 'classnames';
8
8
  import { useState, useDeferredValue, useMemo, useEffect, useCallback } from 'react';
9
9
  import { ErrorIcon } from '../internal/ErrorIcon.js';
@@ -43,10 +43,10 @@ var Checkbox = function Checkbox(_ref) {
43
43
  var deferred = useDeferredValue(!!checked);
44
44
  var iconOn = useMemo(function () {
45
45
  var _ref2;
46
- return (_ref2 = iconChecked !== null && iconChecked !== void 0 ? iconChecked : icon) !== null && _ref2 !== void 0 ? _ref2 : CoreIcons.checkboxOn;
46
+ return (_ref2 = iconChecked !== null && iconChecked !== void 0 ? iconChecked : icon) !== null && _ref2 !== void 0 ? _ref2 : "icon-[mdi--checkbox-marked]";
47
47
  }, [icon, iconChecked]);
48
48
  var iconOff = useMemo(function () {
49
- return icon !== null && icon !== void 0 ? icon : CoreIcons.checkboxOff;
49
+ return icon !== null && icon !== void 0 ? icon : "icon-[mdi--checkbox-blank-outline]";
50
50
  }, [icon]);
51
51
  useEffect(function () {
52
52
  setActualValue(deferred);
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
6
  import { useFloating, autoUpdate, shift, flip, offset, arrow, useClick, useDismiss, useInteractions, FloatingArrow } from '@floating-ui/react';
7
- import { Icon, CoreIcons } from '@react-fabric/core';
7
+ import { Icon } from '@react-fabric/core';
8
8
  import { useState, useDeferredValue, useEffect, useCallback, startTransition, useRef } from 'react';
9
9
  import { InputWrapper } from '../internal/InputWrapper.js';
10
10
  import { ColorPicker } from './ColorPicker.js';
@@ -120,7 +120,7 @@ var ColorInput = function ColorInput(_ref) {
120
120
  children: !actualValue && /*#__PURE__*/jsx(Icon, {
121
121
  size: "md",
122
122
  className: "text-muted",
123
- icon: CoreIcons.colorSwatch
123
+ icon: "icon-[mdi--palette]"
124
124
  })
125
125
  })
126
126
  })), isOpen && /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
@@ -142,7 +142,7 @@ var ColorInput = function ColorInput(_ref) {
142
142
  })]
143
143
  })), !disabled && showPicker && /*#__PURE__*/jsx(Icon, {
144
144
  className: "flex-content p-1",
145
- icon: CoreIcons.colorPicker,
145
+ icon: "icon-[mdi--eyedropper]",
146
146
  onClick: function onClick() {
147
147
  return window.EyeDropper && new window.EyeDropper().open().then(function (resp) {
148
148
  return handleChange(resp.sRGBHex);
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
- import { Icon, CoreIcons } from '@react-fabric/core';
6
+ import { Icon } from '@react-fabric/core';
7
7
  import { isArray, mergeRefs, isEmpty, FileUtil, Format } from '@react-fabric/utilities';
8
8
  import classNames from 'classnames';
9
9
  import { useRef, useState, useDeferredValue, useEffect, useCallback, Fragment } from 'react';
@@ -132,7 +132,7 @@ var FileInput = function FileInput(_ref) {
132
132
  children: Format.bytes(file.size)
133
133
  }), /*#__PURE__*/jsx(Icon, {
134
134
  className: "cursor-pointer opacity-30 hover:opacity-80",
135
- icon: CoreIcons.close,
135
+ icon: "icon-[mdi--close]",
136
136
  onClick: function onClick() {
137
137
  removeFile(idx);
138
138
  }
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { useEffect, Fragment } from 'react';
3
+ import { Fragment } from 'react';
4
4
  import { ErrorIcon } from '../internal/ErrorIcon.js';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -36,23 +36,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
36
36
  * @returns {JSX.Element} The rendered hidden input field and error icon.
37
37
  */
38
38
  var HiddenInput = function HiddenInput(_ref) {
39
- var hiddenValue = _ref.hiddenValue,
40
- defaultValue = _ref.defaultValue,
41
- onChange = _ref.onChange,
42
- invalid = _ref.invalid,
39
+ var invalid = _ref.invalid,
43
40
  error = _ref.error,
44
41
  _ref$value = _ref.value,
45
42
  value = _ref$value === void 0 ? "" : _ref$value,
46
43
  name = _ref.name;
47
- useEffect(function () {
48
- setTimeout(function () {
49
- onChange === null || onChange === void 0 || onChange(hiddenValue !== null && hiddenValue !== void 0 ? hiddenValue : defaultValue);
50
- }, 50);
51
- }, [hiddenValue, defaultValue]);
52
44
  return /*#__PURE__*/jsxs(Fragment, {
53
45
  children: [/*#__PURE__*/jsx("input", {
54
46
  type: "hidden",
55
- onChange: onChange,
56
47
  value: value,
57
48
  name: name
58
49
  }), /*#__PURE__*/jsx(ErrorIcon, {
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
- import { Tooltip, Button, CoreIcons } from '@react-fabric/core';
6
+ import { Tooltip, Button } from '@react-fabric/core';
7
7
  import classNames from 'classnames';
8
8
  import { useState, useDeferredValue, useEffect, useCallback } from 'react';
9
9
  import { useTranslation } from 'react-i18next';
@@ -76,7 +76,7 @@ var Password = function Password(_ref) {
76
76
  color: "warning",
77
77
  variant: "link",
78
78
  "aria-label": t(show ? "password.hide" : "password.show"),
79
- icon: show ? CoreIcons.eyeOff : CoreIcons.eye,
79
+ icon: show ? "icon-[mdi--eye-off-outline]" : "icon-[mdi--eye-outline]",
80
80
  onClick: function onClick() {
81
81
  return setShow(!show);
82
82
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
- import { CoreIcons, Icon } from '@react-fabric/core';
5
+ import { Icon } from '@react-fabric/core';
6
6
  import classNames from 'classnames';
7
7
  import { useMemo, useCallback } from 'react';
8
8
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -34,10 +34,10 @@ var Radio = function Radio(_ref) {
34
34
  rest = _objectWithoutProperties(_ref, _excluded);
35
35
  var iconOn = useMemo(function () {
36
36
  var _ref2;
37
- return (_ref2 = iconChecked !== null && iconChecked !== void 0 ? iconChecked : icon) !== null && _ref2 !== void 0 ? _ref2 : CoreIcons.radioOn;
37
+ return (_ref2 = iconChecked !== null && iconChecked !== void 0 ? iconChecked : icon) !== null && _ref2 !== void 0 ? _ref2 : "icon-[mdi--radiobox-marked]";
38
38
  }, [icon, iconChecked]);
39
39
  var iconOff = useMemo(function () {
40
- return icon !== null && icon !== void 0 ? icon : CoreIcons.radioOff;
40
+ return icon !== null && icon !== void 0 ? icon : "icon-[mdi--radiobox-blank]";
41
41
  }, [icon]);
42
42
  var handleChange = useCallback(function (e) {
43
43
  // @ts-expect-error ignore
@@ -7,7 +7,7 @@ import { cloneElement } from 'react';
7
7
  import { FieldWrapper } from '../internal/FieldWrapper.js';
8
8
  import { jsx } from 'react/jsx-runtime';
9
9
 
10
- var _excluded = ["children", "name", "className", "optionWidth", "onChange"];
10
+ var _excluded = ["children", "name", "className", "optionWidth", "value", "onChange"];
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  /**
@@ -23,6 +23,7 @@ var RadioGroup = function RadioGroup(_ref) {
23
23
  name = _ref.name,
24
24
  className = _ref.className,
25
25
  optionWidth = _ref.optionWidth,
26
+ value = _ref.value,
26
27
  onChange = _ref.onChange,
27
28
  rest = _objectWithoutProperties(_ref, _excluded);
28
29
  return /*#__PURE__*/jsx(FieldWrapper, _objectSpread(_objectSpread({}, rest), {}, {
@@ -31,6 +32,7 @@ var RadioGroup = function RadioGroup(_ref) {
31
32
  children: cloneChildren(children, function (child) {
32
33
  return /*#__PURE__*/cloneElement(child, {
33
34
  name: name,
35
+ checked: child.props.value === value,
34
36
  onChange: onChange,
35
37
  width: optionWidth
36
38
  });
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
- import { useDebounce, Icon, CoreIcons, Button } from '@react-fabric/core';
6
+ import { useDebounce, Icon, Button } from '@react-fabric/core';
7
7
  import { useState, useDeferredValue, useRef, useEffect, useCallback, Fragment } from 'react';
8
8
  import { InputWrapper } from '../internal/InputWrapper.js';
9
9
  import { useHandleEnter } from '../utils/eventHandlers.js';
@@ -81,14 +81,13 @@ var Search = function Search(_ref) {
81
81
  actionButton: /*#__PURE__*/jsxs(Fragment, {
82
82
  children: [searching && /*#__PURE__*/jsx(Icon, {
83
83
  className: "p-2",
84
- icon: CoreIcons.spinner,
85
- animate: "spin"
84
+ icon: "icon-[svg-spinners--eclipse]"
86
85
  }), !searching && !hideHandle && /*#__PURE__*/jsx(Button, {
87
86
  tabIndex: -1,
88
87
  variant: "link",
89
88
  "aria-label": "search",
90
89
  disabled: !actualValue,
91
- icon: CoreIcons.search,
90
+ icon: "icon-[mdi--magnify]",
92
91
  onClick: handleSearch
93
92
  })]
94
93
  })
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import { Tooltip, Icon, CoreIcons } from '@react-fabric/core';
4
+ import { Tooltip, Icon } from '@react-fabric/core';
5
5
  import { isString } from '@react-fabric/utilities';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { jsx } from 'react/jsx-runtime';
@@ -24,7 +24,7 @@ var ErrorIcon = function ErrorIcon(_ref) {
24
24
  children: /*#__PURE__*/jsx(Icon, {
25
25
  className: "flex-content first:ms-2 self-center",
26
26
  color: "danger",
27
- icon: CoreIcons.alert
27
+ icon: "icon-[mdi--alert-circle-outline]"
28
28
  })
29
29
  });
30
30
  };
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
- import { Icon, CoreIcons } from '@react-fabric/core';
6
+ import { Icon } from '@react-fabric/core';
7
7
  import { isString } from '@react-fabric/utilities';
8
8
  import classNames from 'classnames';
9
9
  import { useRef, useState, useMemo, useCallback, useEffect } from 'react';
@@ -85,7 +85,7 @@ var InputWrapper = function InputWrapper(_ref) {
85
85
  invalid: invalid,
86
86
  error: error
87
87
  }), children, allowClear && showClear && /*#__PURE__*/jsx(Icon, {
88
- icon: CoreIcons.close,
88
+ icon: "icon-[mdi--close]",
89
89
  onClick: handleClear,
90
90
  className: classNames("text-tint-500 hover:text-tint-700 p-1 z-1 flex-content", "fabric-inputClear", textarea && "self-start mt-1 me-1")
91
91
  }), decorateEnd && /*#__PURE__*/jsx("div", {
@@ -100,14 +100,14 @@ var InputWrapper = function InputWrapper(_ref) {
100
100
  onClick: function onClick() {
101
101
  return setExpanded(!isExpanded);
102
102
  },
103
- icon: isExpanded ? CoreIcons.arrowCollapse : CoreIcons.arrowExpand,
103
+ icon: isExpanded ? "icon-[mdi--arrow-collapse]" : "icon-[mdi--arrow-expand]",
104
104
  className: "hidden group-hover:block absolute top-0 end-0 bg-base hover:bg-tint-200 p-1 opacity-65 rounded-capped"
105
105
  })]
106
106
  });
107
107
  return /*#__PURE__*/jsx(Wrapper, _objectSpread(_objectSpread({}, wrapperProps), {}, {
108
108
  children: /*#__PURE__*/jsx("div", {
109
109
  ref: elRef,
110
- className: classNames("relative min-h-8 flex flex-col flex-nowrap", width ? "flex-auto" : "flex-1"),
110
+ className: classNames("relative min-h-8 flex flex-col flex-nowrap", width ? "flex-content" : "flex-1"),
111
111
  style: {
112
112
  width: width,
113
113
  flexBasis: width
@@ -3,7 +3,7 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import { useFloating, autoUpdate, shift, flip, offset, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
6
- import { Chip, Icon, CoreIcons } from '@react-fabric/core';
6
+ import { Chip, Icon } from '@react-fabric/core';
7
7
  import { isArray, isEmpty } from '@react-fabric/utilities';
8
8
  import classNames from 'classnames';
9
9
  import { useRef, useId, useMemo, useCallback, useLayoutEffect } from 'react';
@@ -243,9 +243,8 @@ var AutoComplete = function AutoComplete(_ref) {
243
243
  className: "opacity-0 absolute"
244
244
  })]
245
245
  }), state.loading && /*#__PURE__*/jsx(Icon, {
246
- animate: "spin",
247
246
  className: classNames("flex-content p-2 z-0 order-9 text-muted pointer-events-none"),
248
- icon: CoreIcons.spinner
247
+ icon: "icon-[svg-spinners--eclipse]"
249
248
  }), state.open && !state.loading && /*#__PURE__*/jsx(FloatingPortal, {
250
249
  children: /*#__PURE__*/jsx(FloatingFocusManager, {
251
250
  context: context,
@@ -6,7 +6,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
6
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
7
7
  import { useDraggable, useDroppable, DndContext, DragOverlay } from '@dnd-kit/core';
8
8
  import { restrictToHorizontalAxis } from '@dnd-kit/modifiers';
9
- import { ButtonGroup, Button, CoreIcons } from '@react-fabric/core';
9
+ import { ButtonGroup, Button } from '@react-fabric/core';
10
10
  import { mergeRefs } from '@react-fabric/utilities';
11
11
  import { useState, useDeferredValue, useEffect, useMemo, useCallback } from 'react';
12
12
  import { Field } from '../input/Field.js';
@@ -38,7 +38,7 @@ var DualList = function DualList(_ref) {
38
38
  _ref$labelProperty = _ref.labelProperty,
39
39
  labelProperty = _ref$labelProperty === void 0 ? "label" : _ref$labelProperty,
40
40
  _ref$valueProperty = _ref.valueProperty,
41
- valueProperty = _ref$valueProperty === void 0 ? "id" : _ref$valueProperty,
41
+ valueProperty = _ref$valueProperty === void 0 ? "value" : _ref$valueProperty,
42
42
  renderer = _ref.renderer,
43
43
  onChange = _ref.onChange,
44
44
  name = _ref.name,
@@ -195,7 +195,7 @@ var DualList = function DualList(_ref) {
195
195
  "aria-label": "scroll to top",
196
196
  onClick: moveAllLeft,
197
197
  icon: {
198
- icon: CoreIcons.chevronsLeft,
198
+ icon: "icon-[mdi--chevron-double-left]",
199
199
  rtlFlip: true
200
200
  },
201
201
  disabled: !rightOptions.length
@@ -205,7 +205,7 @@ var DualList = function DualList(_ref) {
205
205
  "aria-label": "scroll up",
206
206
  onClick: moveRightSelected,
207
207
  icon: {
208
- icon: CoreIcons.chevronLeft,
208
+ icon: "icon-[mdi--chevron-left]",
209
209
  rtlFlip: true
210
210
  },
211
211
  disabled: !rightSelected.length
@@ -215,7 +215,7 @@ var DualList = function DualList(_ref) {
215
215
  "aria-label": "scroll down",
216
216
  onClick: moveLeftSelected,
217
217
  icon: {
218
- icon: CoreIcons.chevronRight,
218
+ icon: "icon-[mdi--chevron-right]",
219
219
  rtlFlip: true
220
220
  },
221
221
  disabled: !leftSelected.length
@@ -225,7 +225,7 @@ var DualList = function DualList(_ref) {
225
225
  "aria-label": "scroll to bottom",
226
226
  onClick: moveAllRight,
227
227
  icon: {
228
- icon: CoreIcons.chevronsRight,
228
+ icon: "icon-[mdi--chevron-double-right]",
229
229
  rtlFlip: true
230
230
  },
231
231
  disabled: !leftOptions.length