@majapisoftwares/ui 6.3.0 → 6.5.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 (81) hide show
  1. package/AGENTS.md +27 -27
  2. package/README.md +79 -79
  3. package/THIRD_PARTY_NOTICES.md +39 -39
  4. package/components.json +25 -25
  5. package/docs/MIGRATION-0.2.md +20 -20
  6. package/docs/MIGRATION-6.0.md +33 -33
  7. package/docs/NEXT-STARTER-VALIDATION.md +14 -14
  8. package/docs/STANDARDS.md +65 -51
  9. package/docs/VALIDATION.md +11 -11
  10. package/docs/VERSIONING.md +32 -28
  11. package/docs/validation/preference-titles.md +22 -22
  12. package/package.json +91 -89
  13. package/scripts/check-standards.mjs +41 -41
  14. package/src/components/ui/accordion.tsx +82 -82
  15. package/src/components/ui/alert-dialog.tsx +187 -187
  16. package/src/components/ui/alert.tsx +77 -77
  17. package/src/components/ui/attachment.tsx +209 -0
  18. package/src/components/ui/avatar.tsx +108 -108
  19. package/src/components/ui/badge.tsx +55 -55
  20. package/src/components/ui/breadcrumb.tsx +125 -125
  21. package/src/components/ui/bubble.tsx +129 -0
  22. package/src/components/ui/button-group.tsx +89 -89
  23. package/src/components/ui/button.tsx +59 -59
  24. package/src/components/ui/card.tsx +101 -101
  25. package/src/components/ui/checkbox.tsx +27 -27
  26. package/src/components/ui/collapsible.tsx +21 -21
  27. package/src/components/ui/context-menu.tsx +271 -271
  28. package/src/components/ui/dialog.tsx +161 -161
  29. package/src/components/ui/dropdown-menu.tsx +271 -271
  30. package/src/components/ui/empty.tsx +105 -105
  31. package/src/components/ui/field.tsx +238 -238
  32. package/src/components/ui/hover-card.tsx +50 -50
  33. package/src/components/ui/input-group.tsx +155 -155
  34. package/src/components/ui/input.tsx +21 -21
  35. package/src/components/ui/item.tsx +203 -0
  36. package/src/components/ui/kbd.tsx +28 -28
  37. package/src/components/ui/label.tsx +19 -19
  38. package/src/components/ui/message-scroller.tsx +166 -0
  39. package/src/components/ui/message.tsx +93 -0
  40. package/src/components/ui/orb.css +1002 -1002
  41. package/src/components/ui/orb.tsx +752 -752
  42. package/src/components/ui/popover.tsx +89 -89
  43. package/src/components/ui/progress.tsx +82 -82
  44. package/src/components/ui/radio-group.tsx +37 -37
  45. package/src/components/ui/scroll-area.tsx +54 -54
  46. package/src/components/ui/select.tsx +204 -204
  47. package/src/components/ui/separator.tsx +24 -24
  48. package/src/components/ui/sheet.tsx +139 -139
  49. package/src/components/ui/sidebar.tsx +1048 -1048
  50. package/src/components/ui/skeleton.tsx +15 -15
  51. package/src/components/ui/slider.tsx +53 -53
  52. package/src/components/ui/sonner.tsx +44 -44
  53. package/src/components/ui/spinner.tsx +32 -32
  54. package/src/components/ui/switch.tsx +31 -31
  55. package/src/components/ui/table.tsx +121 -121
  56. package/src/components/ui/tabs.tsx +81 -81
  57. package/src/components/ui/textarea.tsx +19 -19
  58. package/src/components/ui/toggle-group.tsx +89 -89
  59. package/src/components/ui/toggle.tsx +44 -44
  60. package/src/components/ui/tooltip.tsx +65 -65
  61. package/src/components/ui/trace.tsx +163 -0
  62. package/src/hooks/use-mobile.ts +20 -20
  63. package/src/hooks/use-streamed-text.ts +64 -0
  64. package/src/lib/i18n.tsx +151 -109
  65. package/src/lib/utils.ts +1 -1
  66. package/src/patterns/app-shell.tsx +237 -237
  67. package/src/patterns/chat-markdown.tsx +72 -0
  68. package/src/patterns/chat-trace.tsx +200 -0
  69. package/src/patterns/chat.tsx +317 -0
  70. package/src/patterns/data-table.tsx +2492 -2492
  71. package/src/patterns/filter-tabs.tsx +53 -53
  72. package/src/patterns/majapi-logo.tsx +32 -32
  73. package/src/patterns/page-header.tsx +62 -62
  74. package/src/patterns/prompt-input.tsx +374 -0
  75. package/src/patterns/status-badge.tsx +24 -24
  76. package/src/patterns/user-menu.tsx +218 -218
  77. package/src/patterns/workspace-switcher.tsx +176 -176
  78. package/src/styles.css +170 -165
  79. package/src/templates/admin-dashboard.tsx +44 -44
  80. package/src/templates/auth-layout.tsx +30 -30
  81. package/src/templates/signup-form.tsx +177 -177
@@ -1,59 +1,59 @@
1
- "use client";
2
-
3
- import { Button as ButtonPrimitive } from "@base-ui/react/button";
4
- import { cva, type VariantProps } from "class-variance-authority";
5
- import { cn } from "cn";
6
-
7
- const buttonVariants = cva(
8
- "group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
13
- outline:
14
- "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",
15
- secondary:
16
- "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
17
- ghost:
18
- "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
19
- destructive:
20
- "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default:
25
- "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
26
- xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
27
- sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
28
- lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
29
- icon: "size-9",
30
- "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
31
- "icon-sm": "size-8",
32
- "icon-lg": "size-10",
33
- },
34
- },
35
- defaultVariants: {
36
- variant: "default",
37
- size: "default",
38
- },
39
- },
40
- );
41
-
42
- function Button({
43
- className,
44
- variant = "default",
45
- size = "default",
46
- ...props
47
- }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
48
- return (
49
- <ButtonPrimitive
50
- data-slot="button"
51
- // Avoid accidental form submits; forms opt in with type="submit".
52
- type="button"
53
- className={cn(buttonVariants({ variant, size, className }))}
54
- {...props}
55
- />
56
- );
57
- }
58
-
59
- export { Button, buttonVariants };
1
+ "use client";
2
+
3
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+ import { cn } from "cn";
6
+
7
+ const buttonVariants = cva(
8
+ "group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
13
+ outline:
14
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",
15
+ secondary:
16
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
17
+ ghost:
18
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
19
+ destructive:
20
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ size: {
24
+ default:
25
+ "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
26
+ xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
27
+ sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
28
+ lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
29
+ icon: "size-9",
30
+ "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
31
+ "icon-sm": "size-8",
32
+ "icon-lg": "size-10",
33
+ },
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default",
38
+ },
39
+ },
40
+ );
41
+
42
+ function Button({
43
+ className,
44
+ variant = "default",
45
+ size = "default",
46
+ ...props
47
+ }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
48
+ return (
49
+ <ButtonPrimitive
50
+ data-slot="button"
51
+ // Avoid accidental form submits; forms opt in with type="submit".
52
+ type="button"
53
+ className={cn(buttonVariants({ variant, size, className }))}
54
+ {...props}
55
+ />
56
+ );
57
+ }
58
+
59
+ export { Button, buttonVariants };
@@ -1,101 +1,101 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { cn } from "cn";
5
-
6
- function Card({
7
- className,
8
- size = "default",
9
- ...props
10
- }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
11
- return (
12
- <div
13
- data-slot="card"
14
- data-size={size}
15
- className={cn(
16
- "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-4xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-md ring-1 ring-foreground/5 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] dark:ring-foreground/10 *:[img:first-child]:rounded-t-4xl *:[img:last-child]:rounded-b-4xl",
17
- className,
18
- )}
19
- {...props}
20
- />
21
- );
22
- }
23
-
24
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
25
- return (
26
- <div
27
- data-slot="card-header"
28
- className={cn(
29
- "group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-t-4xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
30
- className,
31
- )}
32
- {...props}
33
- />
34
- );
35
- }
36
-
37
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
38
- return (
39
- <div
40
- data-slot="card-title"
41
- className={cn("font-heading text-base font-medium", className)}
42
- {...props}
43
- />
44
- );
45
- }
46
-
47
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
48
- return (
49
- <div
50
- data-slot="card-description"
51
- className={cn("text-sm text-muted-foreground", className)}
52
- {...props}
53
- />
54
- );
55
- }
56
-
57
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
58
- return (
59
- <div
60
- data-slot="card-action"
61
- className={cn(
62
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
63
- className,
64
- )}
65
- {...props}
66
- />
67
- );
68
- }
69
-
70
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
71
- return (
72
- <div
73
- data-slot="card-content"
74
- className={cn("px-(--card-spacing)", className)}
75
- {...props}
76
- />
77
- );
78
- }
79
-
80
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
81
- return (
82
- <div
83
- data-slot="card-footer"
84
- className={cn(
85
- "flex items-center rounded-b-4xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",
86
- className,
87
- )}
88
- {...props}
89
- />
90
- );
91
- }
92
-
93
- export {
94
- Card,
95
- CardHeader,
96
- CardFooter,
97
- CardTitle,
98
- CardAction,
99
- CardDescription,
100
- CardContent,
101
- };
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { cn } from "cn";
5
+
6
+ function Card({
7
+ className,
8
+ size = "default",
9
+ ...props
10
+ }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
11
+ return (
12
+ <div
13
+ data-slot="card"
14
+ data-size={size}
15
+ className={cn(
16
+ "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-4xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-md ring-1 ring-foreground/5 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] dark:ring-foreground/10 *:[img:first-child]:rounded-t-4xl *:[img:last-child]:rounded-b-4xl",
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
25
+ return (
26
+ <div
27
+ data-slot="card-header"
28
+ className={cn(
29
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-t-4xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
30
+ className,
31
+ )}
32
+ {...props}
33
+ />
34
+ );
35
+ }
36
+
37
+ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
38
+ return (
39
+ <div
40
+ data-slot="card-title"
41
+ className={cn("font-heading text-base font-medium", className)}
42
+ {...props}
43
+ />
44
+ );
45
+ }
46
+
47
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
48
+ return (
49
+ <div
50
+ data-slot="card-description"
51
+ className={cn("text-sm text-muted-foreground", className)}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
58
+ return (
59
+ <div
60
+ data-slot="card-action"
61
+ className={cn(
62
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
63
+ className,
64
+ )}
65
+ {...props}
66
+ />
67
+ );
68
+ }
69
+
70
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
71
+ return (
72
+ <div
73
+ data-slot="card-content"
74
+ className={cn("px-(--card-spacing)", className)}
75
+ {...props}
76
+ />
77
+ );
78
+ }
79
+
80
+ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
81
+ return (
82
+ <div
83
+ data-slot="card-footer"
84
+ className={cn(
85
+ "flex items-center rounded-b-4xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",
86
+ className,
87
+ )}
88
+ {...props}
89
+ />
90
+ );
91
+ }
92
+
93
+ export {
94
+ Card,
95
+ CardHeader,
96
+ CardFooter,
97
+ CardTitle,
98
+ CardAction,
99
+ CardDescription,
100
+ CardContent,
101
+ };
@@ -1,27 +1,27 @@
1
- "use client";
2
-
3
- import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
4
- import { cn } from "cn";
5
- import { CheckIcon } from "lucide-react";
6
-
7
- function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
8
- return (
9
- <CheckboxPrimitive.Root
10
- data-slot="checkbox"
11
- className={cn(
12
- "peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-transparent bg-input/90 transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-transparent after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
13
- className,
14
- )}
15
- {...props}
16
- >
17
- <CheckboxPrimitive.Indicator
18
- data-slot="checkbox-indicator"
19
- className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
20
- >
21
- <CheckIcon />
22
- </CheckboxPrimitive.Indicator>
23
- </CheckboxPrimitive.Root>
24
- );
25
- }
26
-
27
- export { Checkbox };
1
+ "use client";
2
+
3
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
4
+ import { cn } from "cn";
5
+ import { CheckIcon } from "lucide-react";
6
+
7
+ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
8
+ return (
9
+ <CheckboxPrimitive.Root
10
+ data-slot="checkbox"
11
+ className={cn(
12
+ "peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-transparent bg-input/90 transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-transparent after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
13
+ className,
14
+ )}
15
+ {...props}
16
+ >
17
+ <CheckboxPrimitive.Indicator
18
+ data-slot="checkbox-indicator"
19
+ className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
20
+ >
21
+ <CheckIcon />
22
+ </CheckboxPrimitive.Indicator>
23
+ </CheckboxPrimitive.Root>
24
+ );
25
+ }
26
+
27
+ export { Checkbox };
@@ -1,21 +1,21 @@
1
- "use client";
2
-
3
- import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
4
-
5
- function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
6
- return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
7
- }
8
-
9
- function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
10
- return (
11
- <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
12
- );
13
- }
14
-
15
- function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
16
- return (
17
- <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
18
- );
19
- }
20
-
21
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
1
+ "use client";
2
+
3
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
4
+
5
+ function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
6
+ return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
7
+ }
8
+
9
+ function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
10
+ return (
11
+ <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
12
+ );
13
+ }
14
+
15
+ function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
16
+ return (
17
+ <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
18
+ );
19
+ }
20
+
21
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };