@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.
- package/dist/cjs/AutoComplete/AutoComplete.d.ts +1 -1
- package/dist/cjs/AutoComplete/AutoComplete.js +49 -26
- package/dist/cjs/AutoComplete/AutoComplete.tailwind.js +9 -1
- package/dist/cjs/AutoComplete/types.d.ts +1 -0
- package/dist/cjs/Checkbox/Checkbox.d.ts +1 -1
- package/dist/cjs/Checkbox/Checkbox.js +21 -13
- package/dist/cjs/Checkbox/Checkbox.tailwind.js +8 -2
- package/dist/cjs/DatePicker/DatePicker/DatePicker.d.ts +4 -2
- package/dist/cjs/DatePicker/DatePicker/DatePicker.js +18 -7
- package/dist/cjs/DatePicker/components/Display.d.ts +3 -3
- package/dist/cjs/DatePicker/components/Display.js +16 -5
- package/dist/cjs/Dropzone/Dropzone.d.ts +4 -2
- package/dist/cjs/Dropzone/Dropzone.js +23 -12
- package/dist/cjs/Field/Field.d.ts +1 -0
- package/dist/cjs/Field/Field.js +63 -11
- package/dist/cjs/Field/FieldContext.d.ts +3 -0
- package/dist/cjs/Field/useField.d.ts +4 -1
- package/dist/cjs/Field/useField.js +17 -1
- package/dist/cjs/Form/Form.d.ts +16 -0
- package/dist/cjs/Form/Form.js +140 -0
- package/dist/cjs/Form/FormContext.d.ts +13 -0
- package/dist/cjs/Form/FormContext.js +8 -0
- package/dist/cjs/Form/index.d.ts +3 -0
- package/dist/cjs/Form/index.js +27 -0
- package/dist/cjs/Form/stories/AsynchronousValidation.js +396 -0
- package/dist/cjs/Form/stories/Complex.js +928 -0
- package/dist/cjs/Form/stories/DependentFieldsValidation.js +249 -0
- package/dist/cjs/Form/stories/DirtyFields.js +339 -0
- package/dist/cjs/Form/stories/DynamicFieldsValidation.js +425 -0
- package/dist/cjs/Form/stories/FieldArrays.js +549 -0
- package/dist/cjs/Form/stories/ValidationStrategies.js +455 -0
- package/dist/cjs/Form/stories/utils/useFormikAutoFocusOnError.js +22 -0
- package/dist/cjs/Form/useForm.d.ts +1 -0
- package/dist/cjs/Form/useForm.js +11 -0
- package/dist/cjs/Input/Input.js +22 -9
- package/dist/cjs/Input/Input.tailwind.js +7 -2
- package/dist/cjs/Pagination/DotPagination/DotPagination.d.ts +1 -1
- package/dist/cjs/RadioGroup/RadioButton.d.ts +1 -1
- package/dist/cjs/RadioGroup/RadioButton.js +16 -3
- package/dist/cjs/RadioGroup/RadioButton.tailwind.js +23 -0
- package/dist/cjs/RadioGroup/RadioGroup.d.ts +7 -5
- package/dist/cjs/RadioGroup/RadioGroup.js +78 -16
- package/dist/cjs/RadioGroup/{RadiogroupContext.d.ts → RadioGroupContext.d.ts} +8 -1
- package/dist/cjs/RangeSlider/RangeSlider.d.ts +2 -3
- package/dist/cjs/RangeSlider/RangeSlider.js +27 -10
- package/dist/cjs/Satellite/locale.d.ts +2 -0
- package/dist/cjs/Select/Select.js +39 -6
- package/dist/cjs/Select/Select.tailwind.js +19 -0
- package/dist/cjs/Stepper/Step.js +2 -2
- package/dist/cjs/Switch/Switch.js +2 -2
- package/dist/cjs/Switch/SwitchOption.js +3 -3
- package/dist/cjs/Tables/DataTable/DataTable.d.ts +1 -1
- package/dist/cjs/Tag/Tag.d.ts +1 -1
- package/dist/cjs/TextArea/TextArea.d.ts +1 -0
- package/dist/cjs/TextArea/TextArea.js +47 -8
- package/dist/cjs/TextArea/TextArea.tailwind.js +41 -4
- package/dist/cjs/Toggle/Toggle.d.ts +1 -1
- package/dist/cjs/Toggle/Toggle.js +23 -6
- package/dist/cjs/Toggle/Toggle.tailwind.js +9 -0
- package/dist/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/cjs/utils/mergeRefs.d.ts +2 -0
- package/dist/cjs/utils/mergeRefs.js +17 -0
- package/dist/esm/AutoComplete/AutoComplete.d.ts +1 -1
- package/dist/esm/AutoComplete/AutoComplete.js +52 -27
- package/dist/esm/AutoComplete/AutoComplete.tailwind.js +9 -1
- package/dist/esm/AutoComplete/types.d.ts +1 -0
- package/dist/esm/Checkbox/Checkbox.d.ts +1 -1
- package/dist/esm/Checkbox/Checkbox.js +21 -13
- package/dist/esm/Checkbox/Checkbox.tailwind.js +8 -2
- package/dist/esm/DatePicker/DatePicker/DatePicker.d.ts +4 -2
- package/dist/esm/DatePicker/DatePicker/DatePicker.js +19 -8
- package/dist/esm/DatePicker/components/Display.d.ts +3 -3
- package/dist/esm/DatePicker/components/Display.js +15 -5
- package/dist/esm/Dropzone/Dropzone.d.ts +4 -2
- package/dist/esm/Dropzone/Dropzone.js +24 -13
- package/dist/esm/Field/Field.d.ts +1 -0
- package/dist/esm/Field/Field.js +64 -12
- package/dist/esm/Field/FieldContext.d.ts +3 -0
- package/dist/esm/Field/useField.d.ts +4 -1
- package/dist/esm/Field/useField.js +17 -2
- package/dist/esm/Form/Form.d.ts +16 -0
- package/dist/esm/Form/Form.js +135 -0
- package/dist/esm/Form/FormContext.d.ts +13 -0
- package/dist/esm/Form/FormContext.js +2 -0
- package/dist/esm/Form/index.d.ts +3 -0
- package/dist/esm/Form/index.js +3 -0
- package/dist/esm/Form/stories/AsynchronousValidation.js +387 -0
- package/dist/esm/Form/stories/Complex.js +919 -0
- package/dist/esm/Form/stories/DependentFieldsValidation.js +240 -0
- package/dist/esm/Form/stories/DirtyFields.js +330 -0
- package/dist/esm/Form/stories/DynamicFieldsValidation.js +416 -0
- package/dist/esm/Form/stories/FieldArrays.js +544 -0
- package/dist/esm/Form/stories/ValidationStrategies.js +446 -0
- package/dist/esm/Form/stories/utils/useFormikAutoFocusOnError.js +16 -0
- package/dist/esm/Form/useForm.d.ts +1 -0
- package/dist/esm/Form/useForm.js +5 -0
- package/dist/esm/Input/Input.js +22 -9
- package/dist/esm/Input/Input.tailwind.js +7 -2
- package/dist/esm/Pagination/DotPagination/DotPagination.d.ts +1 -1
- package/dist/esm/RadioGroup/RadioButton.d.ts +1 -1
- package/dist/esm/RadioGroup/RadioButton.js +16 -3
- package/dist/esm/RadioGroup/RadioButton.tailwind.js +23 -0
- package/dist/esm/RadioGroup/RadioGroup.d.ts +7 -5
- package/dist/esm/RadioGroup/RadioGroup.js +77 -15
- package/dist/esm/RadioGroup/{RadiogroupContext.d.ts → RadioGroupContext.d.ts} +8 -1
- package/dist/esm/RangeSlider/RangeSlider.d.ts +2 -3
- package/dist/esm/RangeSlider/RangeSlider.js +27 -10
- package/dist/esm/Satellite/locale.d.ts +2 -0
- package/dist/esm/Select/Select.js +41 -7
- package/dist/esm/Select/Select.tailwind.js +19 -0
- package/dist/esm/Stepper/Step.js +2 -2
- package/dist/esm/Switch/Switch.js +1 -1
- package/dist/esm/Switch/SwitchOption.js +2 -2
- package/dist/esm/Tables/DataTable/DataTable.d.ts +1 -1
- package/dist/esm/Tag/Tag.d.ts +1 -1
- package/dist/esm/TextArea/TextArea.d.ts +1 -0
- package/dist/esm/TextArea/TextArea.js +49 -9
- package/dist/esm/TextArea/TextArea.tailwind.js +41 -4
- package/dist/esm/Toggle/Toggle.d.ts +1 -1
- package/dist/esm/Toggle/Toggle.js +23 -6
- package/dist/esm/Toggle/Toggle.tailwind.js +9 -0
- package/dist/esm/Tooltip/Tooltip.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/esm/utils/mergeRefs.d.ts +2 -0
- package/dist/esm/utils/mergeRefs.js +11 -0
- package/dist/satellite.min.css +1 -1
- package/package.json +13 -7
- /package/dist/cjs/RadioGroup/{RadiogroupContext.js → RadioGroupContext.js} +0 -0
- /package/dist/esm/RadioGroup/{RadiogroupContext.js → RadioGroupContext.js} +0 -0
@@ -1,25 +1,65 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
|
5
|
-
var _excluded = ["className"];
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
4
|
+
var _excluded = ["className", "placeholder", "required"];
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
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";
|
15
|
+
var STATUS_CLASSNAMES = {
|
16
|
+
"default": "",
|
17
|
+
invalid: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["text-area-invalid"]))),
|
18
|
+
validated: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["text-area-validated"])))
|
19
|
+
};
|
20
|
+
var InvalidIcon = function InvalidIcon() {
|
21
|
+
return /*#__PURE__*/_jsx(XIcon, {
|
22
|
+
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 h-4 w-4 text-white bg-red-700 p-px rounded-full absolute top-2 -right-2"])))
|
23
|
+
});
|
24
|
+
};
|
25
|
+
var ValidatedIcon = function ValidatedIcon() {
|
26
|
+
return /*#__PURE__*/_jsx(CheckIcon, {
|
27
|
+
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["mr-4 h-4 w-4 text-white bg-accent-600 p-px rounded-full absolute top-2 -right-2"])))
|
28
|
+
});
|
29
|
+
};
|
30
|
+
|
12
31
|
/**
|
13
32
|
* The `TextArea` component is a multiline input field for extensive text, ideal for detailed feedback, descriptions, or comments.
|
14
33
|
*
|
15
34
|
* See the [Text Area documentation page](https://satellite.algolia.com/components/forms/text-area) for more information.
|
16
35
|
*/
|
17
36
|
export var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
37
|
+
var _textareaProps$id;
|
18
38
|
var className = _ref.className,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
39
|
+
placeholder = _ref.placeholder,
|
40
|
+
required = _ref.required,
|
41
|
+
textareaProps = _objectWithoutProperties(_ref, _excluded);
|
42
|
+
var _useField = useField({
|
43
|
+
required: required
|
44
|
+
}),
|
45
|
+
state = _useField.state,
|
46
|
+
labelId = _useField.labelId,
|
47
|
+
descriptionId = _useField.descriptionId,
|
48
|
+
inputId = _useField.inputId;
|
49
|
+
var isInvalid = state.status === "invalid";
|
50
|
+
var StatusIcon = isInvalid ? InvalidIcon : state.status === "validated" ? ValidatedIcon : Fragment;
|
51
|
+
return /*#__PURE__*/_jsxs("div", {
|
52
|
+
className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["text-area relative"]))), STATUS_CLASSNAMES[state.status], className),
|
53
|
+
children: [/*#__PURE__*/_jsx("textarea", _objectSpread(_objectSpread({
|
54
|
+
"aria-labelledby": labelId,
|
55
|
+
"aria-describedby": descriptionId
|
56
|
+
}, textareaProps), {}, {
|
57
|
+
id: (_textareaProps$id = textareaProps.id) !== null && _textareaProps$id !== void 0 ? _textareaProps$id : inputId,
|
58
|
+
required: required,
|
59
|
+
"aria-invalid": isInvalid,
|
60
|
+
ref: ref,
|
61
|
+
placeholder: placeholder
|
62
|
+
})), /*#__PURE__*/_jsx(StatusIcon, {})]
|
63
|
+
});
|
24
64
|
});
|
25
65
|
TextArea.displayName = "TextArea";
|
@@ -10,8 +10,8 @@ var textAreaPlugin = plugin(function (_ref) {
|
|
10
10
|
theme = _ref.theme;
|
11
11
|
addComponents({
|
12
12
|
".text-area": {
|
13
|
+
display: "flex",
|
13
14
|
width: "100%",
|
14
|
-
padding: theme("spacing.4"),
|
15
15
|
backgroundColor: theme("colors.white"),
|
16
16
|
border: "1px solid ".concat(theme("colors.grey.500")),
|
17
17
|
borderRadius: theme("borderRadius.DEFAULT"),
|
@@ -30,12 +30,49 @@ var textAreaPlugin = plugin(function (_ref) {
|
|
30
30
|
boxShadow: "0px 1px 0px 0px ".concat(theme("colors.shadow.5")),
|
31
31
|
outline: "none"
|
32
32
|
},
|
33
|
+
"&:has(textarea:disabled)": {
|
34
|
+
borderColor: disabledColor(theme("colors.grey.200")),
|
35
|
+
boxShadow: "none"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
".text-area-invalid": {
|
39
|
+
backgroundColor: theme("colors.red.100"),
|
40
|
+
borderColor: theme("colors.red.700"),
|
41
|
+
"&:hover": {
|
42
|
+
borderColor: theme("colors.red.700"),
|
43
|
+
backgroundColor: theme("colors.red.50")
|
44
|
+
},
|
45
|
+
"&:focus-within": {
|
46
|
+
outline: "1px solid ".concat(theme("colors.red.700"))
|
47
|
+
}
|
48
|
+
},
|
49
|
+
".text-area-invalid textarea": {
|
50
|
+
paddingRight: theme("spacing.6")
|
51
|
+
},
|
52
|
+
".text-area-validated textarea": {
|
53
|
+
paddingRight: theme("spacing.6")
|
54
|
+
},
|
55
|
+
textarea: {
|
56
|
+
flex: "1",
|
57
|
+
minWidth: "0px",
|
58
|
+
caretColor: theme("colors.grey.600"),
|
59
|
+
color: theme("colors.grey.900"),
|
60
|
+
background: "transparent",
|
61
|
+
padding: theme("spacing.4"),
|
62
|
+
"&:focus": {
|
63
|
+
outline: "none"
|
64
|
+
},
|
33
65
|
"&:disabled": {
|
34
66
|
cursor: "not-allowed",
|
35
67
|
color: theme("colors.grey.300"),
|
36
|
-
background: "linear-gradient(-180deg, ".concat(theme("colors.white"), " 0%, ").concat(theme("colors.grey.100"), " 100%)")
|
37
|
-
|
38
|
-
|
68
|
+
background: "linear-gradient(-180deg, ".concat(theme("colors.white"), " 0%, ").concat(theme("colors.grey.100"), " 100%)")
|
69
|
+
}
|
70
|
+
},
|
71
|
+
".text-area-invalid:not(.text-area:disabled)": {
|
72
|
+
backgroundColor: theme("colors.red.100"),
|
73
|
+
borderColor: theme("colors.red.700"),
|
74
|
+
"&:hover": {
|
75
|
+
borderColor: theme("colors.red.800")
|
39
76
|
}
|
40
77
|
}
|
41
78
|
});
|
@@ -7,6 +7,6 @@ export declare type ToggleProps = Omit<HTMLAttributes<HTMLInputElement>, "childr
|
|
7
7
|
*
|
8
8
|
* See the [Toggle documentation page](https://satellite.algolia.com/components/controls/toggle) for more information.
|
9
9
|
*/
|
10
|
-
export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "children" | "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "onChange" | "
|
10
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "children" | "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "onChange" | "required" | "autoFocus" | "disabled" | "checked"> & {
|
11
11
|
decorative?: boolean | undefined;
|
12
12
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
@@ -2,12 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
6
|
-
var _excluded = ["className", "checked", "decorative", "defaultChecked"];
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
6
|
+
var _excluded = ["className", "checked", "decorative", "defaultChecked", "required"];
|
7
7
|
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; }
|
8
8
|
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; }
|
9
9
|
import cx from "clsx";
|
10
10
|
import { forwardRef, useState } from "react";
|
11
|
+
import { useField } from "../Field";
|
11
12
|
import stl from "../styles/helpers/satellitePrefixer";
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -17,10 +18,12 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
* See the [Toggle documentation page](https://satellite.algolia.com/components/controls/toggle) for more information.
|
18
19
|
*/
|
19
20
|
export var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
21
|
+
var _inputProps$id;
|
20
22
|
var className = _ref.className,
|
21
23
|
checked = _ref.checked,
|
22
24
|
decorative = _ref.decorative,
|
23
25
|
defaultChecked = _ref.defaultChecked,
|
26
|
+
required = _ref.required,
|
24
27
|
inputProps = _objectWithoutProperties(_ref, _excluded);
|
25
28
|
var isControlled = typeof checked === "boolean";
|
26
29
|
var _useState = useState(Boolean(isControlled ? checked : defaultChecked)),
|
@@ -30,13 +33,21 @@ export var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
30
33
|
var isChecked = Boolean(isControlled ? checked : internalChecked);
|
31
34
|
var isDisabled = inputProps.disabled,
|
32
35
|
onChange = inputProps.onChange;
|
36
|
+
var _useField = useField({
|
37
|
+
required: required
|
38
|
+
}),
|
39
|
+
state = _useField.state,
|
40
|
+
labelId = _useField.labelId,
|
41
|
+
descriptionId = _useField.descriptionId,
|
42
|
+
inputId = _useField.inputId;
|
43
|
+
var isInvalid = state.status === "invalid";
|
33
44
|
var handleChange = function handleChange(evt) {
|
34
45
|
onChange === null || onChange === void 0 || onChange(evt);
|
35
46
|
if (!isControlled && !evt.isDefaultPrevented()) {
|
36
47
|
setInternalChecked(evt.currentTarget.checked);
|
37
48
|
}
|
38
49
|
};
|
39
|
-
var handleClassName = cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["toggle-handle"]))), isChecked && stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["toggle-checked"]))), isDisabled && stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["toggle-disabled"]))));
|
50
|
+
var handleClassName = cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["toggle-handle"]))), isChecked && stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["toggle-checked"]))), isDisabled && stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["toggle-disabled"]))), isInvalid && stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["toggle-invalid"]))));
|
40
51
|
var onClick = function onClick(event) {
|
41
52
|
if (isDisabled) {
|
42
53
|
return;
|
@@ -46,11 +57,17 @@ export var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
46
57
|
};
|
47
58
|
return /*#__PURE__*/_jsxs("div", {
|
48
59
|
translate: "yes",
|
49
|
-
className: cx(stl(
|
60
|
+
className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["toggle-container"]))), className),
|
50
61
|
children: [decorative ? /*#__PURE__*/_jsx("span", {
|
51
62
|
className: handleClassName,
|
52
63
|
onClick: onClick
|
53
|
-
}) : /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({
|
64
|
+
}) : /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({
|
65
|
+
"aria-labelledby": labelId,
|
66
|
+
"aria-describedby": descriptionId
|
67
|
+
}, inputProps), {}, {
|
68
|
+
id: (_inputProps$id = inputProps.id) !== null && _inputProps$id !== void 0 ? _inputProps$id : inputId,
|
69
|
+
required: required,
|
70
|
+
"aria-invalid": isInvalid,
|
54
71
|
className: handleClassName,
|
55
72
|
disabled: isDisabled,
|
56
73
|
onChange: handleChange,
|
@@ -60,7 +77,7 @@ export var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
60
77
|
role: "switch",
|
61
78
|
ref: ref
|
62
79
|
})), /*#__PURE__*/_jsx("div", {
|
63
|
-
className: stl(
|
80
|
+
className: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["toggle"])))
|
64
81
|
})]
|
65
82
|
});
|
66
83
|
});
|
@@ -73,11 +73,20 @@ var togglePlugin = plugin(function (_ref) {
|
|
73
73
|
},
|
74
74
|
".toggle-checked.toggle-handle.toggle-disabled ~ &": {
|
75
75
|
background: theme("colors.xenon.200")
|
76
|
+
},
|
77
|
+
".toggle-handle.toggle-invalid ~ &": {
|
78
|
+
background: theme("colors.red.700"),
|
79
|
+
"&:after": {
|
80
|
+
background: theme("colors.red.100")
|
81
|
+
}
|
76
82
|
}
|
77
83
|
},
|
78
84
|
"input:focus ~ .toggle": {
|
79
85
|
outline: "2px solid ".concat(theme("colors.accent.600")),
|
80
86
|
outlineOffset: "1px"
|
87
|
+
},
|
88
|
+
"input:focus.toggle-invalid ~ .toggle": {
|
89
|
+
outlineColor: theme("colors.red.700")
|
81
90
|
}
|
82
91
|
});
|
83
92
|
});
|
@@ -8,4 +8,4 @@ export interface TooltipProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEl
|
|
8
8
|
*
|
9
9
|
* See the [Tooltip documentation page](https://satellite.algolia.com/components/overlay/tooltip) for more information.
|
10
10
|
*/
|
11
|
-
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "
|
11
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "slot" | "style" | "title" | "children" | "id" | "variant" | "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"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const isCssPropertySupported: <P extends number | typeof Symbol.iterator | "filter" | "fill" | "
|
1
|
+
export declare const isCssPropertySupported: <P extends number | typeof Symbol.iterator | "filter" | "fill" | "clipPath" | "marker" | "mask" | "translate" | "color" | "grid" | "width" | "height" | "alignmentBaseline" | "baselineShift" | "clip" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "offset" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "top" | "left" | "right" | "bottom" | "content" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "all" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "columns" | "contain" | "counterIncrement" | "counterReset" | "counterSet" | "cssFloat" | "cssText" | "emptyCells" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "font" | "fontFeatureSettings" | "fontKerning" | "fontOpticalSizing" | "fontSynthesis" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "gap" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hyphens" | "imageOrientation" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "lineBreak" | "lineHeight" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "margin" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetDistance" | "offsetPath" | "offsetRotate" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflowAnchor" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "padding" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "position" | "printColorAdjust" | "quotes" | "resize" | "rowGap" | "rubyPosition" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollbarGutter" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textOrientation" | "textOverflow" | "textShadow" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transformBox" | "transformOrigin" | "transformStyle" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "userSelect" | "verticalAlign" | "webkitAlignContent" | "webkitAlignItems" | "webkitAlignSelf" | "webkitAnimation" | "webkitAnimationDelay" | "webkitAnimationDirection" | "webkitAnimationDuration" | "webkitAnimationFillMode" | "webkitAnimationIterationCount" | "webkitAnimationName" | "webkitAnimationPlayState" | "webkitAnimationTimingFunction" | "webkitAppearance" | "webkitBackfaceVisibility" | "webkitBackgroundClip" | "webkitBackgroundOrigin" | "webkitBackgroundSize" | "webkitBorderBottomLeftRadius" | "webkitBorderBottomRightRadius" | "webkitBorderRadius" | "webkitBorderTopLeftRadius" | "webkitBorderTopRightRadius" | "webkitBoxAlign" | "webkitBoxFlex" | "webkitBoxOrdinalGroup" | "webkitBoxOrient" | "webkitBoxPack" | "webkitBoxShadow" | "webkitBoxSizing" | "webkitFilter" | "webkitFlex" | "webkitFlexBasis" | "webkitFlexDirection" | "webkitFlexFlow" | "webkitFlexGrow" | "webkitFlexShrink" | "webkitFlexWrap" | "webkitJustifyContent" | "webkitLineClamp" | "webkitMask" | "webkitMaskBoxImage" | "webkitMaskBoxImageOutset" | "webkitMaskBoxImageRepeat" | "webkitMaskBoxImageSlice" | "webkitMaskBoxImageSource" | "webkitMaskBoxImageWidth" | "webkitMaskClip" | "webkitMaskComposite" | "webkitMaskImage" | "webkitMaskOrigin" | "webkitMaskPosition" | "webkitMaskRepeat" | "webkitMaskSize" | "webkitOrder" | "webkitPerspective" | "webkitPerspectiveOrigin" | "webkitTextFillColor" | "webkitTextSizeAdjust" | "webkitTextStroke" | "webkitTextStrokeColor" | "webkitTextStrokeWidth" | "webkitTransform" | "webkitTransformOrigin" | "webkitTransformStyle" | "webkitTransition" | "webkitTransitionDelay" | "webkitTransitionDuration" | "webkitTransitionProperty" | "webkitTransitionTimingFunction" | "webkitUserSelect" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordWrap" | "zIndex" | "getPropertyPriority" | "getPropertyValue" | "item" | "removeProperty" | "setProperty">(prop: P, value: CSSStyleDeclaration[P]) => boolean;
|