@xingxingmofashu/ui 0.1.0-beta.1 → 0.1.0-beta.2
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/README.md +9 -8
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/button.js +2 -2
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -18
- package/dist/components/dialog.js +2 -2
- package/dist/components/input.d.ts +19 -0
- package/dist/components/input.js +64 -0
- package/dist/components/toggle-group.d.ts +15 -12
- package/dist/components/toggle-group.js +5 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/theme/checkbox.js +1 -1
- package/dist/theme/input.d.ts +131 -0
- package/dist/theme/input.js +82 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Liquid Glass UI components for React 19 and Tailwind CSS 4.
|
|
4
4
|
|
|
5
|
-
The package ships
|
|
6
|
-
Checkbox, Dialog, Slider, Switch, and Toggle Group. Glass surfaces, rim
|
|
5
|
+
The package ships ten components: Accordion, Alert Dialog, Button, Card,
|
|
6
|
+
Checkbox, Dialog, Input, Slider, Switch, and Toggle Group. Glass surfaces, rim
|
|
7
7
|
highlights, and inner shadows are drawn entirely with CSS. The interactive
|
|
8
8
|
components are built on Base UI and do not add a custom rendering engine; `Card`
|
|
9
9
|
is a native layout primitive.
|
|
@@ -15,8 +15,8 @@ is a native layout primitive.
|
|
|
15
15
|
- Tailwind CSS 4.
|
|
16
16
|
- An ESM-capable bundler. The package publishes ES modules only.
|
|
17
17
|
|
|
18
|
-
`Accordion`, `AlertDialog`, `Button`, `Checkbox`, `Dialog`, `
|
|
19
|
-
and `ToggleGroup` are client components. `Card` is server-safe and can be
|
|
18
|
+
`Accordion`, `AlertDialog`, `Button`, `Checkbox`, `Dialog`, `Input`, `Slider`,
|
|
19
|
+
`Switch`, and `ToggleGroup` are client components. `Card` is server-safe and can be
|
|
20
20
|
rendered from a React Server Component.
|
|
21
21
|
|
|
22
22
|
## Install
|
|
@@ -86,9 +86,9 @@ package stylesheet; override them in your own theme layer. Tailwind aliases use
|
|
|
86
86
|
the `ui-` prefix (`text-ui-ink`, `outline-ui-glass-focus`, and so on) to avoid
|
|
87
87
|
colliding with host design tokens.
|
|
88
88
|
|
|
89
|
-
`Button`, `Card`, `Checkbox`, `Dialog`, `
|
|
90
|
-
`Accordion`, and `AlertDialog` inherit the host font and do not
|
|
91
|
-
family.
|
|
89
|
+
`Button`, `Card`, `Checkbox`, `Dialog`, `Input`, `Slider`, `Switch`,
|
|
90
|
+
`ToggleGroup`, `Accordion`, and `AlertDialog` inherit the host font and do not
|
|
91
|
+
force a font family.
|
|
92
92
|
|
|
93
93
|
The visual material relies on modern CSS: `backdrop-filter`, `color-mix`,
|
|
94
94
|
container units, individual `translate` / `scale` properties, and `:has`.
|
|
@@ -102,9 +102,10 @@ Use a current evergreen browser.
|
|
|
102
102
|
- `Card`
|
|
103
103
|
- `Checkbox`
|
|
104
104
|
- `Dialog`
|
|
105
|
+
- `Input`
|
|
105
106
|
- `Slider`
|
|
106
107
|
- `Switch`
|
|
107
|
-
- `ToggleGroup`
|
|
108
|
+
- `ToggleGroup`
|
|
108
109
|
|
|
109
110
|
|
|
110
111
|
## Development
|
|
@@ -36,14 +36,14 @@ function AlertDialog({
|
|
|
36
36
|
className: ui.overlay()
|
|
37
37
|
}
|
|
38
38
|
)),
|
|
39
|
-
/* @__PURE__ */ React.createElement("div", { "data-slot": "content", className: ui.content() }, /* @__PURE__ */ React.createElement(UIAlertDialog.Title, { "data-slot": "title", className: ui.title() }, title), description
|
|
39
|
+
/* @__PURE__ */ React.createElement("div", { "data-slot": "content", className: ui.content() }, /* @__PURE__ */ React.createElement(UIAlertDialog.Title, { "data-slot": "title", className: ui.title() }, title), description ? /* @__PURE__ */ React.createElement(
|
|
40
40
|
UIAlertDialog.Description,
|
|
41
41
|
{
|
|
42
42
|
"data-slot": "description",
|
|
43
43
|
className: ui.description()
|
|
44
44
|
},
|
|
45
45
|
description
|
|
46
|
-
) : null, children
|
|
46
|
+
) : null, children ? /* @__PURE__ */ React.createElement("div", { "data-slot": "body", className: ui.body() }, children) : null, /* @__PURE__ */ React.createElement("div", { "data-slot": "footer", className: ui.footer() }, /* @__PURE__ */ React.createElement(
|
|
47
47
|
UIAlertDialog.Close,
|
|
48
48
|
{
|
|
49
49
|
onClick: onCancel,
|
|
@@ -29,7 +29,7 @@ function Button({
|
|
|
29
29
|
className: ui.overlay(),
|
|
30
30
|
"aria-hidden": "true"
|
|
31
31
|
}
|
|
32
|
-
)), leadingIcon
|
|
32
|
+
)), leadingIcon ? /* @__PURE__ */ React.createElement(
|
|
33
33
|
"span",
|
|
34
34
|
{
|
|
35
35
|
"data-slot": "leading-icon",
|
|
@@ -37,7 +37,7 @@ function Button({
|
|
|
37
37
|
"aria-hidden": "true"
|
|
38
38
|
},
|
|
39
39
|
leadingIcon
|
|
40
|
-
) : null, /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: ui.label() }, label || children), trailingIcon
|
|
40
|
+
) : null, /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: ui.label() }, label || children), trailingIcon ? /* @__PURE__ */ React.createElement(
|
|
41
41
|
"span",
|
|
42
42
|
{
|
|
43
43
|
"data-slot": "trailing-icon",
|
|
@@ -10,6 +10,6 @@ interface CheckboxProps extends Omit<React.ComponentProps<typeof UICheckbox.Root
|
|
|
10
10
|
/** Optional supporting text. */
|
|
11
11
|
description?: React.ReactNode;
|
|
12
12
|
}
|
|
13
|
-
declare function Checkbox({ className, label, description, size, indeterminate,
|
|
13
|
+
declare function Checkbox({ className, label, description, size, indeterminate, ...props }: CheckboxProps): React.JSX.Element;
|
|
14
14
|
export { Checkbox };
|
|
15
15
|
export type { CheckboxProps };
|
|
@@ -26,23 +26,14 @@ function Checkbox({
|
|
|
26
26
|
description,
|
|
27
27
|
size,
|
|
28
28
|
indeterminate = false,
|
|
29
|
-
"aria-label": ariaLabel,
|
|
30
|
-
"aria-labelledby": ariaLabelledBy,
|
|
31
|
-
"aria-describedby": ariaDescribedBy,
|
|
32
29
|
...props
|
|
33
30
|
}) {
|
|
34
31
|
const ui = theme({ size });
|
|
35
|
-
const id = React.useId();
|
|
36
|
-
const labelId = `${id}-label`;
|
|
37
|
-
const descriptionId = `${id}-description`;
|
|
38
32
|
return /* @__PURE__ */ React.createElement(
|
|
39
33
|
UICheckbox.Root,
|
|
40
34
|
{
|
|
41
35
|
...props,
|
|
42
36
|
indeterminate,
|
|
43
|
-
"aria-label": ariaLabel,
|
|
44
|
-
"aria-labelledby": ariaLabelledBy ?? (label != null && ariaLabel == null ? labelId : void 0),
|
|
45
|
-
"aria-describedby": ariaDescribedBy ?? (description != null ? descriptionId : void 0),
|
|
46
37
|
"data-slot": "root",
|
|
47
38
|
className: cn(ui.root(), className)
|
|
48
39
|
},
|
|
@@ -63,15 +54,7 @@ function Checkbox({
|
|
|
63
54
|
},
|
|
64
55
|
/* @__PURE__ */ React.createElement("span", { "data-slot": "indicator-icon", className: ui.indicatorIcon() }, /* @__PURE__ */ React.createElement(CheckIcon, { indeterminate }))
|
|
65
56
|
)),
|
|
66
|
-
label
|
|
67
|
-
"span",
|
|
68
|
-
{
|
|
69
|
-
id: descriptionId,
|
|
70
|
-
"data-slot": "description",
|
|
71
|
-
className: ui.description()
|
|
72
|
-
},
|
|
73
|
-
description
|
|
74
|
-
) : null) : null
|
|
57
|
+
label || description ? /* @__PURE__ */ React.createElement("span", { "data-slot": "wrapper", className: ui.wrapper() }, label ? /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: ui.label() }, label) : null, description ? /* @__PURE__ */ React.createElement("span", { "data-slot": "description", className: ui.description() }, description) : null) : null
|
|
75
58
|
);
|
|
76
59
|
}
|
|
77
60
|
export { Checkbox };
|
|
@@ -26,14 +26,14 @@ function Dialog({
|
|
|
26
26
|
className: ui.overlay()
|
|
27
27
|
}
|
|
28
28
|
)),
|
|
29
|
-
/* @__PURE__ */ React.createElement("div", { "data-slot": "content", className: ui.content() }, /* @__PURE__ */ React.createElement(UIDialog.Title, { "data-slot": "title", className: ui.title() }, title), description
|
|
29
|
+
/* @__PURE__ */ React.createElement("div", { "data-slot": "content", className: ui.content() }, /* @__PURE__ */ React.createElement(UIDialog.Title, { "data-slot": "title", className: ui.title() }, title), description ? /* @__PURE__ */ React.createElement(
|
|
30
30
|
UIDialog.Description,
|
|
31
31
|
{
|
|
32
32
|
"data-slot": "description",
|
|
33
33
|
className: ui.description()
|
|
34
34
|
},
|
|
35
35
|
description
|
|
36
|
-
) : null, children
|
|
36
|
+
) : null, children ? /* @__PURE__ */ React.createElement("div", { "data-slot": "body", className: ui.body() }, children) : null, footer ? /* @__PURE__ */ React.createElement("div", { "data-slot": "footer", className: ui.footer() }, footer) : null)
|
|
37
37
|
))));
|
|
38
38
|
}
|
|
39
39
|
export { Dialog };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Input as UIInput } from "@base-ui/react/input";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
import theme from "../theme/input.js";
|
|
5
|
+
interface InputProps extends Omit<React.ComponentProps<typeof UIInput>, "className" | "children" | "size" | "style">, VariantProps<typeof theme> {
|
|
6
|
+
/** Tailwind classes merged into the root element. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Visible label associated with the input. */
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
/** Optional supporting text under the field. */
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/** Icon rendered before the input. */
|
|
13
|
+
leadingIcon?: React.ReactNode;
|
|
14
|
+
/** Icon rendered after the input. */
|
|
15
|
+
trailingIcon?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function Input({ className, label, description, leadingIcon, trailingIcon, size, id, disabled, ...props }: InputProps): React.JSX.Element;
|
|
18
|
+
export { Input };
|
|
19
|
+
export type { InputProps };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input as UIInput } from "@base-ui/react/input";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import theme from "../theme/input.js";
|
|
6
|
+
function Input({
|
|
7
|
+
className,
|
|
8
|
+
label,
|
|
9
|
+
description,
|
|
10
|
+
leadingIcon,
|
|
11
|
+
trailingIcon,
|
|
12
|
+
size,
|
|
13
|
+
id,
|
|
14
|
+
disabled,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const ui = theme({ size });
|
|
18
|
+
const generatedId = React.useId();
|
|
19
|
+
const inputId = id ?? generatedId;
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "root",
|
|
24
|
+
"data-disabled": disabled || void 0,
|
|
25
|
+
className: cn(ui.root(), className)
|
|
26
|
+
},
|
|
27
|
+
label ? /* @__PURE__ */ React.createElement("label", { htmlFor: inputId, "data-slot": "label", className: ui.label() }, label) : null,
|
|
28
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "control", className: ui.control() }, /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true", "data-slot": "glass", className: ui.glass() }, /* @__PURE__ */ React.createElement(
|
|
29
|
+
"span",
|
|
30
|
+
{
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
"data-slot": "overlay",
|
|
33
|
+
className: ui.overlay()
|
|
34
|
+
}
|
|
35
|
+
)), leadingIcon ? /* @__PURE__ */ React.createElement(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "leading-icon",
|
|
39
|
+
className: ui.leadingIcon(),
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
},
|
|
42
|
+
leadingIcon
|
|
43
|
+
) : null, /* @__PURE__ */ React.createElement(
|
|
44
|
+
UIInput,
|
|
45
|
+
{
|
|
46
|
+
...props,
|
|
47
|
+
id: inputId,
|
|
48
|
+
disabled,
|
|
49
|
+
"data-slot": "input",
|
|
50
|
+
className: ui.input()
|
|
51
|
+
}
|
|
52
|
+
), trailingIcon ? /* @__PURE__ */ React.createElement(
|
|
53
|
+
"span",
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "trailing-icon",
|
|
56
|
+
className: ui.trailingIcon(),
|
|
57
|
+
"aria-hidden": "true"
|
|
58
|
+
},
|
|
59
|
+
trailingIcon
|
|
60
|
+
) : null),
|
|
61
|
+
description ? /* @__PURE__ */ React.createElement("span", { "data-slot": "description", className: ui.description() }, description) : null
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export { Input };
|
|
@@ -3,20 +3,23 @@ import { ToggleGroup as UIToggleGroup } from "@base-ui/react/toggle-group";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { type VariantProps } from "tailwind-variants";
|
|
5
5
|
import theme from "../theme/toggle-group.js";
|
|
6
|
+
/** One option managed by the toggle group. */
|
|
7
|
+
type ToggleGroupItemProps = Omit<UIToggle.Props, "className" | "children" | "style" | "value" | "pressed" | "defaultPressed"> & {
|
|
8
|
+
/** Value that identifies the option in the group value. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Visible content inside the item. */
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
/** Icon rendered before the label. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** Tailwind classes merged into the item root. */
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
6
17
|
type ToggleGroupProps<Value extends string = string> = Omit<UIToggleGroup.Props<Value>, "className" | "style" | "children"> & VariantProps<typeof theme> & {
|
|
18
|
+
/** Options rendered by the toggle group. */
|
|
19
|
+
items: readonly ToggleGroupItemProps[];
|
|
7
20
|
/** Tailwind classes merged into the group root. */
|
|
8
21
|
className?: any;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
type ToggleGroupItemProps<Value extends string = string> = Omit<UIToggle.Props<Value>, "className" | "children" | "style"> & {
|
|
12
|
-
/** Tailwind classes merged into the item root. */
|
|
13
|
-
className?: any;
|
|
14
|
-
/** Icon rendered inside the item. */
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
|
-
/** Text or custom content rendered inside the item. */
|
|
17
|
-
children?: React.ReactNode;
|
|
18
22
|
};
|
|
19
|
-
declare function ToggleGroup<Value extends string = string>({ className, size,
|
|
20
|
-
|
|
21
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
23
|
+
declare function ToggleGroup<Value extends string = string>({ className, size, items, ...props }: ToggleGroupProps<Value>): React.JSX.Element;
|
|
24
|
+
export { ToggleGroup };
|
|
22
25
|
export type { ToggleGroupItemProps, ToggleGroupProps };
|
|
@@ -7,7 +7,7 @@ import theme from "../theme/toggle-group.js";
|
|
|
7
7
|
function ToggleGroup({
|
|
8
8
|
className,
|
|
9
9
|
size,
|
|
10
|
-
|
|
10
|
+
items,
|
|
11
11
|
...props
|
|
12
12
|
}) {
|
|
13
13
|
const ui = theme({ size });
|
|
@@ -19,24 +19,16 @@ function ToggleGroup({
|
|
|
19
19
|
className: cn(ui.root(), className)
|
|
20
20
|
},
|
|
21
21
|
/* @__PURE__ */ React.createElement("span", { "aria-hidden": "true", "data-slot": "glass", className: ui.glass() }, /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true", "data-layer": "rim", className: ui.rim() })),
|
|
22
|
-
|
|
22
|
+
items.map((item) => /* @__PURE__ */ React.createElement(ToggleGroupItem, { key: item.value, ...item }))
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
function ToggleGroupItem({
|
|
26
26
|
className,
|
|
27
27
|
icon,
|
|
28
|
-
|
|
28
|
+
label,
|
|
29
29
|
...props
|
|
30
30
|
}) {
|
|
31
31
|
const ui = theme();
|
|
32
|
-
return /* @__PURE__ */ React.createElement(
|
|
33
|
-
UIToggle,
|
|
34
|
-
{
|
|
35
|
-
...props,
|
|
36
|
-
"data-slot": "item",
|
|
37
|
-
className: cn(ui.item(), className)
|
|
38
|
-
},
|
|
39
|
-
/* @__PURE__ */ React.createElement("span", { "data-slot": "content", className: ui.content() }, icon != null ? /* @__PURE__ */ React.createElement("span", { "data-slot": "icon", "aria-hidden": "true", className: ui.icon() }, icon) : null, /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: ui.label() }, children))
|
|
40
|
-
);
|
|
32
|
+
return /* @__PURE__ */ React.createElement(UIToggle, { ...props, "data-slot": "item", className: cn(ui.item(), className) }, /* @__PURE__ */ React.createElement("span", { "data-slot": "content", className: ui.content() }, icon ? /* @__PURE__ */ React.createElement("span", { "data-slot": "icon", "aria-hidden": "true", className: ui.icon() }, icon) : null, label ? /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: ui.label() }, label) : null));
|
|
41
33
|
}
|
|
42
|
-
export { ToggleGroup
|
|
34
|
+
export { ToggleGroup };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Button, type ButtonProps } from "./components/button.js";
|
|
|
4
4
|
export { Card, type CardProps } from "./components/card.js";
|
|
5
5
|
export { Checkbox, type CheckboxProps } from "./components/checkbox.js";
|
|
6
6
|
export { Dialog, type DialogProps } from "./components/dialog.js";
|
|
7
|
+
export { Input, type InputProps } from "./components/input.js";
|
|
7
8
|
export { Slider, type SliderProps } from "./components/slider.js";
|
|
8
9
|
export { Switch, type SwitchProps } from "./components/switch.js";
|
|
9
|
-
export { ToggleGroup,
|
|
10
|
+
export { ToggleGroup, type ToggleGroupItemProps, type ToggleGroupProps, } from "./components/toggle-group.js";
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ export { Button } from "./components/button.js";
|
|
|
6
6
|
export { Card } from "./components/card.js";
|
|
7
7
|
export { Checkbox } from "./components/checkbox.js";
|
|
8
8
|
export { Dialog } from "./components/dialog.js";
|
|
9
|
+
export { Input } from "./components/input.js";
|
|
9
10
|
export { Slider } from "./components/slider.js";
|
|
10
11
|
export { Switch } from "./components/switch.js";
|
|
11
12
|
export {
|
|
12
|
-
ToggleGroup
|
|
13
|
-
ToggleGroupItem
|
|
13
|
+
ToggleGroup
|
|
14
14
|
} from "./components/toggle-group.js";
|
package/dist/theme/checkbox.js
CHANGED
|
@@ -43,7 +43,7 @@ export default tv({
|
|
|
43
43
|
],
|
|
44
44
|
indicatorIcon: "block size-[var(--ui-checkbox-icon-size)]",
|
|
45
45
|
wrapper: "ms-[var(--ui-checkbox-gap)] min-w-0",
|
|
46
|
-
label: "block font-medium text-ui-ink",
|
|
46
|
+
label: "block font-medium text-ui-ink leading-[var(--ui-checkbox-size)]",
|
|
47
47
|
description: "block text-ui-ink opacity-60"
|
|
48
48
|
},
|
|
49
49
|
variants: {
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
declare const _default: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
xs: {
|
|
4
|
+
root: string;
|
|
5
|
+
control: string;
|
|
6
|
+
leadingIcon: string;
|
|
7
|
+
trailingIcon: string;
|
|
8
|
+
};
|
|
9
|
+
sm: {
|
|
10
|
+
root: string;
|
|
11
|
+
control: string;
|
|
12
|
+
leadingIcon: string;
|
|
13
|
+
trailingIcon: string;
|
|
14
|
+
};
|
|
15
|
+
md: {
|
|
16
|
+
root: string;
|
|
17
|
+
control: string;
|
|
18
|
+
leadingIcon: string;
|
|
19
|
+
trailingIcon: string;
|
|
20
|
+
};
|
|
21
|
+
lg: {
|
|
22
|
+
root: string;
|
|
23
|
+
control: string;
|
|
24
|
+
leadingIcon: string;
|
|
25
|
+
trailingIcon: string;
|
|
26
|
+
};
|
|
27
|
+
xl: {
|
|
28
|
+
root: string;
|
|
29
|
+
control: string;
|
|
30
|
+
leadingIcon: string;
|
|
31
|
+
trailingIcon: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
root: string[];
|
|
36
|
+
label: string;
|
|
37
|
+
control: string[];
|
|
38
|
+
glass: string[];
|
|
39
|
+
overlay: string;
|
|
40
|
+
leadingIcon: string[];
|
|
41
|
+
input: string[];
|
|
42
|
+
trailingIcon: string[];
|
|
43
|
+
description: string;
|
|
44
|
+
}, undefined, {
|
|
45
|
+
size: {
|
|
46
|
+
xs: {
|
|
47
|
+
root: string;
|
|
48
|
+
control: string;
|
|
49
|
+
leadingIcon: string;
|
|
50
|
+
trailingIcon: string;
|
|
51
|
+
};
|
|
52
|
+
sm: {
|
|
53
|
+
root: string;
|
|
54
|
+
control: string;
|
|
55
|
+
leadingIcon: string;
|
|
56
|
+
trailingIcon: string;
|
|
57
|
+
};
|
|
58
|
+
md: {
|
|
59
|
+
root: string;
|
|
60
|
+
control: string;
|
|
61
|
+
leadingIcon: string;
|
|
62
|
+
trailingIcon: string;
|
|
63
|
+
};
|
|
64
|
+
lg: {
|
|
65
|
+
root: string;
|
|
66
|
+
control: string;
|
|
67
|
+
leadingIcon: string;
|
|
68
|
+
trailingIcon: string;
|
|
69
|
+
};
|
|
70
|
+
xl: {
|
|
71
|
+
root: string;
|
|
72
|
+
control: string;
|
|
73
|
+
leadingIcon: string;
|
|
74
|
+
trailingIcon: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
root: string[];
|
|
79
|
+
label: string;
|
|
80
|
+
control: string[];
|
|
81
|
+
glass: string[];
|
|
82
|
+
overlay: string;
|
|
83
|
+
leadingIcon: string[];
|
|
84
|
+
input: string[];
|
|
85
|
+
trailingIcon: string[];
|
|
86
|
+
description: string;
|
|
87
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
88
|
+
size: {
|
|
89
|
+
xs: {
|
|
90
|
+
root: string;
|
|
91
|
+
control: string;
|
|
92
|
+
leadingIcon: string;
|
|
93
|
+
trailingIcon: string;
|
|
94
|
+
};
|
|
95
|
+
sm: {
|
|
96
|
+
root: string;
|
|
97
|
+
control: string;
|
|
98
|
+
leadingIcon: string;
|
|
99
|
+
trailingIcon: string;
|
|
100
|
+
};
|
|
101
|
+
md: {
|
|
102
|
+
root: string;
|
|
103
|
+
control: string;
|
|
104
|
+
leadingIcon: string;
|
|
105
|
+
trailingIcon: string;
|
|
106
|
+
};
|
|
107
|
+
lg: {
|
|
108
|
+
root: string;
|
|
109
|
+
control: string;
|
|
110
|
+
leadingIcon: string;
|
|
111
|
+
trailingIcon: string;
|
|
112
|
+
};
|
|
113
|
+
xl: {
|
|
114
|
+
root: string;
|
|
115
|
+
control: string;
|
|
116
|
+
leadingIcon: string;
|
|
117
|
+
trailingIcon: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}, {
|
|
121
|
+
root: string[];
|
|
122
|
+
label: string;
|
|
123
|
+
control: string[];
|
|
124
|
+
glass: string[];
|
|
125
|
+
overlay: string;
|
|
126
|
+
leadingIcon: string[];
|
|
127
|
+
input: string[];
|
|
128
|
+
trailingIcon: string[];
|
|
129
|
+
description: string;
|
|
130
|
+
}>>;
|
|
131
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export default tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: [
|
|
5
|
+
"group flex w-full min-w-0 flex-col gap-1.5 text-ui-ink",
|
|
6
|
+
"data-[disabled]:cursor-not-allowed"
|
|
7
|
+
],
|
|
8
|
+
label: "w-fit font-medium text-ui-ink group-data-[disabled]:opacity-60",
|
|
9
|
+
control: [
|
|
10
|
+
"relative isolate flex w-full min-w-0 items-center overflow-hidden",
|
|
11
|
+
"h-[var(--ui-input-height)] rounded-[var(--ui-input-radius)]",
|
|
12
|
+
"gap-[var(--ui-input-gap)] px-[var(--ui-input-padding)]",
|
|
13
|
+
"bg-transparent text-inherit",
|
|
14
|
+
"group-data-[disabled]:opacity-60",
|
|
15
|
+
"group-focus-within:outline-2 group-focus-within:outline-offset-2 group-focus-within:outline-ui-glass-focus"
|
|
16
|
+
],
|
|
17
|
+
glass: [
|
|
18
|
+
"ui-glass ui-glass-highlight",
|
|
19
|
+
"pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]",
|
|
20
|
+
"[--ui-glass-tone:brightness(1)] [--ui-glass-contrast:1.1]",
|
|
21
|
+
"[--ui-glass-border:color-mix(in_srgb,var(--ui-ink)_18%,transparent)]",
|
|
22
|
+
"[--ui-glass-surface:color-mix(in_srgb,var(--ui-ink)_3%,transparent)]",
|
|
23
|
+
"[--ui-glass-rim:color-mix(in_srgb,var(--ui-ink)_10%,transparent)]",
|
|
24
|
+
"[--ui-shadow-glass:inset_0_1px_0_rgb(255_255_255/0.45),inset_0_0_0_1px_rgb(255_255_255/0.18),0_1px_2px_rgb(0_0_0/0.08)]",
|
|
25
|
+
"[--ui-glass-rim-inset:4px] [--ui-glass-rim-blur:2px]"
|
|
26
|
+
],
|
|
27
|
+
overlay: "ui-glass-rim",
|
|
28
|
+
leadingIcon: [
|
|
29
|
+
"relative z-[1] inline-flex shrink-0 items-center justify-center text-ui-ink opacity-55",
|
|
30
|
+
"[&_svg]:block [&_svg]:shrink-0"
|
|
31
|
+
],
|
|
32
|
+
input: [
|
|
33
|
+
"relative z-[1] h-full min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 text-ui-ink",
|
|
34
|
+
"placeholder:text-ui-ink/40",
|
|
35
|
+
"outline-none focus:outline-none",
|
|
36
|
+
"disabled:cursor-not-allowed",
|
|
37
|
+
"[&::-webkit-search-cancel-button]:appearance-none"
|
|
38
|
+
],
|
|
39
|
+
trailingIcon: [
|
|
40
|
+
"relative z-[1] inline-flex shrink-0 items-center justify-center text-ui-ink opacity-55",
|
|
41
|
+
"[&_svg]:block [&_svg]:shrink-0"
|
|
42
|
+
],
|
|
43
|
+
description: "text-ui-ink opacity-60 group-data-[disabled]:opacity-50"
|
|
44
|
+
},
|
|
45
|
+
variants: {
|
|
46
|
+
size: {
|
|
47
|
+
xs: {
|
|
48
|
+
root: "gap-1 text-xs",
|
|
49
|
+
control: "[--ui-input-height:28px] [--ui-input-radius:8px] [--ui-input-padding:10px] [--ui-input-gap:6px]",
|
|
50
|
+
leadingIcon: "[&_svg]:size-4",
|
|
51
|
+
trailingIcon: "[&_svg]:size-4"
|
|
52
|
+
},
|
|
53
|
+
sm: {
|
|
54
|
+
root: "gap-1 text-xs",
|
|
55
|
+
control: "[--ui-input-height:32px] [--ui-input-radius:9px] [--ui-input-padding:12px] [--ui-input-gap:7px]",
|
|
56
|
+
leadingIcon: "[&_svg]:size-4",
|
|
57
|
+
trailingIcon: "[&_svg]:size-4"
|
|
58
|
+
},
|
|
59
|
+
md: {
|
|
60
|
+
root: "gap-1.5 text-sm",
|
|
61
|
+
control: "[--ui-input-height:36px] [--ui-input-radius:10px] [--ui-input-padding:12px] [--ui-input-gap:8px]",
|
|
62
|
+
leadingIcon: "[&_svg]:size-5",
|
|
63
|
+
trailingIcon: "[&_svg]:size-5"
|
|
64
|
+
},
|
|
65
|
+
lg: {
|
|
66
|
+
root: "gap-1.5 text-sm",
|
|
67
|
+
control: "[--ui-input-height:40px] [--ui-input-radius:11px] [--ui-input-padding:14px] [--ui-input-gap:8px]",
|
|
68
|
+
leadingIcon: "[&_svg]:size-5",
|
|
69
|
+
trailingIcon: "[&_svg]:size-5"
|
|
70
|
+
},
|
|
71
|
+
xl: {
|
|
72
|
+
root: "gap-2 text-base",
|
|
73
|
+
control: "[--ui-input-height:44px] [--ui-input-radius:12px] [--ui-input-padding:14px] [--ui-input-gap:10px]",
|
|
74
|
+
leadingIcon: "[&_svg]:size-6",
|
|
75
|
+
trailingIcon: "[&_svg]:size-6"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
size: "md"
|
|
81
|
+
}
|
|
82
|
+
});
|