{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agenda-card",
  "type": "registry:item",
  "title": "Agenda Card",
  "description": "A day-at-a-glance widget: the date lit by a blue glow, events sliding in, and a bar that fills for the one under way.",
  "categories": [
    "data"
  ],
  "dependencies": [
    "react-native-reanimated",
    "react-native-svg",
    "react-native-worklets"
  ],
  "registryDependencies": [
    "https://kinetik-ui.dev/r/kinetik-tokens.json",
    "https://kinetik-ui.dev/r/kinetik-motion.json",
    "https://kinetik-ui.dev/r/kinetik-haptics.json"
  ],
  "files": [
    {
      "path": "src/components/kinetik/agenda-card.tsx",
      "type": "registry:file",
      "target": "~/components/kinetik/agenda-card.tsx",
      "content": "import { useEffect, useState } from 'react';\nimport { Pressable, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport Animated, {\n  useAnimatedStyle,\n  useSharedValue,\n  withDelay,\n  withSequence,\n  withSpring,\n  withTiming,\n} from 'react-native-reanimated';\nimport Svg, { Path } from 'react-native-svg';\n\nimport { useHaptic } from '../../lib/kinetik/hooks/use-haptic';\nimport { useReduceMotion } from '../../lib/kinetik/hooks/use-reduce-motion';\nimport { spring, timing } from '../../lib/kinetik/motion/motion';\nimport { gradient } from '../../lib/kinetik/tokens/gradient';\nimport { useKinetikTheme } from '../../lib/kinetik/tokens/theme';\nimport { glow, minTouchTarget, palettes, withAlpha } from '../../lib/kinetik/tokens/tokens';\n\nexport type AgendaEvent = {\n  id: string;\n  title: string;\n  /** Start and end times as shown, e.g. \"10:00\" and \"10:30\". */\n  start: string;\n  end: string;\n  /** Colour of the event's bar. Defaults to a blue, violet and teal rotation. */\n  color?: string;\n  /** For the event happening now: how far through it is, 0–1. Its bar fills to match. */\n  progress?: number;\n};\n\nexport type AgendaCardProps = {\n  /** The big date, e.g. \"Oct 30\". */\n  date: string;\n  /** The day under it, e.g. \"Thursday\". */\n  weekday: string;\n  /** Events in order. The first `limit` are listed. */\n  events: readonly AgendaEvent[];\n  /** How many events the day has, if more than are listed. Defaults to `events.length`. */\n  total?: number;\n  /** Most events listed at once. Defaults to 3. */\n  limit?: number;\n  /** Heading over the list. Defaults to \"Upcoming\". */\n  heading?: string;\n  /** Shows the round add button. */\n  onAdd?: () => void;\n  onEventPress?: (event: AgendaEvent) => void;\n  /** A tap on add. Defaults to true. */\n  haptics?: boolean;\n  style?: StyleProp<ViewStyle>;\n};\n\n// Plus from Tabler Icons (MIT, https://tabler.io/icons), via iconstack.io.\nconst PLUS = 'M12 5l0 14 M5 12l14 0';\nconst TONES = ['hsl(224, 90%, 62%)', 'hsl(272, 72%, 62%)', 'hsl(188, 80%, 50%)'];\n\n/**\n * A day-at-a-glance widget: the date on a panel lit from below by a blue\n * glow, and the next events sliding in one after another, each with a colour\n * bar that fills for the event under way. The add button turns as it is\n * pressed, and new events slide in at their place in the list.\n */\nexport function AgendaCard({\n  date,\n  weekday,\n  events,\n  total,\n  limit = 3,\n  heading = 'Upcoming',\n  onAdd,\n  onEventPress,\n  haptics = true,\n  style,\n}: AgendaCardProps) {\n  const { radius, space, font } = useKinetikTheme();\n  // A night-blue slab on either theme, so the glow reads.\n  const colors = palettes.dark;\n  const reduced = useReduceMotion();\n  const haptic = useHaptic(haptics);\n  const count = total ?? events.length;\n  const shown = events.slice(0, limit);\n  // Events there from the start stagger in; ones added later slide in at once.\n  const [first] = useState(() => new Set(events.map((e) => e.id)));\n\n  const light = useSharedValue(reduced ? 1 : 0);\n  useEffect(() => {\n    if (!reduced) light.set(withTiming(1, { duration: 900 }));\n  }, [reduced, light]);\n  const bump = useSharedValue(1);\n  useEffect(() => {\n    if (!reduced)\n      bump.set(withSequence(withTiming(0.7, { duration: 0 }), withSpring(1, spring('bouncy'))));\n  }, [count, reduced, bump]);\n  const turn = useSharedValue(0);\n\n  const glowStyle = useAnimatedStyle(() => ({\n    opacity: light.get(),\n    transform: [{ translateY: (1 - light.get()) * 30 }],\n  }));\n  const countStyle = useAnimatedStyle(() => ({ transform: [{ scale: bump.get() }] }));\n  const plus = useAnimatedStyle(() => ({ transform: [{ rotate: `${turn.get()}deg` }] }));\n\n  return (\n    <View\n      style={[\n        styles.card,\n        {\n          backgroundColor: 'hsl(224, 20%, 14%)',\n          borderColor: withAlpha(colors.highlight, 0.08),\n          borderRadius: radius.xl + 4,\n          padding: space[3],\n          gap: space[4],\n        },\n        style,\n      ]}\n    >\n      <View\n        accessible\n        accessibilityLabel={`${weekday}, ${date}, ${count} ${count === 1 ? 'event' : 'events'}`}\n        style={[styles.panel, { borderRadius: radius.xl - 4, padding: space[4] }]}\n      >\n        <Animated.View\n          pointerEvents=\"none\"\n          style={[\n            StyleSheet.absoluteFill,\n            gradient(\n              'linear-gradient(180deg, hsl(226, 32%, 6%) 0%, hsl(226, 34%, 8%) 42%, hsl(222, 78%, 42%) 82%, hsl(214, 95%, 72%) 100%)',\n            ),\n            glowStyle,\n          ]}\n        />\n        <Text\n          numberOfLines={1}\n          adjustsFontSizeToFit\n          style={{\n            color: colors.highlight,\n            fontSize: font.size['3xl'],\n            fontWeight: font.weight.semibold,\n            letterSpacing: font.tracking.tight,\n          }}\n        >\n          {date}\n        </Text>\n        <View style={styles.push} />\n        <Text\n          style={{\n            color: colors.highlight,\n            fontSize: font.size.lg,\n            fontWeight: font.weight.semibold,\n          }}\n        >\n          {weekday}\n        </Text>\n        <Animated.View style={[styles.countRow, countStyle]}>\n          <Text\n            style={{\n              color: colors.highlight,\n              fontSize: font.size.lg,\n              fontWeight: font.weight.semibold,\n            }}\n          >\n            {count} {count === 1 ? 'event' : 'events'}\n          </Text>\n        </Animated.View>\n      </View>\n\n      <View style={[styles.list, { gap: space[2], paddingTop: space[2] }]}>\n        <Text\n          accessibilityRole=\"header\"\n          style={{ color: colors.textMuted, fontSize: font.size.sm, letterSpacing: 0.6 }}\n        >\n          {heading.toUpperCase()}\n        </Text>\n        {shown.map((event, i) => (\n          <Row\n            key={event.id}\n            event={event}\n            tone={event.color ?? TONES[i % TONES.length]!}\n            delay={first.has(event.id) ? 160 + i * 110 : 0}\n            onPress={onEventPress ? () => onEventPress(event) : undefined}\n          />\n        ))}\n      </View>\n\n      {onAdd ? (\n        <Pressable\n          accessibilityRole=\"button\"\n          accessibilityLabel=\"Add event\"\n          onPress={() => {\n            haptic('tap');\n            if (!reduced)\n              turn.set(\n                withSequence(withSpring(90, spring('snappy')), withTiming(0, { duration: 0 })),\n              );\n            onAdd();\n          }}\n          style={({ pressed }) => [\n            styles.fab,\n            {\n              backgroundColor: colors.surface,\n              borderColor: withAlpha(colors.sky, 0.55),\n              boxShadow: glow(colors.sky),\n              transform: [{ scale: pressed ? 0.92 : 1 }],\n            },\n          ]}\n        >\n          <Animated.View style={plus}>\n            <Svg width={22} height={22} viewBox=\"0 0 24 24\" fill=\"none\">\n              <Path d={PLUS} stroke={colors.highlight} strokeWidth={2.2} strokeLinecap=\"round\" />\n            </Svg>\n          </Animated.View>\n        </Pressable>\n      ) : null}\n    </View>\n  );\n}\n\nfunction Row({\n  event,\n  tone,\n  delay,\n  onPress,\n}: {\n  event: AgendaEvent;\n  tone: string;\n  delay: number;\n  onPress?: () => void;\n}) {\n  const { font } = useKinetikTheme();\n  const colors = palettes.dark;\n  const reduced = useReduceMotion();\n  const enter = useSharedValue(reduced ? 1 : 0);\n  const share = Math.max(0, Math.min(1, event.progress ?? 0));\n  const fillTo = useSharedValue(reduced ? share : 0);\n  // The delay only matters on mount.\n  const [wait] = useState(delay);\n  useEffect(() => {\n    if (reduced) return;\n    enter.set(withDelay(wait, withSpring(1, spring('smooth'))));\n  }, [wait, reduced, enter]);\n  useEffect(() => {\n    fillTo.set(reduced ? share : withDelay(400, withTiming(share, timing('slow'))));\n  }, [share, reduced, fillTo]);\n\n  const style = useAnimatedStyle(() => ({\n    opacity: enter.get(),\n    transform: [{ translateX: (1 - enter.get()) * 16 }],\n  }));\n  const fill = useAnimatedStyle(() => ({ height: `${fillTo.get() * 100}%` }));\n  const now = event.progress !== undefined;\n\n  const label = `${event.title}, ${event.start} to ${event.end}${now ? ', now' : ''}`;\n  const content = (\n    <>\n      <View\n        style={[styles.bar, { backgroundColor: now ? withAlpha(colors.highlight, 0.16) : tone }]}\n      >\n        {now ? <Animated.View style={[styles.barFill, { backgroundColor: tone }, fill]} /> : null}\n      </View>\n      <View style={styles.grow}>\n        <Text numberOfLines={1} style={{ color: colors.text, fontSize: font.size.md + 1 }}>\n          {event.title}\n        </Text>\n        <Text\n          style={{\n            color: colors.textSubtle,\n            fontSize: font.size.sm,\n            fontVariant: ['tabular-nums'],\n          }}\n        >\n          {event.start} - {event.end}\n        </Text>\n      </View>\n    </>\n  );\n\n  return (\n    <Animated.View style={style}>\n      {onPress ? (\n        <Pressable\n          accessibilityRole=\"button\"\n          accessibilityLabel={label}\n          onPress={onPress}\n          style={styles.row}\n        >\n          {content}\n        </Pressable>\n      ) : (\n        <View accessible accessibilityLabel={label} style={styles.row}>\n          {content}\n        </View>\n      )}\n    </Animated.View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  card: { flexDirection: 'row', borderWidth: 1 },\n  panel: {\n    width: '46%',\n    minHeight: 200,\n    overflow: 'hidden',\n    backgroundColor: 'hsl(226, 32%, 6%)',\n  },\n  push: { flex: 1 },\n  countRow: { alignSelf: 'flex-start', transformOrigin: 'left center' },\n  list: { flex: 1, minWidth: 0 },\n  row: { flexDirection: 'row', gap: 12, minHeight: minTouchTarget, alignItems: 'stretch' },\n  bar: { width: 3, borderRadius: 2, overflow: 'hidden' },\n  barFill: { width: 3, borderRadius: 2 },\n  grow: { flex: 1, minWidth: 0, justifyContent: 'center' },\n  fab: {\n    position: 'absolute',\n    right: 14,\n    bottom: 14,\n    width: 48,\n    height: 48,\n    borderRadius: 24,\n    borderWidth: 1.5,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n});\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "kind": "component",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "category": "data",
    "web": "live",
    "perf": {
      "budget": "The glow, rows and fill run short UI-thread springs and timings on arrival and on change. Nothing animates at rest.",
      "measurements": [
        {
          "device": "Pixel 9 emulator, API 35",
          "kind": "emulator",
          "date": "2026-10-14",
          "build": "release",
          "frameMs": 17,
          "p90Ms": 18,
          "baselineMs": 17,
          "jankyPercent": 1.15,
          "atRest": "idle",
          "memoryMb": 150
        }
      ]
    },
    "a11y": {
      "reducedMotion": "The glow, rows and fills appear in place; the add button does not turn.",
      "screenReader": "The date reads as one line (\"Thursday, Oct 30, 6 events\"), each event as one line (\"Focus Time, 11:00 to 13:00, now\"), and the add button as \"Add event\".",
      "touchTarget": "Event rows are at least 44 pt tall; the add button is 48 pt."
    },
    "requires": "React Native New Architecture (Reanimated 4)",
    "guide": "## Usage\n\n```tsx\nimport { AgendaCard } from '@/components/kinetik/agenda-card';\n\n<AgendaCard\n  date=\"Oct 30\"\n  weekday=\"Thursday\"\n  events={[\n    { id: '1', title: 'Team standup', start: '09:30', end: '09:45' },\n    { id: '2', title: 'Deep work', start: '10:00', end: '12:00', progress: 0.4 },\n    { id: '3', title: 'Design review', start: '13:30', end: '14:30' },\n  ]}\n  onAdd={openNewEvent}\n  onEventPress={(e) => router.push(`/events/${e.id}`)}\n/>;\n```\n\n## When to use\n\n- A home-screen style glance at today: the date, a count and the next few events.\n\n## When not to use\n\n- Full calendars or long agendas: use Month Calendar or Timeline.\n\n## Notes\n\n- The first `limit` events are listed (3 by default). `total` sets the count on the date panel when the day has more.\n- Give the event under way a `progress` (0–1): its bar dims and fills to match, and screen readers hear \"now\".\n- Events added later slide in at once; the ones there from the start stagger in.\n- The card is night-blue on both themes so the glow reads. The add button only shows with `onAdd`.\n"
  },
  "docs": "Prefer `npx kinetik-ui add agenda-card`: it installs dependencies with expo install, so versions match your Expo SDK."
}
