@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,87 @@
1
+ import cn from 'classnames';
2
+
3
+ import {
4
+ Card,
5
+ CardContent,
6
+ CardFooter,
7
+ CardHeader,
8
+ } from '../Card';
9
+ import { Kicker } from '../Kicker';
10
+ import S from './SignalCard.styl';
11
+ import { SignalCardProps } from './SignalCard.types';
12
+
13
+ function SignalCard({
14
+ className,
15
+ kicker,
16
+ icon,
17
+ title,
18
+ subtitle,
19
+ value,
20
+ unit,
21
+ tolerance,
22
+ description,
23
+ delta,
24
+ meta,
25
+ sparkline,
26
+ children,
27
+ ...props
28
+ }: SignalCardProps) {
29
+ const hasHead = icon != null || title != null || subtitle != null;
30
+ const hasFooter = delta != null || (meta?.length ?? 0) > 0;
31
+ const hasContent =
32
+ value != null ||
33
+ description != null ||
34
+ sparkline != null ||
35
+ children != null;
36
+
37
+ return (
38
+ <Card
39
+ data-slot="signal-card"
40
+ paddingSize="s"
41
+ className={cn(S.root, className)}
42
+ {...props}
43
+ >
44
+ {kicker != null && <Kicker>{kicker}</Kicker>}
45
+ {hasHead && (
46
+ <CardHeader
47
+ className={S.head}
48
+ icon={icon}
49
+ iconWithBackground
50
+ title={title}
51
+ titleClassName={S.title}
52
+ description={subtitle}
53
+ descriptionClassName={S.subtitle}
54
+ textsClassName={S.headText}
55
+ />
56
+ )}
57
+ {hasContent && (
58
+ <CardContent noScroll className={S.content}>
59
+ {value != null && (
60
+ <div className={S.figure}>
61
+ <span className={S.value}>{value}</span>
62
+ {unit != null && <span className={S.unit}>{unit}</span>}
63
+ {tolerance != null && (
64
+ <span className={S.tolerance}>{tolerance}</span>
65
+ )}
66
+ </div>
67
+ )}
68
+ {description != null && <div className={S.body}>{description}</div>}
69
+ {sparkline != null && <div className={S.sparkline}>{sparkline}</div>}
70
+ {children}
71
+ </CardContent>
72
+ )}
73
+ {hasFooter && (
74
+ <CardFooter className={S.foot}>
75
+ {delta}
76
+ {meta?.map((item, index) => (
77
+ <span key={index} className={S.dim}>
78
+ {item}
79
+ </span>
80
+ ))}
81
+ </CardFooter>
82
+ )}
83
+ </Card>
84
+ );
85
+ }
86
+
87
+ export { SignalCard };
@@ -0,0 +1,24 @@
1
+ import { type ComponentProps, type ReactNode } from 'react';
2
+
3
+ export interface SignalCardProps extends Omit<ComponentProps<'div'>, 'title'> {
4
+ /** Eyebrow label rendered above the header. */
5
+ kicker?: ReactNode;
6
+ /** Icon rendered in the 40px square header badge. */
7
+ icon?: ReactNode;
8
+ title?: ReactNode;
9
+ subtitle?: ReactNode;
10
+ /** Large metric figure. */
11
+ value?: ReactNode;
12
+ /** Unit suffix rendered after the figure, e.g. "/t". */
13
+ unit?: ReactNode;
14
+ /** Tolerance suffix rendered after the unit, e.g. "± 0.001". */
15
+ tolerance?: ReactNode;
16
+ /** Body copy rendered under the figure. */
17
+ description?: ReactNode;
18
+ /** Delta indicator rendered in the footer, typically a Chip. */
19
+ delta?: ReactNode;
20
+ /** Muted footer meta items, e.g. horizon and confidence. */
21
+ meta?: ReactNode[];
22
+ /** Optional sparkline slot. */
23
+ sparkline?: ReactNode;
24
+ }
@@ -0,0 +1,2 @@
1
+ export { SignalCard } from './SignalCard';
2
+ export type { SignalCardProps } from './SignalCard.types';
@@ -1,7 +1,7 @@
1
1
  .switchRoot
2
2
  position relative
3
3
  display inline-flex
4
- padding 2px
4
+ padding 3px
5
5
  flex-shrink 0
6
6
  cursor pointer
7
7
  border-radius 9999px
@@ -34,8 +34,8 @@
34
34
  height 20px
35
35
 
36
36
  .switchThumb
37
- width 16px
38
- height 16px
37
+ width 14px
38
+ height 14px
39
39
 
40
40
  &[data-state=checked] .switchThumb
41
41
  transform translateX(16px)
@@ -45,8 +45,8 @@
45
45
  height 24px
46
46
 
47
47
  .switchThumb
48
- width 20px
49
- height 20px
48
+ width 18px
49
+ height 18px
50
50
 
51
51
  &[data-state=checked] .switchThumb
52
52
  transform translateX(20px)
@@ -56,8 +56,8 @@
56
56
  height 28px
57
57
 
58
58
  .switchThumb
59
- width 24px
60
- height 24px
59
+ width 22px
60
+ height 22px
61
61
 
62
62
  &[data-state=checked] .switchThumb
63
63
  transform translateX(24px)
@@ -20,9 +20,33 @@
20
20
  .table
21
21
  width 100%
22
22
  caption-side bottom
23
- font-size 14px
23
+ font-size var(--text-sm)
24
24
  overflow hidden
25
25
 
26
+ &[data-size="sm"]
27
+ font-size var(--text-xs)
28
+
29
+ .tableHead
30
+ .tableCell
31
+ padding var(--p-2) var(--p-3)
32
+ height auto
33
+
34
+ &[data-size="md"]
35
+ font-size var(--text-sm)
36
+
37
+ .tableHead
38
+ .tableCell
39
+ padding var(--p-4) var(--p-3)
40
+ height 65px
41
+
42
+ &[data-size="lg"]
43
+ font-size var(--text-base)
44
+
45
+ .tableHead
46
+ .tableCell
47
+ padding var(--p-5) var(--p-4)
48
+ height auto
49
+
26
50
  &.withPaddings
27
51
  .tableHead:first-child
28
52
  .tableCell:first-child
@@ -62,6 +86,7 @@
62
86
 
63
87
  .tableRow
64
88
  position relative
89
+ border-bottom 1px solid var(--border)
65
90
  transition-property background-color, color, border-color, text-decoration-color, fill, stroke
66
91
  transition-timing-function cubic-bezier(0.4, 0, 0.2, 1)
67
92
  transition-duration 150ms
@@ -94,11 +119,8 @@
94
119
  .tableCell
95
120
  position relative
96
121
  z-index 1
97
- padding-left var(--p-2)
98
- padding-right var(--p-2)
99
122
  vertical-align middle
100
123
  white-space nowrap
101
- height 65px
102
124
  min-width 0
103
125
 
104
126
  &:has([role="checkbox"])
@@ -107,10 +129,6 @@
107
129
  [role="checkbox"]
108
130
  transform translateY(2px)
109
131
 
110
- .compact
111
- height auto
112
-
113
-
114
132
  .cellValue
115
133
  display flex
116
134
  align-items center
@@ -2,7 +2,6 @@
2
2
  // Please do not change this file!
3
3
  interface CssExports {
4
4
  'cellValue': string;
5
- 'compact': string;
6
5
  'scrollContainer': string;
7
6
  'scrollInner': string;
8
7
  'scrollbar': string;
@@ -14,13 +14,15 @@ import type {
14
14
 
15
15
  function Table({
16
16
  className,
17
+ size = 'md',
17
18
  withBackground = false,
18
19
  withPaddings = false,
19
20
  ...props
20
- }: TableProps & { withBackground?: boolean; withPaddings?: boolean }) {
21
+ }: TableProps) {
21
22
  return (
22
23
  <table
23
24
  data-slot="table"
25
+ data-size={size}
24
26
  className={cn(
25
27
  S.table,
26
28
  className,
@@ -82,11 +84,11 @@ function TableHead({ className, ...props }: TableHeadProps) {
82
84
  );
83
85
  }
84
86
 
85
- function TableCell({ className, compact, ...props }: TableCellProps) {
87
+ function TableCell({ className, ...props }: TableCellProps) {
86
88
  return (
87
89
  <td
88
90
  data-slot="table-cell"
89
- className={cn(S.tableCell, compact && S.compact, className)}
91
+ className={cn(S.tableCell, className)}
90
92
  {...props}
91
93
  />
92
94
  );
@@ -1,6 +1,12 @@
1
1
  import { type ComponentProps } from 'react';
2
2
 
3
- export interface TableProps extends ComponentProps<'table'> {}
3
+ export type TableSize = 'sm' | 'md' | 'lg';
4
+
5
+ export interface TableProps extends ComponentProps<'table'> {
6
+ size?: TableSize;
7
+ withBackground?: boolean;
8
+ withPaddings?: boolean;
9
+ }
4
10
  export interface TableHeaderProps extends ComponentProps<'thead'> {
5
11
  withBorder?: boolean;
6
12
  }
@@ -8,7 +14,5 @@ export interface TableBodyProps extends ComponentProps<'tbody'> {}
8
14
  export interface TableFooterProps extends ComponentProps<'tfoot'> {}
9
15
  export interface TableRowProps extends ComponentProps<'tr'> {}
10
16
  export interface TableHeadProps extends ComponentProps<'th'> {}
11
- export interface TableCellProps extends ComponentProps<'td'> {
12
- compact?: boolean;
13
- }
17
+ export interface TableCellProps extends ComponentProps<'td'> {}
14
18
  export interface TableCaptionProps extends ComponentProps<'caption'> {}
@@ -8,4 +8,4 @@ export {
8
8
  TableCell,
9
9
  TableCellValue,
10
10
  } from './Table';
11
- export type { TableProps } from './Table.types';
11
+ export type { TableProps, TableSize } from './Table.types';
@@ -5,9 +5,9 @@
5
5
  width fit-content
6
6
  min-width 100%
7
7
  padding 6px 12px
8
- border-radius var(--p-3)
8
+ border-radius var(--radius-4)
9
9
  background-color var(--popover)
10
- font-size 12px
10
+ font-size var(--text-xs)
11
11
  color var(--popover-foreground)
12
12
  backdrop-filter blur(10px)
13
13
  text-wrap balance
@@ -8,7 +8,7 @@ import {
8
8
  } from './chatPersistence';
9
9
 
10
10
  describe('stripMessageForPersistence', () => {
11
- it('removes json-dashboard fences from message text', () => {
11
+ it('keeps json-dashboard fences in assistant message text', () => {
12
12
  const message = stripMessageForPersistence({
13
13
  id: '1',
14
14
  role: MessageRole.ASSISTANT,
@@ -16,13 +16,24 @@ describe('stripMessageForPersistence', () => {
16
16
  timestamp: 1,
17
17
  });
18
18
 
19
+ expect(message.text).toBe('Summary\n```json-dashboard\n{"tiles":[]}\n```');
20
+ });
21
+
22
+ it('removes json-dashboard fences from non-assistant message text', () => {
23
+ const message = stripMessageForPersistence({
24
+ id: '1a',
25
+ role: MessageRole.USER,
26
+ text: 'Summary\n```json-dashboard\n{"tiles":[]}\n```',
27
+ timestamp: 1,
28
+ });
29
+
19
30
  expect(message.text).toBe('Summary');
20
31
  });
21
32
 
22
33
  it('strips from an unclosed json-dashboard fence', () => {
23
34
  const message = stripMessageForPersistence({
24
35
  id: '1b',
25
- role: MessageRole.ASSISTANT,
36
+ role: MessageRole.USER,
26
37
  text: 'Summary\n```json-dashboard\n{"tiles":[]}',
27
38
  timestamp: 1,
28
39
  });
@@ -0,0 +1,33 @@
1
+ .root
2
+ display flex
3
+ flex-direction column
4
+ gap var(--p-3)
5
+ padding-top var(--p-1)
6
+ padding-bottom var(--p-10)
7
+
8
+ .overview
9
+ margin 0
10
+ max-width 720px
11
+ line-height 1.6
12
+
13
+ .block
14
+ display flex
15
+ flex-direction column
16
+ gap var(--p-1)
17
+
18
+ .heading
19
+ margin 0
20
+ font-size var(--text-xs)
21
+ font-weight 600
22
+ letter-spacing 0.02em
23
+ text-transform uppercase
24
+ color var(--muted-foreground)
25
+
26
+ .list
27
+ margin 0
28
+ padding-left var(--p-5)
29
+ max-width 720px
30
+ line-height 1.6
31
+
32
+ li + li
33
+ margin-top 2px
@@ -0,0 +1,11 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'block': string;
5
+ 'heading': string;
6
+ 'list': string;
7
+ 'overview': string;
8
+ 'root': string;
9
+ }
10
+ export const cssExports: CssExports;
11
+ export default cssExports;
@@ -0,0 +1,57 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import { PageContentSection } from '#uilib/components/ui/Page';
4
+
5
+ import S from './DocsGuidance.styl';
6
+
7
+ export interface DocsGuidanceProps {
8
+ /** 1-3 sentence description of what the component is and how to use it. */
9
+ overview: ReactNode;
10
+ /** Bullet points describing situations where the component fits. */
11
+ whenToUse?: ReactNode[];
12
+ /** Bullet points describing situations where another pattern fits better. */
13
+ whenNotToUse?: ReactNode[];
14
+ /** Optional short "do" guidance notes. */
15
+ doNotes?: ReactNode[];
16
+ /** Optional short "don't" guidance notes. */
17
+ dontNotes?: ReactNode[];
18
+ }
19
+
20
+ function GuidanceList({
21
+ heading,
22
+ items,
23
+ }: {
24
+ heading: string;
25
+ items?: ReactNode[];
26
+ }) {
27
+ if (!items?.length) return null;
28
+
29
+ return (
30
+ <div className={S.block}>
31
+ <h4 className={S.heading}>{heading}</h4>
32
+ <ul className={S.list}>
33
+ {items.map((item, index) => (
34
+ <li key={index}>{item}</li>
35
+ ))}
36
+ </ul>
37
+ </div>
38
+ );
39
+ }
40
+
41
+ export function DocsGuidance({
42
+ overview,
43
+ whenToUse,
44
+ whenNotToUse,
45
+ doNotes,
46
+ dontNotes,
47
+ }: DocsGuidanceProps) {
48
+ return (
49
+ <PageContentSection grow={false} className={S.root}>
50
+ <p className={S.overview}>{overview}</p>
51
+ <GuidanceList heading="When to use" items={whenToUse} />
52
+ <GuidanceList heading="When not to use" items={whenNotToUse} />
53
+ <GuidanceList heading="Do" items={doNotes} />
54
+ <GuidanceList heading="Don't" items={dontNotes} />
55
+ </PageContentSection>
56
+ );
57
+ }
@@ -4,6 +4,7 @@ import { AnalysesSelector } from '#uilib/components/ui/AnalysesSelector';
4
4
  import { PageContentSection } from '#uilib/components/ui/Page';
5
5
 
6
6
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
7
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
7
8
  import { DocsHeaderActions } from '../docsHeaderActions';
8
9
 
9
10
  const ITEMS = [
@@ -37,6 +38,21 @@ export default function AnalysesSelectorPage() {
37
38
  subheader="Multi-select analyses with inline or dropdown layout."
38
39
  actions={<DocsHeaderActions />}
39
40
  />
41
+ <DocsGuidance
42
+ overview="AnalysesSelector lets users choose which analyses are shown alongside historical data, rendered as an inline row or a compact dropdown depending on available space. Each item carries a colour swatch and optional status so users can match selections to chart series."
43
+ whenToUse={[
44
+ 'To toggle which analysis series are visible on a chart or comparison view.',
45
+ 'When users need to compare several analyses against historical data at once.',
46
+ 'When the selection should collapse into a dropdown in constrained layouts.',
47
+ ]}
48
+ whenNotToUse={[
49
+ 'To pick a single value from a generic list; use Select instead.',
50
+ 'To filter tabular data by arbitrary fields; use dedicated filter controls.',
51
+ ]}
52
+ doNotes={[
53
+ 'Keep item colours in sync with the corresponding chart series so the mapping stays obvious.',
54
+ ]}
55
+ />
40
56
  <PageContentSection style={{ maxWidth: 420 }}>
41
57
  <AnalysesSelector
42
58
  items={ITEMS}
@@ -2,6 +2,7 @@ import { AnalysisLineIcon } from '#uilib/components/ui/AnalysisLineIcon';
2
2
  import { PageContentSection } from '#uilib/components/ui/Page';
3
3
 
4
4
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
5
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
5
6
  import { DocsHeaderActions } from '../docsHeaderActions';
6
7
 
7
8
  export default function AnalysisLineIconPage() {
@@ -13,6 +14,17 @@ export default function AnalysisLineIconPage() {
13
14
  subheader="Solid and dashed line markers."
14
15
  actions={<DocsHeaderActions />}
15
16
  />
17
+ <DocsGuidance
18
+ overview="AnalysisLineIcon renders a small solid or dashed line marker in a given colour. Use it as a legend swatch so users can match a label to its line on a chart."
19
+ whenToUse={[
20
+ 'In chart legends, selectors, or tooltips to identify a series by colour and line style.',
21
+ 'To distinguish historical series (solid) from forecast series (dashed).',
22
+ ]}
23
+ whenNotToUse={[
24
+ 'As a generic decorative icon; it only conveys meaning next to a chart.',
25
+ 'To indicate status or severity; use Badge instead.',
26
+ ]}
27
+ />
16
28
  <PageContentSection
17
29
  style={{ flexDirection: 'row', gap: '1.5rem', alignItems: 'center' }}
18
30
  >
@@ -6,6 +6,7 @@ import {
6
6
  import { PageContentSection } from '#uilib/components/ui/Page';
7
7
 
8
8
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
9
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
9
10
  import { DocsHeaderActions } from '../docsHeaderActions';
10
11
 
11
12
  export default function AvatarPage() {
@@ -17,6 +18,20 @@ export default function AvatarPage() {
17
18
  subheader="Image with fallback initials."
18
19
  actions={<DocsHeaderActions />}
19
20
  />
21
+ <DocsGuidance
22
+ overview="Avatar displays a user or entity image with an automatic fallback to initials when the image is missing or fails to load. Compose it from AvatarImage and AvatarFallback."
23
+ whenToUse={[
24
+ 'To represent a person or account in headers, lists, comments, or menus.',
25
+ 'When an image may be unavailable and a textual fallback is acceptable.',
26
+ ]}
27
+ whenNotToUse={[
28
+ 'For arbitrary illustrative imagery; use a plain image instead.',
29
+ 'To convey status on its own; pair it with a Badge or status indicator.',
30
+ ]}
31
+ doNotes={[
32
+ 'Always provide an AvatarFallback with one or two initials so the component degrades gracefully.',
33
+ ]}
34
+ />
20
35
  <PageContentSection
21
36
  style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}
22
37
  >
@@ -2,6 +2,7 @@ import { Badge } from '#uilib/components/ui/Badge';
2
2
  import { PageContentSection } from '#uilib/components/ui/Page';
3
3
 
4
4
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
5
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
5
6
  import { DocsHeaderActions } from '../docsHeaderActions';
6
7
 
7
8
  export default function BadgePage() {
@@ -13,6 +14,21 @@ export default function BadgePage() {
13
14
  subheader="Status and label badges."
14
15
  actions={<DocsHeaderActions />}
15
16
  />
17
+ <DocsGuidance
18
+ overview="Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: default or outline for neutral labels, red and green for negative and positive states."
19
+ whenToUse={[
20
+ 'To show the status of an item, such as active, failed, or done.',
21
+ 'To label or categorise content in lists, tables, and cards.',
22
+ 'To surface short metadata next to a title.',
23
+ ]}
24
+ whenNotToUse={[
25
+ 'For interactive actions; badges are not clickable, use Button instead.',
26
+ 'For long descriptive text; keep badge labels to one or two words.',
27
+ ]}
28
+ doNotes={[
29
+ 'Use colour variants consistently so a given colour always carries the same meaning across the product.',
30
+ ]}
31
+ />
16
32
  <PageContentSection
17
33
  style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}
18
34
  >
@@ -0,0 +1,109 @@
1
+ import type {
2
+ BarChartDatum,
3
+ BarChartSeries,
4
+ } from '#uilib/components/ui/BarChart';
5
+ import { BarChart } from '#uilib/components/ui/BarChart';
6
+ import { PageContentSection, SectionHeader } from '#uilib/components/ui/Page';
7
+
8
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
9
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
10
+ import { DocsHeaderActions } from '../docsHeaderActions';
11
+
12
+ const REVENUE_BY_REGION: BarChartDatum[] = [
13
+ { month: 'Jan', emea: 42, americas: 38, apac: 21 },
14
+ { month: 'Feb', emea: 47, americas: 41, apac: 24 },
15
+ { month: 'Mar', emea: 44, americas: 45, apac: 27 },
16
+ { month: 'Apr', emea: 52, americas: 43, apac: 30 },
17
+ { month: 'May', emea: 49, americas: 48, apac: 33 },
18
+ { month: 'Jun', emea: 55, americas: 51, apac: 35 },
19
+ ];
20
+
21
+ const REGION_SERIES: BarChartSeries[] = [
22
+ { key: 'emea', label: 'EMEA' },
23
+ { key: 'americas', label: 'Americas' },
24
+ { key: 'apac', label: 'APAC' },
25
+ ];
26
+
27
+ const ACCURACY_BY_MODEL: BarChartDatum[] = [
28
+ { model: 'Baseline', accuracy: 62 },
29
+ { model: 'Seasonal', accuracy: 71 },
30
+ { model: 'Ensemble', accuracy: 79 },
31
+ { model: 'Neural', accuracy: 84 },
32
+ ];
33
+
34
+ const ACCURACY_SERIES: BarChartSeries[] = [
35
+ { key: 'accuracy', label: 'Accuracy' },
36
+ ];
37
+
38
+ const formatPercent = (value: number) => `${value}%`;
39
+
40
+ export default function BarChartPage() {
41
+ return (
42
+ <>
43
+ <AppPageHeader
44
+ breadcrumbs={[{ label: 'BarChart' }]}
45
+ title="BarChart"
46
+ subheader="Categorical bar chart with grouped and stacked modes."
47
+ actions={<DocsHeaderActions />}
48
+ />
49
+ <DocsGuidance
50
+ overview="BarChart compares values across categories. Provide rows of data, a category key, and a list of series; choose vertical or horizontal orientation and grouped or stacked mode. Grid, axes, tooltip, and legend follow the shared chart styling."
51
+ whenToUse={[
52
+ 'To compare discrete categories such as regions, models, or scenarios.',
53
+ 'Stacked mode when the per-category total matters as much as the breakdown.',
54
+ 'Horizontal orientation when category labels are long or there are many categories.',
55
+ ]}
56
+ whenNotToUse={[
57
+ 'For continuous time series; use ChartAreaInteractive or a line chart instead.',
58
+ 'For part-to-whole of a single total; use DonutChart.',
59
+ ]}
60
+ doNotes={[
61
+ 'Start the value axis at zero so bar lengths stay proportional.',
62
+ ]}
63
+ />
64
+ <PageContentSection>
65
+ <SectionHeader
66
+ title="Grouped"
67
+ description="Monthly revenue by region, side by side."
68
+ withMargin
69
+ />
70
+ <BarChart
71
+ data={REVENUE_BY_REGION}
72
+ categoryKey="month"
73
+ series={REGION_SERIES}
74
+ height={280}
75
+ />
76
+ </PageContentSection>
77
+ <PageContentSection>
78
+ <SectionHeader
79
+ title="Stacked"
80
+ description="The same data stacked to emphasise monthly totals."
81
+ withMargin
82
+ />
83
+ <BarChart
84
+ data={REVENUE_BY_REGION}
85
+ categoryKey="month"
86
+ series={REGION_SERIES}
87
+ mode="stacked"
88
+ height={280}
89
+ />
90
+ </PageContentSection>
91
+ <PageContentSection>
92
+ <SectionHeader
93
+ title="Horizontal"
94
+ description="Single series with long category labels and formatted ticks."
95
+ withMargin
96
+ />
97
+ <BarChart
98
+ data={ACCURACY_BY_MODEL}
99
+ categoryKey="model"
100
+ series={ACCURACY_SERIES}
101
+ orientation="horizontal"
102
+ valueFormatter={formatPercent}
103
+ showLegend={false}
104
+ height={240}
105
+ />
106
+ </PageContentSection>
107
+ </>
108
+ );
109
+ }