@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.
Files changed (71) hide show
  1. package/README.md +39 -14
  2. package/dist/components/accordion.d.ts +14 -10
  3. package/dist/components/accordion.mjs +78 -25
  4. package/dist/components/alert-dialog.d.ts +7 -2
  5. package/dist/components/alert-dialog.mjs +74 -33
  6. package/dist/components/button.d.ts +6 -2
  7. package/dist/components/button.mjs +20 -11
  8. package/dist/components/card.d.ts +6 -1
  9. package/dist/components/card.mjs +27 -4
  10. package/dist/components/checkbox.d.ts +5 -1
  11. package/dist/components/checkbox.mjs +73 -26
  12. package/dist/components/dialog.d.ts +7 -2
  13. package/dist/components/dialog.mjs +66 -20
  14. package/dist/components/drawer.d.ts +7 -2
  15. package/dist/components/drawer.mjs +66 -20
  16. package/dist/components/icons/check.d.ts +3 -0
  17. package/dist/components/icons/check.mjs +24 -0
  18. package/dist/components/icons/close.d.ts +3 -0
  19. package/dist/components/icons/close.mjs +21 -0
  20. package/dist/components/icons/dash.d.ts +3 -0
  21. package/dist/components/icons/dash.mjs +24 -0
  22. package/dist/components/icons/error.d.ts +3 -0
  23. package/dist/components/icons/error.mjs +23 -0
  24. package/dist/components/icons/info.d.ts +3 -0
  25. package/dist/components/icons/info.mjs +23 -0
  26. package/dist/components/icons/loading.d.ts +3 -0
  27. package/dist/components/icons/loading.mjs +22 -0
  28. package/dist/components/icons/plus.d.ts +3 -0
  29. package/dist/components/icons/plus.mjs +22 -0
  30. package/dist/components/icons/success.d.ts +3 -0
  31. package/dist/components/icons/success.mjs +22 -0
  32. package/dist/components/icons/warning.d.ts +3 -0
  33. package/dist/components/icons/warning.mjs +23 -0
  34. package/dist/components/input.d.ts +5 -1
  35. package/dist/components/input.mjs +73 -30
  36. package/dist/components/popover.d.ts +7 -2
  37. package/dist/components/popover.mjs +53 -14
  38. package/dist/components/progress.d.ts +21 -0
  39. package/dist/components/progress.mjs +71 -0
  40. package/dist/components/scroll-area.d.ts +7 -2
  41. package/dist/components/scroll-area.mjs +48 -14
  42. package/dist/components/slider.d.ts +15 -4
  43. package/dist/components/slider.mjs +65 -16
  44. package/dist/components/switch.d.ts +5 -1
  45. package/dist/components/switch.mjs +65 -18
  46. package/dist/components/toast.d.ts +17 -11
  47. package/dist/components/toast.mjs +111 -87
  48. package/dist/components/toggle-group.d.ts +11 -5
  49. package/dist/components/toggle-group.mjs +54 -6
  50. package/dist/components/toggle.d.ts +5 -1
  51. package/dist/components/toggle.mjs +36 -5
  52. package/dist/index.css +1 -1
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.mjs +2 -0
  55. package/dist/internal/aria.d.ts +3 -0
  56. package/dist/internal/aria.mjs +5 -0
  57. package/dist/internal/tv.d.ts +17 -0
  58. package/dist/internal/tv.mjs +0 -0
  59. package/dist/keyframes.css +1 -1
  60. package/dist/theme/alert-dialog.mjs +1 -1
  61. package/dist/theme/checkbox.mjs +4 -4
  62. package/dist/theme/dialog.mjs +1 -1
  63. package/dist/theme/drawer.mjs +1 -1
  64. package/dist/theme/popover.mjs +2 -2
  65. package/dist/theme/progress.d.ts +80 -0
  66. package/dist/theme/progress.mjs +64 -0
  67. package/dist/theme/slider.mjs +8 -0
  68. package/dist/theme/switch.mjs +2 -0
  69. package/dist/theme/toast.d.ts +15 -36
  70. package/dist/theme/toast.mjs +29 -21
  71. 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
- function CheckIcon({ indeterminate }) {
7
- return /* @__PURE__ */ React.createElement(
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 ui = theme({ size });
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(ui.root(), className)
39
+ className: cn(styles.root(), ui?.root, className)
39
40
  },
40
- /* @__PURE__ */ React.createElement("span", { "data-slot": "box", className: ui.box() }, /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true", "data-slot": "fill", className: ui.fill() }), /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true", "data-slot": "glass", className: ui.glass() }, /* @__PURE__ */ React.createElement(
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": "overlay",
45
- className: ui.overlay()
45
+ "data-slot": "fill",
46
+ className: cn(styles.fill(), ui?.fill)
46
47
  }
47
- )), /* @__PURE__ */ React.createElement(
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: ui.indicator()
69
+ className: cn(styles.indicator(), ui?.indicator)
54
70
  },
55
- /* @__PURE__ */ React.createElement("span", { "data-slot": "indicator-icon", className: ui.indicatorIcon() }, /* @__PURE__ */ React.createElement(CheckIcon, { indeterminate }))
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("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
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?: any;
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 ui = theme();
15
- return /* @__PURE__ */ React.createElement(UIDialog.Root, { ...props }, /* @__PURE__ */ React.createElement(UIDialog.Portal, null, /* @__PURE__ */ React.createElement(UIDialog.Backdrop, { "data-slot": "backdrop", className: ui.backdrop() }), /* @__PURE__ */ React.createElement(UIDialog.Viewport, { "data-slot": "viewport", className: ui.viewport() }, /* @__PURE__ */ React.createElement(
16
- UIDialog.Popup,
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": "popup",
19
- className: cn(ui.popup(), className)
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("span", { "aria-hidden": "true", "data-slot": "glass", className: ui.glass() }, /* @__PURE__ */ React.createElement(
22
- "span",
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": "description",
33
- className: ui.description()
31
+ "data-slot": "popup",
32
+ className: cn(styles.popup(), ui?.popup, className)
34
33
  },
35
- description
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
- ))));
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?: any;
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 ui = theme({ direction });
16
- return /* @__PURE__ */ React.createElement(UIDrawer.Root, { ...props, swipeDirection: direction }, /* @__PURE__ */ React.createElement(UIDrawer.Portal, null, /* @__PURE__ */ React.createElement(UIDrawer.Backdrop, { "data-slot": "backdrop", className: ui.backdrop() }), /* @__PURE__ */ React.createElement(UIDrawer.Viewport, { "data-slot": "viewport", className: ui.viewport() }, /* @__PURE__ */ React.createElement(
17
- UIDrawer.Popup,
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": "popup",
20
- className: cn(ui.popup(), className)
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("span", { "aria-hidden": "true", "data-slot": "glass", className: ui.glass() }, /* @__PURE__ */ React.createElement(
23
- "span",
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": "description",
34
- className: ui.description()
32
+ "data-slot": "popup",
33
+ className: cn(styles.popup(), ui?.popup, className)
35
34
  },
36
- description
37
- ) : 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)
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,3 @@
1
+ import * as React from "react";
2
+ declare function CheckIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { CheckIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function CloseIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { CloseIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function DashIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { DashIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function ErrorIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { ErrorIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function InfoIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { InfoIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function LoadingIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { LoadingIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function PlusIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { PlusIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function SuccessIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { SuccessIcon };
@@ -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,3 @@
1
+ import * as React from "react";
2
+ declare function WarningIcon({ className, ...props }: React.ComponentProps<"svg">): React.JSX.Element;
3
+ export { WarningIcon };
@@ -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 };