@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
@@ -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>>;
|
@@ -12,7 +12,7 @@ var _PolymorphicButton = require("./../Button/PolymorphicButton");
|
|
12
12
|
var _Icons = require("./../../Icons");
|
13
13
|
var _useLinkProps = require("./../../utils/useLinkProps");
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
|
-
var _excluded = ["endIcon", "href", "onClick"];
|
15
|
+
var _excluded = ["endIcon", "href", "onClick", "withExternalLinkIcon"];
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (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; }
|
18
18
|
/**
|
@@ -24,12 +24,14 @@ var ButtonLink = exports.ButtonLink = /*#__PURE__*/(0, _react.forwardRef)(functi
|
|
24
24
|
var EndIcon = _ref.endIcon,
|
25
25
|
href = _ref.href,
|
26
26
|
onClick = _ref.onClick,
|
27
|
+
_ref$withExternalLink = _ref.withExternalLinkIcon,
|
28
|
+
withExternalLinkIcon = _ref$withExternalLink === void 0 ? true : _ref$withExternalLink,
|
27
29
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
28
30
|
var linkProps = (0, _useLinkProps.useLinkProps)(_objectSpread(_objectSpread({}, props), {}, {
|
29
31
|
href: href,
|
30
32
|
onClick: onClick
|
31
33
|
}));
|
32
|
-
if (linkProps.target === "_blank" && EndIcon === undefined) {
|
34
|
+
if (linkProps.target === "_blank" && EndIcon === undefined && withExternalLinkIcon) {
|
33
35
|
EndIcon = _Icons.ExternalLinkIcon;
|
34
36
|
}
|
35
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PolymorphicButton.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.
|
@@ -88,8 +88,6 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
88
88
|
value = _ref.value,
|
89
89
|
selectOnBlur = _ref.selectOnBlur,
|
90
90
|
onChange = _ref.onChange,
|
91
|
-
_ref$allowDuplicates = _ref.allowDuplicates,
|
92
|
-
allowDuplicates = _ref$allowDuplicates === void 0 ? false : _ref$allowDuplicates,
|
93
91
|
options = _ref.options,
|
94
92
|
optionItemComponent = _ref.optionItemComponent,
|
95
93
|
creatable = _ref.creatable,
|
@@ -157,7 +155,7 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
157
155
|
return !value ? [] : Array.isArray(value) ? value : [value];
|
158
156
|
}, [value]);
|
159
157
|
var items = (0, _react.useMemo)(function () {
|
160
|
-
var results = (0, _utils.filter)(options !== null && options !== void 0 ? options : [], multiple ? selectedItems : [], inputValue
|
158
|
+
var results = (0, _utils.filter)(options !== null && options !== void 0 ? options : [], multiple ? selectedItems : [], inputValue);
|
161
159
|
var emptyInputValue = !inputValue || inputValue.trim().length === 0;
|
162
160
|
if (creatable && !emptyInputValue) {
|
163
161
|
results.unshift.apply(results, (0, _toConsumableArray2["default"])(createFromInputValue(options, inputValue)));
|
@@ -171,7 +169,7 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
171
169
|
});
|
172
170
|
}
|
173
171
|
return results;
|
174
|
-
}, [creatable, createFromInputValue, inputValue, locale, maxItems, multiple, options, selectedItems, showAllItems
|
172
|
+
}, [creatable, createFromInputValue, inputValue, locale, maxItems, multiple, options, selectedItems, showAllItems]);
|
175
173
|
var hasValue = !!selectedItems.length;
|
176
174
|
var showClearButton = !disabled && clearable && hasValue;
|
177
175
|
var multipleSelection = (0, _downshift.useMultipleSelection)({
|
@@ -180,7 +178,7 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
180
178
|
if (typeof changes.selectedItems === "undefined") {
|
181
179
|
onChange(null, changes.type);
|
182
180
|
} else if (multiple) {
|
183
|
-
onChange(
|
181
|
+
onChange((0, _uniqBy.uniqBy)(changes.selectedItems, function (i) {
|
184
182
|
return i.value;
|
185
183
|
}), changes.type);
|
186
184
|
} else {
|
@@ -376,7 +374,7 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
376
374
|
option: option,
|
377
375
|
editable: !disabled
|
378
376
|
})
|
379
|
-
}),
|
377
|
+
}), String(option.value)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Indicators.Tag, _objectSpread(_objectSpread({
|
380
378
|
onRemove: disabled ? undefined : function (evt) {
|
381
379
|
evt.stopPropagation();
|
382
380
|
multipleSelection.removeSelectedItem(option);
|
@@ -387,7 +385,7 @@ var AutoComplete = exports.AutoComplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
387
385
|
index: index
|
388
386
|
})), {}, {
|
389
387
|
children: option.label
|
390
|
-
}),
|
388
|
+
}), String(option.value));
|
391
389
|
}), shouldRenderCustomTemplate && renderValueTemplate({
|
392
390
|
option: value,
|
393
391
|
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;
|
@@ -65,13 +65,12 @@ function needlesMatch(needles, option) {
|
|
65
65
|
});
|
66
66
|
}
|
67
67
|
function filter(options, selectedItems, itemValue) {
|
68
|
-
var allowDuplicates = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
69
68
|
var needles = itemValue.toLowerCase().trim().split(/\s+/);
|
70
69
|
return options.filter(function (option) {
|
71
|
-
return
|
70
|
+
return !selectedItems.some(function (_ref) {
|
72
71
|
var value = _ref.value;
|
73
72
|
return value === option.value;
|
74
|
-
})
|
73
|
+
}) && (option.bypassNeedleMatch || needlesMatch(needles, option));
|
75
74
|
});
|
76
75
|
}
|
77
76
|
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 {};
|
@@ -73,7 +73,7 @@ var Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
73
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
74
74
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["group/checkbox inline-flex items-center ", ""])), textPosition === "left" && "flex-row-reverse"), className),
|
75
75
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
76
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n checkbox focusable-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
|
76
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n checkbox focusable-visible-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
|
77
77
|
style: {
|
78
78
|
color: checkedColor
|
79
79
|
},
|
@@ -83,7 +83,7 @@ var Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
83
83
|
"aria-labelledby": labelId,
|
84
84
|
"aria-describedby": descriptionId
|
85
85
|
}, checkboxProps), {}, {
|
86
|
-
id: id
|
86
|
+
id: id,
|
87
87
|
required: required,
|
88
88
|
"aria-invalid": status === "invalid",
|
89
89
|
"aria-checked": indeterminate ? "mixed" : isChecked,
|
@@ -142,7 +142,7 @@ var Dropzone = exports.Dropzone = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
142
142
|
"aria-labelledby": labelId,
|
143
143
|
"aria-describedby": descriptionId,
|
144
144
|
"aria-invalid": isInvalid,
|
145
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\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),
|
145
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\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),
|
146
146
|
onClick: function onClick(evt) {
|
147
147
|
// Helps with https://github.com/react-dropzone/react-dropzone/issues/182
|
148
148
|
if (evt.target.closest("label")) {
|