stratosphere-ui 3.1.8 → 3.1.9
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps, FC, HTMLProps, MouseEvent } from 'react';
|
|
1
|
+
import { ComponentProps, FC, HTMLProps, MouseEvent, TouchEvent } from 'react';
|
|
2
2
|
export declare const BADGE_COLORS: readonly ["primary", "secondary", "accent", "neutral", "info", "success", "warning", "error", "ghost"];
|
|
3
3
|
export declare const BADGE_SIZES: readonly ["xl", "lg", "md", "sm", "xs"];
|
|
4
4
|
export type BadgeColor = (typeof BADGE_COLORS)[number];
|
|
@@ -8,7 +8,7 @@ export interface BadgeProps extends Omit<HTMLProps<HTMLDivElement>, 'size'> {
|
|
|
8
8
|
dash?: boolean;
|
|
9
9
|
dismissable?: boolean;
|
|
10
10
|
icon?: FC<ComponentProps<'svg'>>;
|
|
11
|
-
onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
onDismiss?: (event: MouseEvent<HTMLButtonElement> | TouchEvent<HTMLButtonElement>) => void;
|
|
12
12
|
outline?: boolean;
|
|
13
13
|
size?: BadgeSize;
|
|
14
14
|
soft?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
export declare const useOutsideClick: (ref: RefObject<HTMLElement>, onClick: (event: DocumentEventMap["mousedown"]) => void) => void;
|
|
2
|
+
export declare const useOutsideClick: (ref: RefObject<HTMLElement>, onClick: (event: DocumentEventMap["mousedown"] | TouchEvent) => void) => void;
|
package/dist/stratosphere-ui.js
CHANGED
|
@@ -4909,6 +4909,9 @@ const lH = ["info", "success", "warning", "error"], SF = ({
|
|
|
4909
4909
|
onKeyDown: (M) => {
|
|
4910
4910
|
M.stopPropagation();
|
|
4911
4911
|
},
|
|
4912
|
+
onTouchEnd: (M) => {
|
|
4913
|
+
M.stopPropagation(), M.preventDefault(), h == null || h(M);
|
|
4914
|
+
},
|
|
4912
4915
|
children: [
|
|
4913
4916
|
/* @__PURE__ */ W.jsx(CF, { className: "h-4 w-4" }),
|
|
4914
4917
|
/* @__PURE__ */ W.jsx("span", { className: "sr-only", children: "Remove badge" })
|
|
@@ -29804,8 +29807,8 @@ const _H = ({
|
|
|
29804
29807
|
const l = (s) => {
|
|
29805
29808
|
n.current !== null && !n.current.contains(s.target) && u(s);
|
|
29806
29809
|
};
|
|
29807
|
-
return document.addEventListener("mousedown", l), () => {
|
|
29808
|
-
document.removeEventListener("mousedown", l);
|
|
29810
|
+
return document.addEventListener("mousedown", l), document.addEventListener("touchstart", l), () => {
|
|
29811
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("touchstart", l);
|
|
29809
29812
|
};
|
|
29810
29813
|
}, [u, n]), Gz = ({
|
|
29811
29814
|
debounceTime: n,
|