@exegia/corpora-ui 0.20.0 → 0.22.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.
- package/dist-lib/components/blocks/auth/auth-flow-atom.d.ts +77 -0
- package/dist-lib/components/blocks/auth/auth-session-atom.d.ts +28 -0
- package/dist-lib/components/blocks/auth/auth-state-type.d.ts +71 -0
- package/dist-lib/components/blocks/auth/auth-state.d.ts +9 -0
- package/dist-lib/components/blocks/auth/use-auth-state.d.ts +52 -0
- package/dist-lib/components/blocks/layout.d.ts +4 -1
- package/dist-lib/components/blocks/nav/sidebar/__tests__/ai-sidebar-atom.test.d.ts +1 -0
- package/dist-lib/components/blocks/nav/sidebar/ai-sidebar-atom.d.ts +217 -0
- package/dist-lib/components/blocks/nav/sidebar/index.d.ts +3 -1
- package/dist-lib/components/blocks/nav/sidebar/sidebar-context.d.ts +3 -0
- package/dist-lib/components/blocks/nav/sidebar/sidebar-row.d.ts +3 -1
- package/dist-lib/components/blocks/nav/sidebar/type.d.ts +109 -29
- package/dist-lib/components/blocks/nav/sidebar/use-ai-sidebar-state.d.ts +29 -0
- package/dist-lib/components/blocks/nav/sidebar/use-ai-sidebar.d.ts +6 -1
- package/dist-lib/components/blocks/nav/sidebar/utils.d.ts +1 -1
- package/dist-lib/components/blocks/profile/index.d.ts +7 -0
- package/dist-lib/components/blocks/profile/profile-card-atom.d.ts +68 -0
- package/dist-lib/components/blocks/profile/profile-card-block.d.ts +28 -39
- package/dist-lib/components/blocks/profile/type.d.ts +80 -0
- package/dist-lib/components/blocks/profile/use-profile-card-state.d.ts +24 -0
- package/dist-lib/components/blocks/profile/use-profile-card.d.ts +34 -0
- package/dist-lib/components/blocks/shell/__tests__/shell-fit-atom.test.d.ts +1 -0
- package/dist-lib/components/blocks/shell/__tests__/shell-metrics.test.d.ts +1 -0
- package/dist-lib/components/blocks/shell/animated-panel-provider.d.ts +1 -1
- package/dist-lib/components/blocks/shell/animated-panel.d.ts +1 -1
- package/dist-lib/components/blocks/shell/index.d.ts +4 -12
- package/dist-lib/components/blocks/shell/shell-fit-atom.d.ts +68 -0
- package/dist-lib/components/blocks/shell/shell-metrics.d.ts +54 -0
- package/dist-lib/components/blocks/shell/type.d.ts +115 -3
- package/dist-lib/components/blocks/shell/use-shell-fit-state.d.ts +25 -0
- package/dist-lib/components/blocks/shell/use-shell-fit.d.ts +14 -0
- package/dist-lib/components/blocks/shell/use-shell-panels.d.ts +12 -1
- package/dist-lib/components/blocks/shell/utils.d.ts +32 -0
- package/dist-lib/components/composed/__tests__/logo.test.d.ts +1 -0
- package/dist-lib/components/composed/logo.d.ts +34 -0
- package/dist-lib/components/composed/tree/__tests__/tree-atom.test.d.ts +1 -0
- package/dist-lib/components/composed/tree/constants.d.ts +4 -4
- package/dist-lib/components/composed/tree/index.d.ts +3 -1
- package/dist-lib/components/composed/tree/tree-atom.d.ts +160 -0
- package/dist-lib/components/composed/tree/tree-node.d.ts +6 -1
- package/dist-lib/components/composed/tree/type.d.ts +116 -18
- package/dist-lib/components/composed/tree/use-tree-dnd.d.ts +18 -7
- package/dist-lib/components/composed/tree/use-tree-state.d.ts +25 -0
- package/dist-lib/components/composed/tree/use-tree.d.ts +4 -0
- package/dist-lib/components/composed/user-avatar.d.ts +5 -28
- package/dist-lib/components/user-avatar/__tests__/user-avatar.test.d.ts +1 -0
- package/dist-lib/components/user-avatar/component.d.ts +1 -8
- package/dist-lib/components/user-avatar/index.d.ts +5 -0
- package/dist-lib/components/user-avatar/presence-badge.d.ts +16 -0
- package/dist-lib/components/user-avatar/type.d.ts +53 -0
- package/dist-lib/components/user-avatar/use-user-avatar-state.d.ts +26 -0
- package/dist-lib/components/user-avatar/use-user-avatar.d.ts +37 -0
- package/dist-lib/components/user-avatar/user-avatar-atom.d.ts +64 -0
- package/dist-lib/components/user-avatar/utils.d.ts +22 -0
- package/dist-lib/index.d.ts +6 -3
- package/dist-lib/index.js +3732 -2670
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/state/exegia-provider.d.ts +51 -0
- package/dist-lib/state/index.d.ts +4 -0
- package/dist-lib/state/store.d.ts +17 -0
- package/package.json +15 -12
- package/src/components/blocks/auth/__tests__/auth-state-atom.test.tsx +247 -0
- package/src/components/blocks/auth/auth-flow-atom.ts +238 -0
- package/src/components/blocks/auth/auth-session-atom.ts +82 -0
- package/src/components/blocks/auth/auth-state-type.ts +97 -0
- package/src/components/blocks/auth/auth-state.ts +52 -0
- package/src/components/blocks/auth/use-auth-state.ts +127 -0
- package/src/components/blocks/layout.ts +30 -2
- package/src/components/blocks/nav/sidebar/__tests__/ai-sidebar-atom.test.tsx +325 -0
- package/src/components/blocks/nav/sidebar/ai-sidebar-atom.ts +698 -0
- package/src/components/blocks/nav/sidebar/ai-sidebar.tsx +48 -42
- package/src/components/blocks/nav/sidebar/index.ts +53 -1
- package/src/components/blocks/nav/sidebar/sidebar-context.ts +15 -0
- package/src/components/blocks/nav/sidebar/sidebar-row.tsx +119 -50
- package/src/components/blocks/nav/sidebar/type.ts +125 -30
- package/src/components/blocks/nav/sidebar/use-ai-sidebar-state.ts +123 -0
- package/src/components/blocks/nav/sidebar/use-ai-sidebar.ts +301 -248
- package/src/components/blocks/nav/sidebar/utils.ts +1 -1
- package/src/components/blocks/profile/__tests__/profile-card-block.test.tsx +194 -0
- package/src/components/blocks/profile/index.ts +28 -0
- package/src/components/blocks/profile/profile-card-atom.ts +247 -0
- package/src/components/blocks/profile/profile-card-block.tsx +153 -74
- package/src/components/blocks/profile/type.ts +95 -0
- package/src/components/blocks/profile/use-profile-card-state.ts +67 -0
- package/src/components/blocks/profile/use-profile-card.ts +126 -0
- package/src/components/blocks/shell/__tests__/shell-fit-atom.test.tsx +360 -0
- package/src/components/blocks/shell/__tests__/shell-layout.test.tsx +192 -3
- package/src/components/blocks/shell/__tests__/shell-metrics.test.ts +108 -0
- package/src/components/blocks/shell/animated-panel-inset.tsx +5 -1
- package/src/components/blocks/shell/animated-panel-provider.tsx +77 -11
- package/src/components/blocks/shell/animated-panel-trigger.tsx +4 -0
- package/src/components/blocks/shell/animated-panel.tsx +126 -29
- package/src/components/blocks/shell/index.ts +18 -13
- package/src/components/blocks/shell/shell-fit-atom.ts +243 -0
- package/src/components/blocks/shell/shell-layout.tsx +55 -53
- package/src/components/blocks/shell/shell-metrics.ts +79 -0
- package/src/components/blocks/shell/type.ts +130 -3
- package/src/components/blocks/shell/use-shell-fit-state.ts +49 -0
- package/src/components/blocks/shell/use-shell-fit.ts +135 -0
- package/src/components/blocks/shell/use-shell-panels.ts +57 -4
- package/src/components/blocks/shell/utils.ts +44 -4
- package/src/components/composed/__tests__/logo.test.tsx +60 -0
- package/src/components/composed/logo.tsx +159 -0
- package/src/components/composed/tree/CLAUDE.md +132 -0
- package/src/components/composed/tree/__tests__/tree-atom.test.tsx +217 -0
- package/src/components/composed/tree/__tests__/tree.test.tsx +162 -37
- package/src/components/composed/tree/__tests__/use-tree.test.tsx +2 -1
- package/src/components/composed/tree/constants.ts +4 -4
- package/src/components/composed/tree/index.ts +38 -0
- package/src/components/composed/tree/tree-atom.ts +590 -0
- package/src/components/composed/tree/tree-node.tsx +117 -78
- package/src/components/composed/tree/tree.tsx +24 -16
- package/src/components/composed/tree/type.ts +125 -15
- package/src/components/composed/tree/use-tree-dnd.ts +82 -51
- package/src/components/composed/tree/use-tree-state.ts +105 -0
- package/src/components/composed/tree/use-tree.ts +185 -184
- package/src/components/composed/user-avatar.tsx +11 -99
- package/src/components/user-avatar/__tests__/user-avatar.test.tsx +286 -0
- package/src/components/user-avatar/component.tsx +151 -22
- package/src/components/user-avatar/fallback.tsx +3 -1
- package/src/components/user-avatar/index.ts +19 -0
- package/src/components/user-avatar/presence-badge.tsx +56 -0
- package/src/components/user-avatar/type.ts +58 -0
- package/src/components/user-avatar/use-user-avatar-state.ts +60 -0
- package/src/components/user-avatar/use-user-avatar.ts +180 -0
- package/src/components/user-avatar/user-avatar-atom.ts +218 -0
- package/src/components/user-avatar/utils.ts +94 -0
- package/src/index.ts +35 -3
- package/src/state/exegia-provider.tsx +79 -0
- package/src/state/index.ts +4 -0
- package/src/state/store.ts +19 -0
- package/dist-lib/components/blocks/nav/sidebar-block.d.ts +0 -14
- package/dist-lib/components/blocks/nav/sidebar-nav-row.d.ts +0 -3
- package/dist-lib/components/blocks/nav/types.d.ts +0 -60
- package/dist-lib/components/blocks/nav/utils.d.ts +0 -1
- package/dist-lib/components/blocks/shell/animated-sidebar-content.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-footer.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-group-content.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-group-label.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-group.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-header.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-button.d.ts +0 -3
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-item.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub-button.d.ts +0 -3
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub-item.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub.d.ts +0 -2
- package/dist-lib/components/blocks/shell/animated-sidebar-menu.d.ts +0 -2
- package/src/components/blocks/nav/__tests__/sidebar-block.test.tsx +0 -125
- package/src/components/blocks/nav/sidebar-block.tsx +0 -142
- package/src/components/blocks/nav/sidebar-nav-row.tsx +0 -78
- package/src/components/blocks/nav/types.ts +0 -65
- package/src/components/blocks/nav/utils.ts +0 -4
- package/src/components/blocks/shell/animated-sidebar-content.tsx +0 -19
- package/src/components/blocks/shell/animated-sidebar-footer.tsx +0 -19
- package/src/components/blocks/shell/animated-sidebar-group-content.tsx +0 -16
- package/src/components/blocks/shell/animated-sidebar-group-label.tsx +0 -29
- package/src/components/blocks/shell/animated-sidebar-group.tsx +0 -16
- package/src/components/blocks/shell/animated-sidebar-header.tsx +0 -16
- package/src/components/blocks/shell/animated-sidebar-menu-button.tsx +0 -151
- package/src/components/blocks/shell/animated-sidebar-menu-item.tsx +0 -20
- package/src/components/blocks/shell/animated-sidebar-menu-sub-button.tsx +0 -85
- package/src/components/blocks/shell/animated-sidebar-menu-sub-item.tsx +0 -19
- package/src/components/blocks/shell/animated-sidebar-menu-sub.tsx +0 -44
- package/src/components/blocks/shell/animated-sidebar-menu.tsx +0 -26
- /package/dist-lib/components/blocks/{nav/__tests__/sidebar-block.test.d.ts → auth/__tests__/auth-state-atom.test.d.ts} +0 -0
|
@@ -7,8 +7,11 @@ export interface TreeNode {
|
|
|
7
7
|
/** Leading icon. Required in practice for `sidebar` — it is all that
|
|
8
8
|
* remains of a row while the rail is collapsed. */
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
10
|
+
/** Route metadata for the consumer's `onNavigate` — every row renders as
|
|
11
|
+
* a button, so this is never turned into an anchor element. Read it (with
|
|
12
|
+
* `target`) off the node your handler receives. One native behaviour is
|
|
13
|
+
* kept: `toc` rows below the route level jump to `#{id}` after select
|
|
14
|
+
* (a `#hash` href overrides the id; a non-hash href disables the jump). */
|
|
12
15
|
href?: string;
|
|
13
16
|
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
14
17
|
disabled?: boolean;
|
|
@@ -23,14 +26,29 @@ export interface TreeNode {
|
|
|
23
26
|
export type TreeVariant = "navigation" | "toc" | "sidebar" | "files";
|
|
24
27
|
/** Where a dragged row lands relative to its drop target. */
|
|
25
28
|
export type TreeDropPosition = "before" | "after" | "inside";
|
|
29
|
+
/** Key for one tree’s state in the store. Any stable string; `useTree`
|
|
30
|
+
* generates one when you don't pass it. */
|
|
31
|
+
export type TreeInstanceId = string;
|
|
32
|
+
/** Row a drag hovers, and where the drop would land. */
|
|
33
|
+
export interface TreeDropTarget {
|
|
34
|
+
id: string;
|
|
35
|
+
position: TreeDropPosition;
|
|
36
|
+
}
|
|
26
37
|
interface TreeBaseProps {
|
|
27
38
|
items: TreeNode[];
|
|
39
|
+
/** Key this tree's state under a name your app can address —
|
|
40
|
+
* `useTreeState("app-nav")` / `useTreeActions("app-nav")` reach it from
|
|
41
|
+
* anywhere under `ExegiaProvider`. Without one the tree generates a key
|
|
42
|
+
* and its state is dropped when it unmounts. */
|
|
43
|
+
treeId?: TreeInstanceId;
|
|
28
44
|
/** Never set on the data form — `tree` selects the controller form. */
|
|
29
45
|
tree?: never;
|
|
30
46
|
/** `id` of the current entry — matches any depth. Its ancestors expand. */
|
|
31
47
|
activeId?: string;
|
|
32
|
-
/** Fires for every selection (rows and leaves alike), after the
|
|
33
|
-
*
|
|
48
|
+
/** Fires for every selection (rows and leaves alike), after the node's
|
|
49
|
+
* own `onSelect`. Rows are buttons, so this is the routing path — wire
|
|
50
|
+
* your router's navigate here. `toc` rows below the route level still jump
|
|
51
|
+
* to `#{id}` natively, after this fires. */
|
|
34
52
|
onNavigate?: (node: TreeNode) => void;
|
|
35
53
|
/** Expand/collapse cues. Silent until `bindSounds()`. */
|
|
36
54
|
sound?: boolean;
|
|
@@ -62,11 +80,13 @@ export type TreeProps = TreeDataProps | TreeControllerProps;
|
|
|
62
80
|
export type TreeDataProps = TreeBaseProps & (({
|
|
63
81
|
/** Nested app navigation. With 3 levels of nodes the top level
|
|
64
82
|
* becomes collapsible section names (styled as headings, not
|
|
65
|
-
*
|
|
83
|
+
* rows); with 2 it renders plain selectable rows. */
|
|
66
84
|
variant: "navigation";
|
|
67
85
|
} & TreeReadonlyProps) | ({
|
|
68
|
-
/** Table of contents: top-level nodes are routes
|
|
69
|
-
*
|
|
86
|
+
/** Table of contents: top-level nodes are routes (handled in
|
|
87
|
+
* `onNavigate`); rows below jump to `#{id}` after select, like an
|
|
88
|
+
* anchor would. Parents select on the row and expand from a
|
|
89
|
+
* separate overlay chevron. */
|
|
70
90
|
variant: "toc";
|
|
71
91
|
} & TreeReadonlyProps) | ({
|
|
72
92
|
/** Single-level icon rail. `collapsed` shrinks rows to their
|
|
@@ -91,6 +111,11 @@ export type TreeDataProps = TreeBaseProps & (({
|
|
|
91
111
|
* controlled when passed and hook-owned when its `default*` twin is used
|
|
92
112
|
* instead. */
|
|
93
113
|
export interface UseTreeOptions {
|
|
114
|
+
/** Key this tree's state under a name your app can address —
|
|
115
|
+
* `useTreeState("app-nav")` / `useTreeActions("app-nav")` reach it from
|
|
116
|
+
* anywhere under `ExegiaProvider`. Without one the hook generates a key
|
|
117
|
+
* and the state is dropped when the component unmounts. */
|
|
118
|
+
treeId?: TreeInstanceId;
|
|
94
119
|
/** Which shape the tree takes — gates rename/reorder (`files`) and the
|
|
95
120
|
* collapsible rail (`sidebar`). */
|
|
96
121
|
variant: TreeVariant;
|
|
@@ -127,6 +152,8 @@ export interface UseTreeOptions {
|
|
|
127
152
|
/** Everything the tree can do, callable from outside the component.
|
|
128
153
|
* Returned by `useTree` and accepted by `<Tree tree={…} />`. */
|
|
129
154
|
export interface TreeController {
|
|
155
|
+
/** The key this tree's state is stored under. */
|
|
156
|
+
treeId: TreeInstanceId;
|
|
130
157
|
variant: TreeVariant;
|
|
131
158
|
items: TreeNode[];
|
|
132
159
|
/** `navigation` with 3 levels of nodes — depth 0 renders as sections. */
|
|
@@ -165,28 +192,99 @@ export interface TreeController {
|
|
|
165
192
|
/** Whether reorder is wired up at all. */
|
|
166
193
|
canMove: boolean;
|
|
167
194
|
move: (id: string, parentId: string | null, index: number) => void;
|
|
195
|
+
/** Back to the values the tree mounted with. */
|
|
196
|
+
reset: () => void;
|
|
168
197
|
dnd: TreeDndContextValue;
|
|
169
198
|
}
|
|
170
199
|
/** @internal What a row needs from the root, threaded through context so
|
|
171
|
-
* the recursive rows stay prop-light.
|
|
200
|
+
* the recursive rows stay prop-light.
|
|
201
|
+
*
|
|
202
|
+
* Deliberately free of tree state. Rows read state from per-node atoms, so
|
|
203
|
+
* this value keeps its identity for the life of the tree and expanding one
|
|
204
|
+
* branch no longer re-renders every row through context. */
|
|
172
205
|
export interface TreeContextValue {
|
|
173
|
-
|
|
206
|
+
treeId: TreeInstanceId;
|
|
174
207
|
renderTrailing?: (node: TreeNode) => React.ReactNode;
|
|
208
|
+
dnd: TreeDndHandlers;
|
|
175
209
|
}
|
|
176
|
-
/** @internal
|
|
177
|
-
*
|
|
178
|
-
|
|
210
|
+
/** @internal The drag event handlers, stable for the life of the tree —
|
|
211
|
+
* they read drag state out of the store instead of closing over it, so
|
|
212
|
+
* handing them to every row costs no re-renders. */
|
|
213
|
+
export interface TreeDndHandlers {
|
|
179
214
|
enabled: boolean;
|
|
180
|
-
draggedId: string | null;
|
|
181
|
-
/** Row the pointer is over and where the drop would land. */
|
|
182
|
-
dropTarget: {
|
|
183
|
-
id: string;
|
|
184
|
-
position: TreeDropPosition;
|
|
185
|
-
} | null;
|
|
186
215
|
onRowDragStart: (event: React.DragEvent, id: string) => void;
|
|
187
216
|
onRowDragOver: (event: React.DragEvent, node: TreeNode) => void;
|
|
188
217
|
onRowDragLeave: (event: React.DragEvent) => void;
|
|
189
218
|
onRowDrop: (event: React.DragEvent, node: TreeNode) => void;
|
|
190
219
|
onRowDragEnd: () => void;
|
|
191
220
|
}
|
|
221
|
+
/** @internal Handlers plus live drag state — what `TreeController.dnd`
|
|
222
|
+
* exposes (all `null`/no-op outside `files`). */
|
|
223
|
+
export interface TreeDndContextValue extends TreeDndHandlers {
|
|
224
|
+
draggedId: string | null;
|
|
225
|
+
/** Row the pointer is over and where the drop would land. */
|
|
226
|
+
dropTarget: TreeDropTarget | null;
|
|
227
|
+
}
|
|
228
|
+
/** Everything observable about one tree, for consumers reading it by id. */
|
|
229
|
+
export interface TreeState {
|
|
230
|
+
variant: TreeVariant;
|
|
231
|
+
items: TreeNode[];
|
|
232
|
+
activeId?: string;
|
|
233
|
+
expandedIds: ReadonlySet<string>;
|
|
234
|
+
collapsed: boolean;
|
|
235
|
+
renamingId: string | null;
|
|
236
|
+
sectioned: boolean;
|
|
237
|
+
sectionIds: string[];
|
|
238
|
+
canRename: boolean;
|
|
239
|
+
canMove: boolean;
|
|
240
|
+
draggedId: string | null;
|
|
241
|
+
dropTarget: TreeDropTarget | null;
|
|
242
|
+
}
|
|
243
|
+
/** Everything doable to one tree from outside its component. */
|
|
244
|
+
export interface TreeActions {
|
|
245
|
+
expand: (id: string) => void;
|
|
246
|
+
collapse: (id: string) => void;
|
|
247
|
+
toggleExpanded: (id: string) => void;
|
|
248
|
+
expandAll: () => void;
|
|
249
|
+
collapseAll: () => void;
|
|
250
|
+
reveal: (id: string) => void;
|
|
251
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
252
|
+
toggleCollapsed: () => void;
|
|
253
|
+
select: (id: string) => void;
|
|
254
|
+
startRename: (id: string) => void;
|
|
255
|
+
cancelRename: () => void;
|
|
256
|
+
rename: (id: string, label: string) => void;
|
|
257
|
+
move: (id: string, parentId: string | null, index: number) => void;
|
|
258
|
+
setItems: (items: TreeNode[]) => void;
|
|
259
|
+
reset: () => void;
|
|
260
|
+
}
|
|
261
|
+
/** @internal Projection of `useTree`'s options — primitives only, so the
|
|
262
|
+
* store write runs once per real change instead of once per render. */
|
|
263
|
+
export interface TreeConfig {
|
|
264
|
+
variant: TreeVariant;
|
|
265
|
+
sound: boolean;
|
|
266
|
+
controlsItems: boolean;
|
|
267
|
+
controlsActiveId: boolean;
|
|
268
|
+
controlsCollapsed: boolean;
|
|
269
|
+
managesItems: boolean;
|
|
270
|
+
hasRenameHandler: boolean;
|
|
271
|
+
hasMoveHandler: boolean;
|
|
272
|
+
}
|
|
273
|
+
/** @internal Latest option callbacks. Only write atoms read this, so it
|
|
274
|
+
* can be refreshed every commit without re-rendering anything. */
|
|
275
|
+
export interface TreeHandlers {
|
|
276
|
+
onNavigate?: (node: TreeNode) => void;
|
|
277
|
+
onItemsChange?: (items: TreeNode[]) => void;
|
|
278
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
279
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
280
|
+
onRename?: (id: string, label: string) => void;
|
|
281
|
+
onMove?: (id: string, parentId: string | null, index: number) => void;
|
|
282
|
+
}
|
|
283
|
+
/** @internal What an instance starts from, replayed by `resetTreeAtom`. */
|
|
284
|
+
export interface TreeSeed {
|
|
285
|
+
items: TreeNode[];
|
|
286
|
+
activeId?: string;
|
|
287
|
+
collapsed: boolean;
|
|
288
|
+
expandedIds?: string[];
|
|
289
|
+
}
|
|
192
290
|
export {};
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { TreeDndContextValue,
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
1
|
+
import { TreeDndContextValue, TreeDndHandlers, TreeInstanceId } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* The drag handlers for the `files` variant, stable for the life of the tree.
|
|
4
|
+
*
|
|
5
|
+
* Nothing here subscribes to drag state: items, the dragged id and the drop
|
|
6
|
+
* target are read out of the store when a handler runs. That is what lets
|
|
7
|
+
* every row share one handler object without re-rendering when a drag moves —
|
|
8
|
+
* and it keeps `useTree` from subscribing to data it also projects from
|
|
9
|
+
* props, which would loop on an inline `items` array.
|
|
10
|
+
*
|
|
11
|
+
* Inert unless the tree `canMove`. `dataTransfer` is set for interop but
|
|
12
|
+
* never read, so the flow also works where the store is unavailable (tests,
|
|
13
|
+
* some webviews).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTreeDndHandlers(treeId: TreeInstanceId): TreeDndHandlers;
|
|
16
|
+
/** The handlers plus live drag state, for `TreeController.dnd`. Rows take the
|
|
17
|
+
* handlers alone and read the state per node instead. */
|
|
18
|
+
export declare function useTreeDnd(treeId: TreeInstanceId): TreeDndContextValue;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TreeActions, TreeInstanceId, TreeState } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Read the tree registered under `treeId` from anywhere below
|
|
4
|
+
* `ExegiaProvider` — no controller, no props, no provider of its own.
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const { collapsed, activeId } = useTreeState("app-nav")
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* This returns the whole state object, so the caller re-renders on any
|
|
11
|
+
* change. A component that reads one field should subscribe to that field's
|
|
12
|
+
* atom instead: `useAtomValue(treeCollapsedAtom("app-nav"))`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTreeState(treeId: TreeInstanceId): TreeState;
|
|
15
|
+
/**
|
|
16
|
+
* Drive the tree registered under `treeId` from anywhere. Writes only — the
|
|
17
|
+
* caller never re-renders when the tree changes, so this is what a command
|
|
18
|
+
* palette, a keyboard shortcut or a route guard should reach for.
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const nav = useTreeActions("app-nav")
|
|
22
|
+
* <Button onClick={nav.collapseAll}>Collapse all</Button>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function useTreeActions(treeId: TreeInstanceId): TreeActions;
|
|
@@ -16,5 +16,9 @@ import { TreeController, UseTreeOptions } from './type';
|
|
|
16
16
|
* <Tree tree={tree} />
|
|
17
17
|
* <Button onClick={tree.collapseAll}>Collapse all</Button>
|
|
18
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* State lives in Jotai atoms keyed by `treeId`, so anything under
|
|
21
|
+
* `ExegiaProvider` can drive this tree without the controller — name it and
|
|
22
|
+
* reach for `useTreeState(treeId)` / `useTreeActions(treeId)` elsewhere.
|
|
19
23
|
*/
|
|
20
24
|
export declare function useTree(options: UseTreeOptions): TreeController;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import { AvatarPrimitive } from '../ui/avatar';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export interface UserAvatarProps extends Omit<AvatarPrimitive.Root.Props, "children"> {
|
|
4
|
-
/** Image URL. Without one the initials show immediately — no skeleton. */
|
|
5
|
-
src?: string;
|
|
6
|
-
/** Drives the initials, and the alt text unless `alt` overrides it. */
|
|
7
|
-
name?: string;
|
|
8
|
-
/** Overrides the initials derived from `name`. */
|
|
9
|
-
initials?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Alt text for the image. Pass "" when adjacent text already names the
|
|
12
|
-
* person — the image is then decorative.
|
|
13
|
-
*/
|
|
14
|
-
alt?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Force the skeleton, for when the identity itself is still being fetched.
|
|
17
|
-
* Omitted, it follows the image: a passed `src` skeletons until it resolves.
|
|
18
|
-
*/
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/** "Jenny Hamilton" → "JH", "luna" → "L". */
|
|
22
|
-
export declare function initialsFrom(name: string): string;
|
|
23
1
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* the image resolves rather than flashing initials that are about to be
|
|
28
|
-
* replaced. A failed load settles on the initials.
|
|
2
|
+
* Back-compat path. The avatar moved to `components/user-avatar/` (split
|
|
3
|
+
* into component / atoms / hooks); this module re-exports it so existing
|
|
4
|
+
* imports keep resolving to the one implementation. Prefer the new path.
|
|
29
5
|
*/
|
|
30
|
-
export
|
|
6
|
+
export { UserAvatar, initialsFrom, useUserAvatar, useUserAvatarActions, useUserAvatarState, } from '../user-avatar';
|
|
7
|
+
export type { UserAvatarProps, UserPresence } from '../user-avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { UserAvatarProps } from './type';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
* Identity avatar: an image when one is given, initials otherwise.
|
|
5
|
-
*
|
|
6
|
-
* A passed `src` is assumed to be remote, so the slot holds a skeleton until
|
|
7
|
-
* the image resolves rather than flashing initials that are about to be
|
|
8
|
-
* replaced. A failed load settles on the initials.
|
|
9
|
-
*/
|
|
10
|
-
export declare function UserAvatar({ src, name, initials, alt, loading: loadingProp, className, ...props }: UserAvatarProps): React.ReactElement;
|
|
3
|
+
export declare function UserAvatar({ src, name, initials, alt, loading: loadingProp, presence: presenceProp, bezel, avatarId, className, style, ...props }: UserAvatarProps): React.ReactElement;
|
|
@@ -4,7 +4,12 @@ import { Fallback } from './fallback';
|
|
|
4
4
|
export { AudioWave } from './audio-wave';
|
|
5
5
|
export { UserAvatar } from './component';
|
|
6
6
|
export { Fallback } from './fallback';
|
|
7
|
+
export { PresenceBadge } from './presence-badge';
|
|
7
8
|
export { initialsFrom } from './utils';
|
|
9
|
+
export { useUserAvatar } from './use-user-avatar';
|
|
10
|
+
export type { UseUserAvatarOptions, UserAvatarBinding } from './use-user-avatar';
|
|
11
|
+
export { useUserAvatarActions, useUserAvatarState } from './use-user-avatar-state';
|
|
12
|
+
export { DEFAULT_BEZEL_ANGLE, removeUserAvatarInstance, resetUserAvatarAtom, setUserAvatarBezelAngleAtom, setUserAvatarPresenceAtom, toggleUserAvatarPresenceAtom, userAvatarBezelAngleAtom, userAvatarIsOnlineAtom, userAvatarPresenceAtom, userAvatarStateAtom, } from './user-avatar-atom';
|
|
8
13
|
export type * from './type';
|
|
9
14
|
export declare const Avatar: {
|
|
10
15
|
AudioWave: typeof AudioWave;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UserPresence } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Corner dot naming whether the person is reachable. Sits on the avatar
|
|
4
|
+
* frame, outside the clipped circle, with a background-coloured ring so it
|
|
5
|
+
* reads against any image. Colour is not the only signal: `offline` is a
|
|
6
|
+
* hollow ring, `online` a filled dot, and the label is spelled out for AT.
|
|
7
|
+
*
|
|
8
|
+
* `lightAngle` (degrees clockwise from 12) lays a faint sheen across the dot
|
|
9
|
+
* from that side — the same angle the avatar's bezel is lit from, so the two
|
|
10
|
+
* highlights agree and the badge reads as a bead sitting in the same light.
|
|
11
|
+
*/
|
|
12
|
+
export declare function PresenceBadge({ presence, lightAngle, className, }: {
|
|
13
|
+
presence: UserPresence;
|
|
14
|
+
lightAngle?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AvatarPrimitive } from '../ui/avatar';
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
export type ImageStatus = Parameters<NonNullable<AvatarPrimitive.Image.Props["onLoadingStatusChange"]>>[0];
|
|
4
|
+
/** Whether the person is reachable right now — drawn as the corner badge. */
|
|
5
|
+
export type UserPresence = "online" | "offline";
|
|
6
|
+
/** Key for one avatar's state in the store. Any stable string; `useUserAvatar`
|
|
7
|
+
* generates one when the component does not name itself. */
|
|
8
|
+
export type UserAvatarInstanceId = string;
|
|
4
9
|
export interface UserAvatarProps extends Omit<AvatarPrimitive.Root.Props, "children"> {
|
|
5
10
|
/** Image URL. Without one the initials show immediately — no skeleton. */
|
|
6
11
|
src?: string;
|
|
@@ -18,6 +23,54 @@ export interface UserAvatarProps extends Omit<AvatarPrimitive.Root.Props, "child
|
|
|
18
23
|
* Omitted, it follows the image: a passed `src` skeletons until it resolves.
|
|
19
24
|
*/
|
|
20
25
|
loading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Corner badge: a green dot for `online`, a hollow grey ring for `offline`.
|
|
28
|
+
* Omitted, no badge — unless the avatar is driven by id and something set
|
|
29
|
+
* its presence in the store. Controlled when passed.
|
|
30
|
+
*/
|
|
31
|
+
presence?: UserPresence;
|
|
32
|
+
/**
|
|
33
|
+
* Embossed rim whose highlight follows the pointer, so the avatar reads as
|
|
34
|
+
* a lit bezel rather than a flat disc. Light and dark aware, and with a
|
|
35
|
+
* photo it samples the image's rim lightness (CORS permitting) to weight
|
|
36
|
+
* highlight against shadow, so the emboss reads on a dark portrait and a
|
|
37
|
+
* pale one alike. Static under reduced motion. On by default — pass
|
|
38
|
+
* `false` for a flat disc.
|
|
39
|
+
*/
|
|
40
|
+
bezel?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Name this avatar's slice of the store so `useUserAvatarState(id)` /
|
|
43
|
+
* `useUserAvatarActions(id)` can read or drive it from anywhere under
|
|
44
|
+
* `ExegiaProvider`. Unnamed avatars key off `useId` and are dropped on
|
|
45
|
+
* unmount.
|
|
46
|
+
*/
|
|
47
|
+
avatarId?: UserAvatarInstanceId;
|
|
48
|
+
}
|
|
49
|
+
/** Everything the store knows about one avatar. */
|
|
50
|
+
export interface UserAvatarState {
|
|
51
|
+
presence: UserPresence | null;
|
|
52
|
+
/** Bezel light direction in degrees, clockwise from 12 o'clock. Continuous
|
|
53
|
+
* (may leave [0, 360)) so the rim's CSS rotation never spins the long way;
|
|
54
|
+
* `((a % 360) + 360) % 360` if you need it normalised. */
|
|
55
|
+
bezelAngle: number;
|
|
56
|
+
imageStatus: ImageStatus;
|
|
57
|
+
/** Perceived lightness of the loaded image's rim, 0 (black) → 1 (white),
|
|
58
|
+
* or `null` while unknown — no image yet, or one that could not be sampled
|
|
59
|
+
* (non-CORS host, no canvas). The bezel's highlight/shadow alphas follow
|
|
60
|
+
* it so the emboss reads on a dark photo and a pale one alike. */
|
|
61
|
+
imageTone: number | null;
|
|
62
|
+
}
|
|
63
|
+
/** Write-only handles onto one avatar. Nothing here re-renders the caller. */
|
|
64
|
+
export interface UserAvatarActions {
|
|
65
|
+
setPresence: (presence: UserPresence | null) => void;
|
|
66
|
+
togglePresence: () => void;
|
|
67
|
+
setBezelAngle: (angle: number) => void;
|
|
68
|
+
reset: () => void;
|
|
69
|
+
}
|
|
70
|
+
/** @internal Which fields the mounted component controls from props. The
|
|
71
|
+
* store must never overwrite a controlled value. */
|
|
72
|
+
export interface UserAvatarConfig {
|
|
73
|
+
controlsPresence: boolean;
|
|
21
74
|
}
|
|
22
75
|
export interface IAudioWaveProps {
|
|
23
76
|
className?: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UserAvatarActions, UserAvatarInstanceId, UserAvatarState } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Read the avatar registered under `avatarId` from anywhere below
|
|
4
|
+
* `ExegiaProvider` — no props, no ref, no provider of its own.
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const { presence } = useUserAvatarState("me")
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Returns the whole state object, so the caller re-renders on any change —
|
|
11
|
+
* including every bezel frame while a pointer moves. A component that only
|
|
12
|
+
* cares about presence should subscribe to that atom instead:
|
|
13
|
+
* `useAtomValue(userAvatarPresenceAtom("me"))`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useUserAvatarState(avatarId: UserAvatarInstanceId): UserAvatarState;
|
|
16
|
+
/**
|
|
17
|
+
* Write-only handles onto the avatar registered under `avatarId`. Nothing
|
|
18
|
+
* here subscribes, so a presence indicator elsewhere in the app can flip
|
|
19
|
+
* the badge without re-rendering when the avatar changes.
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { setPresence } = useUserAvatarActions("me")
|
|
23
|
+
* socket.on("presence", (p) => setPresence(p))
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useUserAvatarActions(avatarId: UserAvatarInstanceId): UserAvatarActions;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ImageStatus, UserAvatarInstanceId, UserPresence } from './type';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface UseUserAvatarOptions {
|
|
4
|
+
avatarId?: UserAvatarInstanceId;
|
|
5
|
+
/** Controlled presence. `undefined` leaves the store in charge. */
|
|
6
|
+
presence?: UserPresence;
|
|
7
|
+
/** Track the pointer for the bezel highlight. */
|
|
8
|
+
bezel: boolean;
|
|
9
|
+
/** Only meaningful with an image — no image, no status to track. */
|
|
10
|
+
hasImage: boolean;
|
|
11
|
+
/** The image URL, sampled for its rim lightness once it has loaded so the
|
|
12
|
+
* bezel can pick alphas that read against it. Omit to skip sampling. */
|
|
13
|
+
src?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UserAvatarBinding {
|
|
16
|
+
avatarId: UserAvatarInstanceId;
|
|
17
|
+
presence: UserPresence | null;
|
|
18
|
+
bezelAngle: number;
|
|
19
|
+
imageStatus: ImageStatus;
|
|
20
|
+
/** Rim lightness of the loaded image, 0–1, or `null` while unknown. */
|
|
21
|
+
imageTone: number | null;
|
|
22
|
+
/** Hand to the image's `onLoadingStatusChange`. Stable. */
|
|
23
|
+
setImageStatus: (status: ImageStatus) => void;
|
|
24
|
+
/** Attach to the avatar root — the bezel is lit relative to its centre. */
|
|
25
|
+
ref: React.RefObject<HTMLElement | null>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Binds one avatar to its slice of the store: projects the controlled
|
|
29
|
+
* `presence` prop, tracks the image status, and — while `bezel` is on —
|
|
30
|
+
* follows the pointer with a rAF-coalesced `pointermove` listener that turns
|
|
31
|
+
* the pointer's bearing from the avatar's centre into `bezelAngle`.
|
|
32
|
+
*
|
|
33
|
+
* Unnamed avatars key off `useId` and are dropped from the store on unmount;
|
|
34
|
+
* a named `avatarId` outlives its component so a presence set elsewhere
|
|
35
|
+
* survives a remount.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useUserAvatar(options: UseUserAvatarOptions): UserAvatarBinding;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { UserAvatarConfig, UserAvatarInstanceId, UserAvatarState, UserPresence } from './type';
|
|
2
|
+
/** Light from the top-left, the classic emboss, until a pointer moves. */
|
|
3
|
+
export declare const DEFAULT_BEZEL_ANGLE = 315;
|
|
4
|
+
type Family<AtomType> = ((id: UserAvatarInstanceId) => AtomType) & {
|
|
5
|
+
remove: (id: UserAvatarInstanceId) => void;
|
|
6
|
+
};
|
|
7
|
+
/** `null` = no badge. */
|
|
8
|
+
export declare const userAvatarPresenceAtom: Family<import('jotai').PrimitiveAtom<UserPresence | null> & {
|
|
9
|
+
init: UserPresence | null;
|
|
10
|
+
}>;
|
|
11
|
+
/** Degrees clockwise from 12 o'clock — where the bezel highlight sits. */
|
|
12
|
+
export declare const userAvatarBezelAngleAtom: Family<import('jotai').PrimitiveAtom<number> & {
|
|
13
|
+
init: number;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const userAvatarImageStatusAtom: Family<import('jotai').PrimitiveAtom<import('@base-ui/react').ImageLoadingStatus> & {
|
|
16
|
+
init: import('@base-ui/react').ImageLoadingStatus;
|
|
17
|
+
}>;
|
|
18
|
+
/** Rim lightness of the loaded image, `null` until sampled (or unsampleable). */
|
|
19
|
+
export declare const userAvatarImageToneAtom: Family<import('jotai').PrimitiveAtom<number | null> & {
|
|
20
|
+
init: number | null;
|
|
21
|
+
}>;
|
|
22
|
+
/** @internal Which fields the mounted component controls from props. */
|
|
23
|
+
export declare const userAvatarConfigAtom: Family<import('jotai').PrimitiveAtom<UserAvatarConfig> & {
|
|
24
|
+
init: UserAvatarConfig;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const userAvatarIsOnlineAtom: Family<import('jotai').Atom<boolean>>;
|
|
27
|
+
/** Whole-state read for callers that want the object; field atoms above are
|
|
28
|
+
* cheaper for components that watch one thing. */
|
|
29
|
+
export declare const userAvatarStateAtom: Family<import('jotai').Atom<UserAvatarState>>;
|
|
30
|
+
/** Inert while a `presence` prop controls the avatar — the prop is truth. */
|
|
31
|
+
export declare const setUserAvatarPresenceAtom: Family<import('jotai').WritableAtom<null, [presence: UserPresence | null], void> & {
|
|
32
|
+
init: null;
|
|
33
|
+
}>;
|
|
34
|
+
/** online ⇄ offline; a badge-less avatar comes online. */
|
|
35
|
+
export declare const toggleUserAvatarPresenceAtom: Family<import('jotai').WritableAtom<null, [], void> & {
|
|
36
|
+
init: null;
|
|
37
|
+
}>;
|
|
38
|
+
/** Stored as given — continuous, not wrapped into [0, 360): the rim is
|
|
39
|
+
* rotated with a CSS transition, and an unwrapped angle is what lets a
|
|
40
|
+
* 359° → 1° move take the short way round. Written on every pointer frame,
|
|
41
|
+
* so it stays a bare set — no config gate, no side effects. */
|
|
42
|
+
export declare const setUserAvatarBezelAngleAtom: Family<import('jotai').WritableAtom<null, [angle: number], void> & {
|
|
43
|
+
init: null;
|
|
44
|
+
}>;
|
|
45
|
+
/** @internal Reported by the image element; drives the skeleton. */
|
|
46
|
+
export declare const setUserAvatarImageStatusAtom: Family<import('jotai').WritableAtom<null, [status: import('@base-ui/react').ImageLoadingStatus], void> & {
|
|
47
|
+
init: null;
|
|
48
|
+
}>;
|
|
49
|
+
/** @internal Written by the hook once the loaded image has been sampled;
|
|
50
|
+
* cleared (null) when the image changes or goes away. Clamped to [0, 1]. */
|
|
51
|
+
export declare const setUserAvatarImageToneAtom: Family<import('jotai').WritableAtom<null, [tone: number | null], void> & {
|
|
52
|
+
init: null;
|
|
53
|
+
}>;
|
|
54
|
+
/** @internal Projection of the mounted component's controlled props. */
|
|
55
|
+
export declare const projectUserAvatarPropsAtom: Family<import('jotai').WritableAtom<null, [config: UserAvatarConfig, presence: UserPresence | null | undefined], void> & {
|
|
56
|
+
init: null;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const resetUserAvatarAtom: Family<import('jotai').WritableAtom<null, [], void> & {
|
|
59
|
+
init: null;
|
|
60
|
+
}>;
|
|
61
|
+
/** Forget an avatar entirely — every family drops the key so the store can
|
|
62
|
+
* release its state. Call on teardown of a named instance. */
|
|
63
|
+
export declare function removeUserAvatarInstance(id: UserAvatarInstanceId): void;
|
|
64
|
+
export {};
|
|
@@ -1,2 +1,24 @@
|
|
|
1
1
|
/** "Jenny Hamilton" → "JH", "luna" → "L". */
|
|
2
2
|
export declare function initialsFrom(name: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Average perceived lightness, 0 (black) → 1 (white), of an image's outer
|
|
5
|
+
* band — the pixels the bezel ring overlays — or `null` when it cannot be
|
|
6
|
+
* measured: no DOM/canvas (SSR, test DOM), a decode failure, or a host
|
|
7
|
+
* without CORS headers (the sample needs a CORS-clean image; the avatar's
|
|
8
|
+
* own `<img>` is left untouched, so a non-CORS host still displays).
|
|
9
|
+
* Results are memoised per `src`, so a room of the same face samples once.
|
|
10
|
+
*/
|
|
11
|
+
export declare function measureRimTone(src: string): Promise<number | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Bezel highlight/shadow alphas for an image whose rim lightness is `tone`
|
|
14
|
+
* (0 → 1). Against a dark rim the white highlight is eased off (it glares)
|
|
15
|
+
* and the black shadow pushed up (it has to darken mid-tones to register);
|
|
16
|
+
* against a pale rim the reverse — the highlight can be full (it barely
|
|
17
|
+
* shows) and the shadow is what carries the emboss, so it sits lighter.
|
|
18
|
+
* Linear between; the end points are tuned by eye on a dark and a light
|
|
19
|
+
* photo in both themes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function bezelAlphasForTone(tone: number): {
|
|
22
|
+
hi: number;
|
|
23
|
+
lo: number;
|
|
24
|
+
};
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -20,11 +20,14 @@ export * from './components/ui/separator';
|
|
|
20
20
|
export * from './components/ui/skeleton';
|
|
21
21
|
export * from './components/ui/spinner';
|
|
22
22
|
export * from './components/ui/textarea';
|
|
23
|
+
export * from './components/composed/logo';
|
|
23
24
|
export * from './components/composed/password-input';
|
|
24
25
|
export * from './components/composed/social-providers';
|
|
25
26
|
export * from './components/composed/tree';
|
|
26
|
-
export
|
|
27
|
+
export { DEFAULT_BEZEL_ANGLE, PresenceBadge, UserAvatar, initialsFrom, removeUserAvatarInstance, resetUserAvatarAtom, setUserAvatarBezelAngleAtom, setUserAvatarPresenceAtom, toggleUserAvatarPresenceAtom, useUserAvatar, useUserAvatarActions, useUserAvatarState, userAvatarBezelAngleAtom, userAvatarIsOnlineAtom, userAvatarPresenceAtom, userAvatarStateAtom, } from './components/user-avatar';
|
|
28
|
+
export type { UseUserAvatarOptions, UserAvatarActions, UserAvatarBinding, UserAvatarInstanceId, UserAvatarProps, UserAvatarState, UserPresence, } from './components/user-avatar';
|
|
27
29
|
export * from './components/blocks/auth/auth-shell';
|
|
30
|
+
export * from './components/blocks/auth/auth-state';
|
|
28
31
|
export * from './components/blocks/auth/code-auth-block';
|
|
29
32
|
export * from './components/blocks/auth/forgot-password-block';
|
|
30
33
|
export * from './components/blocks/auth/linked-accounts-block';
|
|
@@ -34,14 +37,14 @@ export * from './components/blocks/auth/passkey-manager-block';
|
|
|
34
37
|
export * from './components/blocks/auth/passkey-sign-in-block';
|
|
35
38
|
export * from './components/blocks/auth/signup-block';
|
|
36
39
|
export * from './components/blocks/auth/update-password-block';
|
|
37
|
-
export * from './components/blocks/nav/sidebar-block';
|
|
38
40
|
export * from './components/blocks/nav/sidebar';
|
|
39
41
|
export * from './components/blocks/shell';
|
|
40
42
|
export { default as ShellLayout } from './components/blocks/shell';
|
|
41
43
|
export * from './components/blocks/scaffold';
|
|
42
44
|
export { default as Layout } from './components/blocks/layout';
|
|
43
|
-
export * from './components/blocks/profile
|
|
45
|
+
export * from './components/blocks/profile';
|
|
44
46
|
export * from './components/motion/shared-layout-bg';
|
|
47
|
+
export * from './state';
|
|
45
48
|
export { AnimatedPanel as AnimatedSidebar, AnimatedPanelProvider as AnimatedSidebarProvider, AnimatedPanelTrigger as AnimatedSidebarTrigger, AnimatedPanelInset as AnimatedSidebarInset, } from './components/blocks/shell';
|
|
46
49
|
export * from './lib/auth-accent';
|
|
47
50
|
export * from './lib/ease';
|