@exxatdesignux/ui 0.0.9 → 0.2.6

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.
@@ -2,7 +2,11 @@
2
2
 
3
3
  import * as React from "react"
4
4
  import { Button } from "@/components/ui/button"
5
- import { PageHeader } from "@/components/page-header"
5
+ import {
6
+ PageHeader,
7
+ type PageHeaderCollaborator,
8
+ type PageHeaderVariant,
9
+ } from "@/components/page-header"
6
10
  import {
7
11
  DropdownMenu,
8
12
  DropdownMenuContent,
@@ -11,31 +15,56 @@ import {
11
15
  DropdownMenuTrigger,
12
16
  } from "@/components/ui/dropdown-menu"
13
17
  import { Tip } from "@/components/ui/tip"
18
+ import { QUESTION_BANK_HEADER_COLLABORATORS } from "@/lib/mock/question-bank-header-collaborators"
14
19
 
15
20
  export interface QuestionBankPageHeaderProps {
21
+ /** Defaults to “Question bank” when omitted (template hub). */
22
+ title?: string
16
23
  questionCount: number
17
24
  onNewQuestion: () => void
18
25
  onExport: () => void
19
26
  showMetrics: boolean
20
27
  onToggleMetrics: () => void
21
28
  showTitleBlock?: boolean
29
+ /** `collaboration` adds access line + collaborator stack + invite before CTAs. */
30
+ variant?: PageHeaderVariant
31
+ /** Optional role / access row when `variant="collaboration"` (badge + copy). */
32
+ accessInfo?: React.ReactNode
33
+ collaborators?: PageHeaderCollaborator[]
34
+ collaboratorDisplayLimit?: number
35
+ onAddCollaborator?: () => void
36
+ addCollaboratorLabel?: string
22
37
  }
23
38
 
24
39
  export function QuestionBankPageHeader({
40
+ title = "Question bank",
25
41
  questionCount,
26
42
  onNewQuestion,
27
43
  onExport,
28
44
  showMetrics,
29
45
  onToggleMetrics,
30
46
  showTitleBlock = true,
47
+ variant = "default",
48
+ accessInfo,
49
+ collaborators = QUESTION_BANK_HEADER_COLLABORATORS,
50
+ collaboratorDisplayLimit = 4,
51
+ onAddCollaborator = () => {},
52
+ addCollaboratorLabel = "Invite people",
31
53
  }: QuestionBankPageHeaderProps) {
32
54
  const [moreOpen, setMoreOpen] = React.useState(false)
33
55
  const countLine = `${questionCount} ${questionCount === 1 ? "question" : "questions"} · Last updated now`
56
+ const resolvedAccess = variant === "collaboration" ? accessInfo : undefined
34
57
 
35
58
  return (
36
59
  <PageHeader
37
- title="Question bank"
60
+ title={title}
38
61
  subtitle={countLine}
62
+ variant={variant}
63
+ accessInfo={resolvedAccess}
64
+ collaborators={variant === "collaboration" ? collaborators : undefined}
65
+ collaboratorDisplayLimit={collaboratorDisplayLimit}
66
+ onAddCollaborator={variant === "collaboration" ? onAddCollaborator : undefined}
67
+ addCollaboratorLabel={addCollaboratorLabel}
39
68
  showTitleBlock={showTitleBlock}
40
69
  actions={(
41
70
  <div className="flex items-center gap-2" role="group" aria-label="Question bank actions">
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Demo collaborators for Question bank collaboration header (stacked faces).
3
+ */
4
+
5
+ import { stockPortraitUrl } from "@/lib/stock-portrait"
6
+ import type { PageHeaderCollaborator } from "@/components/page-header"
7
+
8
+ export const QUESTION_BANK_HEADER_COLLABORATORS: PageHeaderCollaborator[] = [
9
+ { id: "1", name: "Alex Morgan", imageUrl: stockPortraitUrl("qb-collab-alex"), initials: "AM" },
10
+ { id: "2", name: "Jordan Lee", imageUrl: stockPortraitUrl("qb-collab-jordan"), initials: "JL" },
11
+ { id: "3", name: "Sam Rivera", imageUrl: stockPortraitUrl("qb-collab-sam"), initials: "SR" },
12
+ { id: "4", name: "Taylor Kim", imageUrl: stockPortraitUrl("qb-collab-taylor"), initials: "TK" },
13
+ { id: "5", name: "Riley Patel", imageUrl: stockPortraitUrl("qb-collab-riley"), initials: "RP" },
14
+ ]