@exegia/corpora-ui 0.12.0 → 0.14.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 (29) hide show
  1. package/dist-lib/components/blocks/layout.d.ts +5 -0
  2. package/dist-lib/components/{agents → blocks/nav/sidebar}/ai-sidebar.d.ts +1 -1
  3. package/dist-lib/components/{agents → blocks/nav/sidebar}/index.d.ts +1 -0
  4. package/dist-lib/components/{agents → blocks/nav/sidebar}/sidebar-row.d.ts +1 -1
  5. package/dist-lib/components/blocks/shell/index.d.ts +4 -1
  6. package/dist-lib/components/blocks/shell/type.d.ts +1 -0
  7. package/dist-lib/index.d.ts +4 -1
  8. package/dist-lib/index.js +1363 -644
  9. package/dist-lib/index.js.map +1 -1
  10. package/package.json +1 -1
  11. package/src/components/blocks/layout.ts +7 -0
  12. package/src/components/{agents → blocks/nav/sidebar}/ai-sidebar.tsx +13 -17
  13. package/src/components/{agents → blocks/nav/sidebar}/index.ts +2 -1
  14. package/src/components/{agents → blocks/nav/sidebar}/marquee-label.tsx +1 -1
  15. package/src/components/{agents → blocks/nav/sidebar}/sidebar-icon.tsx +1 -1
  16. package/src/components/{agents → blocks/nav/sidebar}/sidebar-row.tsx +4 -4
  17. package/src/components/{agents → blocks/nav/sidebar}/use-ai-sidebar.ts +2 -2
  18. package/src/components/{agents → blocks/nav/sidebar}/utils.ts +1 -1
  19. package/src/components/blocks/shell/index.ts +6 -1
  20. package/src/components/blocks/shell/type.ts +2 -22
  21. package/src/index.ts +4 -1
  22. /package/dist-lib/components/{agents → blocks/nav/sidebar}/__tests__/ai-sidebar.test.d.ts +0 -0
  23. /package/dist-lib/components/{agents → blocks/nav/sidebar}/marquee-label.d.ts +0 -0
  24. /package/dist-lib/components/{agents → blocks/nav/sidebar}/sidebar-icon.d.ts +0 -0
  25. /package/dist-lib/components/{agents → blocks/nav/sidebar}/type.d.ts +0 -0
  26. /package/dist-lib/components/{agents → blocks/nav/sidebar}/use-ai-sidebar.d.ts +0 -0
  27. /package/dist-lib/components/{agents → blocks/nav/sidebar}/utils.d.ts +0 -0
  28. /package/src/components/{agents → blocks/nav/sidebar}/__tests__/ai-sidebar.test.tsx +0 -0
  29. /package/src/components/{agents → blocks/nav/sidebar}/type.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exegia/corpora-ui",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "shadcn-ready React UI library for the corpora manuscript-research apps.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,7 @@
1
+ import ShellLayout from "@/components/blocks/shell"
2
+
3
+ const Layout = {
4
+ Main: ShellLayout
5
+ }
6
+
7
+ export default Layout
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { AnimatePresence } from "motion/react";
4
4
  import { cn } from "@/lib/utils";
5
- import type { AISidebarProps } from "@/components/agents/type.ts"
6
- import { useAISidebar } from "@/components/agents/use-ai-sidebar.ts"
7
- import { ResourceRow } from "@/components/agents/sidebar-row.tsx"
5
+ import type { AISidebarProps, FlatResource } from "./type"
6
+ import { useAISidebar, type UseAISidebarOptions } from "./use-ai-sidebar"
7
+ import { ResourceRow } from "./sidebar-row"
8
8
 
9
9
  export function AISidebar({
10
10
  renderIcon,
@@ -41,7 +41,7 @@ export function AISidebar({
41
41
  commitRename,
42
42
  handleMenuOpenChange,
43
43
  setRowRef,
44
- } = useAISidebar(options);
44
+ } = useAISidebar(options as UseAISidebarOptions);
45
45
 
46
46
  return (
47
47
  <>
@@ -53,13 +53,13 @@ export function AISidebar({
53
53
  onDrop={handleDrop}
54
54
  onMouseLeave={clearHover}
55
55
  className={cn(
56
- "relative flex min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden",
57
- draggingId && "select-none pb-9",
58
- className,
56
+ "relative min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden",
57
+ draggingId && "pb-9 select-none",
58
+ className
59
59
  )}
60
60
  >
61
61
  <AnimatePresence initial={false}>
62
- {flat.map((row) => (
62
+ {flat.map((row: FlatResource) => (
63
63
  <ResourceRow
64
64
  key={row.item.id}
65
65
  row={row}
@@ -72,14 +72,10 @@ export function AISidebar({
72
72
  renaming={renamingId === row.item.id}
73
73
  hoverActive={hoveredId !== null && !draggingId}
74
74
  hoverPill={
75
- hoveredId === row.item.id &&
76
- !draggingId &&
77
- !row.item.disabled
75
+ hoveredId === row.item.id && !draggingId && !row.item.disabled
78
76
  }
79
77
  hoverLayoutId={hoverLayoutId}
80
- onHoverChange={(hovered) =>
81
- handleRowHover(row.item.id, hovered)
82
- }
78
+ onHoverChange={(hovered) => handleRowHover(row.item.id, hovered)}
83
79
  onFocus={() => setFocusedId(row.item.id)}
84
80
  onSelect={() => select(row.item.id)}
85
81
  onToggle={() => toggle(row.item.id)}
@@ -100,7 +96,7 @@ export function AISidebar({
100
96
  ))}
101
97
  </AnimatePresence>
102
98
 
103
- {draggingId ? (
99
+ {draggingId && (
104
100
  <div
105
101
  aria-hidden="true"
106
102
  data-active={dropTarget?.id === null || undefined}
@@ -108,11 +104,11 @@ export function AISidebar({
108
104
  >
109
105
  Move to top level
110
106
  </div>
111
- ) : null}
107
+ )}
112
108
  </div>
113
109
  <span className="sr-only" aria-live="polite">
114
110
  {announcement}
115
111
  </span>
116
112
  </>
117
- );
113
+ )
118
114
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import { AISidebar } from "./ai-sidebar"
3
2
  import { MarqueeLabel } from "./marquee-label.tsx"
4
3
  import { ResourceRow } from "./sidebar-row.tsx"
@@ -6,6 +5,8 @@ import { SidebarIcon } from "./sidebar-icon.tsx"
6
5
  export { useAISidebar, type UseAISidebarOptions } from "./use-ai-sidebar.ts"
7
6
  export type * from "./type.ts"
8
7
 
8
+ export { AISidebar, MarqueeLabel, ResourceRow, SidebarIcon }
9
+
9
10
  export const Sidebar = {
10
11
  Wrapper: AISidebar,
11
12
  MarqueeLabel,
@@ -1,6 +1,6 @@
1
1
  import { motion, useReducedMotion } from "motion/react"
2
2
  import { useEffect, useRef, useState } from "react"
3
- import { ROW_REVEAL } from "@/components/agents/utils.ts"
3
+ import { ROW_REVEAL } from "./utils.ts"
4
4
 
5
5
  export function MarqueeLabel({
6
6
  active,
@@ -1,4 +1,4 @@
1
- import type { SidebarResource } from "@/components/agents/type.ts"
1
+ import type { SidebarResource } from "./type.ts"
2
2
  import { Bookmark, FileText, Folder, FolderOpen } from "lucide-react"
3
3
 
4
4
  export function SidebarIcon(item: SidebarResource, expanded: boolean) {
@@ -5,7 +5,7 @@ import {
5
5
  useState,
6
6
  type MouseEvent,
7
7
  } from "react"
8
- import type { ResourceRowProps } from "@/components/agents/type.ts"
8
+ import type { ResourceRowProps } from "./type"
9
9
  import {
10
10
  AnimatePresence,
11
11
  motion,
@@ -15,9 +15,9 @@ import {
15
15
  import { ChevronRight, MoreHorizontal, Pencil } from "lucide-react"
16
16
  import { SPRING_LAYOUT } from "@/lib/ease.ts"
17
17
  import { cn } from "@/lib/utils.ts"
18
- import { canContain } from "@/components/agents/utils.ts"
19
- import { SidebarIcon } from "@/components/agents/sidebar-icon.tsx"
20
- import { MarqueeLabel } from "@/components/agents/marquee-label.tsx"
18
+ import { canContain } from "./utils"
19
+ import { SidebarIcon } from "./sidebar-icon"
20
+ import { MarqueeLabel } from "./marquee-label"
21
21
  import {
22
22
  MorphPopover,
23
23
  MorphPopoverContent,
@@ -16,7 +16,7 @@ import type {
16
16
  FlatResource,
17
17
  SidebarResource,
18
18
  SidebarResourceMove,
19
- } from "@/components/agents/type.ts"
19
+ } from "./type.ts"
20
20
  import {
21
21
  canContain,
22
22
  containsResource,
@@ -24,7 +24,7 @@ import {
24
24
  flattenResources,
25
25
  moveResource,
26
26
  renameResource,
27
- } from "@/components/agents/utils.ts"
27
+ } from "./utils.ts"
28
28
 
29
29
  export type UseAISidebarOptions = Pick<
30
30
  AISidebarProps,
@@ -1,5 +1,5 @@
1
1
  import { EASE_OUT } from "@/lib/ease.ts"
2
- import type { FlatResource, SidebarResource, SidebarResourceDropPosition, SidebarResourceMove } from "@/components/agents/type.ts"
2
+ import type { FlatResource, SidebarResource, SidebarResourceDropPosition, SidebarResourceMove } from "./type.ts"
3
3
 
4
4
  export const ROW_REVEAL = {
5
5
  duration: 0.16,
@@ -1 +1,6 @@
1
- export * from "./shell-layout"
1
+ import { ShellLayout } from "./shell-layout"
2
+
3
+ export type * from "./type"
4
+ export * from "./utils"
5
+
6
+ export { ShellLayout as default }
@@ -1,9 +1,4 @@
1
- // import type {
2
- // ISidebarNavItem,
3
- // ISidebarNavSection,
4
- // ISidebarNavSubItem,
5
- // } from "@/components/blocks/nav/types"
6
-
1
+ import React from "react"
7
2
 
8
3
  export interface ShellAction {
9
4
  id: string
@@ -21,16 +16,6 @@ export interface ShellWorkspace {
21
16
 
22
17
  export interface ShellLayoutProps {
23
18
  children?: React.ReactNode
24
- // sections?: ISidebarNavSection[]
25
- //activeId?: string
26
- // onNavigate?: (item: ISidebarNavItem | ISidebarNavSubItem) => void
27
- // workspace?: ShellWorkspace
28
- //sidebarFooter?: React.ReactNode
29
- // topActions?: ShellAction[]
30
- //title?: React.ReactNode
31
- //eyebrow?: React.ReactNode
32
- //searchPlaceholder?: string
33
- //searchShortcut?: React.ReactNode
34
19
  open?: boolean
35
20
  defaultOpen?: boolean
36
21
  onOpenChange?: (open: boolean) => void
@@ -40,11 +25,6 @@ export interface ShellLayoutProps {
40
25
  rightOpen?: boolean
41
26
  defaultRightOpen?: boolean
42
27
  onRightOpenChange?: (open: boolean) => void
43
- // openMobile?: boolean
44
- //defaultOpenMobile?: boolean
45
- //onOpenMobileChange?: (open: boolean) => void
46
28
  className?: string
47
- variant: 'web' | 'desktop'
48
- //sidebarClassName?: string
49
- //contentClassName?: string
29
+ variant: 'web' | 'desktop'
50
30
  }
package/src/index.ts CHANGED
@@ -40,7 +40,10 @@ export * from "./components/blocks/auth/passkey-sign-in-block"
40
40
  export * from "./components/blocks/auth/signup-block"
41
41
  export * from "./components/blocks/auth/update-password-block"
42
42
  export * from "./components/blocks/nav/sidebar-block"
43
- export * from "./components/blocks/shell/shell-layout"
43
+ export * from "./components/blocks/nav/sidebar"
44
+ export * from "./components/blocks/shell"
45
+ export { default as ShellLayout } from "./components/blocks/shell"
46
+ export { default as Layout } from "./components/blocks/layout"
44
47
  export * from "./components/blocks/profile/profile-card-block"
45
48
 
46
49
  // motion primitives