@regardio/react 0.7.24 → 0.8.1
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/button/index.d.mts +2 -2
- package/dist/button/index.mjs +2 -2
- package/dist/button-BllZdqCA.mjs +109 -0
- package/dist/carousel/index.mjs +1 -1
- package/dist/checkbox/index.mjs +12 -17
- package/dist/combobox/index.d.mts +142 -0
- package/dist/combobox/index.mjs +238 -0
- package/dist/field/index.d.mts +2 -2
- package/dist/field/index.mjs +26 -26
- package/dist/fieldset/index.d.mts +2 -2
- package/dist/fieldset/index.mjs +18 -21
- package/dist/icon-button/index.d.mts +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/index-BTB1biC_.d.mts +19 -0
- package/dist/index-DEHa010W.d.mts +35 -0
- package/dist/input/index.d.mts +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/input-BHRHF8xW.mjs +62 -0
- package/dist/password-input/index.d.mts +2 -2
- package/dist/password-input/index.mjs +5 -6
- package/dist/radio/index.mjs +12 -17
- package/dist/slider/index.mjs +6 -13
- package/dist/switch/index.mjs +7 -12
- package/dist/text/index.d.mts +6 -3
- package/dist/text/index.mjs +6 -3
- package/dist/toggle/index.mjs +44 -29
- package/package.json +27 -15
- package/src/button/button.test.tsx +12 -8
- package/src/button/button.tsx +50 -59
- package/src/button/index.ts +2 -2
- package/src/checkbox/checkbox.tsx +11 -14
- package/src/combobox/combobox.stories.tsx +137 -0
- package/src/combobox/combobox.tsx +435 -0
- package/src/combobox/index.ts +2 -0
- package/src/field/field.test.tsx +1 -1
- package/src/field/field.tsx +21 -13
- package/src/fieldset/fieldset.test.tsx +1 -1
- package/src/fieldset/fieldset.tsx +6 -6
- package/src/icon-button/icon-button.test.tsx +1 -1
- package/src/input/input.stories.tsx +0 -11
- package/src/input/input.test.tsx +5 -2
- package/src/input/input.tsx +34 -75
- package/src/password-input/password-input.tsx +4 -5
- package/src/radio/radio.tsx +11 -14
- package/src/slider/slider.tsx +6 -8
- package/src/storybook.css +27 -0
- package/src/switch/switch.tsx +6 -11
- package/src/text/text.tsx +6 -3
- package/src/toggle/toggle.test.tsx +1 -2
- package/src/toggle/toggle.tsx +44 -29
- package/dist/button-wigUM1BB.mjs +0 -127
- package/dist/index-B_G_f749.d.mts +0 -29
- package/dist/index-DH3W0i5O.d.mts +0 -35
- package/dist/input-C2SM4-AB.mjs +0 -71
package/dist/button/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { Button, ButtonProps,
|
|
1
|
+
import { i as buttonVariants, n as ButtonProps, r as ButtonVariant, t as Button } from "../index-DEHa010W.mjs";
|
|
2
|
+
export { Button, ButtonProps, ButtonVariant, buttonVariants };
|
package/dist/button/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Button } from "../button-
|
|
2
|
-
export { Button };
|
|
1
|
+
import { n as buttonVariants, t as Button } from "../button-BllZdqCA.mjs";
|
|
2
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { tv } from "@regardio/tailwind/utils";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@base-ui/react/button";
|
|
4
|
+
//#region src/button/button.tsx
|
|
5
|
+
const buttonVariants = {
|
|
6
|
+
destructive: [
|
|
7
|
+
"inline-flex",
|
|
8
|
+
"items-center",
|
|
9
|
+
"justify-center",
|
|
10
|
+
"transition-colors",
|
|
11
|
+
"bg-destructive",
|
|
12
|
+
"text-destructive-foreground",
|
|
13
|
+
"border-destructive",
|
|
14
|
+
"hover:bg-destructive-hover",
|
|
15
|
+
"hover:border-destructive-hover"
|
|
16
|
+
],
|
|
17
|
+
ghost: [
|
|
18
|
+
"inline-flex",
|
|
19
|
+
"items-center",
|
|
20
|
+
"justify-center",
|
|
21
|
+
"transition-colors",
|
|
22
|
+
"bg-transparent",
|
|
23
|
+
"text-foreground",
|
|
24
|
+
"border-transparent",
|
|
25
|
+
"hover:bg-muted"
|
|
26
|
+
],
|
|
27
|
+
outline: [
|
|
28
|
+
"inline-flex",
|
|
29
|
+
"items-center",
|
|
30
|
+
"justify-center",
|
|
31
|
+
"transition-colors",
|
|
32
|
+
"bg-transparent",
|
|
33
|
+
"text-foreground",
|
|
34
|
+
"border-current",
|
|
35
|
+
"hover:bg-muted"
|
|
36
|
+
],
|
|
37
|
+
primary: [
|
|
38
|
+
"inline-flex",
|
|
39
|
+
"items-center",
|
|
40
|
+
"justify-center",
|
|
41
|
+
"transition-colors",
|
|
42
|
+
"bg-primary",
|
|
43
|
+
"text-primary-foreground",
|
|
44
|
+
"border-primary",
|
|
45
|
+
"hover:bg-primary-hover",
|
|
46
|
+
"hover:border-primary-hover"
|
|
47
|
+
],
|
|
48
|
+
secondary: [
|
|
49
|
+
"inline-flex",
|
|
50
|
+
"items-center",
|
|
51
|
+
"justify-center",
|
|
52
|
+
"transition-colors",
|
|
53
|
+
"bg-secondary",
|
|
54
|
+
"text-secondary-foreground",
|
|
55
|
+
"border-secondary",
|
|
56
|
+
"hover:bg-secondary-hover",
|
|
57
|
+
"hover:border-secondary-hover"
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
const button = tv({
|
|
61
|
+
base: [],
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
size: "md",
|
|
64
|
+
variant: "primary"
|
|
65
|
+
},
|
|
66
|
+
variants: {
|
|
67
|
+
size: {
|
|
68
|
+
"2xl": [
|
|
69
|
+
"px-8",
|
|
70
|
+
"py-4",
|
|
71
|
+
"text-xl"
|
|
72
|
+
],
|
|
73
|
+
lg: [
|
|
74
|
+
"px-6",
|
|
75
|
+
"py-3",
|
|
76
|
+
"text-lg"
|
|
77
|
+
],
|
|
78
|
+
md: [
|
|
79
|
+
"px-4",
|
|
80
|
+
"py-2",
|
|
81
|
+
"text-base"
|
|
82
|
+
],
|
|
83
|
+
sm: [
|
|
84
|
+
"px-3",
|
|
85
|
+
"py-1.5",
|
|
86
|
+
"text-sm"
|
|
87
|
+
],
|
|
88
|
+
xl: [
|
|
89
|
+
"px-7",
|
|
90
|
+
"py-3.5",
|
|
91
|
+
"text-lg"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
variant: buttonVariants
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const Button$1 = ({ children, className, size, variant, ...props }) => {
|
|
98
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
99
|
+
className: button({
|
|
100
|
+
className,
|
|
101
|
+
size,
|
|
102
|
+
variant
|
|
103
|
+
}),
|
|
104
|
+
...props,
|
|
105
|
+
children
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
export { buttonVariants as n, Button$1 as t };
|
package/dist/carousel/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-CfYAbeIz.mjs";
|
|
2
|
-
import { t as Button } from "../button-
|
|
2
|
+
import { t as Button } from "../button-BllZdqCA.mjs";
|
|
3
3
|
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import useEmblaCarousel from "embla-carousel-react";
|
package/dist/checkbox/index.mjs
CHANGED
|
@@ -4,22 +4,19 @@ import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
|
4
4
|
//#region src/checkbox/checkbox.tsx
|
|
5
5
|
const checkboxRoot = tv({
|
|
6
6
|
base: [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"flex",
|
|
8
|
+
"items-center",
|
|
9
|
+
"justify-center",
|
|
9
10
|
"rounded",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"focus:outline-none",
|
|
14
|
-
"focus:ring-2",
|
|
15
|
-
"focus:ring-blue-500",
|
|
16
|
-
"focus:ring-offset-2",
|
|
11
|
+
"focus-visible:outline-2",
|
|
12
|
+
"focus-visible:outline-offset-2",
|
|
13
|
+
"focus-visible:outline-ring",
|
|
17
14
|
"disabled:cursor-not-allowed",
|
|
18
|
-
"
|
|
19
|
-
"data-[
|
|
20
|
-
"data-[
|
|
15
|
+
"data-[checked]:bg-primary",
|
|
16
|
+
"data-[unchecked]:border",
|
|
17
|
+
"data-[unchecked]:border-current",
|
|
18
|
+
"data-[unchecked]:bg-background-muted",
|
|
21
19
|
"transition-colors",
|
|
22
|
-
"duration-200",
|
|
23
20
|
"cursor-pointer"
|
|
24
21
|
],
|
|
25
22
|
defaultVariants: { size: "md" },
|
|
@@ -31,10 +28,8 @@ const checkboxRoot = tv({
|
|
|
31
28
|
});
|
|
32
29
|
const checkboxIndicator = tv({ base: [
|
|
33
30
|
"flex",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"text-white",
|
|
37
|
-
"data-[unchecked]:invisible"
|
|
31
|
+
"text-primary-foreground",
|
|
32
|
+
"data-[unchecked]:hidden"
|
|
38
33
|
] });
|
|
39
34
|
const CheckboxRoot = ({ className, size = "md", ...props }) => {
|
|
40
35
|
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ComponentProps, ForwardRefExoticComponent, ReactNode, RefAttributes } from "react";
|
|
2
|
+
import { JSX } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as Combobox$1, ComboboxArrowProps, ComboboxBackdropProps, ComboboxGroupProps, ComboboxLabelProps, ComboboxPortalProps, ComboboxRowProps, ComboboxStatusProps } from "@base-ui/react/combobox";
|
|
4
|
+
|
|
5
|
+
//#region src/combobox/combobox.d.ts
|
|
6
|
+
type ComboboxSize = "sm" | "md" | "lg";
|
|
7
|
+
interface ComboboxInputGroupProps extends ComponentProps<typeof Combobox$1.InputGroup> {
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ComboboxInputProps extends Omit<ComponentProps<typeof Combobox$1.Input>, "size"> {
|
|
11
|
+
className?: string;
|
|
12
|
+
size?: ComboboxSize;
|
|
13
|
+
}
|
|
14
|
+
interface ComboboxTriggerProps extends ComponentProps<typeof Combobox$1.Trigger> {
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
interface ComboboxIconProps extends ComponentProps<typeof Combobox$1.Icon> {
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface ComboboxClearProps extends ComponentProps<typeof Combobox$1.Clear> {
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
interface ComboboxChipsProps extends ComponentProps<typeof Combobox$1.Chips> {
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
interface ComboboxChipProps extends ComponentProps<typeof Combobox$1.Chip> {
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
interface ComboboxChipRemoveProps extends ComponentProps<typeof Combobox$1.ChipRemove> {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
interface ComboboxPositionerProps extends ComponentProps<typeof Combobox$1.Positioner> {
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
interface ComboboxPopupProps extends ComponentProps<typeof Combobox$1.Popup> {
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ComboboxListProps extends ComponentProps<typeof Combobox$1.List> {
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ComboboxItemProps extends ComponentProps<typeof Combobox$1.Item> {
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
interface ComboboxItemIndicatorProps extends ComponentProps<typeof Combobox$1.ItemIndicator> {
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
interface ComboboxEmptyProps extends ComponentProps<typeof Combobox$1.Empty> {
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
interface ComboboxGroupLabelProps extends ComponentProps<typeof Combobox$1.GroupLabel> {
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
interface ComboboxSeparatorProps extends ComponentProps<typeof Combobox$1.Separator> {
|
|
57
|
+
className?: string;
|
|
58
|
+
}
|
|
59
|
+
declare const Combobox: {
|
|
60
|
+
Arrow: ForwardRefExoticComponent<Omit<ComboboxArrowProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
61
|
+
Backdrop: ForwardRefExoticComponent<Omit<ComboboxBackdropProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
62
|
+
Chip: ({
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
}: ComboboxChipProps) => JSX.Element;
|
|
66
|
+
ChipRemove: ({
|
|
67
|
+
className,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}: ComboboxChipRemoveProps) => JSX.Element;
|
|
71
|
+
Chips: ({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: ComboboxChipsProps) => JSX.Element;
|
|
75
|
+
Clear: ({
|
|
76
|
+
className,
|
|
77
|
+
children,
|
|
78
|
+
...props
|
|
79
|
+
}: ComboboxClearProps) => JSX.Element;
|
|
80
|
+
Collection: typeof Combobox$1.Collection;
|
|
81
|
+
Empty: ({
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}: ComboboxEmptyProps) => JSX.Element;
|
|
85
|
+
Group: ForwardRefExoticComponent<Omit<ComboboxGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
86
|
+
GroupLabel: ({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: ComboboxGroupLabelProps) => JSX.Element;
|
|
90
|
+
Icon: ({
|
|
91
|
+
className,
|
|
92
|
+
children,
|
|
93
|
+
...props
|
|
94
|
+
}: ComboboxIconProps) => JSX.Element;
|
|
95
|
+
Input: ({
|
|
96
|
+
className,
|
|
97
|
+
size,
|
|
98
|
+
...props
|
|
99
|
+
}: ComboboxInputProps) => JSX.Element;
|
|
100
|
+
InputGroup: ({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: ComboboxInputGroupProps) => JSX.Element;
|
|
104
|
+
Item: ({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}: ComboboxItemProps) => JSX.Element;
|
|
108
|
+
ItemIndicator: ({
|
|
109
|
+
className,
|
|
110
|
+
children,
|
|
111
|
+
...props
|
|
112
|
+
}: ComboboxItemIndicatorProps) => JSX.Element;
|
|
113
|
+
Label: ForwardRefExoticComponent<Omit<ComboboxLabelProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
114
|
+
List: ({
|
|
115
|
+
className,
|
|
116
|
+
...props
|
|
117
|
+
}: ComboboxListProps) => JSX.Element;
|
|
118
|
+
Popup: ({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}: ComboboxPopupProps) => JSX.Element;
|
|
122
|
+
Portal: ForwardRefExoticComponent<Omit<ComboboxPortalProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
123
|
+
Positioner: ({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: ComboboxPositionerProps) => JSX.Element;
|
|
127
|
+
Root: typeof Combobox$1.Root;
|
|
128
|
+
Row: ForwardRefExoticComponent<Omit<ComboboxRowProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
129
|
+
Separator: ({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}: ComboboxSeparatorProps) => JSX.Element;
|
|
133
|
+
Status: ForwardRefExoticComponent<Omit<ComboboxStatusProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
134
|
+
Trigger: ({
|
|
135
|
+
className,
|
|
136
|
+
children,
|
|
137
|
+
...props
|
|
138
|
+
}: ComboboxTriggerProps) => JSX.Element;
|
|
139
|
+
Value: typeof Combobox$1.Value;
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { Combobox, type ComboboxSize };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { tv } from "@regardio/tailwind/utils";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
|
|
4
|
+
//#region src/combobox/combobox.tsx
|
|
5
|
+
const comboboxInputGroup = tv({ base: ["relative", "w-full"] });
|
|
6
|
+
const comboboxInput = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"w-full",
|
|
9
|
+
"border",
|
|
10
|
+
"border-current",
|
|
11
|
+
"rounded-md",
|
|
12
|
+
"bg-background-muted",
|
|
13
|
+
"text-foreground",
|
|
14
|
+
"placeholder:text-muted-foreground",
|
|
15
|
+
"focus-visible:outline-2",
|
|
16
|
+
"focus-visible:outline-offset-2",
|
|
17
|
+
"focus-visible:outline-ring",
|
|
18
|
+
"transition-colors"
|
|
19
|
+
],
|
|
20
|
+
defaultVariants: { size: "md" },
|
|
21
|
+
variants: { size: {
|
|
22
|
+
lg: [
|
|
23
|
+
"px-4",
|
|
24
|
+
"py-3",
|
|
25
|
+
"text-lg"
|
|
26
|
+
],
|
|
27
|
+
md: ["px-3", "py-2"],
|
|
28
|
+
sm: [
|
|
29
|
+
"px-2",
|
|
30
|
+
"py-1",
|
|
31
|
+
"text-sm"
|
|
32
|
+
]
|
|
33
|
+
} }
|
|
34
|
+
});
|
|
35
|
+
const comboboxTrigger = tv({ base: [
|
|
36
|
+
"absolute",
|
|
37
|
+
"right-0",
|
|
38
|
+
"top-0",
|
|
39
|
+
"bottom-0",
|
|
40
|
+
"flex",
|
|
41
|
+
"items-center",
|
|
42
|
+
"px-3",
|
|
43
|
+
"text-muted-foreground",
|
|
44
|
+
"hover:text-foreground",
|
|
45
|
+
"cursor-pointer"
|
|
46
|
+
] });
|
|
47
|
+
const comboboxIcon = tv({ base: ["flex", "items-center"] });
|
|
48
|
+
const comboboxClear = tv({ base: [
|
|
49
|
+
"absolute",
|
|
50
|
+
"right-10",
|
|
51
|
+
"top-0",
|
|
52
|
+
"bottom-0",
|
|
53
|
+
"flex",
|
|
54
|
+
"items-center",
|
|
55
|
+
"px-2",
|
|
56
|
+
"text-muted-foreground",
|
|
57
|
+
"hover:text-foreground",
|
|
58
|
+
"cursor-pointer"
|
|
59
|
+
] });
|
|
60
|
+
const comboboxChips = tv({ base: [
|
|
61
|
+
"flex",
|
|
62
|
+
"flex-wrap",
|
|
63
|
+
"gap-1",
|
|
64
|
+
"pr-10",
|
|
65
|
+
"px-3",
|
|
66
|
+
"py-2",
|
|
67
|
+
"border",
|
|
68
|
+
"border-current",
|
|
69
|
+
"rounded-md",
|
|
70
|
+
"bg-background-muted",
|
|
71
|
+
"min-h-[42px]"
|
|
72
|
+
] });
|
|
73
|
+
const comboboxChip = tv({ base: [
|
|
74
|
+
"inline-flex",
|
|
75
|
+
"items-center",
|
|
76
|
+
"gap-1",
|
|
77
|
+
"px-2",
|
|
78
|
+
"py-1",
|
|
79
|
+
"rounded",
|
|
80
|
+
"bg-muted",
|
|
81
|
+
"text-foreground",
|
|
82
|
+
"text-sm"
|
|
83
|
+
] });
|
|
84
|
+
const comboboxChipRemove = tv({ base: [
|
|
85
|
+
"flex",
|
|
86
|
+
"items-center",
|
|
87
|
+
"text-muted-foreground",
|
|
88
|
+
"hover:text-foreground",
|
|
89
|
+
"cursor-pointer"
|
|
90
|
+
] });
|
|
91
|
+
const comboboxPositioner = tv({ base: ["absolute", "z-50"] });
|
|
92
|
+
const comboboxPopup = tv({ base: [
|
|
93
|
+
"min-w-[var(--anchor-width)]",
|
|
94
|
+
"mt-1",
|
|
95
|
+
"rounded-md",
|
|
96
|
+
"border",
|
|
97
|
+
"border-current",
|
|
98
|
+
"bg-background",
|
|
99
|
+
"shadow-lg",
|
|
100
|
+
"overflow-hidden"
|
|
101
|
+
] });
|
|
102
|
+
const comboboxList = tv({ base: [
|
|
103
|
+
"max-h-60",
|
|
104
|
+
"overflow-auto",
|
|
105
|
+
"py-1",
|
|
106
|
+
"bg-background"
|
|
107
|
+
] });
|
|
108
|
+
const comboboxItem = tv({ base: [
|
|
109
|
+
"flex",
|
|
110
|
+
"items-center",
|
|
111
|
+
"gap-2",
|
|
112
|
+
"px-3",
|
|
113
|
+
"py-2",
|
|
114
|
+
"cursor-pointer",
|
|
115
|
+
"text-foreground",
|
|
116
|
+
"data-[highlighted]:bg-muted",
|
|
117
|
+
"data-[selected]:bg-primary",
|
|
118
|
+
"data-[selected]:text-primary-foreground"
|
|
119
|
+
] });
|
|
120
|
+
const comboboxItemIndicator = tv({ base: ["flex", "data-[unselected]:hidden"] });
|
|
121
|
+
const comboboxEmpty = tv({ base: [
|
|
122
|
+
"px-3",
|
|
123
|
+
"py-2",
|
|
124
|
+
"text-muted-foreground"
|
|
125
|
+
] });
|
|
126
|
+
const comboboxGroupLabel = tv({ base: [
|
|
127
|
+
"px-3",
|
|
128
|
+
"py-2",
|
|
129
|
+
"text-muted-foreground",
|
|
130
|
+
"font-semibold"
|
|
131
|
+
] });
|
|
132
|
+
const comboboxSeparator = tv({ base: [
|
|
133
|
+
"my-1",
|
|
134
|
+
"h-px",
|
|
135
|
+
"bg-border"
|
|
136
|
+
] });
|
|
137
|
+
const ComboboxInputGroup = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.InputGroup, {
|
|
138
|
+
className: comboboxInputGroup({ className }),
|
|
139
|
+
...props
|
|
140
|
+
});
|
|
141
|
+
const ComboboxInput = ({ className, size = "md", ...props }) => /* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
142
|
+
className: comboboxInput({
|
|
143
|
+
className,
|
|
144
|
+
size
|
|
145
|
+
}),
|
|
146
|
+
...props
|
|
147
|
+
});
|
|
148
|
+
const ComboboxTrigger = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Trigger, {
|
|
149
|
+
className: comboboxTrigger({ className }),
|
|
150
|
+
...props,
|
|
151
|
+
children
|
|
152
|
+
});
|
|
153
|
+
const ComboboxIcon = ({ className, children = "▼", ...props }) => /* @__PURE__ */ jsx(Combobox$1.Icon, {
|
|
154
|
+
className: comboboxIcon({ className }),
|
|
155
|
+
...props,
|
|
156
|
+
children
|
|
157
|
+
});
|
|
158
|
+
const ComboboxClear = ({ className, children = "✕", ...props }) => /* @__PURE__ */ jsx(Combobox$1.Clear, {
|
|
159
|
+
className: comboboxClear({ className }),
|
|
160
|
+
...props,
|
|
161
|
+
children
|
|
162
|
+
});
|
|
163
|
+
const ComboboxChips = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Chips, {
|
|
164
|
+
className: comboboxChips({ className }),
|
|
165
|
+
...props
|
|
166
|
+
});
|
|
167
|
+
const ComboboxChip = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Chip, {
|
|
168
|
+
className: comboboxChip({ className }),
|
|
169
|
+
...props
|
|
170
|
+
});
|
|
171
|
+
const ComboboxChipRemove = ({ className, children = "✕", ...props }) => /* @__PURE__ */ jsx(Combobox$1.ChipRemove, {
|
|
172
|
+
className: comboboxChipRemove({ className }),
|
|
173
|
+
...props,
|
|
174
|
+
children
|
|
175
|
+
});
|
|
176
|
+
const ComboboxPositioner = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Positioner, {
|
|
177
|
+
className: comboboxPositioner({ className }),
|
|
178
|
+
...props
|
|
179
|
+
});
|
|
180
|
+
const ComboboxPopup = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Popup, {
|
|
181
|
+
className: comboboxPopup({ className }),
|
|
182
|
+
...props
|
|
183
|
+
});
|
|
184
|
+
const ComboboxList = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.List, {
|
|
185
|
+
className: comboboxList({ className }),
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
const ComboboxItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
189
|
+
className: comboboxItem({ className }),
|
|
190
|
+
...props
|
|
191
|
+
});
|
|
192
|
+
const ComboboxItemIndicator = ({ className, children = "✓", ...props }) => /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
|
|
193
|
+
className: comboboxItemIndicator({ className }),
|
|
194
|
+
...props,
|
|
195
|
+
children
|
|
196
|
+
});
|
|
197
|
+
const ComboboxEmpty = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Empty, {
|
|
198
|
+
className: comboboxEmpty({ className }),
|
|
199
|
+
...props
|
|
200
|
+
});
|
|
201
|
+
const ComboboxGroupLabel = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
|
|
202
|
+
className: comboboxGroupLabel({ className }),
|
|
203
|
+
...props
|
|
204
|
+
});
|
|
205
|
+
const ComboboxSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx(Combobox$1.Separator, {
|
|
206
|
+
className: comboboxSeparator({ className }),
|
|
207
|
+
...props
|
|
208
|
+
});
|
|
209
|
+
const Combobox = {
|
|
210
|
+
Arrow: Combobox$1.Arrow,
|
|
211
|
+
Backdrop: Combobox$1.Backdrop,
|
|
212
|
+
Chip: ComboboxChip,
|
|
213
|
+
ChipRemove: ComboboxChipRemove,
|
|
214
|
+
Chips: ComboboxChips,
|
|
215
|
+
Clear: ComboboxClear,
|
|
216
|
+
Collection: Combobox$1.Collection,
|
|
217
|
+
Empty: ComboboxEmpty,
|
|
218
|
+
Group: Combobox$1.Group,
|
|
219
|
+
GroupLabel: ComboboxGroupLabel,
|
|
220
|
+
Icon: ComboboxIcon,
|
|
221
|
+
Input: ComboboxInput,
|
|
222
|
+
InputGroup: ComboboxInputGroup,
|
|
223
|
+
Item: ComboboxItem,
|
|
224
|
+
ItemIndicator: ComboboxItemIndicator,
|
|
225
|
+
Label: Combobox$1.Label,
|
|
226
|
+
List: ComboboxList,
|
|
227
|
+
Popup: ComboboxPopup,
|
|
228
|
+
Portal: Combobox$1.Portal,
|
|
229
|
+
Positioner: ComboboxPositioner,
|
|
230
|
+
Root: Combobox$1.Root,
|
|
231
|
+
Row: Combobox$1.Row,
|
|
232
|
+
Separator: ComboboxSeparator,
|
|
233
|
+
Status: Combobox$1.Status,
|
|
234
|
+
Trigger: ComboboxTrigger,
|
|
235
|
+
Value: Combobox$1.Value
|
|
236
|
+
};
|
|
237
|
+
//#endregion
|
|
238
|
+
export { Combobox };
|
package/dist/field/index.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import { Field as Field$1 } from "@base-ui/react/field";
|
|
|
3
3
|
|
|
4
4
|
//#region src/field/field.d.ts
|
|
5
5
|
declare const fieldRootVariants: {
|
|
6
|
-
readonly default: readonly [];
|
|
7
|
-
readonly required: readonly ["after:content-[\"*\"]", "after:ml-1", "after:text-
|
|
6
|
+
readonly default: readonly ["space-y-1"];
|
|
7
|
+
readonly required: readonly ["space-y-1", "after:content-[\"*\"]", "after:ml-1", "after:text-destructive"];
|
|
8
8
|
};
|
|
9
9
|
type FieldRootVariant = keyof typeof fieldRootVariants;
|
|
10
10
|
type FieldLabelVariant = "default" | "error";
|
package/dist/field/index.mjs
CHANGED
|
@@ -3,54 +3,54 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Field as Field$1 } from "@base-ui/react/field";
|
|
4
4
|
//#region src/field/field.tsx
|
|
5
5
|
const fieldRoot = tv({
|
|
6
|
-
base: [
|
|
6
|
+
base: [],
|
|
7
7
|
defaultVariants: { variant: "default" },
|
|
8
8
|
variants: { variant: {
|
|
9
|
-
default: [],
|
|
9
|
+
default: ["space-y-1"],
|
|
10
10
|
required: [
|
|
11
|
+
"space-y-1",
|
|
11
12
|
"after:content-[\"*\"]",
|
|
12
13
|
"after:ml-1",
|
|
13
|
-
"after:text-
|
|
14
|
+
"after:text-destructive"
|
|
14
15
|
]
|
|
15
16
|
} }
|
|
16
17
|
});
|
|
17
18
|
const fieldLabel = tv({
|
|
18
|
-
base: [
|
|
19
|
-
"block",
|
|
20
|
-
"text-sm",
|
|
21
|
-
"font-medium",
|
|
22
|
-
"text-gray-700",
|
|
23
|
-
"mb-1"
|
|
24
|
-
],
|
|
19
|
+
base: [],
|
|
25
20
|
defaultVariants: { variant: "default" },
|
|
26
21
|
variants: { variant: {
|
|
27
|
-
default: [
|
|
28
|
-
|
|
22
|
+
default: [
|
|
23
|
+
"block",
|
|
24
|
+
"text-foreground",
|
|
25
|
+
"mb-1"
|
|
26
|
+
],
|
|
27
|
+
error: [
|
|
28
|
+
"block",
|
|
29
|
+
"text-destructive",
|
|
30
|
+
"mb-1"
|
|
31
|
+
]
|
|
29
32
|
} }
|
|
30
33
|
});
|
|
31
34
|
const fieldDescription = tv({
|
|
32
|
-
base: [
|
|
33
|
-
"text-sm",
|
|
34
|
-
"text-gray-500",
|
|
35
|
-
"mt-1"
|
|
36
|
-
],
|
|
35
|
+
base: [],
|
|
37
36
|
defaultVariants: { variant: "default" },
|
|
38
37
|
variants: { variant: {
|
|
39
|
-
default: [],
|
|
40
|
-
error: ["text-
|
|
38
|
+
default: ["text-muted-foreground", "mt-1"],
|
|
39
|
+
error: ["text-destructive", "mt-1"]
|
|
41
40
|
} }
|
|
42
41
|
});
|
|
43
|
-
const fieldError = tv({
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"mt-1"
|
|
47
|
-
|
|
42
|
+
const fieldError = tv({
|
|
43
|
+
base: [],
|
|
44
|
+
defaultVariants: { variant: "default" },
|
|
45
|
+
variants: { variant: { default: ["text-destructive", "mt-1"] } }
|
|
46
|
+
});
|
|
48
47
|
const fieldItem = tv({
|
|
49
|
-
base: [
|
|
48
|
+
base: [],
|
|
50
49
|
defaultVariants: { layout: "default" },
|
|
51
50
|
variants: { layout: {
|
|
52
|
-
default: [],
|
|
51
|
+
default: ["flex", "flex-col"],
|
|
53
52
|
horizontal: [
|
|
53
|
+
"flex",
|
|
54
54
|
"flex-row",
|
|
55
55
|
"items-center",
|
|
56
56
|
"gap-2"
|
|
@@ -3,8 +3,8 @@ import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
|
3
3
|
|
|
4
4
|
//#region src/fieldset/fieldset.d.ts
|
|
5
5
|
declare const fieldsetRootVariants: {
|
|
6
|
-
readonly compact: readonly ["space-y-2"];
|
|
7
|
-
readonly default: readonly ["space-y-4"];
|
|
6
|
+
readonly compact: readonly ["border", "border-current", "rounded-lg", "p-4", "space-y-2"];
|
|
7
|
+
readonly default: readonly ["border", "border-current", "rounded-lg", "p-4", "space-y-4"];
|
|
8
8
|
};
|
|
9
9
|
type FieldsetRootVariant = keyof typeof fieldsetRootVariants;
|
|
10
10
|
type FieldsetLegendSize = "default" | "small";
|