@algolia/satellite 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/cjs/AutoComplete/AutoComplete.d.ts +1 -1
  2. package/dist/cjs/AutoComplete/AutoComplete.js +49 -26
  3. package/dist/cjs/AutoComplete/AutoComplete.tailwind.js +9 -1
  4. package/dist/cjs/AutoComplete/types.d.ts +1 -0
  5. package/dist/cjs/Checkbox/Checkbox.d.ts +1 -1
  6. package/dist/cjs/Checkbox/Checkbox.js +21 -13
  7. package/dist/cjs/Checkbox/Checkbox.tailwind.js +8 -2
  8. package/dist/cjs/DatePicker/DatePicker/DatePicker.d.ts +4 -2
  9. package/dist/cjs/DatePicker/DatePicker/DatePicker.js +18 -7
  10. package/dist/cjs/DatePicker/components/Display.d.ts +3 -3
  11. package/dist/cjs/DatePicker/components/Display.js +16 -5
  12. package/dist/cjs/Dropzone/Dropzone.d.ts +4 -2
  13. package/dist/cjs/Dropzone/Dropzone.js +23 -12
  14. package/dist/cjs/Field/Field.d.ts +1 -0
  15. package/dist/cjs/Field/Field.js +63 -11
  16. package/dist/cjs/Field/FieldContext.d.ts +3 -0
  17. package/dist/cjs/Field/useField.d.ts +4 -1
  18. package/dist/cjs/Field/useField.js +17 -1
  19. package/dist/cjs/Form/Form.d.ts +16 -0
  20. package/dist/cjs/Form/Form.js +140 -0
  21. package/dist/cjs/Form/FormContext.d.ts +13 -0
  22. package/dist/cjs/Form/FormContext.js +8 -0
  23. package/dist/cjs/Form/index.d.ts +3 -0
  24. package/dist/cjs/Form/index.js +27 -0
  25. package/dist/cjs/Form/stories/AsynchronousValidation.js +396 -0
  26. package/dist/cjs/Form/stories/Complex.js +928 -0
  27. package/dist/cjs/Form/stories/DependentFieldsValidation.js +249 -0
  28. package/dist/cjs/Form/stories/DirtyFields.js +339 -0
  29. package/dist/cjs/Form/stories/DynamicFieldsValidation.js +425 -0
  30. package/dist/cjs/Form/stories/FieldArrays.js +549 -0
  31. package/dist/cjs/Form/stories/ValidationStrategies.js +455 -0
  32. package/dist/cjs/Form/stories/utils/useFormikAutoFocusOnError.js +22 -0
  33. package/dist/cjs/Form/useForm.d.ts +1 -0
  34. package/dist/cjs/Form/useForm.js +11 -0
  35. package/dist/cjs/Input/Input.js +22 -9
  36. package/dist/cjs/Input/Input.tailwind.js +7 -2
  37. package/dist/cjs/Pagination/DotPagination/DotPagination.d.ts +1 -1
  38. package/dist/cjs/RadioGroup/RadioButton.d.ts +1 -1
  39. package/dist/cjs/RadioGroup/RadioButton.js +16 -3
  40. package/dist/cjs/RadioGroup/RadioButton.tailwind.js +23 -0
  41. package/dist/cjs/RadioGroup/RadioGroup.d.ts +7 -5
  42. package/dist/cjs/RadioGroup/RadioGroup.js +78 -16
  43. package/dist/cjs/RadioGroup/{RadiogroupContext.d.ts → RadioGroupContext.d.ts} +8 -1
  44. package/dist/cjs/RangeSlider/RangeSlider.d.ts +2 -3
  45. package/dist/cjs/RangeSlider/RangeSlider.js +27 -10
  46. package/dist/cjs/Satellite/locale.d.ts +2 -0
  47. package/dist/cjs/Select/Select.js +39 -6
  48. package/dist/cjs/Select/Select.tailwind.js +19 -0
  49. package/dist/cjs/Stepper/Step.js +2 -2
  50. package/dist/cjs/Switch/Switch.js +2 -2
  51. package/dist/cjs/Switch/SwitchOption.js +3 -3
  52. package/dist/cjs/Tables/DataTable/DataTable.d.ts +1 -1
  53. package/dist/cjs/Tag/Tag.d.ts +1 -1
  54. package/dist/cjs/TextArea/TextArea.d.ts +1 -0
  55. package/dist/cjs/TextArea/TextArea.js +47 -8
  56. package/dist/cjs/TextArea/TextArea.tailwind.js +41 -4
  57. package/dist/cjs/Toggle/Toggle.d.ts +1 -1
  58. package/dist/cjs/Toggle/Toggle.js +23 -6
  59. package/dist/cjs/Toggle/Toggle.tailwind.js +9 -0
  60. package/dist/cjs/Tooltip/Tooltip.d.ts +1 -1
  61. package/dist/cjs/index.d.ts +1 -0
  62. package/dist/cjs/index.js +12 -0
  63. package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
  64. package/dist/cjs/utils/mergeRefs.d.ts +2 -0
  65. package/dist/cjs/utils/mergeRefs.js +17 -0
  66. package/dist/esm/AutoComplete/AutoComplete.d.ts +1 -1
  67. package/dist/esm/AutoComplete/AutoComplete.js +52 -27
  68. package/dist/esm/AutoComplete/AutoComplete.tailwind.js +9 -1
  69. package/dist/esm/AutoComplete/types.d.ts +1 -0
  70. package/dist/esm/Checkbox/Checkbox.d.ts +1 -1
  71. package/dist/esm/Checkbox/Checkbox.js +21 -13
  72. package/dist/esm/Checkbox/Checkbox.tailwind.js +8 -2
  73. package/dist/esm/DatePicker/DatePicker/DatePicker.d.ts +4 -2
  74. package/dist/esm/DatePicker/DatePicker/DatePicker.js +19 -8
  75. package/dist/esm/DatePicker/components/Display.d.ts +3 -3
  76. package/dist/esm/DatePicker/components/Display.js +15 -5
  77. package/dist/esm/Dropzone/Dropzone.d.ts +4 -2
  78. package/dist/esm/Dropzone/Dropzone.js +24 -13
  79. package/dist/esm/Field/Field.d.ts +1 -0
  80. package/dist/esm/Field/Field.js +64 -12
  81. package/dist/esm/Field/FieldContext.d.ts +3 -0
  82. package/dist/esm/Field/useField.d.ts +4 -1
  83. package/dist/esm/Field/useField.js +17 -2
  84. package/dist/esm/Form/Form.d.ts +16 -0
  85. package/dist/esm/Form/Form.js +135 -0
  86. package/dist/esm/Form/FormContext.d.ts +13 -0
  87. package/dist/esm/Form/FormContext.js +2 -0
  88. package/dist/esm/Form/index.d.ts +3 -0
  89. package/dist/esm/Form/index.js +3 -0
  90. package/dist/esm/Form/stories/AsynchronousValidation.js +387 -0
  91. package/dist/esm/Form/stories/Complex.js +919 -0
  92. package/dist/esm/Form/stories/DependentFieldsValidation.js +240 -0
  93. package/dist/esm/Form/stories/DirtyFields.js +330 -0
  94. package/dist/esm/Form/stories/DynamicFieldsValidation.js +416 -0
  95. package/dist/esm/Form/stories/FieldArrays.js +544 -0
  96. package/dist/esm/Form/stories/ValidationStrategies.js +446 -0
  97. package/dist/esm/Form/stories/utils/useFormikAutoFocusOnError.js +16 -0
  98. package/dist/esm/Form/useForm.d.ts +1 -0
  99. package/dist/esm/Form/useForm.js +5 -0
  100. package/dist/esm/Input/Input.js +22 -9
  101. package/dist/esm/Input/Input.tailwind.js +7 -2
  102. package/dist/esm/Pagination/DotPagination/DotPagination.d.ts +1 -1
  103. package/dist/esm/RadioGroup/RadioButton.d.ts +1 -1
  104. package/dist/esm/RadioGroup/RadioButton.js +16 -3
  105. package/dist/esm/RadioGroup/RadioButton.tailwind.js +23 -0
  106. package/dist/esm/RadioGroup/RadioGroup.d.ts +7 -5
  107. package/dist/esm/RadioGroup/RadioGroup.js +77 -15
  108. package/dist/esm/RadioGroup/{RadiogroupContext.d.ts → RadioGroupContext.d.ts} +8 -1
  109. package/dist/esm/RangeSlider/RangeSlider.d.ts +2 -3
  110. package/dist/esm/RangeSlider/RangeSlider.js +27 -10
  111. package/dist/esm/Satellite/locale.d.ts +2 -0
  112. package/dist/esm/Select/Select.js +41 -7
  113. package/dist/esm/Select/Select.tailwind.js +19 -0
  114. package/dist/esm/Stepper/Step.js +2 -2
  115. package/dist/esm/Switch/Switch.js +1 -1
  116. package/dist/esm/Switch/SwitchOption.js +2 -2
  117. package/dist/esm/Tables/DataTable/DataTable.d.ts +1 -1
  118. package/dist/esm/Tag/Tag.d.ts +1 -1
  119. package/dist/esm/TextArea/TextArea.d.ts +1 -0
  120. package/dist/esm/TextArea/TextArea.js +49 -9
  121. package/dist/esm/TextArea/TextArea.tailwind.js +41 -4
  122. package/dist/esm/Toggle/Toggle.d.ts +1 -1
  123. package/dist/esm/Toggle/Toggle.js +23 -6
  124. package/dist/esm/Toggle/Toggle.tailwind.js +9 -0
  125. package/dist/esm/Tooltip/Tooltip.d.ts +1 -1
  126. package/dist/esm/index.d.ts +1 -0
  127. package/dist/esm/index.js +1 -0
  128. package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
  129. package/dist/esm/utils/mergeRefs.d.ts +2 -0
  130. package/dist/esm/utils/mergeRefs.js +11 -0
  131. package/dist/satellite.min.css +1 -1
  132. package/package.json +13 -7
  133. /package/dist/cjs/RadioGroup/{RadiogroupContext.js → RadioGroupContext.js} +0 -0
  134. /package/dist/esm/RadioGroup/{RadiogroupContext.js → RadioGroupContext.js} +0 -0
@@ -56,6 +56,29 @@ var radioButtonPlugin = plugin(function (_ref) {
56
56
  boxShadow: "none"
57
57
  }
58
58
  }
59
+ },
60
+ ".radio-button-invalid:not(.radio-button:disabled)": {
61
+ borderColor: theme("colors.red.700"),
62
+ "&:hover": {
63
+ background: theme("colors.red.50"),
64
+ borderColor: theme("colors.red.700")
65
+ },
66
+ "&:focus": {
67
+ borderColor: theme("colors.red.700"),
68
+ boxShadow: "\n 0 0 0 1px ".concat(theme("colors.red.700"), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
69
+ },
70
+ "&:checked": {
71
+ borderColor: theme("colors.red.700"),
72
+ "&::after": {
73
+ background: theme("colors.red.700")
74
+ },
75
+ "&:hover": {
76
+ borderColor: theme("colors.red.700")
77
+ },
78
+ "&:focus": {
79
+ boxShadow: "\n 0 0 0 1px ".concat(theme("colors.red.700"), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
80
+ }
81
+ }
59
82
  }
60
83
  });
61
84
  });
@@ -1,10 +1,12 @@
1
- import type { ReactNode, VFC } from "react";
1
+ import type { ForwardRefExoticComponent, ReactNode, RefAttributes, VFC } from "react";
2
2
  export interface RadioGroupProps {
3
+ id?: string;
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  name?: string;
6
7
  value: string;
7
8
  disabled?: boolean;
9
+ required?: boolean;
8
10
  /**
9
11
  * `RadioGroupItem` text position
10
12
  * @default left
@@ -16,10 +18,11 @@ export interface RadioGroupProps {
16
18
  export interface RadioGroupItemProps {
17
19
  value: string;
18
20
  disabled?: boolean;
21
+ required?: boolean;
19
22
  children?: ReactNode;
20
23
  }
21
- declare type RadioGroupSubComponents = {
22
- Item: VFC<RadioGroupItemProps>;
24
+ export declare type RadioGroupComponent = ForwardRefExoticComponent<RadioGroupProps & RefAttributes<HTMLFieldSetElement>> & {
25
+ Item: typeof RadioGroupItem;
23
26
  };
24
27
  export declare const RadioGroupItem: VFC<RadioGroupItemProps>;
25
28
  /**
@@ -27,5 +30,4 @@ export declare const RadioGroupItem: VFC<RadioGroupItemProps>;
27
30
  *
28
31
  * See the [Radio Group documentation page](https://satellite.algolia.com/components/controls/radio-group) for more information.
29
32
  */
30
- export declare const RadioGroup: VFC<RadioGroupProps> & RadioGroupSubComponents;
31
- export {};
33
+ export declare const RadioGroup: RadioGroupComponent;
@@ -1,33 +1,54 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
- import { useState } from "react";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
5
+ var _excluded = ["value", "disabled", "required", "children"];
6
+ import cx from "clsx";
7
+ import { Children, cloneElement, forwardRef, useMemo, useState } from "react";
5
8
  import { Card } from "../Card";
9
+ import { useField } from "../Field";
6
10
  import stl from "../styles/helpers/satellitePrefixer";
7
11
  import { uniqueId } from "../utils/uniqueId";
8
12
  import { RadioButton } from "./RadioButton";
9
- import { RadioGroupContext, useRadioGroupContext } from "./RadiogroupContext";
13
+ import { RadioGroupContext, useRadioGroupContext } from "./RadioGroupContext";
10
14
  import { jsx as _jsx } from "react/jsx-runtime";
11
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
16
  export var RadioGroupItem = function RadioGroupItem(_ref) {
13
17
  var value = _ref.value,
14
18
  disabled = _ref.disabled,
15
- children = _ref.children;
19
+ required = _ref.required,
20
+ children = _ref.children,
21
+ props = _objectWithoutProperties(_ref, _excluded);
16
22
  var _useRadioGroupContext = useRadioGroupContext(),
23
+ id = _useRadioGroupContext.id,
17
24
  name = _useRadioGroupContext.name,
18
25
  contextDisabled = _useRadioGroupContext.disabled,
26
+ contextRequired = _useRadioGroupContext.required,
19
27
  _onChange = _useRadioGroupContext.onChange,
20
28
  contextValue = _useRadioGroupContext.value,
21
29
  _useRadioGroupContext2 = _useRadioGroupContext.textPosition,
22
- textPosition = _useRadioGroupContext2 === void 0 ? "left" : _useRadioGroupContext2;
30
+ textPosition = _useRadioGroupContext2 === void 0 ? "left" : _useRadioGroupContext2,
31
+ descriptionId = _useRadioGroupContext.descriptionId,
32
+ state = _useRadioGroupContext.state,
33
+ ref = _useRadioGroupContext.ref;
34
+ var isFirstChild = props.childIndex === 0;
35
+ var isInvalid = (state === null || state === void 0 ? void 0 : state.status) === "invalid";
23
36
  var checked = value === contextValue;
24
37
  disabled = contextDisabled || disabled;
38
+ required = contextRequired || required;
39
+ var labelId = useMemo(
40
+ // eslint-disable-next-line @algolia/stl/prefer-stl-helper
41
+ function () {
42
+ return uniqueId("stl-radio-group-label-");
43
+ }, []);
25
44
  return /*#__PURE__*/_jsxs("label", {
26
- className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex items-center justify-between\n min-h-10 px-4 py-2\n ", "\n ", "\n ", ""])), disabled ? "text-grey-300" : "hover:bg-grey-100", disabled ? "cursor-not-allowed" : "cursor-pointer", textPosition === "right" && "flex-row-reverse"),
45
+ className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex items-center justify-between\n min-h-10 px-4 py-2\n ", "\n ", "\n ", "\n ", ""])), disabled ? "text-grey-300" : "hover:bg-grey-100", disabled ? "cursor-not-allowed" : "cursor-pointer", textPosition === "right" && "flex-row-reverse", isInvalid && "hover:bg-red-50"),
27
46
  children: [/*#__PURE__*/_jsx("span", {
47
+ id: labelId,
28
48
  className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["flex-1 truncate ", ""])), textPosition === "right" ? "ml-2" : "mr-2"),
29
49
  children: children
30
50
  }), /*#__PURE__*/_jsx(RadioButton, {
51
+ id: checked || isFirstChild && !contextValue ? id : undefined,
31
52
  className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["shrink-0 self-start mt-1"]))),
32
53
  value: value,
33
54
  checked: checked,
@@ -37,21 +58,48 @@ export var RadioGroupItem = function RadioGroupItem(_ref) {
37
58
  _onChange(value);
38
59
  }
39
60
  },
40
- disabled: disabled
61
+ disabled: disabled,
62
+ required: required,
63
+ "aria-invalid": isInvalid,
64
+ "aria-labelledby": labelId,
65
+ "aria-describedby": descriptionId,
66
+ ref: isFirstChild ? ref : undefined
41
67
  })]
42
68
  });
43
69
  };
44
70
 
71
+ // This function is used to clone the children of the `RadioGroup` component
72
+ // and pass the `childIndex` prop to the `RadioGroupItem` children.
73
+ function applyChildIndexRecursively(children) {
74
+ return Children.map(children, function (child, index) {
75
+ var _child$props;
76
+ if (child.type === RadioGroupItem) {
77
+ return /*#__PURE__*/cloneElement(child, {
78
+ childIndex: index
79
+ });
80
+ }
81
+ if ((_child$props = child.props) !== null && _child$props !== void 0 && _child$props.children) {
82
+ return /*#__PURE__*/cloneElement(child, {
83
+ children: applyChildIndexRecursively(child.props.children)
84
+ });
85
+ }
86
+ return child;
87
+ });
88
+ }
89
+
45
90
  /**
46
91
  * The `RadioGroup` component presents mutually exclusive options, allowing users to make a single selection from a list.
47
92
  *
48
93
  * See the [Radio Group documentation page](https://satellite.algolia.com/components/controls/radio-group) for more information.
49
94
  */
50
- export var RadioGroup = function RadioGroup(_ref2) {
51
- var className = _ref2.className,
95
+ export var RadioGroup = /*#__PURE__*/forwardRef(function (_ref2, ref) {
96
+ var id = _ref2.id,
97
+ className = _ref2.className,
52
98
  name = _ref2.name,
53
99
  value = _ref2.value,
54
100
  disabled = _ref2.disabled,
101
+ _ref2$required = _ref2.required,
102
+ required = _ref2$required === void 0 ? false : _ref2$required,
55
103
  textPosition = _ref2.textPosition,
56
104
  children = _ref2.children,
57
105
  onChange = _ref2.onChange;
@@ -61,26 +109,40 @@ export var RadioGroup = function RadioGroup(_ref2) {
61
109
  _useState2 = _slicedToArray(_useState, 1),
62
110
  componentDefaultName = _useState2[0];
63
111
  name = name || componentDefaultName;
112
+ var _useField = useField({
113
+ required: required
114
+ }),
115
+ state = _useField.state,
116
+ labelId = _useField.labelId,
117
+ descriptionId = _useField.descriptionId,
118
+ inputId = _useField.inputId;
64
119
  var contextValue = {
120
+ id: id !== null && id !== void 0 ? id : inputId,
65
121
  name: name,
66
122
  value: value,
67
123
  disabled: disabled,
124
+ required: required,
68
125
  onChange: onChange,
69
- textPosition: textPosition
126
+ textPosition: textPosition,
127
+ labelId: labelId,
128
+ descriptionId: descriptionId,
129
+ state: state,
130
+ ref: ref
70
131
  };
71
132
  return /*#__PURE__*/_jsx(Card, {
72
133
  fullBleed: true,
73
- className: className,
134
+ className: cx(className, stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["border ", ""])), state.status === "invalid" ? "bg-red-100 border-red-700" : "border-transparent")),
74
135
  children: /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
75
136
  value: contextValue,
76
137
  children: /*#__PURE__*/_jsx("fieldset", {
77
- className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["min-w-0"]))),
138
+ className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["min-w-0"]))),
78
139
  children: /*#__PURE__*/_jsx("div", {
79
- className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["flex flex-col py-1"]))),
80
- children: children
140
+ className: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["flex flex-col py-1"]))),
141
+ children: applyChildIndexRecursively(children)
81
142
  })
82
143
  })
83
144
  })
84
145
  });
85
- };
146
+ });
147
+ RadioGroup.displayName = "RadioGroup";
86
148
  RadioGroup.Item = RadioGroupItem;
@@ -1,11 +1,18 @@
1
- /// <reference types="react" />
1
+ import type { ForwardedRef } from "react";
2
+ import type { FieldState } from "../Field";
2
3
  export interface RadioGroupContextType {
4
+ id?: string;
3
5
  name: string;
4
6
  value: string;
5
7
  disabled?: boolean;
8
+ required?: boolean;
6
9
  /** `RadioGroupItem` text position */
7
10
  textPosition?: "left" | "right";
8
11
  onChange: (newValue: string) => void;
12
+ labelId?: string;
13
+ descriptionId?: string;
14
+ state?: FieldState;
15
+ ref?: ForwardedRef<HTMLInputElement>;
9
16
  }
10
17
  export declare const RadioGroupContext: import("react").Context<RadioGroupContextType | null>;
11
18
  export declare const useRadioGroupContext: () => RadioGroupContextType;
@@ -12,9 +12,8 @@ export interface RangeSliderProps<Value extends RangeSliderValue = number> {
12
12
  name?: string;
13
13
  /** @ignore */
14
14
  className?: string;
15
- /** @ignore */
16
- "aria-label"?: string;
17
15
  disabled?: boolean;
16
+ required?: boolean;
18
17
  min?: number;
19
18
  max?: number;
20
19
  step?: number;
@@ -22,7 +21,7 @@ export interface RangeSliderProps<Value extends RangeSliderValue = number> {
22
21
  track1Color?: string;
23
22
  track2Color?: string;
24
23
  }
25
- declare const RangeSliderInternal: <Value extends RangeSliderValue = number>({ className, value, defaultValue, onChange, onCommit, disabled, min, max, track1Color, track2Color, ...otherProps }: RangeSliderProps<Value>, ref: ForwardedRef<HTMLSpanElement>) => JSX.Element;
24
+ declare const RangeSliderInternal: <Value extends RangeSliderValue = number>({ id, className, value, defaultValue, onChange, onCommit, disabled, required, min, max, track1Color, track2Color, ...otherProps }: RangeSliderProps<Value>, ref: ForwardedRef<HTMLSpanElement>) => JSX.Element;
26
25
  /**
27
26
  * The `RangeSlider` component is an input field where users select one or two numeric values within a given range (minimum and maximum values).
28
27
  *
@@ -1,13 +1,14 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _excluded = ["className", "value", "defaultValue", "onChange", "onCommit", "disabled", "min", "max", "track1Color", "track2Color"];
4
+ var _excluded = ["id", "className", "value", "defaultValue", "onChange", "onCommit", "disabled", "required", "min", "max", "track1Color", "track2Color"];
5
5
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
6
6
  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; }
7
7
  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; }
8
8
  import { SliderRange, Root as SliderRoot, SliderThumb, SliderTrack } from "@radix-ui/react-slider";
9
9
  import cx from "clsx";
10
10
  import { forwardRef } from "react";
11
+ import { useField } from "../Field";
11
12
  import colors from "../styles/colors";
12
13
  import stl from "../styles/helpers/satellitePrefixer";
13
14
 
@@ -28,12 +29,15 @@ var ThumbGroove = function ThumbGroove(_ref) {
28
29
  });
29
30
  };
30
31
  var RangeSliderInternal = function RangeSliderInternal(_ref2, ref) {
31
- var className = _ref2.className,
32
+ var idProp = _ref2.id,
33
+ className = _ref2.className,
32
34
  value = _ref2.value,
33
35
  defaultValue = _ref2.defaultValue,
34
36
  onChange = _ref2.onChange,
35
37
  onCommit = _ref2.onCommit,
36
38
  disabled = _ref2.disabled,
39
+ _ref2$required = _ref2.required,
40
+ required = _ref2$required === void 0 ? false : _ref2$required,
37
41
  _ref2$min = _ref2.min,
38
42
  min = _ref2$min === void 0 ? 0 : _ref2$min,
39
43
  _ref2$max = _ref2.max,
@@ -46,9 +50,16 @@ var RangeSliderInternal = function RangeSliderInternal(_ref2, ref) {
46
50
  track1: disabled ? colors.grey[200] : track1Color,
47
51
  track2: disabled ? colors.grey[100] : track2Color
48
52
  };
49
- return /*#__PURE__*/_jsxs(SliderRoot, _objectSpread(_objectSpread({
50
- ref: ref
51
- }, otherProps), {}, {
53
+ var _useField = useField({
54
+ required: required
55
+ }),
56
+ state = _useField.state,
57
+ labelId = _useField.labelId,
58
+ descriptionId = _useField.descriptionId,
59
+ inputId = _useField.inputId;
60
+ var isInvalid = state.status === "invalid";
61
+ var id = idProp !== null && idProp !== void 0 ? idProp : inputId;
62
+ return /*#__PURE__*/_jsxs(SliderRoot, _objectSpread(_objectSpread({}, otherProps), {}, {
52
63
  className: cx(stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["relative h-6 min-w-[200px] flex items-center select-none touch-none aria-disabled:opacity-70 cursor-pointer aria-disabled:cursor-not-allowed"]))), className),
53
64
  value: coerceToRadixValue(value),
54
65
  defaultValue: coerceToRadixValue(defaultValue),
@@ -66,23 +77,29 @@ var RangeSliderInternal = function RangeSliderInternal(_ref2, ref) {
66
77
  max: max,
67
78
  min: min,
68
79
  children: [/*#__PURE__*/_jsx(SliderTrack, {
69
- className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["relative h-1 flex-1 rounded bg-grey-100"]))), TRACK_SHADOWS_CLASSNAME),
80
+ className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["relative h-1 flex-1 rounded bg-grey-100 ", ""])), isInvalid && "bg-red-100"), TRACK_SHADOWS_CLASSNAME),
70
81
  style: {
71
82
  backgroundColor: trackColors.track2
72
83
  },
73
84
  children: /*#__PURE__*/_jsx(SliderRange, {
74
- className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["absolute rounded-full h-full bg-accent-600"]))), TRACK_SHADOWS_CLASSNAME),
85
+ className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["absolute rounded-full h-full bg-accent-600 ", ""])), isInvalid && "bg-red-700"), TRACK_SHADOWS_CLASSNAME),
75
86
  style: {
76
87
  backgroundColor: trackColors.track1
77
88
  }
78
89
  })
79
90
  }), Array(thumbsCount).fill(undefined).map(function (_, idx) {
80
91
  return /*#__PURE__*/_jsxs(SliderThumb, {
81
- className: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["group absolute -translate-x-1.5 -translate-y-3\n w-3 h-6 rounded-[2px] border border-grey-500\n bg-white bg-gradient-to-b from-white to-grey-50 shadow-[0_1px_0_0_rgb(35_38_59_/_5%)]\n hover:border-grey-600\n "]))),
92
+ ref: ref,
93
+ id: id && (idx === 0 ? id : "".concat(id, "-").concat(idx)),
94
+ "aria-labelledby": labelId,
95
+ "aria-describedby": descriptionId,
96
+ "aria-required": required,
97
+ "aria-invalid": isInvalid,
98
+ className: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["group absolute -translate-x-1.5 -translate-y-3\n w-3 h-6 rounded-[2px] border border-grey-500\n bg-white bg-gradient-to-b from-white to-grey-50 shadow-[0_1px_0_0_rgb(35_38_59_/_5%)]\n ", "\n "])), isInvalid ? "border-red-700 hover:border-red-700 focus:outline-red-700" : "hover:border-grey-600"),
82
99
  children: [/*#__PURE__*/_jsx(ThumbGroove, {
83
- className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["absolute top-1.5 right-1.5"])))
100
+ className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["absolute top-1.5 right-1.5 ", ""])), isInvalid && "bg-red-700 group-hover:bg-red-700")
84
101
  }), /*#__PURE__*/_jsx(ThumbGroove, {
85
- className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["absolute top-1.5 left-1.5"])))
102
+ className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["absolute top-1.5 left-1.5 ", ""])), isInvalid && "bg-red-700 group-hover:bg-red-700")
86
103
  })]
87
104
  }, "thumb_".concat(idx));
88
105
  })]
@@ -3,6 +3,7 @@ import type { AutoCompleteLocale } from "../AutoComplete";
3
3
  import type { UserAvatarLocale } from "../Avatars/UserAvatar";
4
4
  import type { DatePickerLocale } from "../DatePicker/types";
5
5
  import type { DropzoneLocale } from "../Dropzone";
6
+ import type { ExperimentalFormLocale } from "../Form/Form";
6
7
  import type { InputPropsLocale } from "../Input";
7
8
  import type { ModalLocale } from "../Modal";
8
9
  import type { PaginationLocale } from "../Pagination";
@@ -23,6 +24,7 @@ export declare type ComponentsLocales = {
23
24
  datePicker?: DatePickerLocale;
24
25
  dotPagination?: DotPaginationLocale;
25
26
  dropzone?: DropzoneLocale;
27
+ form?: ExperimentalFormLocale;
26
28
  input?: InputPropsLocale;
27
29
  modal?: ModalLocale;
28
30
  pagination?: PaginationLocale;
@@ -1,19 +1,32 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _excluded = ["variant", "className"];
5
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
+ var _excluded = ["variant", "className", "required"];
5
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
6
6
  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; }
7
7
  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; }
8
8
  import cx from "clsx";
9
- import { forwardRef } from "react";
9
+ import { forwardRef, Fragment } from "react";
10
+ import { useField } from "../Field";
11
+ import { CheckIcon, XIcon } from "../Icons";
10
12
  import stl from "../styles/helpers/satellitePrefixer";
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
15
  var VARIANT_CLASSNAMES = {
13
16
  small: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["select-input-small"]))),
14
17
  medium: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["select-input-medium"]))),
15
18
  large: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["select-input-large"])))
16
19
  };
20
+ var InvalidIcon = function InvalidIcon() {
21
+ return /*#__PURE__*/_jsx(XIcon, {
22
+ className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["h-4 w-4 mr-10 text-white bg-red-700 p-px rounded-full absolute top-1/2 right-0 -translate-y-1/2"])))
23
+ });
24
+ };
25
+ var ValidatedIcon = function ValidatedIcon() {
26
+ return /*#__PURE__*/_jsx(CheckIcon, {
27
+ className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["h-4 w-4 mr-10 text-white bg-accent-600 p-px rounded-full absolute top-1/2 right-0 -translate-y-1/2"])))
28
+ });
29
+ };
17
30
 
18
31
  /**
19
32
  * The `Select` component provides a dropdown menu, allowing users to choose one option from a list.
@@ -21,13 +34,34 @@ var VARIANT_CLASSNAMES = {
21
34
  * See the [Select documentation page](https://satellite.algolia.com/components/forms/select) for more information.
22
35
  */
23
36
  export var Select = /*#__PURE__*/forwardRef(function (_ref, ref) {
37
+ var _props$id;
24
38
  var _ref$variant = _ref.variant,
25
39
  variant = _ref$variant === void 0 ? "medium" : _ref$variant,
26
40
  className = _ref.className,
41
+ required = _ref.required,
27
42
  props = _objectWithoutProperties(_ref, _excluded);
28
- return /*#__PURE__*/_jsx("select", _objectSpread(_objectSpread({}, props), {}, {
29
- className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["select-input display-body"]))), VARIANT_CLASSNAMES[variant], className),
30
- ref: ref
31
- }));
43
+ var _useField = useField({
44
+ required: required
45
+ }),
46
+ state = _useField.state,
47
+ labelId = _useField.labelId,
48
+ descriptionId = _useField.descriptionId,
49
+ inputId = _useField.inputId;
50
+ var isValidated = state.status === "validated";
51
+ var isInvalid = state.status === "invalid";
52
+ var StatusIcon = isInvalid ? InvalidIcon : state.status === "validated" ? ValidatedIcon : Fragment;
53
+ return /*#__PURE__*/_jsxs("div", {
54
+ className: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["relative w-full"]))),
55
+ children: [/*#__PURE__*/_jsx("select", _objectSpread(_objectSpread({
56
+ "aria-labelledby": labelId,
57
+ "aria-describedby": descriptionId
58
+ }, props), {}, {
59
+ id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : inputId,
60
+ required: required,
61
+ "aria-invalid": isInvalid,
62
+ className: cx(stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["select-input display-body"]))), VARIANT_CLASSNAMES[variant], isInvalid && stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["select-input-invalid"]))), isValidated && stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["select-input-validated"]))), className),
63
+ ref: ref
64
+ })), /*#__PURE__*/_jsx(StatusIcon, {})]
65
+ });
32
66
  });
33
67
  Select.displayName = "Select";
@@ -26,6 +26,7 @@ var selectPlugin = plugin(function (_ref) {
26
26
  borderRadius: theme("borderRadius.DEFAULT"),
27
27
  border: "1px solid ".concat(theme("colors.grey.500")),
28
28
  boxShadow: "0 1px 0 0 ".concat(theme("colors.shadow.5")),
29
+ transition: "all 100ms ease-in-out",
29
30
  "&::-moz-focus-inner, &:-moz-focusring": {
30
31
  outline: "none",
31
32
  color: "transparent",
@@ -71,6 +72,24 @@ var selectPlugin = plugin(function (_ref) {
71
72
  ".select-input-large": {
72
73
  height: theme("spacing.12"),
73
74
  backgroundSize: "12px, auto"
75
+ },
76
+ ".select-input-invalid, .select-input-validated": {
77
+ padding: "0 ".concat(theme("spacing.16"), " 0 ").concat(theme("spacing.4"))
78
+ },
79
+ ".select-input-invalid": {
80
+ borderColor: theme("colors.red.700"),
81
+ backgroundColor: theme("colors.red.100"),
82
+ backgroundImage: selectIconBG(theme("colors.red.700")),
83
+ "&:hover": {
84
+ borderColor: theme("colors.red.700"),
85
+ backgroundColor: theme("colors.red.50"),
86
+ backgroundImage: selectIconBG(theme("colors.red.700"))
87
+ },
88
+ "&:focus": {
89
+ backgroundImage: selectIconBG(theme("colors.red.700")),
90
+ borderColor: theme("colors.red.700"),
91
+ boxShadow: "\n 0 0 0 1px ".concat(theme("colors.red.700"), ",\n 0 2px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
92
+ }
74
93
  }
75
94
  });
76
95
  });
@@ -65,7 +65,7 @@ export var Step = function Step(_ref) {
65
65
  className: cx(className, stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["text-grey-600 group/step"])))),
66
66
  children: /*#__PURE__*/_jsxs("button", {
67
67
  id: buttonId,
68
- className: cx(stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["relative w-full flex items-center text-left gap-2 rounded border transition-colors group/button"]))), stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["-outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-xenon-600"]))), disabled ? stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["cursor-not-allowed"]))) : stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["hover:bg-grey-100"]))), active ? stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["border-grey-200 bg-white"]))) : stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["border-transparent"]))), BUTTON_SIZE_CLASSNAMES[context.size]),
68
+ className: cx(stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["relative w-full flex items-center text-left gap-2 rounded border group/button"]))), stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["-outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-xenon-600"]))), disabled ? stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["cursor-not-allowed"]))) : stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["hover:bg-grey-100"]))), active ? stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["border-grey-200 bg-white"]))) : stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["border-transparent"]))), BUTTON_SIZE_CLASSNAMES[context.size]),
69
69
  "aria-label": disabled ? disabledLocale : active ? activeLocale : completed ? completedLocale : incompletedLocale,
70
70
  "aria-current": active ? "step" : undefined,
71
71
  disabled: disabled,
@@ -89,7 +89,7 @@ export var Step = function Step(_ref) {
89
89
  children: [context.connectors && /*#__PURE__*/_jsx("span", {
90
90
  className: cx(stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["absolute -z-10 border-l h-full group-last/step:hidden"]))), completed ? stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["border-green-600"]))) : stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["border-grey-200"]))), CONNECTOR_SIZE_CLASSNAMES[context.size])
91
91
  }), /*#__PURE__*/_jsx("span", {
92
- className: cx(stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["rounded-full flex items-center justify-center shrink-0 text-sm transition-colors"]))), !active && !completed && stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["bg-grey-100"]))), !active && !completed && !disabled && stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["group-hover/button:bg-white"]))), active && !completed && stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["bg-grey-800 text-white"]))), completed && stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["bg-green-600 text-white"]))), ICON_SIZE_CLASSNAMES[context.size]),
92
+ className: cx(stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["rounded-full flex items-center justify-center shrink-0 text-sm"]))), !active && !completed && stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["bg-grey-100"]))), !active && !completed && !disabled && stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["group-hover/button:bg-white"]))), active && !completed && stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["bg-grey-800 text-white"]))), completed && stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["bg-green-600 text-white"]))), ICON_SIZE_CLASSNAMES[context.size]),
93
93
  children: Icon ? /*#__PURE__*/_jsx(Icon, {
94
94
  width: ICON_SIZE[context.size],
95
95
  height: ICON_SIZE[context.size]
@@ -4,7 +4,7 @@ var _templateObject, _templateObject2;
4
4
  import cx from "clsx";
5
5
  import { useLayoutEffect, useRef, useState } from "react";
6
6
  import { BUTTON_SIZE_CLASSNAMES } from "../Button/styles";
7
- import { RadioGroupContext } from "../RadioGroup/RadiogroupContext";
7
+ import { RadioGroupContext } from "../RadioGroup/RadioGroupContext";
8
8
  import stl from "../styles/helpers/satellitePrefixer";
9
9
  import { prefersReducedMotion } from "../utils/prefersReducedMotion";
10
10
  import { uniqueId } from "../utils/uniqueId";
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
  var _templateObject, _templateObject2;
4
4
  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; }
5
5
  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; }
6
- import { useRadioGroupContext } from "../RadioGroup/RadiogroupContext";
6
+ import { useRadioGroupContext } from "../RadioGroup/RadioGroupContext";
7
7
  import stl from "../styles/helpers/satellitePrefixer";
8
8
  import { OverflowTooltipWrapper } from "../Tooltip/OverflowTooltipWrapper";
9
9
  import { buildAnimationProps } from "./utils";
@@ -17,7 +17,7 @@ export var SwitchOption = function SwitchOption(_ref) {
17
17
  var checked = context.value === value;
18
18
  var inputDisabled = context.disabled || disabled;
19
19
  return /*#__PURE__*/_jsxs("label", _objectSpread(_objectSpread({
20
- className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n inline-flex grow shrink justify-center items-center min-w-16 max-w-48 px-4 z-10 text-grey-600\n ", "\n ", "\n "])), inputDisabled ? "cursor-not-allowed opacity-60 rounded bg-grey-100" : "cursor-pointer hover:text-grey-900", !checked && !inputDisabled && "rounded motion-safe:transition-colors active:bg-accent-200/20 motion-safe:duration-100 ease-linear")
20
+ className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n inline-flex grow shrink justify-center items-center min-w-16 max-w-48 px-4 z-10 text-grey-600\n ", "\n ", "\n "])), inputDisabled ? "cursor-not-allowed opacity-60 rounded bg-grey-100" : "cursor-pointer hover:text-grey-900", !checked && !inputDisabled && "rounded active:bg-accent-200/20")
21
21
  }, buildAnimationProps(context.name, value)), {}, {
22
22
  children: [/*#__PURE__*/_jsx("input", {
23
23
  className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["w-0 h-0 opacity-0"]))),
@@ -51,5 +51,5 @@ export declare type DataTableProps<Item> = BaseDataTableProps<Item> & (DataTable
51
51
  *
52
52
  * See the [Data Table documentation page](https://satellite.algolia.com/layouts/data-table) for more information.
53
53
  */
54
- export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, sortMode, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale: propsLocale, }: DataTableProps<Item>) => JSX.Element;
54
+ export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, sortMode, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale, }: DataTableProps<Item>) => JSX.Element;
55
55
  export {};
@@ -27,4 +27,4 @@ export interface TagProps extends DetailedHTMLProps<HTMLAttributes<HTMLSpanEleme
27
27
  *
28
28
  * See the [Tag documentation page](https://satellite.algolia.com/components/forms/tag) for more information.
29
29
  */
30
- export declare const Tag: import("react").ForwardRefExoticComponent<Pick<TagProps, "dir" | "slot" | "style" | "title" | "children" | "id" | "variant" | "locale" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "onAdd" | "addTooltip" | "onRemove" | "removeTooltip"> & import("react").RefAttributes<HTMLSpanElement>>;
30
+ export declare const Tag: import("react").ForwardRefExoticComponent<Pick<TagProps, "slot" | "style" | "title" | "children" | "id" | "variant" | "locale" | "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "onAdd" | "addTooltip" | "onRemove" | "removeTooltip"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,6 +1,7 @@
1
1
  import type { TextareaHTMLAttributes } from "react";
2
2
  export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
3
3
  }
4
+ export declare type TextareaStatus = "default" | "validated" | "invalid";
4
5
  /**
5
6
  * The `TextArea` component is a multiline input field for extensive text, ideal for detailed feedback, descriptions, or comments.
6
7
  *