@algolia/satellite 2.3.0-rc.4 → 2.3.0-rc.6
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/Actions/ButtonLink/ButtonLink.d.ts +2 -0
- package/dist/cjs/Actions/ButtonLink/ButtonLink.js +4 -2
- package/dist/cjs/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
- package/dist/cjs/Fields/AutoComplete/AutoComplete.js +5 -7
- package/dist/cjs/Fields/AutoComplete/types.d.ts +0 -8
- package/dist/cjs/Fields/AutoComplete/utils.d.ts +1 -1
- package/dist/cjs/Fields/AutoComplete/utils.js +2 -3
- package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
- package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
- package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/cjs/Fields/Select/Select.tailwind.js +4 -3
- package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
- package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/cjs/Fields/SelectableCard/index.js +27 -0
- package/dist/cjs/Fields/Switch/Switch.js +1 -1
- package/dist/cjs/Fields/index.d.ts +1 -0
- package/dist/cjs/Fields/index.js +11 -0
- package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/cjs/Navigation/Link/Link.d.ts +10 -0
- package/dist/cjs/Navigation/Link/Link.js +4 -2
- package/dist/esm/Actions/ButtonLink/ButtonLink.d.ts +2 -0
- package/dist/esm/Actions/ButtonLink/ButtonLink.js +4 -2
- package/dist/esm/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
- package/dist/esm/Fields/AutoComplete/AutoComplete.js +5 -7
- package/dist/esm/Fields/AutoComplete/types.d.ts +0 -8
- package/dist/esm/Fields/AutoComplete/utils.d.ts +1 -1
- package/dist/esm/Fields/AutoComplete/utils.js +2 -3
- package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/esm/Fields/Form/stories/Complex.js +123 -50
- package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
- package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/esm/Fields/Select/Select.tailwind.js +4 -3
- package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
- package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/esm/Fields/SelectableCard/index.js +2 -0
- package/dist/esm/Fields/Switch/Switch.js +1 -1
- package/dist/esm/Fields/index.d.ts +1 -0
- package/dist/esm/Fields/index.js +1 -0
- package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/esm/Navigation/Link/Link.d.ts +10 -0
- package/dist/esm/Navigation/Link/Link.js +4 -2
- package/dist/satellite.min.css +1 -1
- package/package.json +2 -2
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.SelectableCard = void 0;
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
12
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
13
|
+
var _react = require("react");
|
14
|
+
var _ = require("..");
|
15
|
+
var _Layout = require("../../Layout");
|
16
|
+
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
17
|
+
var _SelectableCardContext = require("./SelectableCardContext");
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
19
|
+
var _excluded = ["value", "selectedColor", "children", "id", "className"];
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18; // We need to omit the `elevation` prop because we handle it ourselves.
|
21
|
+
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; }
|
22
|
+
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) { (0, _defineProperty2["default"])(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; }
|
23
|
+
var SELECTED_COLOR_CLASSNAMES = {
|
24
|
+
grey: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["border-grey-600"]))),
|
25
|
+
pink: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["border-pink-600"]))),
|
26
|
+
accent: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["border-accent-600"]))),
|
27
|
+
blue: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["border-blue-600"]))),
|
28
|
+
green: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["border-green-600"]))),
|
29
|
+
orange: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["border-orange-600"]))),
|
30
|
+
red: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["border-red-600"]))),
|
31
|
+
xenon: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["border-xenon-600"])))
|
32
|
+
};
|
33
|
+
var SelectableCard = exports.SelectableCard = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
34
|
+
var value = _ref.value,
|
35
|
+
_ref$selectedColor = _ref.selectedColor,
|
36
|
+
selectedColor = _ref$selectedColor === void 0 ? "xenon" : _ref$selectedColor,
|
37
|
+
children = _ref.children,
|
38
|
+
id = _ref.id,
|
39
|
+
className = _ref.className,
|
40
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
41
|
+
var _useSelectableCardCon = (0, _SelectableCardContext.useSelectableCardContext)(),
|
42
|
+
name = _useSelectableCardCon.name,
|
43
|
+
isControlled = _useSelectableCardCon.isControlled,
|
44
|
+
setValue = _useSelectableCardCon.setValue,
|
45
|
+
onValueChange = _useSelectableCardCon.onValueChange,
|
46
|
+
type = _useSelectableCardCon.type,
|
47
|
+
valueContext = _useSelectableCardCon.value,
|
48
|
+
disabledContext = _useSelectableCardCon.disabled;
|
49
|
+
var disabled = props.disabled || disabledContext;
|
50
|
+
var selected = valueContext === null || valueContext === void 0 ? void 0 : valueContext.includes(value);
|
51
|
+
var _useField = (0, _.useField)(),
|
52
|
+
status = _useField.state.status;
|
53
|
+
var isInvalid = status === "invalid";
|
54
|
+
var handleCheckboxChange = function handleCheckboxChange(evt) {
|
55
|
+
var _valueContext$filter;
|
56
|
+
var newValue = selected ? (_valueContext$filter = valueContext === null || valueContext === void 0 ? void 0 : valueContext.filter(function (v) {
|
57
|
+
return v !== value;
|
58
|
+
})) !== null && _valueContext$filter !== void 0 ? _valueContext$filter : [] : [].concat((0, _toConsumableArray2["default"])(valueContext !== null && valueContext !== void 0 ? valueContext : []), [value]);
|
59
|
+
if (!isControlled && !evt.isDefaultPrevented()) {
|
60
|
+
setValue(newValue);
|
61
|
+
}
|
62
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(newValue);
|
63
|
+
};
|
64
|
+
var handleRadioButtonChange = function handleRadioButtonChange(evt) {
|
65
|
+
var newValue = [evt.target.value];
|
66
|
+
if (!isControlled && !evt.isDefaultPrevented()) {
|
67
|
+
setValue(newValue);
|
68
|
+
}
|
69
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(newValue);
|
70
|
+
};
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Card, _objectSpread(_objectSpread({
|
72
|
+
ref: ref,
|
73
|
+
fullBleed: true,
|
74
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["relative border transition-[shadow,border]"]))), !disabled && !selected && !isInvalid && (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["border-transparent"]))),
|
75
|
+
// Disabled
|
76
|
+
disabled && (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100 border-grey-200 text-grey-300 shadow-none cursor-not-allowed [&>*]:text-grey-300"]))),
|
77
|
+
// Selected
|
78
|
+
selected && (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["card-z200"]))), !disabled && selected && !isInvalid && SELECTED_COLOR_CLASSNAMES[selectedColor],
|
79
|
+
// Hovered
|
80
|
+
!disabled && !selected && !isInvalid && (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["hover:border-grey-200"]))), // Focused
|
81
|
+
(0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["focusable-visible-within"]))), !selected && (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["focus-within:border-grey-200"]))),
|
82
|
+
// Invalid
|
83
|
+
isInvalid && (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["border-red-700 shadow-none"]))),
|
84
|
+
// Custom
|
85
|
+
className)
|
86
|
+
}, props), {}, {
|
87
|
+
children: [type === "multiple" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Checkbox, {
|
88
|
+
id: id,
|
89
|
+
disabled: disabled,
|
90
|
+
checked: selected,
|
91
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["absolute right-4 top-4 z-10"])))),
|
92
|
+
onChange: handleCheckboxChange,
|
93
|
+
name: name
|
94
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_.RadioButton, {
|
95
|
+
id: id,
|
96
|
+
disabled: disabled,
|
97
|
+
checked: selected,
|
98
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["absolute right-4 top-4 z-10"])))),
|
99
|
+
onChange: handleRadioButtonChange,
|
100
|
+
value: value,
|
101
|
+
name: name
|
102
|
+
}), children]
|
103
|
+
}));
|
104
|
+
});
|
105
|
+
SelectableCard.displayName = "SelectableCard";
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
2
|
+
import type { SelectionTypes } from "./SelectableCardGroup";
|
3
|
+
export interface SelectableCardContextInterface {
|
4
|
+
value?: string[];
|
5
|
+
name?: string;
|
6
|
+
type: SelectionTypes;
|
7
|
+
isControlled: boolean;
|
8
|
+
setValue: Dispatch<SetStateAction<string[]>>;
|
9
|
+
onValueChange?: (value: string[]) => void;
|
10
|
+
disabled?: boolean;
|
11
|
+
}
|
12
|
+
export declare const SelectableCardContext: import("react").Context<SelectableCardContextInterface | null>;
|
13
|
+
export declare const useSelectableCardContext: () => SelectableCardContextInterface;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useSelectableCardContext = exports.SelectableCardContext = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var SelectableCardContext = exports.SelectableCardContext = /*#__PURE__*/(0, _react.createContext)(null);
|
9
|
+
var useSelectableCardContext = exports.useSelectableCardContext = function useSelectableCardContext() {
|
10
|
+
var context = (0, _react.useContext)(SelectableCardContext);
|
11
|
+
if (!context) {
|
12
|
+
throw new Error("useSelectableCardContext used outside SelectableCardContext");
|
13
|
+
}
|
14
|
+
return context;
|
15
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { type FC, type PropsWithChildren } from "react";
|
2
|
+
export declare type SelectionTypes = "multiple" | "single";
|
3
|
+
export declare type SelectableCardGroupProps = {
|
4
|
+
disabled?: boolean;
|
5
|
+
name?: string;
|
6
|
+
value?: string[];
|
7
|
+
defaultValue?: string[];
|
8
|
+
type: SelectionTypes;
|
9
|
+
onValueChange?: (value: string[]) => void;
|
10
|
+
className?: string;
|
11
|
+
required?: boolean;
|
12
|
+
};
|
13
|
+
export declare const SelectableCardGroup: FC<PropsWithChildren<SelectableCardGroupProps>>;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.SelectableCardGroup = void 0;
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
+
var _react = require("react");
|
10
|
+
var _ = require("..");
|
11
|
+
var _SelectableCardContext = require("./SelectableCardContext");
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
+
var SelectableCardGroup = exports.SelectableCardGroup = function SelectableCardGroup(_ref) {
|
14
|
+
var _ref2;
|
15
|
+
var children = _ref.children,
|
16
|
+
disabled = _ref.disabled,
|
17
|
+
name = _ref.name,
|
18
|
+
controlledValue = _ref.value,
|
19
|
+
defaultValue = _ref.defaultValue,
|
20
|
+
type = _ref.type,
|
21
|
+
onValueChange = _ref.onValueChange,
|
22
|
+
className = _ref.className,
|
23
|
+
required = _ref.required;
|
24
|
+
var isControlled = controlledValue !== undefined;
|
25
|
+
var _useState = (0, _react.useState)((_ref2 = controlledValue !== null && controlledValue !== void 0 ? controlledValue : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : []),
|
26
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
27
|
+
internalValue = _useState2[0],
|
28
|
+
setInternalValue = _useState2[1];
|
29
|
+
var value = isControlled ? controlledValue : internalValue;
|
30
|
+
var _useField = (0, _.useField)({
|
31
|
+
required: required
|
32
|
+
}),
|
33
|
+
status = _useField.state.status,
|
34
|
+
labelId = _useField.labelId,
|
35
|
+
descriptionId = _useField.descriptionId;
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectableCardContext.SelectableCardContext.Provider, {
|
37
|
+
value: {
|
38
|
+
value: value,
|
39
|
+
setValue: setInternalValue,
|
40
|
+
isControlled: isControlled,
|
41
|
+
name: name,
|
42
|
+
disabled: disabled,
|
43
|
+
onValueChange: onValueChange,
|
44
|
+
type: type
|
45
|
+
},
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
47
|
+
role: type === "single" ? "radiogroup" : "group",
|
48
|
+
"aria-invalid": status === "invalid",
|
49
|
+
"aria-labelledby": labelId,
|
50
|
+
"aria-describedby": descriptionId,
|
51
|
+
className: className,
|
52
|
+
children: children
|
53
|
+
})
|
54
|
+
});
|
55
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _SelectableCard = require("./SelectableCard");
|
7
|
+
Object.keys(_SelectableCard).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _SelectableCard[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function get() {
|
13
|
+
return _SelectableCard[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
17
|
+
var _SelectableCardGroup = require("./SelectableCardGroup");
|
18
|
+
Object.keys(_SelectableCardGroup).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _SelectableCardGroup[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function get() {
|
24
|
+
return _SelectableCardGroup[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
@@ -83,7 +83,7 @@ var Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
83
83
|
role: "switch",
|
84
84
|
ref: ref
|
85
85
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
86
|
-
className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["switch focusable-sibling"])))
|
86
|
+
className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["switch focusable-visible-sibling"])))
|
87
87
|
})]
|
88
88
|
});
|
89
89
|
});
|
package/dist/cjs/Fields/index.js
CHANGED
@@ -146,6 +146,17 @@ Object.keys(_Select).forEach(function (key) {
|
|
146
146
|
}
|
147
147
|
});
|
148
148
|
});
|
149
|
+
var _SelectableCard = require("./SelectableCard");
|
150
|
+
Object.keys(_SelectableCard).forEach(function (key) {
|
151
|
+
if (key === "default" || key === "__esModule") return;
|
152
|
+
if (key in exports && exports[key] === _SelectableCard[key]) return;
|
153
|
+
Object.defineProperty(exports, key, {
|
154
|
+
enumerable: true,
|
155
|
+
get: function get() {
|
156
|
+
return _SelectableCard[key];
|
157
|
+
}
|
158
|
+
});
|
159
|
+
});
|
149
160
|
var _Switch = require("./Switch");
|
150
161
|
Object.keys(_Switch).forEach(function (key) {
|
151
162
|
if (key === "default" || key === "__esModule") return;
|
@@ -7,7 +7,7 @@ var plugin = require("tailwindcss/plugin");
|
|
7
7
|
module.exports = plugin(function (_ref) {
|
8
8
|
var addComponents = _ref.addComponents,
|
9
9
|
theme = _ref.theme;
|
10
|
-
addComponents((0, _defineProperty2["default"])({}, ".focusable:focus,\n .focusable-within:focus-within,\n .focusable-visible:focus-visible,\n .focusable-visible-within:has(:focus-visible),\n input:focus ~ .focusable-sibling,\n .focusable-visible-group:focus-visible .focusable-visible-group-item,\n .focusable-show", {
|
10
|
+
addComponents((0, _defineProperty2["default"])({}, ".focusable:focus,\n .focusable-within:focus-within,\n .focusable-visible:focus-visible,\n .focusable-visible-within:has(:focus-visible),\n input:focus ~ .focusable-sibling,\n input:focus-visible ~ .focusable-visible-sibling,\n .focusable-visible-group:focus-visible .focusable-visible-group-item,\n .focusable-show", {
|
11
11
|
outline: "2px solid ".concat(theme("colors.accent.600")),
|
12
12
|
outlineOffset: "1px"
|
13
13
|
}));
|
@@ -13,6 +13,11 @@ export declare type LinkProps = {
|
|
13
13
|
* The icon to display at the end of the link.
|
14
14
|
*/
|
15
15
|
endIcon?: IconComponentType;
|
16
|
+
/**
|
17
|
+
* To determine if the `ExternalLink` icon should be displayed.
|
18
|
+
* @default true
|
19
|
+
*/
|
20
|
+
withExternalLinkIcon?: boolean;
|
16
21
|
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
17
22
|
/**
|
18
23
|
* The `Link` component is used to display a link.
|
@@ -32,4 +37,9 @@ export declare const Link: import("react").ForwardRefExoticComponent<{
|
|
32
37
|
* The icon to display at the end of the link.
|
33
38
|
*/
|
34
39
|
endIcon?: IconComponentType | undefined;
|
40
|
+
/**
|
41
|
+
* To determine if the `ExternalLink` icon should be displayed.
|
42
|
+
* @default true
|
43
|
+
*/
|
44
|
+
withExternalLinkIcon?: boolean | undefined;
|
35
45
|
} & AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
|
@@ -15,7 +15,7 @@ var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/
|
|
15
15
|
var _useLinkProps = require("./../../utils/useLinkProps");
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
17
|
var _templateObject, _templateObject2, _templateObject3;
|
18
|
-
var _excluded = ["className", "children", "startIcon", "endIcon", "href", "onClick"];
|
18
|
+
var _excluded = ["className", "children", "startIcon", "endIcon", "withExternalLinkIcon", "href", "onClick"];
|
19
19
|
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; }
|
20
20
|
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) { (0, _defineProperty2["default"])(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; }
|
21
21
|
/**
|
@@ -28,6 +28,8 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
28
28
|
children = _ref.children,
|
29
29
|
StartIcon = _ref.startIcon,
|
30
30
|
EndIcon = _ref.endIcon,
|
31
|
+
_ref$withExternalLink = _ref.withExternalLinkIcon,
|
32
|
+
withExternalLinkIcon = _ref$withExternalLink === void 0 ? true : _ref$withExternalLink,
|
31
33
|
href = _ref.href,
|
32
34
|
onClick = _ref.onClick,
|
33
35
|
anchorProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
@@ -36,7 +38,7 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
36
38
|
onClick: onClick
|
37
39
|
}));
|
38
40
|
var isExternalLink = linkProps.target === "_blank" && EndIcon === undefined;
|
39
|
-
if (isExternalLink) {
|
41
|
+
if (isExternalLink && withExternalLinkIcon) {
|
40
42
|
EndIcon = _Icons.ExternalLinkIcon;
|
41
43
|
}
|
42
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", _objectSpread(_objectSpread(_objectSpread({}, anchorProps), linkProps), {}, {
|
@@ -2,6 +2,7 @@
|
|
2
2
|
import type { PolymorphicButtonProps } from "../../Actions/Button/PolymorphicButton";
|
3
3
|
export declare type ButtonLinkProps = Omit<PolymorphicButtonProps<"a">, "as" | "ref"> & {
|
4
4
|
href: string;
|
5
|
+
withExternalLinkIcon?: boolean;
|
5
6
|
};
|
6
7
|
/**
|
7
8
|
* The `ButtonLink` component is used to display a link as a button.
|
@@ -10,4 +11,5 @@ export declare type ButtonLinkProps = Omit<PolymorphicButtonProps<"a">, "as" | "
|
|
10
11
|
*/
|
11
12
|
export declare const ButtonLink: import("react").ForwardRefExoticComponent<Omit<PolymorphicButtonProps<"a">, "ref" | "as"> & {
|
12
13
|
href: string;
|
14
|
+
withExternalLinkIcon?: boolean | undefined;
|
13
15
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
-
var _excluded = ["endIcon", "href", "onClick"];
|
3
|
+
var _excluded = ["endIcon", "href", "onClick", "withExternalLinkIcon"];
|
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
6
|
import { forwardRef } from "react";
|
@@ -17,12 +17,14 @@ export var ButtonLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
17
17
|
var EndIcon = _ref.endIcon,
|
18
18
|
href = _ref.href,
|
19
19
|
onClick = _ref.onClick,
|
20
|
+
_ref$withExternalLink = _ref.withExternalLinkIcon,
|
21
|
+
withExternalLinkIcon = _ref$withExternalLink === void 0 ? true : _ref$withExternalLink,
|
20
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
21
23
|
var linkProps = useLinkProps(_objectSpread(_objectSpread({}, props), {}, {
|
22
24
|
href: href,
|
23
25
|
onClick: onClick
|
24
26
|
}));
|
25
|
-
if (linkProps.target === "_blank" && EndIcon === undefined) {
|
27
|
+
if (linkProps.target === "_blank" && EndIcon === undefined && withExternalLinkIcon) {
|
26
28
|
EndIcon = ExternalLinkIcon;
|
27
29
|
}
|
28
30
|
return /*#__PURE__*/_jsx(PolymorphicButton, _objectSpread(_objectSpread(_objectSpread({}, props), linkProps), {}, {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { ToggleGroupItemProps as RadixToggleGroupItemProps, ToggleGroupMultipleProps as RadixToggleGroupMultipleProps, ToggleGroupSingleProps as RadixToggleGroupSingleProps } from "@radix-ui/react-toggle-group";
|
2
1
|
import type { FC, PropsWithChildren } from "react";
|
3
2
|
import type { ToggleButtonBaseProps } from "../../Actions/ToggleButton/ToggleButtonBase";
|
4
3
|
declare type ToggleGroupSharedProps = {
|
@@ -12,7 +11,7 @@ declare type ToggleGroupSharedProps = {
|
|
12
11
|
*/
|
13
12
|
disabled?: boolean;
|
14
13
|
};
|
15
|
-
declare type ToggleGroupSingleProps = {
|
14
|
+
declare type ToggleGroupSingleProps<T extends string = string> = {
|
16
15
|
/**
|
17
16
|
* Defines whether a single or multiple items can be pressed at a time.
|
18
17
|
*/
|
@@ -21,18 +20,18 @@ declare type ToggleGroupSingleProps = {
|
|
21
20
|
* Defines the controlled value of the pressed item.
|
22
21
|
* Must be used in conjunction with `onChange`.
|
23
22
|
*/
|
24
|
-
value?:
|
23
|
+
value?: T;
|
25
24
|
/**
|
26
25
|
* Defines the value of the item to show as pressed when initially rendered.
|
27
26
|
* Use when you do not need to control the state of the items.
|
28
27
|
*/
|
29
|
-
defaultValue?:
|
28
|
+
defaultValue?: T;
|
30
29
|
/**
|
31
30
|
* Defines the event handler called when the pressed state of an item changes.
|
32
31
|
*/
|
33
|
-
onChange?:
|
32
|
+
onChange?: (value: T) => void;
|
34
33
|
};
|
35
|
-
declare type ToggleGroupMultipleProps = {
|
34
|
+
declare type ToggleGroupMultipleProps<T extends string = string> = {
|
36
35
|
/**
|
37
36
|
* Defines whether a single or multiple items can be pressed at a time.
|
38
37
|
*/
|
@@ -41,24 +40,24 @@ declare type ToggleGroupMultipleProps = {
|
|
41
40
|
* Defines the controlled value of the pressed items.
|
42
41
|
* Must be used in conjunction with `onChange`.
|
43
42
|
*/
|
44
|
-
value?:
|
43
|
+
value?: T[];
|
45
44
|
/**
|
46
45
|
* Defines the values of the items to show as pressed when initially rendered.
|
47
46
|
* Use when you do not need to control the state of the items.
|
48
47
|
*/
|
49
|
-
defaultValue?:
|
48
|
+
defaultValue?: T[];
|
50
49
|
/**
|
51
50
|
* Defines the event handler called when the pressed state of an item changes.
|
52
51
|
*/
|
53
|
-
onChange?:
|
52
|
+
onChange?: (value: T[]) => void;
|
54
53
|
};
|
55
|
-
export declare type ToggleGroupProps = ToggleGroupSharedProps & (ToggleGroupSingleProps | ToggleGroupMultipleProps);
|
56
|
-
declare type ToggleGroupComponent = FC<PropsWithChildren<ToggleGroupProps
|
57
|
-
Item: FC<PropsWithChildren<ToggleGroupItemProps
|
54
|
+
export declare type ToggleGroupProps<T extends string = string> = ToggleGroupSharedProps & (ToggleGroupSingleProps<T> | ToggleGroupMultipleProps<T>);
|
55
|
+
export declare type ToggleGroupComponent<T extends string = string> = FC<PropsWithChildren<ToggleGroupProps<T>>> & {
|
56
|
+
Item: FC<PropsWithChildren<ToggleGroupItemProps<T>>>;
|
58
57
|
};
|
59
|
-
export declare type ToggleGroupItemProps = PropsWithChildren<ToggleButtonBaseProps & {
|
58
|
+
export declare type ToggleGroupItemProps<T extends string = string> = PropsWithChildren<ToggleButtonBaseProps & {
|
60
59
|
/** Defines a unique value for the item. */
|
61
|
-
value:
|
60
|
+
value: T;
|
62
61
|
}>;
|
63
62
|
/**
|
64
63
|
* The `ToggleGroup` component is a toggle group that allows users to select one or more options.
|
@@ -84,8 +84,6 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
84
84
|
value = _ref.value,
|
85
85
|
selectOnBlur = _ref.selectOnBlur,
|
86
86
|
onChange = _ref.onChange,
|
87
|
-
_ref$allowDuplicates = _ref.allowDuplicates,
|
88
|
-
allowDuplicates = _ref$allowDuplicates === void 0 ? false : _ref$allowDuplicates,
|
89
87
|
options = _ref.options,
|
90
88
|
optionItemComponent = _ref.optionItemComponent,
|
91
89
|
creatable = _ref.creatable,
|
@@ -153,7 +151,7 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
153
151
|
return !value ? [] : Array.isArray(value) ? value : [value];
|
154
152
|
}, [value]);
|
155
153
|
var items = useMemo(function () {
|
156
|
-
var results = filter(options !== null && options !== void 0 ? options : [], multiple ? selectedItems : [], inputValue
|
154
|
+
var results = filter(options !== null && options !== void 0 ? options : [], multiple ? selectedItems : [], inputValue);
|
157
155
|
var emptyInputValue = !inputValue || inputValue.trim().length === 0;
|
158
156
|
if (creatable && !emptyInputValue) {
|
159
157
|
results.unshift.apply(results, _toConsumableArray(createFromInputValue(options, inputValue)));
|
@@ -167,7 +165,7 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
167
165
|
});
|
168
166
|
}
|
169
167
|
return results;
|
170
|
-
}, [creatable, createFromInputValue, inputValue, locale, maxItems, multiple, options, selectedItems, showAllItems
|
168
|
+
}, [creatable, createFromInputValue, inputValue, locale, maxItems, multiple, options, selectedItems, showAllItems]);
|
171
169
|
var hasValue = !!selectedItems.length;
|
172
170
|
var showClearButton = !disabled && clearable && hasValue;
|
173
171
|
var multipleSelection = useMultipleSelection({
|
@@ -176,7 +174,7 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
176
174
|
if (typeof changes.selectedItems === "undefined") {
|
177
175
|
onChange(null, changes.type);
|
178
176
|
} else if (multiple) {
|
179
|
-
onChange(
|
177
|
+
onChange(uniqBy(changes.selectedItems, function (i) {
|
180
178
|
return i.value;
|
181
179
|
}), changes.type);
|
182
180
|
} else {
|
@@ -372,7 +370,7 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
372
370
|
option: option,
|
373
371
|
editable: !disabled
|
374
372
|
})
|
375
|
-
}),
|
373
|
+
}), String(option.value)) : /*#__PURE__*/_jsx(Tag, _objectSpread(_objectSpread({
|
376
374
|
onRemove: disabled ? undefined : function (evt) {
|
377
375
|
evt.stopPropagation();
|
378
376
|
multipleSelection.removeSelectedItem(option);
|
@@ -383,7 +381,7 @@ export var AutoComplete = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
383
381
|
index: index
|
384
382
|
})), {}, {
|
385
383
|
children: option.label
|
386
|
-
}),
|
384
|
+
}), String(option.value));
|
387
385
|
}), shouldRenderCustomTemplate && renderValueTemplate({
|
388
386
|
option: value,
|
389
387
|
editable: !disabled
|
@@ -173,10 +173,6 @@ export interface AutoCompleteSingleProps<T extends Option = Option> extends Auto
|
|
173
173
|
* The callback function that is called when the value of the `AutoComplete` changes.
|
174
174
|
*/
|
175
175
|
onChange: (option: T | null, changeType?: AutoCompleteChangeTypesValue) => void;
|
176
|
-
/**
|
177
|
-
* Whether the `AutoComplete` allows duplicate selections (only in `multiple` mode).
|
178
|
-
*/
|
179
|
-
allowDuplicates?: never;
|
180
176
|
}
|
181
177
|
declare type UseMultipleSelectionStateChangeTypesKey = keyof typeof UseMultipleSelectionStateChangeTypes;
|
182
178
|
export declare type AutoCompleteChangeTypesValue = (typeof UseMultipleSelectionStateChangeTypes)[UseMultipleSelectionStateChangeTypesKey];
|
@@ -193,10 +189,6 @@ export interface AutoCompleteMultiProps<T extends Option = Option> extends AutoC
|
|
193
189
|
* The callback function that is called when the value of the `AutoComplete` changes.
|
194
190
|
*/
|
195
191
|
onChange: (option: T[] | null, changeType?: AutoCompleteChangeTypesValue) => void;
|
196
|
-
/**
|
197
|
-
* Whether the `AutoComplete` allows duplicate selections (only in `multiple` mode).
|
198
|
-
*/
|
199
|
-
allowDuplicates?: boolean;
|
200
192
|
}
|
201
193
|
export declare type AutoCompleteProps<T extends Option = Option> = AutoCompleteMultiProps<T> | AutoCompleteSingleProps<T>;
|
202
194
|
declare type OptionsValue = string | number | boolean;
|
@@ -4,5 +4,5 @@ export declare const defaultCreateFromInputValue: <T extends Option = Option>(op
|
|
4
4
|
export declare const caseInsensitiveCreateFromInputValue: <T extends Option = Option>(options: T[] | undefined, inputValue: string) => Option[];
|
5
5
|
export declare const DEFAULT_AUTOCOMPLETE_LOCALE: Required<AutoCompleteLocale>;
|
6
6
|
export declare const optionToString: (option: Option | null | undefined) => string;
|
7
|
-
export declare function filter<T extends Option = Option>(options: T[], selectedItems: T[], itemValue: string
|
7
|
+
export declare function filter<T extends Option = Option>(options: T[], selectedItems: T[], itemValue: string): T[];
|
8
8
|
export declare function inputValueFromProps<T extends Option = Option>(props: AutoCompleteProps<T>): string;
|
@@ -55,13 +55,12 @@ function needlesMatch(needles, option) {
|
|
55
55
|
});
|
56
56
|
}
|
57
57
|
export function filter(options, selectedItems, itemValue) {
|
58
|
-
var allowDuplicates = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
59
58
|
var needles = itemValue.toLowerCase().trim().split(/\s+/);
|
60
59
|
return options.filter(function (option) {
|
61
|
-
return
|
60
|
+
return !selectedItems.some(function (_ref) {
|
62
61
|
var value = _ref.value;
|
63
62
|
return value === option.value;
|
64
|
-
})
|
63
|
+
}) && (option.bypassNeedleMatch || needlesMatch(needles, option));
|
65
64
|
});
|
66
65
|
}
|
67
66
|
export function inputValueFromProps(props) {
|
@@ -15,12 +15,12 @@ declare type CheckboxCustomProps = {
|
|
15
15
|
*/
|
16
16
|
checkedColor?: string;
|
17
17
|
};
|
18
|
-
declare type CheckboxInputProps = Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "required" | "autoFocus" | "disabled" | "checked" | "defaultChecked">;
|
18
|
+
declare type CheckboxInputProps = Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "required" | "autoFocus" | "disabled" | "checked" | "defaultChecked" | "name">;
|
19
19
|
export declare type CheckboxProps = CheckboxInputProps & CheckboxCustomProps;
|
20
20
|
/**
|
21
21
|
* The `Checkbox` component is a control that allows single or multiple selections from a set of options.
|
22
22
|
*
|
23
23
|
* See the [Checkbox documentation page](https://satellite.algolia.com/8261d6576/p/023233-checkbox) for more information.
|
24
24
|
*/
|
25
|
-
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultChecked" | "autoFocus" | "disabled" | "checked" | "required"> & CheckboxCustomProps & import("react").RefAttributes<HTMLInputElement>>;
|
25
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "name" | "onChange" | "defaultChecked" | "autoFocus" | "disabled" | "checked" | "required"> & CheckboxCustomProps & import("react").RefAttributes<HTMLInputElement>>;
|
26
26
|
export {};
|
@@ -66,7 +66,7 @@ export var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
66
66
|
return /*#__PURE__*/_jsxs("div", {
|
67
67
|
className: cx(stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["group/checkbox inline-flex items-center ", ""])), textPosition === "left" && "flex-row-reverse"), className),
|
68
68
|
children: [/*#__PURE__*/_jsxs("span", {
|
69
|
-
className: cx(stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n checkbox focusable-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
|
69
|
+
className: cx(stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n checkbox focusable-visible-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
|
70
70
|
style: {
|
71
71
|
color: checkedColor
|
72
72
|
},
|
@@ -76,7 +76,7 @@ export var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
76
76
|
"aria-labelledby": labelId,
|
77
77
|
"aria-describedby": descriptionId
|
78
78
|
}, checkboxProps), {}, {
|
79
|
-
id: id
|
79
|
+
id: id,
|
80
80
|
required: required,
|
81
81
|
"aria-invalid": status === "invalid",
|
82
82
|
"aria-checked": indeterminate ? "mixed" : isChecked,
|
@@ -135,7 +135,7 @@ export var Dropzone = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
135
135
|
"aria-labelledby": labelId,
|
136
136
|
"aria-describedby": descriptionId,
|
137
137
|
"aria-invalid": isInvalid,
|
138
|
-
className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n relative flex items-center group/dropzone bg-white\n border border-dashed rounded\n overflow-hidden transition-colors\n focusable focus-visible:border-transparent\n min-h-16 p-4\n ", "\n ", "\n ", ""])), disabled ? "cursor-not-allowed border-grey-200" : "cursor-pointer border-grey-500", isDragReject && !disabled ? "border-red-200 cursor-not-allowed" : isDragActive ? "border-accent-500 cursor-pointer" : null, !disabled && (isInvalid ? "bg-red-100 border-red-700 hover:bg-red-50" : "bg-white hover:bg-grey-100")), className),
|
138
|
+
className: cx(stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n relative flex items-center group/dropzone bg-white\n border border-dashed rounded\n overflow-hidden transition-colors\n focusable-visible focus-visible:border-transparent\n min-h-16 p-4\n ", "\n ", "\n ", ""])), disabled ? "cursor-not-allowed border-grey-200" : "cursor-pointer border-grey-500", isDragReject && !disabled ? "border-red-200 cursor-not-allowed" : isDragActive ? "border-accent-500 cursor-pointer" : null, !disabled && (isInvalid ? "bg-red-100 border-red-700 hover:bg-red-50" : "bg-white hover:bg-grey-100")), className),
|
139
139
|
onClick: function onClick(evt) {
|
140
140
|
// Helps with https://github.com/react-dropzone/react-dropzone/issues/182
|
141
141
|
if (evt.target.closest("label")) {
|