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,296 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId, useLayoutEffect, useRef, useState, type KeyboardEvent } from "react";
|
|
4
|
+
import { Button } from "../Button";
|
|
5
|
+
import type { CalendarProps } from "./Calendar.types";
|
|
6
|
+
import styles from "./Calendar.module.css";
|
|
7
|
+
|
|
8
|
+
export type { CalendarProps, CalendarSize } from "./Calendar.types";
|
|
9
|
+
|
|
10
|
+
const WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] as const;
|
|
11
|
+
|
|
12
|
+
function parseISODate(iso?: string): Date | null {
|
|
13
|
+
if (!iso) return null;
|
|
14
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso);
|
|
15
|
+
if (!match) return null;
|
|
16
|
+
const year = Number(match[1]);
|
|
17
|
+
const month = Number(match[2]) - 1;
|
|
18
|
+
const day = Number(match[3]);
|
|
19
|
+
const date = new Date(year, month, day);
|
|
20
|
+
if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return date;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function toISODate(date: Date): string {
|
|
27
|
+
const year = date.getFullYear();
|
|
28
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
29
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
30
|
+
return `${year}-${month}-${day}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function startOfMonth(date: Date): Date {
|
|
34
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function addDays(date: Date, delta: number): Date {
|
|
38
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + delta);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function addMonths(date: Date, delta: number): Date {
|
|
42
|
+
const nextMonth = new Date(date.getFullYear(), date.getMonth() + delta, 1);
|
|
43
|
+
const lastDay = new Date(nextMonth.getFullYear(), nextMonth.getMonth() + 1, 0).getDate();
|
|
44
|
+
return new Date(nextMonth.getFullYear(), nextMonth.getMonth(), Math.min(date.getDate(), lastDay));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function monthFromISO(iso?: string): Date {
|
|
48
|
+
const parsed = parseISODate(iso);
|
|
49
|
+
const base = parsed ?? new Date();
|
|
50
|
+
return startOfMonth(base);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function buildWeeks(view: Date): Date[][] {
|
|
54
|
+
const first = new Date(view.getFullYear(), view.getMonth(), 1);
|
|
55
|
+
const start = new Date(view.getFullYear(), view.getMonth(), 1 - first.getDay());
|
|
56
|
+
const weeks: Date[][] = [];
|
|
57
|
+
for (let weekIndex = 0; weekIndex < 6; weekIndex += 1) {
|
|
58
|
+
const week: Date[] = [];
|
|
59
|
+
for (let dayIndex = 0; dayIndex < 7; dayIndex += 1) {
|
|
60
|
+
week.push(addDays(start, weekIndex * 7 + dayIndex));
|
|
61
|
+
}
|
|
62
|
+
weeks.push(week);
|
|
63
|
+
}
|
|
64
|
+
return weeks;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isSameDay(a: Date, b: Date): boolean {
|
|
68
|
+
return (
|
|
69
|
+
a.getFullYear() === b.getFullYear() &&
|
|
70
|
+
a.getMonth() === b.getMonth() &&
|
|
71
|
+
a.getDate() === b.getDate()
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function dayIsDisabled(date: Date, minDate?: string, maxDate?: string, calendarDisabled?: boolean): boolean {
|
|
76
|
+
if (calendarDisabled) return true;
|
|
77
|
+
const iso = toISODate(date);
|
|
78
|
+
if (minDate && iso < minDate) return true;
|
|
79
|
+
if (maxDate && iso > maxDate) return true;
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function dayName(date: Date, isToday: boolean, isSelected: boolean): string {
|
|
84
|
+
const label = date.toLocaleDateString("en-US", {
|
|
85
|
+
weekday: "long",
|
|
86
|
+
month: "long",
|
|
87
|
+
day: "numeric",
|
|
88
|
+
year: "numeric",
|
|
89
|
+
});
|
|
90
|
+
const extras = [label];
|
|
91
|
+
if (isToday) extras.push("today");
|
|
92
|
+
if (isSelected) extras.push("selected");
|
|
93
|
+
return extras.join(", ");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function Calendar({
|
|
97
|
+
value,
|
|
98
|
+
defaultValue,
|
|
99
|
+
onValueChange,
|
|
100
|
+
size = "md",
|
|
101
|
+
disabled = false,
|
|
102
|
+
minDate,
|
|
103
|
+
maxDate,
|
|
104
|
+
}: CalendarProps) {
|
|
105
|
+
const headingId = useId();
|
|
106
|
+
const isControlled = value !== undefined;
|
|
107
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
108
|
+
const selectedISO = isControlled ? value : uncontrolledValue;
|
|
109
|
+
const selectedDate = parseISODate(selectedISO);
|
|
110
|
+
|
|
111
|
+
const [view, setView] = useState(() => monthFromISO(selectedISO ?? defaultValue));
|
|
112
|
+
const [focusedISO, setFocusedISO] = useState(
|
|
113
|
+
() => selectedISO ?? toISODate(new Date()),
|
|
114
|
+
);
|
|
115
|
+
const [seenValue, setSeenValue] = useState(value);
|
|
116
|
+
|
|
117
|
+
if (isControlled && value !== seenValue) {
|
|
118
|
+
setSeenValue(value);
|
|
119
|
+
const next = parseISODate(value);
|
|
120
|
+
if (next) {
|
|
121
|
+
if (view.getFullYear() !== next.getFullYear() || view.getMonth() !== next.getMonth()) {
|
|
122
|
+
setView(startOfMonth(next));
|
|
123
|
+
}
|
|
124
|
+
setFocusedISO(value);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const dayRefs = useRef<Map<string, HTMLButtonElement>>(new Map());
|
|
129
|
+
const moveFocusRef = useRef(false);
|
|
130
|
+
|
|
131
|
+
const today = new Date();
|
|
132
|
+
const todayISO = toISODate(today);
|
|
133
|
+
const weeks = buildWeeks(view);
|
|
134
|
+
const monthLabel = view.toLocaleString("en-US", { month: "long", year: "numeric" });
|
|
135
|
+
|
|
136
|
+
const lastPrev = new Date(view.getFullYear(), view.getMonth(), 0);
|
|
137
|
+
const firstNext = new Date(view.getFullYear(), view.getMonth() + 1, 1);
|
|
138
|
+
const prevDisabled = disabled || Boolean(minDate && toISODate(lastPrev) < minDate);
|
|
139
|
+
const nextDisabled = disabled || Boolean(maxDate && toISODate(firstNext) > maxDate);
|
|
140
|
+
|
|
141
|
+
useLayoutEffect(() => {
|
|
142
|
+
if (!moveFocusRef.current) return;
|
|
143
|
+
moveFocusRef.current = false;
|
|
144
|
+
dayRefs.current.get(focusedISO)?.focus();
|
|
145
|
+
}, [focusedISO, view]);
|
|
146
|
+
|
|
147
|
+
function commit(date: Date) {
|
|
148
|
+
if (dayIsDisabled(date, minDate, maxDate, disabled)) return;
|
|
149
|
+
const iso = toISODate(date);
|
|
150
|
+
if (!isControlled) setUncontrolledValue(iso);
|
|
151
|
+
onValueChange?.(iso);
|
|
152
|
+
setView(startOfMonth(date));
|
|
153
|
+
setFocusedISO(iso);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function goMonth(delta: number) {
|
|
157
|
+
const next = startOfMonth(addMonths(view, delta));
|
|
158
|
+
const from = parseISODate(focusedISO) ?? view;
|
|
159
|
+
const last = new Date(next.getFullYear(), next.getMonth() + 1, 0).getDate();
|
|
160
|
+
const day = Math.min(from.getDate(), last);
|
|
161
|
+
setView(next);
|
|
162
|
+
setFocusedISO(toISODate(new Date(next.getFullYear(), next.getMonth(), day)));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function moveTo(date: Date) {
|
|
166
|
+
moveFocusRef.current = true;
|
|
167
|
+
setFocusedISO(toISODate(date));
|
|
168
|
+
setView(startOfMonth(date));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function onGridKeyDown(event: KeyboardEvent<HTMLDivElement>) {
|
|
172
|
+
const current = parseISODate(focusedISO) ?? today;
|
|
173
|
+
let next: Date | null = null;
|
|
174
|
+
|
|
175
|
+
switch (event.key) {
|
|
176
|
+
case "ArrowLeft":
|
|
177
|
+
next = addDays(current, -1);
|
|
178
|
+
break;
|
|
179
|
+
case "ArrowRight":
|
|
180
|
+
next = addDays(current, 1);
|
|
181
|
+
break;
|
|
182
|
+
case "ArrowUp":
|
|
183
|
+
next = addDays(current, -7);
|
|
184
|
+
break;
|
|
185
|
+
case "ArrowDown":
|
|
186
|
+
next = addDays(current, 7);
|
|
187
|
+
break;
|
|
188
|
+
case "Home":
|
|
189
|
+
next = addDays(current, -current.getDay());
|
|
190
|
+
break;
|
|
191
|
+
case "End":
|
|
192
|
+
next = addDays(current, 6 - current.getDay());
|
|
193
|
+
break;
|
|
194
|
+
case "PageUp":
|
|
195
|
+
next = addMonths(current, -1);
|
|
196
|
+
break;
|
|
197
|
+
case "PageDown":
|
|
198
|
+
next = addMonths(current, 1);
|
|
199
|
+
break;
|
|
200
|
+
case "Enter":
|
|
201
|
+
case " ":
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
commit(current);
|
|
204
|
+
return;
|
|
205
|
+
default:
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
if (next) moveTo(next);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<div
|
|
215
|
+
className={`${styles.calendar} ${styles[size]}`}
|
|
216
|
+
data-disabled={disabled || undefined}
|
|
217
|
+
>
|
|
218
|
+
<div className={styles.header}>
|
|
219
|
+
<Button
|
|
220
|
+
variant="tertiary"
|
|
221
|
+
size="sm"
|
|
222
|
+
iconStart="ChevronLeft"
|
|
223
|
+
ariaLabel="Previous month"
|
|
224
|
+
disabled={prevDisabled}
|
|
225
|
+
onClick={() => goMonth(-1)}
|
|
226
|
+
/>
|
|
227
|
+
<div className={styles.heading} id={headingId} role="heading" aria-level={2} aria-live="polite">
|
|
228
|
+
{monthLabel}
|
|
229
|
+
</div>
|
|
230
|
+
<Button
|
|
231
|
+
variant="tertiary"
|
|
232
|
+
size="sm"
|
|
233
|
+
iconStart="ChevronRight"
|
|
234
|
+
ariaLabel="Next month"
|
|
235
|
+
disabled={nextDisabled}
|
|
236
|
+
onClick={() => goMonth(1)}
|
|
237
|
+
/>
|
|
238
|
+
</div>
|
|
239
|
+
<div
|
|
240
|
+
className={styles.grid}
|
|
241
|
+
role="grid"
|
|
242
|
+
aria-labelledby={headingId}
|
|
243
|
+
aria-disabled={disabled || undefined}
|
|
244
|
+
onKeyDown={onGridKeyDown}
|
|
245
|
+
>
|
|
246
|
+
<div role="row" className={styles.weekdays}>
|
|
247
|
+
{WEEKDAYS.map((label) => (
|
|
248
|
+
<div key={label} role="columnheader" className={styles.weekday}>
|
|
249
|
+
{label}
|
|
250
|
+
</div>
|
|
251
|
+
))}
|
|
252
|
+
</div>
|
|
253
|
+
{weeks.map((week, weekIndex) => (
|
|
254
|
+
<div key={weekIndex} role="row" className={styles.row}>
|
|
255
|
+
{week.map((date) => {
|
|
256
|
+
const iso = toISODate(date);
|
|
257
|
+
const outside = date.getMonth() !== view.getMonth();
|
|
258
|
+
const isToday = iso === todayISO;
|
|
259
|
+
const isSelected = Boolean(selectedDate && isSameDay(date, selectedDate));
|
|
260
|
+
const isFocused = iso === focusedISO;
|
|
261
|
+
const dayDisabled = dayIsDisabled(date, minDate, maxDate, disabled);
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<div
|
|
265
|
+
key={iso}
|
|
266
|
+
role="gridcell"
|
|
267
|
+
className={styles.cell}
|
|
268
|
+
aria-selected={isSelected || undefined}
|
|
269
|
+
>
|
|
270
|
+
<button
|
|
271
|
+
ref={(node) => {
|
|
272
|
+
if (node) dayRefs.current.set(iso, node);
|
|
273
|
+
else dayRefs.current.delete(iso);
|
|
274
|
+
}}
|
|
275
|
+
type="button"
|
|
276
|
+
className={styles.day}
|
|
277
|
+
tabIndex={isFocused ? 0 : -1}
|
|
278
|
+
aria-label={dayName(date, isToday, isSelected)}
|
|
279
|
+
aria-disabled={dayDisabled || undefined}
|
|
280
|
+
data-outside={outside || undefined}
|
|
281
|
+
data-today={isToday || undefined}
|
|
282
|
+
data-selected={isSelected || undefined}
|
|
283
|
+
onClick={() => commit(date)}
|
|
284
|
+
onFocus={() => setFocusedISO(iso)}
|
|
285
|
+
>
|
|
286
|
+
{date.getDate()}
|
|
287
|
+
</button>
|
|
288
|
+
</div>
|
|
289
|
+
);
|
|
290
|
+
})}
|
|
291
|
+
</div>
|
|
292
|
+
))}
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CalendarSize = "sm" | "md" | "lg";
|
|
2
|
+
|
|
3
|
+
export interface CalendarProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onValueChange?: (date: string) => void;
|
|
7
|
+
size?: CalendarSize;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
minDate?: string;
|
|
10
|
+
maxDate?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
--card-spacing: var(--space-6);
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background-color: var(--surface-card);
|
|
9
|
+
border: 1px solid var(--border-faint);
|
|
10
|
+
border-radius: var(--radius-surface-md);
|
|
11
|
+
box-shadow: var(--shadow-sm);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.sm {
|
|
15
|
+
--card-spacing: var(--space-4);
|
|
16
|
+
max-width: 24rem;
|
|
17
|
+
margin-inline: auto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.image {
|
|
21
|
+
display: block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 10rem;
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
border-top-left-radius: var(--radius-surface-md);
|
|
26
|
+
border-top-right-radius: var(--radius-surface-md);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sm .image {
|
|
30
|
+
height: 8rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.content {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: var(--card-spacing);
|
|
37
|
+
padding: var(--card-spacing);
|
|
38
|
+
min-width: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.header {
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
gap: var(--space-4);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.copy {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: var(--space-1);
|
|
52
|
+
min-width: 0;
|
|
53
|
+
flex: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.title {
|
|
57
|
+
margin: 0;
|
|
58
|
+
overflow-wrap: anywhere;
|
|
59
|
+
font-family: var(--font-sans);
|
|
60
|
+
font-size: var(--type-size-heading);
|
|
61
|
+
font-weight: var(--type-weight-heading);
|
|
62
|
+
line-height: var(--type-line-heading);
|
|
63
|
+
color: var(--text-primary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sm .title {
|
|
67
|
+
font-size: var(--type-size-body);
|
|
68
|
+
line-height: var(--type-line-body);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.description {
|
|
72
|
+
margin: 0;
|
|
73
|
+
overflow-wrap: anywhere;
|
|
74
|
+
font-family: var(--font-sans);
|
|
75
|
+
font-size: var(--type-size-body-sm);
|
|
76
|
+
line-height: var(--type-line-body);
|
|
77
|
+
color: var(--text-secondary);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.body {
|
|
81
|
+
display: grid;
|
|
82
|
+
gap: var(--space-4);
|
|
83
|
+
min-width: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.footer {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
align-items: stretch;
|
|
90
|
+
gap: var(--space-2);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.footer button {
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
package/ui/Card/Card.tsx
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useId } from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
import type { CardProps } from "./Card.types";
|
|
4
|
+
import styles from "./Card.module.css";
|
|
5
|
+
|
|
6
|
+
export type { CardProps, CardSize, CardAction, CardActionVariant } from "./Card.types";
|
|
7
|
+
|
|
8
|
+
export function Card({
|
|
9
|
+
title,
|
|
10
|
+
description,
|
|
11
|
+
children,
|
|
12
|
+
size = "md",
|
|
13
|
+
actions,
|
|
14
|
+
headerAction,
|
|
15
|
+
imageSrc,
|
|
16
|
+
imageAlt,
|
|
17
|
+
}: CardProps) {
|
|
18
|
+
const titleId = useId();
|
|
19
|
+
const footerActions = (actions ?? []).slice(0, 2);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<article
|
|
23
|
+
className={[styles.card, styles[size]].filter(Boolean).join(" ")}
|
|
24
|
+
aria-labelledby={title ? titleId : undefined}
|
|
25
|
+
>
|
|
26
|
+
{imageSrc ? (
|
|
27
|
+
<img className={styles.image} src={imageSrc} alt={imageAlt ?? ""} />
|
|
28
|
+
) : null}
|
|
29
|
+
<div className={styles.content}>
|
|
30
|
+
{title || description || headerAction ? (
|
|
31
|
+
<header className={styles.header}>
|
|
32
|
+
<div className={styles.copy}>
|
|
33
|
+
{title ? (
|
|
34
|
+
<h2 id={titleId} className={styles.title}>
|
|
35
|
+
{title}
|
|
36
|
+
</h2>
|
|
37
|
+
) : null}
|
|
38
|
+
{description ? <p className={styles.description}>{description}</p> : null}
|
|
39
|
+
</div>
|
|
40
|
+
{headerAction ? (
|
|
41
|
+
<Button
|
|
42
|
+
variant={headerAction.variant ?? "tertiary"}
|
|
43
|
+
size="sm"
|
|
44
|
+
onClick={headerAction.onClick}
|
|
45
|
+
>
|
|
46
|
+
{headerAction.label}
|
|
47
|
+
</Button>
|
|
48
|
+
) : null}
|
|
49
|
+
</header>
|
|
50
|
+
) : null}
|
|
51
|
+
<div className={styles.body}>{children}</div>
|
|
52
|
+
{footerActions.length > 0 ? (
|
|
53
|
+
<footer className={styles.footer}>
|
|
54
|
+
{footerActions.map((action) => (
|
|
55
|
+
<Button
|
|
56
|
+
key={action.label}
|
|
57
|
+
variant={action.variant}
|
|
58
|
+
size="md"
|
|
59
|
+
onClick={action.onClick}
|
|
60
|
+
>
|
|
61
|
+
{action.label}
|
|
62
|
+
</Button>
|
|
63
|
+
))}
|
|
64
|
+
</footer>
|
|
65
|
+
) : null}
|
|
66
|
+
</div>
|
|
67
|
+
</article>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ButtonVariant } from "../Button";
|
|
3
|
+
|
|
4
|
+
export type CardSize = "sm" | "md";
|
|
5
|
+
export type CardActionVariant = ButtonVariant;
|
|
6
|
+
|
|
7
|
+
export interface CardAction {
|
|
8
|
+
label: string;
|
|
9
|
+
variant?: CardActionVariant;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CardProps {
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
size?: CardSize;
|
|
18
|
+
actions?: CardAction[];
|
|
19
|
+
headerAction?: CardAction;
|
|
20
|
+
imageSrc?: string;
|
|
21
|
+
/** Required when imageSrc is set. */
|
|
22
|
+
imageAlt?: string;
|
|
23
|
+
}
|
package/ui/Card/index.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
outline: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.root:focus-visible {
|
|
8
|
+
outline: var(--border-focus-width) solid var(--focus-ring);
|
|
9
|
+
outline-offset: var(--space-inset-2xs);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.horizontal,
|
|
13
|
+
.vertical {
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.stage {
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.viewport {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.vertical .viewport {
|
|
26
|
+
block-size: 12.5rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.track {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: stretch;
|
|
32
|
+
margin-inline-start: calc(-1 * var(--space-4));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.vertical .track {
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
height: 100%;
|
|
38
|
+
margin-inline-start: 0;
|
|
39
|
+
margin-block-start: calc(-1 * var(--space-4));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.slide {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
min-height: 0;
|
|
47
|
+
flex-grow: 0;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
flex-basis: 100%;
|
|
50
|
+
padding-inline-start: var(--space-4);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.slide > * {
|
|
54
|
+
flex: 1 1 auto;
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-width: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.vertical .slide {
|
|
60
|
+
padding-inline-start: 0;
|
|
61
|
+
padding-block-start: var(--space-4);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.per2 .slide {
|
|
65
|
+
flex-basis: 50%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.per3 .slide {
|
|
69
|
+
flex-basis: calc(100% / 3);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.per4 .slide {
|
|
73
|
+
flex-basis: 25%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.prev,
|
|
77
|
+
.next {
|
|
78
|
+
position: absolute;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.horizontal .prev {
|
|
83
|
+
inset-block-start: 50%;
|
|
84
|
+
inset-inline-start: calc(-1 * var(--space-12));
|
|
85
|
+
transform: translateY(-50%);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.horizontal .next {
|
|
89
|
+
inset-block-start: 50%;
|
|
90
|
+
inset-inline-end: calc(-1 * var(--space-12));
|
|
91
|
+
transform: translateY(-50%);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.vertical .prev {
|
|
95
|
+
inset-block-start: calc(-1 * var(--space-12));
|
|
96
|
+
inset-inline-start: 50%;
|
|
97
|
+
transform: translateX(-50%);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.vertical .next {
|
|
101
|
+
inset-block-end: calc(-1 * var(--space-12));
|
|
102
|
+
inset-inline-start: 50%;
|
|
103
|
+
transform: translateX(-50%);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.index {
|
|
107
|
+
margin: var(--space-3) 0 0;
|
|
108
|
+
text-align: center;
|
|
109
|
+
font-family: var(--font-sans);
|
|
110
|
+
font-size: var(--type-size-caption);
|
|
111
|
+
font-weight: var(--type-weight-caption);
|
|
112
|
+
line-height: var(--type-line-body);
|
|
113
|
+
color: var(--text-muted);
|
|
114
|
+
}
|