@mlw-packages/react-components 1.8.12 → 1.8.14
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/index.css +0 -5
- package/dist/index.d.mts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +39 -24
- package/dist/index.mjs +39 -24
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -4770,11 +4770,6 @@ body {
|
|
|
4770
4770
|
--tw-scale-y: .95;
|
|
4771
4771
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
4772
4772
|
}
|
|
4773
|
-
.active\:scale-\[0\.98\]:active {
|
|
4774
|
-
--tw-scale-x: 0.98;
|
|
4775
|
-
--tw-scale-y: 0.98;
|
|
4776
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
4777
|
-
}
|
|
4778
4773
|
.active\:bg-accent\/80:active {
|
|
4779
4774
|
background-color: hsl(var(--accent) / 0.8);
|
|
4780
4775
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1543,6 +1543,7 @@ interface SelectTestIds {
|
|
|
1543
1543
|
paginationPrev?: string;
|
|
1544
1544
|
paginationNext?: string;
|
|
1545
1545
|
paginationPage?: (page: number) => string;
|
|
1546
|
+
empty?: string;
|
|
1546
1547
|
}
|
|
1547
1548
|
interface DefaultSelectProps<T extends string> extends ErrorMessageProps {
|
|
1548
1549
|
selected: T | null;
|
|
@@ -1559,6 +1560,7 @@ interface SelectPropsWithItems<T extends string> extends DefaultSelectProps<T> {
|
|
|
1559
1560
|
items: SelectItem<T>[];
|
|
1560
1561
|
groupItems?: never;
|
|
1561
1562
|
testIds?: SelectTestIds;
|
|
1563
|
+
empty?: React__default.ReactNode;
|
|
1562
1564
|
}
|
|
1563
1565
|
interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps<T> {
|
|
1564
1566
|
items?: never;
|
|
@@ -1566,9 +1568,10 @@ interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps
|
|
|
1566
1568
|
[key: string]: SelectItem<T>[];
|
|
1567
1569
|
};
|
|
1568
1570
|
testIds?: SelectTestIds;
|
|
1571
|
+
empty?: React__default.ReactNode;
|
|
1569
1572
|
}
|
|
1570
1573
|
type NewSelectProps<T extends string> = SelectPropsWithItems<T> | SelectPropsWithGroupItems<T>;
|
|
1571
|
-
declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, disabled, selected, label, labelClassname, className, pagination, hideClear, }: NewSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
1574
|
+
declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, disabled, selected, label, labelClassname, className, pagination, hideClear, empty }: NewSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
1572
1575
|
|
|
1573
1576
|
type Primitive = string | number | boolean | null | undefined;
|
|
1574
1577
|
interface ChartData$4 {
|
|
@@ -2079,7 +2082,7 @@ interface BrushProps {
|
|
|
2079
2082
|
legend?: string;
|
|
2080
2083
|
startIndex: number;
|
|
2081
2084
|
endIndex: number;
|
|
2082
|
-
onMouseDown: (e: React__default.MouseEvent, type: "start" | "end" | "middle") => void;
|
|
2085
|
+
onMouseDown: (e: React__default.MouseEvent | React__default.TouchEvent, type: "start" | "end" | "middle") => void;
|
|
2083
2086
|
brushRef: React__default.RefObject<HTMLDivElement | null>;
|
|
2084
2087
|
xAxisKey: string;
|
|
2085
2088
|
seriesOrder: Array<{
|
|
@@ -2183,7 +2186,7 @@ declare function useTimeSeriesRange({ dataLength, defaultStartIndex, defaultEndI
|
|
|
2183
2186
|
endIndex: number;
|
|
2184
2187
|
isDragging: "end" | "start" | "middle" | null;
|
|
2185
2188
|
brushRef: React$1.RefObject<HTMLDivElement | null>;
|
|
2186
|
-
handleMouseDown: (e: React.MouseEvent, type: "start" | "end" | "middle") => void;
|
|
2189
|
+
handleMouseDown: (e: React.MouseEvent | React.TouchEvent, type: "start" | "end" | "middle") => void;
|
|
2187
2190
|
};
|
|
2188
2191
|
|
|
2189
2192
|
interface NoDataProps {
|
|
@@ -2211,7 +2214,7 @@ interface LeaderboardProps<T extends string> {
|
|
|
2211
2214
|
}
|
|
2212
2215
|
declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
|
|
2213
2216
|
|
|
2214
|
-
type
|
|
2217
|
+
type NumericInputProps = {
|
|
2215
2218
|
value: number;
|
|
2216
2219
|
onChange: (value: number) => void;
|
|
2217
2220
|
min?: number;
|
|
@@ -2225,7 +2228,7 @@ type PlanInputProps = {
|
|
|
2225
2228
|
hideConfirm?: boolean;
|
|
2226
2229
|
numericKeyboard?: boolean;
|
|
2227
2230
|
};
|
|
2228
|
-
declare function NumericInput({ value, onChange, min, max, label, className, error, isLoading, disabled, tooltip_on_overflow, hideConfirm, numericKeyboard, }:
|
|
2231
|
+
declare function NumericInput({ value, onChange, min, max, label, className, error, isLoading, disabled, tooltip_on_overflow, hideConfirm, numericKeyboard, }: NumericInputProps): react_jsx_runtime.JSX.Element;
|
|
2229
2232
|
|
|
2230
2233
|
declare function useIsMobile(): boolean;
|
|
2231
2234
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1543,6 +1543,7 @@ interface SelectTestIds {
|
|
|
1543
1543
|
paginationPrev?: string;
|
|
1544
1544
|
paginationNext?: string;
|
|
1545
1545
|
paginationPage?: (page: number) => string;
|
|
1546
|
+
empty?: string;
|
|
1546
1547
|
}
|
|
1547
1548
|
interface DefaultSelectProps<T extends string> extends ErrorMessageProps {
|
|
1548
1549
|
selected: T | null;
|
|
@@ -1559,6 +1560,7 @@ interface SelectPropsWithItems<T extends string> extends DefaultSelectProps<T> {
|
|
|
1559
1560
|
items: SelectItem<T>[];
|
|
1560
1561
|
groupItems?: never;
|
|
1561
1562
|
testIds?: SelectTestIds;
|
|
1563
|
+
empty?: React__default.ReactNode;
|
|
1562
1564
|
}
|
|
1563
1565
|
interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps<T> {
|
|
1564
1566
|
items?: never;
|
|
@@ -1566,9 +1568,10 @@ interface SelectPropsWithGroupItems<T extends string> extends DefaultSelectProps
|
|
|
1566
1568
|
[key: string]: SelectItem<T>[];
|
|
1567
1569
|
};
|
|
1568
1570
|
testIds?: SelectTestIds;
|
|
1571
|
+
empty?: React__default.ReactNode;
|
|
1569
1572
|
}
|
|
1570
1573
|
type NewSelectProps<T extends string> = SelectPropsWithItems<T> | SelectPropsWithGroupItems<T>;
|
|
1571
|
-
declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, disabled, selected, label, labelClassname, className, pagination, hideClear, }: NewSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
1574
|
+
declare function Select<T extends string>({ items, groupItems, placeholder, onChange, error, testIds, disabled, selected, label, labelClassname, className, pagination, hideClear, empty }: NewSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
1572
1575
|
|
|
1573
1576
|
type Primitive = string | number | boolean | null | undefined;
|
|
1574
1577
|
interface ChartData$4 {
|
|
@@ -2079,7 +2082,7 @@ interface BrushProps {
|
|
|
2079
2082
|
legend?: string;
|
|
2080
2083
|
startIndex: number;
|
|
2081
2084
|
endIndex: number;
|
|
2082
|
-
onMouseDown: (e: React__default.MouseEvent, type: "start" | "end" | "middle") => void;
|
|
2085
|
+
onMouseDown: (e: React__default.MouseEvent | React__default.TouchEvent, type: "start" | "end" | "middle") => void;
|
|
2083
2086
|
brushRef: React__default.RefObject<HTMLDivElement | null>;
|
|
2084
2087
|
xAxisKey: string;
|
|
2085
2088
|
seriesOrder: Array<{
|
|
@@ -2183,7 +2186,7 @@ declare function useTimeSeriesRange({ dataLength, defaultStartIndex, defaultEndI
|
|
|
2183
2186
|
endIndex: number;
|
|
2184
2187
|
isDragging: "end" | "start" | "middle" | null;
|
|
2185
2188
|
brushRef: React$1.RefObject<HTMLDivElement | null>;
|
|
2186
|
-
handleMouseDown: (e: React.MouseEvent, type: "start" | "end" | "middle") => void;
|
|
2189
|
+
handleMouseDown: (e: React.MouseEvent | React.TouchEvent, type: "start" | "end" | "middle") => void;
|
|
2187
2190
|
};
|
|
2188
2191
|
|
|
2189
2192
|
interface NoDataProps {
|
|
@@ -2211,7 +2214,7 @@ interface LeaderboardProps<T extends string> {
|
|
|
2211
2214
|
}
|
|
2212
2215
|
declare function Leaderboard<T extends string>({ items, order: initialOrder, title, className, isLoading, legend, }: LeaderboardProps<T>): react_jsx_runtime.JSX.Element;
|
|
2213
2216
|
|
|
2214
|
-
type
|
|
2217
|
+
type NumericInputProps = {
|
|
2215
2218
|
value: number;
|
|
2216
2219
|
onChange: (value: number) => void;
|
|
2217
2220
|
min?: number;
|
|
@@ -2225,7 +2228,7 @@ type PlanInputProps = {
|
|
|
2225
2228
|
hideConfirm?: boolean;
|
|
2226
2229
|
numericKeyboard?: boolean;
|
|
2227
2230
|
};
|
|
2228
|
-
declare function NumericInput({ value, onChange, min, max, label, className, error, isLoading, disabled, tooltip_on_overflow, hideConfirm, numericKeyboard, }:
|
|
2231
|
+
declare function NumericInput({ value, onChange, min, max, label, className, error, isLoading, disabled, tooltip_on_overflow, hideConfirm, numericKeyboard, }: NumericInputProps): react_jsx_runtime.JSX.Element;
|
|
2229
2232
|
|
|
2230
2233
|
declare function useIsMobile(): boolean;
|
|
2231
2234
|
|
package/dist/index.js
CHANGED
|
@@ -670,7 +670,7 @@ var DialogOverlayBase = React33__namespace.forwardRef(({ className, testid: data
|
|
|
670
670
|
{
|
|
671
671
|
ref,
|
|
672
672
|
className: cn(
|
|
673
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
673
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 border-border",
|
|
674
674
|
className
|
|
675
675
|
),
|
|
676
676
|
"data-testid": dataTestId,
|
|
@@ -1902,7 +1902,7 @@ var CommandBase = React33__namespace.forwardRef(({ className, testid: dataTestId
|
|
|
1902
1902
|
{
|
|
1903
1903
|
ref,
|
|
1904
1904
|
className: cn(
|
|
1905
|
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground",
|
|
1905
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground border-border",
|
|
1906
1906
|
className
|
|
1907
1907
|
),
|
|
1908
1908
|
"data-testid": dataTestId,
|
|
@@ -1924,13 +1924,13 @@ var CommandDialogBase = ({ children, open, ...props }) => {
|
|
|
1924
1924
|
exit: "exit",
|
|
1925
1925
|
variants: dialogVariants,
|
|
1926
1926
|
transition: { duration: 0.2, ease: "easeOut" },
|
|
1927
|
-
className: "overflow-hidden p-0",
|
|
1927
|
+
className: "overflow-hidden p-0 ",
|
|
1928
1928
|
children: /* @__PURE__ */ jsxRuntime.jsx(CommandBase, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
1929
1929
|
},
|
|
1930
1930
|
"command-dialog"
|
|
1931
1931
|
) }) }) });
|
|
1932
1932
|
};
|
|
1933
|
-
var CommandInputBase = React33__namespace.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
1933
|
+
var CommandInputBase = React33__namespace.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3 border-border", "cmdk-input-wrapper": "", children: [
|
|
1934
1934
|
/* @__PURE__ */ jsxRuntime.jsx(react.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
1935
1935
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1936
1936
|
cmdk.Command.Input,
|
|
@@ -2026,7 +2026,7 @@ var CommandItemBase = React33__namespace.forwardRef(({ className, testid: dataTe
|
|
|
2026
2026
|
{
|
|
2027
2027
|
ref,
|
|
2028
2028
|
className: cn(
|
|
2029
|
-
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-muted data-[selected=true]:text-primary data-[disabled=true]:opacity-50 aria-[selected=true]:bg-accent hover:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
2029
|
+
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-muted data-[selected=true]:text-primary data-[disabled=true]:opacity-50 aria-[selected=true]:bg-accent hover:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 ",
|
|
2030
2030
|
className
|
|
2031
2031
|
),
|
|
2032
2032
|
"data-testid": dataTestId,
|
|
@@ -2084,15 +2084,12 @@ PopoverContentBase.displayName = PopoverPrimitive__namespace.Content.displayName
|
|
|
2084
2084
|
function ClearButton({
|
|
2085
2085
|
onClick,
|
|
2086
2086
|
ariaLabel = "Limpar sele\xE7\xE3o",
|
|
2087
|
-
className
|
|
2088
|
-
variant = "ghost",
|
|
2089
|
-
size = "icon"
|
|
2087
|
+
className
|
|
2090
2088
|
}) {
|
|
2091
2089
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2092
|
-
|
|
2090
|
+
"span",
|
|
2093
2091
|
{
|
|
2094
|
-
|
|
2095
|
-
size,
|
|
2092
|
+
role: "button",
|
|
2096
2093
|
"aria-label": ariaLabel,
|
|
2097
2094
|
tabIndex: -1,
|
|
2098
2095
|
onPointerDown: (e) => {
|
|
@@ -2107,7 +2104,7 @@ function ClearButton({
|
|
|
2107
2104
|
onClick?.(e);
|
|
2108
2105
|
},
|
|
2109
2106
|
className: cn(
|
|
2110
|
-
"flex justify-center hover:text-red-500 hover:bg-transparent",
|
|
2107
|
+
"flex justify-center hover:text-red-500 hover:bg-transparent p-1 transition-all text-gray-500 cursor-pointer",
|
|
2111
2108
|
className
|
|
2112
2109
|
),
|
|
2113
2110
|
children: /* @__PURE__ */ jsxRuntime.jsx(ssr.XIcon, { className: `w-4 h-4 ${className}` })
|
|
@@ -2158,7 +2155,7 @@ function ComboboxBase({
|
|
|
2158
2155
|
"aria-disabled": disabled || void 0,
|
|
2159
2156
|
disabled,
|
|
2160
2157
|
className: cn(
|
|
2161
|
-
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9`,
|
|
2158
|
+
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation`,
|
|
2162
2159
|
error && "border-red-500"
|
|
2163
2160
|
),
|
|
2164
2161
|
"data-testid": testIds.trigger ?? "combobox-trigger",
|
|
@@ -2631,7 +2628,7 @@ function MultiSelectContentBase({
|
|
|
2631
2628
|
PopoverContentBase,
|
|
2632
2629
|
{
|
|
2633
2630
|
forceMount: true,
|
|
2634
|
-
className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0",
|
|
2631
|
+
className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0 border-border",
|
|
2635
2632
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2636
2633
|
framerMotion.motion.div,
|
|
2637
2634
|
{
|
|
@@ -2657,7 +2654,7 @@ function MultiSelectContentBase({
|
|
|
2657
2654
|
placeholder: typeof search === "object" ? search.placeholder : void 0
|
|
2658
2655
|
}
|
|
2659
2656
|
) : /* @__PURE__ */ jsxRuntime.jsx("button", { autoFocus: true, className: "sr-only" }),
|
|
2660
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CommandListBase, { children: [
|
|
2657
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CommandListBase, { className: "border-border", children: [
|
|
2661
2658
|
canSearch && /* @__PURE__ */ jsxRuntime.jsx(CommandEmptyBase, { children: typeof search === "object" ? search.emptyMessage ?? emptyMessage : emptyMessage }),
|
|
2662
2659
|
children
|
|
2663
2660
|
] })
|
|
@@ -9807,7 +9804,8 @@ function Select({
|
|
|
9807
9804
|
labelClassname,
|
|
9808
9805
|
className,
|
|
9809
9806
|
pagination,
|
|
9810
|
-
hideClear = false
|
|
9807
|
+
hideClear = false,
|
|
9808
|
+
empty
|
|
9811
9809
|
}) {
|
|
9812
9810
|
const [page, setPage] = React33.useState(1);
|
|
9813
9811
|
const [animating, setAnimating] = React33.useState(false);
|
|
@@ -9899,7 +9897,7 @@ function Select({
|
|
|
9899
9897
|
]
|
|
9900
9898
|
}
|
|
9901
9899
|
),
|
|
9902
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsxRuntime.jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9900
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsxRuntime.jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: empty ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: empty }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: pagination && pagination > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9903
9901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9904
9902
|
"div",
|
|
9905
9903
|
{
|
|
@@ -10012,7 +10010,7 @@ function Select({
|
|
|
10012
10010
|
item.value
|
|
10013
10011
|
))
|
|
10014
10012
|
}
|
|
10015
|
-
) }) }) })
|
|
10013
|
+
) }) }) }) })
|
|
10016
10014
|
]
|
|
10017
10015
|
}
|
|
10018
10016
|
),
|
|
@@ -13824,7 +13822,7 @@ function MultiSelect({
|
|
|
13824
13822
|
MultiSelectTriggerBase,
|
|
13825
13823
|
{
|
|
13826
13824
|
className: cn(
|
|
13827
|
-
"flex items-center gap-2 justify-between",
|
|
13825
|
+
"flex items-center gap-2 justify-between hover:bg-muted transition-all duration-150",
|
|
13828
13826
|
error && "border-red-500",
|
|
13829
13827
|
className
|
|
13830
13828
|
),
|
|
@@ -15807,22 +15805,27 @@ var Brush = ({
|
|
|
15807
15805
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15808
15806
|
"div",
|
|
15809
15807
|
{
|
|
15810
|
-
className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md",
|
|
15808
|
+
className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md touch-none",
|
|
15811
15809
|
style: {
|
|
15812
15810
|
left: `${startIndex / (dataLength - 1) * 100}%`,
|
|
15813
15811
|
right: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`,
|
|
15814
15812
|
backgroundColor: "transparent"
|
|
15815
15813
|
},
|
|
15816
15814
|
onMouseDown: (e) => onMouseDown(e, "middle"),
|
|
15815
|
+
onTouchStart: (e) => onMouseDown(e, "middle"),
|
|
15817
15816
|
children: [
|
|
15818
15817
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15819
15818
|
"div",
|
|
15820
15819
|
{
|
|
15821
|
-
className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
15820
|
+
className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle touch-none",
|
|
15822
15821
|
onMouseDown: (e) => {
|
|
15823
15822
|
e.stopPropagation();
|
|
15824
15823
|
onMouseDown(e, "start");
|
|
15825
15824
|
},
|
|
15825
|
+
onTouchStart: (e) => {
|
|
15826
|
+
e.stopPropagation();
|
|
15827
|
+
onMouseDown(e, "start");
|
|
15828
|
+
},
|
|
15826
15829
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15827
15830
|
"div",
|
|
15828
15831
|
{
|
|
@@ -15837,11 +15840,15 @@ var Brush = ({
|
|
|
15837
15840
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15838
15841
|
"div",
|
|
15839
15842
|
{
|
|
15840
|
-
className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
15843
|
+
className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle touch-none",
|
|
15841
15844
|
onMouseDown: (e) => {
|
|
15842
15845
|
e.stopPropagation();
|
|
15843
15846
|
onMouseDown(e, "end");
|
|
15844
15847
|
},
|
|
15848
|
+
onTouchStart: (e) => {
|
|
15849
|
+
e.stopPropagation();
|
|
15850
|
+
onMouseDown(e, "end");
|
|
15851
|
+
},
|
|
15845
15852
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15846
15853
|
"div",
|
|
15847
15854
|
{
|
|
@@ -16568,8 +16575,10 @@ function useTimeSeriesRange({
|
|
|
16568
16575
|
const handleMouseDown = React33.useCallback(
|
|
16569
16576
|
(e, type) => {
|
|
16570
16577
|
e.preventDefault();
|
|
16578
|
+
const isTouchEvent = "touches" in e;
|
|
16579
|
+
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
16571
16580
|
setIsDragging(type);
|
|
16572
|
-
setDragStartX(
|
|
16581
|
+
setDragStartX(clientX);
|
|
16573
16582
|
setInitialStartIndex(startIndex);
|
|
16574
16583
|
setInitialEndIndex(endIndex);
|
|
16575
16584
|
},
|
|
@@ -16578,8 +16587,10 @@ function useTimeSeriesRange({
|
|
|
16578
16587
|
const handleMouseMove = React33.useCallback(
|
|
16579
16588
|
(e) => {
|
|
16580
16589
|
if (!isDragging || !brushRef.current) return;
|
|
16590
|
+
const isTouchEvent = "touches" in e;
|
|
16591
|
+
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
16581
16592
|
const brushWidth = brushRef.current.offsetWidth;
|
|
16582
|
-
const deltaX =
|
|
16593
|
+
const deltaX = clientX - dragStartX;
|
|
16583
16594
|
const indexDelta = Math.round(deltaX / brushWidth * dataLength);
|
|
16584
16595
|
if (isDragging === "start") {
|
|
16585
16596
|
const newStart = Math.max(
|
|
@@ -16625,9 +16636,13 @@ function useTimeSeriesRange({
|
|
|
16625
16636
|
if (isDragging) {
|
|
16626
16637
|
document.addEventListener("mousemove", handleMouseMove);
|
|
16627
16638
|
document.addEventListener("mouseup", handleMouseUp);
|
|
16639
|
+
document.addEventListener("touchmove", handleMouseMove);
|
|
16640
|
+
document.addEventListener("touchend", handleMouseUp);
|
|
16628
16641
|
return () => {
|
|
16629
16642
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
16630
16643
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
16644
|
+
document.removeEventListener("touchmove", handleMouseMove);
|
|
16645
|
+
document.removeEventListener("touchend", handleMouseUp);
|
|
16631
16646
|
};
|
|
16632
16647
|
}
|
|
16633
16648
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
package/dist/index.mjs
CHANGED
|
@@ -627,7 +627,7 @@ var DialogOverlayBase = React33.forwardRef(({ className, testid: dataTestId = "d
|
|
|
627
627
|
{
|
|
628
628
|
ref,
|
|
629
629
|
className: cn(
|
|
630
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
630
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 border-border",
|
|
631
631
|
className
|
|
632
632
|
),
|
|
633
633
|
"data-testid": dataTestId,
|
|
@@ -1859,7 +1859,7 @@ var CommandBase = React33.forwardRef(({ className, testid: dataTestId = "command
|
|
|
1859
1859
|
{
|
|
1860
1860
|
ref,
|
|
1861
1861
|
className: cn(
|
|
1862
|
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground",
|
|
1862
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground border-border",
|
|
1863
1863
|
className
|
|
1864
1864
|
),
|
|
1865
1865
|
"data-testid": dataTestId,
|
|
@@ -1881,13 +1881,13 @@ var CommandDialogBase = ({ children, open, ...props }) => {
|
|
|
1881
1881
|
exit: "exit",
|
|
1882
1882
|
variants: dialogVariants,
|
|
1883
1883
|
transition: { duration: 0.2, ease: "easeOut" },
|
|
1884
|
-
className: "overflow-hidden p-0",
|
|
1884
|
+
className: "overflow-hidden p-0 ",
|
|
1885
1885
|
children: /* @__PURE__ */ jsx(CommandBase, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
1886
1886
|
},
|
|
1887
1887
|
"command-dialog"
|
|
1888
1888
|
) }) }) });
|
|
1889
1889
|
};
|
|
1890
|
-
var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
1890
|
+
var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3 border-border", "cmdk-input-wrapper": "", children: [
|
|
1891
1891
|
/* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
1892
1892
|
/* @__PURE__ */ jsx(
|
|
1893
1893
|
Command.Input,
|
|
@@ -1983,7 +1983,7 @@ var CommandItemBase = React33.forwardRef(({ className, testid: dataTestId = "com
|
|
|
1983
1983
|
{
|
|
1984
1984
|
ref,
|
|
1985
1985
|
className: cn(
|
|
1986
|
-
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-muted data-[selected=true]:text-primary data-[disabled=true]:opacity-50 aria-[selected=true]:bg-accent hover:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
1986
|
+
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-muted data-[selected=true]:text-primary data-[disabled=true]:opacity-50 aria-[selected=true]:bg-accent hover:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 ",
|
|
1987
1987
|
className
|
|
1988
1988
|
),
|
|
1989
1989
|
"data-testid": dataTestId,
|
|
@@ -2041,15 +2041,12 @@ PopoverContentBase.displayName = PopoverPrimitive.Content.displayName;
|
|
|
2041
2041
|
function ClearButton({
|
|
2042
2042
|
onClick,
|
|
2043
2043
|
ariaLabel = "Limpar sele\xE7\xE3o",
|
|
2044
|
-
className
|
|
2045
|
-
variant = "ghost",
|
|
2046
|
-
size = "icon"
|
|
2044
|
+
className
|
|
2047
2045
|
}) {
|
|
2048
2046
|
return /* @__PURE__ */ jsx(
|
|
2049
|
-
|
|
2047
|
+
"span",
|
|
2050
2048
|
{
|
|
2051
|
-
|
|
2052
|
-
size,
|
|
2049
|
+
role: "button",
|
|
2053
2050
|
"aria-label": ariaLabel,
|
|
2054
2051
|
tabIndex: -1,
|
|
2055
2052
|
onPointerDown: (e) => {
|
|
@@ -2064,7 +2061,7 @@ function ClearButton({
|
|
|
2064
2061
|
onClick?.(e);
|
|
2065
2062
|
},
|
|
2066
2063
|
className: cn(
|
|
2067
|
-
"flex justify-center hover:text-red-500 hover:bg-transparent",
|
|
2064
|
+
"flex justify-center hover:text-red-500 hover:bg-transparent p-1 transition-all text-gray-500 cursor-pointer",
|
|
2068
2065
|
className
|
|
2069
2066
|
),
|
|
2070
2067
|
children: /* @__PURE__ */ jsx(XIcon$1, { className: `w-4 h-4 ${className}` })
|
|
@@ -2115,7 +2112,7 @@ function ComboboxBase({
|
|
|
2115
2112
|
"aria-disabled": disabled || void 0,
|
|
2116
2113
|
disabled,
|
|
2117
2114
|
className: cn(
|
|
2118
|
-
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9`,
|
|
2115
|
+
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation`,
|
|
2119
2116
|
error && "border-red-500"
|
|
2120
2117
|
),
|
|
2121
2118
|
"data-testid": testIds.trigger ?? "combobox-trigger",
|
|
@@ -2588,7 +2585,7 @@ function MultiSelectContentBase({
|
|
|
2588
2585
|
PopoverContentBase,
|
|
2589
2586
|
{
|
|
2590
2587
|
forceMount: true,
|
|
2591
|
-
className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0",
|
|
2588
|
+
className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0 border-border",
|
|
2592
2589
|
children: /* @__PURE__ */ jsx(
|
|
2593
2590
|
motion.div,
|
|
2594
2591
|
{
|
|
@@ -2614,7 +2611,7 @@ function MultiSelectContentBase({
|
|
|
2614
2611
|
placeholder: typeof search === "object" ? search.placeholder : void 0
|
|
2615
2612
|
}
|
|
2616
2613
|
) : /* @__PURE__ */ jsx("button", { autoFocus: true, className: "sr-only" }),
|
|
2617
|
-
/* @__PURE__ */ jsxs(CommandListBase, { children: [
|
|
2614
|
+
/* @__PURE__ */ jsxs(CommandListBase, { className: "border-border", children: [
|
|
2618
2615
|
canSearch && /* @__PURE__ */ jsx(CommandEmptyBase, { children: typeof search === "object" ? search.emptyMessage ?? emptyMessage : emptyMessage }),
|
|
2619
2616
|
children
|
|
2620
2617
|
] })
|
|
@@ -9764,7 +9761,8 @@ function Select({
|
|
|
9764
9761
|
labelClassname,
|
|
9765
9762
|
className,
|
|
9766
9763
|
pagination,
|
|
9767
|
-
hideClear = false
|
|
9764
|
+
hideClear = false,
|
|
9765
|
+
empty
|
|
9768
9766
|
}) {
|
|
9769
9767
|
const [page, setPage] = useState(1);
|
|
9770
9768
|
const [animating, setAnimating] = useState(false);
|
|
@@ -9856,7 +9854,7 @@ function Select({
|
|
|
9856
9854
|
]
|
|
9857
9855
|
}
|
|
9858
9856
|
),
|
|
9859
|
-
/* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9857
|
+
/* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: empty ? /* @__PURE__ */ jsx("div", { children: empty }) : /* @__PURE__ */ jsx(Fragment, { children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9860
9858
|
/* @__PURE__ */ jsx(
|
|
9861
9859
|
"div",
|
|
9862
9860
|
{
|
|
@@ -9969,7 +9967,7 @@ function Select({
|
|
|
9969
9967
|
item.value
|
|
9970
9968
|
))
|
|
9971
9969
|
}
|
|
9972
|
-
) }) }) })
|
|
9970
|
+
) }) }) }) })
|
|
9973
9971
|
]
|
|
9974
9972
|
}
|
|
9975
9973
|
),
|
|
@@ -13781,7 +13779,7 @@ function MultiSelect({
|
|
|
13781
13779
|
MultiSelectTriggerBase,
|
|
13782
13780
|
{
|
|
13783
13781
|
className: cn(
|
|
13784
|
-
"flex items-center gap-2 justify-between",
|
|
13782
|
+
"flex items-center gap-2 justify-between hover:bg-muted transition-all duration-150",
|
|
13785
13783
|
error && "border-red-500",
|
|
13786
13784
|
className
|
|
13787
13785
|
),
|
|
@@ -15764,22 +15762,27 @@ var Brush = ({
|
|
|
15764
15762
|
/* @__PURE__ */ jsxs(
|
|
15765
15763
|
"div",
|
|
15766
15764
|
{
|
|
15767
|
-
className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md",
|
|
15765
|
+
className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md touch-none",
|
|
15768
15766
|
style: {
|
|
15769
15767
|
left: `${startIndex / (dataLength - 1) * 100}%`,
|
|
15770
15768
|
right: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`,
|
|
15771
15769
|
backgroundColor: "transparent"
|
|
15772
15770
|
},
|
|
15773
15771
|
onMouseDown: (e) => onMouseDown(e, "middle"),
|
|
15772
|
+
onTouchStart: (e) => onMouseDown(e, "middle"),
|
|
15774
15773
|
children: [
|
|
15775
15774
|
/* @__PURE__ */ jsx(
|
|
15776
15775
|
"div",
|
|
15777
15776
|
{
|
|
15778
|
-
className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
15777
|
+
className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle touch-none",
|
|
15779
15778
|
onMouseDown: (e) => {
|
|
15780
15779
|
e.stopPropagation();
|
|
15781
15780
|
onMouseDown(e, "start");
|
|
15782
15781
|
},
|
|
15782
|
+
onTouchStart: (e) => {
|
|
15783
|
+
e.stopPropagation();
|
|
15784
|
+
onMouseDown(e, "start");
|
|
15785
|
+
},
|
|
15783
15786
|
children: /* @__PURE__ */ jsx(
|
|
15784
15787
|
"div",
|
|
15785
15788
|
{
|
|
@@ -15794,11 +15797,15 @@ var Brush = ({
|
|
|
15794
15797
|
/* @__PURE__ */ jsx(
|
|
15795
15798
|
"div",
|
|
15796
15799
|
{
|
|
15797
|
-
className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
15800
|
+
className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle touch-none",
|
|
15798
15801
|
onMouseDown: (e) => {
|
|
15799
15802
|
e.stopPropagation();
|
|
15800
15803
|
onMouseDown(e, "end");
|
|
15801
15804
|
},
|
|
15805
|
+
onTouchStart: (e) => {
|
|
15806
|
+
e.stopPropagation();
|
|
15807
|
+
onMouseDown(e, "end");
|
|
15808
|
+
},
|
|
15802
15809
|
children: /* @__PURE__ */ jsx(
|
|
15803
15810
|
"div",
|
|
15804
15811
|
{
|
|
@@ -16525,8 +16532,10 @@ function useTimeSeriesRange({
|
|
|
16525
16532
|
const handleMouseDown = useCallback(
|
|
16526
16533
|
(e, type) => {
|
|
16527
16534
|
e.preventDefault();
|
|
16535
|
+
const isTouchEvent = "touches" in e;
|
|
16536
|
+
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
16528
16537
|
setIsDragging(type);
|
|
16529
|
-
setDragStartX(
|
|
16538
|
+
setDragStartX(clientX);
|
|
16530
16539
|
setInitialStartIndex(startIndex);
|
|
16531
16540
|
setInitialEndIndex(endIndex);
|
|
16532
16541
|
},
|
|
@@ -16535,8 +16544,10 @@ function useTimeSeriesRange({
|
|
|
16535
16544
|
const handleMouseMove = useCallback(
|
|
16536
16545
|
(e) => {
|
|
16537
16546
|
if (!isDragging || !brushRef.current) return;
|
|
16547
|
+
const isTouchEvent = "touches" in e;
|
|
16548
|
+
const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
|
|
16538
16549
|
const brushWidth = brushRef.current.offsetWidth;
|
|
16539
|
-
const deltaX =
|
|
16550
|
+
const deltaX = clientX - dragStartX;
|
|
16540
16551
|
const indexDelta = Math.round(deltaX / brushWidth * dataLength);
|
|
16541
16552
|
if (isDragging === "start") {
|
|
16542
16553
|
const newStart = Math.max(
|
|
@@ -16582,9 +16593,13 @@ function useTimeSeriesRange({
|
|
|
16582
16593
|
if (isDragging) {
|
|
16583
16594
|
document.addEventListener("mousemove", handleMouseMove);
|
|
16584
16595
|
document.addEventListener("mouseup", handleMouseUp);
|
|
16596
|
+
document.addEventListener("touchmove", handleMouseMove);
|
|
16597
|
+
document.addEventListener("touchend", handleMouseUp);
|
|
16585
16598
|
return () => {
|
|
16586
16599
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
16587
16600
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
16601
|
+
document.removeEventListener("touchmove", handleMouseMove);
|
|
16602
|
+
document.removeEventListener("touchend", handleMouseUp);
|
|
16588
16603
|
};
|
|
16589
16604
|
}
|
|
16590
16605
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|