@sybilion/uilib 1.3.92 → 1.3.95

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 (239) hide show
  1. package/assets/globals.css +98 -0
  2. package/dist/esm/components/ui/Badge/Badge.styl.js +1 -1
  3. package/dist/esm/components/ui/BarChart/BarChart.js +32 -0
  4. package/dist/esm/components/ui/BarChart/BarChart.styl.js +7 -0
  5. package/dist/esm/components/ui/Button/Button.js +1 -1
  6. package/dist/esm/components/ui/Button/Button.styl.js +1 -1
  7. package/dist/esm/components/ui/Card/Card.styl.js +1 -1
  8. package/dist/esm/components/ui/Chart/Chart.helpers.js +15 -3
  9. package/dist/esm/components/ui/Chart/chartSeriesPalette.js +17 -0
  10. package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.js +2 -2
  11. package/dist/esm/components/ui/Checkbox/Checkbox.styl.js +1 -1
  12. package/dist/esm/components/ui/Chip/Chip.js +12 -0
  13. package/dist/esm/components/ui/Chip/Chip.styl.js +7 -0
  14. package/dist/esm/components/ui/DonutChart/DonutChart.js +35 -0
  15. package/dist/esm/components/ui/DonutChart/DonutChart.styl.js +7 -0
  16. package/dist/esm/components/ui/Input/Input.styl.js +1 -1
  17. package/dist/esm/components/ui/Kicker/Kicker.js +9 -0
  18. package/dist/esm/components/ui/Kicker/Kicker.styl.js +7 -0
  19. package/dist/esm/components/ui/LabeledInput/LabeledInput.styl.js +1 -1
  20. package/dist/esm/components/ui/Page/PageTabs/PageTabs.js +2 -2
  21. package/dist/esm/components/ui/Page/PageXScroll/PageXScroll.js +5 -5
  22. package/dist/esm/components/ui/PullQuote/PullQuote.js +9 -0
  23. package/dist/esm/components/ui/PullQuote/PullQuote.styl.js +7 -0
  24. package/dist/esm/components/ui/Select/Select.styl.js +1 -1
  25. package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +1 -1
  26. package/dist/esm/components/ui/SignalCard/SignalCard.js +17 -0
  27. package/dist/esm/components/ui/SignalCard/SignalCard.styl.js +7 -0
  28. package/dist/esm/components/ui/Switch/Switch.styl.js +1 -1
  29. package/dist/esm/components/ui/Table/Table.js +4 -4
  30. package/dist/esm/components/ui/Table/Table.styl.js +2 -2
  31. package/dist/esm/components/ui/Tooltip/Tooltip.styl.js +1 -1
  32. package/dist/esm/index.js +6 -0
  33. package/dist/esm/types/src/components/ui/BarChart/BarChart.d.ts +3 -0
  34. package/dist/esm/types/src/components/ui/BarChart/BarChart.types.d.ts +28 -0
  35. package/dist/esm/types/src/components/ui/BarChart/index.d.ts +2 -0
  36. package/dist/esm/types/src/components/ui/Chart/chartSeriesPalette.d.ts +6 -0
  37. package/dist/esm/types/src/components/ui/Chip/Chip.d.ts +3 -0
  38. package/dist/esm/types/src/components/ui/Chip/Chip.types.d.ts +13 -0
  39. package/dist/esm/types/src/components/ui/Chip/index.d.ts +2 -0
  40. package/dist/esm/types/src/components/ui/DonutChart/DonutChart.d.ts +3 -0
  41. package/dist/esm/types/src/components/ui/DonutChart/DonutChart.types.d.ts +25 -0
  42. package/dist/esm/types/src/components/ui/DonutChart/index.d.ts +2 -0
  43. package/dist/esm/types/src/components/ui/Kicker/Kicker.d.ts +3 -0
  44. package/dist/esm/types/src/components/ui/Kicker/Kicker.types.d.ts +5 -0
  45. package/dist/esm/types/src/components/ui/Kicker/index.d.ts +2 -0
  46. package/dist/esm/types/src/components/ui/Page/PageTabs/PageTabs.d.ts +3 -1
  47. package/dist/esm/types/src/components/ui/Page/PageXScroll/PageXScroll.d.ts +8 -3
  48. package/dist/esm/types/src/components/ui/PullQuote/PullQuote.d.ts +3 -0
  49. package/dist/esm/types/src/components/ui/PullQuote/PullQuote.types.d.ts +7 -0
  50. package/dist/esm/types/src/components/ui/PullQuote/index.d.ts +2 -0
  51. package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +1 -1
  52. package/dist/esm/types/src/components/ui/SignalCard/SignalCard.d.ts +3 -0
  53. package/dist/esm/types/src/components/ui/SignalCard/SignalCard.types.d.ts +23 -0
  54. package/dist/esm/types/src/components/ui/SignalCard/index.d.ts +2 -0
  55. package/dist/esm/types/src/components/ui/Table/Table.d.ts +2 -5
  56. package/dist/esm/types/src/components/ui/Table/Table.types.d.ts +4 -1
  57. package/dist/esm/types/src/components/ui/Table/index.d.ts +1 -1
  58. package/dist/esm/types/src/docs/components/DocsGuidance/DocsGuidance.d.ts +14 -0
  59. package/dist/esm/types/src/docs/pages/BarChartPage.d.ts +1 -0
  60. package/dist/esm/types/src/docs/pages/ChipPage.d.ts +1 -0
  61. package/dist/esm/types/src/docs/pages/ColorsPage.d.ts +1 -0
  62. package/dist/esm/types/src/docs/pages/DonutChartPage.d.ts +1 -0
  63. package/dist/esm/types/src/docs/pages/IconsPage.d.ts +1 -0
  64. package/dist/esm/types/src/docs/pages/KickerPage.d.ts +1 -0
  65. package/dist/esm/types/src/docs/pages/MotionPage.d.ts +1 -0
  66. package/dist/esm/types/src/docs/pages/PullQuotePage.d.ts +1 -0
  67. package/dist/esm/types/src/docs/pages/RadiiShadowsPage.d.ts +1 -0
  68. package/dist/esm/types/src/docs/pages/SignalCardPage.d.ts +1 -0
  69. package/dist/esm/types/src/docs/pages/SpacingPage.d.ts +1 -0
  70. package/dist/esm/types/src/docs/pages/TypographyPage.d.ts +1 -0
  71. package/dist/esm/types/src/docs/registry.d.ts +1 -1
  72. package/dist/esm/types/src/index.d.ts +6 -0
  73. package/dist/esm/types/tests/charts.test.d.ts +1 -0
  74. package/dist/esm/types/tests/chip.test.d.ts +1 -0
  75. package/dist/esm/types/tests/componentsSmoke.test.d.ts +1 -0
  76. package/dist/esm/types/tests/docsRegistry.test.d.ts +1 -0
  77. package/dist/esm/types/tests/iconsPageFilter.test.d.ts +1 -0
  78. package/dist/esm/types/tests/mocks/homecodeUiMock.d.ts +32 -1
  79. package/dist/esm/types/tests/mocks/lightweightChartsMock.d.ts +29 -0
  80. package/dist/esm/types/tests/pullQuoteKicker.test.d.ts +1 -0
  81. package/dist/esm/types/tests/signalCard.test.d.ts +1 -0
  82. package/dist/esm/types/tests/tokenSync.test.d.ts +1 -0
  83. package/package.json +1 -1
  84. package/src/components/ui/Badge/Badge.styl +4 -4
  85. package/src/components/ui/BarChart/BarChart.styl +2 -0
  86. package/src/components/ui/BarChart/BarChart.styl.d.ts +7 -0
  87. package/src/components/ui/BarChart/BarChart.tsx +142 -0
  88. package/src/components/ui/BarChart/BarChart.types.ts +36 -0
  89. package/src/components/ui/BarChart/index.ts +2 -0
  90. package/src/components/ui/Button/Button.styl +30 -28
  91. package/src/components/ui/Button/Button.tsx +2 -1
  92. package/src/components/ui/Card/Card.styl +4 -3
  93. package/src/components/ui/Chart/Chart.helpers.ts +17 -3
  94. package/src/components/ui/Chart/chartSeriesPalette.ts +16 -0
  95. package/src/components/ui/Chat/ChatSheet/ChatSelector.tsx +2 -2
  96. package/src/components/ui/Checkbox/Checkbox.styl +1 -1
  97. package/src/components/ui/Chip/Chip.styl +78 -0
  98. package/src/components/ui/Chip/Chip.styl.d.ts +16 -0
  99. package/src/components/ui/Chip/Chip.tsx +35 -0
  100. package/src/components/ui/Chip/Chip.types.ts +23 -0
  101. package/src/components/ui/Chip/index.ts +2 -0
  102. package/src/components/ui/DonutChart/DonutChart.styl +16 -0
  103. package/src/components/ui/DonutChart/DonutChart.styl.d.ts +10 -0
  104. package/src/components/ui/DonutChart/DonutChart.tsx +112 -0
  105. package/src/components/ui/DonutChart/DonutChart.types.ts +30 -0
  106. package/src/components/ui/DonutChart/index.ts +2 -0
  107. package/src/components/ui/Input/Input.styl +2 -2
  108. package/src/components/ui/Kicker/Kicker.styl +10 -0
  109. package/src/components/ui/Kicker/Kicker.styl.d.ts +7 -0
  110. package/src/components/ui/Kicker/Kicker.tsx +15 -0
  111. package/src/components/ui/Kicker/Kicker.types.ts +6 -0
  112. package/src/components/ui/Kicker/index.ts +2 -0
  113. package/src/components/ui/LabeledInput/LabeledInput.styl +4 -1
  114. package/src/components/ui/Page/PageTabs/PageTabs.tsx +8 -2
  115. package/src/components/ui/Page/PageXScroll/PageXScroll.tsx +12 -6
  116. package/src/components/ui/PullQuote/PullQuote.styl +32 -0
  117. package/src/components/ui/PullQuote/PullQuote.styl.d.ts +10 -0
  118. package/src/components/ui/PullQuote/PullQuote.tsx +31 -0
  119. package/src/components/ui/PullQuote/PullQuote.types.ts +8 -0
  120. package/src/components/ui/PullQuote/index.ts +2 -0
  121. package/src/components/ui/Select/Select.styl +21 -14
  122. package/src/components/ui/Select/Select.types.ts +1 -1
  123. package/src/components/ui/Sidebar/Sidebar.styl +1 -0
  124. package/src/components/ui/SignalCard/SignalCard.styl +104 -0
  125. package/src/components/ui/SignalCard/SignalCard.styl.d.ts +20 -0
  126. package/src/components/ui/SignalCard/SignalCard.tsx +87 -0
  127. package/src/components/ui/SignalCard/SignalCard.types.ts +24 -0
  128. package/src/components/ui/SignalCard/index.ts +2 -0
  129. package/src/components/ui/Switch/Switch.styl +7 -7
  130. package/src/components/ui/Table/Table.styl +26 -8
  131. package/src/components/ui/Table/Table.styl.d.ts +0 -1
  132. package/src/components/ui/Table/Table.tsx +5 -3
  133. package/src/components/ui/Table/Table.types.ts +8 -4
  134. package/src/components/ui/Table/index.ts +1 -1
  135. package/src/components/ui/Tooltip/Tooltip.styl +2 -2
  136. package/src/contexts/chatPersistence.test.ts +13 -2
  137. package/src/docs/components/DocsGuidance/DocsGuidance.styl +33 -0
  138. package/src/docs/components/DocsGuidance/DocsGuidance.styl.d.ts +11 -0
  139. package/src/docs/components/DocsGuidance/DocsGuidance.tsx +57 -0
  140. package/src/docs/pages/AnalysesSelectorPage.tsx +16 -0
  141. package/src/docs/pages/AnalysisLineIconPage.tsx +12 -0
  142. package/src/docs/pages/AvatarPage.tsx +15 -0
  143. package/src/docs/pages/BadgePage.tsx +16 -0
  144. package/src/docs/pages/BarChartPage.tsx +109 -0
  145. package/src/docs/pages/BreadcrumbPage.tsx +15 -0
  146. package/src/docs/pages/ButtonPage.tsx +17 -0
  147. package/src/docs/pages/CardPage.tsx +190 -17
  148. package/src/docs/pages/ChartAreaInteractivePage.tsx +24 -7
  149. package/src/docs/pages/ChartPage.tsx +14 -0
  150. package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +15 -0
  151. package/src/docs/pages/ChatComposerPrefillPage.tsx +15 -0
  152. package/src/docs/pages/ChatPage.tsx +15 -0
  153. package/src/docs/pages/ChatSheetPage.tsx +14 -0
  154. package/src/docs/pages/ChatSlashCommandsPage.tsx +15 -0
  155. package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +14 -0
  156. package/src/docs/pages/CheckboxPage.tsx +37 -4
  157. package/src/docs/pages/ChipPage.tsx +160 -0
  158. package/src/docs/pages/ColorsPage.styl +27 -0
  159. package/src/docs/pages/ColorsPage.styl.d.ts +12 -0
  160. package/src/docs/pages/ColorsPage.tsx +102 -0
  161. package/src/docs/pages/ConfirmPage.tsx +15 -0
  162. package/src/docs/pages/DialogPage.tsx +15 -0
  163. package/src/docs/pages/DonutChartPage.tsx +80 -0
  164. package/src/docs/pages/DrawerPage.tsx +17 -0
  165. package/src/docs/pages/DriverMapPage.tsx +17 -0
  166. package/src/docs/pages/DriversComparisonChartPage.tsx +17 -0
  167. package/src/docs/pages/DropZonePage.tsx +16 -0
  168. package/src/docs/pages/DropdownMenuPage.tsx +16 -0
  169. package/src/docs/pages/FileChipPage.tsx +17 -0
  170. package/src/docs/pages/FlickeringGridPage.tsx +15 -0
  171. package/src/docs/pages/FoldablePage.tsx +16 -0
  172. package/src/docs/pages/GridLayoutPage.tsx +16 -0
  173. package/src/docs/pages/IconsPage.styl +74 -0
  174. package/src/docs/pages/IconsPage.styl.d.ts +17 -0
  175. package/src/docs/pages/IconsPage.tsx +125 -0
  176. package/src/docs/pages/ImagePage.tsx +16 -0
  177. package/src/docs/pages/ImageWithFallbackPage.tsx +15 -0
  178. package/src/docs/pages/IncludeHiddenInYScalePage.tsx +14 -0
  179. package/src/docs/pages/InputPage.tsx +134 -19
  180. package/src/docs/pages/InteractiveContentPage.tsx +15 -0
  181. package/src/docs/pages/KickerPage.tsx +62 -0
  182. package/src/docs/pages/LabelPage.tsx +15 -0
  183. package/src/docs/pages/LabelWithIdPage.tsx +11 -0
  184. package/src/docs/pages/LabeledInputPage.tsx +12 -0
  185. package/src/docs/pages/LegacyPlatformLinkPage.tsx +15 -0
  186. package/src/docs/pages/LightweightChartPage.styl +0 -1
  187. package/src/docs/pages/LightweightChartPage.tsx +17 -0
  188. package/src/docs/pages/LogoPage.tsx +15 -0
  189. package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +15 -0
  190. package/src/docs/pages/MotionPage.styl +71 -0
  191. package/src/docs/pages/MotionPage.styl.d.ts +17 -0
  192. package/src/docs/pages/MotionPage.tsx +176 -0
  193. package/src/docs/pages/NavUserHeaderPage.tsx +15 -0
  194. package/src/docs/pages/NumberControlPage.tsx +15 -0
  195. package/src/docs/pages/PageColumnsPage.tsx +15 -0
  196. package/src/docs/pages/PageFooterPage.tsx +15 -0
  197. package/src/docs/pages/PagePage.tsx +15 -0
  198. package/src/docs/pages/PageTabsPage.tsx +18 -0
  199. package/src/docs/pages/PerformanceChartPage.tsx +15 -0
  200. package/src/docs/pages/ProgressPage.tsx +66 -3
  201. package/src/docs/pages/PullQuotePage.tsx +59 -0
  202. package/src/docs/pages/RadiiShadowsPage.styl +47 -0
  203. package/src/docs/pages/RadiiShadowsPage.styl.d.ts +14 -0
  204. package/src/docs/pages/RadiiShadowsPage.tsx +109 -0
  205. package/src/docs/pages/RegionCoordsPage.tsx +12 -0
  206. package/src/docs/pages/RenamerPage.tsx +15 -0
  207. package/src/docs/pages/SelectPage.tsx +160 -6
  208. package/src/docs/pages/SeparatorPage.tsx +12 -0
  209. package/src/docs/pages/SheetPage.tsx +15 -0
  210. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +12 -0
  211. package/src/docs/pages/SidebarPage.tsx +15 -0
  212. package/src/docs/pages/SignalCardPage.tsx +126 -0
  213. package/src/docs/pages/SkeletonPage.tsx +16 -0
  214. package/src/docs/pages/SliderPage.tsx +70 -4
  215. package/src/docs/pages/SmartTextTruncatePage.styl +13 -0
  216. package/src/docs/pages/SmartTextTruncatePage.styl.d.ts +8 -0
  217. package/src/docs/pages/SmartTextTruncatePage.tsx +17 -4
  218. package/src/docs/pages/SpacingPage.styl +31 -0
  219. package/src/docs/pages/SpacingPage.styl.d.ts +12 -0
  220. package/src/docs/pages/SpacingPage.tsx +50 -0
  221. package/src/docs/pages/SparklinePage.tsx +15 -0
  222. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +16 -0
  223. package/src/docs/pages/SwitchPage.tsx +147 -8
  224. package/src/docs/pages/SybilionAuthLayoutPage.tsx +15 -0
  225. package/src/docs/pages/TablePage.tsx +132 -20
  226. package/src/docs/pages/TabsPage.tsx +20 -0
  227. package/src/docs/pages/TextShimmerPage.tsx +12 -0
  228. package/src/docs/pages/TextWithDeferTooltipPage.tsx +15 -0
  229. package/src/docs/pages/TimeRangeControlsPage.tsx +15 -0
  230. package/src/docs/pages/ToggleGroupPage.tsx +15 -0
  231. package/src/docs/pages/TogglePage.tsx +13 -0
  232. package/src/docs/pages/TooltipPage.tsx +17 -0
  233. package/src/docs/pages/TypographyPage.styl +42 -0
  234. package/src/docs/pages/TypographyPage.styl.d.ts +12 -0
  235. package/src/docs/pages/TypographyPage.tsx +226 -0
  236. package/src/docs/pages/VimeoEmbedPage.tsx +12 -0
  237. package/src/docs/pages/WorldMapPage.tsx +12 -0
  238. package/src/docs/registry.ts +79 -0
  239. package/src/index.ts +6 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -1,6 +1,37 @@
1
+ import { type ReactNode } from 'react';
2
+ /** Minimal stand-in for @homecode/ui Theme root: renders children only. */
3
+ declare function Theme({ children }: {
4
+ children?: ReactNode;
5
+ }): import("react").FunctionComponentElement<import("react").FragmentProps>;
6
+ /** Minimal stand-in for @homecode/ui Shimmer placeholder. */
7
+ declare function Shimmer({ className }: {
8
+ className?: string;
9
+ }): import("react").DetailedReactHTMLElement<{
10
+ className: string;
11
+ }, HTMLElement>;
12
+ declare const ThemeDefaults: {
13
+ colors: {
14
+ dark: string;
15
+ light: string;
16
+ };
17
+ getColors(overrides?: Record<string, unknown>): Record<string, unknown>;
18
+ getConfig(): Record<string, unknown>;
19
+ };
20
+ declare const ThemeHelpers: {
21
+ colorsConfigToVars(_config: Record<string, unknown>): Record<string, string>;
22
+ };
23
+ /** Minimal stand-in for @homecode/ui Scroll: a plain div wrapper. */
24
+ declare function Scroll({ children, className, onInnerRef, }: {
25
+ children?: ReactNode;
26
+ className?: string;
27
+ onInnerRef?: (el: HTMLDivElement | null) => void;
28
+ }): import("react").DetailedReactHTMLElement<{
29
+ className: string;
30
+ ref: (el: HTMLDivElement | null) => void;
31
+ }, HTMLDivElement>;
1
32
  declare const LS: {
2
33
  get(key: string): any;
3
34
  set(key: string, val: unknown): void;
4
35
  remove(key: string): void;
5
36
  };
6
- export { LS };
37
+ export { LS, Scroll, Shimmer, Theme, ThemeDefaults, ThemeHelpers };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Stub for the ESM-only `lightweight-charts` package, which jest's CJS
3
+ * resolver cannot load. Provides the runtime values uilib imports; tests
4
+ * import these modules but never mount a lightweight chart.
5
+ */
6
+ export declare const ColorType: {
7
+ Solid: string;
8
+ VerticalGradient: string;
9
+ };
10
+ export declare const LineStyle: {
11
+ Solid: number;
12
+ Dotted: number;
13
+ Dashed: number;
14
+ LargeDashed: number;
15
+ SparseDotted: number;
16
+ };
17
+ export declare const LineType: {
18
+ Simple: number;
19
+ WithSteps: number;
20
+ Curved: number;
21
+ };
22
+ export declare const LineSeries: {
23
+ type: string;
24
+ };
25
+ export declare const customSeriesDefaultOptions: {
26
+ lastValueVisible: boolean;
27
+ priceLineVisible: boolean;
28
+ };
29
+ export declare function createChart(): never;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.3.92",
3
+ "version": "1.3.95",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -5,11 +5,11 @@
5
5
  width fit-content
6
6
  flex-shrink 0
7
7
  white-space nowrap
8
- gap 0.375rem
9
- padding 2px var(--p-2)
10
- border-radius 0.75rem
8
+ gap var(--spacing-xs)
9
+ padding 5px 10px
10
+ border-radius var(--radius-pill)
11
11
  border-color transparent
12
- font-size 0.75rem
12
+ font-size 11px
13
13
  line-height 1rem
14
14
  font-family var(--font-family-body)
15
15
  font-weight 400
@@ -0,0 +1,2 @@
1
+ .root
2
+ width 100%
@@ -0,0 +1,7 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'root': string;
5
+ }
6
+ export const cssExports: CssExports;
7
+ export default cssExports;
@@ -0,0 +1,142 @@
1
+ import cn from 'classnames';
2
+ import { forwardRef, useMemo } from 'react';
3
+
4
+ import type { ChartConfig } from '#uilib/components/ui/Chart';
5
+ import {
6
+ ChartContainer,
7
+ ChartLegend,
8
+ ChartLegendContent,
9
+ ChartTooltip,
10
+ ChartTooltipContent,
11
+ } from '#uilib/components/ui/Chart';
12
+ import { getChartSeriesColor } from '#uilib/components/ui/Chart/chartSeriesPalette';
13
+ import {
14
+ Bar,
15
+ CartesianGrid,
16
+ BarChart as RechartsBarChart,
17
+ XAxis,
18
+ YAxis,
19
+ } from 'recharts';
20
+
21
+ import S from './BarChart.styl';
22
+ import { BarChartProps, BarChartSeries } from './BarChart.types';
23
+
24
+ const STACK_ID = 'stack';
25
+
26
+ function buildChartConfig(series: BarChartSeries[]): ChartConfig {
27
+ const config: ChartConfig = {};
28
+
29
+ series.forEach((item, index) => {
30
+ config[item.key] = {
31
+ label: item.label ?? item.key,
32
+ color: item.color ?? getChartSeriesColor(index),
33
+ };
34
+ });
35
+
36
+ return config;
37
+ }
38
+
39
+ const BarChart = forwardRef<HTMLDivElement, BarChartProps>(
40
+ (
41
+ {
42
+ className,
43
+ data,
44
+ categoryKey,
45
+ series,
46
+ orientation = 'vertical',
47
+ mode = 'grouped',
48
+ showLegend = true,
49
+ showTooltip = true,
50
+ showGrid = true,
51
+ valueFormatter,
52
+ height,
53
+ ...props
54
+ },
55
+ ref,
56
+ ) => {
57
+ const config = useMemo(() => buildChartConfig(series), [series]);
58
+
59
+ const isHorizontal = orientation === 'horizontal';
60
+ const stackId = mode === 'stacked' ? STACK_ID : undefined;
61
+ const barRadius: [number, number, number, number] | number =
62
+ mode === 'stacked' ? 0 : isHorizontal ? [0, 3, 3, 0] : [3, 3, 0, 0];
63
+
64
+ return (
65
+ <div ref={ref} className={cn(S.root, className)} {...props}>
66
+ <ChartContainer
67
+ config={config}
68
+ style={height ? { height: `${height}px` } : undefined}
69
+ >
70
+ <RechartsBarChart
71
+ data={data}
72
+ layout={isHorizontal ? 'vertical' : 'horizontal'}
73
+ accessibilityLayer
74
+ >
75
+ {showGrid && (
76
+ <CartesianGrid
77
+ stroke="var(--border)"
78
+ strokeWidth={0.6}
79
+ vertical={isHorizontal}
80
+ horizontal={!isHorizontal}
81
+ />
82
+ )}
83
+ {isHorizontal ? (
84
+ <>
85
+ <XAxis
86
+ type="number"
87
+ tickLine={false}
88
+ axisLine={{ stroke: 'var(--border)', strokeWidth: 1 }}
89
+ tickFormatter={valueFormatter}
90
+ />
91
+ <YAxis
92
+ type="category"
93
+ dataKey={categoryKey}
94
+ tickLine={false}
95
+ axisLine={{ stroke: 'var(--border)', strokeWidth: 1 }}
96
+ width={80}
97
+ />
98
+ </>
99
+ ) : (
100
+ <>
101
+ <XAxis
102
+ type="category"
103
+ dataKey={categoryKey}
104
+ tickLine={false}
105
+ axisLine={{ stroke: 'var(--border)', strokeWidth: 1 }}
106
+ />
107
+ <YAxis
108
+ type="number"
109
+ tickLine={false}
110
+ axisLine={{ stroke: 'var(--border)', strokeWidth: 1 }}
111
+ width={48}
112
+ tickFormatter={valueFormatter}
113
+ />
114
+ </>
115
+ )}
116
+ {showTooltip && (
117
+ <ChartTooltip
118
+ cursor={{ fill: 'var(--muted)' }}
119
+ content={<ChartTooltipContent indicator="dot" />}
120
+ />
121
+ )}
122
+ {series.map(item => (
123
+ <Bar
124
+ key={item.key}
125
+ dataKey={item.key}
126
+ fill={`var(--color-${item.key})`}
127
+ stackId={stackId}
128
+ radius={barRadius}
129
+ maxBarSize={48}
130
+ />
131
+ ))}
132
+ {showLegend && <ChartLegend content={<ChartLegendContent />} />}
133
+ </RechartsBarChart>
134
+ </ChartContainer>
135
+ </div>
136
+ );
137
+ },
138
+ );
139
+
140
+ BarChart.displayName = 'BarChart';
141
+
142
+ export { BarChart };
@@ -0,0 +1,36 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+
3
+ export type BarChartDatum = Record<string, string | number | null | undefined>;
4
+
5
+ export interface BarChartSeries {
6
+ /** Data key of the series in each datum. */
7
+ key: string;
8
+ /** Human-readable label; falls back to the key. */
9
+ label?: ReactNode;
10
+ /** CSS colour; falls back to the built-in series palette. */
11
+ color?: string;
12
+ }
13
+
14
+ /** Direction the bars grow in: vertical bars rise up, horizontal bars extend right. */
15
+ export type BarChartOrientation = 'vertical' | 'horizontal';
16
+
17
+ export type BarChartMode = 'grouped' | 'stacked';
18
+
19
+ export interface BarChartProps extends Omit<
20
+ HTMLAttributes<HTMLDivElement>,
21
+ 'children'
22
+ > {
23
+ data: BarChartDatum[];
24
+ /** Data key holding the category label (x axis for vertical bars). */
25
+ categoryKey: string;
26
+ series: BarChartSeries[];
27
+ orientation?: BarChartOrientation;
28
+ mode?: BarChartMode;
29
+ showLegend?: boolean;
30
+ showTooltip?: boolean;
31
+ showGrid?: boolean;
32
+ /** Formats numeric axis tick values. */
33
+ valueFormatter?: (value: number) => string;
34
+ /** Fixed chart height in px; defaults to a 16:9 responsive box. */
35
+ height?: number;
36
+ }
@@ -0,0 +1,2 @@
1
+ export * from './BarChart';
2
+ export * from './BarChart.types';
@@ -3,17 +3,17 @@
3
3
  display inline-flex
4
4
  align-items center
5
5
  justify-content center
6
- gap 8px
6
+ gap 10px
7
7
  flex-shrink 0
8
8
  white-space nowrap
9
- border-radius 14px
9
+ border-radius var(--radius-button)
10
10
  font-family 'Manrope', sans-serif
11
- font-size 14px
11
+ font-size 15px
12
12
  font-weight 500
13
- line-height 20px
13
+ line-height 1
14
14
  outline none
15
15
  cursor pointer
16
- transition all 150ms
16
+ transition all var(--dur-base) var(--ease-standard)
17
17
  border 0
18
18
 
19
19
  &:disabled
@@ -99,33 +99,35 @@
99
99
 
100
100
  // Size styles
101
101
  .sizeMd
102
- min-height 48px
103
- padding 14px 16px
104
-
105
- &:has(> svg)
106
- padding-left 14px
107
- padding-right 14px
102
+ padding var(--p-3) var(--p-5)
108
103
 
109
104
  .sizeSm
110
- height 36px
111
- gap 6px
112
- padding 0 12px
113
- border-radius 14px
114
-
115
- &:has(> svg)
116
- padding-left 10px
117
- padding-right 10px
105
+ padding var(--p-2) 14px
106
+ font-size 13px
107
+ border-radius var(--radius-3)
118
108
 
119
109
  .sizeLg
120
- height 40px
121
- padding 0 24px
122
- border-radius 14px
123
-
124
- &:has(> svg)
125
- padding-left 16px
126
- padding-right 16px
110
+ padding var(--p-4) var(--p-6)
111
+ font-size var(--text-base)
112
+ border-radius var(--radius-4)
127
113
 
114
+ // Icon buttons: square, sized per size variant, same radius as the size variant
128
115
  .sizeIcon
129
- width 36px
130
- height 36px
131
116
  padding 0
117
+ width 48px
118
+ height 48px
119
+
120
+ &.sizeSm
121
+ width 36px
122
+ height 36px
123
+ padding 0
124
+
125
+ &.sizeMd
126
+ width 48px
127
+ height 48px
128
+ padding 0
129
+
130
+ &.sizeLg
131
+ width 56px
132
+ height 56px
133
+ padding 0
@@ -24,7 +24,8 @@ function Button({
24
24
  className={cn(
25
25
  S.root,
26
26
  S[variant],
27
- icon ? S.sizeIcon : sizeClass(size),
27
+ sizeClass(size),
28
+ icon && S.sizeIcon,
28
29
  className,
29
30
  )}
30
31
  {...props}
@@ -5,8 +5,9 @@
5
5
  flex-direction column
6
6
  gap var(--p-4)
7
7
  max-height 100%
8
- border-radius 20px
9
- // border 1px solid var(--border)
8
+ border-radius var(--radius-card)
9
+ border 1px solid var(--border)
10
+ box-shadow var(--shadow-1)
10
11
  background-color var(--card)
11
12
  color var(--card-foreground)
12
13
  position relative
@@ -106,4 +107,4 @@
106
107
  overflow hidden
107
108
 
108
109
  &:global(.border-t)
109
- padding-top 24px
110
+ padding-top var(--p-6)
@@ -42,15 +42,29 @@ export function normalizeTooltipPayload(
42
42
  return result.length ? result : undefined;
43
43
  }
44
44
 
45
+ function isRecord(value: unknown): value is Record<string, unknown> {
46
+ return typeof value === 'object' && value !== null;
47
+ }
48
+
45
49
  export function getPayloadConfigFromPayload(
46
50
  config: ChartConfig,
47
51
  payload: unknown,
48
52
  key: string,
49
53
  ) {
50
- if (typeof payload !== 'object' || payload === null) {
54
+ if (!isRecord(payload)) {
51
55
  return config[key];
52
56
  }
53
57
 
54
- // Simple direct lookup first
55
- return config[key] || undefined;
58
+ // When the item (or its inner datum) carries a string at `key` — e.g. a
59
+ // Pie slice with nameKey="key" — that string names the config entry.
60
+ const inner = isRecord(payload.payload) ? payload.payload : undefined;
61
+
62
+ let configLabelKey = key;
63
+ if (typeof payload[key] === 'string') {
64
+ configLabelKey = String(payload[key]);
65
+ } else if (inner && typeof inner[key] === 'string') {
66
+ configLabelKey = String(inner[key]);
67
+ }
68
+
69
+ return configLabelKey in config ? config[configLabelKey] : config[key];
56
70
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Categorical series palette for charts.
3
+ * Uses --sb-* ramp tokens so colours follow the active theme.
4
+ */
5
+ export const CHART_SERIES_PALETTE: readonly string[] = [
6
+ 'var(--sb-cyan-500)',
7
+ 'var(--sb-purple-500)',
8
+ 'var(--sb-green-600)',
9
+ 'var(--sb-yellow-500)',
10
+ 'var(--sb-red-500)',
11
+ 'var(--sb-slate-400)',
12
+ ];
13
+
14
+ export function getChartSeriesColor(index: number): string {
15
+ return CHART_SERIES_PALETTE[index % CHART_SERIES_PALETTE.length];
16
+ }
@@ -29,7 +29,7 @@ export interface ChatSelectorProps
29
29
  }
30
30
 
31
31
  const deleteIconSize = (s: NonNullable<SelectTriggerProps['size']>) =>
32
- s === 'sm' ? 16 : s === 'md' ? 18 : 20;
32
+ s === 'xs' ? 14 : s === 'sm' ? 16 : s === 'md' ? 18 : 20;
33
33
 
34
34
  export function ChatSelector({
35
35
  id,
@@ -117,7 +117,7 @@ export function ChatSelector({
117
117
  <Button
118
118
  type="button"
119
119
  variant="ghost"
120
- size={size}
120
+ size={size === 'xs' ? 'sm' : size}
121
121
  className={S.deleteBtn}
122
122
  aria-label="Delete chat"
123
123
  onClick={handleDeleteChat}
@@ -3,7 +3,7 @@
3
3
  width 16px
4
4
  height 16px
5
5
  flex-shrink 0
6
- border-radius 4px
6
+ border-radius var(--radius-2)
7
7
  border 1px solid var(--input)
8
8
  background transparent
9
9
  box-shadow 0 1px 2px 0 rgba(0, 0, 0, 0.05)
@@ -0,0 +1,78 @@
1
+ .root
2
+ display inline-flex
3
+ align-items center
4
+ width fit-content
5
+ flex-shrink 0
6
+ white-space nowrap
7
+ gap 6px
8
+ padding 5px 10px
9
+ border-radius var(--radius-pill)
10
+ font-family var(--font-family-body)
11
+ font-size 11px
12
+ line-height 1rem
13
+ font-weight 400
14
+ letter-spacing var(--tracking-body)
15
+ transition background-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard)
16
+
17
+ .dot
18
+ width 6px
19
+ height 6px
20
+ border-radius 50%
21
+ background var(--sb-cyan-400)
22
+ flex none
23
+
24
+ .arrow
25
+ width 10px
26
+ height 10px
27
+ flex none
28
+ pointer-events none
29
+
30
+ // Neutral variant — slate wash with status dot
31
+ &.variant-neutral
32
+ background var(--sb-slate-100)
33
+ color var(--sb-slate-800)
34
+
35
+ :global(.dark) &
36
+ background var(--sb-slate-800)
37
+ color var(--sb-slate-200)
38
+
39
+ // Line variant — hairline outline on surface
40
+ &.variant-line
41
+ background var(--background)
42
+ border 1px solid var(--border)
43
+ color var(--sb-slate-900)
44
+
45
+ :global(.dark) &
46
+ color var(--sb-slate-100)
47
+
48
+ // Active variant — accent outline
49
+ &.variant-active
50
+ background transparent
51
+ border 1px solid var(--sb-cyan-400)
52
+ color var(--sb-slate-900)
53
+
54
+ :global(.dark) &
55
+ color var(--sb-slate-100)
56
+
57
+ // Filled variant — inverse
58
+ &.variant-filled
59
+ background var(--sb-slate-900)
60
+ color var(--sb-slate-50)
61
+
62
+ :global(.dark) &
63
+ background var(--sb-slate-100)
64
+ color var(--sb-slate-900)
65
+
66
+ // Accent variant — cyan wash
67
+ &.variant-accent
68
+ background var(--sb-cyan-100)
69
+ color var(--sb-slate-900)
70
+
71
+ // Status variants — quantitative delta / impact only
72
+ &.variant-positive
73
+ background var(--status-positive-bg)
74
+ color var(--status-positive)
75
+
76
+ &.variant-negative
77
+ background var(--status-negative-bg)
78
+ color var(--status-negative)
@@ -0,0 +1,16 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'arrow': string;
5
+ 'dot': string;
6
+ 'root': string;
7
+ 'variant-accent': string;
8
+ 'variant-active': string;
9
+ 'variant-filled': string;
10
+ 'variant-line': string;
11
+ 'variant-negative': string;
12
+ 'variant-neutral': string;
13
+ 'variant-positive': string;
14
+ }
15
+ export const cssExports: CssExports;
16
+ export default cssExports;
@@ -0,0 +1,35 @@
1
+ import cn from 'classnames';
2
+
3
+ import { TrendingDown, TrendingUp } from 'lucide-react';
4
+
5
+ import S from './Chip.styl';
6
+ import { ChipProps } from './Chip.types';
7
+
8
+ function Chip({
9
+ className,
10
+ variant = 'neutral',
11
+ dot,
12
+ trend,
13
+ children,
14
+ ...props
15
+ }: ChipProps) {
16
+ const showDot = dot ?? variant === 'neutral';
17
+ const TrendIcon =
18
+ trend === 'up' ? TrendingUp : trend === 'down' ? TrendingDown : null;
19
+
20
+ return (
21
+ <span
22
+ data-slot="chip"
23
+ className={cn(S.root, S[`variant-${variant}`], className)}
24
+ {...props}
25
+ >
26
+ {showDot && <span className={S.dot} aria-hidden="true" />}
27
+ {TrendIcon && (
28
+ <TrendIcon className={S.arrow} strokeWidth={1.5} aria-hidden="true" />
29
+ )}
30
+ {children}
31
+ </span>
32
+ );
33
+ }
34
+
35
+ export { Chip };
@@ -0,0 +1,23 @@
1
+ import { type ComponentProps } from 'react';
2
+
3
+ export type ChipVariant =
4
+ | 'neutral'
5
+ | 'line'
6
+ | 'active'
7
+ | 'filled'
8
+ | 'accent'
9
+ | 'positive'
10
+ | 'negative';
11
+
12
+ export type ChipTrend = 'up' | 'down';
13
+
14
+ export interface ChipProps extends ComponentProps<'span'> {
15
+ variant?: ChipVariant;
16
+ /**
17
+ * Show the 6px status dot. Defaults to true for the neutral variant
18
+ * and false for all others.
19
+ */
20
+ dot?: boolean;
21
+ /** Render a Lucide trend arrow before the label. */
22
+ trend?: ChipTrend;
23
+ }
@@ -0,0 +1,2 @@
1
+ export { Chip } from './Chip';
2
+ export type { ChipProps, ChipTrend, ChipVariant } from './Chip.types';
@@ -0,0 +1,16 @@
1
+ .root
2
+ width 100%
3
+
4
+ .chart
5
+ aspect-ratio 1 / 1
6
+ max-height 320px
7
+ margin 0 auto
8
+
9
+ .centerValue
10
+ fill var(--foreground)
11
+ font-size 1.5rem
12
+ font-weight 600
13
+
14
+ .centerCaption
15
+ fill var(--muted-foreground)
16
+ font-size 0.75rem