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,35 @@
|
|
|
1
|
+
import { LucideByName } from "../Button/lucideName";
|
|
2
|
+
import type { EmptyProps } from "./Empty.types";
|
|
3
|
+
import styles from "./Empty.module.css";
|
|
4
|
+
|
|
5
|
+
export type { EmptyProps } from "./Empty.types";
|
|
6
|
+
|
|
7
|
+
const ICON_SIZE = 20;
|
|
8
|
+
|
|
9
|
+
export function Empty({
|
|
10
|
+
title,
|
|
11
|
+
description,
|
|
12
|
+
icon,
|
|
13
|
+
media,
|
|
14
|
+
actions,
|
|
15
|
+
outlined = false,
|
|
16
|
+
}: EmptyProps) {
|
|
17
|
+
const showIcon = Boolean(icon) && !media;
|
|
18
|
+
const showMedia = Boolean(media);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className={`${styles.root}${outlined ? ` ${styles.outlined}` : ""}`}>
|
|
22
|
+
{showIcon ? (
|
|
23
|
+
<div className={styles.mediaWell} aria-hidden>
|
|
24
|
+
<LucideByName name={icon} size={ICON_SIZE} />
|
|
25
|
+
</div>
|
|
26
|
+
) : null}
|
|
27
|
+
{showMedia ? <div className={styles.mediaSlot}>{media}</div> : null}
|
|
28
|
+
<div className={styles.copy}>
|
|
29
|
+
<h3 className={styles.title}>{title}</h3>
|
|
30
|
+
{description ? <p className={styles.description}>{description}</p> : null}
|
|
31
|
+
</div>
|
|
32
|
+
{actions ? <div className={styles.actions}>{actions}</div> : null}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.field {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.top {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--space-2);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.start {
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
15
|
+
column-gap: var(--space-3);
|
|
16
|
+
row-gap: var(--space-1);
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.start .label {
|
|
21
|
+
grid-column: 1;
|
|
22
|
+
grid-row: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.start .body {
|
|
26
|
+
grid-column: 2;
|
|
27
|
+
grid-row: 1;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.start .hint {
|
|
32
|
+
grid-column: 2;
|
|
33
|
+
grid-row: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.start .error {
|
|
37
|
+
grid-column: 2;
|
|
38
|
+
grid-row: 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.label {
|
|
42
|
+
font-family: var(--font-sans);
|
|
43
|
+
font-size: var(--type-size-label);
|
|
44
|
+
font-weight: var(--type-weight-label);
|
|
45
|
+
color: var(--text-primary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.body {
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.hint {
|
|
53
|
+
margin: 0;
|
|
54
|
+
font-family: var(--font-sans);
|
|
55
|
+
font-size: var(--type-size-body-sm);
|
|
56
|
+
line-height: var(--type-line-body);
|
|
57
|
+
color: var(--text-muted);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.error {
|
|
61
|
+
margin: 0;
|
|
62
|
+
font-family: var(--font-sans);
|
|
63
|
+
font-size: var(--type-size-body-sm);
|
|
64
|
+
line-height: var(--type-line-body);
|
|
65
|
+
color: var(--text-danger);
|
|
66
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cloneElement, isValidElement, type ReactElement } from "react";
|
|
2
|
+
import type { FieldProps } from "./Field.types";
|
|
3
|
+
import styles from "./Field.module.css";
|
|
4
|
+
|
|
5
|
+
export type { FieldProps, FieldLabelPosition } from "./Field.types";
|
|
6
|
+
|
|
7
|
+
export function Field({
|
|
8
|
+
label,
|
|
9
|
+
htmlFor,
|
|
10
|
+
hint,
|
|
11
|
+
error,
|
|
12
|
+
labelPosition = "top",
|
|
13
|
+
children,
|
|
14
|
+
}: FieldProps) {
|
|
15
|
+
const hintId = hint && !error ? `${htmlFor}-hint` : undefined;
|
|
16
|
+
const errorId = error ? `${htmlFor}-error` : undefined;
|
|
17
|
+
const describedBy = [hintId, errorId].filter(Boolean).join(" ") || undefined;
|
|
18
|
+
|
|
19
|
+
const control =
|
|
20
|
+
describedBy && isValidElement(children)
|
|
21
|
+
? cloneElement(children as ReactElement<{ describedBy?: string }>, { describedBy })
|
|
22
|
+
: children;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
className={`${styles.field} ${styles[labelPosition]}`}
|
|
27
|
+
role="group"
|
|
28
|
+
data-invalid={error ? "true" : undefined}
|
|
29
|
+
>
|
|
30
|
+
<label className={styles.label} htmlFor={htmlFor}>
|
|
31
|
+
{label}
|
|
32
|
+
</label>
|
|
33
|
+
<div className={styles.body}>{control}</div>
|
|
34
|
+
{hint && !error ? (
|
|
35
|
+
<p id={hintId} className={styles.hint}>
|
|
36
|
+
{hint}
|
|
37
|
+
</p>
|
|
38
|
+
) : null}
|
|
39
|
+
{error ? (
|
|
40
|
+
<p id={errorId} className={styles.error} role="alert">
|
|
41
|
+
{error}
|
|
42
|
+
</p>
|
|
43
|
+
) : null}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type FieldLabelPosition = "top" | "start";
|
|
4
|
+
|
|
5
|
+
export interface FieldProps {
|
|
6
|
+
label: string;
|
|
7
|
+
htmlFor: string;
|
|
8
|
+
hint?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
labelPosition?: FieldLabelPosition;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.fieldset {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: var(--space-2);
|
|
4
|
+
min-width: 0;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
border: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.legend {
|
|
11
|
+
padding: 0;
|
|
12
|
+
font-family: var(--font-sans);
|
|
13
|
+
font-size: var(--type-size-label);
|
|
14
|
+
font-weight: var(--type-weight-label);
|
|
15
|
+
color: var(--text-primary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.description {
|
|
19
|
+
margin: 0;
|
|
20
|
+
font-family: var(--font-sans);
|
|
21
|
+
font-size: var(--type-size-body-sm);
|
|
22
|
+
line-height: var(--type-line-body);
|
|
23
|
+
color: var(--text-muted);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.body {
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: var(--space-4);
|
|
29
|
+
min-width: 0;
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FieldSetProps } from "./FieldSet.types";
|
|
2
|
+
import styles from "./FieldSet.module.css";
|
|
3
|
+
|
|
4
|
+
export type { FieldSetProps } from "./FieldSet.types";
|
|
5
|
+
|
|
6
|
+
export function FieldSet({ legend, description, children }: FieldSetProps) {
|
|
7
|
+
return (
|
|
8
|
+
<fieldset className={styles.fieldset}>
|
|
9
|
+
<legend className={styles.legend}>{legend}</legend>
|
|
10
|
+
{description ? <p className={styles.description}>{description}</p> : null}
|
|
11
|
+
<div className={styles.body}>{children}</div>
|
|
12
|
+
</fieldset>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.cell {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.sm {
|
|
12
|
+
min-height: 2.25rem;
|
|
13
|
+
padding: var(--space-2) var(--space-4);
|
|
14
|
+
gap: var(--space-2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.md {
|
|
18
|
+
min-height: 2.75rem;
|
|
19
|
+
padding: var(--space-2) var(--space-6);
|
|
20
|
+
gap: var(--space-2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.start {
|
|
24
|
+
justify-content: flex-start;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.end {
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.center {
|
|
32
|
+
justify-content: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.checkboxOnly {
|
|
36
|
+
width: auto;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding-inline: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.label {
|
|
42
|
+
min-width: 0;
|
|
43
|
+
font-family: var(--font-sans);
|
|
44
|
+
font-weight: var(--type-weight-label);
|
|
45
|
+
line-height: var(--type-line-body);
|
|
46
|
+
color: var(--text-secondary);
|
|
47
|
+
overflow-wrap: anywhere;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.sm .label,
|
|
51
|
+
.md .label {
|
|
52
|
+
font-size: var(--type-size-caption);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.sort {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: inherit;
|
|
59
|
+
gap: inherit;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
width: 100%;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
border: 0;
|
|
65
|
+
background: transparent;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
color: inherit;
|
|
68
|
+
font: inherit;
|
|
69
|
+
text-align: inherit;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.sort:focus-visible {
|
|
73
|
+
outline: var(--border-focus-width) solid var(--focus-ring);
|
|
74
|
+
outline-offset: var(--space-inset-2xs);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sortIcon {
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
color: var(--icon-muted);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.sortIconActive {
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
color: var(--icon-primary);
|
|
85
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { Checkbox } from "../Checkbox";
|
|
5
|
+
import { LucideByName } from "../Button/lucideName";
|
|
6
|
+
import type { HeaderCellProps } from "./HeaderCell.types";
|
|
7
|
+
import styles from "./HeaderCell.module.css";
|
|
8
|
+
|
|
9
|
+
export type {
|
|
10
|
+
HeaderCellProps,
|
|
11
|
+
HeaderCellSize,
|
|
12
|
+
HeaderCellAlign,
|
|
13
|
+
HeaderCellSort,
|
|
14
|
+
} from "./HeaderCell.types";
|
|
15
|
+
|
|
16
|
+
export function HeaderCell({
|
|
17
|
+
label,
|
|
18
|
+
size = "md",
|
|
19
|
+
checkbox = false,
|
|
20
|
+
checked,
|
|
21
|
+
defaultChecked,
|
|
22
|
+
indeterminate,
|
|
23
|
+
onCheckedChange,
|
|
24
|
+
align = "start",
|
|
25
|
+
sortable = false,
|
|
26
|
+
sort,
|
|
27
|
+
onSort,
|
|
28
|
+
id,
|
|
29
|
+
}: HeaderCellProps) {
|
|
30
|
+
const generatedId = useId();
|
|
31
|
+
const checkboxId = id ?? generatedId;
|
|
32
|
+
const aria = label ? `Select all ${label}` : "Select all rows";
|
|
33
|
+
const icon = sort === "asc" ? "ChevronUp" : sort === "desc" ? "ChevronDown" : "ChevronsUpDown";
|
|
34
|
+
const sortLabel =
|
|
35
|
+
sort === "asc"
|
|
36
|
+
? `Sort ${label ?? "column"} descending`
|
|
37
|
+
: sort === "desc"
|
|
38
|
+
? `Clear sort on ${label ?? "column"}`
|
|
39
|
+
: `Sort ${label ?? "column"} ascending`;
|
|
40
|
+
const checkboxOnly = checkbox && !label;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<span
|
|
44
|
+
className={`${styles.cell} ${styles[size]} ${styles[align]}${checkboxOnly ? ` ${styles.checkboxOnly}` : ""}`}
|
|
45
|
+
>
|
|
46
|
+
{checkbox ? (
|
|
47
|
+
<Checkbox
|
|
48
|
+
id={checkboxId}
|
|
49
|
+
size="sm"
|
|
50
|
+
ariaLabel={aria}
|
|
51
|
+
checked={checked}
|
|
52
|
+
defaultChecked={defaultChecked}
|
|
53
|
+
indeterminate={indeterminate}
|
|
54
|
+
onChange={onCheckedChange}
|
|
55
|
+
/>
|
|
56
|
+
) : null}
|
|
57
|
+
{sortable && !checkbox ? (
|
|
58
|
+
<button type="button" className={styles.sort} onClick={onSort} aria-label={sortLabel}>
|
|
59
|
+
{label ? <span className={styles.label}>{label}</span> : null}
|
|
60
|
+
<LucideByName
|
|
61
|
+
name={icon}
|
|
62
|
+
size={14}
|
|
63
|
+
className={sort ? styles.sortIconActive : styles.sortIcon}
|
|
64
|
+
/>
|
|
65
|
+
</button>
|
|
66
|
+
) : label ? (
|
|
67
|
+
<span className={styles.label}>{label}</span>
|
|
68
|
+
) : null}
|
|
69
|
+
</span>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type HeaderCellSize = "sm" | "md";
|
|
2
|
+
export type HeaderCellAlign = "start" | "end" | "center";
|
|
3
|
+
export type HeaderCellSort = "asc" | "desc";
|
|
4
|
+
|
|
5
|
+
export interface HeaderCellProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
size?: HeaderCellSize;
|
|
8
|
+
checkbox?: boolean;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
defaultChecked?: boolean;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
13
|
+
align?: HeaderCellAlign;
|
|
14
|
+
sortable?: boolean;
|
|
15
|
+
sort?: HeaderCellSort;
|
|
16
|
+
onSort?: () => void;
|
|
17
|
+
id?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.shell {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--space-2);
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.shell:hover:not([data-disabled]),
|
|
9
|
+
.shell[data-demo="hover"]:not([data-disabled]) {
|
|
10
|
+
border-color: var(--border-strong);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.shell:focus-within,
|
|
14
|
+
.shell[data-demo="focus"] {
|
|
15
|
+
border-color: var(--border-focus);
|
|
16
|
+
outline: var(--border-focus-width) solid var(--focus-ring);
|
|
17
|
+
outline-offset: var(--space-inset-2xs);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.shell.controlError:focus-within,
|
|
21
|
+
.shell.controlError[data-demo="focus"] {
|
|
22
|
+
border-color: var(--status-danger);
|
|
23
|
+
outline-color: var(--status-danger);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.shell[data-disabled] {
|
|
27
|
+
opacity: 0.5;
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
background-color: var(--surface-muted);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.native {
|
|
33
|
+
flex: 1;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
width: 100%;
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
border: 0;
|
|
39
|
+
background: transparent;
|
|
40
|
+
font: inherit;
|
|
41
|
+
color: inherit;
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.native:disabled {
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.slot {
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
color: var(--text-muted);
|
|
52
|
+
line-height: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.icon {
|
|
56
|
+
display: block;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
color: var(--icon-muted);
|
|
59
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { LucideByName } from "../Button/lucideName";
|
|
2
|
+
import type { InputProps } from "./Input.types";
|
|
3
|
+
import controlStyles from "../shared/controls.module.css";
|
|
4
|
+
import styles from "./Input.module.css";
|
|
5
|
+
|
|
6
|
+
export type { InputProps, InputSize, InputType } from "./Input.types";
|
|
7
|
+
|
|
8
|
+
const ICON_PX = { sm: 14, md: 16, lg: 18 } as const;
|
|
9
|
+
|
|
10
|
+
export function Input({
|
|
11
|
+
id,
|
|
12
|
+
type = "text",
|
|
13
|
+
size = "md",
|
|
14
|
+
placeholder,
|
|
15
|
+
disabled = false,
|
|
16
|
+
error = false,
|
|
17
|
+
defaultValue,
|
|
18
|
+
value,
|
|
19
|
+
onChange,
|
|
20
|
+
name,
|
|
21
|
+
start,
|
|
22
|
+
end,
|
|
23
|
+
iconStart,
|
|
24
|
+
iconEnd,
|
|
25
|
+
demo,
|
|
26
|
+
describedBy,
|
|
27
|
+
ariaLabel,
|
|
28
|
+
}: InputProps) {
|
|
29
|
+
const iconPx = ICON_PX[size];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
className={`${controlStyles.control} ${size === "sm" ? controlStyles.controlSm : size === "lg" ? controlStyles.controlLg : controlStyles.controlMd} ${error ? controlStyles.controlError : ""} ${styles.shell}`}
|
|
34
|
+
data-disabled={disabled || undefined}
|
|
35
|
+
data-demo={disabled ? undefined : demo}
|
|
36
|
+
>
|
|
37
|
+
<LucideByName name={iconStart} size={iconPx} className={styles.icon} />
|
|
38
|
+
{start ? (
|
|
39
|
+
<span className={styles.slot} aria-hidden>
|
|
40
|
+
{start}
|
|
41
|
+
</span>
|
|
42
|
+
) : null}
|
|
43
|
+
<input
|
|
44
|
+
id={id}
|
|
45
|
+
name={name}
|
|
46
|
+
type={type}
|
|
47
|
+
placeholder={placeholder}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
value={value}
|
|
50
|
+
defaultValue={value === undefined ? defaultValue : undefined}
|
|
51
|
+
onChange={(event) => onChange?.(event.target.value)}
|
|
52
|
+
aria-invalid={error || undefined}
|
|
53
|
+
aria-label={ariaLabel}
|
|
54
|
+
aria-describedby={describedBy}
|
|
55
|
+
className={styles.native}
|
|
56
|
+
/>
|
|
57
|
+
{end ? (
|
|
58
|
+
<span className={styles.slot} aria-hidden>
|
|
59
|
+
{end}
|
|
60
|
+
</span>
|
|
61
|
+
) : null}
|
|
62
|
+
<LucideByName name={iconEnd} size={iconPx} className={styles.icon} />
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type InputSize = "sm" | "md" | "lg";
|
|
2
|
+
export type InputType = "text" | "email" | "password" | "search";
|
|
3
|
+
|
|
4
|
+
export interface InputProps {
|
|
5
|
+
id: string;
|
|
6
|
+
type?: InputType;
|
|
7
|
+
size?: InputSize;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
name?: string;
|
|
15
|
+
start?: string;
|
|
16
|
+
end?: string;
|
|
17
|
+
iconStart?: string;
|
|
18
|
+
iconEnd?: string;
|
|
19
|
+
demo?: "hover" | "focus";
|
|
20
|
+
describedBy?: string;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
}
|