@waveso/ui 0.0.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.
Files changed (62) hide show
  1. package/README.md +142 -0
  2. package/dist/alert-dialog.d.ts +36 -0
  3. package/dist/alert-dialog.js +149 -0
  4. package/dist/alert-dialog.js.map +1 -0
  5. package/dist/alert.d.ts +14 -0
  6. package/dist/alert.js +76 -0
  7. package/dist/alert.js.map +1 -0
  8. package/dist/avatar.d.ts +14 -0
  9. package/dist/avatar.js +100 -0
  10. package/dist/avatar.js.map +1 -0
  11. package/dist/badge.d.ts +11 -0
  12. package/dist/badge.js +51 -0
  13. package/dist/badge.js.map +1 -0
  14. package/dist/button.d.ts +14 -0
  15. package/dist/button.js +4 -0
  16. package/dist/button.js.map +1 -0
  17. package/dist/card.d.ts +14 -0
  18. package/dist/card.js +97 -0
  19. package/dist/card.js.map +1 -0
  20. package/dist/checkbox.d.ts +6 -0
  21. package/dist/checkbox.js +33 -0
  22. package/dist/checkbox.js.map +1 -0
  23. package/dist/chunk-76UQO56T.js +19 -0
  24. package/dist/chunk-76UQO56T.js.map +1 -0
  25. package/dist/chunk-L3UIJEIQ.js +41 -0
  26. package/dist/chunk-L3UIJEIQ.js.map +1 -0
  27. package/dist/chunk-OUFYQLVN.js +56 -0
  28. package/dist/chunk-OUFYQLVN.js.map +1 -0
  29. package/dist/dialog.d.ts +30 -0
  30. package/dist/dialog.js +138 -0
  31. package/dist/dialog.js.map +1 -0
  32. package/dist/hooks/use-mobile.d.ts +3 -0
  33. package/dist/hooks/use-mobile.js +20 -0
  34. package/dist/hooks/use-mobile.js.map +1 -0
  35. package/dist/input.d.ts +6 -0
  36. package/dist/input.js +22 -0
  37. package/dist/input.js.map +1 -0
  38. package/dist/label.d.ts +6 -0
  39. package/dist/label.js +20 -0
  40. package/dist/label.js.map +1 -0
  41. package/dist/lib/utils.d.ts +40 -0
  42. package/dist/lib/utils.js +3 -0
  43. package/dist/lib/utils.js.map +1 -0
  44. package/dist/progress.d.ts +16 -0
  45. package/dist/progress.js +72 -0
  46. package/dist/progress.js.map +1 -0
  47. package/dist/separator.d.ts +8 -0
  48. package/dist/separator.js +26 -0
  49. package/dist/separator.js.map +1 -0
  50. package/dist/skeleton.d.ts +5 -0
  51. package/dist/skeleton.js +17 -0
  52. package/dist/skeleton.js.map +1 -0
  53. package/dist/spinner.d.ts +5 -0
  54. package/dist/spinner.js +11 -0
  55. package/dist/spinner.js.map +1 -0
  56. package/dist/switch.d.ts +10 -0
  57. package/dist/switch.js +29 -0
  58. package/dist/switch.js.map +1 -0
  59. package/dist/textarea.d.ts +10 -0
  60. package/dist/textarea.js +25 -0
  61. package/dist/textarea.js.map +1 -0
  62. package/package.json +89 -0
package/dist/label.js ADDED
@@ -0,0 +1,20 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ function Label({ className, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "label",
7
+ {
8
+ "data-slot": "label",
9
+ className: cn(
10
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
11
+ className
12
+ ),
13
+ ...props
14
+ }
15
+ );
16
+ }
17
+
18
+ export { Label };
19
+ //# sourceMappingURL=label.js.map
20
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/label.tsx"],"names":[],"mappings":";;;AAMA,SAAS,KAAA,CAAM,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkC;AACrE,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qNAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"label.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"./lib/utils\"\n\nfunction Label({ className, ...props }: React.ComponentProps<\"label\">) {\n return (\n <label\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n"]}
@@ -0,0 +1,40 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ /**
4
+ * `cn()` is the single className helper.
5
+ *
6
+ * It does two things:
7
+ * - Combines conditional class values (via `clsx`).
8
+ * - Dedupes/conflict-resolves Tailwind utilities (via `tailwind-merge`).
9
+ *
10
+ * Why the overloads?
11
+ * - Base UI primitives support `className` as either a string **or** a `(state) => string` function.
12
+ * - DOM elements (`div`, `textarea`, etc.) only accept `className: string`.
13
+ *
14
+ * So `cn()` is overloaded:
15
+ * - If you pass only string/clsx values, it returns a **string**.
16
+ * - If you pass any function-valued input, it returns a **(state) => string** function.
17
+ *
18
+ * Examples:
19
+ * ```ts
20
+ * // DOM element (string only)
21
+ * <div className={cn("p-4", isActive && "bg-muted")} />
22
+ *
23
+ * // Base UI primitive (state function)
24
+ * <SomeBaseUiThing
25
+ * className={cn(
26
+ * "px-2",
27
+ * (s) => s.disabled && "opacity-50",
28
+ * (s) => s.active && "bg-muted",
29
+ * )}
30
+ * />
31
+ *
32
+ * // Important: DOM elements only accept string className.
33
+ * // So only pass string/clsx values to `cn()` for DOM elements.
34
+ * ```
35
+ */
36
+ type CnValue<State> = ClassValue | ((state: State) => ClassValue);
37
+ declare function cn(...inputs: ClassValue[]): string;
38
+ declare function cn<State>(...inputs: CnValue<State>[]): (state: State) => string;
39
+
40
+ export { cn };
@@ -0,0 +1,3 @@
1
+ export { cn } from '../chunk-76UQO56T.js';
2
+ //# sourceMappingURL=utils.js.map
3
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"utils.js"}
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Progress as Progress$1 } from '@base-ui/react/progress';
4
+
5
+ type ProgressProps = React.ComponentProps<typeof Progress$1.Root>;
6
+ type ProgressTrackProps = React.ComponentProps<typeof Progress$1.Track>;
7
+ type ProgressIndicatorProps = React.ComponentProps<typeof Progress$1.Indicator>;
8
+ type ProgressLabelProps = React.ComponentProps<typeof Progress$1.Label>;
9
+ type ProgressValueProps = React.ComponentProps<typeof Progress$1.Value>;
10
+ declare function Progress({ className, children, value, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
11
+ declare function ProgressTrack({ className, ...props }: ProgressTrackProps): react_jsx_runtime.JSX.Element;
12
+ declare function ProgressIndicator({ className, ...props }: ProgressIndicatorProps): react_jsx_runtime.JSX.Element;
13
+ declare function ProgressLabel({ className, ...props }: ProgressLabelProps): react_jsx_runtime.JSX.Element;
14
+ declare function ProgressValue({ className, ...props }: ProgressValueProps): react_jsx_runtime.JSX.Element;
15
+
16
+ export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue };
@@ -0,0 +1,72 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { Progress as Progress$1 } from '@base-ui/react/progress';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+
5
+ function Progress({ className, children, value, ...props }) {
6
+ return /* @__PURE__ */ jsxs(
7
+ Progress$1.Root,
8
+ {
9
+ value,
10
+ "data-slot": "progress",
11
+ className: cn("flex flex-wrap gap-3", className),
12
+ ...props,
13
+ children: [
14
+ children,
15
+ /* @__PURE__ */ jsx(ProgressTrack, { children: /* @__PURE__ */ jsx(ProgressIndicator, {}) })
16
+ ]
17
+ }
18
+ );
19
+ }
20
+ function ProgressTrack({ className, ...props }) {
21
+ return /* @__PURE__ */ jsx(
22
+ Progress$1.Track,
23
+ {
24
+ className: cn(
25
+ "bg-muted relative flex h-1 w-full items-center overflow-x-hidden rounded-full",
26
+ className
27
+ ),
28
+ "data-slot": "progress-track",
29
+ ...props
30
+ }
31
+ );
32
+ }
33
+ function ProgressIndicator({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx(
35
+ Progress$1.Indicator,
36
+ {
37
+ "data-slot": "progress-indicator",
38
+ className: cn(
39
+ "bg-primary h-full transition-all",
40
+ className
41
+ ),
42
+ ...props
43
+ }
44
+ );
45
+ }
46
+ function ProgressLabel({ className, ...props }) {
47
+ return /* @__PURE__ */ jsx(
48
+ Progress$1.Label,
49
+ {
50
+ className: cn("text-sm font-medium", className),
51
+ "data-slot": "progress-label",
52
+ ...props
53
+ }
54
+ );
55
+ }
56
+ function ProgressValue({ className, ...props }) {
57
+ return /* @__PURE__ */ jsx(
58
+ Progress$1.Value,
59
+ {
60
+ className: cn(
61
+ "text-muted-foreground ml-auto text-sm tabular-nums",
62
+ className
63
+ ),
64
+ "data-slot": "progress-value",
65
+ ...props
66
+ }
67
+ );
68
+ }
69
+
70
+ export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue };
71
+ //# sourceMappingURL=progress.js.map
72
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/progress.tsx"],"names":["ProgressPrimitive"],"mappings":";;;;AAaA,SAAS,SAAS,EAAE,SAAA,EAAW,UAAU,KAAA,EAAO,GAAG,OAAM,EAAkB;AACzE,EAAA,uBACE,IAAA;AAAA,IAACA,UAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,KAAA;AAAA,MACA,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAS,CAAA;AAAA,MAC9C,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,wBACD,GAAA,CAAC,aAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,iBAAA,EAAA,EAAkB,CAAA,EACrB;AAAA;AAAA;AAAA,GACF;AAEJ;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuB;AAClE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,KAAA;AAAA,IAAlB;AAAA,MACC,SAAA,EAAW,EAAA;AAAA,QACT,+EAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,WAAA,EAAU,gBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA2B;AAC1E,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,SAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kCAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuB;AAClE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,KAAA;AAAA,IAAlB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA;AAAA,MAC9C,WAAA,EAAU,gBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuB;AAClE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,KAAA;AAAA,IAAlB;AAAA,MACC,SAAA,EAAW,EAAA;AAAA,QACT,oDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,WAAA,EAAU,gBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ","file":"progress.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as ProgressPrimitive } from \"@base-ui/react/progress\"\n\nimport { cn } from \"./lib/utils\"\n\ntype ProgressProps = React.ComponentProps<typeof ProgressPrimitive.Root>\ntype ProgressTrackProps = React.ComponentProps<typeof ProgressPrimitive.Track>\ntype ProgressIndicatorProps = React.ComponentProps<typeof ProgressPrimitive.Indicator>\ntype ProgressLabelProps = React.ComponentProps<typeof ProgressPrimitive.Label>\ntype ProgressValueProps = React.ComponentProps<typeof ProgressPrimitive.Value>\n\nfunction Progress({ className, children, value, ...props }: ProgressProps) {\n return (\n <ProgressPrimitive.Root\n value={value}\n data-slot=\"progress\"\n className={cn(\"flex flex-wrap gap-3\", className)}\n {...props}\n >\n {children}\n <ProgressTrack>\n <ProgressIndicator />\n </ProgressTrack>\n </ProgressPrimitive.Root>\n )\n}\n\nfunction ProgressTrack({ className, ...props }: ProgressTrackProps) {\n return (\n <ProgressPrimitive.Track\n className={cn(\n \"bg-muted relative flex h-1 w-full items-center overflow-x-hidden rounded-full\",\n className\n )}\n data-slot=\"progress-track\"\n {...props}\n />\n )\n}\n\nfunction ProgressIndicator({ className, ...props }: ProgressIndicatorProps) {\n return (\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n \"bg-primary h-full transition-all\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProgressLabel({ className, ...props }: ProgressLabelProps) {\n return (\n <ProgressPrimitive.Label\n className={cn(\"text-sm font-medium\", className)}\n data-slot=\"progress-label\"\n {...props}\n />\n )\n}\n\nfunction ProgressValue({ className, ...props }: ProgressValueProps) {\n return (\n <ProgressPrimitive.Value\n className={cn(\n \"text-muted-foreground ml-auto text-sm tabular-nums\",\n className\n )}\n data-slot=\"progress-value\"\n {...props}\n />\n )\n}\n\nexport {\n Progress,\n ProgressTrack,\n ProgressIndicator,\n ProgressLabel,\n ProgressValue,\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Separator as Separator$1 } from '@base-ui/react/separator';
4
+
5
+ type SeparatorProps = React.ComponentProps<typeof Separator$1>;
6
+ declare function Separator({ className, orientation, ...props }: SeparatorProps): react_jsx_runtime.JSX.Element;
7
+
8
+ export { Separator };
@@ -0,0 +1,26 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { Separator as Separator$1 } from '@base-ui/react/separator';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function Separator({
6
+ className,
7
+ orientation = "horizontal",
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(
11
+ Separator$1,
12
+ {
13
+ "data-slot": "separator",
14
+ orientation,
15
+ className: cn(
16
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",
17
+ className
18
+ ),
19
+ ...props
20
+ }
21
+ );
22
+ }
23
+
24
+ export { Separator };
25
+ //# sourceMappingURL=separator.js.map
26
+ //# sourceMappingURL=separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/separator.tsx"],"names":["SeparatorPrimitive"],"mappings":";;;;AAUA,SAAS,SAAA,CAAU;AAAA,EACjB,SAAA;AAAA,EACA,WAAA,GAAc,YAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAmB;AACjB,EAAA,uBACE,GAAA;AAAA,IAACA,WAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,WAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA,QACT,sKAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"separator.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"./lib/utils\"\n\ntype SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive>\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: SeparatorProps) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n"]}
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
4
+
5
+ export { Skeleton };
@@ -0,0 +1,17 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ function Skeleton({ className, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "div",
7
+ {
8
+ "data-slot": "skeleton",
9
+ className: cn("bg-muted animate-pulse rounded-md", className),
10
+ ...props
11
+ }
12
+ );
13
+ }
14
+
15
+ export { Skeleton };
16
+ //# sourceMappingURL=skeleton.js.map
17
+ //# sourceMappingURL=skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/skeleton.tsx"],"names":[],"mappings":";;;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACtE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,mCAAA,EAAqC,SAAS,CAAA;AAAA,MAC3D,GAAG;AAAA;AAAA,GACN;AAEJ","file":"skeleton.js","sourcesContent":["import { cn } from \"./lib/utils\"\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\"bg-muted animate-pulse rounded-md\", className)}\n {...props}\n />\n )\n}\n\nexport { Skeleton }\n"]}
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function Spinner({ className, ...props }: React.ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
4
+
5
+ export { Spinner };
@@ -0,0 +1,11 @@
1
+ import { LoaderIcon } from './chunk-L3UIJEIQ.js';
2
+ import { cn } from './chunk-76UQO56T.js';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function Spinner({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx(LoaderIcon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
7
+ }
8
+
9
+ export { Spinner };
10
+ //# sourceMappingURL=spinner.js.map
11
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/spinner.tsx"],"names":[],"mappings":";;;;AAGA,SAAS,OAAA,CAAQ,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACrE,EAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAW,IAAA,EAAK,QAAA,EAAS,YAAA,EAAW,SAAA,EAAU,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAE/G","file":"spinner.js","sourcesContent":["import { cn } from \"./lib/utils\"\nimport { LoaderIcon } from \"./lib/internal-icons\"\n\nfunction Spinner({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <LoaderIcon role=\"status\" aria-label=\"Loading\" className={cn(\"size-4 animate-spin\", className)} {...props} />\n )\n}\n\nexport { Spinner }\n"]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
4
+
5
+ type SwitchProps = React.ComponentProps<typeof Switch$1.Root> & {
6
+ size?: "sm" | "default";
7
+ };
8
+ declare function Switch({ className, size, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { Switch };
package/dist/switch.js ADDED
@@ -0,0 +1,29 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function Switch({ className, size = "default", ...props }) {
6
+ return /* @__PURE__ */ jsx(
7
+ Switch$1.Root,
8
+ {
9
+ "data-slot": "switch",
10
+ "data-size": size,
11
+ className: cn(
12
+ "data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",
13
+ className
14
+ ),
15
+ ...props,
16
+ children: /* @__PURE__ */ jsx(
17
+ Switch$1.Thumb,
18
+ {
19
+ "data-slot": "switch-thumb",
20
+ className: "bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"
21
+ }
22
+ )
23
+ }
24
+ );
25
+ }
26
+
27
+ export { Switch };
28
+ //# sourceMappingURL=switch.js.map
29
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/switch.tsx"],"names":["SwitchPrimitive"],"mappings":";;;;AAWA,SAAS,OAAO,EAAE,SAAA,EAAW,OAAO,SAAA,EAAW,GAAG,OAAM,EAAgB;AACtE,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,QAAA;AAAA,MACV,WAAA,EAAW,IAAA;AAAA,MACX,SAAA,EAAW,EAAA;AAAA,QACT,qpBAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA;AAAA,QAACA,QAAA,CAAgB,KAAA;AAAA,QAAhB;AAAA,UACC,WAAA,EAAU,cAAA;AAAA,UACV,SAAA,EAAU;AAAA;AAAA;AACZ;AAAA,GACF;AAEJ","file":"switch.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Switch as SwitchPrimitive } from \"@base-ui/react/switch\"\n\nimport { cn } from \"./lib/utils\"\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root> & {\n size?: \"sm\" | \"default\"\n}\n\nfunction Switch({ className, size = \"default\", ...props }: SwitchProps) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n data-size={size}\n className={cn(\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]\",\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\nexport { Switch }\n"]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type TextareaProps = Omit<React.ComponentProps<"textarea">, "onChange"> & {
5
+ onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
6
+ onValueChange?: (value: string) => void;
7
+ };
8
+ declare function Textarea({ className, onChange, onValueChange, ...props }: TextareaProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { Textarea };
@@ -0,0 +1,25 @@
1
+ import { cn } from './chunk-76UQO56T.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ function Textarea({ className, onChange, onValueChange, ...props }) {
5
+ function handleChange(e) {
6
+ onChange?.(e);
7
+ onValueChange?.(e.target.value);
8
+ }
9
+ return /* @__PURE__ */ jsx(
10
+ "textarea",
11
+ {
12
+ "data-slot": "textarea",
13
+ className: cn(
14
+ "border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none disabled:bg-input/50 disabled:cursor-not-allowed dark:disabled:bg-input/80 placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",
15
+ className
16
+ ),
17
+ onChange: handleChange,
18
+ ...props
19
+ }
20
+ );
21
+ }
22
+
23
+ export { Textarea };
24
+ //# sourceMappingURL=textarea.js.map
25
+ //# sourceMappingURL=textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/textarea.tsx"],"names":[],"mappings":";;;AASA,SAAS,SAAS,EAAE,SAAA,EAAW,UAAU,aAAA,EAAe,GAAG,OAAM,EAAkB;AACjF,EAAA,SAAS,aAAa,CAAA,EAA2C;AAC/D,IAAA,QAAA,GAAW,CAAC,CAAA;AACZ,IAAA,aAAA,GAAgB,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,EAChC;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,gkBAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,QAAA,EAAU,YAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ","file":"textarea.js","sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"./lib/utils\"\n\ntype TextareaProps = Omit<React.ComponentProps<\"textarea\">, \"onChange\"> & {\n onChange?: React.ChangeEventHandler<HTMLTextAreaElement>\n onValueChange?: (value: string) => void\n}\n\nfunction Textarea({ className, onChange, onValueChange, ...props }: TextareaProps) {\n function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {\n onChange?.(e)\n onValueChange?.(e.target.value)\n }\n\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none disabled:bg-input/50 disabled:cursor-not-allowed dark:disabled:bg-input/80 placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm\",\n className,\n )}\n onChange={handleChange}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n"]}
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@waveso/ui",
3
+ "version": "0.0.2",
4
+ "description": "Wave UI component library built on Base UI and Tailwind CSS",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "license": "MIT",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ "./*": {
11
+ "import": {
12
+ "types": "./dist/*.d.ts",
13
+ "default": "./dist/*.js"
14
+ }
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "package.json"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsup",
23
+ "dev": "tsup --watch",
24
+ "typecheck": "tsc --noEmit",
25
+ "clean": "rm -rf dist",
26
+ "storybook": "storybook dev -p 6006",
27
+ "build-storybook": "storybook build",
28
+ "prepublishOnly": "npm run build",
29
+ "changeset": "changeset",
30
+ "version": "changeset version",
31
+ "release": "npm run build && changeset publish"
32
+ },
33
+ "peerDependencies": {
34
+ "@base-ui/react": "^1.0.0",
35
+ "class-variance-authority": "^0.7.0",
36
+ "clsx": "^2.0.0",
37
+ "react": "^19.0.0",
38
+ "react-dom": "^19.0.0",
39
+ "tailwind-merge": "^3.0.0"
40
+ },
41
+ "peerDependenciesMeta": {
42
+ "react-day-picker": {
43
+ "optional": true
44
+ },
45
+ "embla-carousel-react": {
46
+ "optional": true
47
+ },
48
+ "react-hook-form": {
49
+ "optional": true
50
+ },
51
+ "input-otp": {
52
+ "optional": true
53
+ },
54
+ "motion": {
55
+ "optional": true
56
+ },
57
+ "usehooks-ts": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "@base-ui/react": "^1.0.0",
63
+ "@changesets/cli": "^2.27.0",
64
+ "@storybook/addon-a11y": "^10.2.13",
65
+ "@storybook/addon-docs": "^10.2.13",
66
+ "@storybook/addon-themes": "^10.2.13",
67
+ "@storybook/react-vite": "^10.2.13",
68
+ "@tailwindcss/vite": "^4.2.1",
69
+ "@types/react": "^19",
70
+ "@types/react-dom": "^19",
71
+ "class-variance-authority": "^0.7.1",
72
+ "clsx": "^2.1.1",
73
+ "embla-carousel-react": "^8.6.0",
74
+ "input-otp": "^1.4.2",
75
+ "motion": "^12.31.0",
76
+ "react": "^19.2.0",
77
+ "react-day-picker": "^9.13.0",
78
+ "react-dom": "^19.2.0",
79
+ "react-hook-form": "^7.66.0",
80
+ "storybook": "^10.2.13",
81
+ "tailwind-merge": "^3.4.0",
82
+ "tailwindcss": "^4.2.1",
83
+ "tsup": "^8.4.0",
84
+ "tw-animate-css": "^1.4.0",
85
+ "typescript": "^5.7.0",
86
+ "usehooks-ts": "^3.1.1",
87
+ "vite": "^7.3.1"
88
+ }
89
+ }