@pingux/astro 2.123.0-alpha.0 → 2.123.0-alpha.2

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 (37) hide show
  1. package/lib/cjs/components/DatePicker/DateField.js +2 -0
  2. package/lib/cjs/components/DatePicker/DatePicker.js +5 -1
  3. package/lib/cjs/components/FileInputField/FileInputField.js +3 -1
  4. package/lib/cjs/components/LinkSelectField/LinkSelectField.js +2 -0
  5. package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +0 -17
  6. package/lib/cjs/components/NumberField/NumberField.js +2 -0
  7. package/lib/cjs/components/RadioGroupField/RadioGroupField.js +4 -1
  8. package/lib/cjs/components/SliderField/SliderLabelContainer.js +4 -2
  9. package/lib/cjs/components/TextField/TextField.js +1 -3
  10. package/lib/cjs/hooks/useField/useField.d.ts +5 -3
  11. package/lib/cjs/hooks/useField/useField.js +3 -1
  12. package/lib/cjs/hooks/useSliderField/useSliderField.d.ts +4 -1
  13. package/lib/cjs/hooks/useSliderField/useSliderField.js +7 -2
  14. package/lib/cjs/types/TextAreaField.d.ts +3 -0
  15. package/lib/cjs/types/checkboxField.d.ts +3 -0
  16. package/lib/cjs/types/colorField.d.ts +5 -1
  17. package/lib/cjs/types/passwordField.d.ts +3 -1
  18. package/lib/cjs/types/radioField.d.ts +3 -0
  19. package/lib/cjs/types/radioGroupField.d.ts +2 -0
  20. package/lib/cjs/types/searchField.d.ts +5 -1
  21. package/lib/cjs/types/selectField.d.ts +2 -0
  22. package/lib/cjs/types/sliderField.d.ts +4 -0
  23. package/lib/cjs/types/switchField.d.ts +2 -0
  24. package/lib/cjs/utils/testUtils/universalFormSubmitTest.js +148 -93
  25. package/lib/components/DatePicker/DateField.js +2 -0
  26. package/lib/components/DatePicker/DatePicker.js +5 -1
  27. package/lib/components/FileInputField/FileInputField.js +3 -1
  28. package/lib/components/LinkSelectField/LinkSelectField.js +2 -0
  29. package/lib/components/MultivaluesField/MultivaluesField.test.js +0 -17
  30. package/lib/components/NumberField/NumberField.js +2 -0
  31. package/lib/components/RadioGroupField/RadioGroupField.js +4 -1
  32. package/lib/components/SliderField/SliderLabelContainer.js +4 -2
  33. package/lib/components/TextField/TextField.js +1 -3
  34. package/lib/hooks/useField/useField.js +3 -1
  35. package/lib/hooks/useSliderField/useSliderField.js +7 -2
  36. package/lib/utils/testUtils/universalFormSubmitTest.js +150 -95
  37. package/package.json +1 -1
@@ -295,6 +295,8 @@ DateField.propTypes = {
295
295
  hasFormatHelpText: _propTypes["default"].bool,
296
296
  /** Text rendered below the input. */
297
297
  helperText: _propTypes["default"].node,
298
+ /** Props object that is spread directly into the helphint element. */
299
+ helpHintProps: _propTypes["default"].shape({}),
298
300
  /** Whether the field is disabled. */
299
301
  isDisabled: _propTypes["default"].bool,
300
302
  /** Whether the overlay is currently open. */
@@ -44,6 +44,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
44
44
  var defaultValue = props.defaultValue,
45
45
  hasAutoFocus = props.hasAutoFocus,
46
46
  helperText = props.helperText,
47
+ helpHintProps = props.helpHintProps,
47
48
  isDefaultOpen = props.isDefaultOpen,
48
49
  isReadOnly = props.isReadOnly,
49
50
  maxValue = props.maxValue,
@@ -117,7 +118,8 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
117
118
  labelProps: labelProps,
118
119
  isOpen: state.isOpen,
119
120
  status: status,
120
- datePickerState: state
121
+ datePickerState: state,
122
+ helpHintProps: helpHintProps
121
123
  })), calendar, helperText && (0, _react2.jsx)(_index.FieldHelperText, {
122
124
  status: status
123
125
  }, helperText));
@@ -133,6 +135,8 @@ DatePicker.propTypes = {
133
135
  hasFormatHelpText: _propTypes["default"].bool,
134
136
  /** Text rendered below the input. */
135
137
  helperText: _propTypes["default"].string,
138
+ /** Props object that is spread directly into the helphint element. */
139
+ helpHintProps: _propTypes["default"].shape({}),
136
140
  /** The element's unique identifier. */
137
141
  id: _propTypes["default"].string,
138
142
  /**
@@ -318,7 +318,9 @@ FileInputField.propTypes = _objectSpread(_objectSpread(_objectSpread({
318
318
  * */
319
319
  onRemove: _propTypes["default"].func,
320
320
  /** These props will be spread to the field text component. */
321
- textProps: _propTypes["default"].shape({})
321
+ textProps: _propTypes["default"].shape({}),
322
+ /** Props object that is spread directly into the helphint element. */
323
+ helpHintProps: _propTypes["default"].shape({})
322
324
  }, _statusProp.statusPropTypes), _ariaAttributes.ariaAttributesBasePropTypes), _fieldAttributes.inputFieldAttributesBasePropTypes);
323
325
  FileInputField.defaultProps = _objectSpread({
324
326
  defaultButtonText: 'Select a file'
@@ -109,6 +109,8 @@ LinkSelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
109
109
  hasNoStatusIndicator: _propTypes["default"].bool,
110
110
  /** Text rendered below the input. */
111
111
  helperText: _propTypes["default"].node,
112
+ /** Props object that is spread directly into the helphint element. */
113
+ helpHintProps: _propTypes["default"].shape({}),
112
114
  /** If present this prop will cause a help hint to render in the label of the field. */
113
115
  hintText: _propTypes["default"].string,
114
116
  /** Sets the default open state of the menu. */
@@ -18,7 +18,6 @@ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-
18
18
  var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
19
19
  var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
20
20
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
21
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
22
21
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
23
22
  var _fill = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/fill"));
24
23
  var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
@@ -35,7 +34,6 @@ var _testWrapper = require("../../utils/testUtils/testWrapper");
35
34
  var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
36
35
  var _universalFormSubmitTest = require("../../utils/testUtils/universalFormSubmitTest");
37
36
  var _react2 = require("@emotion/react");
38
- var _excluded = ["key"];
39
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
40
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
39
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -1219,21 +1217,6 @@ test('renders duplicate groups for duplicate keys on items group ', function ()
1219
1217
  _userEvent["default"].click(input);
1220
1218
  expect(_testWrapper.screen.getAllByRole('group')).not.toHaveLength(2);
1221
1219
  });
1222
- test('renders with error without key on item groups ', function () {
1223
- var errorMessage = '';
1224
- try {
1225
- getSectionsComponent({
1226
- items: (0, _map["default"])(withSection).call(withSection, function (_ref8) {
1227
- var key = _ref8.key,
1228
- item = (0, _objectWithoutProperties2["default"])(_ref8, _excluded);
1229
- return item;
1230
- })
1231
- });
1232
- } catch (error) {
1233
- errorMessage = error.message;
1234
- }
1235
- expect(errorMessage).toMatch(/No key found for item/);
1236
- });
1237
1220
  test('onLoadMore and onLoadPrev callbacks are called', function () {
1238
1221
  (0, _testWrapper.render)((0, _react2.jsx)(ComponentOnPrevLoad, null));
1239
1222
  _userEvent["default"].tab();
@@ -184,6 +184,8 @@ NumberField.propTypes = _objectSpread(_objectSpread(_objectSpread({
184
184
  label: _propTypes["default"].node,
185
185
  /** Text rendered below the input. */
186
186
  helperText: _propTypes["default"].node,
187
+ /** Props object that is spread directly into the helphint element. */
188
+ helpHintProps: _propTypes["default"].shape({}),
187
189
  /** If present this prop will cause a help hint to render in the label of the field. */
188
190
  hintText: _propTypes["default"].string,
189
191
  /**
@@ -30,6 +30,7 @@ var RadioGroupField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
30
30
  isDisabled = props.isDisabled,
31
31
  isRequired = props.isRequired,
32
32
  hintText = props.hintText,
33
+ helpHintProps = props.helpHintProps,
33
34
  label = props.label,
34
35
  orientation = props.orientation,
35
36
  status = props.status;
@@ -56,7 +57,9 @@ var RadioGroupField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
56
57
  hintText: hintText,
57
58
  isRequired: isRequired,
58
59
  variant: "forms.label.radioGroup"
59
- }, labelProps), label), (0, _react2.jsx)(_.Box, {
60
+ }, labelProps, {
61
+ helpHintProps: helpHintProps
62
+ }), label), (0, _react2.jsx)(_.Box, {
60
63
  variant: "forms.radioGroupWrapper",
61
64
  isRow: orientation === _orientation["default"].HORIZONTAL,
62
65
  "aria-labelledby": helperText && helperTextId,
@@ -21,7 +21,8 @@ var SliderLabelContainer = /*#__PURE__*/(0, _react.forwardRef)(function (props,
21
21
  labelProps = props.labelProps,
22
22
  isDisplayValueHidden = props.isDisplayValueHidden,
23
23
  outputProps = props.outputProps,
24
- className = props.className;
24
+ className = props.className,
25
+ helpHintProps = props.helpHintProps;
25
26
  return (0, _react2.jsx)(_index.Box, {
26
27
  ref: ref,
27
28
  className: className,
@@ -33,7 +34,8 @@ var SliderLabelContainer = /*#__PURE__*/(0, _react.forwardRef)(function (props,
33
34
  }, (0, _react2.jsx)(_index.Label, (0, _extends2["default"])({}, labelProps, {
34
35
  sx: {
35
36
  mb: '0px'
36
- }
37
+ },
38
+ helpHintProps: helpHintProps
37
39
  }), label)), !isDisplayValueHidden && (0, _react2.jsx)(_index.Box, {
38
40
  className: className,
39
41
  variant: "slider.outputContainer"
@@ -31,7 +31,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
31
31
  var displayName = 'TextField';
32
32
  var TextField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
33
33
  var helperText = props.helperText,
34
- helpHintProps = props.helpHintProps,
35
34
  slots = props.slots,
36
35
  status = props.status;
37
36
  var _useField = (0, _hooks.useField)(props),
@@ -59,8 +58,7 @@ var TextField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
59
58
  ref: labelRef,
60
59
  sx: isLabelHigher ? {
61
60
  gridRow: '1/5'
62
- } : {},
63
- helpHintProps: helpHintProps
61
+ } : {}
64
62
  })), (0, _react2.jsx)(_.Box, (0, _extends2["default"])({
65
63
  variant: "forms.input.fieldControlWrapper"
66
64
  }, fieldControlWrapperProps), slots === null || slots === void 0 ? void 0 : slots.beforeInput, (0, _react2.jsx)(_.Input, (0, _extends2["default"])({
@@ -1,7 +1,7 @@
1
1
  import React, { Key } from 'react';
2
2
  import type { AriaLabelingProps, CollectionChildren, DOMProps } from '@react-types/shared';
3
3
  import { ThemeUICSSObject } from 'theme-ui';
4
- import { AriaRole, BoxProps, LabelModeProps, LabelProps, Status, ValidPositiveInteger } from '../../types';
4
+ import { AriaRole, BoxProps, HelpHintProps, LabelModeProps, LabelProps, Status, ValidPositiveInteger } from '../../types';
5
5
  /**
6
6
  * Generates the necessary props to be used in field components.
7
7
  * @param {{}} props Props for the field
@@ -63,6 +63,8 @@ export interface UseFieldProps<T> {
63
63
  /** Whether the element should receive focus on render. */
64
64
  hasAutoFocus?: boolean;
65
65
  hasNoStatusIndicator?: boolean;
66
+ /** Props object that is spread directly into the helphint element. */
67
+ helpHintProps?: HelpHintProps;
66
68
  /** Text rendered below the input. */
67
69
  helperText?: string;
68
70
  /** If present this prop will cause a help hint to render in the label of the field. */
@@ -1098,7 +1100,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
1098
1100
  labelMode?: LabelModeProps | undefined;
1099
1101
  requiredIndicator?: React.ReactNode;
1100
1102
  hintText: string | undefined;
1101
- helpHintProps?: import("../../types").HelpHintProps | undefined;
1103
+ helpHintProps: HelpHintProps | undefined;
1102
1104
  statusClasses?: {
1103
1105
  [className: string]: boolean;
1104
1106
  } | undefined;
@@ -1417,7 +1419,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
1417
1419
  labelMode?: LabelModeProps | undefined;
1418
1420
  requiredIndicator?: React.ReactNode;
1419
1421
  hintText: string | undefined;
1420
- helpHintProps?: import("../../types").HelpHintProps | undefined;
1422
+ helpHintProps: HelpHintProps | undefined;
1421
1423
  statusClasses?: {
1422
1424
  [className: string]: boolean;
1423
1425
  } | undefined;
@@ -26,7 +26,7 @@ var _labelModes = require("../../utils/devUtils/constants/labelModes");
26
26
  var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
27
27
  var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
28
28
  var _ = require("..");
29
- var _excluded = ["autocomplete", "autoComplete", "autoCorrect", "className", "containerProps", "controlProps", "defaultValue", "hasAutoFocus", "hasNoStatusIndicator", "hintText", "id", "isDefaultSelected", "isDisabled", "isIndeterminate", "isReadOnly", "isRequired", "isRestrictiveMultivalues", "label", "labelMode", "labelProps", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "role", "spellCheck", "status", "statusClasses", "type", "value", "wrapperProps"];
29
+ var _excluded = ["autocomplete", "autoComplete", "autoCorrect", "className", "containerProps", "controlProps", "defaultValue", "hasAutoFocus", "hasNoStatusIndicator", "helpHintProps", "hintText", "id", "isDefaultSelected", "isDisabled", "isIndeterminate", "isReadOnly", "isRequired", "isRestrictiveMultivalues", "label", "labelMode", "labelProps", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "role", "spellCheck", "status", "statusClasses", "type", "value", "wrapperProps"];
30
30
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
31
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
32
32
  /**
@@ -47,6 +47,7 @@ var useField = function useField(props) {
47
47
  defaultValue = props.defaultValue,
48
48
  hasAutoFocus = props.hasAutoFocus,
49
49
  hasNoStatusIndicator = props.hasNoStatusIndicator,
50
+ helpHintProps = props.helpHintProps,
50
51
  hintText = props.hintText,
51
52
  id = props.id,
52
53
  isDefaultSelected = props.isDefaultSelected,
@@ -200,6 +201,7 @@ var useField = function useField(props) {
200
201
  className: labelClasses,
201
202
  hintText: hintText,
202
203
  isRequired: isRequired,
204
+ helpHintProps: helpHintProps,
203
205
  mode: labelMode
204
206
  }, raLabelProps), labelProps);
205
207
  var fieldControlWrapperProps = _objectSpread({
@@ -245,7 +245,9 @@ declare const useSliderField: (props: UseSliderFieldProps) => {
245
245
  };
246
246
  labelContainerProps: {
247
247
  label: import("react").ReactNode;
248
- labelProps: import("react").LabelHTMLAttributes<HTMLLabelElement> & import("../..").LabelProps;
248
+ labelProps: import("react").LabelHTMLAttributes<HTMLLabelElement> & import("../..").LabelProps & {
249
+ hintText: string | undefined;
250
+ };
249
251
  isDisplayValueHidden: boolean;
250
252
  outputProps: import("react").OutputHTMLAttributes<HTMLOutputElement> & import("../..").TextProps & {
251
253
  as: string;
@@ -254,6 +256,7 @@ declare const useSliderField: (props: UseSliderFieldProps) => {
254
256
  isHorizontal: boolean;
255
257
  displayValue: any;
256
258
  isVertical: boolean;
259
+ helpHintProps: import("../..").HelpHintProps | undefined;
257
260
  className: string;
258
261
  };
259
262
  sliderActiveTrackProps: {
@@ -20,7 +20,7 @@ var _reactAria = require("react-aria");
20
20
  var _reactStately = require("react-stately");
21
21
  var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
22
22
  var _useStatusClasses7 = _interopRequireDefault(require("../useStatusClasses"));
23
- var _excluded = ["activeTrackProps", "autoFocus", "className", "defaultValue", "displayValue", "formatOptions", "helperTextProps", "isDisabled", "isDisplayValueHidden", "isMultiThumb", "label", "labelProps", "maxValue", "minValue", "name", "onBlur", "onChange", "onChangeEnd", "onFocus", "onFocusChange", "onKeyDown", "onKeyUp", "orientation", "outputProps", "size", "status", "step", "sx", "thumbProps", "trackProps", "trackRef", "value", "wrapperProps"];
23
+ var _excluded = ["activeTrackProps", "autoFocus", "className", "defaultValue", "displayValue", "formatOptions", "helperTextProps", "helpHintProps", "hintText", "isDisabled", "isDisplayValueHidden", "isMultiThumb", "label", "labelProps", "maxValue", "minValue", "name", "onBlur", "onChange", "onChangeEnd", "onFocus", "onFocusChange", "onKeyDown", "onKeyUp", "orientation", "outputProps", "size", "status", "step", "sx", "thumbProps", "trackProps", "trackRef", "value", "wrapperProps"];
24
24
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
25
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
26
26
  var getDefaultValue = function getDefaultValue(_ref) {
@@ -55,6 +55,8 @@ var useSliderField = function useSliderField(props) {
55
55
  displayValueProp = props.displayValue,
56
56
  formatOptions = props.formatOptions,
57
57
  helperTextProps = props.helperTextProps,
58
+ helpHintProps = props.helpHintProps,
59
+ hintText = props.hintText,
58
60
  isDisabled = props.isDisabled,
59
61
  _props$isDisplayValue = props.isDisplayValueHidden,
60
62
  isDisplayValueHidden = _props$isDisplayValue === void 0 ? false : _props$isDisplayValue,
@@ -174,7 +176,9 @@ var useSliderField = function useSliderField(props) {
174
176
  as: 'output',
175
177
  variant: 'label'
176
178
  });
177
- var mergedLabelProps = (0, _reactAria.mergeProps)(labelProps, raLabelProps);
179
+ var mergedLabelProps = (0, _reactAria.mergeProps)(labelProps, raLabelProps, {
180
+ hintText: hintText
181
+ });
178
182
  var labelContainerProps = {
179
183
  label: label,
180
184
  labelProps: mergedLabelProps,
@@ -183,6 +187,7 @@ var useSliderField = function useSliderField(props) {
183
187
  isHorizontal: isHorizontal,
184
188
  displayValue: displayValue,
185
189
  isVertical: isVertical,
190
+ helpHintProps: helpHintProps,
186
191
  className: labelContainerClassNames
187
192
  };
188
193
  var sliderActiveTrackProps = _objectSpread(_objectSpread({}, activeTrackProps), {}, {
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SharedFieldProps } from './shared/fieldProps';
3
3
  import { TestingAttributes } from './shared/test';
4
+ import { HelpHintProps } from './helpHint';
4
5
  import { ValidPositiveInteger } from './shared';
5
6
  export interface TextAreaFieldProps extends TestingAttributes, SharedFieldProps {
6
7
  /** Whether the textarea is unable to be resized. */
@@ -47,4 +48,6 @@ export interface TextAreaFieldProps extends TestingAttributes, SharedFieldProps
47
48
  id?: string;
48
49
  /** The name for the textarea element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea). */
49
50
  name?: string;
51
+ /** Props object that is spread directly into the helphint element. */
52
+ helpHintProps?: HelpHintProps;
50
53
  }
@@ -1,4 +1,5 @@
1
1
  import { UseFieldProps } from '../hooks/useField/useField';
2
+ import { HelpHintProps } from './helpHint';
2
3
  export interface CheckboxFieldProps extends Omit<UseFieldProps<HTMLInputElement>, 'onChange'> {
3
4
  /** Handler that is called when a key is pressed. */
4
5
  onKeyDown?: () => void;
@@ -8,4 +9,6 @@ export interface CheckboxFieldProps extends Omit<UseFieldProps<HTMLInputElement>
8
9
  onChange?: (isSelected: boolean) => void;
9
10
  /** props that are spread directly into the checkbox component */
10
11
  checkBoxProps?: object;
12
+ /** Props object that is spread directly into the helphint element. */
13
+ helpHintProps?: HelpHintProps;
11
14
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ControlProps } from '../hooks/useField/useField';
3
3
  import { TestingAttributes } from './shared/test';
4
4
  import { Alignment, Axis } from './shared';
5
- import { ButtonProps, LabelProps, Status } from '.';
5
+ import { ButtonProps, HelpHintProps, LabelProps, Status } from '.';
6
6
  export type RGBProps = {
7
7
  r: number;
8
8
  g: number;
@@ -27,6 +27,10 @@ export interface ColorFieldProps extends TestingAttributes {
27
27
  direction?: Axis;
28
28
  /** Text to display after the Color Field button. Useful for errors or other info. */
29
29
  helperText?: React.ReactNode;
30
+ /** Props object that is spread directly into the helphint element. */
31
+ helpHintProps?: HelpHintProps;
32
+ /** If present this prop will cause a help hint to render in the label of the field. */
33
+ hintText?: string;
30
34
  /** The content to display as the label. */
31
35
  label?: React.ReactNode;
32
36
  /** Pass a function to call every time the color is changed. [React Color onChange](https://casesandberg.github.io/react-color/#api-onChange)
@@ -2,7 +2,7 @@
2
2
  import { UseFieldProps } from '../hooks/useField/useField';
3
3
  import { TestingAttributes } from './shared/test';
4
4
  import { Status } from './item';
5
- import { Requirement, RequirementsListProps } from '.';
5
+ import { HelpHintProps, Requirement, RequirementsListProps } from '.';
6
6
  export interface PasswordFieldProps extends UseFieldProps<HTMLInputElement>, TestingAttributes {
7
7
  /** The rendered label for the field. */
8
8
  label?: string | React.ReactNode;
@@ -35,6 +35,8 @@ export interface PasswordFieldProps extends UseFieldProps<HTMLInputElement>, Tes
35
35
  isDisabled?: boolean;
36
36
  /** Whether the input can be selected, but not changed by the user. */
37
37
  isReadOnly?: boolean;
38
+ /** Props object that is spread directly into the helphint element. */
39
+ helpHintProps?: HelpHintProps;
38
40
  /** Whether the field is required. */
39
41
  isRequired?: boolean;
40
42
  /**
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { HelpHintProps } from './helpHint';
2
3
  import { Status } from './item';
3
4
  import { DOMAttributes } from './shared';
4
5
  export interface RadioFieldProps extends DOMAttributes {
@@ -12,6 +13,8 @@ export interface RadioFieldProps extends DOMAttributes {
12
13
  hasAutoFocus?: boolean;
13
14
  /** Text rendered below the input. */
14
15
  helperText?: ReactNode;
16
+ /** Props object that is spread directly into the helphint element. */
17
+ helpHintProps?: HelpHintProps;
15
18
  /** If present this prop will cause a help hint to render in the label of the field. */
16
19
  hintText?: string;
17
20
  /** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AriaRadioGroupProps } from 'react-aria';
3
3
  import { SharedFieldProps } from './shared/fieldProps';
4
+ import { HelpHintProps } from './helpHint';
4
5
  export interface RadioGroupFieldProps extends Omit<AriaRadioGroupProps, 'label'>, SharedFieldProps {
5
6
  className?: string;
6
7
  id?: string;
@@ -12,4 +13,5 @@ export interface RadioGroupFieldProps extends Omit<AriaRadioGroupProps, 'label'>
12
13
  defaultValue?: string;
13
14
  orientation?: 'horizontal' | 'vertical';
14
15
  onChange?: (value: string) => void;
16
+ helpHintProps?: HelpHintProps;
15
17
  }
@@ -2,7 +2,7 @@
2
2
  import { ThemeUICSSObject } from 'theme-ui';
3
3
  import { ControlProps } from '../hooks/useField/useField';
4
4
  import { StyleProps } from './shared';
5
- import { IconProps, IconTypeExtended, LabelProps } from '.';
5
+ import { HelpHintProps, IconProps, IconTypeExtended, LabelProps } from '.';
6
6
  export interface SearchFieldProps extends StyleProps {
7
7
  /**
8
8
  * @ignore
@@ -38,6 +38,10 @@ export interface SearchFieldProps extends StyleProps {
38
38
  id?: string;
39
39
  /** Whether the input is disabled. */
40
40
  isDisabled?: boolean;
41
+ /** Props object that is spread directly into the helphint element. */
42
+ helpHintProps?: HelpHintProps;
43
+ /** If present this prop will cause a help hint to render in the label of the field. */
44
+ hintText?: string;
41
45
  /** The content to display as the label. */
42
46
  label?: React.ReactNode;
43
47
  /** The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname). */
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { UseSelectFieldProps, UseSelectFieldReturnProps } from '../hooks/useSelectField/useSelectField';
3
3
  import { SharedFieldProps } from './shared/fieldProps';
4
+ import { HelpHintProps } from './helpHint';
4
5
  import { Status } from './item';
5
6
  import { StyleProps } from './shared';
6
7
  export interface SelectFieldProps<T> extends Omit<StyleProps, 'direction'>, UseSelectFieldProps<T> {
@@ -23,4 +24,5 @@ export interface SelectFieldBaseProps extends UseSelectFieldReturnProps<object>,
23
24
  defaultText?: string;
24
25
  selectProps?: Record<string, unknown>;
25
26
  isDisabled?: boolean;
27
+ helpHintProps?: HelpHintProps;
26
28
  }
@@ -4,6 +4,7 @@ import type { PressEvent } from '@react-types/shared';
4
4
  import { ThemeUICSSObject } from 'theme-ui';
5
5
  import { BoxProps } from './box';
6
6
  import { FieldHelperTextProps } from './fieldHelperText';
7
+ import { HelpHintProps } from './helpHint';
7
8
  import { InputProps } from './input';
8
9
  import { Status } from './item';
9
10
  import { LabelProps } from './label';
@@ -27,6 +28,7 @@ export interface SliderLabelContainerProps {
27
28
  displayValue?: ReactNode;
28
29
  label?: ReactNode;
29
30
  labelProps?: LabelProps;
31
+ helpHintProps?: HelpHintProps;
30
32
  isDisplayValueHidden?: boolean;
31
33
  outputProps?: TextProps;
32
34
  className?: string;
@@ -48,6 +50,8 @@ export interface SliderFieldProps {
48
50
  formatOptions?: Intl.NumberFormatOptions;
49
51
  helperText?: string;
50
52
  helperTextProps?: FieldHelperTextProps;
53
+ helpHintProps?: HelpHintProps;
54
+ hintText?: string;
51
55
  isDisabled?: boolean;
52
56
  isDisplayValueHidden?: boolean;
53
57
  isMultiThumb?: boolean;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ThemeUICSSObject } from 'theme-ui';
3
3
  import { ControlProps } from '../hooks/useField/useField';
4
+ import { HelpHintProps } from './helpHint';
4
5
  import { Status } from './item';
5
6
  import { LabelProps } from './label';
6
7
  import { DOMAttributes } from './shared';
@@ -28,4 +29,5 @@ export interface SwitchFieldProps extends DOMAttributes {
28
29
  onKeyDown?: () => void;
29
30
  onKeyUp?: () => void;
30
31
  sx?: ThemeUICSSObject;
32
+ helpHintProps?: HelpHintProps;
31
33
  }