@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,160 @@
1
+ import { Chip } from '#uilib/components/ui/Chip';
2
+ import type { ChipVariant } from '#uilib/components/ui/Chip';
3
+ import { PageContentSection } from '#uilib/components/ui/Page';
4
+
5
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
6
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
7
+ import { DocsHeaderActions } from '../docsHeaderActions';
8
+
9
+ const VARIANTS: ChipVariant[] = [
10
+ 'neutral',
11
+ 'line',
12
+ 'active',
13
+ 'filled',
14
+ 'accent',
15
+ 'positive',
16
+ 'negative',
17
+ ];
18
+
19
+ export default function ChipPage() {
20
+ return (
21
+ <>
22
+ <AppPageHeader
23
+ breadcrumbs={[{ label: 'Chip' }]}
24
+ title="Chip"
25
+ subheader="Status and delta capsule with filter, accent, and trend variants."
26
+ actions={<DocsHeaderActions />}
27
+ />
28
+ <DocsGuidance
29
+ overview="Chips are compact pill-shaped capsules for filters, status pills, version tags, and quantitative delta indicators. Unlike Badge, which stays general purpose, Chip carries status and delta semantics: the positive and negative variants sit outside the primary palette and are reserved for quantitative impact signals."
30
+ whenToUse={[
31
+ 'To present a row of filter options, with the active variant marking the current selection.',
32
+ 'To flag live status, version tags, or deadlines with the neutral, accent, and filled variants.',
33
+ 'To show a quantitative delta or impact direction with the positive or negative variant, optionally with a trend arrow.',
34
+ ]}
35
+ whenNotToUse={[
36
+ 'For general-purpose labels without status or delta semantics; use Badge instead.',
37
+ 'For file attachments; use FileChip.',
38
+ 'As decoration; the status variants are reserved for quantitative signals only.',
39
+ ]}
40
+ doNotes={[
41
+ 'Keep chip labels short and in sentence case.',
42
+ 'Pair the positive and negative variants with a trend arrow or delta value so the direction reads at a glance.',
43
+ ]}
44
+ />
45
+ <PageContentSection
46
+ style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
47
+ >
48
+ <section>
49
+ <h3 style={{ marginBottom: '1rem' }}>Variants</h3>
50
+ <div
51
+ style={{
52
+ display: 'flex',
53
+ flexWrap: 'wrap',
54
+ gap: '0.75rem',
55
+ alignItems: 'center',
56
+ }}
57
+ >
58
+ {VARIANTS.map(v => (
59
+ <Chip key={v} variant={v}>
60
+ {v}
61
+ </Chip>
62
+ ))}
63
+ </div>
64
+ </section>
65
+ <section>
66
+ <h3 style={{ marginBottom: '1rem' }}>Filters</h3>
67
+ <div
68
+ style={{
69
+ display: 'flex',
70
+ flexWrap: 'wrap',
71
+ gap: '0.75rem',
72
+ alignItems: 'center',
73
+ }}
74
+ >
75
+ <Chip variant="line">All signals</Chip>
76
+ <Chip variant="active">Polymers</Chip>
77
+ <Chip variant="line">Energy</Chip>
78
+ <Chip variant="line">Logistics</Chip>
79
+ <Chip variant="line">Weather</Chip>
80
+ </div>
81
+ </section>
82
+ <section>
83
+ <h3 style={{ marginBottom: '1rem' }}>Status and tags</h3>
84
+ <div
85
+ style={{
86
+ display: 'flex',
87
+ flexWrap: 'wrap',
88
+ gap: '0.75rem',
89
+ alignItems: 'center',
90
+ }}
91
+ >
92
+ <Chip variant="neutral">Live</Chip>
93
+ <Chip variant="accent">New · v2.3</Chip>
94
+ <Chip variant="filled">Decision due T−48h</Chip>
95
+ <Chip variant="line" style={{ color: 'var(--sb-slate-500)' }}>
96
+ Archived
97
+ </Chip>
98
+ </div>
99
+ </section>
100
+ <section>
101
+ <h3 style={{ marginBottom: '1rem' }}>Deltas</h3>
102
+ <p
103
+ style={{
104
+ marginBottom: '0.75rem',
105
+ color: 'var(--muted-foreground)',
106
+ }}
107
+ >
108
+ Status chips sit outside the primary palette. Reserved for
109
+ quantitative delta and impact signals — not decoration.
110
+ </p>
111
+ <div
112
+ style={{
113
+ display: 'flex',
114
+ flexWrap: 'wrap',
115
+ gap: '0.75rem',
116
+ alignItems: 'center',
117
+ }}
118
+ >
119
+ <Chip variant="negative" trend="down">
120
+ Negative impact
121
+ </Chip>
122
+ <Chip variant="positive" trend="up">
123
+ Positive impact
124
+ </Chip>
125
+ <Chip variant="negative">▼ 3.4%</Chip>
126
+ <Chip variant="positive">▲ 1.2%</Chip>
127
+ </div>
128
+ </section>
129
+ <section>
130
+ <h3 style={{ marginBottom: '1rem' }}>Dot</h3>
131
+ <p
132
+ style={{
133
+ marginBottom: '0.75rem',
134
+ color: 'var(--muted-foreground)',
135
+ }}
136
+ >
137
+ The neutral variant shows the 6px dot by default; pass{' '}
138
+ <code>dot</code> to control it on any variant.
139
+ </p>
140
+ <div
141
+ style={{
142
+ display: 'flex',
143
+ flexWrap: 'wrap',
144
+ gap: '0.75rem',
145
+ alignItems: 'center',
146
+ }}
147
+ >
148
+ <Chip variant="neutral">Live</Chip>
149
+ <Chip variant="neutral" dot={false}>
150
+ No dot
151
+ </Chip>
152
+ <Chip variant="line" dot>
153
+ Streaming
154
+ </Chip>
155
+ </div>
156
+ </section>
157
+ </PageContentSection>
158
+ </>
159
+ );
160
+ }
@@ -0,0 +1,27 @@
1
+ .family
2
+ margin-bottom var(--p-6)
3
+
4
+ .familyName
5
+ margin-bottom var(--p-3)
6
+
7
+ .ramp
8
+ display grid
9
+ grid-template-columns repeat(auto-fill, minmax(96px, 1fr))
10
+ gap var(--p-2)
11
+
12
+ .swatch
13
+ display flex
14
+ flex-direction column
15
+ gap var(--p-1)
16
+
17
+ .chip
18
+ height 48px
19
+ border-radius var(--radius-2)
20
+ border 1px solid var(--border)
21
+
22
+ .token
23
+ font-family monospace
24
+ font-size var(--text-2xs)
25
+ color var(--muted-foreground)
26
+ user-select text
27
+ word-break break-all
@@ -0,0 +1,12 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'chip': string;
5
+ 'family': string;
6
+ 'familyName': string;
7
+ 'ramp': string;
8
+ 'swatch': string;
9
+ 'token': string;
10
+ }
11
+ export const cssExports: CssExports;
12
+ export default cssExports;
@@ -0,0 +1,102 @@
1
+ import { PageContentSection } from '#uilib/components/ui/Page';
2
+
3
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
4
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
5
+ import { DocsHeaderActions } from '../docsHeaderActions';
6
+ import S from './ColorsPage.styl';
7
+
8
+ const RAMP_STEPS = [
9
+ '50',
10
+ '100',
11
+ '200',
12
+ '300',
13
+ '400',
14
+ '500',
15
+ '600',
16
+ '700',
17
+ '800',
18
+ '900',
19
+ ];
20
+
21
+ const RAMPS: { family: string; tokens: string[] }[] = [
22
+ 'cyan',
23
+ 'purple',
24
+ 'red',
25
+ 'green',
26
+ 'yellow',
27
+ 'gray',
28
+ ].map(family => ({
29
+ family,
30
+ tokens: RAMP_STEPS.map(step => `--sb-${family}-${step}`),
31
+ }));
32
+
33
+ RAMPS.push({
34
+ family: 'slate',
35
+ tokens: [...RAMP_STEPS, '950'].map(step => `--sb-slate-${step}`),
36
+ });
37
+
38
+ const SEMANTIC_TOKENS = [
39
+ '--background',
40
+ '--foreground',
41
+ '--primary',
42
+ '--muted',
43
+ '--border',
44
+ '--brand-color',
45
+ '--status-positive',
46
+ '--status-positive-bg',
47
+ '--status-negative',
48
+ '--status-negative-bg',
49
+ ];
50
+
51
+ function Swatch({ token }: { token: string }) {
52
+ return (
53
+ <div className={S.swatch}>
54
+ <div className={S.chip} style={{ background: `var(${token})` }} />
55
+ <span className={S.token}>{token}</span>
56
+ </div>
57
+ );
58
+ }
59
+
60
+ export default function ColorsPage() {
61
+ return (
62
+ <>
63
+ <AppPageHeader
64
+ breadcrumbs={[{ label: 'Colors' }]}
65
+ title="Colors"
66
+ subheader="Core --sb-* ramps and the semantic tokens built on top of them."
67
+ actions={<DocsHeaderActions />}
68
+ />
69
+ <DocsGuidance
70
+ overview="Colour is defined as a set of core ramps (--sb-cyan/purple/red/green/yellow/gray/slate) plus semantic tokens that map those ramps onto roles such as background, border, brand, and status. Components should reference semantic tokens first and reach for a raw ramp step only when no role fits."
71
+ whenToUse={[
72
+ 'Semantic tokens for surfaces, text, borders, and status colour in components.',
73
+ 'Ramp steps for data visualisation or decorative accents where a specific hue is needed.',
74
+ ]}
75
+ whenNotToUse={[
76
+ 'Hardcoded hex or oklch values in component styles; always go through a token.',
77
+ ]}
78
+ />
79
+ <PageContentSection>
80
+ <h3>Core ramps</h3>
81
+ {RAMPS.map(({ family, tokens }) => (
82
+ <div key={family} className={S.family}>
83
+ <h4 className={S.familyName}>{family}</h4>
84
+ <div className={S.ramp}>
85
+ {tokens.map(token => (
86
+ <Swatch key={token} token={token} />
87
+ ))}
88
+ </div>
89
+ </div>
90
+ ))}
91
+ </PageContentSection>
92
+ <PageContentSection>
93
+ <h3>Semantic tokens</h3>
94
+ <div className={S.ramp}>
95
+ {SEMANTIC_TOKENS.map(token => (
96
+ <Swatch key={token} token={token} />
97
+ ))}
98
+ </div>
99
+ </PageContentSection>
100
+ </>
101
+ );
102
+ }
@@ -5,6 +5,7 @@ import { Confirm } from '#uilib/components/ui/Confirm';
5
5
  import { PageContentSection } from '#uilib/components/ui/Page';
6
6
 
7
7
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
8
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
8
9
  import { DocsHeaderActions } from '../docsHeaderActions';
9
10
 
10
11
  export default function ConfirmPage() {
@@ -19,6 +20,20 @@ export default function ConfirmPage() {
19
20
  subheader="Confirmation dialog built on Dialog with primary and cancel actions."
20
21
  actions={<DocsHeaderActions />}
21
22
  />
23
+ <DocsGuidance
24
+ overview="Confirm is a focused confirmation dialog built on Dialog, with a title, body, and paired confirm and cancel actions. Set confirmVariant to destructive for irreversible operations such as deletion."
25
+ whenToUse={[
26
+ 'Before destructive or irreversible actions, such as deleting an item.',
27
+ 'When proceeding would discard unsaved work.',
28
+ ]}
29
+ whenNotToUse={[
30
+ 'For routine, easily reversible actions; frequent confirmations train users to click through.',
31
+ 'When the task needs input or several fields; use Dialog instead.',
32
+ ]}
33
+ doNotes={[
34
+ 'Label the confirm button with the action it performs, such as “Delete”, rather than “OK”.',
35
+ ]}
36
+ />
22
37
  <PageContentSection>
23
38
  <div
24
39
  style={{
@@ -5,6 +5,7 @@ import { Dialog } from '#uilib/components/ui/Dialog';
5
5
  import { PageContentSection } from '#uilib/components/ui/Page';
6
6
 
7
7
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
8
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
8
9
  import { DocsHeaderActions } from '../docsHeaderActions';
9
10
 
10
11
  export default function DialogPage() {
@@ -18,6 +19,20 @@ export default function DialogPage() {
18
19
  subheader="Modal dialog with trigger and footer."
19
20
  actions={<DocsHeaderActions />}
20
21
  />
22
+ <DocsGuidance
23
+ overview="Dialog presents content in a modal layer above the page, with a trigger, title, optional subtitle, body content, and a footer for actions. It blocks interaction with the page until dismissed."
24
+ whenToUse={[
25
+ 'For focused tasks that must be completed before returning to the page, such as editing details.',
26
+ 'To present important information that must not be missed.',
27
+ ]}
28
+ whenNotToUse={[
29
+ 'For simple yes or no confirmations; use Confirm instead.',
30
+ 'For lengthy or complex flows; consider a dedicated page or drawer.',
31
+ ]}
32
+ doNotes={[
33
+ 'Keep dialog content short and provide a clear primary action in the footer.',
34
+ ]}
35
+ />
21
36
  <PageContentSection>
22
37
  <Dialog
23
38
  open={open}
@@ -0,0 +1,80 @@
1
+ import type { DonutChartDatum } from '#uilib/components/ui/DonutChart';
2
+ import { DonutChart } from '#uilib/components/ui/DonutChart';
3
+ import { PageContentSection, SectionHeader } from '#uilib/components/ui/Page';
4
+
5
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
6
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
7
+ import { DocsHeaderActions } from '../docsHeaderActions';
8
+
9
+ const ALLOCATION: DonutChartDatum[] = [
10
+ { key: 'equities', label: 'Equities', value: 4520 },
11
+ { key: 'bonds', label: 'Bonds', value: 2780 },
12
+ { key: 'commodities', label: 'Commodities', value: 1340 },
13
+ { key: 'property', label: 'Property', value: 860 },
14
+ { key: 'cash', label: 'Cash', value: 500 },
15
+ ];
16
+
17
+ const ALLOCATION_TOTAL = ALLOCATION.reduce((sum, d) => sum + d.value, 0);
18
+
19
+ const SENTIMENT: DonutChartDatum[] = [
20
+ {
21
+ key: 'positive',
22
+ label: 'Positive',
23
+ value: 58,
24
+ color: 'var(--status-positive)',
25
+ },
26
+ { key: 'neutral', label: 'Neutral', value: 27, color: 'var(--sb-slate-400)' },
27
+ {
28
+ key: 'negative',
29
+ label: 'Negative',
30
+ value: 15,
31
+ color: 'var(--status-negative)',
32
+ },
33
+ ];
34
+
35
+ export default function DonutChartPage() {
36
+ return (
37
+ <>
38
+ <AppPageHeader
39
+ breadcrumbs={[{ label: 'DonutChart' }]}
40
+ title="DonutChart"
41
+ subheader="Part-to-whole donut chart with an optional centre figure."
42
+ actions={<DocsHeaderActions />}
43
+ />
44
+ <DocsGuidance
45
+ overview="DonutChart shows how a small number of categories make up a whole. Each datum carries a key, value, and optional label and colour; the centre of the donut can display a headline figure with a caption. Tooltip and legend reuse the shared chart infrastructure."
46
+ whenToUse={[
47
+ 'To show composition of a total across roughly two to six categories, such as portfolio allocation or sentiment share.',
48
+ 'When a single headline figure (the total) deserves prominence in the centre.',
49
+ ]}
50
+ whenNotToUse={[
51
+ 'For more than about six categories; slices become unreadable — use BarChart instead.',
52
+ 'For comparing values across groups or over time; a donut only conveys part-to-whole.',
53
+ ]}
54
+ doNotes={[
55
+ 'Order slices from largest to smallest so the chart reads clockwise.',
56
+ ]}
57
+ />
58
+ <PageContentSection>
59
+ <SectionHeader
60
+ title="With centre label"
61
+ description="Portfolio allocation with the total in the donut hole."
62
+ withMargin
63
+ />
64
+ <DonutChart
65
+ data={ALLOCATION}
66
+ centerValue={ALLOCATION_TOTAL.toLocaleString()}
67
+ centerCaption="Total (GBP k)"
68
+ />
69
+ </PageContentSection>
70
+ <PageContentSection>
71
+ <SectionHeader
72
+ title="Custom colours"
73
+ description="Sentiment share using status tokens, without a centre label."
74
+ withMargin
75
+ />
76
+ <DonutChart data={SENTIMENT} innerRadius="55%" height={240} />
77
+ </PageContentSection>
78
+ </>
79
+ );
80
+ }
@@ -12,6 +12,7 @@ import {
12
12
  import { PageContentSection } from '#uilib/components/ui/Page';
13
13
 
14
14
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
15
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
15
16
  import { DocsHeaderActions } from '../docsHeaderActions';
16
17
 
17
18
  export default function DrawerPage() {
@@ -23,6 +24,22 @@ export default function DrawerPage() {
23
24
  subheader="Mobile-friendly drawer (Vaul)."
24
25
  actions={<DocsHeaderActions />}
25
26
  />
27
+ <DocsGuidance
28
+ overview="Drawer is a panel that slides in from the edge of the screen, built on Vaul for touch-friendly drag-to-dismiss behaviour. Compose it from DrawerTrigger, DrawerContent, DrawerHeader, and DrawerFooter, and give every drawer a DrawerTitle and DrawerDescription."
29
+ whenToUse={[
30
+ 'For supplementary content or actions on mobile, where a bottom sheet feels more natural than a dialog.',
31
+ 'For short, focused tasks that the user completes and dismisses, such as confirming a choice or adjusting a setting.',
32
+ 'When the user should be able to swipe or drag the surface away to dismiss it.',
33
+ ]}
34
+ whenNotToUse={[
35
+ 'For critical confirmations that must block interaction; use AlertDialog instead.',
36
+ 'For long forms or dense content; use a dedicated page or a Dialog with more room.',
37
+ ]}
38
+ doNotes={[
39
+ 'Always provide a DrawerTitle and DrawerDescription so screen readers can announce the surface.',
40
+ 'Place dismiss actions in DrawerFooter using DrawerClose so they close the drawer consistently.',
41
+ ]}
42
+ />
26
43
  <PageContentSection>
27
44
  <Drawer>
28
45
  <DrawerTrigger asChild>
@@ -11,6 +11,7 @@ import {
11
11
  import { CaretLeft, CaretRight } from '@phosphor-icons/react';
12
12
 
13
13
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
14
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
14
15
  import { DocsHeaderActions } from '../docsHeaderActions';
15
16
 
16
17
  /** ISO `YYYY-MM` keys, sorted ascending → series for DriverPerformanceChart. */
@@ -201,6 +202,22 @@ export default function DriverMapPage() {
201
202
  subheader="World map with driver badges and the driver detail card — map clicks and the selector sync selection; arrow keys navigate the map."
202
203
  actions={<DocsHeaderActions />}
203
204
  />
205
+ <DocsGuidance
206
+ overview="DriverMap renders a world map with badges for each driver, and DriverCard shows the detail of the selected driver. The two share a selection: clicking a badge on the map, using arrow keys, or paging through an external selector all update the same selected driver."
207
+ whenToUse={[
208
+ 'To give a geographic overview of where drivers originate and let users explore them by region.',
209
+ 'Alongside DriverCard, so selecting a driver on the map reveals its importance, lag, and summary.',
210
+ 'When drivers carry coordinates or region metadata that benefits from a spatial presentation.',
211
+ ]}
212
+ whenNotToUse={[
213
+ 'When drivers have no meaningful geography; a table or list ranks them more clearly.',
214
+ 'For comparing driver series over time; use DriversComparisonChart instead.',
215
+ ]}
216
+ doNotes={[
217
+ 'Pass isLoading to both the map and the card so their loading states stay in sync.',
218
+ 'Provide a driverSelector in DriverCard so users can page through drivers without using the map.',
219
+ ]}
220
+ />
204
221
  <PageContentSection>
205
222
  <div
206
223
  style={{
@@ -13,6 +13,7 @@ import { useTheme } from '#uilib/contexts/theme-context';
13
13
  import type { BacktestsComponentPayload } from '@sybilion/platform-sdk';
14
14
 
15
15
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
16
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
16
17
  import { DocsHeaderActions } from '../docsHeaderActions';
17
18
 
18
19
  const ALL_TIME_RANGE = TIME_RANGES[TIME_RANGES.length - 1];
@@ -123,6 +124,22 @@ export default function DriversComparisonChartPage() {
123
124
  subheader="Normalized target line with driver series; Lagged/Overlapped tabs shift driver alignment; table rows toggle chart visibility."
124
125
  actions={<DocsHeaderActions />}
125
126
  />
127
+ <DocsGuidance
128
+ overview="DriversComparisonChart plots a normalized target line against the normalized series of its drivers, with a table of drivers underneath. The Lagged and Overlapped view tabs control whether driver series are shifted by their reported lag or aligned in time, and table rows toggle each series on the chart."
129
+ whenToUse={[
130
+ 'To show how individual drivers move relative to a backtested target over time.',
131
+ 'When users need to compare lagged and contemporaneous alignment of driver series.',
132
+ 'When the driver table and the chart should stay linked, so hiding a row hides its line.',
133
+ ]}
134
+ whenNotToUse={[
135
+ 'For a single series with no target to compare against; use ChartAreaInteractive directly.',
136
+ 'When drivers lack normalized series data; the chart needs a populated payload to be useful.',
137
+ ]}
138
+ doNotes={[
139
+ 'Provide a statusHint when the payload is empty so users understand why the chart is blank.',
140
+ 'Control viewTab from the page when an external Lagged/Overlapped switcher should stay in sync.',
141
+ ]}
142
+ />
126
143
  <PageContentSection>
127
144
  <div
128
145
  style={{
@@ -4,6 +4,7 @@ import { DropZone } from '#uilib/components/ui/DropZone/DropZone';
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
  export default function DropZonePage() {
@@ -17,6 +18,21 @@ export default function DropZonePage() {
17
18
  subheader="Drag and drop or pick a file."
18
19
  actions={<DocsHeaderActions />}
19
20
  />
21
+ <DocsGuidance
22
+ overview="DropZone is a file upload target that accepts a dragged file or opens the system file picker on click. Restrict accepted types with the accept prop and receive the chosen file in the onFile callback."
23
+ whenToUse={[
24
+ 'When uploading a file is a primary step in a flow, such as importing a dataset.',
25
+ 'When drag and drop is a natural interaction, for example on desktop-focused screens.',
26
+ ]}
27
+ whenNotToUse={[
28
+ 'In compact layouts where a large drop target wastes space; use a simple file input or button instead.',
29
+ 'When users need to manage multiple attachments inline; pair an upload control with FileChip rows.',
30
+ ]}
31
+ doNotes={[
32
+ 'Set accept to the formats you can actually process, and repeat them in the label so expectations are clear.',
33
+ 'Show the selected file name after a drop so users get immediate confirmation.',
34
+ ]}
35
+ />
20
36
  <PageContentSection>
21
37
  <DropZone
22
38
  accept=".csv,.txt"
@@ -10,6 +10,7 @@ import {
10
10
  import { PageContentSection } from '#uilib/components/ui/Page';
11
11
 
12
12
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
13
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
13
14
  import { DocsHeaderActions } from '../docsHeaderActions';
14
15
 
15
16
  export default function DropdownMenuPage() {
@@ -21,6 +22,21 @@ export default function DropdownMenuPage() {
21
22
  subheader="Context menu with items."
22
23
  actions={<DocsHeaderActions />}
23
24
  />
25
+ <DocsGuidance
26
+ overview="DropdownMenu displays a list of actions or options in a floating panel opened from a trigger, typically a button. Group related items with DropdownMenuLabel and DropdownMenuSeparator, and handle each action in onSelect."
27
+ whenToUse={[
28
+ 'To collect secondary actions behind a single trigger, such as an overflow or kebab menu.',
29
+ 'When a row, card, or toolbar offers several contextual actions that would crowd the layout as buttons.',
30
+ ]}
31
+ whenNotToUse={[
32
+ 'To choose a value for a form field; use Select or Combobox instead.',
33
+ 'When there are only one or two actions; show them as buttons directly.',
34
+ ]}
35
+ doNotes={[
36
+ 'Order items by expected frequency of use and separate destructive actions from the rest.',
37
+ 'Keep item labels short and verb-led, such as “Rename” or “Delete”.',
38
+ ]}
39
+ />
24
40
  <PageContentSection>
25
41
  <DropdownMenu>
26
42
  <DropdownMenuTrigger asChild>
@@ -2,6 +2,7 @@ import { FileChip } from '#uilib/components/ui/FileChip';
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
  const LONG_NAME =
@@ -16,6 +17,22 @@ export default function FileChipPage() {
16
17
  subheader="Compact file row for chat attachments and downloadable CSV presets."
17
18
  actions={<DocsHeaderActions />}
18
19
  />
20
+ <DocsGuidance
21
+ overview="FileChip is a compact row that represents a file with a format icon, name, and hint text. It supports an onClick handler for downloadable files and an onRemove handler for detachable attachments, and truncates long file names gracefully."
22
+ whenToUse={[
23
+ 'To show attachments in a chat composer or message, with a remove control.',
24
+ 'To offer downloadable files, such as CSV presets, where clicking the chip starts the download.',
25
+ 'Anywhere a full file card would be too heavy and only the name and format matter.',
26
+ ]}
27
+ whenNotToUse={[
28
+ 'As the upload control itself; use DropZone or a file input to collect the file first.',
29
+ 'For rich file previews with thumbnails or metadata; use a card layout instead.',
30
+ ]}
31
+ doNotes={[
32
+ 'Set the hint to describe the action, such as “Download CSV file”, so the affordance is clear.',
33
+ 'Pass the correct format so the chip shows the right icon for the file type.',
34
+ ]}
35
+ />
19
36
  <PageContentSection
20
37
  style={{
21
38
  display: 'flex',
@@ -2,6 +2,7 @@ import { FlickeringGrid } from '#uilib/components/ui/FlickeringGrid';
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 FlickeringGridPage() {
@@ -13,6 +14,20 @@ export default function FlickeringGridPage() {
13
14
  subheader="Decorative animated grid background."
14
15
  actions={<DocsHeaderActions />}
15
16
  />
17
+ <DocsGuidance
18
+ overview="FlickeringGrid is a purely decorative animated grid of squares that flicker at random. Place it behind content in a positioned container to add subtle visual texture to hero areas or empty states."
19
+ whenToUse={[
20
+ 'As a background flourish on landing, sign-in, or marketing-style surfaces.',
21
+ 'To add ambient motion to an otherwise static empty state.',
22
+ ]}
23
+ whenNotToUse={[
24
+ 'Behind dense data displays such as charts or tables, where motion competes with the content.',
25
+ 'When users may prefer reduced motion; avoid relying on it to convey any meaning.',
26
+ ]}
27
+ dontNotes={[
28
+ 'Do not attach interactive behaviour to the grid; it is decoration only.',
29
+ ]}
30
+ />
16
31
  <PageContentSection
17
32
  style={{ height: 200, position: 'relative', overflow: 'hidden' }}
18
33
  >