@xingxingmofashu/ui 0.1.1 → 0.1.3
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 +39 -14
- package/dist/components/accordion.d.ts +14 -10
- package/dist/components/accordion.mjs +78 -25
- package/dist/components/alert-dialog.d.ts +7 -2
- package/dist/components/alert-dialog.mjs +74 -33
- package/dist/components/button.d.ts +6 -2
- package/dist/components/button.mjs +20 -11
- package/dist/components/card.d.ts +6 -1
- package/dist/components/card.mjs +27 -4
- package/dist/components/checkbox.d.ts +5 -1
- package/dist/components/checkbox.mjs +73 -26
- package/dist/components/dialog.d.ts +7 -2
- package/dist/components/dialog.mjs +66 -20
- package/dist/components/drawer.d.ts +7 -2
- package/dist/components/drawer.mjs +66 -20
- package/dist/components/icons/check.d.ts +3 -0
- package/dist/components/icons/check.mjs +24 -0
- package/dist/components/icons/close.d.ts +3 -0
- package/dist/components/icons/close.mjs +21 -0
- package/dist/components/icons/dash.d.ts +3 -0
- package/dist/components/icons/dash.mjs +24 -0
- package/dist/components/icons/error.d.ts +3 -0
- package/dist/components/icons/error.mjs +23 -0
- package/dist/components/icons/info.d.ts +3 -0
- package/dist/components/icons/info.mjs +23 -0
- package/dist/components/icons/loading.d.ts +3 -0
- package/dist/components/icons/loading.mjs +22 -0
- package/dist/components/icons/plus.d.ts +3 -0
- package/dist/components/icons/plus.mjs +22 -0
- package/dist/components/icons/success.d.ts +3 -0
- package/dist/components/icons/success.mjs +22 -0
- package/dist/components/icons/warning.d.ts +3 -0
- package/dist/components/icons/warning.mjs +23 -0
- package/dist/components/input.d.ts +5 -1
- package/dist/components/input.mjs +73 -30
- package/dist/components/popover.d.ts +7 -2
- package/dist/components/popover.mjs +53 -14
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.mjs +71 -0
- package/dist/components/scroll-area.d.ts +7 -2
- package/dist/components/scroll-area.mjs +48 -14
- package/dist/components/slider.d.ts +15 -4
- package/dist/components/slider.mjs +65 -16
- package/dist/components/switch.d.ts +5 -1
- package/dist/components/switch.mjs +65 -18
- package/dist/components/toast.d.ts +17 -11
- package/dist/components/toast.mjs +111 -87
- package/dist/components/toggle-group.d.ts +11 -5
- package/dist/components/toggle-group.mjs +54 -6
- package/dist/components/toggle.d.ts +5 -1
- package/dist/components/toggle.mjs +36 -5
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +2 -0
- package/dist/internal/aria.d.ts +3 -0
- package/dist/internal/aria.mjs +5 -0
- package/dist/internal/tv.d.ts +17 -0
- package/dist/internal/tv.mjs +0 -0
- package/dist/keyframes.css +1 -1
- package/dist/theme/alert-dialog.mjs +1 -1
- package/dist/theme/checkbox.mjs +4 -4
- package/dist/theme/dialog.mjs +1 -1
- package/dist/theme/drawer.mjs +1 -1
- package/dist/theme/popover.mjs +2 -2
- package/dist/theme/progress.d.ts +80 -0
- package/dist/theme/progress.mjs +64 -0
- package/dist/theme/slider.mjs +8 -0
- package/dist/theme/switch.mjs +2 -0
- package/dist/theme/toast.d.ts +15 -36
- package/dist/theme/toast.mjs +29 -21
- package/package.json +8 -3
|
@@ -2,59 +2,106 @@
|
|
|
2
2
|
import { Checkbox as UICheckbox } from "@base-ui/react/checkbox";
|
|
3
3
|
import { cn } from "cn";
|
|
4
4
|
import * as React from "react";
|
|
5
|
+
import { mergeIds } from "../internal/aria.mjs";
|
|
5
6
|
import theme from "../theme/checkbox.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"svg",
|
|
9
|
-
{
|
|
10
|
-
"aria-hidden": "true",
|
|
11
|
-
"data-icon": indeterminate ? "dash" : "check",
|
|
12
|
-
focusable: "false",
|
|
13
|
-
viewBox: "0 0 16 16",
|
|
14
|
-
fill: "none",
|
|
15
|
-
stroke: "currentColor",
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round",
|
|
18
|
-
strokeWidth: "1.5"
|
|
19
|
-
},
|
|
20
|
-
/* @__PURE__ */ React.createElement("path", { d: indeterminate ? "M3.5 8h9" : "m2.5 8.5 4 4 7-9" })
|
|
21
|
-
);
|
|
22
|
-
}
|
|
7
|
+
import { CheckIcon } from "./icons/check.mjs";
|
|
8
|
+
import { DashIcon } from "./icons/dash.mjs";
|
|
23
9
|
function Checkbox({
|
|
24
10
|
className,
|
|
11
|
+
ui,
|
|
25
12
|
label,
|
|
26
13
|
description,
|
|
27
14
|
size,
|
|
28
15
|
indeterminate = false,
|
|
16
|
+
"aria-describedby": ariaDescribedBy,
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
"aria-labelledby": ariaLabelledBy,
|
|
29
19
|
...props
|
|
30
20
|
}) {
|
|
31
|
-
const
|
|
21
|
+
const styles = theme({ size });
|
|
22
|
+
const labelId = React.useId();
|
|
23
|
+
const descriptionId = React.useId();
|
|
24
|
+
const hasName = Boolean(label || ariaLabel || ariaLabelledBy);
|
|
25
|
+
const labelledBy = ariaLabelledBy || (label && !ariaLabel ? labelId : void 0);
|
|
26
|
+
const describedBy = mergeIds(
|
|
27
|
+
ariaDescribedBy,
|
|
28
|
+
description && hasName ? descriptionId : void 0
|
|
29
|
+
);
|
|
32
30
|
return /* @__PURE__ */ React.createElement(
|
|
33
31
|
UICheckbox.Root,
|
|
34
32
|
{
|
|
35
33
|
...props,
|
|
34
|
+
"aria-describedby": describedBy,
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
"aria-labelledby": labelledBy,
|
|
36
37
|
indeterminate,
|
|
37
38
|
"data-slot": "root",
|
|
38
|
-
className: cn(
|
|
39
|
+
className: cn(styles.root(), ui?.root, className)
|
|
39
40
|
},
|
|
40
|
-
/* @__PURE__ */ React.createElement("span", { "data-slot": "box", className:
|
|
41
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "box", className: cn(styles.box(), ui?.box) }, /* @__PURE__ */ React.createElement(
|
|
41
42
|
"span",
|
|
42
43
|
{
|
|
43
44
|
"aria-hidden": "true",
|
|
44
|
-
"data-slot": "
|
|
45
|
-
className:
|
|
45
|
+
"data-slot": "fill",
|
|
46
|
+
className: cn(styles.fill(), ui?.fill)
|
|
46
47
|
}
|
|
47
|
-
)
|
|
48
|
+
), /* @__PURE__ */ React.createElement(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
"data-slot": "glass",
|
|
53
|
+
className: cn(styles.glass(), ui?.glass)
|
|
54
|
+
},
|
|
55
|
+
/* @__PURE__ */ React.createElement(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
"data-slot": "overlay",
|
|
60
|
+
className: cn(styles.overlay(), ui?.overlay)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
), /* @__PURE__ */ React.createElement(
|
|
48
64
|
UICheckbox.Indicator,
|
|
49
65
|
{
|
|
50
66
|
keepMounted: true,
|
|
51
67
|
"aria-hidden": "true",
|
|
52
68
|
"data-slot": "indicator",
|
|
53
|
-
className:
|
|
69
|
+
className: cn(styles.indicator(), ui?.indicator)
|
|
54
70
|
},
|
|
55
|
-
/* @__PURE__ */ React.createElement(
|
|
71
|
+
/* @__PURE__ */ React.createElement(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "indicator-icon",
|
|
75
|
+
className: cn(styles.indicatorIcon(), ui?.indicatorIcon)
|
|
76
|
+
},
|
|
77
|
+
indeterminate ? /* @__PURE__ */ React.createElement(DashIcon, null) : /* @__PURE__ */ React.createElement(CheckIcon, null)
|
|
78
|
+
)
|
|
56
79
|
)),
|
|
57
|
-
label || description ? /* @__PURE__ */ React.createElement(
|
|
80
|
+
label || description ? /* @__PURE__ */ React.createElement(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
"data-slot": "wrapper",
|
|
84
|
+
className: cn(styles.wrapper(), ui?.wrapper)
|
|
85
|
+
},
|
|
86
|
+
label ? /* @__PURE__ */ React.createElement(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
id: labelId,
|
|
90
|
+
"data-slot": "label",
|
|
91
|
+
className: cn(styles.label(), ui?.label)
|
|
92
|
+
},
|
|
93
|
+
label
|
|
94
|
+
) : null,
|
|
95
|
+
description ? /* @__PURE__ */ React.createElement(
|
|
96
|
+
"span",
|
|
97
|
+
{
|
|
98
|
+
id: descriptionId,
|
|
99
|
+
"data-slot": "description",
|
|
100
|
+
className: cn(styles.description(), ui?.description)
|
|
101
|
+
},
|
|
102
|
+
description
|
|
103
|
+
) : null
|
|
104
|
+
) : null
|
|
58
105
|
);
|
|
59
106
|
}
|
|
60
107
|
export { Checkbox };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Dialog as UIDialog } from "@base-ui/react/dialog";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
4
|
+
import theme from "../theme/dialog";
|
|
5
|
+
type Dialog = ComponentConfig<typeof theme>;
|
|
3
6
|
type DialogProps = Omit<UIDialog.Root.Props, "children"> & {
|
|
4
7
|
/** Dialog heading. */
|
|
5
8
|
title: React.ReactNode;
|
|
@@ -10,8 +13,10 @@ type DialogProps = Omit<UIDialog.Root.Props, "children"> & {
|
|
|
10
13
|
/** Action area rendered at the bottom of the dialog. */
|
|
11
14
|
footer?: React.ReactNode;
|
|
12
15
|
/** Tailwind classes merged into the popup. */
|
|
13
|
-
className?:
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
18
|
+
ui?: Dialog["slots"];
|
|
14
19
|
};
|
|
15
|
-
declare function Dialog({ title, description, children, footer, className, ...props }: DialogProps): React.JSX.Element;
|
|
20
|
+
declare function Dialog({ title, description, children, footer, className, ui, ...props }: DialogProps): React.JSX.Element;
|
|
16
21
|
export { Dialog };
|
|
17
22
|
export type { DialogProps };
|
|
@@ -9,31 +9,77 @@ function Dialog({
|
|
|
9
9
|
children,
|
|
10
10
|
footer,
|
|
11
11
|
className,
|
|
12
|
+
ui,
|
|
12
13
|
...props
|
|
13
14
|
}) {
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */ React.createElement(UIDialog.Root, { ...props }, /* @__PURE__ */ React.createElement(UIDialog.Portal, null, /* @__PURE__ */ React.createElement(
|
|
16
|
-
UIDialog.
|
|
15
|
+
const styles = theme();
|
|
16
|
+
return /* @__PURE__ */ React.createElement(UIDialog.Root, { ...props }, /* @__PURE__ */ React.createElement(UIDialog.Portal, null, /* @__PURE__ */ React.createElement(
|
|
17
|
+
UIDialog.Backdrop,
|
|
17
18
|
{
|
|
18
|
-
"data-slot": "
|
|
19
|
-
className: cn(
|
|
19
|
+
"data-slot": "backdrop",
|
|
20
|
+
className: cn(styles.backdrop(), ui?.backdrop)
|
|
21
|
+
}
|
|
22
|
+
), /* @__PURE__ */ React.createElement(
|
|
23
|
+
UIDialog.Viewport,
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "viewport",
|
|
26
|
+
className: cn(styles.viewport(), ui?.viewport)
|
|
20
27
|
},
|
|
21
|
-
/* @__PURE__ */ React.createElement(
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
"aria-hidden": "true",
|
|
25
|
-
"data-slot": "overlay",
|
|
26
|
-
className: ui.overlay()
|
|
27
|
-
}
|
|
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 ? /* @__PURE__ */ React.createElement(
|
|
30
|
-
UIDialog.Description,
|
|
28
|
+
/* @__PURE__ */ React.createElement(
|
|
29
|
+
UIDialog.Popup,
|
|
31
30
|
{
|
|
32
|
-
"data-slot": "
|
|
33
|
-
className:
|
|
31
|
+
"data-slot": "popup",
|
|
32
|
+
className: cn(styles.popup(), ui?.popup, className)
|
|
34
33
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/* @__PURE__ */ React.createElement(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
"data-slot": "glass",
|
|
39
|
+
className: cn(styles.glass(), ui?.glass)
|
|
40
|
+
},
|
|
41
|
+
/* @__PURE__ */ React.createElement(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
"data-slot": "overlay",
|
|
46
|
+
className: cn(styles.overlay(), ui?.overlay)
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ React.createElement(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "content",
|
|
54
|
+
className: cn(styles.content(), ui?.content)
|
|
55
|
+
},
|
|
56
|
+
/* @__PURE__ */ React.createElement(
|
|
57
|
+
UIDialog.Title,
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "title",
|
|
60
|
+
className: cn(styles.title(), ui?.title)
|
|
61
|
+
},
|
|
62
|
+
title
|
|
63
|
+
),
|
|
64
|
+
description ? /* @__PURE__ */ React.createElement(
|
|
65
|
+
UIDialog.Description,
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "description",
|
|
68
|
+
className: cn(styles.description(), ui?.description)
|
|
69
|
+
},
|
|
70
|
+
description
|
|
71
|
+
) : null,
|
|
72
|
+
children ? /* @__PURE__ */ React.createElement("div", { "data-slot": "body", className: cn(styles.body(), ui?.body) }, children) : null,
|
|
73
|
+
footer ? /* @__PURE__ */ React.createElement(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "footer",
|
|
77
|
+
className: cn(styles.footer(), ui?.footer)
|
|
78
|
+
},
|
|
79
|
+
footer
|
|
80
|
+
) : null
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
)));
|
|
38
84
|
}
|
|
39
85
|
export { Dialog };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Drawer as UIDrawer } from "@base-ui/react/drawer";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
4
|
+
import theme from "../theme/drawer";
|
|
5
|
+
type Drawer = ComponentConfig<typeof theme>;
|
|
3
6
|
interface DrawerProps extends Omit<UIDrawer.Root.Props, "children" | "className" | "style" | "swipeDirection"> {
|
|
4
7
|
/** Drawer heading. */
|
|
5
8
|
title: React.ReactNode;
|
|
@@ -12,8 +15,10 @@ interface DrawerProps extends Omit<UIDrawer.Root.Props, "children" | "className"
|
|
|
12
15
|
/** Edge the drawer slides in from. */
|
|
13
16
|
direction?: NonNullable<UIDrawer.Root.Props["swipeDirection"]>;
|
|
14
17
|
/** Tailwind classes merged into the popup. */
|
|
15
|
-
className?:
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
20
|
+
ui?: Drawer["slots"];
|
|
16
21
|
}
|
|
17
|
-
declare function Drawer({ title, description, children, footer, direction, className, ...props }: DrawerProps): React.JSX.Element;
|
|
22
|
+
declare function Drawer({ title, description, children, footer, direction, className, ui, ...props }: DrawerProps): React.JSX.Element;
|
|
18
23
|
export { Drawer };
|
|
19
24
|
export type { DrawerProps };
|
|
@@ -10,31 +10,77 @@ function Drawer({
|
|
|
10
10
|
footer,
|
|
11
11
|
direction = "down",
|
|
12
12
|
className,
|
|
13
|
+
ui,
|
|
13
14
|
...props
|
|
14
15
|
}) {
|
|
15
|
-
const
|
|
16
|
-
return /* @__PURE__ */ React.createElement(UIDrawer.Root, { ...props, swipeDirection: direction }, /* @__PURE__ */ React.createElement(UIDrawer.Portal, null, /* @__PURE__ */ React.createElement(
|
|
17
|
-
UIDrawer.
|
|
16
|
+
const styles = theme({ direction });
|
|
17
|
+
return /* @__PURE__ */ React.createElement(UIDrawer.Root, { ...props, swipeDirection: direction }, /* @__PURE__ */ React.createElement(UIDrawer.Portal, null, /* @__PURE__ */ React.createElement(
|
|
18
|
+
UIDrawer.Backdrop,
|
|
18
19
|
{
|
|
19
|
-
"data-slot": "
|
|
20
|
-
className: cn(
|
|
20
|
+
"data-slot": "backdrop",
|
|
21
|
+
className: cn(styles.backdrop(), ui?.backdrop)
|
|
22
|
+
}
|
|
23
|
+
), /* @__PURE__ */ React.createElement(
|
|
24
|
+
UIDrawer.Viewport,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "viewport",
|
|
27
|
+
className: cn(styles.viewport(), ui?.viewport)
|
|
21
28
|
},
|
|
22
|
-
/* @__PURE__ */ React.createElement(
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
"aria-hidden": "true",
|
|
26
|
-
"data-slot": "overlay",
|
|
27
|
-
className: ui.overlay()
|
|
28
|
-
}
|
|
29
|
-
)),
|
|
30
|
-
/* @__PURE__ */ React.createElement(UIDrawer.Content, { "data-slot": "content", className: ui.content() }, /* @__PURE__ */ React.createElement(UIDrawer.Title, { "data-slot": "title", className: ui.title() }, title), description ? /* @__PURE__ */ React.createElement(
|
|
31
|
-
UIDrawer.Description,
|
|
29
|
+
/* @__PURE__ */ React.createElement(
|
|
30
|
+
UIDrawer.Popup,
|
|
32
31
|
{
|
|
33
|
-
"data-slot": "
|
|
34
|
-
className:
|
|
32
|
+
"data-slot": "popup",
|
|
33
|
+
className: cn(styles.popup(), ui?.popup, className)
|
|
35
34
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/* @__PURE__ */ React.createElement(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
"data-slot": "glass",
|
|
40
|
+
className: cn(styles.glass(), ui?.glass)
|
|
41
|
+
},
|
|
42
|
+
/* @__PURE__ */ React.createElement(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
"data-slot": "overlay",
|
|
47
|
+
className: cn(styles.overlay(), ui?.overlay)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ React.createElement(
|
|
52
|
+
UIDrawer.Content,
|
|
53
|
+
{
|
|
54
|
+
"data-slot": "content",
|
|
55
|
+
className: cn(styles.content(), ui?.content)
|
|
56
|
+
},
|
|
57
|
+
/* @__PURE__ */ React.createElement(
|
|
58
|
+
UIDrawer.Title,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "title",
|
|
61
|
+
className: cn(styles.title(), ui?.title)
|
|
62
|
+
},
|
|
63
|
+
title
|
|
64
|
+
),
|
|
65
|
+
description ? /* @__PURE__ */ React.createElement(
|
|
66
|
+
UIDrawer.Description,
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "description",
|
|
69
|
+
className: cn(styles.description(), ui?.description)
|
|
70
|
+
},
|
|
71
|
+
description
|
|
72
|
+
) : null,
|
|
73
|
+
children ? /* @__PURE__ */ React.createElement("div", { "data-slot": "body", className: cn(styles.body(), ui?.body) }, children) : null,
|
|
74
|
+
footer ? /* @__PURE__ */ React.createElement(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
"data-slot": "footer",
|
|
78
|
+
className: cn(styles.footer(), ui?.footer)
|
|
79
|
+
},
|
|
80
|
+
footer
|
|
81
|
+
) : null
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
)));
|
|
39
85
|
}
|
|
40
86
|
export { Drawer };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function CheckIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
"data-icon": "check",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
strokeWidth: "1.5",
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
/* @__PURE__ */ React.createElement("path", { d: "m4 12 6 6 10-12" })
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export { CheckIcon };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function CloseIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "1.5",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("path", { d: "m6 6 12 12M18 6 6 18" })
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export { CloseIcon };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function DashIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
"data-icon": "dash",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
strokeWidth: "1.5",
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
/* @__PURE__ */ React.createElement("path", { d: "M5 12h14" })
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export { DashIcon };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function ErrorIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "8.5" }),
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 8v5" }),
|
|
20
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 16.5h.01" })
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export { ErrorIcon };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function InfoIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "8.5" }),
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 11v5" }),
|
|
20
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 8h.01" })
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export { InfoIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function LoadingIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "8", opacity: "0.25" }),
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 4a8 8 0 0 1 8 8" })
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export { LoadingIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function PlusIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "1.5",
|
|
14
|
+
strokeLinecap: "square",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "M2.5 12h19M12 21.5v-19" })
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export { PlusIcon };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function SuccessIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "8.5" }),
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "m8 12.5 3 3 5.5-6" })
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export { SuccessIcon };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function WarningIcon({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 4 21 20H3L12 4Z" }),
|
|
19
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 10v4" }),
|
|
20
|
+
/* @__PURE__ */ React.createElement("path", { d: "M12 17.5h.01" })
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export { WarningIcon };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Input as UIInput } from "@base-ui/react/input";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
4
5
|
import theme from "../theme/input";
|
|
6
|
+
type Input = ComponentConfig<typeof theme>;
|
|
5
7
|
interface InputProps extends Omit<UIInput.Props, "className" | "children" | "size" | "style">, VariantProps<typeof theme> {
|
|
6
8
|
/** Tailwind classes merged into the root element. */
|
|
7
9
|
className?: string;
|
|
10
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
11
|
+
ui?: Input["slots"];
|
|
8
12
|
/** Visible label associated with the input. */
|
|
9
13
|
label?: React.ReactNode;
|
|
10
14
|
/** Optional supporting text under the field. */
|
|
@@ -14,6 +18,6 @@ interface InputProps extends Omit<UIInput.Props, "className" | "children" | "siz
|
|
|
14
18
|
/** Icon rendered after the input. */
|
|
15
19
|
trailingIcon?: React.ReactNode;
|
|
16
20
|
}
|
|
17
|
-
declare function Input({ className, label, description, leadingIcon, trailingIcon, size, id, disabled, ...props }: InputProps): React.JSX.Element;
|
|
21
|
+
declare function Input({ className, ui, label, description, leadingIcon, trailingIcon, size, id, disabled, "aria-describedby": ariaDescribedBy, ...props }: InputProps): React.JSX.Element;
|
|
18
22
|
export { Input };
|
|
19
23
|
export type { InputProps };
|