@choice-ui/react 1.8.9 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/dist/index.js +0 -7
- package/dist/components/checkbox/dist/index.d.ts +1 -10
- package/dist/components/checkbox/dist/index.js +5 -49
- package/dist/components/colors/src/color-image-paint/color-image-paint.js +2 -2
- package/dist/components/dropdown/dist/index.d.ts +0 -6
- package/dist/components/dropdown/dist/index.js +8 -12
- package/dist/components/dropdown/src/dropdown.js +8 -2
- package/dist/components/emoji-picker/dist/index.d.ts +1 -29
- package/dist/components/emoji-picker/dist/index.js +42 -144
- package/dist/components/form/src/adapters/range-adapter.js +2 -2
- package/dist/components/icon-button/dist/index.d.ts +1 -1
- package/dist/components/icon-button/dist/index.js +0 -39
- package/dist/components/menus/dist/index.d.ts +0 -5
- package/dist/components/menus/dist/index.js +1 -18
- package/dist/components/menus/src/context/menu-context-sub-trigger.js +6 -1
- package/dist/components/menus/src/hooks/use-menu-tree.js +8 -1
- package/dist/components/radio/dist/index.d.ts +1 -9
- package/dist/components/radio/dist/index.js +6 -50
- package/dist/components/range/dist/index.d.ts +20 -276
- package/dist/components/range/dist/index.js +616 -1044
- package/dist/components/textarea/dist/index.js +1 -3
- package/dist/components/tooltip/dist/index.d.ts +0 -2
- package/dist/components/tooltip/dist/index.js +5 -23
- package/package.json +32 -20
- package/dist/components/virtual-select/dist/index.d.ts +0 -48
|
@@ -28,12 +28,6 @@ var iconButtonTv = tcv({
|
|
|
28
28
|
highlight: {},
|
|
29
29
|
ghost: {},
|
|
30
30
|
dark: { button: "text-white" },
|
|
31
|
-
submit: {
|
|
32
|
-
button: [
|
|
33
|
-
"bg-[var(--theme-submit-btn-bg)] text-[var(--theme-submit-btn-text)]",
|
|
34
|
-
"focus-visible:border-transparent"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
31
|
reset: {}
|
|
38
32
|
},
|
|
39
33
|
active: {
|
|
@@ -147,39 +141,6 @@ var iconButtonTv = tcv({
|
|
|
147
141
|
variant: "dark",
|
|
148
142
|
disabled: true,
|
|
149
143
|
class: { button: "text-gray-500" }
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
variant: "submit",
|
|
153
|
-
active: false,
|
|
154
|
-
disabled: false,
|
|
155
|
-
class: {
|
|
156
|
-
button: ["focus-visible:shadow-focus", "hover:opacity-70", "active:opacity-70"]
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
variant: "submit",
|
|
161
|
-
active: true,
|
|
162
|
-
disabled: false,
|
|
163
|
-
class: {
|
|
164
|
-
button: "opacity-70"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
variant: "submit",
|
|
169
|
-
focused: true,
|
|
170
|
-
class: {
|
|
171
|
-
button: ["shadow-focus", "border-transparent"]
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
variant: "submit",
|
|
176
|
-
loading: true,
|
|
177
|
-
class: { button: "opacity-70" }
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
variant: "submit",
|
|
181
|
-
disabled: true,
|
|
182
|
-
class: { button: "opacity-50" }
|
|
183
144
|
}
|
|
184
145
|
],
|
|
185
146
|
defaultVariants: {
|
|
@@ -458,11 +458,6 @@ declare const MenuContext: react.Context<MenuContextType | null>;
|
|
|
458
458
|
interface MenuContextItemProps extends MenuItemProps {
|
|
459
459
|
customActive?: boolean;
|
|
460
460
|
exclusiveIndex?: number;
|
|
461
|
-
/**
|
|
462
|
-
* Whether this item is a link item. When true, a link icon will be displayed on the right.
|
|
463
|
-
* The actual link navigation should be handled by the onClick handler.
|
|
464
|
-
*/
|
|
465
|
-
asLink?: boolean;
|
|
466
461
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
467
462
|
onKeyDown?: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
468
463
|
onMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "../../button/dist/index.js";
|
|
2
2
|
import React__default, { memo, forwardRef, useMemo, useContext, createContext, startTransition, useCallback, useRef, useState, useEffect, Children, isValidElement, Fragment as Fragment$1 } from "react";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
|
-
import { ChevronDownSmall, Check,
|
|
4
|
+
import { ChevronDownSmall, Check, ChevronRightSmall, ChevronUpSmall } from "@choiceform/icons-react";
|
|
5
5
|
import { Kbd } from "../../kbd/dist/index.js";
|
|
6
6
|
import { flushSync } from "react-dom";
|
|
7
7
|
import { SearchInput } from "../../search-input/dist/index.js";
|
|
@@ -418,13 +418,9 @@ var MenuLabel = memo(function MenuLabel2({
|
|
|
418
418
|
});
|
|
419
419
|
MenuLabel.displayName = "MenuLabel";
|
|
420
420
|
var SCROLL_ARROW_PADDING = 16;
|
|
421
|
-
var MIN_HEIGHT_FOR_ARROWS = 48;
|
|
422
421
|
var shouldShowArrow = (scrollRef, dir) => {
|
|
423
422
|
if (scrollRef.current) {
|
|
424
423
|
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
|
|
425
|
-
if (clientHeight < MIN_HEIGHT_FOR_ARROWS) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
424
|
if (dir === "up") {
|
|
429
425
|
return scrollTop >= SCROLL_ARROW_PADDING;
|
|
430
426
|
}
|
|
@@ -908,9 +904,7 @@ var MenuContextItem = memo(
|
|
|
908
904
|
size: size2,
|
|
909
905
|
shortcut,
|
|
910
906
|
prefixElement,
|
|
911
|
-
suffixElement,
|
|
912
907
|
variant,
|
|
913
|
-
asLink,
|
|
914
908
|
onClick,
|
|
915
909
|
onMouseUp,
|
|
916
910
|
onTouchStart,
|
|
@@ -975,16 +969,6 @@ var MenuContextItem = memo(
|
|
|
975
969
|
}),
|
|
976
970
|
[shortcut == null ? void 0 : shortcut.modifier, shortcut == null ? void 0 : shortcut.keys]
|
|
977
971
|
);
|
|
978
|
-
const suffixConfig = useMemo(() => {
|
|
979
|
-
if (suffixElement !== void 0) return suffixElement;
|
|
980
|
-
if (prefixElement !== void 0 && menu.selection && !customActive && selected) {
|
|
981
|
-
return /* @__PURE__ */ jsx(Check, {});
|
|
982
|
-
}
|
|
983
|
-
if (asLink) {
|
|
984
|
-
return /* @__PURE__ */ jsx(Launch, { className: "h-3 w-3 text-current" });
|
|
985
|
-
}
|
|
986
|
-
return void 0;
|
|
987
|
-
}, [suffixElement, prefixElement, menu.selection, selected, customActive, asLink]);
|
|
988
972
|
const combinedRef = useCallback(
|
|
989
973
|
(node) => {
|
|
990
974
|
item.ref(node);
|
|
@@ -1007,7 +991,6 @@ var MenuContextItem = memo(
|
|
|
1007
991
|
disabled,
|
|
1008
992
|
selected,
|
|
1009
993
|
prefixElement: prefixConfig,
|
|
1010
|
-
suffixElement: suffixConfig,
|
|
1011
994
|
shortcut: shortcutConfig,
|
|
1012
995
|
variant,
|
|
1013
996
|
size: size2,
|
|
@@ -26,7 +26,12 @@ const MenuContextSubTrigger = memo(
|
|
|
26
26
|
throw new Error("MenuContextSubTrigger must be used within a MenuContext component");
|
|
27
27
|
}
|
|
28
28
|
const isActive = useMemo(
|
|
29
|
-
() =>
|
|
29
|
+
() => {
|
|
30
|
+
if (menu.activeIndex !== null && menu.activeIndex !== void 0) {
|
|
31
|
+
return item.index === menu.activeIndex;
|
|
32
|
+
}
|
|
33
|
+
return !!active;
|
|
34
|
+
},
|
|
30
35
|
[item.index, menu.activeIndex, active]
|
|
31
36
|
);
|
|
32
37
|
const handleFocus = useEventCallback((event) => {
|
|
@@ -16,18 +16,25 @@ function useMenuTree(config) {
|
|
|
16
16
|
handleOpenChange(false);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
const handleParentNavigate = useEventCallback((event) => {
|
|
20
|
+
if (event.nodeId === parentId && event.index !== item.index && isControlledOpen) {
|
|
21
|
+
handleOpenChange(false);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
19
24
|
const cleanupTreeEvents = useEventCallback(() => {
|
|
20
25
|
if (tree) {
|
|
21
26
|
tree.events.off("click", handleTreeClick);
|
|
22
27
|
tree.events.off("menuopen", handleSubMenuOpen);
|
|
28
|
+
tree.events.off("navigate", handleParentNavigate);
|
|
23
29
|
}
|
|
24
30
|
});
|
|
25
31
|
useEffect(() => {
|
|
26
32
|
if (!tree) return;
|
|
27
33
|
tree.events.on("click", handleTreeClick);
|
|
28
34
|
tree.events.on("menuopen", handleSubMenuOpen);
|
|
35
|
+
tree.events.on("navigate", handleParentNavigate);
|
|
29
36
|
return cleanupTreeEvents;
|
|
30
|
-
}, [tree, nodeId, parentId, handleTreeClick, handleSubMenuOpen, cleanupTreeEvents]);
|
|
37
|
+
}, [tree, nodeId, parentId, handleTreeClick, handleSubMenuOpen, handleParentNavigate, cleanupTreeEvents]);
|
|
31
38
|
useEffect(() => {
|
|
32
39
|
if (isControlledOpen && tree) {
|
|
33
40
|
tree.events.emit("menuopen", { parentId, nodeId });
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { HTMLProps, ReactNode } from 'react';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
|
|
4
|
-
interface RadioIconProps extends Omit<HTMLProps<HTMLDivElement>, "children"> {
|
|
5
|
-
children?: ReactNode | ((props: {
|
|
6
|
-
value?: boolean;
|
|
7
|
-
}) => ReactNode);
|
|
8
|
-
}
|
|
9
|
-
declare const RadioIcon: react.MemoExoticComponent<react.ForwardRefExoticComponent<Omit<RadioIconProps, "ref"> & react.RefAttributes<HTMLDivElement>>>;
|
|
10
|
-
|
|
11
4
|
interface RadioLabelProps extends Omit<HTMLProps<HTMLLabelElement>, "htmlFor" | "id" | "disabled"> {
|
|
12
5
|
children: ReactNode;
|
|
13
6
|
}
|
|
@@ -26,7 +19,6 @@ interface RadioType {
|
|
|
26
19
|
(props: RadioProps & {
|
|
27
20
|
ref?: React.Ref<HTMLInputElement>;
|
|
28
21
|
}): JSX.Element;
|
|
29
|
-
Icon: typeof RadioIcon;
|
|
30
22
|
Label: typeof RadioLabel;
|
|
31
23
|
displayName?: string;
|
|
32
24
|
}
|
|
@@ -58,4 +50,4 @@ interface RadioGroupType {
|
|
|
58
50
|
}
|
|
59
51
|
declare const RadioGroup: RadioGroupType;
|
|
60
52
|
|
|
61
|
-
export { Radio, RadioGroup, type RadioGroupProps, type
|
|
53
|
+
export { Radio, RadioGroup, type RadioGroupProps, type RadioProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dot } from "@choiceform/icons-react";
|
|
2
|
-
import { memo, forwardRef, useId, useMemo, createContext, useContext
|
|
2
|
+
import { memo, forwardRef, useId, useMemo, createContext, useContext } from "react";
|
|
3
3
|
import { useEventCallback } from "usehooks-ts";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { tcx, tcv } from "../../../shared/utils/tcx/tcx.js";
|
|
@@ -145,38 +145,6 @@ var radioTv = tcv({
|
|
|
145
145
|
focused: false
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
|
-
var RadioIcon = memo(
|
|
149
|
-
forwardRef(function RadioIcon2(props, ref) {
|
|
150
|
-
const { className, children, ...rest } = props;
|
|
151
|
-
const { value, disabled, variant } = useRadioContext();
|
|
152
|
-
const tv = radioTv({
|
|
153
|
-
type: "radio",
|
|
154
|
-
variant,
|
|
155
|
-
disabled,
|
|
156
|
-
checked: value
|
|
157
|
-
});
|
|
158
|
-
const renderIcon = () => {
|
|
159
|
-
if (typeof children === "function") {
|
|
160
|
-
return children({ value });
|
|
161
|
-
}
|
|
162
|
-
if (children !== void 0) {
|
|
163
|
-
return children;
|
|
164
|
-
}
|
|
165
|
-
return value ? /* @__PURE__ */ jsx(Dot, {}) : null;
|
|
166
|
-
};
|
|
167
|
-
return /* @__PURE__ */ jsx(
|
|
168
|
-
"div",
|
|
169
|
-
{
|
|
170
|
-
ref,
|
|
171
|
-
className: tcx(tv.box(), className),
|
|
172
|
-
"data-active": value,
|
|
173
|
-
...rest,
|
|
174
|
-
children: renderIcon()
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
})
|
|
178
|
-
);
|
|
179
|
-
RadioIcon.displayName = "Radio.Icon";
|
|
180
148
|
var RadioLabel = memo(
|
|
181
149
|
forwardRef(function RadioLabel2(props, ref) {
|
|
182
150
|
const { children, className, ...rest } = props;
|
|
@@ -233,24 +201,13 @@ var RadioBase = forwardRef(function Radio(props, ref) {
|
|
|
233
201
|
}
|
|
234
202
|
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
235
203
|
});
|
|
236
|
-
const isIconElement = (child) => {
|
|
237
|
-
var _a;
|
|
238
|
-
return isValidElement(child) && (child.type === RadioIcon || ((_a = child.type) == null ? void 0 : _a.displayName) === "Radio.Icon");
|
|
239
|
-
};
|
|
240
|
-
const childArray = Children.toArray(children);
|
|
241
|
-
const iconChild = childArray.find(isIconElement);
|
|
242
|
-
const otherChildren = childArray.filter((child) => !isIconElement(child));
|
|
243
204
|
const renderChildren = () => {
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
if (typeof child === "string" || typeof child === "number") {
|
|
247
|
-
return /* @__PURE__ */ jsx(RadioLabel, { children: child });
|
|
248
|
-
}
|
|
205
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
206
|
+
return /* @__PURE__ */ jsx(RadioLabel, { children });
|
|
249
207
|
}
|
|
250
|
-
return
|
|
208
|
+
return children;
|
|
251
209
|
};
|
|
252
|
-
|
|
253
|
-
return /* @__PURE__ */ jsx(RadioContext.Provider, { value: { id, descriptionId, disabled, value, variant }, children: /* @__PURE__ */ jsxs("div", { className: tcx(tv.root(), className), children: [
|
|
210
|
+
return /* @__PURE__ */ jsx(RadioContext.Provider, { value: { id, descriptionId, disabled }, children: /* @__PURE__ */ jsxs("div", { className: tcx(tv.root(), className), children: [
|
|
254
211
|
/* @__PURE__ */ jsxs("div", { className: "pointer-events-none relative", children: [
|
|
255
212
|
/* @__PURE__ */ jsx(
|
|
256
213
|
"input",
|
|
@@ -272,14 +229,13 @@ var RadioBase = forwardRef(function Radio(props, ref) {
|
|
|
272
229
|
...rest
|
|
273
230
|
}
|
|
274
231
|
),
|
|
275
|
-
|
|
232
|
+
/* @__PURE__ */ jsx("div", { className: tv.box(), children: value && /* @__PURE__ */ jsx(Dot, {}) })
|
|
276
233
|
] }),
|
|
277
234
|
renderChildren()
|
|
278
235
|
] }) });
|
|
279
236
|
});
|
|
280
237
|
var MemoizedRadio = memo(RadioBase);
|
|
281
238
|
var Radio2 = MemoizedRadio;
|
|
282
|
-
Radio2.Icon = RadioIcon;
|
|
283
239
|
Radio2.Label = RadioLabel;
|
|
284
240
|
Radio2.displayName = "Radio";
|
|
285
241
|
var RadioGroupItem = memo(
|
|
@@ -1,60 +1,10 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import * as tailwind_variants from 'tailwind-variants';
|
|
5
|
-
|
|
6
|
-
interface RangeConnectsProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const RangeConnects: React$1.ForwardRefExoticComponent<RangeConnectsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
interface RangeContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
height?: number;
|
|
14
|
-
}
|
|
15
|
-
declare function RangeContainer(props: RangeContainerProps): react_jsx_runtime.JSX.Element;
|
|
16
|
-
declare namespace RangeContainer {
|
|
17
|
-
var displayName: string;
|
|
18
|
-
}
|
|
19
|
-
interface RangeTupleConnectsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
declare const RangeTupleConnects: React$1.ForwardRefExoticComponent<RangeTupleConnectsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
interface RangeTupleContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
className?: string;
|
|
26
|
-
height?: number;
|
|
27
|
-
}
|
|
28
|
-
declare function RangeTupleContainer(props: RangeTupleContainerProps): react_jsx_runtime.JSX.Element;
|
|
29
|
-
declare namespace RangeTupleContainer {
|
|
30
|
-
var displayName: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface RangeThumbProps {
|
|
34
|
-
className?: string;
|
|
35
|
-
size?: number;
|
|
36
|
-
}
|
|
37
|
-
declare const RangeThumb: React__default.ForwardRefExoticComponent<RangeThumbProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
38
|
-
type ThumbIndex$1 = 0 | 1;
|
|
39
|
-
interface RangeTupleThumbProps {
|
|
40
|
-
className?: string;
|
|
41
|
-
size?: number;
|
|
42
|
-
index: ThumbIndex$1;
|
|
43
|
-
}
|
|
44
|
-
declare const RangeTupleThumb: React__default.ForwardRefExoticComponent<RangeTupleThumbProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
45
|
-
|
|
46
|
-
interface RangeDotProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
47
|
-
className?: string;
|
|
48
|
-
}
|
|
49
|
-
interface RangeTupleDotProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
-
className?: string;
|
|
51
|
-
}
|
|
52
|
-
declare const RangeDot: React$1.ForwardRefExoticComponent<RangeDotProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
53
|
-
declare const RangeTupleDot: React$1.ForwardRefExoticComponent<RangeTupleDotProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
54
|
-
|
|
1
|
+
import { default as React } from 'react';
|
|
55
2
|
interface RangeProps {
|
|
56
|
-
children?: React__default.ReactNode;
|
|
57
3
|
className?: string;
|
|
4
|
+
connectsClassName?: {
|
|
5
|
+
negative?: string;
|
|
6
|
+
positive?: string;
|
|
7
|
+
};
|
|
58
8
|
defaultValue?: number;
|
|
59
9
|
disabled?: boolean;
|
|
60
10
|
max?: number;
|
|
@@ -65,24 +15,20 @@ interface RangeProps {
|
|
|
65
15
|
readOnly?: boolean;
|
|
66
16
|
step?: number;
|
|
67
17
|
thumbSize?: number;
|
|
18
|
+
trackSize?: {
|
|
19
|
+
height?: number;
|
|
20
|
+
width?: number | "auto";
|
|
21
|
+
};
|
|
68
22
|
value?: number;
|
|
69
|
-
/**
|
|
70
|
-
* Width of the range track in pixels.
|
|
71
|
-
* If not provided (undefined), the width will be auto-calculated from the container.
|
|
72
|
-
*/
|
|
73
|
-
width?: number | boolean;
|
|
74
|
-
}
|
|
75
|
-
interface RangeComponent extends React__default.ForwardRefExoticComponent<RangeProps & React__default.RefAttributes<HTMLDivElement>> {
|
|
76
|
-
Container: typeof RangeContainer;
|
|
77
|
-
Connects: typeof RangeConnects;
|
|
78
|
-
Thumb: typeof RangeThumb;
|
|
79
|
-
Dot: typeof RangeDot;
|
|
80
23
|
}
|
|
81
|
-
declare const Range:
|
|
24
|
+
declare const Range: React.ForwardRefExoticComponent<RangeProps & React.RefAttributes<HTMLDivElement>>;
|
|
82
25
|
|
|
83
26
|
interface RangeTupleProps {
|
|
84
|
-
children?: React__default.ReactNode;
|
|
85
27
|
className?: string;
|
|
28
|
+
connectsClassName?: {
|
|
29
|
+
negative?: string;
|
|
30
|
+
positive?: string;
|
|
31
|
+
};
|
|
86
32
|
defaultValue?: [number, number];
|
|
87
33
|
disabled?: boolean;
|
|
88
34
|
max?: number;
|
|
@@ -93,214 +39,12 @@ interface RangeTupleProps {
|
|
|
93
39
|
readOnly?: boolean;
|
|
94
40
|
step?: number;
|
|
95
41
|
thumbSize?: number;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* If not provided (undefined) or set to false, the width will be auto-calculated from the container.
|
|
100
|
-
*/
|
|
101
|
-
width?: number | boolean;
|
|
102
|
-
}
|
|
103
|
-
interface RangeTupleComponent extends React__default.ForwardRefExoticComponent<RangeTupleProps & React__default.RefAttributes<HTMLDivElement>> {
|
|
104
|
-
Container: typeof RangeTupleContainer;
|
|
105
|
-
Connects: typeof RangeTupleConnects;
|
|
106
|
-
Thumb: typeof RangeTupleThumb;
|
|
107
|
-
Dot: typeof RangeTupleDot;
|
|
108
|
-
}
|
|
109
|
-
declare const RangeTuple: RangeTupleComponent;
|
|
110
|
-
|
|
111
|
-
declare const rangeTv: tailwind_variants.TVReturnType<{
|
|
112
|
-
overStepValue: {
|
|
113
|
-
true: {
|
|
114
|
-
dot: string;
|
|
115
|
-
};
|
|
116
|
-
false: {
|
|
117
|
-
dot: string;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
defaultStepValue: {
|
|
121
|
-
true: {
|
|
122
|
-
dot: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
hasStepOrDefault: {
|
|
126
|
-
true: {};
|
|
127
|
-
false: {};
|
|
128
|
-
};
|
|
129
|
-
currentDefaultValue: {
|
|
130
|
-
true: {};
|
|
131
|
-
false: {};
|
|
132
|
-
};
|
|
133
|
-
disabled: {
|
|
134
|
-
true: {
|
|
135
|
-
connect: string;
|
|
136
|
-
thumb: string;
|
|
137
|
-
};
|
|
138
|
-
false: {
|
|
139
|
-
connect: string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
}, {
|
|
143
|
-
container: string[];
|
|
144
|
-
connect: string[];
|
|
145
|
-
thumbWrapper: string[];
|
|
146
|
-
thumb: string[];
|
|
147
|
-
dotContainer: string;
|
|
148
|
-
dot: string[];
|
|
149
|
-
input: string;
|
|
150
|
-
}, undefined, {
|
|
151
|
-
overStepValue: {
|
|
152
|
-
true: {
|
|
153
|
-
dot: string;
|
|
154
|
-
};
|
|
155
|
-
false: {
|
|
156
|
-
dot: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
defaultStepValue: {
|
|
160
|
-
true: {
|
|
161
|
-
dot: string;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
hasStepOrDefault: {
|
|
165
|
-
true: {};
|
|
166
|
-
false: {};
|
|
167
|
-
};
|
|
168
|
-
currentDefaultValue: {
|
|
169
|
-
true: {};
|
|
170
|
-
false: {};
|
|
171
|
-
};
|
|
172
|
-
disabled: {
|
|
173
|
-
true: {
|
|
174
|
-
connect: string;
|
|
175
|
-
thumb: string;
|
|
176
|
-
};
|
|
177
|
-
false: {
|
|
178
|
-
connect: string;
|
|
179
|
-
};
|
|
42
|
+
trackSize?: {
|
|
43
|
+
height?: number;
|
|
44
|
+
width?: number | "auto";
|
|
180
45
|
};
|
|
181
|
-
|
|
182
|
-
container: string[];
|
|
183
|
-
connect: string[];
|
|
184
|
-
thumbWrapper: string[];
|
|
185
|
-
thumb: string[];
|
|
186
|
-
dotContainer: string;
|
|
187
|
-
dot: string[];
|
|
188
|
-
input: string;
|
|
189
|
-
}, tailwind_variants.TVReturnType<{
|
|
190
|
-
overStepValue: {
|
|
191
|
-
true: {
|
|
192
|
-
dot: string;
|
|
193
|
-
};
|
|
194
|
-
false: {
|
|
195
|
-
dot: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
defaultStepValue: {
|
|
199
|
-
true: {
|
|
200
|
-
dot: string;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
hasStepOrDefault: {
|
|
204
|
-
true: {};
|
|
205
|
-
false: {};
|
|
206
|
-
};
|
|
207
|
-
currentDefaultValue: {
|
|
208
|
-
true: {};
|
|
209
|
-
false: {};
|
|
210
|
-
};
|
|
211
|
-
disabled: {
|
|
212
|
-
true: {
|
|
213
|
-
connect: string;
|
|
214
|
-
thumb: string;
|
|
215
|
-
};
|
|
216
|
-
false: {
|
|
217
|
-
connect: string;
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
}, {
|
|
221
|
-
container: string[];
|
|
222
|
-
connect: string[];
|
|
223
|
-
thumbWrapper: string[];
|
|
224
|
-
thumb: string[];
|
|
225
|
-
dotContainer: string;
|
|
226
|
-
dot: string[];
|
|
227
|
-
input: string;
|
|
228
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
229
|
-
|
|
230
|
-
interface RangeContextValue {
|
|
231
|
-
currentValue: number;
|
|
232
|
-
disabled: boolean;
|
|
233
|
-
readOnly: boolean;
|
|
234
|
-
min: number;
|
|
235
|
-
max: number;
|
|
236
|
-
step: number;
|
|
237
|
-
thumbSize: number;
|
|
238
|
-
trackHeight: number;
|
|
239
|
-
transforms: {
|
|
240
|
-
minTransform: number;
|
|
241
|
-
maxTransform: number;
|
|
242
|
-
transformX: number;
|
|
243
|
-
};
|
|
244
|
-
defaultStepValue: number | null;
|
|
245
|
-
currentStepValue: number;
|
|
246
|
-
dotsData: Array<{
|
|
247
|
-
value: number;
|
|
248
|
-
position: number;
|
|
249
|
-
}> | null;
|
|
250
|
-
defaultDotPosition: number | null;
|
|
251
|
-
thumbRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
252
|
-
inputRef: React.MutableRefObject<HTMLInputElement | null>;
|
|
253
|
-
isDragging: React.MutableRefObject<boolean>;
|
|
254
|
-
handlePointerDown: (e: React.PointerEvent) => void;
|
|
255
|
-
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
256
|
-
tv: ReturnType<typeof rangeTv>;
|
|
257
|
-
defaultValue?: number;
|
|
258
|
-
hasCustomDot: boolean;
|
|
259
|
-
hasCustomConnects: boolean;
|
|
260
|
-
isDefaultValue?: boolean;
|
|
261
|
-
}
|
|
262
|
-
declare const RangeContext: React$1.Context<RangeContextValue | null>;
|
|
263
|
-
declare function useRangeContext(): RangeContextValue;
|
|
264
|
-
|
|
265
|
-
type ThumbIndex = 0 | 1;
|
|
266
|
-
interface RangeTupleContextValue {
|
|
267
|
-
currentValue: [number, number];
|
|
268
|
-
disabled: boolean;
|
|
269
|
-
readOnly: boolean;
|
|
270
|
-
min: number;
|
|
271
|
-
max: number;
|
|
272
|
-
step: number;
|
|
273
|
-
thumbSize: number;
|
|
274
|
-
trackHeight: number;
|
|
275
|
-
transforms: {
|
|
276
|
-
minTransform: number;
|
|
277
|
-
maxTransform: number;
|
|
278
|
-
transformX0: number;
|
|
279
|
-
transformX1: number;
|
|
280
|
-
};
|
|
281
|
-
defaultStepValue: [number, number] | null;
|
|
282
|
-
currentStepValue: [number, number];
|
|
283
|
-
dotsData: Array<{
|
|
284
|
-
value: number;
|
|
285
|
-
position: number;
|
|
286
|
-
}> | null;
|
|
287
|
-
defaultDotPositions: [number, number] | null;
|
|
288
|
-
normalizedDefaultValue: [number, number] | undefined;
|
|
289
|
-
thumb0Ref: React.RefObject<HTMLDivElement | null>;
|
|
290
|
-
thumb1Ref: React.RefObject<HTMLDivElement | null>;
|
|
291
|
-
input0Ref: React.RefObject<HTMLInputElement | null>;
|
|
292
|
-
input1Ref: React.RefObject<HTMLInputElement | null>;
|
|
293
|
-
isDragging: React.MutableRefObject<ThumbIndex | null>;
|
|
294
|
-
handlePointerDown: (e: React.PointerEvent, thumbIndex: ThumbIndex) => void;
|
|
295
|
-
handleKeyDown: (e: React.KeyboardEvent, thumbIndex: ThumbIndex) => void;
|
|
296
|
-
tv: ReturnType<typeof rangeTv>;
|
|
297
|
-
thumbTv0: ReturnType<typeof rangeTv>;
|
|
298
|
-
thumbTv1: ReturnType<typeof rangeTv>;
|
|
299
|
-
hasCustomDot: boolean;
|
|
300
|
-
hasCustomConnects: boolean;
|
|
301
|
-
isDefaultValue?: boolean;
|
|
46
|
+
value?: [number, number];
|
|
302
47
|
}
|
|
303
|
-
declare const
|
|
304
|
-
declare function useRangeTupleContext(): RangeTupleContextValue;
|
|
48
|
+
declare const RangeTuple: React.ForwardRefExoticComponent<RangeTupleProps & React.RefAttributes<HTMLDivElement>>;
|
|
305
49
|
|
|
306
|
-
export { Range, type
|
|
50
|
+
export { Range, type RangeProps, RangeTuple, type RangeTupleProps };
|