nili/ui
كل المكوّنات

ActivityFeed

عرض شامل
٢٤ تصدير٣ محور تنويع٣٦ خاصيّة٤ ملف
import { ActivityFeed, ActivityFeedFile, ActivityFeedFooter, ActivityFeedHeader, ActivityFeedItemType, ActivityFeedKey } from '@nili/ui';

هذه صفحة العرض الشامل الخاصة بالمكتبة، معروضة حيّة. غيّر اللغة أو السمة من الأعلى وسَتتبعك.

أنواع العناصر

أربعة أنواع من الصفوف: نص عادي، وصفّ بإجراءات، وصفّ يحمل ملفًا، وصفّ يقتبس رسالة. ويحدّد النوع أي فتحة تُرسم، والفتحات خصائص لا أبناء كي لا يُركّب الصف بشكل خاطئ.

  • AL
    علّقت Ada Lovelace
    نظام التصميم

    يبدو جيدًا بالنسبة إليّ — سأطلقه.

  • GH
    تريد Grace Hopper الانضمام إلى مساحة العمل
  • KJ
    شاركت Katherine Johnson ملفًا
  • RP
    ردّت Radia Perlman
    هل ننقل المراجعة إلى صباح الخميس؟
import { ActivityFeedItem, Avatar, Button } from "@nili/ui"

export function Example() {
  return (
    <>
      <ActivityFeedItem
        type="basic"
        avatar={<Avatar size="sm" name="Ada Lovelace" tone="blue" />}
        title="Ada Lovelace commented"
        timestamp="8 min ago"
        subject="Design system"
        description="This looks good to me — shipping it."
      />

      <ActivityFeedItem
        type="button"
        avatar={<Avatar size="sm" name="Grace Hopper" tone="purple" />}
        title="Grace Hopper wants to join"
        timestamp="1 h ago"
        actions={
          <>
            <Button size="xs">Accept</Button>
            <Button size="xs" appearance="stroke">Decline</Button>
          </>
        }
      />

      <ActivityFeedItem
        type="file"
        title="Katherine shared a file"
        file={{ name: "annual-report.pdf", size: "4mb", href: "#" }}
      />

      <ActivityFeedItem
        type="message"
        title="Radia replied"
        message="Can we move the review to Thursday?"
      />
    </>
  )
}

الصفوف غير المقروءة والقابلة للاختيار

يحوّل onSelect العنوان إلى زر حقيقي يمتد على البطاقة — فيصير الصف قابلًا للنقر بينما تبقى الإجراءات والقائمة بداخله أزرارًا منفصلة قابلة للتركيز. أما صفّ يحمل onClick على الغلاف فيبتلعها كلها.

  • AL
    جديد
    نظام التصميم
  • BL
import { ActivityFeedItem } from "@nili/ui"

export function Example() {
  return (
    <>
      <ActivityFeedItem
        unread
        onSelect={() => open(notification)}
        title="Ada Lovelace mentioned you"
        timestamp="8 min ago"
        badge={<Badge size="small" color="blue" appearance="lighter">New</Badge>}
      />
      <ActivityFeedItem
        onSelect={() => open(notification)}
        title="Already read"
        timestamp="2 days ago"
      />
    </>
  )
}

اللوحة كاملة

الترويسة وصفّ الألسنة والتذييل كلها فتحات في ActivityFeed. والألسنة أزرار عادية لا نسخة من Tabs — فهي ترشّح قائمة واحدة في مكانها بدل تبديل اللوحات، وتسميتها tablist كذبة على قارئ الشاشة.

اللسان: all

الإشعارات

  • AL
    نظام التصميم

    هل يمكنك إلقاء نظرة على ألوان Badge الجديدة؟

  • GH
  • KJ
import {
  ActivityFeed, ActivityFeedItem, ActivityFeedTab,
  ActivityFeedTabSeparator, ActivityFeedFooter, LinkButton,
} from "@nili/ui"

export function Example() {
  const [tab, setTab] = useState("all")

  return (
    <ActivityFeed
      label="Notifications"
      title="Notifications"
      headerAction={<LinkButton color="primary" size="sm">Mark all as read</LinkButton>}
      tabs={
        <>
          <ActivityFeedTab selected={tab === "all"} onClick={() => setTab("all")}>
            All
          </ActivityFeedTab>
          <ActivityFeedTab
            selected={tab === "unread"}
            onClick={() => setTab("unread")}
            count={3}
          >
            Unread
          </ActivityFeedTab>
          <ActivityFeedTabSeparator />
          <ActivityFeedTab selected={tab === "mentions"} onClick={() => setTab("mentions")}>
            Mentions
          </ActivityFeedTab>
        </>
      }
      footer={
        <ActivityFeedFooter
          hint={<><ActivityFeedKey>↑</ActivityFeedKey><ActivityFeedKey>↓</ActivityFeedKey> to navigate</>}
          action={<LinkButton href="#" size="sm">See all activity</LinkButton>}
        />
      }
    >
      …
    </ActivityFeed>
  )
}