atlas-react-kit 0.1.0

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 (63) hide show
  1. package/COMPONENTS.md +80 -0
  2. package/DESIGN_RULES.md +40 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE +24 -0
  5. package/README.md +83 -0
  6. package/dist/badge.d.ts +10 -0
  7. package/dist/badge.js +57 -0
  8. package/dist/button.d.ts +10 -0
  9. package/dist/button.js +36 -0
  10. package/dist/calendar.d.ts +10 -0
  11. package/dist/calendar.js +76 -0
  12. package/dist/card.d.ts +19 -0
  13. package/dist/card.js +32 -0
  14. package/dist/checkbox.d.ts +4 -0
  15. package/dist/checkbox.js +10 -0
  16. package/dist/dialog.d.ts +15 -0
  17. package/dist/dialog.js +38 -0
  18. package/dist/empty-panel.d.ts +10 -0
  19. package/dist/empty-panel.js +6 -0
  20. package/dist/field.d.ts +24 -0
  21. package/dist/field.js +68 -0
  22. package/dist/form/feedback-field.d.ts +4 -0
  23. package/dist/form/feedback-field.js +7 -0
  24. package/dist/form/field-error.d.ts +12 -0
  25. package/dist/form/field-error.js +13 -0
  26. package/dist/form/select-field.d.ts +13 -0
  27. package/dist/form/select-field.js +12 -0
  28. package/dist/form/text-field.d.ts +27 -0
  29. package/dist/form/text-field.js +25 -0
  30. package/dist/input.d.ts +3 -0
  31. package/dist/input.js +7 -0
  32. package/dist/internal/tabs-styles.d.ts +5 -0
  33. package/dist/internal/tabs-styles.js +19 -0
  34. package/dist/label.d.ts +4 -0
  35. package/dist/label.js +9 -0
  36. package/dist/next/tabs-nav-link.d.ts +6 -0
  37. package/dist/next/tabs-nav-link.js +9 -0
  38. package/dist/popover.d.ts +10 -0
  39. package/dist/popover.js +27 -0
  40. package/dist/select.d.ts +15 -0
  41. package/dist/select.js +38 -0
  42. package/dist/separator.d.ts +4 -0
  43. package/dist/separator.js +9 -0
  44. package/dist/skeleton.d.ts +2 -0
  45. package/dist/skeleton.js +6 -0
  46. package/dist/sonner.d.ts +4 -0
  47. package/dist/sonner.js +15 -0
  48. package/dist/table-body-skeleton.d.ts +7 -0
  49. package/dist/table-body-skeleton.js +7 -0
  50. package/dist/table.d.ts +10 -0
  51. package/dist/table.js +29 -0
  52. package/dist/tabs.d.ts +17 -0
  53. package/dist/tabs.js +28 -0
  54. package/dist/textarea.d.ts +3 -0
  55. package/dist/textarea.js +7 -0
  56. package/dist/toggle-group.d.ts +10 -0
  57. package/dist/toggle-group.js +24 -0
  58. package/dist/toggle.d.ts +9 -0
  59. package/dist/toggle.js +27 -0
  60. package/dist/utils.d.ts +5 -0
  61. package/dist/utils.js +11 -0
  62. package/package.json +181 -0
  63. package/theme.css +184 -0
@@ -0,0 +1,24 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { Label } from "./label.js";
3
+ declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react").JSX.Element;
4
+ declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
5
+ variant?: "legend" | "label";
6
+ }): import("react").JSX.Element;
7
+ declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
8
+ declare const fieldVariants: (props?: ({
9
+ orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
12
+ declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
13
+ declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
14
+ declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
15
+ declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
16
+ declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
17
+ children?: React.ReactNode;
18
+ }): import("react").JSX.Element;
19
+ declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
20
+ errors?: Array<{
21
+ message?: string;
22
+ } | undefined>;
23
+ }): import("react").JSX.Element | null;
24
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
package/dist/field.js ADDED
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "./utils.js";
6
+ import { Label } from "./label.js";
7
+ import { Separator } from "./separator.js";
8
+ function FieldSet({ className, ...props }) {
9
+ return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
10
+ }
11
+ function FieldLegend({ className, variant = "legend", ...props }) {
12
+ return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-semibold uppercase data-[variant=label]:text-xs data-[variant=legend]:text-xs", className), ...props }));
13
+ }
14
+ function FieldGroup({ className, ...props }) {
15
+ return (_jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group flex w-full flex-col gap-10 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className), ...props }));
16
+ }
17
+ const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
18
+ variants: {
19
+ orientation: {
20
+ vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
21
+ horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
22
+ responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ orientation: "vertical",
27
+ },
28
+ });
29
+ function Field({ className, orientation = "vertical", ...props }) {
30
+ return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
31
+ }
32
+ function FieldContent({ className, ...props }) {
33
+ return (_jsx("div", { "data-slot": "field-content", className: cn("group/field-content flex flex-1 flex-col gap-1 leading-snug", className), ...props }));
34
+ }
35
+ function FieldLabel({ className, ...props }) {
36
+ return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-relaxed group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-selected has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border *:data-[slot=field]:p-4 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-selected", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className), ...props }));
37
+ }
38
+ function FieldTitle({ className, ...props }) {
39
+ return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-xs font-semibold uppercase group-data-[disabled=true]/field:opacity-50 in-data-[slot=field-label]:font-semibold", className), ...props }));
40
+ }
41
+ function FieldDescription({ className, ...props }) {
42
+ return (_jsx("p", { "data-slot": "field-description", className: cn("text-left text-sm leading-normal font-normal tracking-normal text-muted-foreground normal-case group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
43
+ }
44
+ function FieldSeparator({ children, className, ...props }) {
45
+ return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
46
+ }
47
+ function FieldError({ className, children, errors, ...props }) {
48
+ const content = useMemo(() => {
49
+ if (children) {
50
+ return children;
51
+ }
52
+ if (!errors?.length) {
53
+ return null;
54
+ }
55
+ const uniqueErrors = [
56
+ ...new Map(errors.map((error) => [error?.message, error])).values(),
57
+ ];
58
+ if (uniqueErrors?.length == 1) {
59
+ return uniqueErrors[0]?.message;
60
+ }
61
+ return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map((error, index) => error?.message && _jsx("li", { children: error.message }, index)) }));
62
+ }, [children, errors]);
63
+ if (!content) {
64
+ return null;
65
+ }
66
+ return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-sm font-normal text-destructive", className), ...props, children: content }));
67
+ }
68
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
@@ -0,0 +1,4 @@
1
+ /** Form-level submit or mutation error (not tied to a single field). */
2
+ export declare function FormFeedbackField({ message }: {
3
+ message: string | null;
4
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /** Form-level submit or mutation error (not tied to a single field). */
3
+ export function FormFeedbackField({ message }) {
4
+ if (!message)
5
+ return null;
6
+ return (_jsx("p", { className: "text-sm text-destructive", role: "alert", children: message }));
7
+ }
@@ -0,0 +1,12 @@
1
+ export type FieldErrorMessage = string | {
2
+ message?: string;
3
+ } | undefined;
4
+ export type FieldMetaState = {
5
+ errors: FieldErrorMessage[];
6
+ };
7
+ /** First TanStack Form error message for a field, if any. */
8
+ export declare function getFieldErrorMessage(message: FieldErrorMessage): string | undefined;
9
+ export declare function FieldError({ message, text, }: {
10
+ message?: FieldErrorMessage;
11
+ text?: string;
12
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /** First TanStack Form error message for a field, if any. */
3
+ export function getFieldErrorMessage(message) {
4
+ if (typeof message === "string")
5
+ return message;
6
+ return message?.message;
7
+ }
8
+ export function FieldError({ message, text, }) {
9
+ const resolved = text ?? getFieldErrorMessage(message);
10
+ if (!resolved)
11
+ return null;
12
+ return (_jsx("p", { className: "text-xs text-destructive", role: "alert", children: resolved }));
13
+ }
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from "react";
2
+ import { type FieldMetaState } from "./field-error.js";
3
+ type Props = {
4
+ value: string | undefined;
5
+ meta?: FieldMetaState;
6
+ label: string;
7
+ onValueChange: (value: string) => void;
8
+ placeholder?: string;
9
+ children: ReactNode;
10
+ };
11
+ /** Select control with built-in field error text and invalid styling. */
12
+ export declare function FormSelectField({ value, meta, label, onValueChange, placeholder, children, }: Props): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { Label } from "../label.js";
5
+ import { Select, SelectContent, SelectTrigger, SelectValue } from "../select.js";
6
+ import { FieldError, getFieldErrorMessage, } from "./field-error.js";
7
+ /** Select control with built-in field error text and invalid styling. */
8
+ export function FormSelectField({ value, meta, label, onValueChange, placeholder, children, }) {
9
+ const errorText = meta ? getFieldErrorMessage(meta.errors[0]) : undefined;
10
+ const id = useId();
11
+ return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: id, children: label }), _jsxs(Select, { value: value, onValueChange: onValueChange, children: [_jsx(SelectTrigger, { id: id, "aria-invalid": errorText ? true : undefined, children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { children: children })] }), _jsx(FieldError, { text: errorText })] }));
12
+ }
@@ -0,0 +1,27 @@
1
+ import { type FieldMetaState } from "./field-error.js";
2
+ export type TextFieldApi = {
3
+ name: string;
4
+ state: {
5
+ value: string;
6
+ meta: FieldMetaState;
7
+ };
8
+ handleChange: (value: string) => void;
9
+ handleBlur: () => void;
10
+ };
11
+ export declare function FormTextField({ field, label, placeholder, description, autoFocus, multiline, rows, inputType, showError, autoComplete, required, minLength, }: {
12
+ field: TextFieldApi;
13
+ label: string;
14
+ placeholder?: string;
15
+ /** Optional hint under the label (employer vs referrer, etc.). */
16
+ description?: string;
17
+ autoFocus?: boolean;
18
+ multiline?: boolean;
19
+ /** Textarea rows when `multiline` is set. */
20
+ rows?: number;
21
+ inputType?: "text" | "email" | "password" | "date" | "datetime-local" | "time" | "number";
22
+ /** When true (default), shows meta.errors and aria-invalid styling. */
23
+ showError?: boolean;
24
+ autoComplete?: string;
25
+ required?: boolean;
26
+ minLength?: number;
27
+ }): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Input } from "../input.js";
4
+ import { Label } from "../label.js";
5
+ import { Textarea } from "../textarea.js";
6
+ import { onInputChange } from "../utils.js";
7
+ import { FieldError, getFieldErrorMessage, } from "./field-error.js";
8
+ export function FormTextField({ field, label, placeholder, description, autoFocus, multiline, rows = 3, inputType = "text", showError = true, autoComplete, required, minLength, }) {
9
+ const onChange = onInputChange(field.handleChange);
10
+ const errorText = showError
11
+ ? getFieldErrorMessage(field.state.meta.errors[0])
12
+ : undefined;
13
+ const controlProps = {
14
+ id: field.name,
15
+ value: field.state.value,
16
+ onChange,
17
+ onBlur: field.handleBlur,
18
+ placeholder,
19
+ autoComplete,
20
+ required,
21
+ minLength,
22
+ "aria-invalid": errorText ? true : undefined,
23
+ };
24
+ return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: field.name, children: label }), description ? (_jsx("p", { className: "text-xs text-muted-foreground", children: description })) : null, multiline ? (_jsx(Textarea, { ...controlProps, rows: rows })) : (_jsx(Input, { ...controlProps, type: inputType, autoFocus: autoFocus })), showError ? _jsx(FieldError, { text: errorText }) : null] }));
25
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
3
+ export { Input };
package/dist/input.js ADDED
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "./utils.js";
4
+ function Input({ className, type, ...props }) {
5
+ return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-10 w-full min-w-0 rounded-none border border-input bg-background px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
6
+ }
7
+ export { Input };
@@ -0,0 +1,5 @@
1
+ declare const tabsListVariants: (props?: ({
2
+ variant?: "default" | "line" | null | undefined;
3
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
+ declare const tabsTriggerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export { tabsListVariants, tabsTriggerVariants };
@@ -0,0 +1,19 @@
1
+ import { cva } from "class-variance-authority";
2
+ const tabsListVariants = cva('group/tabs-list inline-flex w-fit items-stretch justify-center p-0 text-muted-foreground group-data-[orientation="horizontal"]/tabs:h-11 group-data-[orientation="vertical"]/tabs:h-fit group-data-[orientation="vertical"]/tabs:flex-col', {
3
+ variants: {
4
+ variant: {
5
+ default: "bg-muted",
6
+ line: "gap-1 bg-transparent",
7
+ },
8
+ },
9
+ defaultVariants: {
10
+ variant: "default",
11
+ },
12
+ });
13
+ const tabsTriggerVariants = cva([
14
+ 'relative inline-flex h-full min-w-0 flex-1 items-center justify-center gap-2 border border-transparent px-4 py-1.5 text-xs font-semibold tracking-wider whitespace-nowrap text-foreground/60 uppercase transition-all group-data-[orientation="vertical"]/tabs:w-full group-data-[orientation="vertical"]/tabs:justify-start group-data-[orientation="vertical"]/tabs:px-4 group-data-[orientation="vertical"]/tabs:py-2 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-3.5',
15
+ 'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state="active"]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state="active"]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state="active"]:bg-transparent',
16
+ 'data-[state="active"]:bg-selected data-[state="active"]:text-selected-foreground dark:data-[state="active"]:border-transparent dark:data-[state="active"]:bg-selected dark:data-[state="active"]:text-selected-foreground',
17
+ 'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation="horizontal"]/tabs:after:inset-x-0 group-data-[orientation="horizontal"]/tabs:after:bottom-[-5px] group-data-[orientation="horizontal"]/tabs:after:h-0.5 group-data-[orientation="vertical"]/tabs:after:inset-y-0 group-data-[orientation="vertical"]/tabs:after:-right-1 group-data-[orientation="vertical"]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state="active"]:after:opacity-100',
18
+ ]);
19
+ export { tabsListVariants, tabsTriggerVariants };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Label as LabelPrimitive } from "radix-ui";
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
4
+ export { Label };
package/dist/label.js ADDED
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Label as LabelPrimitive } from "radix-ui";
5
+ import { cn } from "./utils.js";
6
+ function Label({ className, ...props }) {
7
+ return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-xs font-semibold tracking-wide uppercase select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-data-[slot=checkbox]:text-sm peer-data-[slot=checkbox]:font-normal peer-data-[slot=checkbox]:tracking-normal peer-data-[slot=checkbox]:normal-case peer-data-[slot=radio-group-item]:text-sm peer-data-[slot=radio-group-item]:font-normal peer-data-[slot=radio-group-item]:tracking-normal peer-data-[slot=radio-group-item]:normal-case peer-data-[slot=switch]:text-sm peer-data-[slot=switch]:font-normal peer-data-[slot=switch]:tracking-normal peer-data-[slot=switch]:normal-case", className), ...props }));
8
+ }
9
+ export { Label };
@@ -0,0 +1,6 @@
1
+ import type * as React from "react";
2
+ import Link from "next/link.js";
3
+ declare function TabsNavLink({ active, className, ...props }: React.ComponentProps<typeof Link> & {
4
+ active: boolean;
5
+ }): React.JSX.Element;
6
+ export { TabsNavLink };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import Link from "next/link.js";
4
+ import { cn } from "../utils.js";
5
+ import { tabsTriggerVariants } from "../internal/tabs-styles.js";
6
+ function TabsNavLink({ active, className, ...props }) {
7
+ return (_jsx(Link, { "data-slot": "tabs-nav-link", "data-state": active ? "active" : "inactive", "aria-current": active ? "page" : undefined, className: cn(tabsTriggerVariants(), className), ...props }));
8
+ }
9
+ export { TabsNavLink };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "radix-ui";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, collisionPadding, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
7
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
9
+ declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
10
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Popover as PopoverPrimitive } from "radix-ui";
5
+ import { cn } from "./utils.js";
6
+ function Popover({ ...props }) {
7
+ return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
8
+ }
9
+ function PopoverTrigger({ ...props }) {
10
+ return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
11
+ }
12
+ function PopoverContent({ className, align = "center", sideOffset = 4, collisionPadding = 8, ...props }) {
13
+ return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, collisionPadding: collisionPadding, className: cn("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-none bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className), ...props }) }));
14
+ }
15
+ function PopoverAnchor({ ...props }) {
16
+ return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
17
+ }
18
+ function PopoverHeader({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "popover-header", className: cn("flex flex-col gap-1 text-sm", className), ...props }));
20
+ }
21
+ function PopoverTitle({ className, ...props }) {
22
+ return (_jsx("h2", { "data-slot": "popover-title", className: cn("text-xs font-semibold uppercase", className), ...props }));
23
+ }
24
+ function PopoverDescription({ className, ...props }) {
25
+ return (_jsx("p", { "data-slot": "popover-description", className: cn("mt-0.5 text-sm leading-relaxed text-muted-foreground", className), ...props }));
26
+ }
27
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { Select as SelectPrimitive } from "radix-ui";
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
4
+ declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): React.JSX.Element;
9
+ declare function SelectContent({ className, children, position, align, sideOffset, collisionPadding, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
15
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
package/dist/select.js ADDED
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Select as SelectPrimitive } from "radix-ui";
5
+ import { cn } from "./utils.js";
6
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
7
+ function Select({ ...props }) {
8
+ return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
9
+ }
10
+ function SelectGroup({ className, ...props }) {
11
+ return (_jsx(SelectPrimitive.Group, { "data-slot": "select-group", className: cn("scroll-my-1.5 p-1.5", className), ...props }));
12
+ }
13
+ function SelectValue({ ...props }) {
14
+ return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
15
+ }
16
+ function SelectTrigger({ className, size = "default", children, ...props }) {
17
+ return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-full min-w-0 items-center justify-between gap-1.5 rounded-none border border-input bg-background px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-10 data-[size=sm]:h-9 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" }) })] }));
18
+ }
19
+ function SelectContent({ className, children, position = "popper", align = "center", sideOffset = 4, collisionPadding = 8, ...props }) {
20
+ return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position === "popper" &&
21
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align, sideOffset: sideOffset, collisionPadding: collisionPadding, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { "data-position": position, className: cn("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", position === "popper" && ""), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
22
+ }
23
+ function SelectLabel({ className, ...props }) {
24
+ return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("px-3 py-2 text-xs font-semibold tracking-wider text-muted-foreground uppercase", className), ...props }));
25
+ }
26
+ function SelectItem({ className, children, ...props }) {
27
+ return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-2.5 rounded-none py-2 pr-8 pl-3 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[state=checked]:bg-selected data-[state=checked]:text-selected-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "pointer-events-none" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
28
+ }
29
+ function SelectSeparator({ className, ...props }) {
30
+ return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1.5 my-1.5 h-px bg-border/50", className), ...props }));
31
+ }
32
+ function SelectScrollUpButton({ className, ...props }) {
33
+ return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5", className), ...props, children: _jsx(ChevronUpIcon, {}) }));
34
+ }
35
+ function SelectScrollDownButton({ className, ...props }) {
36
+ return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5", className), ...props, children: _jsx(ChevronDownIcon, {}) }));
37
+ }
38
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Separator as SeparatorPrimitive } from "radix-ui";
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
4
+ export { Separator };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Separator as SeparatorPrimitive } from "radix-ui";
5
+ import { cn } from "./utils.js";
6
+ function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
7
+ return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props }));
8
+ }
9
+ export { Separator };
@@ -0,0 +1,2 @@
1
+ declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
2
+ export { Skeleton };
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "./utils.js";
3
+ function Skeleton({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse bg-muted", className), ...props }));
5
+ }
6
+ export { Skeleton };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { type ToasterProps } from "sonner";
3
+ declare const Toaster: ({ ...props }: ToasterProps) => React.JSX.Element;
4
+ export { Toaster };
package/dist/sonner.js ADDED
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useTheme } from "next-themes";
5
+ import { Toaster as Sonner } from "sonner";
6
+ const Toaster = ({ ...props }) => {
7
+ const { theme = "system" } = useTheme();
8
+ return (_jsx(Sonner, { theme: theme, className: "toaster group", style: {
9
+ "--normal-bg": "var(--popover)",
10
+ "--normal-text": "var(--popover-foreground)",
11
+ "--normal-border": "var(--border)",
12
+ "--border-radius": "0px",
13
+ }, ...props }));
14
+ };
15
+ export { Toaster };
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ columns: number;
3
+ rows?: number;
4
+ };
5
+ /** Skeleton table body rows for client query loading states. */
6
+ export declare function TableBodySkeleton({ columns, rows }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Skeleton } from "./skeleton.js";
3
+ import { TableBody, TableCell, TableRow } from "./table.js";
4
+ /** Skeleton table body rows for client query loading states. */
5
+ export function TableBodySkeleton({ columns, rows = 5 }) {
6
+ return (_jsx(TableBody, { children: Array.from({ length: rows }, (_, row) => (_jsx(TableRow, { children: Array.from({ length: columns }, (_, col) => (_jsx(TableCell, { children: _jsx(Skeleton, { className: "h-4 w-full max-w-[12rem]" }) }, col))) }, row))) }));
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
6
+ declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
7
+ declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
8
+ declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
9
+ declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
10
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
package/dist/table.js ADDED
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "./utils.js";
5
+ function Table({ className, ...props }) {
6
+ return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
7
+ }
8
+ function TableHeader({ className, ...props }) {
9
+ return (_jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props }));
10
+ }
11
+ function TableBody({ className, ...props }) {
12
+ return (_jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props }));
13
+ }
14
+ function TableFooter({ className, ...props }) {
15
+ return (_jsx("tfoot", { "data-slot": "table-footer", className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
16
+ }
17
+ function TableRow({ className, ...props }) {
18
+ return (_jsx("tr", { "data-slot": "table-row", className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-selected", className), ...props }));
19
+ }
20
+ function TableHead({ className, ...props }) {
21
+ return (_jsx("th", { "data-slot": "table-head", className: cn("h-12 px-3 text-left align-middle text-xs font-medium tracking-wider whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0", className), ...props }));
22
+ }
23
+ function TableCell({ className, ...props }) {
24
+ return (_jsx("td", { "data-slot": "table-cell", className: cn("p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className), ...props }));
25
+ }
26
+ function TableCaption({ className, ...props }) {
27
+ return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
28
+ }
29
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
package/dist/tabs.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Tabs as TabsPrimitive } from "radix-ui";
4
+ import { tabsListVariants } from "./internal/tabs-styles.js";
5
+ declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
6
+ declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
7
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
8
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
9
+ /**
10
+ * Tab-styled links for a view switcher that changes the URL. Use this, not
11
+ * `Tabs` + `TabsTrigger asChild`, when there are no `TabsContent` panels:
12
+ * tabs would point assistive tech at panels that don't exist.
13
+ */
14
+ declare function TabsNav({ className, children, ...props }: React.ComponentProps<"nav"> & {
15
+ "aria-label": string;
16
+ }): React.JSX.Element;
17
+ export { Tabs, TabsList, TabsTrigger, TabsContent, TabsNav, tabsListVariants };
package/dist/tabs.js ADDED
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import {} from "class-variance-authority";
5
+ import { Tabs as TabsPrimitive } from "radix-ui";
6
+ import { cn } from "./utils.js";
7
+ import { tabsListVariants, tabsTriggerVariants, } from "./internal/tabs-styles.js";
8
+ function Tabs({ className, orientation = "horizontal", ...props }) {
9
+ return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn('group/tabs flex gap-2 data-[orientation="horizontal"]:flex-col', className), ...props }));
10
+ }
11
+ function TabsList({ className, variant = "default", ...props }) {
12
+ return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
13
+ }
14
+ function TabsTrigger({ className, ...props }) {
15
+ return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn(tabsTriggerVariants(), className), ...props }));
16
+ }
17
+ function TabsContent({ className, ...props }) {
18
+ return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
19
+ }
20
+ /**
21
+ * Tab-styled links for a view switcher that changes the URL. Use this, not
22
+ * `Tabs` + `TabsTrigger asChild`, when there are no `TabsContent` panels:
23
+ * tabs would point assistive tech at panels that don't exist.
24
+ */
25
+ function TabsNav({ className, children, ...props }) {
26
+ return (_jsx("nav", { "data-slot": "tabs-nav", "data-orientation": "horizontal", className: cn("group/tabs", className), ...props, children: _jsx("div", { "data-slot": "tabs-list", "data-variant": "default", className: tabsListVariants(), children: children }) }));
27
+ }
28
+ export { Tabs, TabsList, TabsTrigger, TabsContent, TabsNav, tabsListVariants };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "./utils.js";
4
+ function Textarea({ className, ...props }) {
5
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full resize-none rounded-none border border-input bg-background px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
6
+ }
7
+ export { Textarea };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
4
+ import { toggleVariants } from "./toggle.js";
5
+ declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
6
+ spacing?: number;
7
+ orientation?: "horizontal" | "vertical";
8
+ }): React.JSX.Element;
9
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
10
+ export { ToggleGroup, ToggleGroupItem };