agentic-ds-kit 0.1.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/AGENTS.md +10 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/contracts/accordion.json +38 -0
- package/contracts/alert.json +57 -0
- package/contracts/alertdialog.json +89 -0
- package/contracts/appheader.json +140 -0
- package/contracts/appnav.json +72 -0
- package/contracts/avatar.json +63 -0
- package/contracts/avatargroup.json +83 -0
- package/contracts/badge.json +92 -0
- package/contracts/barchart.json +55 -0
- package/contracts/breadcrumb.json +76 -0
- package/contracts/button.json +120 -0
- package/contracts/buttongroup.json +48 -0
- package/contracts/calendar.json +93 -0
- package/contracts/card.json +123 -0
- package/contracts/carousel.json +98 -0
- package/contracts/cell.json +203 -0
- package/contracts/chat.json +131 -0
- package/contracts/checkbox.json +101 -0
- package/contracts/collapsible.json +66 -0
- package/contracts/command.json +84 -0
- package/contracts/datatable.json +126 -0
- package/contracts/datepicker.json +102 -0
- package/contracts/drawer.json +93 -0
- package/contracts/dropdownmenu.json +190 -0
- package/contracts/empty.json +79 -0
- package/contracts/field.json +49 -0
- package/contracts/fieldset.json +29 -0
- package/contracts/headercell.json +107 -0
- package/contracts/index.json +478 -0
- package/contracts/input.json +119 -0
- package/contracts/inputotp.json +119 -0
- package/contracts/insightcard.json +130 -0
- package/contracts/linechart.json +51 -0
- package/contracts/loadinganimation.json +33 -0
- package/contracts/modal.json +100 -0
- package/contracts/modalcard.json +88 -0
- package/contracts/navigationmenu.json +65 -0
- package/contracts/numbertransition.json +33 -0
- package/contracts/pageheader.json +101 -0
- package/contracts/pagination.json +85 -0
- package/contracts/patterns/activity.json +30 -0
- package/contracts/patterns/assistant-workspace.json +16 -0
- package/contracts/patterns/dashboard.json +12 -0
- package/contracts/patterns/empty-first-run.json +15 -0
- package/contracts/patterns/inbox.json +32 -0
- package/contracts/patterns/invite-members.json +14 -0
- package/contracts/patterns/list-detail.json +13 -0
- package/contracts/patterns/settings-form.json +13 -0
- package/contracts/piechart.json +68 -0
- package/contracts/progress.json +124 -0
- package/contracts/progresssteps.json +91 -0
- package/contracts/radiogroup.json +132 -0
- package/contracts/scoreboard.json +46 -0
- package/contracts/scorecard.json +124 -0
- package/contracts/section.json +97 -0
- package/contracts/select.json +130 -0
- package/contracts/shimmertext.json +33 -0
- package/contracts/sidenav.json +133 -0
- package/contracts/slider.json +81 -0
- package/contracts/spinner.json +52 -0
- package/contracts/switch.json +94 -0
- package/contracts/table.json +92 -0
- package/contracts/tabs.json +90 -0
- package/contracts/textarea.json +54 -0
- package/contracts/thinkinganimation.json +32 -0
- package/contracts/timeline.json +49 -0
- package/contracts/toast.json +104 -0
- package/contracts/tooltip.json +66 -0
- package/lib/tokens.css +637 -0
- package/package.json +60 -0
- package/skills/prototype-from-kit/SKILL.md +29 -0
- package/src/index.ts +71 -0
- package/tokens/tokens.json +725 -0
- package/ui/Accordion/Accordion.module.css +68 -0
- package/ui/Accordion/Accordion.tsx +51 -0
- package/ui/Accordion/Accordion.types.ts +10 -0
- package/ui/Accordion/index.ts +2 -0
- package/ui/Alert/Alert.module.css +62 -0
- package/ui/Alert/Alert.tsx +27 -0
- package/ui/Alert/Alert.types.ts +7 -0
- package/ui/Alert/index.ts +2 -0
- package/ui/AlertDialog/AlertDialog.module.css +71 -0
- package/ui/AlertDialog/AlertDialog.tsx +109 -0
- package/ui/AlertDialog/AlertDialog.types.ts +14 -0
- package/ui/AlertDialog/index.ts +6 -0
- package/ui/AppHeader/AppHeader.module.css +120 -0
- package/ui/AppHeader/AppHeader.tsx +70 -0
- package/ui/AppHeader/AppHeader.types.ts +28 -0
- package/ui/AppHeader/index.ts +2 -0
- package/ui/AppNav/AppNav.module.css +168 -0
- package/ui/AppNav/AppNav.tsx +137 -0
- package/ui/AppNav/AppNav.types.ts +24 -0
- package/ui/AppNav/index.ts +2 -0
- package/ui/Avatar/Avatar.module.css +52 -0
- package/ui/Avatar/Avatar.tsx +62 -0
- package/ui/Avatar/Avatar.types.ts +8 -0
- package/ui/Avatar/index.ts +2 -0
- package/ui/AvatarGroup/AvatarGroup.module.css +49 -0
- package/ui/AvatarGroup/AvatarGroup.tsx +29 -0
- package/ui/AvatarGroup/AvatarGroup.types.ts +16 -0
- package/ui/AvatarGroup/index.ts +2 -0
- package/ui/Badge/Badge.module.css +92 -0
- package/ui/Badge/Badge.tsx +43 -0
- package/ui/Badge/Badge.types.ts +11 -0
- package/ui/Badge/index.ts +2 -0
- package/ui/BarChart/BarChart.module.css +56 -0
- package/ui/BarChart/BarChart.tsx +380 -0
- package/ui/BarChart/BarChart.types.ts +18 -0
- package/ui/BarChart/index.ts +2 -0
- package/ui/Breadcrumb/Breadcrumb.module.css +64 -0
- package/ui/Breadcrumb/Breadcrumb.tsx +89 -0
- package/ui/Breadcrumb/Breadcrumb.types.ts +14 -0
- package/ui/Breadcrumb/index.ts +2 -0
- package/ui/Button/Button.module.css +101 -0
- package/ui/Button/Button.tsx +49 -0
- package/ui/Button/Button.types.ts +18 -0
- package/ui/Button/index.ts +2 -0
- package/ui/Button/lucideName.tsx +188 -0
- package/ui/ButtonGroup/ButtonGroup.module.css +31 -0
- package/ui/ButtonGroup/ButtonGroup.tsx +12 -0
- package/ui/ButtonGroup/ButtonGroup.types.ts +6 -0
- package/ui/ButtonGroup/index.ts +2 -0
- package/ui/Calendar/Calendar.module.css +146 -0
- package/ui/Calendar/Calendar.tsx +296 -0
- package/ui/Calendar/Calendar.types.ts +11 -0
- package/ui/Calendar/index.ts +2 -0
- package/ui/Card/Card.module.css +95 -0
- package/ui/Card/Card.tsx +69 -0
- package/ui/Card/Card.types.ts +23 -0
- package/ui/Card/index.ts +2 -0
- package/ui/Carousel/Carousel.module.css +114 -0
- package/ui/Carousel/Carousel.tsx +152 -0
- package/ui/Carousel/Carousel.types.ts +17 -0
- package/ui/Carousel/index.ts +7 -0
- package/ui/Cell/Cell.module.css +133 -0
- package/ui/Cell/Cell.tsx +300 -0
- package/ui/Cell/Cell.types.ts +69 -0
- package/ui/Cell/index.ts +11 -0
- package/ui/Chat/Chat.module.css +149 -0
- package/ui/Chat/Chat.tsx +175 -0
- package/ui/Chat/Chat.types.ts +39 -0
- package/ui/Chat/index.ts +2 -0
- package/ui/Checkbox/Checkbox.module.css +135 -0
- package/ui/Checkbox/Checkbox.tsx +70 -0
- package/ui/Checkbox/Checkbox.types.ts +15 -0
- package/ui/Checkbox/index.ts +2 -0
- package/ui/Collapsible/Collapsible.module.css +68 -0
- package/ui/Collapsible/Collapsible.tsx +59 -0
- package/ui/Collapsible/Collapsible.types.ts +9 -0
- package/ui/Collapsible/index.ts +2 -0
- package/ui/Command/Command.module.css +138 -0
- package/ui/Command/Command.tsx +152 -0
- package/ui/Command/Command.types.ts +20 -0
- package/ui/Command/index.ts +2 -0
- package/ui/DataTable/DataTable.module.css +211 -0
- package/ui/DataTable/DataTable.tsx +429 -0
- package/ui/DataTable/DataTable.types.ts +35 -0
- package/ui/DataTable/index.ts +8 -0
- package/ui/DatePicker/DatePicker.module.css +44 -0
- package/ui/DatePicker/DatePicker.tsx +123 -0
- package/ui/DatePicker/DatePicker.types.ts +15 -0
- package/ui/DatePicker/index.ts +2 -0
- package/ui/Drawer/Drawer.module.css +204 -0
- package/ui/Drawer/Drawer.tsx +112 -0
- package/ui/Drawer/Drawer.types.ts +14 -0
- package/ui/Drawer/index.ts +2 -0
- package/ui/DropdownMenu/DropdownMenu.module.css +319 -0
- package/ui/DropdownMenu/DropdownMenu.tsx +580 -0
- package/ui/DropdownMenu/DropdownMenu.types.ts +48 -0
- package/ui/DropdownMenu/index.ts +8 -0
- package/ui/Empty/Empty.module.css +68 -0
- package/ui/Empty/Empty.tsx +35 -0
- package/ui/Empty/Empty.types.ts +10 -0
- package/ui/Empty/index.ts +2 -0
- package/ui/Field/Field.module.css +66 -0
- package/ui/Field/Field.tsx +46 -0
- package/ui/Field/Field.types.ts +12 -0
- package/ui/Field/index.ts +2 -0
- package/ui/FieldSet/FieldSet.module.css +30 -0
- package/ui/FieldSet/FieldSet.tsx +14 -0
- package/ui/FieldSet/FieldSet.types.ts +7 -0
- package/ui/FieldSet/index.ts +2 -0
- package/ui/HeaderCell/HeaderCell.module.css +85 -0
- package/ui/HeaderCell/HeaderCell.tsx +71 -0
- package/ui/HeaderCell/HeaderCell.types.ts +18 -0
- package/ui/HeaderCell/index.ts +2 -0
- package/ui/Input/Input.module.css +59 -0
- package/ui/Input/Input.tsx +65 -0
- package/ui/Input/Input.types.ts +22 -0
- package/ui/Input/index.ts +2 -0
- package/ui/InputOTP/InputOTP.module.css +139 -0
- package/ui/InputOTP/InputOTP.tsx +136 -0
- package/ui/InputOTP/InputOTP.types.ts +19 -0
- package/ui/InputOTP/index.ts +2 -0
- package/ui/InsightCard/InsightCard.module.css +166 -0
- package/ui/InsightCard/InsightCard.tsx +90 -0
- package/ui/InsightCard/InsightCard.types.ts +20 -0
- package/ui/InsightCard/index.ts +7 -0
- package/ui/LineChart/LineChart.module.css +93 -0
- package/ui/LineChart/LineChart.tsx +424 -0
- package/ui/LineChart/LineChart.types.ts +19 -0
- package/ui/LineChart/index.ts +2 -0
- package/ui/LoadingAnimation/LoadingAnimation.module.css +66 -0
- package/ui/LoadingAnimation/LoadingAnimation.tsx +41 -0
- package/ui/LoadingAnimation/LoadingAnimation.types.ts +9 -0
- package/ui/LoadingAnimation/index.ts +6 -0
- package/ui/Modal/Modal.module.css +48 -0
- package/ui/Modal/Modal.tsx +114 -0
- package/ui/Modal/Modal.types.ts +15 -0
- package/ui/Modal/index.ts +2 -0
- package/ui/ModalCard/ModalCard.module.css +137 -0
- package/ui/ModalCard/ModalCard.tsx +58 -0
- package/ui/ModalCard/ModalCard.types.ts +15 -0
- package/ui/ModalCard/index.ts +2 -0
- package/ui/NavigationMenu/NavigationMenu.module.css +31 -0
- package/ui/NavigationMenu/NavigationMenu.tsx +57 -0
- package/ui/NavigationMenu/NavigationMenu.types.ts +22 -0
- package/ui/NavigationMenu/index.ts +7 -0
- package/ui/NumberTransition/NumberTransition.module.css +110 -0
- package/ui/NumberTransition/NumberTransition.tsx +78 -0
- package/ui/NumberTransition/NumberTransition.types.ts +9 -0
- package/ui/NumberTransition/index.ts +2 -0
- package/ui/PageHeader/PageHeader.module.css +57 -0
- package/ui/PageHeader/PageHeader.tsx +39 -0
- package/ui/PageHeader/PageHeader.types.ts +12 -0
- package/ui/PageHeader/index.ts +2 -0
- package/ui/Pagination/Pagination.module.css +19 -0
- package/ui/Pagination/Pagination.tsx +147 -0
- package/ui/Pagination/Pagination.types.ts +12 -0
- package/ui/Pagination/index.ts +2 -0
- package/ui/PieChart/PieChart.module.css +116 -0
- package/ui/PieChart/PieChart.tsx +293 -0
- package/ui/PieChart/PieChart.types.ts +22 -0
- package/ui/PieChart/index.ts +2 -0
- package/ui/Progress/Progress.module.css +226 -0
- package/ui/Progress/Progress.tsx +167 -0
- package/ui/Progress/Progress.types.ts +15 -0
- package/ui/Progress/index.ts +8 -0
- package/ui/ProgressSteps/ProgressSteps.module.css +210 -0
- package/ui/ProgressSteps/ProgressSteps.tsx +105 -0
- package/ui/ProgressSteps/ProgressSteps.types.ts +19 -0
- package/ui/ProgressSteps/index.ts +8 -0
- package/ui/RadioGroup/RadioGroup.module.css +284 -0
- package/ui/RadioGroup/RadioGroup.tsx +116 -0
- package/ui/RadioGroup/RadioGroup.types.ts +30 -0
- package/ui/RadioGroup/index.ts +8 -0
- package/ui/Scoreboard/Scoreboard.module.css +53 -0
- package/ui/Scoreboard/Scoreboard.tsx +41 -0
- package/ui/Scoreboard/Scoreboard.types.ts +7 -0
- package/ui/Scoreboard/index.ts +2 -0
- package/ui/Scorecard/Scorecard.module.css +150 -0
- package/ui/Scorecard/Scorecard.tsx +92 -0
- package/ui/Scorecard/Scorecard.types.ts +18 -0
- package/ui/Scorecard/index.ts +2 -0
- package/ui/Section/Section.module.css +104 -0
- package/ui/Section/Section.tsx +75 -0
- package/ui/Section/Section.types.ts +15 -0
- package/ui/Section/index.ts +2 -0
- package/ui/Select/Select.module.css +7 -0
- package/ui/Select/Select.tsx +113 -0
- package/ui/Select/Select.types.ts +26 -0
- package/ui/Select/index.ts +2 -0
- package/ui/ShimmerText/ShimmerText.module.css +46 -0
- package/ui/ShimmerText/ShimmerText.tsx +48 -0
- package/ui/ShimmerText/ShimmerText.types.ts +12 -0
- package/ui/ShimmerText/index.ts +2 -0
- package/ui/SideNav/SideNav.module.css +347 -0
- package/ui/SideNav/SideNav.tsx +222 -0
- package/ui/SideNav/SideNav.types.ts +42 -0
- package/ui/SideNav/index.ts +8 -0
- package/ui/Slider/Slider.module.css +105 -0
- package/ui/Slider/Slider.tsx +187 -0
- package/ui/Slider/Slider.types.ts +11 -0
- package/ui/Slider/index.ts +2 -0
- package/ui/Spinner/Spinner.module.css +58 -0
- package/ui/Spinner/Spinner.tsx +19 -0
- package/ui/Spinner/Spinner.types.ts +6 -0
- package/ui/Spinner/index.ts +2 -0
- package/ui/Switch/Switch.module.css +189 -0
- package/ui/Switch/Switch.tsx +65 -0
- package/ui/Switch/Switch.types.ts +12 -0
- package/ui/Switch/index.ts +2 -0
- package/ui/Table/Table.module.css +132 -0
- package/ui/Table/Table.tsx +108 -0
- package/ui/Table/Table.types.ts +26 -0
- package/ui/Table/index.ts +8 -0
- package/ui/Tabs/Tabs.module.css +162 -0
- package/ui/Tabs/Tabs.tsx +150 -0
- package/ui/Tabs/Tabs.types.ts +21 -0
- package/ui/Tabs/index.ts +2 -0
- package/ui/Textarea/Textarea.module.css +74 -0
- package/ui/Textarea/Textarea.tsx +38 -0
- package/ui/Textarea/Textarea.types.ts +14 -0
- package/ui/Textarea/index.ts +2 -0
- package/ui/ThinkingAnimation/ThinkingAnimation.module.css +75 -0
- package/ui/ThinkingAnimation/ThinkingAnimation.tsx +31 -0
- package/ui/ThinkingAnimation/ThinkingAnimation.types.ts +8 -0
- package/ui/ThinkingAnimation/index.ts +2 -0
- package/ui/Timeline/Timeline.module.css +99 -0
- package/ui/Timeline/Timeline.tsx +47 -0
- package/ui/Timeline/Timeline.types.ts +16 -0
- package/ui/Timeline/index.ts +2 -0
- package/ui/Toast/Toast.module.css +133 -0
- package/ui/Toast/Toast.tsx +89 -0
- package/ui/Toast/Toast.types.ts +17 -0
- package/ui/Toast/index.ts +2 -0
- package/ui/Tooltip/Tooltip.module.css +111 -0
- package/ui/Tooltip/Tooltip.tsx +101 -0
- package/ui/Tooltip/index.ts +2 -0
- package/ui/patterns/ActivityPattern/ActivityFeed.tsx +77 -0
- package/ui/patterns/ActivityPattern/ActivityPattern.tsx +120 -0
- package/ui/patterns/ActivityPattern/ActivityTasks.tsx +86 -0
- package/ui/patterns/ActivityPattern/TaskDrawer.module.css +39 -0
- package/ui/patterns/ActivityPattern/TaskDrawer.tsx +186 -0
- package/ui/patterns/ActivityPattern/index.ts +2 -0
- package/ui/patterns/AssistantWorkspacePattern/AssistantWorkspacePattern.module.css +16 -0
- package/ui/patterns/AssistantWorkspacePattern/AssistantWorkspacePattern.tsx +159 -0
- package/ui/patterns/AssistantWorkspacePattern/index.ts +2 -0
- package/ui/patterns/DashboardPattern/DashboardPattern.tsx +102 -0
- package/ui/patterns/DashboardPattern/index.ts +1 -0
- package/ui/patterns/DashboardPattern/patterns.module.css +6 -0
- package/ui/patterns/EmptyFirstRunPattern/EmptyFirstRunPattern.tsx +125 -0
- package/ui/patterns/EmptyFirstRunPattern/index.ts +2 -0
- package/ui/patterns/InboxPattern/InboxPattern.module.css +40 -0
- package/ui/patterns/InboxPattern/InboxPattern.tsx +192 -0
- package/ui/patterns/InboxPattern/InboxReplyDrawer.tsx +97 -0
- package/ui/patterns/InboxPattern/inbox-data.ts +101 -0
- package/ui/patterns/InboxPattern/index.ts +2 -0
- package/ui/patterns/InviteMembersPattern/InviteMembersPattern.tsx +148 -0
- package/ui/patterns/InviteMembersPattern/index.ts +2 -0
- package/ui/patterns/ListDetailPattern/ListDetailPattern.module.css +34 -0
- package/ui/patterns/ListDetailPattern/ListDetailPattern.tsx +145 -0
- package/ui/patterns/ListDetailPattern/index.ts +2 -0
- package/ui/patterns/SettingsFormPattern/SettingsFormPattern.module.css +12 -0
- package/ui/patterns/SettingsFormPattern/SettingsFormPattern.tsx +89 -0
- package/ui/patterns/SettingsFormPattern/index.ts +3 -0
- package/ui/shared/ChartFrame.module.css +295 -0
- package/ui/shared/ChartFrame.tsx +87 -0
- package/ui/shared/chartMath.ts +228 -0
- package/ui/shared/controls.module.css +48 -0
- package/ui/shared/useChartSize.ts +22 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { ModalCard } from "../ModalCard";
|
|
6
|
+
import type { ModalProps } from "./Modal.types";
|
|
7
|
+
import styles from "./Modal.module.css";
|
|
8
|
+
|
|
9
|
+
export type { ModalProps, ModalSize } from "./Modal.types";
|
|
10
|
+
|
|
11
|
+
const FOCUSABLE = "a, button, input, select, textarea, [tabindex]:not([tabindex='-1'])";
|
|
12
|
+
|
|
13
|
+
export function Modal({
|
|
14
|
+
open,
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
size = "md",
|
|
18
|
+
showClose = true,
|
|
19
|
+
onClose,
|
|
20
|
+
children,
|
|
21
|
+
footer,
|
|
22
|
+
contained = false,
|
|
23
|
+
}: ModalProps) {
|
|
24
|
+
const cardRef = useRef<HTMLDivElement>(null);
|
|
25
|
+
const onCloseRef = useRef(onClose);
|
|
26
|
+
const previousFocusRef = useRef<HTMLElement | null>(null);
|
|
27
|
+
const [mounted, setMounted] = useState(false);
|
|
28
|
+
|
|
29
|
+
onCloseRef.current = onClose;
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setMounted(true);
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!open) return;
|
|
37
|
+
|
|
38
|
+
previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
39
|
+
|
|
40
|
+
const root = cardRef.current;
|
|
41
|
+
if (!root) return;
|
|
42
|
+
|
|
43
|
+
const getFocusable = () => Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE));
|
|
44
|
+
const firstFocusable = getFocusable()[0];
|
|
45
|
+
(firstFocusable ?? root).focus();
|
|
46
|
+
|
|
47
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
48
|
+
if (event.key === "Escape") {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
onCloseRef.current();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (event.key !== "Tab") return;
|
|
55
|
+
|
|
56
|
+
const items = getFocusable();
|
|
57
|
+
if (items.length === 0) return;
|
|
58
|
+
|
|
59
|
+
const first = items[0];
|
|
60
|
+
const last = items[items.length - 1];
|
|
61
|
+
const active = document.activeElement;
|
|
62
|
+
const inside = active instanceof Node && root.contains(active);
|
|
63
|
+
|
|
64
|
+
if (event.shiftKey) {
|
|
65
|
+
if (!inside || active === first) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
last.focus();
|
|
68
|
+
}
|
|
69
|
+
} else if (!inside || active === last) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
first.focus();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
document.addEventListener("keydown", onKeyDown);
|
|
76
|
+
const previousOverflow = document.body.style.overflow;
|
|
77
|
+
if (!contained) {
|
|
78
|
+
document.body.style.overflow = "hidden";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return () => {
|
|
82
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
83
|
+
if (!contained) {
|
|
84
|
+
document.body.style.overflow = previousOverflow;
|
|
85
|
+
}
|
|
86
|
+
previousFocusRef.current?.focus();
|
|
87
|
+
};
|
|
88
|
+
}, [open, contained, mounted]);
|
|
89
|
+
|
|
90
|
+
if (!open) return null;
|
|
91
|
+
if (!contained && !mounted) return null;
|
|
92
|
+
|
|
93
|
+
const node = (
|
|
94
|
+
<div className={`${styles.root} ${contained ? styles.contained : ""}`}>
|
|
95
|
+
<button type="button" className={styles.scrim} aria-label="Close dialog" onClick={onClose} />
|
|
96
|
+
<ModalCard
|
|
97
|
+
ref={cardRef}
|
|
98
|
+
role="dialog"
|
|
99
|
+
aria-modal="true"
|
|
100
|
+
tabIndex={-1}
|
|
101
|
+
title={title}
|
|
102
|
+
description={description}
|
|
103
|
+
size={size}
|
|
104
|
+
onClose={showClose ? onClose : undefined}
|
|
105
|
+
footer={footer}
|
|
106
|
+
>
|
|
107
|
+
{children}
|
|
108
|
+
</ModalCard>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
if (contained) return node;
|
|
113
|
+
return createPortal(node, document.body);
|
|
114
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type ModalSize = "sm" | "md" | "lg";
|
|
4
|
+
|
|
5
|
+
export interface ModalProps {
|
|
6
|
+
open: boolean;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
size?: ModalSize;
|
|
10
|
+
showClose?: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
contained?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: var(--space-stack-xs);
|
|
4
|
+
width: min(100%, 28rem);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
padding: var(--space-inset-lg);
|
|
7
|
+
overflow: auto;
|
|
8
|
+
background-color: var(--surface-page);
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: var(--radius-control-lg);
|
|
11
|
+
box-shadow: var(--shadow-modal);
|
|
12
|
+
outline: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sm {
|
|
16
|
+
width: min(100%, 22rem);
|
|
17
|
+
padding: var(--space-inset-md);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.md {
|
|
21
|
+
width: min(100%, 28rem);
|
|
22
|
+
padding: var(--space-inset-lg);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.lg {
|
|
26
|
+
width: min(100%, 36rem);
|
|
27
|
+
padding: var(--space-inset-xl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.card[role="dialog"] {
|
|
31
|
+
max-height: min(90vh, 40rem, 100%);
|
|
32
|
+
min-height: 0;
|
|
33
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
animation: cardEnter var(--motion-modal-duration) var(--motion-modal-easing);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.header {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
gap: var(--space-inline-sm);
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.copy {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: var(--space-stack-xs);
|
|
50
|
+
min-width: 0;
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.title {
|
|
55
|
+
margin: 0;
|
|
56
|
+
font-family: var(--font-sans);
|
|
57
|
+
font-size: var(--type-size-body);
|
|
58
|
+
font-weight: var(--type-weight-heading);
|
|
59
|
+
line-height: var(--type-line-heading);
|
|
60
|
+
color: var(--text-primary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sm .title {
|
|
64
|
+
font-size: var(--type-size-body-sm);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.md .title {
|
|
68
|
+
font-size: var(--type-size-body);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.lg .title {
|
|
72
|
+
font-size: var(--type-size-heading);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.description {
|
|
76
|
+
margin: 0;
|
|
77
|
+
font-family: var(--font-sans);
|
|
78
|
+
font-size: var(--type-size-body-sm);
|
|
79
|
+
line-height: var(--type-line-body);
|
|
80
|
+
color: var(--text-muted);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.close {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
width: 2rem;
|
|
89
|
+
height: 2rem;
|
|
90
|
+
margin: 0;
|
|
91
|
+
padding: 0;
|
|
92
|
+
color: var(--icon-muted);
|
|
93
|
+
background: transparent;
|
|
94
|
+
border: none;
|
|
95
|
+
border-radius: var(--radius-control-sm);
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.close:hover {
|
|
100
|
+
background-color: var(--surface-muted);
|
|
101
|
+
color: var(--icon-primary);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.close:focus-visible {
|
|
105
|
+
outline: var(--border-focus-width) solid var(--focus-ring);
|
|
106
|
+
outline-offset: var(--space-inset-2xs);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.body {
|
|
110
|
+
min-width: 0;
|
|
111
|
+
font-family: var(--font-sans);
|
|
112
|
+
font-size: var(--type-size-body);
|
|
113
|
+
line-height: var(--type-line-body);
|
|
114
|
+
color: var(--text-primary);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.card[role="dialog"] .body {
|
|
118
|
+
min-height: 0;
|
|
119
|
+
overflow: auto;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.footer {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
justify-content: flex-end;
|
|
126
|
+
gap: var(--space-inline-sm);
|
|
127
|
+
min-width: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@keyframes cardEnter {
|
|
131
|
+
from {
|
|
132
|
+
opacity: var(--opacity-0);
|
|
133
|
+
}
|
|
134
|
+
to {
|
|
135
|
+
opacity: var(--opacity-full);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, useId } from "react";
|
|
4
|
+
import { LucideByName } from "../Button/lucideName";
|
|
5
|
+
import type { ModalCardProps } from "./ModalCard.types";
|
|
6
|
+
import styles from "./ModalCard.module.css";
|
|
7
|
+
|
|
8
|
+
export type { ModalCardProps, ModalCardSize } from "./ModalCard.types";
|
|
9
|
+
|
|
10
|
+
export const ModalCard = forwardRef<HTMLDivElement, ModalCardProps>(function ModalCard(
|
|
11
|
+
{
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
size = "md",
|
|
15
|
+
onClose,
|
|
16
|
+
children,
|
|
17
|
+
footer,
|
|
18
|
+
role = "group",
|
|
19
|
+
tabIndex,
|
|
20
|
+
"aria-modal": ariaModal,
|
|
21
|
+
},
|
|
22
|
+
ref,
|
|
23
|
+
) {
|
|
24
|
+
const titleId = useId();
|
|
25
|
+
const descriptionId = useId();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
ref={ref}
|
|
30
|
+
role={role}
|
|
31
|
+
tabIndex={tabIndex}
|
|
32
|
+
aria-modal={ariaModal}
|
|
33
|
+
aria-labelledby={titleId}
|
|
34
|
+
aria-describedby={description ? descriptionId : undefined}
|
|
35
|
+
className={`${styles.card} ${styles[size]}`}
|
|
36
|
+
>
|
|
37
|
+
<header className={styles.header}>
|
|
38
|
+
<div className={styles.copy}>
|
|
39
|
+
<h2 id={titleId} className={styles.title}>
|
|
40
|
+
{title}
|
|
41
|
+
</h2>
|
|
42
|
+
{description ? (
|
|
43
|
+
<p id={descriptionId} className={styles.description}>
|
|
44
|
+
{description}
|
|
45
|
+
</p>
|
|
46
|
+
) : null}
|
|
47
|
+
</div>
|
|
48
|
+
{onClose ? (
|
|
49
|
+
<button type="button" className={styles.close} onClick={onClose} aria-label="Close">
|
|
50
|
+
<LucideByName name="X" size={16} />
|
|
51
|
+
</button>
|
|
52
|
+
) : null}
|
|
53
|
+
</header>
|
|
54
|
+
{children ? <div className={styles.body}>{children}</div> : null}
|
|
55
|
+
{footer ? <div className={styles.footer}>{footer}</div> : null}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type ModalCardSize = "sm" | "md" | "lg";
|
|
4
|
+
|
|
5
|
+
export interface ModalCardProps {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
size?: ModalCardSize;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
role?: string;
|
|
13
|
+
tabIndex?: number;
|
|
14
|
+
"aria-modal"?: boolean | "true" | "false";
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--space-1);
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.link {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 2.25rem;
|
|
12
|
+
padding-inline: var(--space-3);
|
|
13
|
+
border-radius: var(--radius-control-md);
|
|
14
|
+
color: var(--text-primary);
|
|
15
|
+
font-family: var(--font-sans);
|
|
16
|
+
font-size: var(--type-size-body-sm);
|
|
17
|
+
font-weight: var(--type-weight-label);
|
|
18
|
+
line-height: var(--type-line-body);
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.link:hover,
|
|
24
|
+
.linkActive {
|
|
25
|
+
background-color: var(--surface-muted);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.link:focus-visible {
|
|
29
|
+
outline: var(--border-focus-width) solid var(--focus-ring);
|
|
30
|
+
outline-offset: var(--space-inset-2xs);
|
|
31
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { DropdownMenu } from "../DropdownMenu";
|
|
5
|
+
import type {
|
|
6
|
+
NavigationMenuDropdownItem,
|
|
7
|
+
NavigationMenuItem,
|
|
8
|
+
NavigationMenuProps,
|
|
9
|
+
} from "./NavigationMenu.types";
|
|
10
|
+
import styles from "./NavigationMenu.module.css";
|
|
11
|
+
|
|
12
|
+
export type {
|
|
13
|
+
NavigationMenuDropdownItem,
|
|
14
|
+
NavigationMenuItem,
|
|
15
|
+
NavigationMenuLinkItem,
|
|
16
|
+
NavigationMenuProps,
|
|
17
|
+
} from "./NavigationMenu.types";
|
|
18
|
+
|
|
19
|
+
function isDropdown(item: NavigationMenuItem): item is NavigationMenuDropdownItem {
|
|
20
|
+
return "groups" in item && Array.isArray((item as NavigationMenuDropdownItem).groups);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function NavigationMenu({ items, onSelect }: NavigationMenuProps) {
|
|
24
|
+
const [openId, setOpenId] = useState<string | null>(null);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<nav className={styles.root} aria-label="Site">
|
|
28
|
+
{items.map((item) => {
|
|
29
|
+
if (isDropdown(item)) {
|
|
30
|
+
return (
|
|
31
|
+
<DropdownMenu
|
|
32
|
+
key={item.id}
|
|
33
|
+
trigger={item.label}
|
|
34
|
+
triggerStyle="nav"
|
|
35
|
+
groups={item.groups}
|
|
36
|
+
columns={item.columns}
|
|
37
|
+
open={openId === item.id}
|
|
38
|
+
onOpenChange={(next) => setOpenId(next ? item.id : null)}
|
|
39
|
+
onSelect={onSelect}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<a
|
|
45
|
+
key={item.id}
|
|
46
|
+
href={item.href}
|
|
47
|
+
className={`${styles.link}${item.active ? ` ${styles.linkActive}` : ""}`}
|
|
48
|
+
aria-current={item.active ? "page" : undefined}
|
|
49
|
+
onClick={() => onSelect?.(item.id)}
|
|
50
|
+
>
|
|
51
|
+
{item.label}
|
|
52
|
+
</a>
|
|
53
|
+
);
|
|
54
|
+
})}
|
|
55
|
+
</nav>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DropdownMenuGroup } from "../DropdownMenu/DropdownMenu.types";
|
|
2
|
+
|
|
3
|
+
export interface NavigationMenuLinkItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface NavigationMenuDropdownItem {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
groups: DropdownMenuGroup[];
|
|
14
|
+
columns?: 1 | 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type NavigationMenuItem = NavigationMenuLinkItem | NavigationMenuDropdownItem;
|
|
18
|
+
|
|
19
|
+
export interface NavigationMenuProps {
|
|
20
|
+
items: NavigationMenuItem[];
|
|
21
|
+
onSelect?: (id: string) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
--number-transition-duration: var(--motion-modal-duration);
|
|
3
|
+
display: inline-block;
|
|
4
|
+
color: var(--text-primary);
|
|
5
|
+
font-family: var(--font-sans);
|
|
6
|
+
font-size: var(--type-size-heading-sm);
|
|
7
|
+
font-weight: var(--type-weight-heading);
|
|
8
|
+
line-height: var(--type-line-heading);
|
|
9
|
+
font-variant-numeric: tabular-nums;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.content {
|
|
13
|
+
display: inline-grid;
|
|
14
|
+
grid-auto-flow: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cell {
|
|
18
|
+
display: inline-grid;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.old,
|
|
23
|
+
.new {
|
|
24
|
+
grid-area: 1 / 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.changing[data-direction="up"] .old {
|
|
28
|
+
animation: number-old-up var(--number-transition-duration) var(--motion-expand-easing) both;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.changing[data-direction="up"] .new {
|
|
32
|
+
animation: number-new-up var(--number-transition-duration) var(--motion-expand-easing) both;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.changing[data-direction="down"] .old {
|
|
36
|
+
animation: number-old-down var(--number-transition-duration) var(--motion-expand-easing) both;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.changing[data-direction="down"] .new {
|
|
40
|
+
animation: number-new-down var(--number-transition-duration) var(--motion-expand-easing) both;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sm {
|
|
44
|
+
font-size: var(--type-size-body-sm);
|
|
45
|
+
font-weight: var(--type-weight-body);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.lg {
|
|
49
|
+
font-size: var(--type-size-heading);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes number-old-up {
|
|
53
|
+
from {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
transform: translateY(0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
to {
|
|
59
|
+
opacity: 0;
|
|
60
|
+
transform: translateY(-100%);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes number-new-up {
|
|
65
|
+
from {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translateY(100%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
to {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
transform: translateY(0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@keyframes number-old-down {
|
|
77
|
+
from {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
transform: translateY(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
to {
|
|
83
|
+
opacity: 0;
|
|
84
|
+
transform: translateY(100%);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@keyframes number-new-down {
|
|
89
|
+
from {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
transform: translateY(-100%);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
to {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
transform: translateY(0);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (prefers-reduced-motion: reduce) {
|
|
101
|
+
.old {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.new {
|
|
106
|
+
opacity: 1;
|
|
107
|
+
animation: none;
|
|
108
|
+
transform: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect, useState } from "react";
|
|
4
|
+
import type { NumberTransitionProps } from "./NumberTransition.types";
|
|
5
|
+
import styles from "./NumberTransition.module.css";
|
|
6
|
+
|
|
7
|
+
export type { NumberTransitionProps, NumberTransitionSize } from "./NumberTransition.types";
|
|
8
|
+
|
|
9
|
+
function visibleCharacter(character: string): string {
|
|
10
|
+
return character === " " ? "\u00a0" : character;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function NumberTransition({
|
|
14
|
+
value,
|
|
15
|
+
format,
|
|
16
|
+
size = "md",
|
|
17
|
+
label,
|
|
18
|
+
className = "",
|
|
19
|
+
}: NumberTransitionProps) {
|
|
20
|
+
const formattedValue = String(format ? format(value) : value);
|
|
21
|
+
const numericValue = Number(value);
|
|
22
|
+
const [frame, setFrame] = useState(() => ({
|
|
23
|
+
previous: formattedValue,
|
|
24
|
+
current: formattedValue,
|
|
25
|
+
currentValue: numericValue,
|
|
26
|
+
direction: "up" as "up" | "down",
|
|
27
|
+
id: 0,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
useLayoutEffect(() => {
|
|
31
|
+
setFrame((current) => {
|
|
32
|
+
if (current.current === formattedValue) return current;
|
|
33
|
+
return {
|
|
34
|
+
previous: current.current,
|
|
35
|
+
current: formattedValue,
|
|
36
|
+
currentValue: numericValue,
|
|
37
|
+
direction:
|
|
38
|
+
Number.isFinite(numericValue) &&
|
|
39
|
+
Number.isFinite(current.currentValue) &&
|
|
40
|
+
numericValue < current.currentValue
|
|
41
|
+
? "down"
|
|
42
|
+
: "up",
|
|
43
|
+
id: current.id + 1,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}, [formattedValue, numericValue]);
|
|
47
|
+
|
|
48
|
+
const length = Math.max(frame.previous.length, frame.current.length);
|
|
49
|
+
const previousCharacters = frame.previous.padStart(length, " ").split("");
|
|
50
|
+
const currentCharacters = frame.current.padStart(length, " ").split("");
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<span
|
|
54
|
+
className={`${styles.root} ${styles[size]} ${className}`.trim()}
|
|
55
|
+
aria-label={label ?? formattedValue}
|
|
56
|
+
aria-live="polite"
|
|
57
|
+
>
|
|
58
|
+
<span className={styles.content} aria-hidden="true">
|
|
59
|
+
{currentCharacters.map((character, index) => {
|
|
60
|
+
const previousCharacter = previousCharacters[index];
|
|
61
|
+
const changed = previousCharacter !== character;
|
|
62
|
+
return (
|
|
63
|
+
<span
|
|
64
|
+
className={`${styles.cell}${changed ? ` ${styles.changing}` : ""}`}
|
|
65
|
+
data-direction={frame.direction}
|
|
66
|
+
key={`${frame.id}-${index}`}
|
|
67
|
+
>
|
|
68
|
+
{changed ? (
|
|
69
|
+
<span className={styles.old}>{visibleCharacter(previousCharacter)}</span>
|
|
70
|
+
) : null}
|
|
71
|
+
<span className={styles.new}>{visibleCharacter(character)}</span>
|
|
72
|
+
</span>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</span>
|
|
76
|
+
</span>
|
|
77
|
+
);
|
|
78
|
+
}
|