@siyahi/ui 0.1.9-next.3 → 0.1.9-next.31

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.
Files changed (254) hide show
  1. package/DESIGN.md +251 -0
  2. package/README.md +94 -177
  3. package/THIRD_PARTY_NOTICES.md +11 -11
  4. package/agents/examples/accordion.tsx +39 -0
  5. package/agents/examples/alert.tsx +24 -0
  6. package/agents/examples/app-sidebar.tsx +40 -0
  7. package/agents/examples/avatar.tsx +24 -0
  8. package/agents/examples/badge.tsx +26 -0
  9. package/agents/examples/bar-list-labels.tsx +22 -0
  10. package/agents/examples/bar-list-sides.tsx +40 -0
  11. package/agents/examples/bar-list.tsx +24 -0
  12. package/agents/examples/breadcrumb.tsx +28 -0
  13. package/agents/examples/button-states.tsx +23 -0
  14. package/agents/examples/button.tsx +21 -0
  15. package/agents/examples/calendar.tsx +11 -0
  16. package/agents/examples/callout.tsx +33 -0
  17. package/agents/examples/card.tsx +36 -0
  18. package/agents/examples/change-bar.tsx +104 -0
  19. package/agents/examples/change-grid-money.tsx +36 -0
  20. package/agents/examples/change-grid.tsx +43 -0
  21. package/agents/examples/chart-area-log.tsx +45 -0
  22. package/agents/examples/chart-area.tsx +39 -0
  23. package/agents/examples/chart-bar-flows.tsx +32 -0
  24. package/agents/examples/chart-bar-hourly.tsx +28 -0
  25. package/agents/examples/chart-bar-losses.tsx +29 -0
  26. package/agents/examples/chart-bar-teams.tsx +72 -0
  27. package/agents/examples/chart-bar-years.tsx +42 -0
  28. package/agents/examples/chart-bar.tsx +56 -0
  29. package/agents/examples/chart-category-ticks.tsx +50 -0
  30. package/agents/examples/chart-line-events.tsx +47 -0
  31. package/agents/examples/chart-line-forecast.tsx +36 -0
  32. package/agents/examples/chart-line-log.tsx +39 -0
  33. package/agents/examples/chart-line-quiet.tsx +114 -0
  34. package/agents/examples/chart-line-timeline.tsx +41 -0
  35. package/agents/examples/chart-line.tsx +57 -0
  36. package/agents/examples/chart-panels.tsx +94 -0
  37. package/agents/examples/code-block.tsx +40 -0
  38. package/agents/examples/collapsible.tsx +18 -0
  39. package/agents/examples/command.tsx +29 -0
  40. package/agents/examples/context-menu.tsx +17 -0
  41. package/agents/examples/copy-button.tsx +8 -0
  42. package/agents/examples/data-bar.tsx +114 -0
  43. package/agents/examples/data-table-compact.tsx +93 -0
  44. package/agents/examples/data-table-filters.tsx +103 -0
  45. package/agents/examples/data-table.tsx +96 -0
  46. package/agents/examples/delta.tsx +18 -0
  47. package/agents/examples/dialog.tsx +28 -0
  48. package/agents/examples/distribution-bar-budget.tsx +30 -0
  49. package/agents/examples/distribution-bar-tug.tsx +74 -0
  50. package/agents/examples/drawdown-chart.tsx +35 -0
  51. package/agents/examples/dropdown-menu.tsx +31 -0
  52. package/agents/examples/field.tsx +108 -0
  53. package/agents/examples/formatters.tsx +42 -0
  54. package/agents/examples/heatmap-calendar-signed.tsx +67 -0
  55. package/agents/examples/heatmap-calendar.tsx +62 -0
  56. package/agents/examples/heatmap-status.tsx +61 -0
  57. package/agents/examples/heatmap-weekday.tsx +72 -0
  58. package/agents/examples/histogram-chart.tsx +28 -0
  59. package/agents/examples/input-states.tsx +23 -0
  60. package/agents/examples/input.tsx +17 -0
  61. package/agents/examples/local-time.tsx +14 -0
  62. package/agents/examples/metric-strip.tsx +46 -0
  63. package/agents/examples/overview-dashboard.tsx +180 -0
  64. package/agents/examples/page-hero.tsx +38 -0
  65. package/agents/examples/page-section.tsx +52 -0
  66. package/agents/examples/popover.tsx +23 -0
  67. package/agents/examples/price-chart.tsx +32 -0
  68. package/agents/examples/progress-tone.tsx +29 -0
  69. package/agents/examples/progress.tsx +10 -0
  70. package/agents/examples/range-position-table.tsx +113 -0
  71. package/agents/examples/range-position.tsx +55 -0
  72. package/agents/examples/scatter-chart-quadrants.tsx +63 -0
  73. package/agents/examples/scatter-chart-scales.tsx +46 -0
  74. package/agents/examples/scatter-chart.tsx +78 -0
  75. package/agents/examples/scroll-area.tsx +22 -0
  76. package/agents/examples/section-cards-select.tsx +28 -0
  77. package/agents/examples/section-cards-trend.tsx +32 -0
  78. package/agents/examples/section-cards.tsx +48 -0
  79. package/agents/examples/select.tsx +27 -0
  80. package/agents/examples/separator.tsx +13 -0
  81. package/agents/examples/sheet.tsx +15 -0
  82. package/agents/examples/skeleton.tsx +11 -0
  83. package/agents/examples/slider.tsx +5 -0
  84. package/agents/examples/slope-chart-market.tsx +33 -0
  85. package/agents/examples/slope-chart.tsx +26 -0
  86. package/agents/examples/stale-blocks.tsx +56 -0
  87. package/agents/examples/surfaces.tsx +116 -0
  88. package/agents/examples/table.tsx +60 -0
  89. package/agents/examples/tabs.tsx +16 -0
  90. package/agents/examples/target-rows.tsx +74 -0
  91. package/agents/examples/toggle-group.tsx +12 -0
  92. package/agents/examples/toggle.tsx +11 -0
  93. package/agents/examples/tooltip.tsx +13 -0
  94. package/agents/examples/treemap.tsx +93 -0
  95. package/agents/examples/waterfall-chart-stores.tsx +27 -0
  96. package/agents/examples/waterfall-chart.tsx +37 -0
  97. package/agents/manifest.json +1391 -0
  98. package/agents/report-rules.json +7 -0
  99. package/dist/components/registry/charts/area-chart-card.d.ts +7 -3
  100. package/dist/components/registry/charts/area-chart-card.js +56 -10
  101. package/dist/components/registry/charts/bar-chart-card.d.ts +1 -1
  102. package/dist/components/registry/charts/bar-chart-card.js +20 -22
  103. package/dist/components/registry/charts/line-chart-card.d.ts +3 -3
  104. package/dist/components/registry/charts/line-chart-card.js +44 -9
  105. package/dist/components/registry/dashboard-01/section-cards.d.ts +6 -0
  106. package/dist/components/registry/dashboard-01/section-cards.js +51 -35
  107. package/dist/components/registry/dashboardcn/bar-list.js +17 -10
  108. package/dist/components/registry/dashboardcn/distribution-bar.js +6 -4
  109. package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +29 -0
  110. package/dist/components/registry/dashboardcn/kpi-row-card.js +81 -0
  111. package/dist/components/registry/dashboardcn/sparkline.d.ts +22 -0
  112. package/dist/components/registry/dashboardcn/sparkline.js +117 -0
  113. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +11 -3
  114. package/dist/components/registry/heatmap/calendar-heatmap.js +164 -45
  115. package/dist/components/registry/heatmap/status-heatmap.d.ts +5 -3
  116. package/dist/components/registry/heatmap/status-heatmap.js +115 -54
  117. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +9 -3
  118. package/dist/components/registry/heatmap/weekday-heatmap.js +83 -53
  119. package/dist/components/registry/niko-table/core/data-table-context.d.ts +18 -1
  120. package/dist/components/registry/niko-table/core/data-table-context.js +7 -1
  121. package/dist/components/registry/niko-table/core/data-table-grouped-row.js +3 -1
  122. package/dist/components/registry/niko-table/core/data-table-root.js +39 -4
  123. package/dist/components/registry/niko-table/core/data-table-structure.js +17 -12
  124. package/dist/components/registry/niko-table/core/data-table.d.ts +2 -2
  125. package/dist/components/registry/niko-table/core/data-table.js +5 -1
  126. package/dist/components/registry/niko-table/filters/table-faceted-filter.js +5 -5
  127. package/dist/components/registry/niko-table/filters/table-search-filter.js +1 -1
  128. package/dist/components/registry/niko-table/lib/flex-columns.d.ts +1 -1
  129. package/dist/components/registry/niko-table/lib/flex-columns.js +3 -3
  130. package/dist/components/registry/niko-table/lib/styles.d.ts +1 -1
  131. package/dist/components/registry/niko-table/lib/styles.js +3 -3
  132. package/dist/components/registry/niko-table/types/index.d.ts +9 -0
  133. package/dist/components/registry/niko-table/ui/table.js +2 -2
  134. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +1 -1
  135. package/dist/components/registry/sidebar-07/app-sidebar.js +3 -1
  136. package/dist/components/registry/sidebar-07/nav-main.d.ts +2 -1
  137. package/dist/components/registry/sidebar-07/nav-main.js +16 -3
  138. package/dist/components/siyahi/callout.d.ts +17 -0
  139. package/dist/components/siyahi/callout.js +34 -0
  140. package/dist/components/siyahi/change-bar.d.ts +21 -0
  141. package/dist/components/siyahi/change-bar.js +35 -0
  142. package/dist/components/siyahi/change-grid.d.ts +31 -0
  143. package/dist/components/siyahi/change-grid.js +74 -0
  144. package/dist/components/siyahi/data-bar.d.ts +19 -0
  145. package/dist/components/siyahi/data-bar.js +29 -0
  146. package/dist/components/siyahi/data-table-compact-columns-toggle.d.ts +4 -0
  147. package/dist/components/siyahi/data-table-compact-columns-toggle.js +19 -0
  148. package/dist/components/siyahi/data-table-footnote.d.ts +12 -0
  149. package/dist/components/siyahi/data-table-footnote.js +35 -0
  150. package/dist/components/siyahi/default-sidebar-open.d.ts +8 -0
  151. package/dist/components/siyahi/default-sidebar-open.js +13 -0
  152. package/dist/components/siyahi/delta.d.ts +5 -1
  153. package/dist/components/siyahi/delta.js +14 -9
  154. package/dist/components/siyahi/drawdown-chart.d.ts +34 -0
  155. package/dist/components/siyahi/drawdown-chart.js +102 -0
  156. package/dist/components/siyahi/histogram-chart.d.ts +57 -0
  157. package/dist/components/siyahi/histogram-chart.js +134 -0
  158. package/dist/components/siyahi/page-hero.d.ts +23 -0
  159. package/dist/components/siyahi/page-hero.js +43 -0
  160. package/dist/components/siyahi/page-section.d.ts +4 -1
  161. package/dist/components/siyahi/page-section.js +6 -3
  162. package/dist/components/siyahi/page-toc.d.ts +20 -0
  163. package/dist/components/siyahi/page-toc.js +76 -0
  164. package/dist/components/siyahi/panel-grid.d.ts +24 -0
  165. package/dist/components/siyahi/panel-grid.js +37 -0
  166. package/dist/components/siyahi/quote.d.ts +12 -0
  167. package/dist/components/siyahi/quote.js +23 -0
  168. package/dist/components/siyahi/range-position.d.ts +24 -0
  169. package/dist/components/siyahi/range-position.js +105 -0
  170. package/dist/components/siyahi/scale-toggle.d.ts +32 -0
  171. package/dist/components/siyahi/scale-toggle.js +61 -0
  172. package/dist/components/siyahi/scatter-chart.d.ts +69 -0
  173. package/dist/components/siyahi/scatter-chart.js +395 -0
  174. package/dist/components/siyahi/siyahi-provider.d.ts +15 -2
  175. package/dist/components/siyahi/siyahi-provider.js +17 -4
  176. package/dist/components/siyahi/slope-chart.d.ts +35 -0
  177. package/dist/components/siyahi/slope-chart.js +159 -0
  178. package/dist/components/siyahi/stale-note.d.ts +9 -0
  179. package/dist/components/siyahi/stale-note.js +12 -0
  180. package/dist/components/siyahi/status-alert.d.ts +15 -0
  181. package/dist/components/siyahi/status-alert.js +29 -0
  182. package/dist/components/siyahi/status-badge.d.ts +15 -0
  183. package/dist/components/siyahi/status-badge.js +24 -0
  184. package/dist/components/siyahi/target-rows.d.ts +34 -0
  185. package/dist/components/siyahi/target-rows.js +97 -0
  186. package/dist/components/siyahi/tone-progress.d.ts +1 -1
  187. package/dist/components/siyahi/tone-progress.js +1 -1
  188. package/dist/components/siyahi/treemap.d.ts +8 -5
  189. package/dist/components/siyahi/treemap.js +80 -34
  190. package/dist/components/siyahi/waterfall-chart.d.ts +51 -0
  191. package/dist/components/siyahi/waterfall-chart.js +147 -0
  192. package/dist/components/ui/accordion.js +5 -5
  193. package/dist/components/ui/alert.js +2 -2
  194. package/dist/components/ui/badge.js +1 -1
  195. package/dist/components/ui/breadcrumb.js +2 -2
  196. package/dist/components/ui/button.js +10 -10
  197. package/dist/components/ui/calendar.js +1 -1
  198. package/dist/components/ui/card.js +4 -4
  199. package/dist/components/ui/chart.js +1 -1
  200. package/dist/components/ui/code-block.js +13 -12
  201. package/dist/components/ui/command.js +7 -6
  202. package/dist/components/ui/context-menu.js +7 -7
  203. package/dist/components/ui/dialog.js +5 -5
  204. package/dist/components/ui/dropdown-menu.js +8 -8
  205. package/dist/components/ui/field.d.ts +26 -0
  206. package/dist/components/ui/field.js +109 -0
  207. package/dist/components/ui/input-group.js +11 -11
  208. package/dist/components/ui/input.js +1 -1
  209. package/dist/components/ui/label.d.ts +5 -0
  210. package/dist/components/ui/label.js +13 -0
  211. package/dist/components/ui/popover.js +3 -3
  212. package/dist/components/ui/progress.js +1 -1
  213. package/dist/components/ui/select.js +6 -6
  214. package/dist/components/ui/sheet.js +5 -5
  215. package/dist/components/ui/sidebar.js +17 -18
  216. package/dist/components/ui/skeleton.js +1 -1
  217. package/dist/components/ui/slider.js +2 -2
  218. package/dist/components/ui/table.js +2 -2
  219. package/dist/components/ui/tabs.js +2 -2
  220. package/dist/components/ui/textarea.js +1 -1
  221. package/dist/components/ui/toggle-group.js +2 -2
  222. package/dist/components/ui/toggle.js +4 -4
  223. package/dist/components/ui/tooltip.js +2 -2
  224. package/dist/index.d.ts +35 -8
  225. package/dist/index.js +30 -4
  226. package/dist/lib/chart-frame.d.ts +51 -7
  227. package/dist/lib/chart-frame.js +390 -133
  228. package/dist/lib/chart-marks.d.ts +83 -0
  229. package/dist/lib/chart-marks.js +216 -0
  230. package/dist/lib/chart-series.d.ts +42 -10
  231. package/dist/lib/compact-columns.d.ts +19 -0
  232. package/dist/lib/compact-columns.js +55 -0
  233. package/dist/lib/fit-text.d.ts +6 -0
  234. package/dist/lib/fit-text.js +11 -0
  235. package/dist/lib/format.d.ts +8 -3
  236. package/dist/lib/format.js +55 -17
  237. package/dist/lib/heat.d.ts +7 -0
  238. package/dist/lib/heat.js +14 -0
  239. package/dist/lib/heatmap-navigation.d.ts +8 -0
  240. package/dist/lib/heatmap-navigation.js +49 -0
  241. package/dist/lib/scatter.d.ts +88 -0
  242. package/dist/lib/scatter.js +179 -0
  243. package/dist/lib/ticks.d.ts +27 -0
  244. package/dist/lib/ticks.js +67 -0
  245. package/dist/lib/tone.d.ts +36 -0
  246. package/dist/lib/tone.js +35 -0
  247. package/dist/lib/treemap.d.ts +0 -5
  248. package/dist/lib/treemap.js +1 -11
  249. package/dist/lib/use-element-width.d.ts +5 -0
  250. package/dist/lib/use-element-width.js +15 -0
  251. package/package.json +5 -1
  252. package/registry.lock.json +16 -0
  253. package/report.css +63 -47
  254. package/styles/siyahi.css +708 -55
@@ -0,0 +1,39 @@
1
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@siyahi/ui";
2
+
3
+ const questions = [
4
+ ["refresh", "When are the figures refreshed?", "Every night at midnight IST, and every minute for today's orders."],
5
+ [
6
+ "refunds",
7
+ "How are refunds counted?",
8
+ "A refund comes off the month the order was placed in, not the month it was paid.",
9
+ ],
10
+ ["stores", "Can I add a second store?", "Yes. Each store is its own workspace, and the totals add them up."],
11
+ ] as const;
12
+
13
+ function Questions() {
14
+ return questions.map(([value, question, answer]) => (
15
+ <AccordionItem key={value} value={value}>
16
+ <AccordionTrigger>{question}</AccordionTrigger>
17
+ <AccordionContent>{answer}</AccordionContent>
18
+ </AccordionItem>
19
+ ));
20
+ }
21
+
22
+ export default function AccordionExample() {
23
+ return (
24
+ <div className="grid gap-6 md:grid-cols-2">
25
+ <div className="flex flex-col gap-2">
26
+ <p className="text-sm text-muted-foreground">One open at a time</p>
27
+ <Accordion aria-label="One open at a time" defaultValue={["refresh"]}>
28
+ <Questions />
29
+ </Accordion>
30
+ </div>
31
+ <div className="flex flex-col gap-2">
32
+ <p className="text-sm text-muted-foreground">Several open</p>
33
+ <Accordion aria-label="Several open" multiple defaultValue={["refresh", "refunds"]}>
34
+ <Questions />
35
+ </Accordion>
36
+ </div>
37
+ </div>
38
+ );
39
+ }
@@ -0,0 +1,24 @@
1
+ import { AlertDescription, AlertTitle, StatusAlert } from "@siyahi/ui";
2
+
3
+ export default function AlertExample() {
4
+ return (
5
+ <div className="flex flex-col gap-3">
6
+ <StatusAlert>
7
+ <AlertTitle>Figures are delayed</AlertTitle>
8
+ <AlertDescription>Sales figures refresh every fifteen minutes during opening hours.</AlertDescription>
9
+ </StatusAlert>
10
+ <StatusAlert tone="warning">
11
+ <AlertTitle>Two payments are unmatched</AlertTitle>
12
+ <AlertDescription>The bank statement lists payments no order accounts for yet.</AlertDescription>
13
+ </StatusAlert>
14
+ <StatusAlert tone="negative">
15
+ <AlertTitle>Import failed</AlertTitle>
16
+ <AlertDescription>The CSV could not be read. Export it again and retry.</AlertDescription>
17
+ </StatusAlert>
18
+ <StatusAlert tone="positive">
19
+ <AlertTitle>Refunds are settled</AlertTitle>
20
+ <AlertDescription>All 14 refunds from last week have reached the customers' accounts.</AlertDescription>
21
+ </StatusAlert>
22
+ </div>
23
+ );
24
+ }
@@ -0,0 +1,40 @@
1
+ import { AppSidebar, SidebarProvider } from "@siyahi/ui";
2
+ import {
3
+ BlocksIcon,
4
+ ChartAreaIcon,
5
+ CodeIcon,
6
+ FileTextIcon,
7
+ HouseIcon,
8
+ LayersIcon,
9
+ PaletteIcon,
10
+ SlidersHorizontalIcon,
11
+ } from "lucide-react";
12
+
13
+ // No `items` on a view, so each one is a plain link.
14
+ const views = [
15
+ { title: "Overview", url: "#/overview", icon: <HouseIcon /> },
16
+ { title: "Foundations", url: "#/foundations", icon: <PaletteIcon /> },
17
+ { title: "Components", url: "#/components", icon: <LayersIcon /> },
18
+ { title: "Inputs and overlays", url: "#/inputs", icon: <SlidersHorizontalIcon /> },
19
+ { title: "Data", url: "#/data", icon: <ChartAreaIcon /> },
20
+ { title: "Blocks", url: "#/blocks", icon: <BlocksIcon />, isActive: true },
21
+ { title: "Reports", url: "#/reports", icon: <FileTextIcon /> },
22
+ // linkProps go onto the anchor: here a new tab, in an app often onMouseEnter to prefetch the view's data.
23
+ {
24
+ title: "Source",
25
+ url: "https://github.com/jatinbansal1998/siyahi",
26
+ icon: <CodeIcon />,
27
+ linkProps: { target: "_blank", rel: "noreferrer" },
28
+ },
29
+ ];
30
+
31
+ export default function AppSidebarExample() {
32
+ return (
33
+ // In an app, AppSidebar sits fixed at the edge; collapsible="none" draws it in place here.
34
+ <SidebarProvider className="min-h-0">
35
+ <div className="flex overflow-hidden rounded-lg border">
36
+ <AppSidebar collapsible="none" navMain={views} navLabel="Views" />
37
+ </div>
38
+ </SidebarProvider>
39
+ );
40
+ }
@@ -0,0 +1,24 @@
1
+ import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup } from "@siyahi/ui";
2
+
3
+ export default function AvatarExample() {
4
+ return (
5
+ <div className="flex items-center gap-6">
6
+ <Avatar>
7
+ <AvatarFallback>JB</AvatarFallback>
8
+ </Avatar>
9
+ {/* A group overlaps its avatars; the first one's badge stays over its neighbour. */}
10
+ <AvatarGroup>
11
+ <Avatar>
12
+ <AvatarFallback>JB</AvatarFallback>
13
+ <AvatarBadge aria-label="Online" />
14
+ </Avatar>
15
+ <Avatar>
16
+ <AvatarFallback>HU</AvatarFallback>
17
+ </Avatar>
18
+ <Avatar>
19
+ <AvatarFallback>AK</AvatarFallback>
20
+ </Avatar>
21
+ </AvatarGroup>
22
+ </div>
23
+ );
24
+ }
@@ -0,0 +1,26 @@
1
+ import { Badge, Delta, StatusBadge } from "@siyahi/ui";
2
+
3
+ export default function BadgeExample() {
4
+ return (
5
+ <div className="flex flex-col gap-3">
6
+ <div className="flex flex-wrap items-center gap-2">
7
+ <StatusBadge tone="positive">Paid</StatusBadge>
8
+ <StatusBadge tone="warning">Pending</StatusBadge>
9
+ <StatusBadge tone="negative">Failed</StatusBadge>
10
+ <StatusBadge tone="accent">New</StatusBadge>
11
+ <StatusBadge>Draft</StatusBadge>
12
+ </div>
13
+ <div className="flex flex-wrap items-center gap-2">
14
+ <Badge>Active</Badge>
15
+ <Badge variant="secondary">Archived</Badge>
16
+ <Badge variant="outline">Engineering</Badge>
17
+ <Badge variant="outline">
18
+ <Delta value={0.042} />
19
+ </Badge>
20
+ <Badge variant="outline">
21
+ <Delta value={-0.013} />
22
+ </Badge>
23
+ </div>
24
+ </div>
25
+ );
26
+ }
@@ -0,0 +1,22 @@
1
+ import { BarList, Card, CardContent, CardDescription, CardHeader, CardTitle, useFormat } from "@siyahi/ui";
2
+
3
+ const categories = [
4
+ { name: "Home Appliances and Kitchen Equipment", value: 100 },
5
+ { name: "Health, Beauty and Personal Care", value: 70 },
6
+ { name: "Books, Stationery and Office Supplies", value: 50 },
7
+ ];
8
+
9
+ export default function BarListLabelsExample() {
10
+ const { count } = useFormat();
11
+ return (
12
+ <Card>
13
+ <CardHeader>
14
+ <CardTitle>Orders by category, ranked</CardTitle>
15
+ <CardDescription>Orders placed this month in each category</CardDescription>
16
+ </CardHeader>
17
+ <CardContent>
18
+ <BarList data={categories} valueFormatter={count} />
19
+ </CardContent>
20
+ </Card>
21
+ );
22
+ }
@@ -0,0 +1,40 @@
1
+ import { BarList, Card, CardContent, CardDescription, CardHeader, CardTitle, useFormat } from "@siyahi/ui";
2
+
3
+ // This quarter's revenue against last quarter's, by city: the biggest rises and falls; made-up figures.
4
+ const gains = [
5
+ { name: "Mumbai", value: 84000 },
6
+ { name: "Bengaluru", value: 52000 },
7
+ { name: "Pune", value: 31000 },
8
+ ];
9
+ const losses = [
10
+ { name: "Kolkata", value: 18400 },
11
+ { name: "Jaipur", value: 7600 },
12
+ ];
13
+
14
+ export default function BarListSidesExample() {
15
+ const { money } = useFormat();
16
+ // One scale for both lists, so a small loss draws a short bar beside a large gain.
17
+ const max = Math.max(...[...gains, ...losses].map((row) => row.value));
18
+ return (
19
+ <Card>
20
+ <CardHeader>
21
+ <CardTitle>What moved revenue</CardTitle>
22
+ <CardDescription>The biggest ₹ rises and falls by city, on one scale</CardDescription>
23
+ </CardHeader>
24
+ {/* Each list is a column of its own, headed and ruled off, with its figures at its own right edge, so a
25
+ gain's figure never reads as the label of the loss beside it. */}
26
+ <CardContent>
27
+ <div className="grid gap-6 md:grid-cols-2 md:gap-0 md:divide-x">
28
+ <div className="md:pr-6">
29
+ <h3 className="text-muted-foreground mb-2 text-xs font-medium">Gains</h3>
30
+ <BarList data={gains} max={max} color="var(--positive)" valueFormatter={(v) => money(v)} />
31
+ </div>
32
+ <div className="md:pl-6">
33
+ <h3 className="text-muted-foreground mb-2 text-xs font-medium">Losses</h3>
34
+ <BarList data={losses} max={max} color="var(--negative)" valueFormatter={(v) => money(v)} />
35
+ </div>
36
+ </div>
37
+ </CardContent>
38
+ </Card>
39
+ );
40
+ }
@@ -0,0 +1,24 @@
1
+ import { BarList, Card, CardContent, CardDescription, CardHeader, CardTitle, Delta, useFormat } from "@siyahi/ui";
2
+
3
+ // value is the drop in a customer's monthly spend; detail is that drop as a share of last month's.
4
+ const largestDrops = [
5
+ { name: "Sharma Textiles", value: 18400, detail: <Delta value={-0.062} /> },
6
+ { name: "Bluepine Logistics", value: 12900, detail: <Delta value={-0.047} /> },
7
+ { name: "Lakeview Clinics", value: 7600, detail: <Delta value={-0.072} /> },
8
+ { name: "Coastal Foods (India)", value: 4100, detail: <Delta value={-0.06} /> },
9
+ ];
10
+
11
+ export default function BarListExample() {
12
+ const { money } = useFormat();
13
+ return (
14
+ <Card>
15
+ <CardHeader>
16
+ <CardTitle>Needs attention</CardTitle>
17
+ <CardDescription>Customers whose spend fell most this month</CardDescription>
18
+ </CardHeader>
19
+ <CardContent>
20
+ <BarList data={largestDrops} valueFormatter={(v) => money(v)} showPercentage />
21
+ </CardContent>
22
+ </Card>
23
+ );
24
+ }
@@ -0,0 +1,28 @@
1
+ import {
2
+ Breadcrumb,
3
+ BreadcrumbItem,
4
+ BreadcrumbLink,
5
+ BreadcrumbList,
6
+ BreadcrumbPage,
7
+ BreadcrumbSeparator,
8
+ } from "@siyahi/ui";
9
+
10
+ export default function BreadcrumbExample() {
11
+ return (
12
+ <Breadcrumb>
13
+ <BreadcrumbList>
14
+ <BreadcrumbItem>
15
+ <BreadcrumbLink href="#/components">Projects</BreadcrumbLink>
16
+ </BreadcrumbItem>
17
+ <BreadcrumbSeparator />
18
+ <BreadcrumbItem>
19
+ <BreadcrumbLink href="#/components">Website</BreadcrumbLink>
20
+ </BreadcrumbItem>
21
+ <BreadcrumbSeparator />
22
+ <BreadcrumbItem>
23
+ <BreadcrumbPage>Checkout redesign</BreadcrumbPage>
24
+ </BreadcrumbItem>
25
+ </BreadcrumbList>
26
+ </Breadcrumb>
27
+ );
28
+ }
@@ -0,0 +1,23 @@
1
+ import { Button, Toggle } from "@siyahi/ui";
2
+ import { DownloadIcon, Loader2Icon, PinIcon } from "lucide-react";
3
+
4
+ export default function ButtonStatesExample() {
5
+ return (
6
+ <div className="flex flex-wrap items-center gap-2">
7
+ <Button disabled>Save</Button>
8
+ <Button variant="outline" disabled>
9
+ <DownloadIcon />
10
+ Export
11
+ </Button>
12
+ {/* Busy: the label stays and the icon spins, so the button keeps its width while the work runs. */}
13
+ <Button disabled aria-busy>
14
+ <Loader2Icon className="motion-safe:animate-spin" />
15
+ Saving
16
+ </Button>
17
+ <Toggle variant="outline" defaultPressed aria-label="Pin to top">
18
+ <PinIcon />
19
+ Pinned
20
+ </Toggle>
21
+ </div>
22
+ );
23
+ }
@@ -0,0 +1,21 @@
1
+ import { Button } from "@siyahi/ui";
2
+ import { DownloadIcon, RefreshCwIcon } from "lucide-react";
3
+
4
+ export default function ButtonExample() {
5
+ return (
6
+ <div className="flex flex-wrap items-center gap-2">
7
+ <Button>Save</Button>
8
+ <Button variant="outline">
9
+ <DownloadIcon />
10
+ Export
11
+ </Button>
12
+ <Button variant="secondary">Secondary</Button>
13
+ <Button variant="ghost">Ghost</Button>
14
+ <Button variant="destructive">Delete</Button>
15
+ <Button variant="link">Link</Button>
16
+ <Button variant="outline" size="icon" aria-label="Refresh">
17
+ <RefreshCwIcon />
18
+ </Button>
19
+ </div>
20
+ );
21
+ }
@@ -0,0 +1,11 @@
1
+ import { Calendar } from "@siyahi/ui";
2
+ import { useState } from "react";
3
+
4
+ export default function CalendarExample() {
5
+ const [date, setDate] = useState<Date | undefined>(new Date(2026, 9, 20));
6
+ return (
7
+ <div className="w-fit rounded-lg border">
8
+ <Calendar mode="single" selected={date} onSelect={setDate} defaultMonth={new Date(2026, 9, 1)} />
9
+ </div>
10
+ );
11
+ }
@@ -0,0 +1,33 @@
1
+ import { AlertDescription, AlertTitle, Callout, Quote, StatusAlert } from "@siyahi/ui";
2
+ import { LightbulbIcon, InfoIcon, TriangleAlertIcon, TrendingUpIcon, TrendingDownIcon } from "lucide-react";
3
+
4
+ export default function CalloutExample() {
5
+ return (
6
+ <div className="grid max-w-2xl gap-3">
7
+ <Callout tone="accent" icon={<LightbulbIcon />} title="The takeaway">
8
+ Two of eleven pricing tests raised revenue; <strong>none</strong> held up in both regions.
9
+ </Callout>
10
+ <Callout icon={<InfoIcon />} title="How the tests were run">
11
+ Four weeks each on a random tenth of new visitors, with refunds and payment fees taken off.
12
+ </Callout>
13
+ <Callout tone="warning" icon={<TriangleAlertIcon />} title="Do not use the combined result">
14
+ It counted orders placed before the test began, so its revenue claims are withdrawn.
15
+ </Callout>
16
+ <div className="grid gap-3 sm:grid-cols-2">
17
+ <Callout tone="positive" icon={<TrendingUpIcon />} title="Best test">
18
+ Annual plan shown first: <strong className="whitespace-nowrap">+₹10,616</strong> a week.
19
+ </Callout>
20
+ <Callout tone="negative" icon={<TrendingDownIcon />} title="Worst test">
21
+ Free delivery only above ₹999: <strong className="whitespace-nowrap">−₹70,679</strong> a week.
22
+ </Callout>
23
+ </div>
24
+ <Quote source="The hosting provider's incident report, 21 Oct 2026">
25
+ Requests to the Mumbai region failed for 42 minutes after a configuration change, which has been rolled back.
26
+ </Quote>
27
+ <StatusAlert tone="warning">
28
+ <AlertTitle>Order history is incomplete</AlertTitle>
29
+ <AlertDescription>The old shop's export starts in April 2024; earlier orders are missing.</AlertDescription>
30
+ </StatusAlert>
31
+ </div>
32
+ );
33
+ }
@@ -0,0 +1,36 @@
1
+ import {
2
+ Button,
3
+ Card,
4
+ CardAction,
5
+ CardContent,
6
+ CardDescription,
7
+ CardFooter,
8
+ CardHeader,
9
+ CardTitle,
10
+ useFormat,
11
+ } from "@siyahi/ui";
12
+ import { DownloadIcon } from "lucide-react";
13
+
14
+ export default function CardExample() {
15
+ const { money } = useFormat();
16
+ return (
17
+ <Card>
18
+ <CardHeader>
19
+ <CardTitle>Revenue this quarter</CardTitle>
20
+ <CardDescription>Across all stores</CardDescription>
21
+ <CardAction>
22
+ <Button variant="outline" size="sm">
23
+ <DownloadIcon />
24
+ Export CSV
25
+ </Button>
26
+ </CardAction>
27
+ </CardHeader>
28
+ <CardContent>
29
+ <p className="text-3xl font-semibold">{money(4512300)}</p>
30
+ </CardContent>
31
+ <CardFooter>
32
+ <p className="text-muted-foreground">Updated every night at midnight IST</p>
33
+ </CardFooter>
34
+ </Card>
35
+ );
36
+ }
@@ -0,0 +1,104 @@
1
+ import {
2
+ Card,
3
+ CardContent,
4
+ CardDescription,
5
+ CardHeader,
6
+ CardTitle,
7
+ ChangeBar,
8
+ DataTable,
9
+ DataTableBody,
10
+ DataTableCompactColumnsToggle,
11
+ DataTableFootnote,
12
+ DataTableHeader,
13
+ DataTableRoot,
14
+ DataTableSortHeader,
15
+ DataTableToolbarSection,
16
+ useFormat,
17
+ type DataTableColumnDef,
18
+ } from "@siyahi/ui";
19
+
20
+ interface Region {
21
+ region: string;
22
+ /** Revenue in January and in February, in rupees; made-up figures. */
23
+ january: number;
24
+ february: number;
25
+ change: number;
26
+ }
27
+
28
+ const region = (name: string, january: number, february: number): Region => ({
29
+ region: name,
30
+ january,
31
+ february,
32
+ change: february / january - 1,
33
+ });
34
+
35
+ const regions: Region[] = [
36
+ region("West", 231900, 258000),
37
+ region("South", 248300, 262500),
38
+ region("Central", 161300, 166000),
39
+ region("East", 250400, 255600),
40
+ region("Northeast", 283100, 276000),
41
+ region("North", 241800, 224400),
42
+ ];
43
+
44
+ // Every bar is a share of the column's largest move, and the column holds gains and losses, so the bars diverge.
45
+ const largestChange = Math.max(...regions.map((r) => Math.abs(r.change)));
46
+ const diverging = regions.some((r) => r.change < 0) && regions.some((r) => r.change > 0);
47
+
48
+ function Money({ amount, muted = false }: { amount: number; muted?: boolean }) {
49
+ const text = useFormat().money(amount);
50
+ return muted ? <span className="text-muted-foreground">{text}</span> : text;
51
+ }
52
+
53
+ const header = () => <DataTableSortHeader />;
54
+
55
+ const columns: DataTableColumnDef<Region>[] = [
56
+ { accessorKey: "region", header, size: 130, meta: { label: "Region", compact: true } },
57
+ {
58
+ accessorKey: "january",
59
+ header,
60
+ size: 130,
61
+ meta: { label: "January", variant: "number" },
62
+ cell: ({ row }) => <Money amount={row.original.january} muted />,
63
+ },
64
+ {
65
+ accessorKey: "february",
66
+ header,
67
+ size: 130,
68
+ meta: { label: "February", variant: "number", compact: true },
69
+ cell: ({ row }) => <Money amount={row.original.february} />,
70
+ },
71
+ {
72
+ accessorKey: "change",
73
+ header,
74
+ size: 150,
75
+ meta: { label: "Change", variant: "number", compact: true },
76
+ cell: ({ row }) => <ChangeBar value={row.original.change} max={largestChange} diverging={diverging} />,
77
+ },
78
+ ];
79
+
80
+ export default function ChangeBarExample() {
81
+ return (
82
+ <Card>
83
+ <CardHeader>
84
+ <CardTitle>The West grew 11.3% in February, the North fell 7.2%</CardTitle>
85
+ <CardDescription>Each region's revenue in February against January</CardDescription>
86
+ </CardHeader>
87
+ <CardContent>
88
+ <DataTableRoot data={regions} columns={columns}>
89
+ <DataTableToolbarSection>
90
+ <DataTableCompactColumnsToggle />
91
+ </DataTableToolbarSection>
92
+ <DataTable aria-label="February against January">
93
+ <DataTableHeader />
94
+ <DataTableBody />
95
+ <DataTableFootnote>
96
+ Each percent is the change on January's value, and the bar is its size against the largest move. Gains run
97
+ right of the centre line, losses left.
98
+ </DataTableFootnote>
99
+ </DataTable>
100
+ </DataTableRoot>
101
+ </CardContent>
102
+ </Card>
103
+ );
104
+ }
@@ -0,0 +1,36 @@
1
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle, ChangeGrid, type ChangeGridRow } from "@siyahi/ui";
2
+
3
+ // Profit or loss per store per quarter; made-up figures.
4
+ const quarters = ["Q1", "Q2", "Q3", "Q4"];
5
+ const stores: [string, number[]][] = [
6
+ ["Koramangala", [412_000, 386_000, 455_000, 520_000]],
7
+ ["Indiranagar", [218_000, -42_000, 131_000, 264_000]],
8
+ ["Whitefield", [-86_000, -124_000, 38_000, 61_000]],
9
+ ["Online", [305_000, 344_000, 398_000, 471_000]],
10
+ ["Jayanagar", [96_000, -158_000, -212_000, -64_000]],
11
+ ];
12
+ const rows: ChangeGridRow[] = stores.map(([label, values]) => ({
13
+ label,
14
+ values,
15
+ total: values.reduce((sum, value) => sum + value, 0),
16
+ }));
17
+
18
+ export default function ChangeGridMoneyExample() {
19
+ return (
20
+ <Card>
21
+ <CardHeader>
22
+ <CardTitle>Profit by store and quarter</CardTitle>
23
+ <CardDescription>After rent and wages. The year adds its quarters.</CardDescription>
24
+ </CardHeader>
25
+ <CardContent>
26
+ <ChangeGrid
27
+ label="Profit by store and quarter"
28
+ columns={quarters}
29
+ rows={rows}
30
+ format="money"
31
+ totalLabel="Year"
32
+ />
33
+ </CardContent>
34
+ </Card>
35
+ );
36
+ }
@@ -0,0 +1,43 @@
1
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle, ChangeGrid, type ChangeGridRow } from "@siyahi/ui";
2
+
3
+ // A café chain's sales growth on the month before, per financial year (April to March); made-up figures.
4
+ const months = ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar"];
5
+ const growth: Omit<ChangeGridRow, "total">[] = [
6
+ {
7
+ label: "FY25",
8
+ values: [0.031, 0.012, -0.024, 0.008, 0.017, -0.006, 0.041, 0.052, 0.063, -0.038, 0.004, 0.022],
9
+ },
10
+ {
11
+ label: "FY26",
12
+ values: [0.018, -0.011, -0.032, 0.014, 0.009, 0, 0.036, 0.047, 0.071, -0.044, -0.008, 0.019],
13
+ },
14
+ // The year is under way: months still to come have no figure.
15
+ {
16
+ label: "FY27",
17
+ values: [0.026, 0.015, -0.018, 0.021, 0.012, 0.007, 0.044, null, null, null, null, null],
18
+ },
19
+ ];
20
+
21
+ // Months compound: a year's growth is the product of (1 + each month), less one.
22
+ const rows: ChangeGridRow[] = growth.map(({ label, values }) => ({
23
+ label,
24
+ values,
25
+ total: values.reduce<number>((year, month) => year * (1 + (month ?? 0)), 1) - 1,
26
+ }));
27
+
28
+ export default function ChangeGridExample() {
29
+ return (
30
+ <Card>
31
+ <CardHeader>
32
+ <CardTitle>Sales growth by month</CardTitle>
33
+ <CardDescription>
34
+ Each month against the one before, by financial year; FY27 ends in March 2027. Deeper tints are larger
35
+ changes; the year compounds its months.
36
+ </CardDescription>
37
+ </CardHeader>
38
+ <CardContent>
39
+ <ChangeGrid label="Sales growth by month and financial year" columns={months} rows={rows} totalLabel="Year" />
40
+ </CardContent>
41
+ </Card>
42
+ );
43
+ }
@@ -0,0 +1,45 @@
1
+ import { AreaChartCard, ToggleGroup, ToggleGroupItem, useFormat, type ChartSeries } from "@siyahi/ui";
2
+
3
+ // Money a new fund manages, month by month from launch, made up for the catalogue: ₹2L to ₹3.1Cr.
4
+ const data = [
5
+ { month: "Nov", managed: 200000 },
6
+ { month: "Dec", managed: 450000 },
7
+ { month: "Jan", managed: 900000 },
8
+ { month: "Feb", managed: 1600000 },
9
+ { month: "Mar", managed: 2400000 },
10
+ { month: "Apr", managed: 3900000 },
11
+ { month: "May", managed: 5800000 },
12
+ { month: "Jun", managed: 8200000 },
13
+ { month: "Jul", managed: 12500000 },
14
+ { month: "Aug", managed: 17000000 },
15
+ { month: "Sep", managed: 23500000 },
16
+ { month: "Oct", managed: 31000000 },
17
+ ];
18
+
19
+ const series: ChartSeries<(typeof data)[number]> = [
20
+ { key: "managed", label: "Money managed", color: "var(--chart-1)" },
21
+ ];
22
+
23
+ export default function ChartAreaLogExample() {
24
+ const { money, moneyCompact } = useFormat();
25
+ return (
26
+ <AreaChartCard
27
+ title="₹3.1Cr managed a year after launch"
28
+ description="Linear shows the size today; Log shows the early months, when it grew fastest."
29
+ action={
30
+ <ToggleGroup defaultValue={["1Y"]} variant="outline" size="sm" aria-label="Range">
31
+ <ToggleGroupItem value="6M">6M</ToggleGroupItem>
32
+ <ToggleGroupItem value="1Y">1Y</ToggleGroupItem>
33
+ </ToggleGroup>
34
+ }
35
+ data={data}
36
+ xKey="month"
37
+ series={series}
38
+ // Linear is selected first; the buttons after the range toggle let the reader switch to log.
39
+ yScaleToggle
40
+ valueFormatter={money}
41
+ yTickFormatter={moneyCompact}
42
+ height={256}
43
+ />
44
+ );
45
+ }