@exegia/corpora-ui 0.19.0 → 0.21.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 (162) hide show
  1. package/dist-lib/components/blocks/auth/__tests__/auth-state-atom.test.d.ts +1 -0
  2. package/dist-lib/components/blocks/auth/auth-flow-atom.d.ts +77 -0
  3. package/dist-lib/components/blocks/auth/auth-session-atom.d.ts +28 -0
  4. package/dist-lib/components/blocks/auth/auth-state-type.d.ts +71 -0
  5. package/dist-lib/components/blocks/auth/auth-state.d.ts +9 -0
  6. package/dist-lib/components/blocks/auth/use-auth-state.d.ts +52 -0
  7. package/dist-lib/components/blocks/nav/sidebar/__tests__/ai-sidebar-atom.test.d.ts +1 -0
  8. package/dist-lib/components/blocks/nav/sidebar/__tests__/use-ai-sidebar.test.d.ts +1 -0
  9. package/dist-lib/components/blocks/nav/sidebar/ai-sidebar-atom.d.ts +217 -0
  10. package/dist-lib/components/blocks/nav/sidebar/ai-sidebar.d.ts +11 -2
  11. package/dist-lib/components/blocks/nav/sidebar/index.d.ts +3 -1
  12. package/dist-lib/components/blocks/nav/sidebar/sidebar-context.d.ts +3 -0
  13. package/dist-lib/components/blocks/nav/sidebar/sidebar-row.d.ts +3 -1
  14. package/dist-lib/components/blocks/nav/sidebar/type.d.ts +191 -29
  15. package/dist-lib/components/blocks/nav/sidebar/use-ai-sidebar-state.d.ts +29 -0
  16. package/dist-lib/components/blocks/nav/sidebar/use-ai-sidebar.d.ts +27 -31
  17. package/dist-lib/components/blocks/nav/sidebar/utils.d.ts +6 -1
  18. package/dist-lib/components/blocks/profile/index.d.ts +7 -0
  19. package/dist-lib/components/blocks/profile/profile-card-atom.d.ts +68 -0
  20. package/dist-lib/components/blocks/profile/profile-card-block.d.ts +28 -39
  21. package/dist-lib/components/blocks/profile/type.d.ts +80 -0
  22. package/dist-lib/components/blocks/profile/use-profile-card-state.d.ts +24 -0
  23. package/dist-lib/components/blocks/profile/use-profile-card.d.ts +34 -0
  24. package/dist-lib/components/blocks/scaffold/constants.d.ts +5 -0
  25. package/dist-lib/components/blocks/scaffold/scaffold-canvas.d.ts +2 -0
  26. package/dist-lib/components/blocks/scaffold/scaffold-panel.d.ts +1 -1
  27. package/dist-lib/components/blocks/scaffold/scaffold-tab.d.ts +6 -1
  28. package/dist-lib/components/blocks/scaffold/type.d.ts +28 -0
  29. package/dist-lib/components/blocks/scaffold/use-panel-visibility.d.ts +19 -0
  30. package/dist-lib/components/blocks/scaffold/utils.d.ts +6 -0
  31. package/dist-lib/components/blocks/shell/__tests__/shell-fit-atom.test.d.ts +1 -0
  32. package/dist-lib/components/blocks/shell/__tests__/shell-metrics.test.d.ts +1 -0
  33. package/dist-lib/components/blocks/shell/animated-panel-provider.d.ts +1 -1
  34. package/dist-lib/components/blocks/shell/animated-panel.d.ts +1 -1
  35. package/dist-lib/components/blocks/shell/index.d.ts +4 -0
  36. package/dist-lib/components/blocks/shell/shell-fit-atom.d.ts +68 -0
  37. package/dist-lib/components/blocks/shell/shell-metrics.d.ts +54 -0
  38. package/dist-lib/components/blocks/shell/type.d.ts +115 -3
  39. package/dist-lib/components/blocks/shell/use-shell-fit-state.d.ts +25 -0
  40. package/dist-lib/components/blocks/shell/use-shell-fit.d.ts +14 -0
  41. package/dist-lib/components/blocks/shell/use-shell-panels.d.ts +12 -1
  42. package/dist-lib/components/blocks/shell/utils.d.ts +32 -0
  43. package/dist-lib/components/composed/tree/__tests__/tree-atom.test.d.ts +1 -0
  44. package/dist-lib/components/composed/tree/__tests__/tree.test.d.ts +1 -0
  45. package/dist-lib/components/composed/tree/__tests__/use-tree.test.d.ts +1 -0
  46. package/dist-lib/components/composed/tree/constants.d.ts +35 -0
  47. package/dist-lib/components/composed/tree/index.d.ts +6 -0
  48. package/dist-lib/components/composed/tree/tree-atom.d.ts +160 -0
  49. package/dist-lib/components/composed/tree/tree-context.d.ts +4 -0
  50. package/dist-lib/components/composed/tree/tree-node.d.ts +12 -0
  51. package/dist-lib/components/composed/tree/tree.d.ts +19 -0
  52. package/dist-lib/components/composed/tree/type.d.ts +290 -0
  53. package/dist-lib/components/composed/tree/use-tree-dnd.d.ts +18 -0
  54. package/dist-lib/components/composed/tree/use-tree-state.d.ts +25 -0
  55. package/dist-lib/components/composed/tree/use-tree.d.ts +24 -0
  56. package/dist-lib/components/composed/tree/utils.d.ts +28 -0
  57. package/dist-lib/components/composed/user-avatar.d.ts +5 -28
  58. package/dist-lib/components/user-avatar/__tests__/user-avatar.test.d.ts +1 -0
  59. package/dist-lib/components/user-avatar/audio-wave.d.ts +2 -0
  60. package/dist-lib/components/user-avatar/component.d.ts +3 -0
  61. package/dist-lib/components/user-avatar/fallback.d.ts +5 -0
  62. package/dist-lib/components/user-avatar/index.d.ts +18 -0
  63. package/dist-lib/components/user-avatar/presence-badge.d.ts +16 -0
  64. package/dist-lib/components/user-avatar/type.d.ts +71 -0
  65. package/dist-lib/components/user-avatar/use-user-avatar-state.d.ts +26 -0
  66. package/dist-lib/components/user-avatar/use-user-avatar.d.ts +32 -0
  67. package/dist-lib/components/user-avatar/user-avatar-atom.d.ts +55 -0
  68. package/dist-lib/components/user-avatar/utils.d.ts +2 -0
  69. package/dist-lib/index.d.ts +6 -2
  70. package/dist-lib/index.js +3576 -1366
  71. package/dist-lib/index.js.map +1 -1
  72. package/dist-lib/state/exegia-provider.d.ts +51 -0
  73. package/dist-lib/state/index.d.ts +4 -0
  74. package/dist-lib/state/store.d.ts +17 -0
  75. package/package.json +16 -12
  76. package/src/components/beste/piece/browser-frame.tsx +9 -6
  77. package/src/components/blocks/auth/__tests__/auth-state-atom.test.tsx +247 -0
  78. package/src/components/blocks/auth/auth-flow-atom.ts +238 -0
  79. package/src/components/blocks/auth/auth-session-atom.ts +82 -0
  80. package/src/components/blocks/auth/auth-state-type.ts +97 -0
  81. package/src/components/blocks/auth/auth-state.ts +52 -0
  82. package/src/components/blocks/auth/use-auth-state.ts +127 -0
  83. package/src/components/blocks/nav/sidebar/__tests__/ai-sidebar-atom.test.tsx +325 -0
  84. package/src/components/blocks/nav/sidebar/__tests__/use-ai-sidebar.test.tsx +310 -0
  85. package/src/components/blocks/nav/sidebar/ai-sidebar-atom.ts +698 -0
  86. package/src/components/blocks/nav/sidebar/ai-sidebar.tsx +112 -76
  87. package/src/components/blocks/nav/sidebar/index.ts +53 -1
  88. package/src/components/blocks/nav/sidebar/sidebar-context.ts +15 -0
  89. package/src/components/blocks/nav/sidebar/sidebar-row.tsx +119 -50
  90. package/src/components/blocks/nav/sidebar/type.ts +228 -29
  91. package/src/components/blocks/nav/sidebar/use-ai-sidebar-state.ts +123 -0
  92. package/src/components/blocks/nav/sidebar/use-ai-sidebar.ts +455 -225
  93. package/src/components/blocks/nav/sidebar/utils.ts +29 -1
  94. package/src/components/blocks/profile/__tests__/profile-card-block.test.tsx +194 -0
  95. package/src/components/blocks/profile/index.ts +28 -0
  96. package/src/components/blocks/profile/profile-card-atom.ts +247 -0
  97. package/src/components/blocks/profile/profile-card-block.tsx +153 -74
  98. package/src/components/blocks/profile/type.ts +95 -0
  99. package/src/components/blocks/profile/use-profile-card-state.ts +67 -0
  100. package/src/components/blocks/profile/use-profile-card.ts +126 -0
  101. package/src/components/blocks/scaffold/__tests__/scaffold.test.tsx +160 -1
  102. package/src/components/blocks/scaffold/constants.ts +7 -0
  103. package/src/components/blocks/scaffold/panel-menu-button.tsx +3 -0
  104. package/src/components/blocks/scaffold/scaffold-canvas.tsx +48 -5
  105. package/src/components/blocks/scaffold/scaffold-inspector.tsx +3 -2
  106. package/src/components/blocks/scaffold/scaffold-main.tsx +1 -1
  107. package/src/components/blocks/scaffold/scaffold-panel.tsx +41 -5
  108. package/src/components/blocks/scaffold/scaffold-root.tsx +18 -3
  109. package/src/components/blocks/scaffold/scaffold-sidebar.tsx +1 -1
  110. package/src/components/blocks/scaffold/scaffold-tab.tsx +45 -7
  111. package/src/components/blocks/scaffold/type.ts +28 -0
  112. package/src/components/blocks/scaffold/use-panel-visibility.ts +180 -0
  113. package/src/components/blocks/scaffold/utils.ts +19 -0
  114. package/src/components/blocks/shell/__tests__/shell-fit-atom.test.tsx +360 -0
  115. package/src/components/blocks/shell/__tests__/shell-layout.test.tsx +192 -3
  116. package/src/components/blocks/shell/__tests__/shell-metrics.test.ts +108 -0
  117. package/src/components/blocks/shell/animated-panel-inset.tsx +5 -1
  118. package/src/components/blocks/shell/animated-panel-provider.tsx +77 -11
  119. package/src/components/blocks/shell/animated-panel-trigger.tsx +4 -0
  120. package/src/components/blocks/shell/animated-panel.tsx +126 -29
  121. package/src/components/blocks/shell/index.ts +18 -0
  122. package/src/components/blocks/shell/shell-fit-atom.ts +243 -0
  123. package/src/components/blocks/shell/shell-layout.tsx +55 -53
  124. package/src/components/blocks/shell/shell-metrics.ts +79 -0
  125. package/src/components/blocks/shell/type.ts +130 -3
  126. package/src/components/blocks/shell/use-shell-fit-state.ts +49 -0
  127. package/src/components/blocks/shell/use-shell-fit.ts +135 -0
  128. package/src/components/blocks/shell/use-shell-panels.ts +57 -4
  129. package/src/components/blocks/shell/utils.ts +44 -4
  130. package/src/components/composed/tree/CLAUDE.md +132 -0
  131. package/src/components/composed/tree/__tests__/tree-atom.test.tsx +217 -0
  132. package/src/components/composed/tree/__tests__/tree.test.tsx +525 -0
  133. package/src/components/composed/tree/__tests__/use-tree.test.tsx +333 -0
  134. package/src/components/composed/tree/constants.ts +60 -0
  135. package/src/components/composed/tree/index.ts +51 -0
  136. package/src/components/composed/tree/tree-atom.ts +590 -0
  137. package/src/components/composed/tree/tree-context.ts +13 -0
  138. package/src/components/composed/tree/tree-node.tsx +490 -0
  139. package/src/components/composed/tree/tree.tsx +286 -0
  140. package/src/components/composed/tree/type.ts +322 -0
  141. package/src/components/composed/tree/use-tree-dnd.ts +179 -0
  142. package/src/components/composed/tree/use-tree-state.ts +105 -0
  143. package/src/components/composed/tree/use-tree.ts +307 -0
  144. package/src/components/composed/tree/utils.ts +172 -0
  145. package/src/components/composed/user-avatar.tsx +11 -96
  146. package/src/components/docs/component-preview.tsx +11 -11
  147. package/src/components/user-avatar/__tests__/user-avatar.test.tsx +245 -0
  148. package/src/components/user-avatar/audio-wave.tsx +22 -0
  149. package/src/components/user-avatar/component.tsx +152 -0
  150. package/src/components/user-avatar/fallback.tsx +26 -0
  151. package/src/components/user-avatar/index.ts +34 -0
  152. package/src/components/user-avatar/presence-badge.tsx +56 -0
  153. package/src/components/user-avatar/type.ts +85 -0
  154. package/src/components/user-avatar/use-user-avatar-state.ts +60 -0
  155. package/src/components/user-avatar/use-user-avatar.ts +144 -0
  156. package/src/components/user-avatar/user-avatar-atom.ts +198 -0
  157. package/src/components/user-avatar/utils.ts +8 -0
  158. package/src/index.css +211 -153
  159. package/src/index.ts +35 -2
  160. package/src/state/exegia-provider.tsx +79 -0
  161. package/src/state/index.ts +4 -0
  162. package/src/state/store.ts +19 -0
@@ -0,0 +1,198 @@
1
+ /**
2
+ * User avatar state — Jotai atom families keyed by an avatar id.
3
+ *
4
+ * Follows the tree's layout (`components/composed/tree/tree-atom.ts`): one
5
+ * in-house `keyed()` family per field, write-only action atoms for every
6
+ * mutation, a composed read-only state atom, and `removeUserAvatarInstance`
7
+ * to drop an id from every family. Nothing here touches the DOM — the
8
+ * pointer maths that feeds `bezelAngle` lives in `use-user-avatar.ts`.
9
+ */
10
+
11
+ import { atom } from "jotai"
12
+ import type { Getter, Setter } from "jotai"
13
+
14
+ import type {
15
+ ImageStatus,
16
+ UserAvatarConfig,
17
+ UserAvatarInstanceId,
18
+ UserAvatarState,
19
+ UserPresence,
20
+ } from "./type"
21
+
22
+ /** Light from the top-left, the classic emboss, until a pointer moves. */
23
+ export const DEFAULT_BEZEL_ANGLE = 315
24
+
25
+ const DEFAULT_CONFIG: UserAvatarConfig = { controlsPresence: false }
26
+
27
+ // ── families ───────────────────────────────────────────────────────────────
28
+
29
+ type Family<AtomType> = ((id: UserAvatarInstanceId) => AtomType) & {
30
+ remove: (id: UserAvatarInstanceId) => void
31
+ }
32
+
33
+ const families: { remove: (id: UserAvatarInstanceId) => void }[] = []
34
+
35
+ function keyed<AtomType>(create: (id: UserAvatarInstanceId) => AtomType) {
36
+ const cache = new Map<UserAvatarInstanceId, AtomType>()
37
+ const family = ((id: UserAvatarInstanceId) => {
38
+ let instance = cache.get(id)
39
+ if (instance === undefined) {
40
+ instance = create(id)
41
+ cache.set(id, instance)
42
+ }
43
+ return instance
44
+ }) as Family<AtomType>
45
+ family.remove = (id: UserAvatarInstanceId) => {
46
+ cache.delete(id)
47
+ }
48
+ families.push(family)
49
+ return family
50
+ }
51
+
52
+ function stateFamily<Value>(name: string, initialValue: Value) {
53
+ return keyed((id) => {
54
+ const instance = atom(initialValue)
55
+ instance.debugLabel = `userAvatar/${id}/${name}`
56
+ return instance
57
+ })
58
+ }
59
+
60
+ function readFamily<Value>(
61
+ name: string,
62
+ read: (get: Getter, id: UserAvatarInstanceId) => Value
63
+ ) {
64
+ return keyed((id) => {
65
+ const instance = atom((get) => read(get, id))
66
+ instance.debugLabel = `userAvatar/${id}/${name}`
67
+ return instance
68
+ })
69
+ }
70
+
71
+ function actionFamily<Args extends unknown[]>(
72
+ name: string,
73
+ write: (
74
+ get: Getter,
75
+ set: Setter,
76
+ id: UserAvatarInstanceId,
77
+ ...args: Args
78
+ ) => void
79
+ ) {
80
+ return keyed((id) => {
81
+ const instance = atom(null, (get, set, ...args: Args) =>
82
+ write(get, set, id, ...args)
83
+ )
84
+ instance.debugLabel = `userAvatar/${id}/${name}`
85
+ return instance
86
+ })
87
+ }
88
+
89
+ // ── primitives ─────────────────────────────────────────────────────────────
90
+
91
+ /** `null` = no badge. */
92
+ export const userAvatarPresenceAtom = stateFamily<UserPresence | null>(
93
+ "presence",
94
+ null
95
+ )
96
+
97
+ /** Degrees clockwise from 12 o'clock — where the bezel highlight sits. */
98
+ export const userAvatarBezelAngleAtom = stateFamily<number>(
99
+ "bezelAngle",
100
+ DEFAULT_BEZEL_ANGLE
101
+ )
102
+
103
+ export const userAvatarImageStatusAtom = stateFamily<ImageStatus>(
104
+ "imageStatus",
105
+ "idle"
106
+ )
107
+
108
+ /** @internal Which fields the mounted component controls from props. */
109
+ export const userAvatarConfigAtom = stateFamily<UserAvatarConfig>(
110
+ "config",
111
+ DEFAULT_CONFIG
112
+ )
113
+
114
+ // ── derived ────────────────────────────────────────────────────────────────
115
+
116
+ export const userAvatarIsOnlineAtom = readFamily(
117
+ "isOnline",
118
+ (get, id) => get(userAvatarPresenceAtom(id)) === "online"
119
+ )
120
+
121
+ /** Whole-state read for callers that want the object; field atoms above are
122
+ * cheaper for components that watch one thing. */
123
+ export const userAvatarStateAtom = readFamily<UserAvatarState>(
124
+ "state",
125
+ (get, id) => ({
126
+ presence: get(userAvatarPresenceAtom(id)),
127
+ bezelAngle: get(userAvatarBezelAngleAtom(id)),
128
+ imageStatus: get(userAvatarImageStatusAtom(id)),
129
+ })
130
+ )
131
+
132
+ // ── actions ────────────────────────────────────────────────────────────────
133
+
134
+ /** Inert while a `presence` prop controls the avatar — the prop is truth. */
135
+ export const setUserAvatarPresenceAtom = actionFamily<
136
+ [presence: UserPresence | null]
137
+ >("setPresence", (get, set, id, presence) => {
138
+ if (get(userAvatarConfigAtom(id)).controlsPresence) return
139
+ set(userAvatarPresenceAtom(id), presence)
140
+ })
141
+
142
+ /** online ⇄ offline; a badge-less avatar comes online. */
143
+ export const toggleUserAvatarPresenceAtom = actionFamily<[]>(
144
+ "togglePresence",
145
+ (get, set, id) => {
146
+ const next = get(userAvatarPresenceAtom(id)) === "online" ? "offline" : "online"
147
+ set(setUserAvatarPresenceAtom(id), next)
148
+ }
149
+ )
150
+
151
+ /** Stored as given — continuous, not wrapped into [0, 360): the rim is
152
+ * rotated with a CSS transition, and an unwrapped angle is what lets a
153
+ * 359° → 1° move take the short way round. Written on every pointer frame,
154
+ * so it stays a bare set — no config gate, no side effects. */
155
+ export const setUserAvatarBezelAngleAtom = actionFamily<[angle: number]>(
156
+ "setBezelAngle",
157
+ (_get, set, id, angle) => {
158
+ if (!Number.isFinite(angle)) return
159
+ set(userAvatarBezelAngleAtom(id), angle)
160
+ }
161
+ )
162
+
163
+ /** @internal Reported by the image element; drives the skeleton. */
164
+ export const setUserAvatarImageStatusAtom = actionFamily<[status: ImageStatus]>(
165
+ "setImageStatus",
166
+ (_get, set, id, status) => {
167
+ set(userAvatarImageStatusAtom(id), status)
168
+ }
169
+ )
170
+
171
+ /** @internal Projection of the mounted component's controlled props. */
172
+ export const projectUserAvatarPropsAtom = actionFamily<
173
+ [config: UserAvatarConfig, presence: UserPresence | null | undefined]
174
+ >("projectProps", (get, set, id, config, presence) => {
175
+ const wasControlled = get(userAvatarConfigAtom(id)).controlsPresence
176
+ set(userAvatarConfigAtom(id), config)
177
+ if (config.controlsPresence) set(userAvatarPresenceAtom(id), presence ?? null)
178
+ // Releasing control (`presence` prop → undefined) clears the badge rather
179
+ // than leaving the last projected value stranded in the store — going
180
+ // from "online" to no presence is a real transition for a user object.
181
+ else if (wasControlled) set(userAvatarPresenceAtom(id), null)
182
+ })
183
+
184
+ export const resetUserAvatarAtom = actionFamily<[]>(
185
+ "reset",
186
+ (_get, set, id) => {
187
+ set(userAvatarPresenceAtom(id), null)
188
+ set(userAvatarBezelAngleAtom(id), DEFAULT_BEZEL_ANGLE)
189
+ set(userAvatarImageStatusAtom(id), "idle")
190
+ set(userAvatarConfigAtom(id), DEFAULT_CONFIG)
191
+ }
192
+ )
193
+
194
+ /** Forget an avatar entirely — every family drops the key so the store can
195
+ * release its state. Call on teardown of a named instance. */
196
+ export function removeUserAvatarInstance(id: UserAvatarInstanceId): void {
197
+ for (const family of families) family.remove(id)
198
+ }
@@ -0,0 +1,8 @@
1
+ /** "Jenny Hamilton" → "JH", "luna" → "L". */
2
+ export function initialsFrom(name: string): string {
3
+ const parts = name.trim().split(/\s+/).filter(Boolean)
4
+ if (parts.length === 0) return ""
5
+ const first = parts[0]?.[0] ?? ""
6
+ const last = parts.length > 1 ? (parts.at(-1)?.[0] ?? "") : ""
7
+ return (first + last).toUpperCase()
8
+ }
package/src/index.css CHANGED
@@ -1,5 +1,6 @@
1
1
  @import "tailwindcss";
2
- @import "tw-animate-css";
2
+ @import "tailwindcss";
3
+ @import "tailwind-animations";
3
4
  @import "shadcn/tailwind.css";
4
5
  @import "@fontsource-variable/inter";
5
6
  @import "@fontsource-variable/figtree";
@@ -8,149 +9,169 @@
8
9
  @custom-variant dark (&:is(.dark *));
9
10
 
10
11
  :root {
11
- /* Let width/height tween between auto and fixed values (e.g. a button
12
+ /* Let width/height tween between auto and fixed values (e.g. a button
12
13
  toggling to an icon-only size). Progressive enhancement: browsers
13
14
  without support keep the instant jump. */
14
- interpolate-size: allow-keywords;
15
- --background: oklch(1 0 0);
16
- --foreground: oklch(0.145 0 0);
17
- --card: oklch(1 0 0);
18
- --card-foreground: oklch(0.145 0 0);
19
- --popover: oklch(1 0 0);
20
- --popover-foreground: oklch(0.145 0 0);
21
- --primary: oklch(0.457 0.24 277.023);
22
- --primary-foreground: oklch(0.962 0.018 272.314);
23
- --secondary: oklch(0.967 0.001 286.375);
24
- --secondary-foreground: oklch(0.21 0.006 285.885);
25
- --muted: oklch(0.97 0 0);
26
- --muted-foreground: oklch(0.556 0 0);
27
- --accent: oklch(0.97 0 0);
28
- --accent-foreground: oklch(0.205 0 0);
29
- --destructive: oklch(0.577 0.245 27.325);
30
- --border: oklch(0.922 0 0);
31
- --input: oklch(0.922 0 0);
32
- --ring: oklch(0.708 0 0);
33
- --chart-1: oklch(0.811 0.111 293.571);
34
- --chart-2: oklch(0.606 0.25 292.717);
35
- --chart-3: oklch(0.541 0.281 293.009);
36
- --chart-4: oklch(0.491 0.27 292.581);
37
- --chart-5: oklch(0.432 0.232 292.759);
38
- --radius: 0.875rem;
39
- --sidebar: oklch(0.985 0 0);
40
- --sidebar-foreground: oklch(0.145 0 0);
41
- --sidebar-primary: oklch(0.511 0.262 276.966);
42
- --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
43
- --sidebar-accent: oklch(0.97 0 0);
44
- --sidebar-accent-foreground: oklch(0.205 0 0);
45
- --sidebar-border: oklch(0.922 0 0);
46
- --sidebar-ring: oklch(0.708 0 0);
47
- --destructive-foreground: var(--color-red-700);
48
- --info: var(--color-blue-500);
49
- --info-foreground: var(--color-blue-700);
50
- --success: var(--color-emerald-500);
51
- --success-foreground: var(--color-emerald-700);
52
- --warning: var(--color-amber-500);
53
- --warning-foreground: var(--color-amber-700);
15
+ interpolate-size: allow-keywords;
16
+ --background: oklch(1 0 0);
17
+ --foreground: oklch(0.145 0 0);
18
+ --card: oklch(1 0 0);
19
+ --card-foreground: oklch(0.145 0 0);
20
+ --popover: oklch(1 0 0);
21
+ --popover-foreground: oklch(0.145 0 0);
22
+ --primary: oklch(0.457 0.24 277.023);
23
+ --primary-foreground: oklch(0.962 0.018 272.314);
24
+ --secondary: oklch(0.967 0.001 286.375);
25
+ --secondary-foreground: oklch(0.21 0.006 285.885);
26
+ --muted: oklch(0.97 0 0);
27
+ --muted-foreground: oklch(0.556 0 0);
28
+ --accent: oklch(0.97 0 0);
29
+ --accent-foreground: oklch(0.205 0 0);
30
+ --destructive: oklch(0.577 0.245 27.325);
31
+ --border: oklch(0.922 0 0);
32
+ --input: oklch(0.922 0 0);
33
+ --ring: oklch(0.708 0 0);
34
+ --chart-1: oklch(0.811 0.111 293.571);
35
+ --chart-2: oklch(0.606 0.25 292.717);
36
+ --chart-3: oklch(0.541 0.281 293.009);
37
+ --chart-4: oklch(0.491 0.27 292.581);
38
+ --chart-5: oklch(0.432 0.232 292.759);
39
+ --radius: 0.875rem;
40
+ --sidebar: oklch(0.985 0 0);
41
+ --sidebar-foreground: oklch(0.145 0 0);
42
+ --sidebar-primary: oklch(0.511 0.262 276.966);
43
+ --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
44
+ --sidebar-accent: oklch(0.97 0 0);
45
+ --sidebar-accent-foreground: oklch(0.205 0 0);
46
+ --sidebar-border: oklch(0.922 0 0);
47
+ --sidebar-ring: oklch(0.708 0 0);
48
+ --destructive-foreground: var(--color-red-700);
49
+ --info: var(--color-blue-500);
50
+ --info-foreground: var(--color-blue-700);
51
+ --success: var(--color-emerald-500);
52
+ --success-foreground: var(--color-emerald-700);
53
+ --warning: var(--color-amber-500);
54
+ --warning-foreground: var(--color-amber-700);
54
55
  }
55
56
 
56
57
  .dark {
57
- --background: oklch(0.145 0 0);
58
- --foreground: oklch(0.985 0 0);
59
- --card: oklch(0.205 0 0);
60
- --card-foreground: oklch(0.985 0 0);
61
- --popover: oklch(0.205 0 0);
62
- --popover-foreground: oklch(0.985 0 0);
63
- --primary: oklch(0.398 0.195 277.366);
64
- --primary-foreground: oklch(0.962 0.018 272.314);
65
- --secondary: oklch(0.274 0.006 286.033);
66
- --secondary-foreground: oklch(0.985 0 0);
67
- --muted: oklch(0.269 0 0);
68
- --muted-foreground: oklch(0.708 0 0);
69
- --accent: oklch(0.269 0 0);
70
- --accent-foreground: oklch(0.985 0 0);
71
- --destructive: oklch(0.704 0.191 22.216);
72
- --border: oklch(1 0 0 / 10%);
73
- --input: oklch(1 0 0 / 15%);
74
- --ring: oklch(0.556 0 0);
75
- --chart-1: oklch(0.811 0.111 293.571);
76
- --chart-2: oklch(0.606 0.25 292.717);
77
- --chart-3: oklch(0.541 0.281 293.009);
78
- --chart-4: oklch(0.491 0.27 292.581);
79
- --chart-5: oklch(0.432 0.232 292.759);
80
- --sidebar: oklch(0.205 0 0);
81
- --sidebar-foreground: oklch(0.985 0 0);
82
- --sidebar-primary: oklch(0.585 0.233 277.117);
83
- --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
84
- --sidebar-accent: oklch(0.269 0 0);
85
- --sidebar-accent-foreground: oklch(0.985 0 0);
86
- --sidebar-border: oklch(1 0 0 / 10%);
87
- --sidebar-ring: oklch(0.556 0 0);
88
- --destructive-foreground: var(--color-red-400);
89
- --info: var(--color-blue-500);
90
- --info-foreground: var(--color-blue-400);
91
- --success: var(--color-emerald-500);
92
- --success-foreground: var(--color-emerald-400);
93
- --warning: var(--color-amber-500);
94
- --warning-foreground: var(--color-amber-400);
58
+ --background: oklch(0.145 0 0);
59
+ --foreground: oklch(0.985 0 0);
60
+ --card: oklch(0.205 0 0);
61
+ --card-foreground: oklch(0.985 0 0);
62
+ --popover: oklch(0.205 0 0);
63
+ --popover-foreground: oklch(0.985 0 0);
64
+ --primary: oklch(0.398 0.195 277.366);
65
+ --primary-foreground: oklch(0.962 0.018 272.314);
66
+ --secondary: oklch(0.274 0.006 286.033);
67
+ --secondary-foreground: oklch(0.985 0 0);
68
+ --muted: oklch(0.269 0 0);
69
+ --muted-foreground: oklch(0.708 0 0);
70
+ --accent: oklch(0.269 0 0);
71
+ --accent-foreground: oklch(0.985 0 0);
72
+ --destructive: oklch(0.704 0.191 22.216);
73
+ --border: oklch(1 0 0 / 10%);
74
+ --input: oklch(1 0 0 / 15%);
75
+ --ring: oklch(0.556 0 0);
76
+ --chart-1: oklch(0.811 0.111 293.571);
77
+ --chart-2: oklch(0.606 0.25 292.717);
78
+ --chart-3: oklch(0.541 0.281 293.009);
79
+ --chart-4: oklch(0.491 0.27 292.581);
80
+ --chart-5: oklch(0.432 0.232 292.759);
81
+ --sidebar: oklch(0.205 0 0);
82
+ --sidebar-foreground: oklch(0.985 0 0);
83
+ --sidebar-primary: oklch(0.585 0.233 277.117);
84
+ --sidebar-primary-foreground: oklch(0.962 0.018 272.314);
85
+ --sidebar-accent: oklch(0.269 0 0);
86
+ --sidebar-accent-foreground: oklch(0.985 0 0);
87
+ --sidebar-border: oklch(1 0 0 / 10%);
88
+ --sidebar-ring: oklch(0.556 0 0);
89
+ --destructive-foreground: var(--color-red-400);
90
+ --info: var(--color-blue-500);
91
+ --info-foreground: var(--color-blue-400);
92
+ --success: var(--color-emerald-500);
93
+ --success-foreground: var(--color-emerald-400);
94
+ --warning: var(--color-amber-500);
95
+ --warning-foreground: var(--color-amber-400);
96
+
97
+ .shadow-bezel {
98
+ box-shadow:
99
+ inset 1px 1px 2px rgb(255 255 255 / 0.15),
100
+ inset -2px -2px 4px rgb(0 0 0 / 0.6);
101
+ }
102
+
103
+ .shadow-debossed {
104
+ box-shadow:
105
+ inset 2px 2px 4px rgb(0 0 0 / 0.6),
106
+ inset -1px -1px 2px rgb(255 255 255 / 0.15);
107
+ }
95
108
  }
96
109
 
97
110
  @theme inline {
98
- /* motion tokens (transitions.dev scale) */
99
- --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
100
- --font-sans: 'Inter Variable', sans-serif;
101
- --font-heading: 'Figtree Variable', sans-serif;
102
- --color-sidebar-ring: var(--sidebar-ring);
103
- --color-sidebar-border: var(--sidebar-border);
104
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
105
- --color-sidebar-accent: var(--sidebar-accent);
106
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
107
- --color-sidebar-primary: var(--sidebar-primary);
108
- --color-sidebar-foreground: var(--sidebar-foreground);
109
- --color-sidebar: var(--sidebar);
110
- --color-chart-5: var(--chart-5);
111
- --color-chart-4: var(--chart-4);
112
- --color-chart-3: var(--chart-3);
113
- --color-chart-2: var(--chart-2);
114
- --color-chart-1: var(--chart-1);
115
- --color-ring: var(--ring);
116
- --color-input: var(--input);
117
- --color-border: var(--border);
118
- --color-destructive: var(--destructive);
119
- --color-accent-foreground: var(--accent-foreground);
120
- --color-accent: var(--accent);
121
- --color-muted-foreground: var(--muted-foreground);
122
- --color-muted: var(--muted);
123
- --color-secondary-foreground: var(--secondary-foreground);
124
- --color-secondary: var(--secondary);
125
- --color-primary-foreground: var(--primary-foreground);
126
- --color-primary: var(--primary);
127
- --color-popover-foreground: var(--popover-foreground);
128
- --color-popover: var(--popover);
129
- --color-card-foreground: var(--card-foreground);
130
- --color-card: var(--card);
131
- --color-foreground: var(--foreground);
132
- --color-background: var(--background);
133
- --radius-sm: calc(var(--radius) * 0.6);
134
- --radius-md: calc(var(--radius) * 0.8);
135
- --radius-lg: var(--radius);
136
- --radius-xl: calc(var(--radius) * 1.4);
137
- --radius-2xl: calc(var(--radius) * 1.8);
138
- --radius-3xl: calc(var(--radius) * 2.2);
139
- --radius-4xl: calc(var(--radius) * 2.6);
140
- --color-destructive-foreground: var(--destructive-foreground);
111
+ /* motion tokens (transitions.dev scale) */
112
+ --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
113
+ --font-sans: "Inter Variable", sans-serif;
114
+ --font-heading: "Figtree Variable", sans-serif;
115
+ --color-sidebar-ring: var(--sidebar-ring);
116
+ --color-sidebar-border: var(--sidebar-border);
117
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
118
+ --color-sidebar-accent: var(--sidebar-accent);
119
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
120
+ --color-sidebar-primary: var(--sidebar-primary);
121
+ --color-sidebar-foreground: var(--sidebar-foreground);
122
+ --color-sidebar: var(--sidebar);
123
+ --color-chart-5: var(--chart-5);
124
+ --color-chart-4: var(--chart-4);
125
+ --color-chart-3: var(--chart-3);
126
+ --color-chart-2: var(--chart-2);
127
+ --color-chart-1: var(--chart-1);
128
+ --color-ring: var(--ring);
129
+ --color-input: var(--input);
130
+ --color-border: var(--border);
131
+ --color-destructive: var(--destructive);
132
+ --color-accent-foreground: var(--accent-foreground);
133
+ --color-accent: var(--accent);
134
+ --color-muted-foreground: var(--muted-foreground);
135
+ --color-muted: var(--muted);
136
+ --color-secondary-foreground: var(--secondary-foreground);
137
+ --color-secondary: var(--secondary);
138
+ --color-primary-foreground: var(--primary-foreground);
139
+ --color-primary: var(--primary);
140
+ --color-popover-foreground: var(--popover-foreground);
141
+ --color-popover: var(--popover);
142
+ --color-card-foreground: var(--card-foreground);
143
+ --color-card: var(--card);
144
+ --color-foreground: var(--foreground);
145
+ --color-background: var(--background);
146
+ --radius-sm: calc(var(--radius) * 0.6);
147
+ --radius-md: calc(var(--radius) * 0.8);
148
+ --radius-lg: var(--radius);
149
+ --radius-xl: calc(var(--radius) * 1.4);
150
+ --radius-2xl: calc(var(--radius) * 1.8);
151
+ --radius-3xl: calc(var(--radius) * 2.2);
152
+ --radius-4xl: calc(var(--radius) * 2.6);
153
+ --color-destructive-foreground: var(--destructive-foreground);
141
154
  @keyframes liquid-drift {
142
- 0% {
143
- background-position: 0% 0%, 100% 100%, 0% 0%;
144
- }
145
- 50% {
146
- background-position: 30% 20%, 70% 80%, 0% 0%;
147
- }
148
- 100% {
149
- background-position: 0% 0%, 100% 100%, 0% 0%;
150
- }
155
+ 0% {
156
+ background-position:
157
+ 0% 0%,
158
+ 100% 100%,
159
+ 0% 0%;
151
160
  }
152
- --animate-caret-blink: 1s ease-out infinite caret-blink
153
- ;
161
+ 50% {
162
+ background-position:
163
+ 30% 20%,
164
+ 70% 80%,
165
+ 0% 0%;
166
+ }
167
+ 100% {
168
+ background-position:
169
+ 0% 0%,
170
+ 100% 100%,
171
+ 0% 0%;
172
+ }
173
+ }
174
+ --animate-caret-blink: 1s ease-out infinite caret-blink;
154
175
  --animate-input-shake: input-shake 0.4s ease-in-out;
155
176
  --animate-skeleton: skeleton 2s -1s infinite linear;
156
177
  --color-warning-foreground: var(--warning-foreground);
@@ -160,35 +181,72 @@
160
181
  --color-info-foreground: var(--info-foreground);
161
182
  --color-info: var(--info);
162
183
  @keyframes skeleton {
163
- to { background-position: -200% 0; }
184
+ to {
185
+ background-position: -200% 0;
186
+ }
164
187
  }
165
188
  @keyframes input-shake {
166
- 0%, 100% { translate: 0; }
167
- 20% { translate: -6px 0; }
168
- 40% { translate: 6px 0; }
169
- 60% { translate: -4px 0; }
170
- 80% { translate: 4px 0; }
189
+ 0%,
190
+ 100% {
191
+ translate: 0;
192
+ }
193
+ 20% {
194
+ translate: -6px 0;
195
+ }
196
+ 40% {
197
+ translate: 6px 0;
198
+ }
199
+ 60% {
200
+ translate: -4px 0;
201
+ }
202
+ 80% {
203
+ translate: 4px 0;
204
+ }
171
205
  }
172
206
  @keyframes caret-blink {
173
- 0%, 70%, to {
174
- opacity: 1;
175
- }
176
- 20%, 50% {
177
- opacity: 0;
178
- }
179
- }}
207
+ 0%,
208
+ 70%,
209
+ to {
210
+ opacity: 1;
211
+ }
212
+ 20%,
213
+ 50% {
214
+ opacity: 0;
215
+ }
216
+ }
217
+ }
180
218
 
181
219
  @layer base {
182
220
  * {
183
221
  @apply border-border outline-ring/50;
184
- }
222
+ }
185
223
  body {
186
224
  @apply bg-background text-foreground;
187
- }
188
- button:not(:disabled), [role="button"]:not(:disabled) {
225
+ }
226
+ button:not(:disabled),
227
+ [role="button"]:not(:disabled) {
189
228
  cursor: pointer;
190
- }
229
+ }
191
230
  html {
192
231
  @apply font-sans;
193
- }
194
- }
232
+ }
233
+ }
234
+
235
+ @utility shadow-bezel {
236
+ /* Inherits light/dark ambient highlights automatically */
237
+ box-shadow:
238
+ inset 1px 1px 2px rgb(255 255 255 / 0.7),
239
+ inset -2px -2px 4px rgb(0 0 0 / 0.25);
240
+ }
241
+
242
+ @utility shadow-debossed {
243
+ box-shadow:
244
+ inset 2px 2px 4px rgb(0 0 0 / 0.25),
245
+ inset -1px -1px 2px rgb(255 255 255 / 0.7);
246
+ }
247
+
248
+ @utility shadow-bezel-dynamic {
249
+ box-shadow:
250
+ inset 1px 1px 2px color-mix(in srgb, currentColor 40%, white),
251
+ inset -2px -2px 4px color-mix(in srgb, currentColor 60%, black);
252
+ }
package/src/index.ts CHANGED
@@ -26,10 +26,40 @@ export * from "./components/ui/textarea"
26
26
  // components
27
27
  export * from "./components/composed/password-input"
28
28
  export * from "./components/composed/social-providers"
29
- export * from "./components/composed/user-avatar"
29
+ export * from "./components/composed/tree"
30
+ // user-avatar: named, not `export *` — its barrel also exports an `Avatar`
31
+ // namespace object that would collide with ui/avatar's component above.
32
+ export {
33
+ DEFAULT_BEZEL_ANGLE,
34
+ PresenceBadge,
35
+ UserAvatar,
36
+ initialsFrom,
37
+ removeUserAvatarInstance,
38
+ resetUserAvatarAtom,
39
+ setUserAvatarBezelAngleAtom,
40
+ setUserAvatarPresenceAtom,
41
+ toggleUserAvatarPresenceAtom,
42
+ useUserAvatar,
43
+ useUserAvatarActions,
44
+ useUserAvatarState,
45
+ userAvatarBezelAngleAtom,
46
+ userAvatarIsOnlineAtom,
47
+ userAvatarPresenceAtom,
48
+ userAvatarStateAtom,
49
+ } from "./components/user-avatar"
50
+ export type {
51
+ UseUserAvatarOptions,
52
+ UserAvatarActions,
53
+ UserAvatarBinding,
54
+ UserAvatarInstanceId,
55
+ UserAvatarProps,
56
+ UserAvatarState,
57
+ UserPresence,
58
+ } from "./components/user-avatar"
30
59
 
31
60
  // blocks
32
61
  export * from "./components/blocks/auth/auth-shell"
62
+ export * from "./components/blocks/auth/auth-state"
33
63
  export * from "./components/blocks/auth/code-auth-block"
34
64
  export * from "./components/blocks/auth/forgot-password-block"
35
65
  export * from "./components/blocks/auth/linked-accounts-block"
@@ -45,11 +75,14 @@ export * from "./components/blocks/shell"
45
75
  export { default as ShellLayout } from "./components/blocks/shell"
46
76
  export * from "./components/blocks/scaffold"
47
77
  export { default as Layout } from "./components/blocks/layout"
48
- export * from "./components/blocks/profile/profile-card-block"
78
+ export * from "./components/blocks/profile"
49
79
 
50
80
  // motion primitives
51
81
  export * from "./components/motion/shared-layout-bg"
52
82
 
83
+ // state
84
+ export * from "./state"
85
+
53
86
  // The v0.17 sidebar monolith became the shell block's AnimatedPanel parts.
54
87
  // `blocks/shell` above already exports every part under its new name; these
55
88
  // aliases keep the published AnimatedSidebar* names working for consumers.