@react-fabric/form 1.0.0-beta.41 → 1.0.0-beta.43

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 (43) hide show
  1. package/css/_file.css +4 -3
  2. package/dist/cjs/input/ColorInput.js +7 -2
  3. package/dist/cjs/input/DateInput.js +7 -2
  4. package/dist/cjs/input/File.js +1 -1
  5. package/dist/cjs/input/Input.js +5 -1
  6. package/dist/cjs/input/Number.js +6 -2
  7. package/dist/cjs/input/Password.js +7 -3
  8. package/dist/cjs/input/Search.js +11 -9
  9. package/dist/cjs/input/Textarea.js +5 -1
  10. package/dist/cjs/internal/FieldWrapper.js +1 -1
  11. package/dist/cjs/internal/InputWrapper.js +7 -2
  12. package/dist/cjs/select/Select.js +1 -1
  13. package/dist/esm/input/ColorInput.js +7 -2
  14. package/dist/esm/input/DateInput.js +7 -2
  15. package/dist/esm/input/File.js +1 -1
  16. package/dist/esm/input/Input.js +5 -1
  17. package/dist/esm/input/Number.js +6 -2
  18. package/dist/esm/input/Password.js +7 -3
  19. package/dist/esm/input/Search.js +11 -9
  20. package/dist/esm/input/Textarea.js +5 -1
  21. package/dist/esm/internal/FieldWrapper.js +1 -1
  22. package/dist/esm/internal/InputWrapper.js +7 -2
  23. package/dist/esm/select/Select.js +1 -1
  24. package/dist/types/input/ColorInput.d.ts +1 -1
  25. package/dist/types/input/DateInput.d.ts +1 -1
  26. package/dist/types/input/Input.d.ts +1 -1
  27. package/dist/types/input/Number.d.ts +1 -1
  28. package/dist/types/input/Password.d.ts +1 -1
  29. package/dist/types/input/Search.d.ts +5 -1
  30. package/dist/types/input/Textarea.d.ts +1 -1
  31. package/dist/types/internal/InputWrapper.d.ts +1 -1
  32. package/package.json +5 -5
  33. package/src/input/ColorInput.tsx +6 -1
  34. package/src/input/DateInput.tsx +6 -1
  35. package/src/input/File.tsx +1 -1
  36. package/src/input/Input.tsx +4 -0
  37. package/src/input/Number.tsx +5 -1
  38. package/src/input/Password.tsx +8 -3
  39. package/src/input/Search.tsx +13 -8
  40. package/src/input/Textarea.tsx +4 -0
  41. package/src/internal/FieldWrapper.tsx +1 -1
  42. package/src/internal/InputWrapper.tsx +14 -2
  43. package/src/select/Select.tsx +1 -1
package/css/_file.css CHANGED
@@ -27,11 +27,12 @@
27
27
  cursor: pointer;
28
28
 
29
29
  padding-block: 0;
30
+ padding-inline: 4px;
30
31
 
31
- color: var(--text-white);
32
+ color: var(--color-white);
32
33
 
33
34
  opacity: 0.8;
34
- background-color: var(--bg-primary-500);
35
+ background-color: var(--color-primary-500);
35
36
  border: 0;
36
37
  border-radius: var(--rounded);
37
38
 
@@ -41,7 +42,7 @@
41
42
  }
42
43
 
43
44
  &[aria-invalid="true"]::-webkit-file-upload-button {
44
- background-color: var(--bg-danger-500);
45
+ background-color: var(--color-danger-500);
45
46
  }
46
47
 
47
48
  &:disabled::-webkit-file-upload-button {
@@ -11,7 +11,7 @@ var react = require('react');
11
11
  var ColorPicker = require('./ColorPicker.js');
12
12
  var jsxRuntime = require('react/jsx-runtime');
13
13
 
14
- var _excluded = ["ref", "required", "disabled", "allowClear", "invalid", "error", "value", "showPicker", "defaultColor", "decorateEnd", "decorateStart", "onChange", "noOutline"];
14
+ var _excluded = ["ref", "required", "disabled", "allowClear", "invalid", "error", "value", "showPicker", "defaultColor", "decorateEnd", "decorateStart", "onBlur", "onFocus", "onChange", "noOutline"];
15
15
  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; }
16
16
  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; }
17
17
  var ColorInput = function ColorInput(_ref) {
@@ -27,6 +27,8 @@ var ColorInput = function ColorInput(_ref) {
27
27
  defaultColor = _ref$defaultColor === void 0 ? "" : _ref$defaultColor,
28
28
  decorateEnd = _ref.decorateEnd,
29
29
  decorateStart = _ref.decorateStart,
30
+ onBlur = _ref.onBlur,
31
+ onFocus = _ref.onFocus,
30
32
  onChange = _ref.onChange,
31
33
  noOutline = _ref.noOutline,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -85,7 +87,10 @@ var ColorInput = function ColorInput(_ref) {
85
87
  "data-ref": "button",
86
88
  className: "flex-1 flex items-center",
87
89
  ref: refs.setReference
88
- }, getReferenceProps()), {}, {
90
+ }, getReferenceProps({
91
+ onBlur: onBlur,
92
+ onFocus: onFocus
93
+ })), {}, {
89
94
  "data-inner-clickable": "true",
90
95
  "data-dropdown-open": isOpen ? true : undefined,
91
96
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -12,7 +12,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
12
12
  var classNames = require('classnames');
13
13
  var jsxRuntime = require('react/jsx-runtime');
14
14
 
15
- var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onChange", "onEnterPressed", "format", "min", "max"];
15
+ var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onBlur", "onFocus", "onChange", "onEnterPressed", "format", "min", "max"];
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
  var DateInput = function DateInput(_ref) {
@@ -28,6 +28,8 @@ var DateInput = function DateInput(_ref) {
28
28
  error = _ref.error,
29
29
  _ref$type = _ref.type,
30
30
  type = _ref$type === void 0 ? "date" : _ref$type,
31
+ onBlur = _ref.onBlur,
32
+ onFocus = _ref.onFocus,
31
33
  onChange = _ref.onChange,
32
34
  onEnterPressed = _ref.onEnterPressed;
33
35
  _ref.format;
@@ -153,7 +155,10 @@ var DateInput = function DateInput(_ref) {
153
155
  autoFocus: autoFocus,
154
156
  value: inputValue,
155
157
  ref: utilities.mergeRefs(ref, refs.setReference)
156
- }, getReferenceProps()), {}, {
158
+ }, getReferenceProps({
159
+ onBlur: onBlur,
160
+ onFocus: onFocus
161
+ })), {}, {
157
162
  onChange: handleChange,
158
163
  onKeyDown: handleEnterPressed
159
164
  })), isOpen && /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
@@ -138,7 +138,7 @@ var FileInput = function FileInput(_ref) {
138
138
  })
139
139
  }, rest), {}, {
140
140
  children: /*#__PURE__*/jsxRuntime.jsx("input", {
141
- className: classNames("appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0", "fabric-fileInput", utilities.isArray(actualValue) && (actualValue === null || actualValue === void 0 ? void 0 : actualValue.length) && "text-(--fabric-bg)"),
141
+ className: classNames("appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer", "fabric-fileInput", utilities.isArray(actualValue) && (actualValue === null || actualValue === void 0 ? void 0 : actualValue.length) && "text-(--fabric-bg)"),
142
142
  "aria-invalid": invalid,
143
143
  "aria-disabled": disabled,
144
144
  "aria-readonly": readOnly,
@@ -9,7 +9,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
9
9
  require('@react-fabric/utilities');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
- var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Input = function Input(_ref) {
@@ -25,6 +25,8 @@ var Input = function Input(_ref) {
25
25
  error = _ref.error,
26
26
  _ref$type = _ref.type,
27
27
  type = _ref$type === void 0 ? "text" : _ref$type,
28
+ onBlur = _ref.onBlur,
29
+ onFocus = _ref.onFocus,
28
30
  onChange = _ref.onChange,
29
31
  onEnterPressed = _ref.onEnterPressed,
30
32
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -70,6 +72,8 @@ var Input = function Input(_ref) {
70
72
  autoComplete: "off",
71
73
  autoFocus: autoFocus,
72
74
  value: actualValue,
75
+ onBlur: onBlur,
76
+ onFocus: onFocus,
73
77
  onChange: handleChange,
74
78
  onKeyDown: handleEnterPressed
75
79
  })
@@ -9,7 +9,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
9
9
  require('@react-fabric/utilities');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
- var _excluded = ["ref", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "name", "min", "max", "step", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "name", "min", "max", "step", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Number = function Number(_ref) {
@@ -25,6 +25,8 @@ var Number = function Number(_ref) {
25
25
  min = _ref.min,
26
26
  max = _ref.max,
27
27
  step = _ref.step,
28
+ onBlur = _ref.onBlur,
29
+ onFocus = _ref.onFocus,
28
30
  onChange = _ref.onChange,
29
31
  onEnterPressed = _ref.onEnterPressed,
30
32
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -53,7 +55,7 @@ var Number = function Number(_ref) {
53
55
  required: required
54
56
  }, rest), {}, {
55
57
  children: /*#__PURE__*/jsxRuntime.jsx("input", {
56
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
58
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
57
59
  "aria-invalid": invalid,
58
60
  "aria-disabled": disabled,
59
61
  "aria-readonly": readOnly,
@@ -71,6 +73,8 @@ var Number = function Number(_ref) {
71
73
  autoComplete: "off",
72
74
  autoFocus: autoFocus,
73
75
  value: actualValue,
76
+ onBlur: onBlur,
77
+ onFocus: onFocus,
74
78
  onChange: handleChange,
75
79
  onKeyDown: handleEnterPressed
76
80
  })
@@ -12,7 +12,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
12
12
  require('@react-fabric/utilities');
13
13
  var jsxRuntime = require('react/jsx-runtime');
14
14
 
15
- var _excluded = ["ref", "value", "name", "strength", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "showToggle", "onChange", "onEnterPressed"];
15
+ var _excluded = ["ref", "value", "name", "strength", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "showToggle", "onBlur", "onFocus", "onChange", "onEnterPressed"];
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
  var Password = function Password(_ref) {
@@ -27,6 +27,8 @@ var Password = function Password(_ref) {
27
27
  placeholder = _ref.placeholder,
28
28
  autoFocus = _ref.autoFocus,
29
29
  showToggle = _ref.showToggle,
30
+ onBlur = _ref.onBlur,
31
+ onFocus = _ref.onFocus,
30
32
  onChange = _ref.onChange,
31
33
  onEnterPressed = _ref.onEnterPressed,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -60,7 +62,7 @@ var Password = function Password(_ref) {
60
62
  disabled: disabled,
61
63
  required: required
62
64
  }, rest), {}, {
63
- decorateEnd: showToggle && /*#__PURE__*/jsxRuntime.jsx(core.Tooltip, {
65
+ actionButton: showToggle && actualValue && /*#__PURE__*/jsxRuntime.jsx(core.Tooltip, {
64
66
  color: "warning",
65
67
  content: t(show ? "password.hide" : "password.show"),
66
68
  children: /*#__PURE__*/jsxRuntime.jsx(core.Button, {
@@ -75,7 +77,7 @@ var Password = function Password(_ref) {
75
77
  })
76
78
  }),
77
79
  children: [/*#__PURE__*/jsxRuntime.jsx("input", {
78
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
80
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
79
81
  "aria-invalid": invalid,
80
82
  "aria-disabled": disabled,
81
83
  "aria-readonly": readOnly,
@@ -90,6 +92,8 @@ var Password = function Password(_ref) {
90
92
  autoComplete: "off",
91
93
  autoFocus: autoFocus,
92
94
  value: actualValue,
95
+ onBlur: onBlur,
96
+ onFocus: onFocus,
93
97
  onChange: handleChange,
94
98
  onKeyDown: handleEnterPressed
95
99
  }), !!strength && /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -10,7 +10,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
10
10
  require('@react-fabric/utilities');
11
11
  var jsxRuntime = require('react/jsx-runtime');
12
12
 
13
- var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "searching", "placeholder", "autoFocus", "allowClear", "searchOnChange", "decorateEnd", "decorateStart", "onSearch", "onChange", "onEnterPressed"];
13
+ var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "searching", "placeholder", "autoFocus", "hideHandle", "allowClear", "searchOnChange", "onBlur", "onFocus", "onSearch", "onChange", "onEnterPressed"];
14
14
  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; }
15
15
  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; }
16
16
  var Search = function Search(_ref) {
@@ -24,12 +24,13 @@ var Search = function Search(_ref) {
24
24
  searching = _ref.searching,
25
25
  placeholder = _ref.placeholder,
26
26
  autoFocus = _ref.autoFocus,
27
+ hideHandle = _ref.hideHandle,
27
28
  _ref$allowClear = _ref.allowClear,
28
29
  allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
29
30
  _ref$searchOnChange = _ref.searchOnChange,
30
- searchOnChange = _ref$searchOnChange === void 0 ? true : _ref$searchOnChange,
31
- decorateEnd = _ref.decorateEnd,
32
- decorateStart = _ref.decorateStart,
31
+ searchOnChange = _ref$searchOnChange === void 0 ? false : _ref$searchOnChange,
32
+ onBlur = _ref.onBlur,
33
+ onFocus = _ref.onFocus,
33
34
  onSearch = _ref.onSearch,
34
35
  onChange = _ref.onChange;
35
36
  _ref.onEnterPressed;
@@ -68,13 +69,12 @@ var Search = function Search(_ref) {
68
69
  readOnly: readOnly,
69
70
  disabled: disabled,
70
71
  required: required,
71
- decorateStart: decorateStart,
72
- decorateEnd: /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
73
- children: [decorateEnd, searching && /*#__PURE__*/jsxRuntime.jsx(core.Icon, {
72
+ actionButton: /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
73
+ children: [searching && /*#__PURE__*/jsxRuntime.jsx(core.Icon, {
74
74
  className: "p-2",
75
75
  icon: core.CoreIcons.spinner,
76
76
  animate: "spin"
77
- }), !searching && /*#__PURE__*/jsxRuntime.jsx(core.Button, {
77
+ }), !searching && !hideHandle && /*#__PURE__*/jsxRuntime.jsx(core.Button, {
78
78
  tabIndex: -1,
79
79
  variant: "link",
80
80
  "aria-label": "search",
@@ -85,7 +85,7 @@ var Search = function Search(_ref) {
85
85
  })
86
86
  }, rest), {}, {
87
87
  children: /*#__PURE__*/jsxRuntime.jsx("input", {
88
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
88
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
89
89
  "aria-invalid": invalid,
90
90
  "aria-disabled": disabled,
91
91
  "aria-readonly": readOnly,
@@ -100,6 +100,8 @@ var Search = function Search(_ref) {
100
100
  autoComplete: "off",
101
101
  autoFocus: autoFocus,
102
102
  value: actualValue,
103
+ onBlur: onBlur,
104
+ onFocus: onFocus,
103
105
  onChange: handleChange,
104
106
  onKeyDown: handleEnterPressed
105
107
  })
@@ -9,7 +9,7 @@ var eventHandlers = require('../utils/eventHandlers.js');
9
9
  require('@react-fabric/utilities');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
 
12
- var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "rows", "maxRows", "variableRows", "expandable", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "rows", "maxRows", "variableRows", "expandable", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Textarea = function Textarea(_ref) {
@@ -28,6 +28,8 @@ var Textarea = function Textarea(_ref) {
28
28
  maxRows = _ref$maxRows === void 0 ? 12 : _ref$maxRows,
29
29
  variableRows = _ref.variableRows,
30
30
  expandable = _ref.expandable,
31
+ onBlur = _ref.onBlur,
32
+ onFocus = _ref.onFocus,
31
33
  onChange = _ref.onChange,
32
34
  onEnterPressed = _ref.onEnterPressed,
33
35
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -84,6 +86,8 @@ var Textarea = function Textarea(_ref) {
84
86
  autoComplete: "off",
85
87
  autoFocus: autoFocus,
86
88
  value: actualValue,
89
+ onBlur: onBlur,
90
+ onFocus: onFocus,
87
91
  onChange: handleChange,
88
92
  onKeyDown: eventHandlers.handleEnter(onEnterPressed, {
89
93
  preventDefault: !!onEnterPressed
@@ -47,7 +47,7 @@ var FieldWrapper = function FieldWrapper(_ref) {
47
47
  width: width,
48
48
  flexBasis: width
49
49
  },
50
- children: [!isInner && /*#__PURE__*/jsxRuntime.jsxs("div", {
50
+ children: [!isInner && label && /*#__PURE__*/jsxRuntime.jsxs("div", {
51
51
  className: "flex flex-nowrap flex-content items-end gap-1 py-0.5 px-2",
52
52
  style: {
53
53
  width: inline ? labelWidth : undefined
@@ -11,7 +11,7 @@ var jsxRuntime = require('react/jsx-runtime');
11
11
  var ErrorIcon = require('./ErrorIcon.js');
12
12
  var FieldWrapper = require('./FieldWrapper.js');
13
13
 
14
- var _excluded = ["invalid", "error", "allowClear", "showClear", "decorateStart", "decorateEnd", "decorateEndShowWhenEmpty", "decorateEndHideWhenEmpty", "children", "onClear", "noOutline", "noBorder", "textarea", "textareaExpandable", "data-inner", "data-open", "floatingExpand", "wrapperRef", "width"];
14
+ var _excluded = ["invalid", "error", "allowClear", "showClear", "decorateStart", "decorateEnd", "decorateEndShowWhenEmpty", "decorateEndHideWhenEmpty", "children", "onClear", "noOutline", "noBorder", "actionButton", "textarea", "textareaExpandable", "data-inner", "data-open", "floatingExpand", "wrapperRef", "width"];
15
15
  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; }
16
16
  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; }
17
17
  var InputWrapper = function InputWrapper(_ref) {
@@ -27,6 +27,7 @@ var InputWrapper = function InputWrapper(_ref) {
27
27
  onClear = _ref.onClear,
28
28
  noOutline = _ref.noOutline,
29
29
  noBorder = _ref.noBorder,
30
+ actionButton = _ref.actionButton,
30
31
  _ref$textarea = _ref.textarea,
31
32
  textarea = _ref$textarea === void 0 ? false : _ref$textarea,
32
33
  _ref$textareaExpandab = _ref.textareaExpandable,
@@ -68,7 +69,7 @@ var InputWrapper = function InputWrapper(_ref) {
68
69
  var el = /*#__PURE__*/jsxRuntime.jsxs("div", {
69
70
  role: "none",
70
71
  ref: wrapperRef,
71
- className: classNames("fabric-inputWrapper", invalid && "fabric-invalidWrapper", !noOutline && !noBorder && "bg-(--fabric-input) outline overflow-hidden", "flex flex-nowrap items-center flex-1", textarea ? "rounded-capped group" : "rounded", isExpanded ? "fixed inset-4 z-[99]" : floatingExpand ? "absolute inset-x-0" : "relative", !noOutline && "after:absolute after:bottom-0 after:h-px after:bg-primary-500 after:mx-auto"),
72
+ className: classNames("fabric-inputWrapper", invalid && "fabric-invalidWrapper", !noOutline && !noBorder && "bg-(--fabric-input) outline -outline-offset-1 overflow-hidden", "flex flex-nowrap items-center flex-1", textarea ? "rounded-capped group" : "rounded", isExpanded ? "fixed inset-4 z-[99]" : floatingExpand ? "absolute inset-x-0" : "relative", !noOutline && "after:absolute after:bottom-0 after:h-[2px] after:bg-primary-500 after:mx-auto"),
72
73
  onKeyDown: function onKeyDown(e) {
73
74
  return e.key === "Escape" && isExpanded && (setExpanded(false), e.stopPropagation());
74
75
  },
@@ -87,6 +88,10 @@ var InputWrapper = function InputWrapper(_ref) {
87
88
  onClickCapture: doFocus,
88
89
  className: classNames("fabric-decorate", "text-muted leading-none flex-content", utilities.isString(decorateEnd) && "px-1", decorateEndHideWhenEmpty && "peer-placeholder-shown:hidden", decorateEndShowWhenEmpty && "hidden peer-placeholder-shown:inline-block"),
89
90
  children: decorateEnd
91
+ }), actionButton && /*#__PURE__*/jsxRuntime.jsx("div", {
92
+ onClickCapture: doFocus,
93
+ className: classNames("fabric-decorate", "text-muted leading-none flex-content"),
94
+ children: actionButton
90
95
  }), textareaExpandable && /*#__PURE__*/jsxRuntime.jsx(core.Icon, {
91
96
  onClick: function onClick() {
92
97
  return setExpanded(!isExpanded);
@@ -242,7 +242,7 @@ var Select = function Select(_ref) {
242
242
  size: 1,
243
243
  ref: ref,
244
244
  autoFocus: autoFocus,
245
- className: classNames("appearance-none bg-transparent outline-none border-none ring-0 flex-1", disabled && "cursor-not-allowed pointer-events-none", multiple && "min-w-24"),
245
+ className: classNames("appearance-none bg-transparent outline-none border-none ring-0 flex-1 peer", disabled && "cursor-not-allowed pointer-events-none", multiple && "min-w-24"),
246
246
  placeholder: utilities.isEmpty(state.value) ? placeholder : "",
247
247
  onChange: function onChange(evt) {
248
248
  return handleQuery(evt.target.value);
@@ -11,7 +11,7 @@ import { useState, useDeferredValue, useEffect, useCallback, startTransition, us
11
11
  import { ColorPicker } from './ColorPicker.js';
12
12
  import { jsxs, jsx } from 'react/jsx-runtime';
13
13
 
14
- var _excluded = ["ref", "required", "disabled", "allowClear", "invalid", "error", "value", "showPicker", "defaultColor", "decorateEnd", "decorateStart", "onChange", "noOutline"];
14
+ var _excluded = ["ref", "required", "disabled", "allowClear", "invalid", "error", "value", "showPicker", "defaultColor", "decorateEnd", "decorateStart", "onBlur", "onFocus", "onChange", "noOutline"];
15
15
  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; }
16
16
  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; }
17
17
  var ColorInput = function ColorInput(_ref) {
@@ -27,6 +27,8 @@ var ColorInput = function ColorInput(_ref) {
27
27
  defaultColor = _ref$defaultColor === void 0 ? "" : _ref$defaultColor,
28
28
  decorateEnd = _ref.decorateEnd,
29
29
  decorateStart = _ref.decorateStart,
30
+ onBlur = _ref.onBlur,
31
+ onFocus = _ref.onFocus,
30
32
  onChange = _ref.onChange,
31
33
  noOutline = _ref.noOutline,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -85,7 +87,10 @@ var ColorInput = function ColorInput(_ref) {
85
87
  "data-ref": "button",
86
88
  className: "flex-1 flex items-center",
87
89
  ref: refs.setReference
88
- }, getReferenceProps()), {}, {
90
+ }, getReferenceProps({
91
+ onBlur: onBlur,
92
+ onFocus: onFocus
93
+ })), {}, {
89
94
  "data-inner-clickable": "true",
90
95
  "data-dropdown-open": isOpen ? true : undefined,
91
96
  children: /*#__PURE__*/jsx("div", {
@@ -12,7 +12,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
12
12
  import classNames from 'classnames';
13
13
  import { jsxs, jsx } from 'react/jsx-runtime';
14
14
 
15
- var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onChange", "onEnterPressed", "format", "min", "max"];
15
+ var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onBlur", "onFocus", "onChange", "onEnterPressed", "format", "min", "max"];
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
  var DateInput = function DateInput(_ref) {
@@ -28,6 +28,8 @@ var DateInput = function DateInput(_ref) {
28
28
  error = _ref.error,
29
29
  _ref$type = _ref.type,
30
30
  type = _ref$type === void 0 ? "date" : _ref$type,
31
+ onBlur = _ref.onBlur,
32
+ onFocus = _ref.onFocus,
31
33
  onChange = _ref.onChange,
32
34
  onEnterPressed = _ref.onEnterPressed;
33
35
  _ref.format;
@@ -153,7 +155,10 @@ var DateInput = function DateInput(_ref) {
153
155
  autoFocus: autoFocus,
154
156
  value: inputValue,
155
157
  ref: mergeRefs(ref, refs.setReference)
156
- }, getReferenceProps()), {}, {
158
+ }, getReferenceProps({
159
+ onBlur: onBlur,
160
+ onFocus: onFocus
161
+ })), {}, {
157
162
  onChange: handleChange,
158
163
  onKeyDown: handleEnterPressed
159
164
  })), isOpen && /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
@@ -138,7 +138,7 @@ var FileInput = function FileInput(_ref) {
138
138
  })
139
139
  }, rest), {}, {
140
140
  children: /*#__PURE__*/jsx("input", {
141
- className: classNames("appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0", "fabric-fileInput", isArray(actualValue) && (actualValue === null || actualValue === void 0 ? void 0 : actualValue.length) && "text-(--fabric-bg)"),
141
+ className: classNames("appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer", "fabric-fileInput", isArray(actualValue) && (actualValue === null || actualValue === void 0 ? void 0 : actualValue.length) && "text-(--fabric-bg)"),
142
142
  "aria-invalid": invalid,
143
143
  "aria-disabled": disabled,
144
144
  "aria-readonly": readOnly,
@@ -9,7 +9,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
9
9
  import '@react-fabric/utilities';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
 
12
- var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "name", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "error", "type", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Input = function Input(_ref) {
@@ -25,6 +25,8 @@ var Input = function Input(_ref) {
25
25
  error = _ref.error,
26
26
  _ref$type = _ref.type,
27
27
  type = _ref$type === void 0 ? "text" : _ref$type,
28
+ onBlur = _ref.onBlur,
29
+ onFocus = _ref.onFocus,
28
30
  onChange = _ref.onChange,
29
31
  onEnterPressed = _ref.onEnterPressed,
30
32
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -70,6 +72,8 @@ var Input = function Input(_ref) {
70
72
  autoComplete: "off",
71
73
  autoFocus: autoFocus,
72
74
  value: actualValue,
75
+ onBlur: onBlur,
76
+ onFocus: onFocus,
73
77
  onChange: handleChange,
74
78
  onKeyDown: handleEnterPressed
75
79
  })
@@ -9,7 +9,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
9
9
  import '@react-fabric/utilities';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
 
12
- var _excluded = ["ref", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "name", "min", "max", "step", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "value", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "name", "min", "max", "step", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Number = function Number(_ref) {
@@ -25,6 +25,8 @@ var Number = function Number(_ref) {
25
25
  min = _ref.min,
26
26
  max = _ref.max,
27
27
  step = _ref.step,
28
+ onBlur = _ref.onBlur,
29
+ onFocus = _ref.onFocus,
28
30
  onChange = _ref.onChange,
29
31
  onEnterPressed = _ref.onEnterPressed,
30
32
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -53,7 +55,7 @@ var Number = function Number(_ref) {
53
55
  required: required
54
56
  }, rest), {}, {
55
57
  children: /*#__PURE__*/jsx("input", {
56
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
58
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
57
59
  "aria-invalid": invalid,
58
60
  "aria-disabled": disabled,
59
61
  "aria-readonly": readOnly,
@@ -71,6 +73,8 @@ var Number = function Number(_ref) {
71
73
  autoComplete: "off",
72
74
  autoFocus: autoFocus,
73
75
  value: actualValue,
76
+ onBlur: onBlur,
77
+ onFocus: onFocus,
74
78
  onChange: handleChange,
75
79
  onKeyDown: handleEnterPressed
76
80
  })
@@ -12,7 +12,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
12
12
  import '@react-fabric/utilities';
13
13
  import { jsxs, jsx } from 'react/jsx-runtime';
14
14
 
15
- var _excluded = ["ref", "value", "name", "strength", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "showToggle", "onChange", "onEnterPressed"];
15
+ var _excluded = ["ref", "value", "name", "strength", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "showToggle", "onBlur", "onFocus", "onChange", "onEnterPressed"];
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
  var Password = function Password(_ref) {
@@ -27,6 +27,8 @@ var Password = function Password(_ref) {
27
27
  placeholder = _ref.placeholder,
28
28
  autoFocus = _ref.autoFocus,
29
29
  showToggle = _ref.showToggle,
30
+ onBlur = _ref.onBlur,
31
+ onFocus = _ref.onFocus,
30
32
  onChange = _ref.onChange,
31
33
  onEnterPressed = _ref.onEnterPressed,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -60,7 +62,7 @@ var Password = function Password(_ref) {
60
62
  disabled: disabled,
61
63
  required: required
62
64
  }, rest), {}, {
63
- decorateEnd: showToggle && /*#__PURE__*/jsx(Tooltip, {
65
+ actionButton: showToggle && actualValue && /*#__PURE__*/jsx(Tooltip, {
64
66
  color: "warning",
65
67
  content: t(show ? "password.hide" : "password.show"),
66
68
  children: /*#__PURE__*/jsx(Button, {
@@ -75,7 +77,7 @@ var Password = function Password(_ref) {
75
77
  })
76
78
  }),
77
79
  children: [/*#__PURE__*/jsx("input", {
78
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
80
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
79
81
  "aria-invalid": invalid,
80
82
  "aria-disabled": disabled,
81
83
  "aria-readonly": readOnly,
@@ -90,6 +92,8 @@ var Password = function Password(_ref) {
90
92
  autoComplete: "off",
91
93
  autoFocus: autoFocus,
92
94
  value: actualValue,
95
+ onBlur: onBlur,
96
+ onFocus: onFocus,
93
97
  onChange: handleChange,
94
98
  onKeyDown: handleEnterPressed
95
99
  }), !!strength && /*#__PURE__*/jsx("div", {
@@ -10,7 +10,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
10
10
  import '@react-fabric/utilities';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
12
12
 
13
- var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "searching", "placeholder", "autoFocus", "allowClear", "searchOnChange", "decorateEnd", "decorateStart", "onSearch", "onChange", "onEnterPressed"];
13
+ var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "searching", "placeholder", "autoFocus", "hideHandle", "allowClear", "searchOnChange", "onBlur", "onFocus", "onSearch", "onChange", "onEnterPressed"];
14
14
  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; }
15
15
  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; }
16
16
  var Search = function Search(_ref) {
@@ -24,12 +24,13 @@ var Search = function Search(_ref) {
24
24
  searching = _ref.searching,
25
25
  placeholder = _ref.placeholder,
26
26
  autoFocus = _ref.autoFocus,
27
+ hideHandle = _ref.hideHandle,
27
28
  _ref$allowClear = _ref.allowClear,
28
29
  allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
29
30
  _ref$searchOnChange = _ref.searchOnChange,
30
- searchOnChange = _ref$searchOnChange === void 0 ? true : _ref$searchOnChange,
31
- decorateEnd = _ref.decorateEnd,
32
- decorateStart = _ref.decorateStart,
31
+ searchOnChange = _ref$searchOnChange === void 0 ? false : _ref$searchOnChange,
32
+ onBlur = _ref.onBlur,
33
+ onFocus = _ref.onFocus,
33
34
  onSearch = _ref.onSearch,
34
35
  onChange = _ref.onChange;
35
36
  _ref.onEnterPressed;
@@ -68,13 +69,12 @@ var Search = function Search(_ref) {
68
69
  readOnly: readOnly,
69
70
  disabled: disabled,
70
71
  required: required,
71
- decorateStart: decorateStart,
72
- decorateEnd: /*#__PURE__*/jsxs(Fragment, {
73
- children: [decorateEnd, searching && /*#__PURE__*/jsx(Icon, {
72
+ actionButton: /*#__PURE__*/jsxs(Fragment, {
73
+ children: [searching && /*#__PURE__*/jsx(Icon, {
74
74
  className: "p-2",
75
75
  icon: CoreIcons.spinner,
76
76
  animate: "spin"
77
- }), !searching && /*#__PURE__*/jsx(Button, {
77
+ }), !searching && !hideHandle && /*#__PURE__*/jsx(Button, {
78
78
  tabIndex: -1,
79
79
  variant: "link",
80
80
  "aria-label": "search",
@@ -85,7 +85,7 @@ var Search = function Search(_ref) {
85
85
  })
86
86
  }, rest), {}, {
87
87
  children: /*#__PURE__*/jsx("input", {
88
- className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
88
+ className: "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
89
89
  "aria-invalid": invalid,
90
90
  "aria-disabled": disabled,
91
91
  "aria-readonly": readOnly,
@@ -100,6 +100,8 @@ var Search = function Search(_ref) {
100
100
  autoComplete: "off",
101
101
  autoFocus: autoFocus,
102
102
  value: actualValue,
103
+ onBlur: onBlur,
104
+ onFocus: onFocus,
103
105
  onChange: handleChange,
104
106
  onKeyDown: handleEnterPressed
105
107
  })
@@ -9,7 +9,7 @@ import { handleEnter } from '../utils/eventHandlers.js';
9
9
  import '@react-fabric/utilities';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
 
12
- var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "rows", "maxRows", "variableRows", "expandable", "onChange", "onEnterPressed"];
12
+ var _excluded = ["ref", "value", "name", "invalid", "readOnly", "disabled", "required", "placeholder", "autoFocus", "rows", "maxRows", "variableRows", "expandable", "onBlur", "onFocus", "onChange", "onEnterPressed"];
13
13
  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; }
14
14
  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; }
15
15
  var Textarea = function Textarea(_ref) {
@@ -28,6 +28,8 @@ var Textarea = function Textarea(_ref) {
28
28
  maxRows = _ref$maxRows === void 0 ? 12 : _ref$maxRows,
29
29
  variableRows = _ref.variableRows,
30
30
  expandable = _ref.expandable,
31
+ onBlur = _ref.onBlur,
32
+ onFocus = _ref.onFocus,
31
33
  onChange = _ref.onChange,
32
34
  onEnterPressed = _ref.onEnterPressed,
33
35
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -84,6 +86,8 @@ var Textarea = function Textarea(_ref) {
84
86
  autoComplete: "off",
85
87
  autoFocus: autoFocus,
86
88
  value: actualValue,
89
+ onBlur: onBlur,
90
+ onFocus: onFocus,
87
91
  onChange: handleChange,
88
92
  onKeyDown: handleEnter(onEnterPressed, {
89
93
  preventDefault: !!onEnterPressed
@@ -47,7 +47,7 @@ var FieldWrapper = function FieldWrapper(_ref) {
47
47
  width: width,
48
48
  flexBasis: width
49
49
  },
50
- children: [!isInner && /*#__PURE__*/jsxs("div", {
50
+ children: [!isInner && label && /*#__PURE__*/jsxs("div", {
51
51
  className: "flex flex-nowrap flex-content items-end gap-1 py-0.5 px-2",
52
52
  style: {
53
53
  width: inline ? labelWidth : undefined
@@ -11,7 +11,7 @@ import { Fragment, jsxs, jsx } from 'react/jsx-runtime';
11
11
  import { ErrorIcon } from './ErrorIcon.js';
12
12
  import { FieldWrapper } from './FieldWrapper.js';
13
13
 
14
- var _excluded = ["invalid", "error", "allowClear", "showClear", "decorateStart", "decorateEnd", "decorateEndShowWhenEmpty", "decorateEndHideWhenEmpty", "children", "onClear", "noOutline", "noBorder", "textarea", "textareaExpandable", "data-inner", "data-open", "floatingExpand", "wrapperRef", "width"];
14
+ var _excluded = ["invalid", "error", "allowClear", "showClear", "decorateStart", "decorateEnd", "decorateEndShowWhenEmpty", "decorateEndHideWhenEmpty", "children", "onClear", "noOutline", "noBorder", "actionButton", "textarea", "textareaExpandable", "data-inner", "data-open", "floatingExpand", "wrapperRef", "width"];
15
15
  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; }
16
16
  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; }
17
17
  var InputWrapper = function InputWrapper(_ref) {
@@ -27,6 +27,7 @@ var InputWrapper = function InputWrapper(_ref) {
27
27
  onClear = _ref.onClear,
28
28
  noOutline = _ref.noOutline,
29
29
  noBorder = _ref.noBorder,
30
+ actionButton = _ref.actionButton,
30
31
  _ref$textarea = _ref.textarea,
31
32
  textarea = _ref$textarea === void 0 ? false : _ref$textarea,
32
33
  _ref$textareaExpandab = _ref.textareaExpandable,
@@ -68,7 +69,7 @@ var InputWrapper = function InputWrapper(_ref) {
68
69
  var el = /*#__PURE__*/jsxs("div", {
69
70
  role: "none",
70
71
  ref: wrapperRef,
71
- className: classNames("fabric-inputWrapper", invalid && "fabric-invalidWrapper", !noOutline && !noBorder && "bg-(--fabric-input) outline overflow-hidden", "flex flex-nowrap items-center flex-1", textarea ? "rounded-capped group" : "rounded", isExpanded ? "fixed inset-4 z-[99]" : floatingExpand ? "absolute inset-x-0" : "relative", !noOutline && "after:absolute after:bottom-0 after:h-px after:bg-primary-500 after:mx-auto"),
72
+ className: classNames("fabric-inputWrapper", invalid && "fabric-invalidWrapper", !noOutline && !noBorder && "bg-(--fabric-input) outline -outline-offset-1 overflow-hidden", "flex flex-nowrap items-center flex-1", textarea ? "rounded-capped group" : "rounded", isExpanded ? "fixed inset-4 z-[99]" : floatingExpand ? "absolute inset-x-0" : "relative", !noOutline && "after:absolute after:bottom-0 after:h-[2px] after:bg-primary-500 after:mx-auto"),
72
73
  onKeyDown: function onKeyDown(e) {
73
74
  return e.key === "Escape" && isExpanded && (setExpanded(false), e.stopPropagation());
74
75
  },
@@ -87,6 +88,10 @@ var InputWrapper = function InputWrapper(_ref) {
87
88
  onClickCapture: doFocus,
88
89
  className: classNames("fabric-decorate", "text-muted leading-none flex-content", isString(decorateEnd) && "px-1", decorateEndHideWhenEmpty && "peer-placeholder-shown:hidden", decorateEndShowWhenEmpty && "hidden peer-placeholder-shown:inline-block"),
89
90
  children: decorateEnd
91
+ }), actionButton && /*#__PURE__*/jsx("div", {
92
+ onClickCapture: doFocus,
93
+ className: classNames("fabric-decorate", "text-muted leading-none flex-content"),
94
+ children: actionButton
90
95
  }), textareaExpandable && /*#__PURE__*/jsx(Icon, {
91
96
  onClick: function onClick() {
92
97
  return setExpanded(!isExpanded);
@@ -242,7 +242,7 @@ var Select = function Select(_ref) {
242
242
  size: 1,
243
243
  ref: ref,
244
244
  autoFocus: autoFocus,
245
- className: classNames("appearance-none bg-transparent outline-none border-none ring-0 flex-1", disabled && "cursor-not-allowed pointer-events-none", multiple && "min-w-24"),
245
+ className: classNames("appearance-none bg-transparent outline-none border-none ring-0 flex-1 peer", disabled && "cursor-not-allowed pointer-events-none", multiple && "min-w-24"),
246
246
  placeholder: isEmpty(state.value) ? placeholder : "",
247
247
  onChange: function onChange(evt) {
248
248
  return handleQuery(evt.target.value);
@@ -7,4 +7,4 @@ export interface ColorInputProps extends InputProps, Omit<ColorProps, "onChange"
7
7
  */
8
8
  showPicker?: boolean;
9
9
  }
10
- export declare const ColorInput: ({ ref, required, disabled, allowClear, invalid, error, value, showPicker, defaultColor, decorateEnd, decorateStart, onChange, noOutline, ...rest }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const ColorInput: ({ ref, required, disabled, allowClear, invalid, error, value, showPicker, defaultColor, decorateEnd, decorateStart, onBlur, onFocus, onChange, noOutline, ...rest }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -16,4 +16,4 @@ export interface DateProps extends InputProps<string>, RefProp<HTMLInputElement>
16
16
  */
17
17
  max?: DateLike;
18
18
  }
19
- export declare const DateInput: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, autoFocus, error, type, onChange, onEnterPressed, format, min, max, ...rest }: DateProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const DateInput: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, autoFocus, error, type, onBlur, onFocus, onChange, onEnterPressed, format, min, max, ...rest }: DateProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,4 +6,4 @@ export interface TextInputProps extends InputProps, RefProp<HTMLInputElement> {
6
6
  */
7
7
  type?: "email" | "file" | "search" | "tel" | "text" | "url";
8
8
  }
9
- export declare const Input: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, autoFocus, error, type, onChange, onEnterPressed, ...rest }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Input: ({ ref, name, value, invalid, readOnly, disabled, required, placeholder, autoFocus, error, type, onBlur, onFocus, onChange, onEnterPressed, ...rest }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -14,4 +14,4 @@ export interface NumberProps extends InputProps<number>, RefProp<HTMLInputElemen
14
14
  */
15
15
  step?: number;
16
16
  }
17
- export declare const Number: ({ ref, value, invalid, readOnly, disabled, required, placeholder, autoFocus, name, min, max, step, onChange, onEnterPressed, ...rest }: NumberProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const Number: ({ ref, value, invalid, readOnly, disabled, required, placeholder, autoFocus, name, min, max, step, onBlur, onFocus, onChange, onEnterPressed, ...rest }: NumberProps) => import("react/jsx-runtime").JSX.Element;
@@ -10,4 +10,4 @@ export interface PasswordProps extends InputProps, RefProp<HTMLInputElement> {
10
10
  */
11
11
  strength?: number;
12
12
  }
13
- export declare const Password: ({ ref, value, name, strength, invalid, readOnly, disabled, required, placeholder, autoFocus, showToggle, onChange, onEnterPressed, ...rest }: PasswordProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Password: ({ ref, value, name, strength, invalid, readOnly, disabled, required, placeholder, autoFocus, showToggle, onBlur, onFocus, onChange, onEnterPressed, ...rest }: PasswordProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,9 +9,13 @@ export interface SearchProps extends InputProps, RefProp<HTMLInputElement> {
9
9
  * search on value change
10
10
  */
11
11
  searchOnChange?: boolean;
12
+ /**
13
+ * hide search action handle
14
+ */
15
+ hideHandle?: boolean;
12
16
  /**
13
17
  * search handler
14
18
  */
15
19
  onSearch?: (query?: string) => void;
16
20
  }
17
- export declare const Search: ({ ref, value, name, invalid, readOnly, disabled, required, searching, placeholder, autoFocus, allowClear, searchOnChange, decorateEnd, decorateStart, onSearch, onChange, onEnterPressed, ...rest }: SearchProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const Search: ({ ref, value, name, invalid, readOnly, disabled, required, searching, placeholder, autoFocus, hideHandle, allowClear, searchOnChange, onBlur, onFocus, onSearch, onChange, onEnterPressed, ...rest }: SearchProps) => import("react/jsx-runtime").JSX.Element;
@@ -18,4 +18,4 @@ export interface TextareaProps extends InputProps, RefProp<HTMLTextAreaElement>
18
18
  */
19
19
  expandable?: boolean;
20
20
  }
21
- export declare const Textarea: ({ ref, value, name, invalid, readOnly, disabled, required, placeholder, autoFocus, rows, maxRows, variableRows, expandable, onChange, onEnterPressed, ...rest }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const Textarea: ({ ref, value, name, invalid, readOnly, disabled, required, placeholder, autoFocus, rows, maxRows, variableRows, expandable, onBlur, onFocus, onChange, onEnterPressed, ...rest }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const InputWrapper: ({ invalid, error, allowClear, showClear, decorateStart, decorateEnd, decorateEndShowWhenEmpty, decorateEndHideWhenEmpty, children, onClear, noOutline, noBorder, textarea, textareaExpandable, "data-inner": isInner, "data-open": isOpen, floatingExpand, wrapperRef, width, ...rest }: KeyValue) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const InputWrapper: ({ invalid, error, allowClear, showClear, decorateStart, decorateEnd, decorateEndShowWhenEmpty, decorateEndHideWhenEmpty, children, onClear, noOutline, noBorder, actionButton, textarea, textareaExpandable, "data-inner": isInner, "data-open": isOpen, floatingExpand, wrapperRef, width, ...rest }: KeyValue) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/form",
3
- "version": "1.0.0-beta.41",
3
+ "version": "1.0.0-beta.43",
4
4
  "description": "RUF: Form package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -41,9 +41,9 @@
41
41
  "@dnd-kit/utilities": "^3.2.2",
42
42
  "@floating-ui/react": "^0.26.24",
43
43
  "@hookform/resolvers": "^3.9.0",
44
- "@react-fabric/core": "^1.0.0-beta.41",
45
- "@react-fabric/date": "^1.0.0-beta.41",
46
- "@react-fabric/utilities": "^1.0.0-beta.41",
44
+ "@react-fabric/core": "^1.0.0-beta.43",
45
+ "@react-fabric/date": "^1.0.0-beta.43",
46
+ "@react-fabric/utilities": "^1.0.0-beta.43",
47
47
  "classnames": "^2.5.1",
48
48
  "color": "^4.2.3",
49
49
  "react-color": "^2.19.3",
@@ -63,5 +63,5 @@
63
63
  "node": ">=18.12.0",
64
64
  "npm": ">=8.19.0"
65
65
  },
66
- "gitHead": "bc737416d3c6a217a6b8c47291c3975a22722d80"
66
+ "gitHead": "92cd2fc5c71e3f0e00a9cff83ff924c51d7adb57"
67
67
  }
@@ -70,6 +70,8 @@ export const ColorInput = ({
70
70
  defaultColor = "",
71
71
  decorateEnd,
72
72
  decorateStart,
73
+ onBlur,
74
+ onFocus,
73
75
  onChange,
74
76
  // @ts-expect-error ignore
75
77
  noOutline,
@@ -144,7 +146,10 @@ export const ColorInput = ({
144
146
  data-ref="button"
145
147
  className="flex-1 flex items-center"
146
148
  ref={refs.setReference}
147
- {...getReferenceProps()}
149
+ {...getReferenceProps({
150
+ onBlur,
151
+ onFocus,
152
+ })}
148
153
  data-inner-clickable="true"
149
154
  data-dropdown-open={isOpen ? true : undefined}
150
155
  >
@@ -82,6 +82,8 @@ export const DateInput = ({
82
82
  autoFocus,
83
83
  error,
84
84
  type = "date",
85
+ onBlur,
86
+ onFocus,
85
87
  onChange,
86
88
  onEnterPressed,
87
89
  format = "dd/MM/yyyy",
@@ -213,7 +215,10 @@ export const DateInput = ({
213
215
  autoFocus={autoFocus}
214
216
  value={inputValue}
215
217
  ref={mergeRefs(ref, refs.setReference)}
216
- {...getReferenceProps()}
218
+ {...getReferenceProps({
219
+ onBlur,
220
+ onFocus,
221
+ })}
217
222
  onChange={handleChange}
218
223
  onKeyDown={handleEnterPressed}
219
224
  />
@@ -193,7 +193,7 @@ export const FileInput = ({
193
193
  >
194
194
  <input
195
195
  className={classNames(
196
- "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0",
196
+ "appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer",
197
197
  "fabric-fileInput",
198
198
  isArray(actualValue) && actualValue?.length && "text-(--fabric-bg)",
199
199
  )}
@@ -53,6 +53,8 @@ export const Input = ({
53
53
  autoFocus,
54
54
  error,
55
55
  type = "text",
56
+ onBlur,
57
+ onFocus,
56
58
  onChange,
57
59
  onEnterPressed,
58
60
  ...rest
@@ -106,6 +108,8 @@ export const Input = ({
106
108
  autoComplete="off"
107
109
  autoFocus={autoFocus}
108
110
  value={actualValue}
111
+ onBlur={onBlur}
112
+ onFocus={onFocus}
109
113
  onChange={handleChange}
110
114
  onKeyDown={handleEnterPressed}
111
115
  />
@@ -64,6 +64,8 @@ export const Number = ({
64
64
  min,
65
65
  max,
66
66
  step,
67
+ onBlur,
68
+ onFocus,
67
69
  onChange,
68
70
  onEnterPressed,
69
71
  ...rest
@@ -100,7 +102,7 @@ export const Number = ({
100
102
  {...rest}
101
103
  >
102
104
  <input
103
- className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0"
105
+ className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer"
104
106
  aria-invalid={invalid}
105
107
  aria-disabled={disabled}
106
108
  aria-readonly={readOnly}
@@ -118,6 +120,8 @@ export const Number = ({
118
120
  autoComplete="off"
119
121
  autoFocus={autoFocus}
120
122
  value={actualValue}
123
+ onBlur={onBlur}
124
+ onFocus={onFocus}
121
125
  onChange={handleChange}
122
126
  onKeyDown={handleEnterPressed}
123
127
  />
@@ -60,6 +60,8 @@ export const Password = ({
60
60
  placeholder,
61
61
  autoFocus,
62
62
  showToggle,
63
+ onBlur,
64
+ onFocus,
63
65
  onChange,
64
66
  onEnterPressed,
65
67
  ...rest
@@ -97,8 +99,9 @@ export const Password = ({
97
99
  disabled={disabled}
98
100
  required={required}
99
101
  {...rest}
100
- decorateEnd={
101
- showToggle && (
102
+ actionButton={
103
+ showToggle &&
104
+ actualValue && (
102
105
  <Tooltip
103
106
  color="warning"
104
107
  content={t(show ? "password.hide" : "password.show")}
@@ -116,7 +119,7 @@ export const Password = ({
116
119
  }
117
120
  >
118
121
  <input
119
- className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0"
122
+ className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer"
120
123
  aria-invalid={invalid}
121
124
  aria-disabled={disabled}
122
125
  aria-readonly={readOnly}
@@ -131,6 +134,8 @@ export const Password = ({
131
134
  autoComplete="off"
132
135
  autoFocus={autoFocus}
133
136
  value={actualValue}
137
+ onBlur={onBlur}
138
+ onFocus={onFocus}
134
139
  onChange={handleChange}
135
140
  onKeyDown={handleEnterPressed}
136
141
  />
@@ -46,6 +46,10 @@ export interface SearchProps extends InputProps, RefProp<HTMLInputElement> {
46
46
  * search on value change
47
47
  */
48
48
  searchOnChange?: boolean;
49
+ /**
50
+ * hide search action handle
51
+ */
52
+ hideHandle?: boolean;
49
53
  /**
50
54
  * search handler
51
55
  */
@@ -63,10 +67,11 @@ export const Search = ({
63
67
  searching,
64
68
  placeholder,
65
69
  autoFocus,
70
+ hideHandle,
66
71
  allowClear = true,
67
- searchOnChange = true,
68
- decorateEnd,
69
- decorateStart,
72
+ searchOnChange = false,
73
+ onBlur,
74
+ onFocus,
70
75
  onSearch,
71
76
  onChange,
72
77
  onEnterPressed,
@@ -115,14 +120,12 @@ export const Search = ({
115
120
  readOnly={readOnly}
116
121
  disabled={disabled}
117
122
  required={required}
118
- decorateStart={decorateStart}
119
- decorateEnd={
123
+ actionButton={
120
124
  <Fragment>
121
- {decorateEnd}
122
125
  {searching && (
123
126
  <Icon className="p-2" icon={CoreIcons.spinner} animate="spin" />
124
127
  )}
125
- {!searching && (
128
+ {!searching && !hideHandle && (
126
129
  <Button
127
130
  tabIndex={-1}
128
131
  variant="link"
@@ -137,7 +140,7 @@ export const Search = ({
137
140
  {...rest}
138
141
  >
139
142
  <input
140
- className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0"
143
+ className="appearance-none bg-transparent py-1 px-2 flex-1 border-none outline-none ring-0 peer"
141
144
  aria-invalid={invalid}
142
145
  aria-disabled={disabled}
143
146
  aria-readonly={readOnly}
@@ -152,6 +155,8 @@ export const Search = ({
152
155
  autoComplete="off"
153
156
  autoFocus={autoFocus}
154
157
  value={actualValue}
158
+ onBlur={onBlur}
159
+ onFocus={onFocus}
155
160
  onChange={handleChange}
156
161
  onKeyDown={handleEnterPressed}
157
162
  />
@@ -69,6 +69,8 @@ export const Textarea = ({
69
69
  maxRows = 12,
70
70
  variableRows,
71
71
  expandable,
72
+ onBlur,
73
+ onFocus,
72
74
  onChange,
73
75
  onEnterPressed,
74
76
  ...rest
@@ -128,6 +130,8 @@ export const Textarea = ({
128
130
  autoComplete="off"
129
131
  autoFocus={autoFocus}
130
132
  value={actualValue}
133
+ onBlur={onBlur}
134
+ onFocus={onFocus}
131
135
  onChange={handleChange}
132
136
  onKeyDown={handleEnter(onEnterPressed, {
133
137
  preventDefault: !!onEnterPressed,
@@ -47,7 +47,7 @@ export const FieldWrapper = ({
47
47
  data-ref="fieldWrapper"
48
48
  style={{ width, flexBasis: width }}
49
49
  >
50
- {!isInner && (
50
+ {!isInner && label && (
51
51
  <div
52
52
  className="flex flex-nowrap flex-content items-end gap-1 py-0.5 px-2"
53
53
  style={{ width: inline ? labelWidth : undefined }}
@@ -49,6 +49,7 @@ export const InputWrapper = ({
49
49
  onClear,
50
50
  noOutline,
51
51
  noBorder,
52
+ actionButton,
52
53
  textarea = false,
53
54
  textareaExpandable = false,
54
55
  "data-inner": isInner,
@@ -107,7 +108,7 @@ export const InputWrapper = ({
107
108
  invalid && "fabric-invalidWrapper",
108
109
  !noOutline &&
109
110
  !noBorder &&
110
- "bg-(--fabric-input) outline overflow-hidden",
111
+ "bg-(--fabric-input) outline -outline-offset-1 overflow-hidden",
111
112
  "flex flex-nowrap items-center flex-1",
112
113
  textarea ? "rounded-capped group" : "rounded",
113
114
  isExpanded
@@ -116,7 +117,7 @@ export const InputWrapper = ({
116
117
  ? "absolute inset-x-0"
117
118
  : "relative",
118
119
  !noOutline &&
119
- "after:absolute after:bottom-0 after:h-px after:bg-primary-500 after:mx-auto",
120
+ "after:absolute after:bottom-0 after:h-[2px] after:bg-primary-500 after:mx-auto",
120
121
  )}
121
122
  onKeyDown={(e) =>
122
123
  e.key === "Escape" &&
@@ -164,6 +165,17 @@ export const InputWrapper = ({
164
165
  {decorateEnd}
165
166
  </div>
166
167
  )}
168
+ {actionButton && (
169
+ <div
170
+ onClickCapture={doFocus}
171
+ className={classNames(
172
+ "fabric-decorate",
173
+ "text-muted leading-none flex-content",
174
+ )}
175
+ >
176
+ {actionButton}
177
+ </div>
178
+ )}
167
179
  {textareaExpandable && (
168
180
  <Icon
169
181
  onClick={() => setExpanded(!isExpanded)}
@@ -296,7 +296,7 @@ export const Select = <T extends AnyObject = string>({
296
296
  ref={ref}
297
297
  autoFocus={autoFocus}
298
298
  className={classNames(
299
- "appearance-none bg-transparent outline-none border-none ring-0 flex-1",
299
+ "appearance-none bg-transparent outline-none border-none ring-0 flex-1 peer",
300
300
  disabled && "cursor-not-allowed pointer-events-none",
301
301
  multiple && "min-w-24",
302
302
  )}