@sybilion/uilib 1.3.93 → 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.
- package/assets/globals.css +98 -0
- package/dist/esm/components/ui/Badge/Badge.styl.js +1 -1
- package/dist/esm/components/ui/BarChart/BarChart.js +32 -0
- package/dist/esm/components/ui/BarChart/BarChart.styl.js +7 -0
- package/dist/esm/components/ui/Button/Button.js +1 -1
- package/dist/esm/components/ui/Button/Button.styl.js +1 -1
- package/dist/esm/components/ui/Card/Card.styl.js +1 -1
- package/dist/esm/components/ui/Chart/Chart.helpers.js +15 -3
- package/dist/esm/components/ui/Chart/chartSeriesPalette.js +17 -0
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.js +2 -2
- package/dist/esm/components/ui/Checkbox/Checkbox.styl.js +1 -1
- package/dist/esm/components/ui/Chip/Chip.js +12 -0
- package/dist/esm/components/ui/Chip/Chip.styl.js +7 -0
- package/dist/esm/components/ui/DonutChart/DonutChart.js +35 -0
- package/dist/esm/components/ui/DonutChart/DonutChart.styl.js +7 -0
- package/dist/esm/components/ui/Input/Input.styl.js +1 -1
- package/dist/esm/components/ui/Kicker/Kicker.js +9 -0
- package/dist/esm/components/ui/Kicker/Kicker.styl.js +7 -0
- package/dist/esm/components/ui/LabeledInput/LabeledInput.styl.js +1 -1
- package/dist/esm/components/ui/PullQuote/PullQuote.js +9 -0
- package/dist/esm/components/ui/PullQuote/PullQuote.styl.js +7 -0
- package/dist/esm/components/ui/Select/Select.styl.js +1 -1
- package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +1 -1
- package/dist/esm/components/ui/SignalCard/SignalCard.js +17 -0
- package/dist/esm/components/ui/SignalCard/SignalCard.styl.js +7 -0
- package/dist/esm/components/ui/Switch/Switch.styl.js +1 -1
- package/dist/esm/components/ui/Table/Table.js +4 -4
- package/dist/esm/components/ui/Table/Table.styl.js +2 -2
- package/dist/esm/components/ui/Tooltip/Tooltip.styl.js +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/types/src/components/ui/BarChart/BarChart.d.ts +3 -0
- package/dist/esm/types/src/components/ui/BarChart/BarChart.types.d.ts +28 -0
- package/dist/esm/types/src/components/ui/BarChart/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/chartSeriesPalette.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Chip/Chip.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Chip/Chip.types.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Chip/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/DonutChart/DonutChart.d.ts +3 -0
- package/dist/esm/types/src/components/ui/DonutChart/DonutChart.types.d.ts +25 -0
- package/dist/esm/types/src/components/ui/DonutChart/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Kicker/Kicker.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Kicker/Kicker.types.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Kicker/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/PullQuote/PullQuote.d.ts +3 -0
- package/dist/esm/types/src/components/ui/PullQuote/PullQuote.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/PullQuote/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +1 -1
- package/dist/esm/types/src/components/ui/SignalCard/SignalCard.d.ts +3 -0
- package/dist/esm/types/src/components/ui/SignalCard/SignalCard.types.d.ts +23 -0
- package/dist/esm/types/src/components/ui/SignalCard/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Table/Table.d.ts +2 -5
- package/dist/esm/types/src/components/ui/Table/Table.types.d.ts +4 -1
- package/dist/esm/types/src/components/ui/Table/index.d.ts +1 -1
- package/dist/esm/types/src/docs/components/DocsGuidance/DocsGuidance.d.ts +14 -0
- package/dist/esm/types/src/docs/pages/BarChartPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ChipPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ColorsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/DonutChartPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/IconsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/KickerPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/MotionPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/PullQuotePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/RadiiShadowsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SignalCardPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SpacingPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TypographyPage.d.ts +1 -0
- package/dist/esm/types/src/docs/registry.d.ts +1 -1
- package/dist/esm/types/src/index.d.ts +6 -0
- package/dist/esm/types/tests/charts.test.d.ts +1 -0
- package/dist/esm/types/tests/chip.test.d.ts +1 -0
- package/dist/esm/types/tests/componentsSmoke.test.d.ts +1 -0
- package/dist/esm/types/tests/docsRegistry.test.d.ts +1 -0
- package/dist/esm/types/tests/iconsPageFilter.test.d.ts +1 -0
- package/dist/esm/types/tests/mocks/homecodeUiMock.d.ts +32 -1
- package/dist/esm/types/tests/mocks/lightweightChartsMock.d.ts +29 -0
- package/dist/esm/types/tests/pullQuoteKicker.test.d.ts +1 -0
- package/dist/esm/types/tests/signalCard.test.d.ts +1 -0
- package/dist/esm/types/tests/tokenSync.test.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/Badge/Badge.styl +4 -4
- package/src/components/ui/BarChart/BarChart.styl +2 -0
- package/src/components/ui/BarChart/BarChart.styl.d.ts +7 -0
- package/src/components/ui/BarChart/BarChart.tsx +142 -0
- package/src/components/ui/BarChart/BarChart.types.ts +36 -0
- package/src/components/ui/BarChart/index.ts +2 -0
- package/src/components/ui/Button/Button.styl +30 -28
- package/src/components/ui/Button/Button.tsx +2 -1
- package/src/components/ui/Card/Card.styl +4 -3
- package/src/components/ui/Chart/Chart.helpers.ts +17 -3
- package/src/components/ui/Chart/chartSeriesPalette.ts +16 -0
- package/src/components/ui/Chat/ChatSheet/ChatSelector.tsx +2 -2
- package/src/components/ui/Checkbox/Checkbox.styl +1 -1
- package/src/components/ui/Chip/Chip.styl +78 -0
- package/src/components/ui/Chip/Chip.styl.d.ts +16 -0
- package/src/components/ui/Chip/Chip.tsx +35 -0
- package/src/components/ui/Chip/Chip.types.ts +23 -0
- package/src/components/ui/Chip/index.ts +2 -0
- package/src/components/ui/DonutChart/DonutChart.styl +16 -0
- package/src/components/ui/DonutChart/DonutChart.styl.d.ts +10 -0
- package/src/components/ui/DonutChart/DonutChart.tsx +112 -0
- package/src/components/ui/DonutChart/DonutChart.types.ts +30 -0
- package/src/components/ui/DonutChart/index.ts +2 -0
- package/src/components/ui/Input/Input.styl +2 -2
- package/src/components/ui/Kicker/Kicker.styl +10 -0
- package/src/components/ui/Kicker/Kicker.styl.d.ts +7 -0
- package/src/components/ui/Kicker/Kicker.tsx +15 -0
- package/src/components/ui/Kicker/Kicker.types.ts +6 -0
- package/src/components/ui/Kicker/index.ts +2 -0
- package/src/components/ui/LabeledInput/LabeledInput.styl +4 -1
- package/src/components/ui/PullQuote/PullQuote.styl +32 -0
- package/src/components/ui/PullQuote/PullQuote.styl.d.ts +10 -0
- package/src/components/ui/PullQuote/PullQuote.tsx +31 -0
- package/src/components/ui/PullQuote/PullQuote.types.ts +8 -0
- package/src/components/ui/PullQuote/index.ts +2 -0
- package/src/components/ui/Select/Select.styl +21 -14
- package/src/components/ui/Select/Select.types.ts +1 -1
- package/src/components/ui/Sidebar/Sidebar.styl +1 -0
- package/src/components/ui/SignalCard/SignalCard.styl +104 -0
- package/src/components/ui/SignalCard/SignalCard.styl.d.ts +20 -0
- package/src/components/ui/SignalCard/SignalCard.tsx +87 -0
- package/src/components/ui/SignalCard/SignalCard.types.ts +24 -0
- package/src/components/ui/SignalCard/index.ts +2 -0
- package/src/components/ui/Switch/Switch.styl +7 -7
- package/src/components/ui/Table/Table.styl +26 -8
- package/src/components/ui/Table/Table.styl.d.ts +0 -1
- package/src/components/ui/Table/Table.tsx +5 -3
- package/src/components/ui/Table/Table.types.ts +8 -4
- package/src/components/ui/Table/index.ts +1 -1
- package/src/components/ui/Tooltip/Tooltip.styl +2 -2
- package/src/contexts/chatPersistence.test.ts +13 -2
- package/src/docs/components/DocsGuidance/DocsGuidance.styl +33 -0
- package/src/docs/components/DocsGuidance/DocsGuidance.styl.d.ts +11 -0
- package/src/docs/components/DocsGuidance/DocsGuidance.tsx +57 -0
- package/src/docs/pages/AnalysesSelectorPage.tsx +16 -0
- package/src/docs/pages/AnalysisLineIconPage.tsx +12 -0
- package/src/docs/pages/AvatarPage.tsx +15 -0
- package/src/docs/pages/BadgePage.tsx +16 -0
- package/src/docs/pages/BarChartPage.tsx +109 -0
- package/src/docs/pages/BreadcrumbPage.tsx +15 -0
- package/src/docs/pages/ButtonPage.tsx +17 -0
- package/src/docs/pages/CardPage.tsx +190 -17
- package/src/docs/pages/ChartAreaInteractivePage.tsx +24 -7
- package/src/docs/pages/ChartPage.tsx +14 -0
- package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +15 -0
- package/src/docs/pages/ChatComposerPrefillPage.tsx +15 -0
- package/src/docs/pages/ChatPage.tsx +15 -0
- package/src/docs/pages/ChatSheetPage.tsx +14 -0
- package/src/docs/pages/ChatSlashCommandsPage.tsx +15 -0
- package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +14 -0
- package/src/docs/pages/CheckboxPage.tsx +37 -4
- package/src/docs/pages/ChipPage.tsx +160 -0
- package/src/docs/pages/ColorsPage.styl +27 -0
- package/src/docs/pages/ColorsPage.styl.d.ts +12 -0
- package/src/docs/pages/ColorsPage.tsx +102 -0
- package/src/docs/pages/ConfirmPage.tsx +15 -0
- package/src/docs/pages/DialogPage.tsx +15 -0
- package/src/docs/pages/DonutChartPage.tsx +80 -0
- package/src/docs/pages/DrawerPage.tsx +17 -0
- package/src/docs/pages/DriverMapPage.tsx +17 -0
- package/src/docs/pages/DriversComparisonChartPage.tsx +17 -0
- package/src/docs/pages/DropZonePage.tsx +16 -0
- package/src/docs/pages/DropdownMenuPage.tsx +16 -0
- package/src/docs/pages/FileChipPage.tsx +17 -0
- package/src/docs/pages/FlickeringGridPage.tsx +15 -0
- package/src/docs/pages/FoldablePage.tsx +16 -0
- package/src/docs/pages/GridLayoutPage.tsx +16 -0
- package/src/docs/pages/IconsPage.styl +74 -0
- package/src/docs/pages/IconsPage.styl.d.ts +17 -0
- package/src/docs/pages/IconsPage.tsx +125 -0
- package/src/docs/pages/ImagePage.tsx +16 -0
- package/src/docs/pages/ImageWithFallbackPage.tsx +15 -0
- package/src/docs/pages/IncludeHiddenInYScalePage.tsx +14 -0
- package/src/docs/pages/InputPage.tsx +134 -19
- package/src/docs/pages/InteractiveContentPage.tsx +15 -0
- package/src/docs/pages/KickerPage.tsx +62 -0
- package/src/docs/pages/LabelPage.tsx +15 -0
- package/src/docs/pages/LabelWithIdPage.tsx +11 -0
- package/src/docs/pages/LabeledInputPage.tsx +12 -0
- package/src/docs/pages/LegacyPlatformLinkPage.tsx +15 -0
- package/src/docs/pages/LightweightChartPage.styl +0 -1
- package/src/docs/pages/LightweightChartPage.tsx +17 -0
- package/src/docs/pages/LogoPage.tsx +15 -0
- package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +15 -0
- package/src/docs/pages/MotionPage.styl +71 -0
- package/src/docs/pages/MotionPage.styl.d.ts +17 -0
- package/src/docs/pages/MotionPage.tsx +176 -0
- package/src/docs/pages/NavUserHeaderPage.tsx +15 -0
- package/src/docs/pages/NumberControlPage.tsx +15 -0
- package/src/docs/pages/PageColumnsPage.tsx +15 -0
- package/src/docs/pages/PageFooterPage.tsx +15 -0
- package/src/docs/pages/PagePage.tsx +15 -0
- package/src/docs/pages/PageTabsPage.tsx +18 -0
- package/src/docs/pages/PerformanceChartPage.tsx +15 -0
- package/src/docs/pages/ProgressPage.tsx +66 -3
- package/src/docs/pages/PullQuotePage.tsx +59 -0
- package/src/docs/pages/RadiiShadowsPage.styl +47 -0
- package/src/docs/pages/RadiiShadowsPage.styl.d.ts +14 -0
- package/src/docs/pages/RadiiShadowsPage.tsx +109 -0
- package/src/docs/pages/RegionCoordsPage.tsx +12 -0
- package/src/docs/pages/RenamerPage.tsx +15 -0
- package/src/docs/pages/SelectPage.tsx +160 -6
- package/src/docs/pages/SeparatorPage.tsx +12 -0
- package/src/docs/pages/SheetPage.tsx +15 -0
- package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +12 -0
- package/src/docs/pages/SidebarPage.tsx +15 -0
- package/src/docs/pages/SignalCardPage.tsx +126 -0
- package/src/docs/pages/SkeletonPage.tsx +16 -0
- package/src/docs/pages/SliderPage.tsx +70 -4
- package/src/docs/pages/SmartTextTruncatePage.styl +13 -0
- package/src/docs/pages/SmartTextTruncatePage.styl.d.ts +8 -0
- package/src/docs/pages/SmartTextTruncatePage.tsx +17 -4
- package/src/docs/pages/SpacingPage.styl +31 -0
- package/src/docs/pages/SpacingPage.styl.d.ts +12 -0
- package/src/docs/pages/SpacingPage.tsx +50 -0
- package/src/docs/pages/SparklinePage.tsx +15 -0
- package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +16 -0
- package/src/docs/pages/SwitchPage.tsx +147 -8
- package/src/docs/pages/SybilionAuthLayoutPage.tsx +15 -0
- package/src/docs/pages/TablePage.tsx +132 -20
- package/src/docs/pages/TabsPage.tsx +20 -0
- package/src/docs/pages/TextShimmerPage.tsx +12 -0
- package/src/docs/pages/TextWithDeferTooltipPage.tsx +15 -0
- package/src/docs/pages/TimeRangeControlsPage.tsx +15 -0
- package/src/docs/pages/ToggleGroupPage.tsx +15 -0
- package/src/docs/pages/TogglePage.tsx +13 -0
- package/src/docs/pages/TooltipPage.tsx +17 -0
- package/src/docs/pages/TypographyPage.styl +42 -0
- package/src/docs/pages/TypographyPage.styl.d.ts +12 -0
- package/src/docs/pages/TypographyPage.tsx +226 -0
- package/src/docs/pages/VimeoEmbedPage.tsx +12 -0
- package/src/docs/pages/WorldMapPage.tsx +12 -0
- package/src/docs/registry.ts +79 -0
- package/src/index.ts +6 -0
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
2
|
|
|
3
|
-
export
|
|
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'> {}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
width fit-content
|
|
6
6
|
min-width 100%
|
|
7
7
|
padding 6px 12px
|
|
8
|
-
border-radius var(--
|
|
8
|
+
border-radius var(--radius-4)
|
|
9
9
|
background-color var(--popover)
|
|
10
|
-
font-size
|
|
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('
|
|
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.
|
|
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
|
+
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
10
10
|
|
|
11
11
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
12
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
12
13
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
13
14
|
|
|
14
15
|
export default function BreadcrumbPage() {
|
|
@@ -20,6 +21,20 @@ export default function BreadcrumbPage() {
|
|
|
20
21
|
subheader="Inline navigation trail."
|
|
21
22
|
actions={<DocsHeaderActions />}
|
|
22
23
|
/>
|
|
24
|
+
<DocsGuidance
|
|
25
|
+
overview="Breadcrumb shows the user’s location within the page hierarchy as an inline trail of links, with the current page rendered as plain text. Compose it from BreadcrumbList, BreadcrumbItem, BreadcrumbLink, and BreadcrumbSeparator."
|
|
26
|
+
whenToUse={[
|
|
27
|
+
'On pages nested two or more levels deep, so users can move back up the hierarchy.',
|
|
28
|
+
'When users arrive deep in the product from search or a direct link and need orientation.',
|
|
29
|
+
]}
|
|
30
|
+
whenNotToUse={[
|
|
31
|
+
'On top-level pages with no parent; a trail with one item adds noise.',
|
|
32
|
+
'As a substitute for primary navigation or a stepper in a multi-step flow.',
|
|
33
|
+
]}
|
|
34
|
+
doNotes={[
|
|
35
|
+
'Render the current page with BreadcrumbPage rather than a link so it is not clickable.',
|
|
36
|
+
]}
|
|
37
|
+
/>
|
|
23
38
|
<PageContentSection>
|
|
24
39
|
<Breadcrumb>
|
|
25
40
|
<BreadcrumbList>
|
|
@@ -4,6 +4,7 @@ import { PageContentSection } from '#uilib/components/ui/Page';
|
|
|
4
4
|
import { Plus } from 'lucide-react';
|
|
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 VARIANTS: ButtonVariant[] = [
|
|
@@ -26,6 +27,22 @@ export default function ButtonPage() {
|
|
|
26
27
|
subheader="Variants, sizes, icon mode, and disabled state."
|
|
27
28
|
actions={<DocsHeaderActions />}
|
|
28
29
|
/>
|
|
30
|
+
<DocsGuidance
|
|
31
|
+
overview="Buttons trigger an action or event, such as submitting a form or confirming a dialog. Choose a variant that matches the weight of the action: default for the primary action, secondary or outline for supporting actions, ghost for low-emphasis actions, and destructive for irreversible ones."
|
|
32
|
+
whenToUse={[
|
|
33
|
+
'To trigger an immediate action, such as saving, submitting, or confirming.',
|
|
34
|
+
'To open a dialog, drawer, or other transient surface.',
|
|
35
|
+
'As the primary call to action in a form, card, or empty state.',
|
|
36
|
+
]}
|
|
37
|
+
whenNotToUse={[
|
|
38
|
+
'To navigate to another page; use a link or the link variant instead.',
|
|
39
|
+
'To switch between mutually exclusive options; use Tabs, Toggle, or ToggleGroup.',
|
|
40
|
+
]}
|
|
41
|
+
doNotes={[
|
|
42
|
+
'Use one default-variant button per view so the primary action stays clear.',
|
|
43
|
+
'Label buttons with a verb that describes the action, such as “Save changes”.',
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
29
46
|
<PageContentSection
|
|
30
47
|
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
31
48
|
>
|