@exegia/corpora-ui 0.10.0 → 0.11.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 (65) hide show
  1. package/dist-lib/components/agents/ai-sidebar.d.ts +2 -0
  2. package/dist-lib/components/agents/index.d.ts +12 -0
  3. package/dist-lib/components/agents/marquee-label.d.ts +4 -0
  4. package/dist-lib/components/agents/sidebar-icon.d.ts +2 -0
  5. package/dist-lib/components/agents/sidebar-row.d.ts +2 -0
  6. package/dist-lib/components/agents/type.d.ts +77 -0
  7. package/dist-lib/components/agents/use-ai-sidebar.d.ts +31 -0
  8. package/dist-lib/components/agents/utils.d.ts +16 -0
  9. package/dist-lib/components/beste/piece/browser-frame.d.ts +2 -0
  10. package/dist-lib/components/beste/piece/type.d.ts +9 -0
  11. package/dist-lib/components/beste/piece/utils.d.ts +3 -0
  12. package/dist-lib/components/blocks/auth/signup-block.d.ts +5 -5
  13. package/dist-lib/components/blocks/nav/sidebar-block.d.ts +3 -56
  14. package/dist-lib/components/blocks/nav/sidebar-nav-row.d.ts +3 -0
  15. package/dist-lib/components/blocks/nav/types.d.ts +60 -0
  16. package/dist-lib/components/blocks/nav/utils.d.ts +1 -0
  17. package/dist-lib/components/blocks/profile/profile-card-block.d.ts +6 -1
  18. package/dist-lib/components/blocks/shell/index.d.ts +1 -0
  19. package/dist-lib/components/blocks/shell/shell-layout.d.ts +3 -0
  20. package/dist-lib/components/blocks/shell/type.d.ts +26 -0
  21. package/dist-lib/components/blocks/shell/utils.d.ts +1 -0
  22. package/dist-lib/components/composed/social-providers.d.ts +9 -1
  23. package/dist-lib/components/docs/demo-controls.d.ts +4 -4
  24. package/dist-lib/components/motion/animated-sidebar.d.ts +12 -1
  25. package/dist-lib/components/motion/popover-morph.d.ts +35 -0
  26. package/dist-lib/components/motion/popover-position.d.ts +15 -0
  27. package/dist-lib/components/ui/badge.d.ts +7 -0
  28. package/dist-lib/components/ui/select.d.ts +30 -0
  29. package/dist-lib/index.d.ts +1 -0
  30. package/dist-lib/index.js +644 -524
  31. package/dist-lib/index.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/components/agents/ai-sidebar.tsx +116 -0
  34. package/src/components/agents/index.ts +14 -0
  35. package/src/components/agents/marquee-label.tsx +59 -0
  36. package/src/components/agents/sidebar-icon.tsx +14 -0
  37. package/src/components/agents/sidebar-row.tsx +271 -0
  38. package/src/components/agents/type.ts +89 -0
  39. package/src/components/agents/use-ai-sidebar.ts +386 -0
  40. package/src/components/agents/utils.ts +142 -0
  41. package/src/components/beste/piece/browser-frame.tsx +55 -0
  42. package/src/components/beste/piece/type.ts +11 -0
  43. package/src/components/beste/piece/utils.ts +21 -0
  44. package/src/components/blocks/auth/linked-accounts-block.tsx +55 -57
  45. package/src/components/blocks/auth/passkey-manager-block.tsx +88 -81
  46. package/src/components/blocks/auth/signup-block.tsx +6 -6
  47. package/src/components/blocks/nav/sidebar-block.tsx +25 -155
  48. package/src/components/blocks/nav/sidebar-nav-row.tsx +79 -0
  49. package/src/components/blocks/nav/types.ts +65 -0
  50. package/src/components/blocks/nav/utils.ts +4 -0
  51. package/src/components/blocks/profile/profile-card-block.tsx +17 -6
  52. package/src/components/blocks/shell/index.ts +1 -0
  53. package/src/components/blocks/shell/shell-layout.tsx +115 -0
  54. package/src/components/blocks/shell/type.ts +50 -0
  55. package/src/components/blocks/shell/utils.ts +2 -0
  56. package/src/components/composed/social-providers.tsx +83 -27
  57. package/src/components/docs/component-preview.tsx +13 -12
  58. package/src/components/docs/demo-controls.tsx +37 -21
  59. package/src/components/motion/animated-sidebar.tsx +392 -364
  60. package/src/components/motion/popover-morph.tsx +292 -0
  61. package/src/components/motion/popover-position.ts +86 -0
  62. package/src/components/ui/badge.tsx +52 -0
  63. package/src/components/ui/select.tsx +257 -0
  64. package/src/index.css +18 -0
  65. package/src/index.ts +1 -0
@@ -1,46 +1,99 @@
1
- "use client";
1
+ "use client"
2
2
 
3
3
  import {
4
4
  RiAppleFill,
5
5
  RiGithubFill,
6
6
  RiGoogleFill,
7
7
  RiTwitterXFill,
8
- } from "@remixicon/react";
9
- import type * as React from "react";
8
+ } from "@remixicon/react"
9
+ import type * as React from "react"
10
10
 
11
- import { Button } from "@/components/ui/button";
12
- import { cn } from "@/lib/utils";
11
+ import { Button } from "@/components/ui/button"
12
+ import { cn } from "@/lib/utils"
13
13
 
14
- export type SocialProvider = "google" | "apple" | "github" | "x";
14
+ export type SocialProvider = "google" | "apple" | "github" | "x"
15
15
 
16
- /** Label + brand mark per provider, shared with the auth blocks. */
16
+ /** Google's four-color "G" — the only provider whose mark isn't monochrome. */
17
+ function GoogleColorIcon(props: React.SVGProps<SVGSVGElement>) {
18
+ return (
19
+ <svg viewBox="0 0 24 24" fill="none" {...props}>
20
+ <path
21
+ fill="#4285F4"
22
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.76h3.56c2.09-1.92 3.28-4.74 3.28-8.09Z"
23
+ />
24
+ <path
25
+ fill="#34A853"
26
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.56-2.76c-.99.66-2.25 1.05-3.72 1.05-2.86 0-5.28-1.93-6.15-4.53H2.18v2.85A11 11 0 0 0 12 23Z"
27
+ />
28
+ <path
29
+ fill="#FBBC05"
30
+ d="M5.85 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.35-2.1V7.05H2.18a11 11 0 0 0 0 9.9l3.67-2.85Z"
31
+ />
32
+ <path
33
+ fill="#EA4335"
34
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15A11 11 0 0 0 2.18 7.05L5.85 9.9C6.72 7.3 9.14 5.38 12 5.38Z"
35
+ />
36
+ </svg>
37
+ )
38
+ }
39
+
40
+ /**
41
+ * Label + brand mark per provider, shared with the auth blocks. `Icon` is the
42
+ * monochrome mark that inherits the current text color; `BrandIcon` +
43
+ * `brandClassName` render it in the provider's own colors.
44
+ */
17
45
  export const SOCIAL_PROVIDERS: Record<
18
46
  SocialProvider,
19
- { label: string; Icon: React.ComponentType<{ className?: string }> }
47
+ {
48
+ label: string
49
+ Icon: React.ComponentType<{ className?: string }>
50
+ BrandIcon: React.ComponentType<{ className?: string }>
51
+ brandClassName: string
52
+ }
20
53
  > = {
21
- google: { label: "Google", Icon: RiGoogleFill },
22
- apple: { label: "Apple", Icon: RiAppleFill },
23
- github: { label: "GitHub", Icon: RiGithubFill },
24
- x: { label: "X", Icon: RiTwitterXFill },
25
- };
54
+ google: {
55
+ label: "Google",
56
+ Icon: RiGoogleFill,
57
+ BrandIcon: GoogleColorIcon,
58
+ brandClassName: "",
59
+ },
60
+ apple: {
61
+ label: "Apple",
62
+ Icon: RiAppleFill,
63
+ BrandIcon: RiAppleFill,
64
+ brandClassName: "text-foreground",
65
+ },
66
+ github: {
67
+ label: "GitHub",
68
+ Icon: RiGithubFill,
69
+ BrandIcon: RiGithubFill,
70
+ brandClassName: "text-foreground",
71
+ },
72
+ x: {
73
+ label: "X",
74
+ Icon: RiTwitterXFill,
75
+ BrandIcon: RiTwitterXFill,
76
+ brandClassName: "text-foreground",
77
+ },
78
+ }
26
79
 
27
80
  const ACTION_LABELS = {
28
81
  login: "Login with",
29
82
  signup: "Sign up with",
30
83
  continue: "Continue with",
31
- } as const;
84
+ } as const
32
85
 
33
86
  export interface SocialProvidersProps {
34
- providers?: SocialProvider[];
87
+ providers?: SocialProvider[]
35
88
  /** Verb used in the stacked layout labels. */
36
- action?: keyof typeof ACTION_LABELS;
89
+ action?: keyof typeof ACTION_LABELS
37
90
  /** "stack" = full-width labeled buttons; "row" = icon-only buttons. */
38
- layout?: "stack" | "row";
91
+ layout?: "stack" | "row"
39
92
  /** Shows the matching button in its loading state and disables the rest. */
40
- loadingProvider?: SocialProvider | null;
41
- disabled?: boolean;
42
- onSelect?: (provider: SocialProvider) => void;
43
- className?: string;
93
+ loadingProvider?: SocialProvider | null
94
+ disabled?: boolean
95
+ onSelect?: (provider: SocialProvider) => void
96
+ className?: string
44
97
  }
45
98
 
46
99
  /** Social auth buttons (coss particle p-button-38). UI only — wire onSelect. */
@@ -53,18 +106,18 @@ export function SocialProviders({
53
106
  onSelect,
54
107
  className,
55
108
  }: SocialProvidersProps) {
56
- const row = layout === "row";
109
+ const row = layout === "row"
57
110
 
58
111
  return (
59
112
  <div
60
113
  className={cn(
61
114
  "flex w-full gap-2",
62
115
  row ? "flex-row justify-center" : "flex-col",
63
- className,
116
+ className
64
117
  )}
65
118
  >
66
119
  {providers.map((provider) => {
67
- const { label, Icon } = SOCIAL_PROVIDERS[provider];
120
+ const { label, Icon } = SOCIAL_PROVIDERS[provider]
68
121
  return (
69
122
  <Button
70
123
  key={provider}
@@ -73,7 +126,10 @@ export function SocialProviders({
73
126
  className={row ? undefined : "w-full"}
74
127
  aria-label={`${ACTION_LABELS[action]} ${label}`}
75
128
  loading={loadingProvider === provider}
76
- disabled={disabled || (loadingProvider !== null && loadingProvider !== provider)}
129
+ disabled={
130
+ disabled ||
131
+ (loadingProvider !== null && loadingProvider !== provider)
132
+ }
77
133
  onClick={() => onSelect?.(provider)}
78
134
  >
79
135
  <Icon aria-hidden="true" />
@@ -83,8 +139,8 @@ export function SocialProviders({
83
139
  </span>
84
140
  )}
85
141
  </Button>
86
- );
142
+ )
87
143
  })}
88
144
  </div>
89
- );
145
+ )
90
146
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from "react"
2
2
 
3
+ import { BrowserFrame } from "@/components/beste/piece/browser-frame"
3
4
  import type { RegistryEntry } from "@/registry"
4
5
 
5
6
  /**
@@ -11,18 +12,18 @@ export function ComponentPreview({ entry }: { entry: RegistryEntry }) {
11
12
  const Demo = entry.preview
12
13
 
13
14
  return (
14
- <div className="flex min-h-48 items-center justify-center rounded-lg border p-8">
15
+ <BrowserFrame title={entry.name} titleStyle="hidden">
15
16
  {Demo ? (
16
- <React.Suspense
17
- fallback={<p className="text-sm text-muted-foreground">Loading…</p>}
18
- >
19
- <Demo />
20
- </React.Suspense>
21
- ) : (
22
- <p className="text-sm text-muted-foreground">
23
- Preview coming soon ({entry.status}).
24
- </p>
25
- )}
26
- </div>
17
+ <React.Suspense
18
+ fallback={<p className="text-sm text-muted-foreground">Loading…</p>}
19
+ >
20
+ <Demo />
21
+ </React.Suspense>
22
+ ) : (
23
+ <p className="text-sm text-muted-foreground">
24
+ Preview coming soon ({entry.status}).
25
+ </p>
26
+ )}
27
+ </BrowserFrame>
27
28
  )
28
29
  }
@@ -1,8 +1,17 @@
1
1
  import type * as React from "react"
2
2
 
3
+ import {
4
+ Select,
5
+ SelectItem,
6
+ SelectTrigger,
7
+ SelectValue,
8
+ SelectContent} from "@/components/ui/select"
9
+ import { Field, FieldLabel } from "@/components/ui/field"
10
+ import { Card , CardContent} from "@/components/ui/card";
11
+
3
12
  /**
4
- * Lightweight playground controls for registry demos. Plain native elements
5
- * on purpose — docs-only, never part of the published library.
13
+ * Lightweight playground controls for registry demos — docs-only, never
14
+ * part of the published library.
6
15
  */
7
16
 
8
17
  export function DemoSelect<T extends string>({
@@ -11,26 +20,33 @@ export function DemoSelect<T extends string>({
11
20
  options,
12
21
  onChange,
13
22
  }: {
14
- label: string
23
+ label?: string
15
24
  value: T
16
25
  options: readonly T[]
17
26
  onChange: (value: T) => void
18
27
  }) {
28
+ const items = options.map((option) => ({ label: option, value: option }))
29
+
19
30
  return (
20
- <label className="flex flex-col gap-1 text-xs text-muted-foreground">
21
- {label}
22
- <select
31
+ <Field className="flex flex-col gap-1 text-xs text-muted-foreground">
32
+ {label && <FieldLabel>{label}</FieldLabel>}
33
+ <Select
34
+ items={items}
35
+ onValueChange={(next) => onChange(next as T)}
23
36
  value={value}
24
- onChange={(event) => onChange(event.target.value as T)}
25
- className="h-7 rounded-md border bg-background px-2 text-xs text-foreground"
26
37
  >
27
- {options.map((option) => (
28
- <option key={option} value={option}>
29
- {option}
30
- </option>
31
- ))}
32
- </select>
33
- </label>
38
+ <SelectTrigger className="h-7 min-w-0 text-xs capitalize rounded-sm " size="sm">
39
+ <SelectValue />
40
+ </SelectTrigger>
41
+ <SelectContent>
42
+ {items.map((item) => (
43
+ <SelectItem key={item.value} value={item.value}>
44
+ {item.label}
45
+ </SelectItem>
46
+ ))}
47
+ </SelectContent>
48
+ </Select>
49
+ </Field>
34
50
  )
35
51
  }
36
52
 
@@ -96,23 +112,23 @@ export function DemoStage({
96
112
  children,
97
113
  canvasClassName,
98
114
  }: {
99
- controls: React.ReactNode
115
+ controls?: React.ReactNode
100
116
  children: React.ReactNode
101
117
  canvasClassName?: string
102
118
  }) {
103
119
  return (
104
- <div className="flex w-full flex-col items-center gap-6">
120
+ <div className="relative flex w-full flex-col items-center">
121
+ {controls && <Card className="absolute top-3 right-3 z-20 rounded-xl shadow-lg">
122
+ <CardContent className="flex flex-row items-center gap-x-2">{controls}</CardContent>
123
+ </Card>}
105
124
  <div
106
125
  className={
107
126
  canvasClassName ??
108
- "flex min-h-28 w-full items-center justify-center rounded-lg"
127
+ "flex min-h-32 w-full items-center justify-center rounded-lg"
109
128
  }
110
129
  >
111
130
  {children}
112
131
  </div>
113
- <div className="flex flex-wrap items-end justify-center gap-x-4 gap-y-3">
114
- {controls}
115
- </div>
116
132
  </div>
117
133
  )
118
134
  }