@siyahi/ui 0.0.0-stage → 0.1.0-next.4

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 (192) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -2
  3. package/THIRD_PARTY_NOTICES.md +51 -0
  4. package/dist/components/registry/dashboard-01/section-cards.d.ts +17 -0
  5. package/dist/components/registry/dashboard-01/section-cards.js +39 -0
  6. package/dist/components/registry/dashboardcn/bar-list.d.ts +24 -0
  7. package/dist/components/registry/dashboardcn/bar-list.js +71 -0
  8. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +134 -0
  9. package/dist/components/registry/heatmap/calendar-heatmap.js +497 -0
  10. package/dist/components/registry/heatmap/status-heatmap.d.ts +120 -0
  11. package/dist/components/registry/heatmap/status-heatmap.js +330 -0
  12. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +145 -0
  13. package/dist/components/registry/heatmap/weekday-heatmap.js +489 -0
  14. package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +26 -0
  15. package/dist/components/registry/niko-table/components/data-table-column-actions.js +32 -0
  16. package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +13 -0
  17. package/dist/components/registry/niko-table/components/data-table-column-filter.js +17 -0
  18. package/dist/components/registry/niko-table/components/data-table-column-header.d.ts +30 -0
  19. package/dist/components/registry/niko-table/components/data-table-column-header.js +35 -0
  20. package/dist/components/registry/niko-table/components/data-table-column-sort.d.ts +21 -0
  21. package/dist/components/registry/niko-table/components/data-table-column-sort.js +36 -0
  22. package/dist/components/registry/niko-table/components/data-table-column-title.d.ts +12 -0
  23. package/dist/components/registry/niko-table/components/data-table-column-title.js +18 -0
  24. package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +108 -0
  25. package/dist/components/registry/niko-table/components/data-table-empty-state.js +148 -0
  26. package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +46 -0
  27. package/dist/components/registry/niko-table/components/data-table-faceted-filter.js +133 -0
  28. package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +111 -0
  29. package/dist/components/registry/niko-table/components/data-table-grouped-rows.js +77 -0
  30. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +65 -0
  31. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.js +65 -0
  32. package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +50 -0
  33. package/dist/components/registry/niko-table/components/data-table-row-context-menu.js +42 -0
  34. package/dist/components/registry/niko-table/components/data-table-row-menu.d.ts +51 -0
  35. package/dist/components/registry/niko-table/components/data-table-row-menu.js +65 -0
  36. package/dist/components/registry/niko-table/components/data-table-toolbar-section.d.ts +7 -0
  37. package/dist/components/registry/niko-table/components/data-table-toolbar-section.js +63 -0
  38. package/dist/components/registry/niko-table/config/data-table.d.ts +156 -0
  39. package/dist/components/registry/niko-table/config/data-table.js +279 -0
  40. package/dist/components/registry/niko-table/config/feature-detection.d.ts +39 -0
  41. package/dist/components/registry/niko-table/config/feature-detection.js +174 -0
  42. package/dist/components/registry/niko-table/core/data-table-context.d.ts +157 -0
  43. package/dist/components/registry/niko-table/core/data-table-context.js +326 -0
  44. package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +85 -0
  45. package/dist/components/registry/niko-table/core/data-table-error-boundary.js +116 -0
  46. package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +49 -0
  47. package/dist/components/registry/niko-table/core/data-table-grouped-row.js +112 -0
  48. package/dist/components/registry/niko-table/core/data-table-root.d.ts +62 -0
  49. package/dist/components/registry/niko-table/core/data-table-root.js +406 -0
  50. package/dist/components/registry/niko-table/core/data-table-structure.d.ts +153 -0
  51. package/dist/components/registry/niko-table/core/data-table-structure.js +370 -0
  52. package/dist/components/registry/niko-table/core/data-table.d.ts +30 -0
  53. package/dist/components/registry/niko-table/core/data-table.js +126 -0
  54. package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +49 -0
  55. package/dist/components/registry/niko-table/filters/table-column-actions.js +48 -0
  56. package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +51 -0
  57. package/dist/components/registry/niko-table/filters/table-column-sort.js +184 -0
  58. package/dist/components/registry/niko-table/filters/table-column-title.d.ts +17 -0
  59. package/dist/components/registry/niko-table/filters/table-column-title.js +20 -0
  60. package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +40 -0
  61. package/dist/components/registry/niko-table/filters/table-faceted-filter.js +210 -0
  62. package/dist/components/registry/niko-table/hooks/use-derived-column-title.d.ts +29 -0
  63. package/dist/components/registry/niko-table/hooks/use-derived-column-title.js +40 -0
  64. package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +49 -0
  65. package/dist/components/registry/niko-table/hooks/use-generated-options.js +144 -0
  66. package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +59 -0
  67. package/dist/components/registry/niko-table/lib/build-faceted-options.js +82 -0
  68. package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +33 -0
  69. package/dist/components/registry/niko-table/lib/column-resize-handle.js +175 -0
  70. package/dist/components/registry/niko-table/lib/constants.d.ts +128 -0
  71. package/dist/components/registry/niko-table/lib/constants.js +123 -0
  72. package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +35 -0
  73. package/dist/components/registry/niko-table/lib/create-scroll-handler.js +63 -0
  74. package/dist/components/registry/niko-table/lib/data-table-features.d.ts +218 -0
  75. package/dist/components/registry/niko-table/lib/data-table-features.js +127 -0
  76. package/dist/components/registry/niko-table/lib/filter-functions.d.ts +47 -0
  77. package/dist/components/registry/niko-table/lib/filter-functions.js +309 -0
  78. package/dist/components/registry/niko-table/lib/filter-rows.d.ts +14 -0
  79. package/dist/components/registry/niko-table/lib/filter-rows.js +28 -0
  80. package/dist/components/registry/niko-table/lib/flex-columns.d.ts +48 -0
  81. package/dist/components/registry/niko-table/lib/flex-columns.js +65 -0
  82. package/dist/components/registry/niko-table/lib/format.d.ts +33 -0
  83. package/dist/components/registry/niko-table/lib/format.js +99 -0
  84. package/dist/components/registry/niko-table/lib/render-cell-content.d.ts +17 -0
  85. package/dist/components/registry/niko-table/lib/render-cell-content.js +65 -0
  86. package/dist/components/registry/niko-table/lib/row-click.d.ts +67 -0
  87. package/dist/components/registry/niko-table/lib/row-click.js +28 -0
  88. package/dist/components/registry/niko-table/lib/styles.d.ts +6 -0
  89. package/dist/components/registry/niko-table/lib/styles.js +24 -0
  90. package/dist/components/registry/niko-table/lib/use-header-min-widths.d.ts +17 -0
  91. package/dist/components/registry/niko-table/lib/use-header-min-widths.js +82 -0
  92. package/dist/components/registry/niko-table/types/index.d.ts +141 -0
  93. package/dist/components/registry/niko-table/types/index.js +2 -0
  94. package/dist/components/registry/niko-table/ui/table.d.ts +13 -0
  95. package/dist/components/registry/niko-table/ui/table.js +74 -0
  96. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +18 -0
  97. package/dist/components/registry/sidebar-07/app-sidebar.js +26 -0
  98. package/dist/components/registry/sidebar-07/nav-main.d.ts +15 -0
  99. package/dist/components/registry/sidebar-07/nav-main.js +25 -0
  100. package/dist/components/registry/sidebar-07/nav-projects.d.ts +9 -0
  101. package/dist/components/registry/sidebar-07/nav-projects.js +43 -0
  102. package/dist/components/registry/sidebar-07/nav-user.d.ts +9 -0
  103. package/dist/components/registry/sidebar-07/nav-user.js +70 -0
  104. package/dist/components/registry/sidebar-07/team-switcher.d.ts +10 -0
  105. package/dist/components/registry/sidebar-07/team-switcher.js +70 -0
  106. package/dist/components/siyahi/delta.d.ts +10 -0
  107. package/dist/components/siyahi/delta.js +27 -0
  108. package/dist/components/siyahi/local-time.d.ts +7 -0
  109. package/dist/components/siyahi/local-time.js +22 -0
  110. package/dist/components/siyahi/price-chart.d.ts +12 -0
  111. package/dist/components/siyahi/price-chart.js +80 -0
  112. package/dist/components/siyahi/siyahi-provider.d.ts +12 -0
  113. package/dist/components/siyahi/siyahi-provider.js +31 -0
  114. package/dist/components/siyahi/treemap.d.ts +14 -0
  115. package/dist/components/siyahi/treemap.js +58 -0
  116. package/dist/components/ui/alert.d.ts +12 -0
  117. package/dist/components/ui/alert.js +43 -0
  118. package/dist/components/ui/avatar.d.ts +13 -0
  119. package/dist/components/ui/avatar.js +50 -0
  120. package/dist/components/ui/badge.d.ts +9 -0
  121. package/dist/components/ui/badge.js +29 -0
  122. package/dist/components/ui/breadcrumb.d.ts +12 -0
  123. package/dist/components/ui/breadcrumb.js +72 -0
  124. package/dist/components/ui/button.d.ts +10 -0
  125. package/dist/components/ui/button.js +44 -0
  126. package/dist/components/ui/calendar.d.ts +12 -0
  127. package/dist/components/ui/calendar.js +107 -0
  128. package/dist/components/ui/card.d.ts +13 -0
  129. package/dist/components/ui/card.js +56 -0
  130. package/dist/components/ui/chart.d.ts +46 -0
  131. package/dist/components/ui/chart.js +149 -0
  132. package/dist/components/ui/collapsible.d.ts +7 -0
  133. package/dist/components/ui/collapsible.js +24 -0
  134. package/dist/components/ui/command.d.ts +21 -0
  135. package/dist/components/ui/command.js +88 -0
  136. package/dist/components/ui/context-menu.d.ts +31 -0
  137. package/dist/components/ui/context-menu.js +132 -0
  138. package/dist/components/ui/dialog.d.ts +19 -0
  139. package/dist/components/ui/dialog.js +91 -0
  140. package/dist/components/ui/dropdown-menu.d.ts +31 -0
  141. package/dist/components/ui/dropdown-menu.js +136 -0
  142. package/dist/components/ui/input-group.d.ts +20 -0
  143. package/dist/components/ui/input-group.js +79 -0
  144. package/dist/components/ui/input.d.ts +5 -0
  145. package/dist/components/ui/input.js +15 -0
  146. package/dist/components/ui/popover.d.ts +11 -0
  147. package/dist/components/ui/popover.js +55 -0
  148. package/dist/components/ui/progress.d.ts +9 -0
  149. package/dist/components/ui/progress.js +43 -0
  150. package/dist/components/ui/scroll-area.d.ts +7 -0
  151. package/dist/components/ui/scroll-area.js +36 -0
  152. package/dist/components/ui/select.d.ts +17 -0
  153. package/dist/components/ui/select.js +97 -0
  154. package/dist/components/ui/separator.d.ts +5 -0
  155. package/dist/components/ui/separator.js +15 -0
  156. package/dist/components/ui/sheet.d.ts +16 -0
  157. package/dist/components/ui/sheet.js +89 -0
  158. package/dist/components/ui/sidebar.d.ts +65 -0
  159. package/dist/components/ui/sidebar.js +385 -0
  160. package/dist/components/ui/skeleton.d.ts +4 -0
  161. package/dist/components/ui/skeleton.js +12 -0
  162. package/dist/components/ui/slider.d.ts +5 -0
  163. package/dist/components/ui/slider.js +33 -0
  164. package/dist/components/ui/table.d.ts +12 -0
  165. package/dist/components/ui/table.js +66 -0
  166. package/dist/components/ui/tabs.d.ts +12 -0
  167. package/dist/components/ui/tabs.js +45 -0
  168. package/dist/components/ui/textarea.d.ts +5 -0
  169. package/dist/components/ui/textarea.js +13 -0
  170. package/dist/components/ui/toggle-group.d.ts +13 -0
  171. package/dist/components/ui/toggle-group.js +52 -0
  172. package/dist/components/ui/toggle.d.ts +10 -0
  173. package/dist/components/ui/toggle.js +36 -0
  174. package/dist/components/ui/tooltip.d.ts +8 -0
  175. package/dist/components/ui/tooltip.js +41 -0
  176. package/dist/hooks/use-mobile.d.ts +3 -0
  177. package/dist/hooks/use-mobile.js +18 -0
  178. package/dist/index.d.ts +73 -0
  179. package/dist/index.js +71 -0
  180. package/dist/lib/format.d.ts +24 -0
  181. package/dist/lib/format.js +58 -0
  182. package/dist/lib/locale.d.ts +12 -0
  183. package/dist/lib/locale.js +8 -0
  184. package/dist/lib/recharts.d.ts +2 -0
  185. package/dist/lib/recharts.js +1 -0
  186. package/dist/lib/utils.d.ts +2 -0
  187. package/dist/lib/utils.js +1 -0
  188. package/package.json +78 -3
  189. package/registry.lock.json +413 -0
  190. package/report.css +129 -0
  191. package/styles/shadcn.css +643 -0
  192. package/styles/siyahi.css +189 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jatin Bansal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,175 @@
1
- # Temporary Holding Version
1
+ <p><img src="assets/icon.svg" width="48" height="48" alt="Siyahi"></p>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # Siyahi
4
+
5
+ Siyahi (Hindi for ink) is a small design system for data-heavy React apps:
6
+ stock [shadcn/ui](https://ui.shadcn.com) on [Base UI](https://base-ui.com) and
7
+ Tailwind CSS v4, shipped as one npm package, `@siyahi/ui`. It adds a theme with
8
+ four meaning colours and a five-hue chart palette that pass WCAG contrast in
9
+ light and dark, a few finance components, locale-aware formatters, a lint that
10
+ keeps pages on the theme, and a catalogue site that is the documentation.
11
+
12
+ **Catalogue:** https://siyahi.jatinbansal.com
13
+
14
+ ## Install
15
+
16
+ Siyahi is pre-1.0; releases go out under the `next` tag. It needs React 19 and
17
+ Tailwind CSS v4, compiled by the Tailwind Vite plugin: the package's stylesheet
18
+ is Tailwind source, so a plain CSS import leaves every component unstyled.
19
+
20
+ ```sh
21
+ npm install @siyahi/ui@next tailwindcss @tailwindcss/vite
22
+ ```
23
+
24
+ ```ts
25
+ // vite.config.ts
26
+ import tailwindcss from "@tailwindcss/vite";
27
+ export default defineConfig({ plugins: [react(), tailwindcss()] });
28
+ ```
29
+
30
+ ```css
31
+ /* src/index.css */
32
+ @import "@siyahi/ui/styles.css";
33
+ ```
34
+
35
+ ```tsx
36
+ // src/main.tsx
37
+ import "./index.css";
38
+ import { SiyahiProvider } from "@siyahi/ui";
39
+ createRoot(root).render(
40
+ <SiyahiProvider>
41
+ <App />
42
+ </SiyahiProvider>,
43
+ );
44
+ ```
45
+
46
+ Everything comes from `@siyahi/ui`: the shadcn components, the registry
47
+ add-ons (data table, heatmaps, stat tiles, sidebar), Siyahi's own components
48
+ and the Recharts pieces charts are built from. Add `lucide-react` only if your
49
+ own code imports icons. A Next.js app compiles the same stylesheet through
50
+ `@tailwindcss/postcss` instead of the Vite plugin.
51
+
52
+ ### Install from a GitHub release
53
+
54
+ Until the npm publish is live, every merge to `main` also attaches both
55
+ tarballs to a [GitHub release](https://github.com/jatinbansal1998/siyahi/releases).
56
+ Install a version by URL, alongside `tailwindcss` and `@tailwindcss/vite` as
57
+ above:
58
+
59
+ ```sh
60
+ npm install --allow-remote=root https://github.com/jatinbansal1998/siyahi/releases/download/v<version>/siyahi-ui-<version>.tgz
61
+ npm install --allow-remote=root --save-dev https://github.com/jatinbansal1998/siyahi/releases/download/v<version>/siyahi-tools-<version>.tgz
62
+ ```
63
+
64
+ npm 12 refuses tarball URLs unless `allow-remote` permits them; put
65
+ `allow-remote=root` in the project's `.npmrc` so a later plain `npm install`
66
+ works too. The rolling `next` release always holds the newest build under fixed
67
+ names (`.../releases/download/next/siyahi-ui-next.tgz` and
68
+ `siyahi-tools-next.tgz`); its assets are replaced on every merge, so pin a
69
+ versioned URL in `package.json`.
70
+
71
+ ## What is in it
72
+
73
+ - **shadcn/ui components** in the `base-vega` style, installed with the shadcn
74
+ CLI and never edited.
75
+ - **Registry add-ons**, copied once with their origin and licence recorded: a
76
+ data table on TanStack Table, calendar, weekday and status heatmaps, a ranked
77
+ bar list, the `SectionCards` stat tile and the `sidebar-07` app shell.
78
+ - **Siyahi components**: `Delta` (a signed figure with ▲ ▼), `PriceChart`
79
+ (TradingView Lightweight Charts in theme colours), `Treemap` (holdings heat
80
+ map), `LocalTime` (a time in the configured zone with the viewer's own clock
81
+ in a tooltip) and `SiyahiProvider`.
82
+ - **Formatters**: `money`, `moneyCompact`, `pct` and `time`, or `useFormat()`
83
+ for the same bound to the provider's locale.
84
+ - **`report.css`** for static HTML reports that do not use React: the theme as
85
+ plain CSS variables plus base body styles, with no network requests.
86
+
87
+ ## Locale
88
+
89
+ Numbers, money and times default to Indian English, rupees and IST:
90
+ `₹1,53,110`, `₹2.4L`, `₹40Cr`, `14:30 IST`. In an Indian-region locale,
91
+ `moneyCompact` prints amounts under one lakh in full (`₹99,999`), never as `K`.
92
+ Pass another locale to the provider and every formatter and component under it
93
+ follows:
94
+
95
+ ```tsx
96
+ <SiyahiProvider locale={{ numberLocale: "en-US", currency: "USD", timeZone: "America/New_York" }}>
97
+ ```
98
+
99
+ The formatters print a minus sign and nothing else. A signed figure (a gain, a
100
+ loss, a change) goes through `<Delta>`, which adds ▲ or ▼ and the meaning
101
+ colour. Time zone names come from the runtime's ICU data; a slim Node or
102
+ browser build may print `GMT+5:30` where a full one prints `IST`.
103
+
104
+ ## Dark mode
105
+
106
+ The colour scheme follows the device (`prefers-color-scheme`). There is no
107
+ toggle and no class to set. The theme's dark values sit under the same `dark`
108
+ variant as the `dark:` utilities, so an app that wants its own toggle swaps one
109
+ line after the import and sets the `dark` class on `<html>`:
110
+
111
+ ```css
112
+ @import "@siyahi/ui/styles.css";
113
+ @custom-variant dark (&:where(.dark, .dark *));
114
+ ```
115
+
116
+ Both the tokens and the utilities then follow the class. Set `color-scheme` on
117
+ `<html>` yourself as well, so scrollbars and form controls match.
118
+
119
+ ## Lint
120
+
121
+ `@siyahi/tools` ships an [oxlint](https://oxc.rs) plugin. Its rules run only in
122
+ files that import `@siyahi/ui`, so older pages are left alone. They reject
123
+ colour literals (hex, `rgb()`, `oklch()`), Tailwind palette colours, Tailwind
124
+ arbitrary values such as `text-[13px]`, `dark:` and `light:` variants,
125
+ numeric font sizes, and chart configs with a per-scheme `theme` map (shadcn's
126
+ chart applies its dark half under a `.dark` class Siyahi never sets; name a
127
+ chart token with `color: "var(--chart-1)"` instead). Two of the rules are
128
+ [`@shadcn/lint`](https://github.com/shadcn-ui/lint)'s, scoped the same way.
129
+
130
+ ```sh
131
+ npm install --save-dev @siyahi/tools@next oxlint
132
+ ```
133
+
134
+ ```json
135
+ {
136
+ "jsPlugins": ["@siyahi/tools/lint"],
137
+ "settings": { "shadcn": { "ui": "@siyahi/ui", "themeImports": ["^@siyahi/ui/"] } },
138
+ "rules": {
139
+ "siyahi/no-color-literal": "error",
140
+ "siyahi/no-scheme-variant": "error",
141
+ "siyahi/no-numeric-font-size": "error",
142
+ "siyahi/no-chart-theme-map": "error",
143
+ "siyahi/no-raw-colors": "error",
144
+ "siyahi/no-arbitrary-values": "error"
145
+ }
146
+ }
147
+ ```
148
+
149
+ `@siyahi/tools` also has `siyahi-shots` (screenshots of a page at 1920 and 390
150
+ pixels wide in both schemes, with layout checks) and `siyahi-contrast` (the
151
+ theme contrast check). See [packages/tools](packages/tools/README.md).
152
+
153
+ ## This repository
154
+
155
+ | Path | What |
156
+ | ----------------- | --------------------------------------------------------------------------------- |
157
+ | `packages/ui` | `@siyahi/ui`. The theme is `styles/siyahi.css`, the only file with colour values. |
158
+ | `packages/tools` | `@siyahi/tools`: lint plugin, contrast check, screenshot script. |
159
+ | `apps/catalogue` | The catalogue site, a Vite app deployed as a Cloudflare Worker. |
160
+ | `assets/icon.svg` | The mark. |
161
+
162
+ Development uses pnpm and [Vite+](https://viteplus.dev):
163
+
164
+ ```sh
165
+ pnpm install
166
+ pnpm check # format, lint, unused code, generated files, build, typecheck, tests
167
+ pnpm dev # the catalogue on localhost
168
+ ```
169
+
170
+ See [CONTRIBUTING.md](CONTRIBUTING.md) before adding anything.
171
+
172
+ ## Licence
173
+
174
+ MIT, see [LICENSE](LICENSE). Code copied from other projects keeps its own
175
+ notice; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,51 @@
1
+ # Third-party notices
2
+
3
+ Siyahi is MIT licensed (see `LICENSE`). It contains code copied from the
4
+ projects below, each under the MIT licence. Every copied file starts with a
5
+ header naming its registry item, origin URL, licence and the SHA-256 of the
6
+ file as copied; `packages/ui/registry.lock.json` lists them all and
7
+ `pnpm generate:check` fails if a copied file is not named here.
8
+
9
+ ## Copied into `@siyahi/ui`
10
+
11
+ | What | Where in the package | Origin | Licence |
12
+ | --------------------------------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
13
+ | shadcn/ui core components (installed with `shadcn add`, never edited) | `src/components/ui/*`, `src/hooks/use-mobile.ts` | https://github.com/shadcn-ui/ui | MIT, Copyright (c) 2023 shadcn |
14
+ | shadcn `tailwind.css` (variants and utilities the components use) | `styles/shadcn.css` | https://github.com/shadcn-ui/ui/tree/main/packages/shadcn | MIT, Copyright (c) 2023 shadcn |
15
+ | shadcn block `sidebar-07` | `src/components/registry/sidebar-07/*` | https://ui.shadcn.com/r/styles/base-vega/sidebar-07.json | MIT, Copyright (c) 2023 shadcn |
16
+ | shadcn block `dashboard-01`, `SectionCards` only | `src/components/registry/dashboard-01/section-cards.tsx` | https://ui.shadcn.com/r/styles/base-vega/dashboard-01.json | MIT, Copyright (c) 2023 shadcn |
17
+ | Heatmaps: calendar, weekday by hour, status timeline | `src/components/registry/heatmap/*` | https://shadcn-heatmap.pages.dev/r/calendar-heatmap.json, https://shadcn-heatmap.pages.dev/r/weekday-heatmap.json, https://shadcn-heatmap.pages.dev/r/status-heatmap.json (source: https://github.com/rutopio/shadcn-heatmap) | MIT, Copyright (c) 2026 ChingRu |
18
+ | niko-table data table on TanStack Table | `src/components/registry/niko-table/*` | https://niko-table.com/r/data-table.json, https://niko-table.com/r/data-table-core.json, https://niko-table.com/r/data-table-ui.json, https://niko-table.com/r/data-table-faceted-filter.json, https://niko-table.com/r/data-table-column-sort.json (source: https://github.com/Semkoo/niko-table-registry) | MIT, Copyright (c) 2025 Semir N.; original work Copyright (c) 2025 WebDevSimplified |
19
+ | dashboardcn ranked list (`BarList`) | `src/components/registry/dashboardcn/bar-list.tsx` | https://dashboardcn.com/r/bar-list.json (source: https://github.com/NoahGdev/dashboardcn) | MIT, Copyright (c) 2026 dashboardcn contributors |
20
+
21
+ ## Runtime dependencies with attribution terms
22
+
23
+ | Package | Licence | Note |
24
+ | --------------------------------------------------------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `lightweight-charts` (TradingView) | Apache-2.0 | `PriceChart` keeps the library's attribution logo on by default; see https://github.com/tradingview/lightweight-charts/blob/master/NOTICE |
26
+ | `@fontsource-variable/geist`, `@fontsource-variable/geist-mono` | SIL Open Font License 1.1 (fonts), MIT (packaging) | Geist by Vercel |
27
+
28
+ Every other dependency is installed from npm under its own licence and is not
29
+ copied into this repository.
30
+
31
+ ## The MIT licence text
32
+
33
+ Each MIT notice above carries this permission text:
34
+
35
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ > of this software and associated documentation files (the "Software"), to deal
37
+ > in the Software without restriction, including without limitation the rights
38
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ > copies of the Software, and to permit persons to whom the Software is
40
+ > furnished to do so, subject to the following conditions:
41
+ >
42
+ > The above copyright notice and this permission notice shall be included in all
43
+ > copies or substantial portions of the Software.
44
+ >
45
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51
+ > SOFTWARE.
@@ -0,0 +1,17 @@
1
+ import * as React$1 from "react";
2
+ //#region src/components/registry/dashboard-01/section-cards.d.ts
3
+ export interface SectionCard {
4
+ /** Muted label above the value. */
5
+ label: string;
6
+ value: React$1.ReactNode;
7
+ /** Outline badge, top right; usually a <Delta />. */
8
+ badge?: React$1.ReactNode;
9
+ /** Bold first footer line. */
10
+ headline?: React$1.ReactNode;
11
+ /** Muted second footer line. */
12
+ detail?: React$1.ReactNode;
13
+ }
14
+ export declare function SectionCards({ items }: {
15
+ items: SectionCard[];
16
+ }): React$1.JSX.Element;
17
+ //#endregion
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { Badge } from "../../ui/badge.js";
3
+ import { Card, CardAction, CardDescription, CardFooter, CardHeader, CardTitle } from "../../ui/card.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/registry/dashboard-01/section-cards.tsx
7
+ function SectionCards({ items }) {
8
+ return /* @__PURE__ */ jsx("div", {
9
+ className: "@container/main",
10
+ children: /* @__PURE__ */ jsx("div", {
11
+ className: "grid grid-cols-1 gap-4 *:data-[slot=card]:bg-linear-to-t *:data-[slot=card]:from-primary/5 *:data-[slot=card]:to-card *:data-[slot=card]:shadow-xs @xl/main:grid-cols-2 @5xl/main:grid-cols-4 dark:*:data-[slot=card]:bg-card",
12
+ children: items.map((item) => /* @__PURE__ */ jsxs(Card, {
13
+ className: "@container/card",
14
+ children: [/* @__PURE__ */ jsxs(CardHeader, { children: [
15
+ /* @__PURE__ */ jsx(CardDescription, { children: item.label }),
16
+ /* @__PURE__ */ jsx(CardTitle, {
17
+ className: "text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",
18
+ children: item.value
19
+ }),
20
+ item.badge && /* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx(Badge, {
21
+ variant: "outline",
22
+ children: item.badge
23
+ }) })
24
+ ] }), (item.headline || item.detail) && /* @__PURE__ */ jsxs(CardFooter, {
25
+ className: "flex-col items-start gap-1.5 text-sm",
26
+ children: [item.headline && /* @__PURE__ */ jsx("div", {
27
+ className: "line-clamp-1 flex gap-2 font-medium",
28
+ children: item.headline
29
+ }), item.detail && /* @__PURE__ */ jsx("div", {
30
+ className: "text-muted-foreground",
31
+ children: item.detail
32
+ })]
33
+ })]
34
+ }, item.label))
35
+ })
36
+ });
37
+ }
38
+ //#endregion
39
+ export { SectionCards };
@@ -0,0 +1,24 @@
1
+ import * as React$1 from "react";
2
+ //#region src/components/registry/dashboardcn/bar-list.d.ts
3
+ export interface BarListItem {
4
+ name: string;
5
+ value: number;
6
+ /** Renders the label as a link. */
7
+ href?: string;
8
+ icon?: React$1.ReactNode;
9
+ /** Stable key when names can repeat. */
10
+ key?: string;
11
+ }
12
+ export interface BarListProps extends React$1.ComponentProps<"div"> {
13
+ data: BarListItem[];
14
+ valueFormatter?: (value: number) => string;
15
+ sortOrder?: "descending" | "ascending" | "none";
16
+ /** Any CSS color. Defaults to chart-1. */
17
+ color?: string;
18
+ /** Show each row's share of the total next to its value. */
19
+ showPercentage?: boolean;
20
+ onItemClick?: (item: BarListItem) => void;
21
+ }
22
+ declare function BarList({ data, valueFormatter, sortOrder, color, showPercentage, onItemClick, className, ...props }: BarListProps): React$1.JSX.Element;
23
+ //#endregion
24
+ export { BarList };
@@ -0,0 +1,71 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { useLocale } from "../../siyahi/siyahi-provider.js";
3
+ import { pct } from "../../../lib/format.js";
4
+ import * as React$1 from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/registry/dashboardcn/bar-list.tsx
7
+ function BarList({ data, valueFormatter, sortOrder = "descending", color = "var(--chart-1)", showPercentage = false, onItemClick, className, ...props }) {
8
+ const locale = useLocale();
9
+ const format = valueFormatter ?? ((value) => new Intl.NumberFormat(locale.numberLocale, {
10
+ notation: "compact",
11
+ maximumFractionDigits: 1
12
+ }).format(value));
13
+ const items = React$1.useMemo(() => {
14
+ if (sortOrder === "none") return data;
15
+ const sorted = [...data].sort((a, b) => a.value - b.value);
16
+ return sortOrder === "descending" ? sorted.reverse() : sorted;
17
+ }, [data, sortOrder]);
18
+ const max = Math.max(...items.map((item) => item.value), 0);
19
+ const total = items.reduce((sum, item) => sum + item.value, 0);
20
+ return /* @__PURE__ */ jsx("div", {
21
+ "data-slot": "bar-list",
22
+ className: cn("flex flex-col gap-1.5", className),
23
+ ...props,
24
+ children: items.map((item) => {
25
+ const width = max > 0 ? item.value / max * 100 : 0;
26
+ const share = total > 0 ? item.value / total : 0;
27
+ const interactive = Boolean(item.href || onItemClick);
28
+ const Label = item.href ? "a" : onItemClick ? "button" : "div";
29
+ return /* @__PURE__ */ jsxs("div", {
30
+ "data-slot": "bar-list-row",
31
+ className: "flex items-center gap-3 text-sm",
32
+ children: [/* @__PURE__ */ jsxs("div", {
33
+ className: "relative flex h-8 min-w-0 flex-1 items-center",
34
+ children: [/* @__PURE__ */ jsx("div", {
35
+ "aria-hidden": "true",
36
+ className: "absolute inset-y-0 left-0 rounded-md transition-[width] duration-300",
37
+ style: {
38
+ width: `${width}%`,
39
+ backgroundColor: `color-mix(in oklab, ${color} 20%, transparent)`
40
+ }
41
+ }), /* @__PURE__ */ jsxs(Label, {
42
+ ...item.href ? { href: item.href } : {},
43
+ ...onItemClick && !item.href ? {
44
+ type: "button",
45
+ onClick: () => onItemClick(item)
46
+ } : {},
47
+ className: cn("relative flex min-w-0 items-center gap-2 px-2 text-left", interactive && "hover:underline"),
48
+ children: [item.icon ? /* @__PURE__ */ jsx("span", {
49
+ className: "text-muted-foreground shrink-0 [&>svg]:size-4",
50
+ children: item.icon
51
+ }) : null, /* @__PURE__ */ jsx("span", {
52
+ className: "truncate",
53
+ children: item.name
54
+ })]
55
+ })]
56
+ }), /* @__PURE__ */ jsxs("div", {
57
+ className: "flex shrink-0 items-center gap-2 tabular-nums",
58
+ children: [/* @__PURE__ */ jsx("span", {
59
+ className: "font-medium",
60
+ children: format(item.value)
61
+ }), showPercentage ? /* @__PURE__ */ jsx("span", {
62
+ className: "text-muted-foreground w-12 text-right text-xs",
63
+ children: pct(share, locale, 0)
64
+ }) : null]
65
+ })]
66
+ }, item.key ?? item.name);
67
+ })
68
+ });
69
+ }
70
+ //#endregion
71
+ export { BarList };
@@ -0,0 +1,134 @@
1
+ import { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
+ import { Day, Locale } from "date-fns";
3
+ //#region src/components/registry/heatmap/calendar-heatmap.d.ts
4
+ export type Activity = {
5
+ date: string;
6
+ value: number;
7
+ };
8
+ type ActivityWithLevel = Activity & {
9
+ level: number;
10
+ };
11
+ export type Labels = {
12
+ months?: string[];
13
+ weekdays?: string[];
14
+ stat?: string;
15
+ cellLabel?: string;
16
+ heatmapLabel?: string;
17
+ legendLabel?: string;
18
+ legendLevelLabel?: string;
19
+ };
20
+ export type ColorConfig = {
21
+ empty?: string;
22
+ scale?: string;
23
+ };
24
+ export type CalendarHeatmapProps = HTMLAttributes<HTMLDivElement> & {
25
+ data: Activity[];
26
+ weekStart?: Day;
27
+ continuousMonths?: boolean;
28
+ hasEmptyColumn?: boolean;
29
+ blockSize?: number;
30
+ blockMargin?: number;
31
+ blockRadius?: number;
32
+ blockAspectRatio?: number;
33
+ levels?: number;
34
+ isNormalized?: boolean;
35
+ colors?: ColorConfig;
36
+ locale?: Locale;
37
+ labels?: Labels;
38
+ fontSize?: number;
39
+ emptyState?: ReactNode;
40
+ totalCount?: number;
41
+ style?: CSSProperties;
42
+ className?: string;
43
+ children: ReactNode;
44
+ };
45
+ /**
46
+ * Calendar Heatmap
47
+ *
48
+ * A GitHub-style contribution calendar showing daily activity over months and years.
49
+ * Each cell represents one day, arranged in weeks (rows) and months (columns).
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <CalendarHeatmap data={data} weekStart={1} continuousMonths>
54
+ * <CalendarHeatmapBody>
55
+ * {({ activity, dayIndex, weekIndex }) => (
56
+ * <CalendarHeatmapBlock
57
+ * activity={activity}
58
+ * dayIndex={dayIndex}
59
+ * weekIndex={weekIndex}
60
+ * />
61
+ * )}
62
+ * </CalendarHeatmapBody>
63
+ * <CalendarHeatmapFooter>
64
+ * <CalendarHeatmapStat />
65
+ * <CalendarHeatmapLegend />
66
+ * </CalendarHeatmapFooter>
67
+ * </CalendarHeatmap>
68
+ * ```
69
+ *
70
+ * @param data - Array of activities with date (YYYY-MM-DD) and value
71
+ * @param weekStart - First day of week (0=Sunday, 1=Monday). Default: 0
72
+ * @param continuousMonths - Display months continuously vs. grouped by year. Default: true
73
+ * @param hasEmptyColumn - Add empty column between months. Default: false
74
+ * @param blockAspectRatio - Width/height ratio of blocks. Default: 1
75
+ * @param levels - Total number of legend cells (including empty when not normalized). Default: 5
76
+ * @param isNormalized - When true, uses min-max normalization across the dataset (suitable for signed values). When false (default), treats 0 as empty and scales from 0 to max.
77
+ */
78
+ export declare const CalendarHeatmap: ({ data, weekStart, continuousMonths, hasEmptyColumn, blockSize, blockMargin, blockRadius, blockAspectRatio, levels: levelsProp, isNormalized, colors, locale, labels: labelsProp, fontSize, emptyState, totalCount: totalCountProp, style, className, children, ...props }: CalendarHeatmapProps) => string | number | bigint | true | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null;
79
+ export type CalendarHeatmapBlockProps = HTMLAttributes<SVGRectElement> & {
80
+ activity: ActivityWithLevel;
81
+ dayIndex: number;
82
+ weekIndex: number;
83
+ highlighted?: boolean;
84
+ onCellClick?: (activity: ActivityWithLevel) => void;
85
+ onCellHover?: (activity: ActivityWithLevel | null) => void;
86
+ };
87
+ export declare function CalendarHeatmapBlock({ ref, activity, dayIndex, weekIndex, highlighted, onCellClick, onCellHover, onClick, onKeyDown, onMouseEnter, onMouseLeave, className, style: styleProp, ...props }: CalendarHeatmapBlockProps & {
88
+ ref?: React.RefObject<SVGRectElement | null>;
89
+ }): import("react").JSX.Element;
90
+ export declare namespace CalendarHeatmapBlock {
91
+ var displayName: string;
92
+ }
93
+ export type CalendarHeatmapBodyProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
94
+ hideMonthLabels?: boolean;
95
+ hideWeekdayLabels?: boolean;
96
+ hideYearLabels?: boolean;
97
+ className?: string;
98
+ labelClassName?: string;
99
+ yearClassName?: string;
100
+ children: (props: {
101
+ activity: ActivityWithLevel;
102
+ dayIndex: number;
103
+ weekIndex: number;
104
+ }) => ReactNode;
105
+ renderYearFooter?: (props: {
106
+ year: number;
107
+ totalCount: number;
108
+ }) => ReactNode;
109
+ };
110
+ export declare const CalendarHeatmapBody: ({ hideMonthLabels, hideWeekdayLabels, hideYearLabels, className, labelClassName, yearClassName, children, renderYearFooter, ...props }: CalendarHeatmapBodyProps) => import("react").JSX.Element;
111
+ export type CalendarHeatmapFooterProps = HTMLAttributes<HTMLDivElement>;
112
+ export declare const CalendarHeatmapFooter: ({ className, ...props }: CalendarHeatmapFooterProps) => import("react").JSX.Element;
113
+ export type CalendarHeatmapStatProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
114
+ compute?: (data: ActivityWithLevel[]) => number | string;
115
+ label?: string;
116
+ children?: (result: {
117
+ value: number | string;
118
+ data: ActivityWithLevel[];
119
+ year: number;
120
+ }) => ReactNode;
121
+ };
122
+ export declare const CalendarHeatmapStat: ({ compute, label, className, children, ...props }: CalendarHeatmapStatProps) => import("react").JSX.Element;
123
+ export type CalendarHeatmapLegendProps = Omit<HTMLAttributes<HTMLFieldSetElement>, "children"> & {
124
+ labels?: {
125
+ less?: string;
126
+ more?: string;
127
+ };
128
+ children?: (props: {
129
+ level: number;
130
+ }) => ReactNode;
131
+ };
132
+ export declare const CalendarHeatmapLegend: ({ labels: labelsProp, className, children, ...props }: CalendarHeatmapLegendProps) => import("react").JSX.Element;
133
+ //#endregion
134
+ export {};