@choice-ui/react 1.9.2 → 1.9.4
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/src/tv.js +7 -0
- package/dist/components/command/dist/index.d.ts +10 -0
- package/dist/components/command/src/command.js +2 -0
- package/dist/components/command/src/components/command-item.d.ts +4 -0
- package/dist/components/command/src/components/command-item.js +6 -0
- package/dist/components/command/src/components/command-list.js +1 -0
- package/dist/components/command/src/context/create-command-context.d.ts +1 -0
- package/dist/components/command/src/context/create-command-context.js +2 -0
- package/dist/components/command/src/tv.js +1 -1
- package/dist/components/command/src/types.d.ts +6 -0
- package/dist/components/dropdown/src/dropdown.d.ts +16 -0
- package/dist/components/dropdown/src/dropdown.js +24 -11
- package/dist/components/list/dist/index.d.ts +1 -1
- package/dist/components/list/src/components/list-content.js +3 -2
- package/dist/components/list/src/components/list-divider.js +3 -1
- package/dist/components/list/src/context/list-context.d.ts +1 -1
- package/dist/components/list/src/context/list-provider.d.ts +1 -1
- package/dist/components/list/src/list.d.ts +1 -1
- package/dist/components/list/src/tv.d.ts +59 -17
- package/dist/components/list/src/tv.js +45 -5
- package/package.json +1 -1
|
@@ -246,6 +246,13 @@ const buttonTv = tcv({
|
|
|
246
246
|
variant: "secondary",
|
|
247
247
|
active: false,
|
|
248
248
|
class: { button: "hover:bg-secondary-background" }
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
disabled: false,
|
|
252
|
+
loading: false,
|
|
253
|
+
variant: "secondary-destruct",
|
|
254
|
+
active: false,
|
|
255
|
+
class: { button: "hover:bg-danger-background/10" }
|
|
249
256
|
}
|
|
250
257
|
],
|
|
251
258
|
defaultVariants: {
|
|
@@ -43,6 +43,10 @@ interface CommandItemProps extends Omit<HTMLProps<HTMLDivElement>, "onSelect"> {
|
|
|
43
43
|
keywords?: string[];
|
|
44
44
|
onSelect?: (value: string) => void;
|
|
45
45
|
prefixElement?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* When true, this item will be set as the selected item and scrolled into view.
|
|
48
|
+
*/
|
|
49
|
+
selected?: boolean;
|
|
46
50
|
shortcut?: {
|
|
47
51
|
keys?: ReactNode;
|
|
48
52
|
modifier?: KbdKey | KbdKey[] | undefined;
|
|
@@ -106,6 +110,11 @@ interface CommandProps extends Omit<react__default.HTMLAttributes<HTMLDivElement
|
|
|
106
110
|
* Event handler called when the selected item of the menu changes.
|
|
107
111
|
*/
|
|
108
112
|
onChange?: (value: string) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Optionally set to `true` to enable selection mode.
|
|
115
|
+
* When enabled, items with `selected` prop will be scrolled into view on mount.
|
|
116
|
+
*/
|
|
117
|
+
selection?: boolean;
|
|
109
118
|
/**
|
|
110
119
|
* Optionally set to `false` to turn off the automatic filtering and sorting.
|
|
111
120
|
* If `false`, you must conditionally render valid items based on the search query yourself.
|
|
@@ -140,6 +149,7 @@ type Context = {
|
|
|
140
149
|
labelId: string;
|
|
141
150
|
listId: string;
|
|
142
151
|
listInnerRef: react__default.MutableRefObject<HTMLDivElement | null>;
|
|
152
|
+
selection?: boolean;
|
|
143
153
|
size?: "default" | "large";
|
|
144
154
|
store: Store;
|
|
145
155
|
value: (id: string, value?: string, keywords?: string[]) => void;
|
|
@@ -42,6 +42,7 @@ const Command = forwardRef((props, forwardedRef) => {
|
|
|
42
42
|
onChange: onValueChange,
|
|
43
43
|
filter,
|
|
44
44
|
shouldFilter,
|
|
45
|
+
selection,
|
|
45
46
|
loop,
|
|
46
47
|
size = "default",
|
|
47
48
|
variant = "default",
|
|
@@ -253,6 +254,7 @@ const Command = forwardRef((props, forwardedRef) => {
|
|
|
253
254
|
propsRef,
|
|
254
255
|
schedule,
|
|
255
256
|
selectFirstItem,
|
|
257
|
+
selection,
|
|
256
258
|
size,
|
|
257
259
|
sort,
|
|
258
260
|
state,
|
|
@@ -6,6 +6,10 @@ export interface CommandItemProps extends Omit<HTMLProps<HTMLDivElement>, "onSel
|
|
|
6
6
|
keywords?: string[];
|
|
7
7
|
onSelect?: (value: string) => void;
|
|
8
8
|
prefixElement?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* When true, this item will be set as the selected item and scrolled into view.
|
|
11
|
+
*/
|
|
12
|
+
selected?: boolean;
|
|
9
13
|
shortcut?: {
|
|
10
14
|
keys?: ReactNode;
|
|
11
15
|
modifier?: KbdKey | KbdKey[] | undefined;
|
|
@@ -16,6 +16,7 @@ const CommandItem = memo(
|
|
|
16
16
|
forceMount,
|
|
17
17
|
keywords,
|
|
18
18
|
onSelect,
|
|
19
|
+
selected: selectedProp,
|
|
19
20
|
value,
|
|
20
21
|
children,
|
|
21
22
|
prefixElement,
|
|
@@ -50,6 +51,11 @@ const CommandItem = memo(
|
|
|
50
51
|
const stableKeywords = useMemo(() => keywords || [], [keywords]);
|
|
51
52
|
const valueRef = useValue(id, ref, valueDeps, stableKeywords);
|
|
52
53
|
const store = context.store;
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (context.selection && selectedProp && valueRef.current) {
|
|
56
|
+
store.setState("value", valueRef.current);
|
|
57
|
+
}
|
|
58
|
+
}, [selectedProp]);
|
|
53
59
|
const selected = useCommandState(
|
|
54
60
|
(state) => Boolean(state.value && state.value === (valueRef == null ? void 0 : valueRef.current))
|
|
55
61
|
);
|
|
@@ -58,6 +58,7 @@ const CommandList = forwardRef((props, forwardedRef) => {
|
|
|
58
58
|
},
|
|
59
59
|
...rest,
|
|
60
60
|
className: tcx(tv.root({ className })),
|
|
61
|
+
style: context.selection ? { scrollPaddingBlock: 8 } : void 0,
|
|
61
62
|
role: "listbox",
|
|
62
63
|
tabIndex: -1,
|
|
63
64
|
"aria-activedescendant": selectedItemId,
|
|
@@ -16,6 +16,7 @@ interface CreateCommandContextOptions {
|
|
|
16
16
|
propsRef: React.MutableRefObject<CommandProps>;
|
|
17
17
|
schedule: (id: string | number, cb: () => void) => void;
|
|
18
18
|
selectFirstItem: () => void;
|
|
19
|
+
selection?: boolean;
|
|
19
20
|
size?: "default" | "large";
|
|
20
21
|
sort: () => void;
|
|
21
22
|
state: React.MutableRefObject<State>;
|
|
@@ -13,6 +13,7 @@ function createCommandContext(options) {
|
|
|
13
13
|
propsRef,
|
|
14
14
|
schedule,
|
|
15
15
|
selectFirstItem,
|
|
16
|
+
selection,
|
|
16
17
|
size,
|
|
17
18
|
sort,
|
|
18
19
|
state,
|
|
@@ -93,6 +94,7 @@ function createCommandContext(options) {
|
|
|
93
94
|
inputId,
|
|
94
95
|
labelId,
|
|
95
96
|
listInnerRef,
|
|
97
|
+
selection,
|
|
96
98
|
store,
|
|
97
99
|
size,
|
|
98
100
|
variant
|
|
@@ -27,6 +27,11 @@ export interface CommandProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
27
27
|
* Event handler called when the selected item of the menu changes.
|
|
28
28
|
*/
|
|
29
29
|
onChange?: (value: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Optionally set to `true` to enable selection mode.
|
|
32
|
+
* When enabled, items with `selected` prop will be scrolled into view on mount.
|
|
33
|
+
*/
|
|
34
|
+
selection?: boolean;
|
|
30
35
|
/**
|
|
31
36
|
* Optionally set to `false` to turn off the automatic filtering and sorting.
|
|
32
37
|
* If `false`, you must conditionally render valid items based on the search query yourself.
|
|
@@ -61,6 +66,7 @@ export type Context = {
|
|
|
61
66
|
labelId: string;
|
|
62
67
|
listId: string;
|
|
63
68
|
listInnerRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
69
|
+
selection?: boolean;
|
|
64
70
|
size?: "default" | "large";
|
|
65
71
|
store: Store;
|
|
66
72
|
value: (id: string, value?: string, keywords?: string[]) => void;
|
|
@@ -2,6 +2,11 @@ import { MenuButton, MenuContextContent, MenuContextItem, MenuContextLabel, Menu
|
|
|
2
2
|
import { FloatingFocusManagerProps, Placement } from '@floating-ui/react';
|
|
3
3
|
import { default as React } from 'react';
|
|
4
4
|
export interface DropdownProps {
|
|
5
|
+
/**
|
|
6
|
+
* Active index for keyboard navigation (controlled).
|
|
7
|
+
* When provided, the component becomes controlled for activeIndex.
|
|
8
|
+
*/
|
|
9
|
+
activeIndex?: number | null;
|
|
5
10
|
/**
|
|
6
11
|
* Whether to automatically select the first item in coordinate mode.
|
|
7
12
|
* @default true
|
|
@@ -14,10 +19,21 @@ export interface DropdownProps {
|
|
|
14
19
|
*/
|
|
15
20
|
avoidCollisions?: boolean;
|
|
16
21
|
children?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Disable internal keyboard navigation.
|
|
24
|
+
* Useful when implementing custom keyboard handling externally.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disableKeyboardNavigation?: boolean;
|
|
17
28
|
disabledNested?: boolean;
|
|
18
29
|
focusManagerProps?: Partial<FloatingFocusManagerProps>;
|
|
19
30
|
matchTriggerWidth?: boolean;
|
|
20
31
|
offset?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Callback when active index changes.
|
|
34
|
+
* Use with activeIndex prop for controlled keyboard navigation.
|
|
35
|
+
*/
|
|
36
|
+
onActiveIndexChange?: (index: number | null) => void;
|
|
21
37
|
onOpenChange?: (open: boolean) => void;
|
|
22
38
|
open?: boolean;
|
|
23
39
|
placement?: Placement;
|
|
@@ -12,8 +12,10 @@ const DEFAULT_OFFSET = 4;
|
|
|
12
12
|
const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
13
13
|
const {
|
|
14
14
|
children,
|
|
15
|
+
activeIndex: controlledActiveIndex,
|
|
15
16
|
autoSelectFirstItem = true,
|
|
16
17
|
avoidCollisions = true,
|
|
18
|
+
disableKeyboardNavigation = false,
|
|
17
19
|
disabledNested = false,
|
|
18
20
|
offset: offsetDistance = DEFAULT_OFFSET,
|
|
19
21
|
placement = "bottom-start",
|
|
@@ -23,6 +25,7 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
23
25
|
selection = false,
|
|
24
26
|
matchTriggerWidth = false,
|
|
25
27
|
open: controlledOpen,
|
|
28
|
+
onActiveIndexChange,
|
|
26
29
|
onOpenChange,
|
|
27
30
|
triggerRef,
|
|
28
31
|
triggerSelector,
|
|
@@ -39,10 +42,12 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
39
42
|
const { scrollRef, elementsRef, labelsRef, selectTimeoutRef } = useMenuBaseRefs();
|
|
40
43
|
const [isOpen, setIsOpen] = useState(false);
|
|
41
44
|
const [hasFocusInside, setHasFocusInside] = useState(false);
|
|
42
|
-
const [
|
|
45
|
+
const [internalActiveIndex, setInternalActiveIndex] = useState(null);
|
|
43
46
|
const [scrollTop, setScrollTop] = useState(0);
|
|
44
47
|
const [touch, setTouch] = useState(false);
|
|
45
48
|
const [isMouseOverMenu, setIsMouseOverMenu] = useState(false);
|
|
49
|
+
const isControlledActiveIndex = controlledActiveIndex !== void 0;
|
|
50
|
+
const activeIndex = isControlledActiveIndex ? controlledActiveIndex : internalActiveIndex;
|
|
46
51
|
const isCoordinateMode = position !== null && position !== void 0;
|
|
47
52
|
const isControlledOpen = isCoordinateMode ? controlledOpen || false : controlledOpen === void 0 ? isOpen : controlledOpen;
|
|
48
53
|
const baseId = useId();
|
|
@@ -119,6 +124,12 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
119
124
|
middleware,
|
|
120
125
|
whileElementsMounted: autoUpdate
|
|
121
126
|
});
|
|
127
|
+
const handleSetActiveIndex = useEventCallback((index) => {
|
|
128
|
+
if (!isControlledActiveIndex) {
|
|
129
|
+
setInternalActiveIndex(index);
|
|
130
|
+
}
|
|
131
|
+
onActiveIndexChange == null ? void 0 : onActiveIndexChange(index);
|
|
132
|
+
});
|
|
122
133
|
useIsomorphicLayoutEffect(() => {
|
|
123
134
|
if (position && isCoordinateMode && isControlledOpen && (!lastPositionRef.current || lastPositionRef.current.x !== position.x || lastPositionRef.current.y !== position.y)) {
|
|
124
135
|
setVirtualPosition(position);
|
|
@@ -127,14 +138,14 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
127
138
|
}, [position, isCoordinateMode, isControlledOpen, setVirtualPosition]);
|
|
128
139
|
useEffect(() => {
|
|
129
140
|
if (isCoordinateMode && isControlledOpen && activeIndex === null && !isMouseOverMenu) {
|
|
130
|
-
|
|
141
|
+
handleSetActiveIndex(autoSelectFirstItem ? 0 : null);
|
|
131
142
|
}
|
|
132
|
-
}, [isCoordinateMode, isControlledOpen, activeIndex, isMouseOverMenu, autoSelectFirstItem]);
|
|
143
|
+
}, [isCoordinateMode, isControlledOpen, activeIndex, isMouseOverMenu, autoSelectFirstItem, handleSetActiveIndex]);
|
|
133
144
|
useEffect(() => {
|
|
134
145
|
if (isCoordinateMode && !isControlledOpen) {
|
|
135
|
-
|
|
146
|
+
handleSetActiveIndex(null);
|
|
136
147
|
}
|
|
137
|
-
}, [isCoordinateMode, isControlledOpen]);
|
|
148
|
+
}, [isCoordinateMode, isControlledOpen, handleSetActiveIndex]);
|
|
138
149
|
const isOpenRef = useRef(isControlledOpen);
|
|
139
150
|
isOpenRef.current = isControlledOpen;
|
|
140
151
|
useEffect(() => {
|
|
@@ -170,7 +181,7 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
170
181
|
escapeKey: true
|
|
171
182
|
});
|
|
172
183
|
const handleNavigate = useEventCallback((index) => {
|
|
173
|
-
|
|
184
|
+
handleSetActiveIndex(index);
|
|
174
185
|
if (tree && index !== null) {
|
|
175
186
|
tree.events.emit("navigate", { nodeId, index });
|
|
176
187
|
}
|
|
@@ -180,12 +191,14 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
180
191
|
activeIndex,
|
|
181
192
|
nested: isNested,
|
|
182
193
|
onNavigate: handleNavigate,
|
|
183
|
-
loop: true
|
|
194
|
+
loop: true,
|
|
195
|
+
enabled: !disableKeyboardNavigation
|
|
184
196
|
});
|
|
185
197
|
const typeahead = useTypeahead(context, {
|
|
186
198
|
listRef: labelsRef,
|
|
187
|
-
onMatch: isControlledOpen ?
|
|
188
|
-
activeIndex
|
|
199
|
+
onMatch: isControlledOpen ? handleSetActiveIndex : void 0,
|
|
200
|
+
activeIndex,
|
|
201
|
+
enabled: !disableKeyboardNavigation
|
|
189
202
|
});
|
|
190
203
|
const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([
|
|
191
204
|
hover,
|
|
@@ -278,7 +291,7 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
278
291
|
const contextValue = useMemo(
|
|
279
292
|
() => ({
|
|
280
293
|
activeIndex,
|
|
281
|
-
setActiveIndex,
|
|
294
|
+
setActiveIndex: handleSetActiveIndex,
|
|
282
295
|
getItemProps,
|
|
283
296
|
setHasFocusInside,
|
|
284
297
|
isOpen: isControlledOpen,
|
|
@@ -287,7 +300,7 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
|
|
|
287
300
|
close: handleClose,
|
|
288
301
|
variant
|
|
289
302
|
}),
|
|
290
|
-
[activeIndex, getItemProps, handleClose, isControlledOpen, readOnly, selection, variant]
|
|
303
|
+
[activeIndex, getItemProps, handleClose, handleSetActiveIndex, isControlledOpen, readOnly, selection, variant]
|
|
291
304
|
);
|
|
292
305
|
const parentActiveIndex = parent == null ? void 0 : parent.activeIndex;
|
|
293
306
|
const parentGetItemProps = parent == null ? void 0 : parent.getItemProps;
|
|
@@ -67,7 +67,7 @@ interface ListProps extends Omit<HTMLProps<HTMLDivElement>, "size" | "as"> {
|
|
|
67
67
|
selection?: boolean;
|
|
68
68
|
shouldShowReferenceLine?: boolean;
|
|
69
69
|
size?: "default" | "large";
|
|
70
|
-
variant?: "default" | "primary";
|
|
70
|
+
variant?: "default" | "primary" | "dark" | "reset";
|
|
71
71
|
}
|
|
72
72
|
interface ListComponentProps extends React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLDivElement>> {
|
|
73
73
|
Content: typeof ListContent;
|
|
@@ -6,7 +6,7 @@ import { tcx } from "../../../../shared/utils/tcx/tcx.js";
|
|
|
6
6
|
const ListContent = forwardRef((props, ref) => {
|
|
7
7
|
const { as: As = "div", children, className, parentId, ...rest } = props;
|
|
8
8
|
const { isSubListExpanded } = useExpandContext();
|
|
9
|
-
const { itemsMap, shouldShowReferenceLine, size } = useStructureContext();
|
|
9
|
+
const { itemsMap, shouldShowReferenceLine, size, variant } = useStructureContext();
|
|
10
10
|
const level = useMemo(() => {
|
|
11
11
|
if (!parentId) return 0;
|
|
12
12
|
let currentLevel = 1;
|
|
@@ -32,7 +32,8 @@ const ListContent = forwardRef((props, ref) => {
|
|
|
32
32
|
const tv = ListContentTv({
|
|
33
33
|
showReferenceLine: shouldShowReferenceLine,
|
|
34
34
|
level: safeLevel,
|
|
35
|
-
size
|
|
35
|
+
size,
|
|
36
|
+
variant
|
|
36
37
|
});
|
|
37
38
|
return /* @__PURE__ */ jsx(LevelContext.Provider, { value: { level: safeLevel }, children: /* @__PURE__ */ jsx(
|
|
38
39
|
As,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { ListDividerTv } from "../tv.js";
|
|
4
|
+
import { useStructureContext } from "../context/list-context.js";
|
|
4
5
|
import { tcx } from "../../../../shared/utils/tcx/tcx.js";
|
|
5
6
|
const ListDivider = forwardRef(
|
|
6
7
|
(props, ref) => {
|
|
7
8
|
const { className, ...rest } = props;
|
|
8
|
-
const
|
|
9
|
+
const { variant = "default" } = useStructureContext();
|
|
10
|
+
const tv = ListDividerTv({ variant });
|
|
9
11
|
return /* @__PURE__ */ jsx(
|
|
10
12
|
"div",
|
|
11
13
|
{
|
|
@@ -28,7 +28,7 @@ interface StructureContextValue {
|
|
|
28
28
|
shouldShowReferenceLine?: boolean;
|
|
29
29
|
size?: "default" | "large";
|
|
30
30
|
unregisterItem: (id: string) => void;
|
|
31
|
-
variant?: "default" | "primary";
|
|
31
|
+
variant?: "default" | "primary" | "dark" | "reset";
|
|
32
32
|
}
|
|
33
33
|
export declare const StructureContext: import('react').Context<StructureContextValue | undefined>;
|
|
34
34
|
export declare function useStructureContext(): StructureContextValue;
|
|
@@ -5,7 +5,7 @@ interface ListProviderProps {
|
|
|
5
5
|
selection?: boolean;
|
|
6
6
|
shouldShowReferenceLine?: boolean;
|
|
7
7
|
size?: "default" | "large";
|
|
8
|
-
variant?: "default" | "primary";
|
|
8
|
+
variant?: "default" | "primary" | "dark" | "reset";
|
|
9
9
|
}
|
|
10
10
|
export declare function ListProvider({ children, interactive, shouldShowReferenceLine, selection, variant, size, }: ListProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -12,7 +12,7 @@ export interface ListProps extends Omit<HTMLProps<HTMLDivElement>, "size" | "as"
|
|
|
12
12
|
selection?: boolean;
|
|
13
13
|
shouldShowReferenceLine?: boolean;
|
|
14
14
|
size?: "default" | "large";
|
|
15
|
-
variant?: "default" | "primary";
|
|
15
|
+
variant?: "default" | "primary" | "dark" | "reset";
|
|
16
16
|
}
|
|
17
17
|
interface ListComponentProps extends React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLDivElement>> {
|
|
18
18
|
Content: typeof ListContent;
|
|
@@ -28,6 +28,8 @@ export declare const ListItemTv: import('tailwind-variants').TVReturnType<{
|
|
|
28
28
|
variant: {
|
|
29
29
|
default: {};
|
|
30
30
|
primary: {};
|
|
31
|
+
dark: {};
|
|
32
|
+
reset: {};
|
|
31
33
|
};
|
|
32
34
|
size: {
|
|
33
35
|
default: {
|
|
@@ -78,6 +80,8 @@ export declare const ListItemTv: import('tailwind-variants').TVReturnType<{
|
|
|
78
80
|
variant: {
|
|
79
81
|
default: {};
|
|
80
82
|
primary: {};
|
|
83
|
+
dark: {};
|
|
84
|
+
reset: {};
|
|
81
85
|
};
|
|
82
86
|
size: {
|
|
83
87
|
default: {
|
|
@@ -128,6 +132,8 @@ export declare const ListItemTv: import('tailwind-variants').TVReturnType<{
|
|
|
128
132
|
variant: {
|
|
129
133
|
default: {};
|
|
130
134
|
primary: {};
|
|
135
|
+
dark: {};
|
|
136
|
+
reset: {};
|
|
131
137
|
};
|
|
132
138
|
size: {
|
|
133
139
|
default: {
|
|
@@ -167,33 +173,51 @@ export declare const ListLabelTv: import('tailwind-variants').TVReturnType<{
|
|
|
167
173
|
};
|
|
168
174
|
}, undefined, "flex h-6 w-full flex-none items-center gap-2 opacity-50", unknown, unknown, undefined>>;
|
|
169
175
|
export declare const ListDividerTv: import('tailwind-variants').TVReturnType<{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
divider?: import('tailwind-merge').ClassNameValue;
|
|
176
|
+
variant: {
|
|
177
|
+
default: {
|
|
178
|
+
divider: string;
|
|
174
179
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
divider?: import('tailwind-merge').ClassNameValue;
|
|
180
|
+
primary: {
|
|
181
|
+
divider: string;
|
|
182
|
+
};
|
|
183
|
+
dark: {
|
|
184
|
+
divider: string;
|
|
181
185
|
};
|
|
186
|
+
reset: {};
|
|
182
187
|
};
|
|
183
|
-
}
|
|
188
|
+
}, {
|
|
184
189
|
root: string;
|
|
185
190
|
divider: string;
|
|
186
191
|
}, undefined, {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
variant: {
|
|
193
|
+
default: {
|
|
194
|
+
divider: string;
|
|
195
|
+
};
|
|
196
|
+
primary: {
|
|
197
|
+
divider: string;
|
|
191
198
|
};
|
|
199
|
+
dark: {
|
|
200
|
+
divider: string;
|
|
201
|
+
};
|
|
202
|
+
reset: {};
|
|
192
203
|
};
|
|
193
|
-
}
|
|
204
|
+
}, {
|
|
194
205
|
root: string;
|
|
195
206
|
divider: string;
|
|
196
|
-
}, import('tailwind-variants').TVReturnType<
|
|
207
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
208
|
+
variant: {
|
|
209
|
+
default: {
|
|
210
|
+
divider: string;
|
|
211
|
+
};
|
|
212
|
+
primary: {
|
|
213
|
+
divider: string;
|
|
214
|
+
};
|
|
215
|
+
dark: {
|
|
216
|
+
divider: string;
|
|
217
|
+
};
|
|
218
|
+
reset: {};
|
|
219
|
+
};
|
|
220
|
+
}, {
|
|
197
221
|
root: string;
|
|
198
222
|
divider: string;
|
|
199
223
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -206,6 +230,12 @@ export declare const ListContentTv: import('tailwind-variants').TVReturnType<{
|
|
|
206
230
|
default: {};
|
|
207
231
|
large: {};
|
|
208
232
|
};
|
|
233
|
+
variant: {
|
|
234
|
+
default: {};
|
|
235
|
+
primary: {};
|
|
236
|
+
dark: {};
|
|
237
|
+
reset: {};
|
|
238
|
+
};
|
|
209
239
|
level: {
|
|
210
240
|
0: string;
|
|
211
241
|
1: string;
|
|
@@ -223,6 +253,12 @@ export declare const ListContentTv: import('tailwind-variants').TVReturnType<{
|
|
|
223
253
|
default: {};
|
|
224
254
|
large: {};
|
|
225
255
|
};
|
|
256
|
+
variant: {
|
|
257
|
+
default: {};
|
|
258
|
+
primary: {};
|
|
259
|
+
dark: {};
|
|
260
|
+
reset: {};
|
|
261
|
+
};
|
|
226
262
|
level: {
|
|
227
263
|
0: string;
|
|
228
264
|
1: string;
|
|
@@ -240,6 +276,12 @@ export declare const ListContentTv: import('tailwind-variants').TVReturnType<{
|
|
|
240
276
|
default: {};
|
|
241
277
|
large: {};
|
|
242
278
|
};
|
|
279
|
+
variant: {
|
|
280
|
+
default: {};
|
|
281
|
+
primary: {};
|
|
282
|
+
dark: {};
|
|
283
|
+
reset: {};
|
|
284
|
+
};
|
|
243
285
|
level: {
|
|
244
286
|
0: string;
|
|
245
287
|
1: string;
|
|
@@ -46,7 +46,9 @@ const ListItemTv = tcv({
|
|
|
46
46
|
},
|
|
47
47
|
variant: {
|
|
48
48
|
default: {},
|
|
49
|
-
primary: {}
|
|
49
|
+
primary: {},
|
|
50
|
+
dark: {},
|
|
51
|
+
reset: {}
|
|
50
52
|
},
|
|
51
53
|
size: {
|
|
52
54
|
default: {
|
|
@@ -91,6 +93,15 @@ const ListItemTv = tcv({
|
|
|
91
93
|
shortcut: "text-default-foreground"
|
|
92
94
|
}
|
|
93
95
|
},
|
|
96
|
+
{
|
|
97
|
+
disabled: false,
|
|
98
|
+
active: true,
|
|
99
|
+
variant: "dark",
|
|
100
|
+
class: {
|
|
101
|
+
root: "bg-white/10",
|
|
102
|
+
shortcut: "text-white"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
94
105
|
{
|
|
95
106
|
size: "default",
|
|
96
107
|
hasPrefix: false,
|
|
@@ -208,9 +219,25 @@ const ListLabelTv = tcv({
|
|
|
208
219
|
const ListDividerTv = tcv({
|
|
209
220
|
slots: {
|
|
210
221
|
root: "flex h-4 w-full flex-none items-center",
|
|
211
|
-
divider: "
|
|
222
|
+
divider: "h-px flex-1"
|
|
212
223
|
},
|
|
213
|
-
|
|
224
|
+
variants: {
|
|
225
|
+
variant: {
|
|
226
|
+
default: {
|
|
227
|
+
divider: "bg-default-boundary"
|
|
228
|
+
},
|
|
229
|
+
primary: {
|
|
230
|
+
divider: "bg-default-boundary"
|
|
231
|
+
},
|
|
232
|
+
dark: {
|
|
233
|
+
divider: "bg-white/10"
|
|
234
|
+
},
|
|
235
|
+
reset: {}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
defaultVariants: {
|
|
239
|
+
variant: "default"
|
|
240
|
+
}
|
|
214
241
|
});
|
|
215
242
|
const ListContentTv = tcv({
|
|
216
243
|
base: "group/list flex flex-col gap-1",
|
|
@@ -223,6 +250,12 @@ const ListContentTv = tcv({
|
|
|
223
250
|
default: {},
|
|
224
251
|
large: {}
|
|
225
252
|
},
|
|
253
|
+
variant: {
|
|
254
|
+
default: {},
|
|
255
|
+
primary: {},
|
|
256
|
+
dark: {},
|
|
257
|
+
reset: {}
|
|
258
|
+
},
|
|
226
259
|
level: {
|
|
227
260
|
0: "",
|
|
228
261
|
1: "",
|
|
@@ -238,10 +271,17 @@ const ListContentTv = tcv({
|
|
|
238
271
|
level: [1, 2, 3, 4, 5],
|
|
239
272
|
class: [
|
|
240
273
|
"relative",
|
|
241
|
-
"before:absolute before:inset-y-0 before:z-1 before:w-px before:content-['']"
|
|
242
|
-
"group-hover/list:before:bg-default-boundary"
|
|
274
|
+
"before:absolute before:inset-y-0 before:z-1 before:w-px before:content-['']"
|
|
243
275
|
]
|
|
244
276
|
},
|
|
277
|
+
{
|
|
278
|
+
variant: ["default", "primary"],
|
|
279
|
+
class: "group-hover/list:before:bg-default-boundary"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
variant: "dark",
|
|
283
|
+
class: "group-hover/list:before:bg-white/10"
|
|
284
|
+
},
|
|
245
285
|
{
|
|
246
286
|
size: "default",
|
|
247
287
|
level: 1,
|
package/package.json
CHANGED