@sybilion/uilib 1.3.93 → 1.3.96
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/components/widgets/PerformanceChart/PerformanceChart.styl.js +2 -2
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +5 -5
- 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 +37 -19
- 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/components/widgets/PerformanceChart/PerformanceChart.styl +3 -0
- package/src/components/widgets/PerformanceChart/PerformanceChart.styl.d.ts +1 -0
- package/src/components/widgets/PerformanceChart/PerformanceTable.tsx +8 -8
- 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 +134 -22
- 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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { ChartConfig } from '#uilib/components/ui/Chart';
|
|
5
|
+
import {
|
|
6
|
+
ChartContainer,
|
|
7
|
+
ChartLegend,
|
|
8
|
+
ChartLegendContent,
|
|
9
|
+
ChartTooltip,
|
|
10
|
+
ChartTooltipContent,
|
|
11
|
+
} from '#uilib/components/ui/Chart';
|
|
12
|
+
import { getChartSeriesColor } from '#uilib/components/ui/Chart/chartSeriesPalette';
|
|
13
|
+
import { Cell, Label, Pie, PieChart } from 'recharts';
|
|
14
|
+
import type { ViewBox } from 'recharts/types/util/types';
|
|
15
|
+
|
|
16
|
+
import S from './DonutChart.styl';
|
|
17
|
+
import { DonutChartDatum, DonutChartProps } from './DonutChart.types';
|
|
18
|
+
|
|
19
|
+
function buildChartConfig(data: DonutChartDatum[]): ChartConfig {
|
|
20
|
+
const config: ChartConfig = {};
|
|
21
|
+
|
|
22
|
+
data.forEach((datum, index) => {
|
|
23
|
+
config[datum.key] = {
|
|
24
|
+
label: datum.label ?? datum.key,
|
|
25
|
+
color: datum.color ?? getChartSeriesColor(index),
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return config;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const DonutChart = forwardRef<HTMLDivElement, DonutChartProps>(
|
|
33
|
+
(
|
|
34
|
+
{
|
|
35
|
+
className,
|
|
36
|
+
data,
|
|
37
|
+
innerRadius = '62%',
|
|
38
|
+
outerRadius = '85%',
|
|
39
|
+
centerValue,
|
|
40
|
+
centerCaption,
|
|
41
|
+
showLegend = true,
|
|
42
|
+
showTooltip = true,
|
|
43
|
+
height,
|
|
44
|
+
...props
|
|
45
|
+
},
|
|
46
|
+
ref,
|
|
47
|
+
) => {
|
|
48
|
+
const config = useMemo(() => buildChartConfig(data), [data]);
|
|
49
|
+
|
|
50
|
+
const renderCenterLabel = ({ viewBox }: { viewBox?: ViewBox }) => {
|
|
51
|
+
if (centerValue === undefined || !viewBox || !('cx' in viewBox)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const { cx, cy } = viewBox;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<text x={cx} y={cy} textAnchor="middle" dominantBaseline="middle">
|
|
59
|
+
<tspan x={cx} y={cy} className={S.centerValue}>
|
|
60
|
+
{centerValue}
|
|
61
|
+
</tspan>
|
|
62
|
+
{centerCaption && (
|
|
63
|
+
<tspan x={cx} y={cy + 22} className={S.centerCaption}>
|
|
64
|
+
{centerCaption}
|
|
65
|
+
</tspan>
|
|
66
|
+
)}
|
|
67
|
+
</text>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<div ref={ref} className={cn(S.root, className)} {...props}>
|
|
73
|
+
<ChartContainer
|
|
74
|
+
config={config}
|
|
75
|
+
className={S.chart}
|
|
76
|
+
style={height ? { height: `${height}px` } : undefined}
|
|
77
|
+
>
|
|
78
|
+
<PieChart accessibilityLayer>
|
|
79
|
+
{showTooltip && (
|
|
80
|
+
<ChartTooltip
|
|
81
|
+
cursor={false}
|
|
82
|
+
content={<ChartTooltipContent nameKey="key" hideLabel />}
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
85
|
+
<Pie
|
|
86
|
+
data={data}
|
|
87
|
+
dataKey="value"
|
|
88
|
+
nameKey="key"
|
|
89
|
+
innerRadius={innerRadius}
|
|
90
|
+
outerRadius={outerRadius}
|
|
91
|
+
strokeWidth={1}
|
|
92
|
+
>
|
|
93
|
+
{data.map(datum => (
|
|
94
|
+
<Cell key={datum.key} fill={`var(--color-${datum.key})`} />
|
|
95
|
+
))}
|
|
96
|
+
{centerValue !== undefined && (
|
|
97
|
+
<Label content={renderCenterLabel} />
|
|
98
|
+
)}
|
|
99
|
+
</Pie>
|
|
100
|
+
{showLegend && (
|
|
101
|
+
<ChartLegend content={<ChartLegendContent nameKey="key" />} />
|
|
102
|
+
)}
|
|
103
|
+
</PieChart>
|
|
104
|
+
</ChartContainer>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
DonutChart.displayName = 'DonutChart';
|
|
111
|
+
|
|
112
|
+
export { DonutChart };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DonutChartDatum {
|
|
4
|
+
/** Unique slice key; used for tooltip/legend label lookups. */
|
|
5
|
+
key: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Human-readable label; falls back to the key. */
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
/** CSS colour; falls back to the built-in series palette. */
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DonutChartProps extends Omit<
|
|
14
|
+
HTMLAttributes<HTMLDivElement>,
|
|
15
|
+
'children'
|
|
16
|
+
> {
|
|
17
|
+
data: DonutChartDatum[];
|
|
18
|
+
/** Radius of the donut hole; px number or percentage string. */
|
|
19
|
+
innerRadius?: number | string;
|
|
20
|
+
/** Outer radius of the donut; px number or percentage string. */
|
|
21
|
+
outerRadius?: number | string;
|
|
22
|
+
/** Large figure rendered in the centre of the donut hole. */
|
|
23
|
+
centerValue?: string | number;
|
|
24
|
+
/** Small caption rendered under the centre value. */
|
|
25
|
+
centerCaption?: string;
|
|
26
|
+
showLegend?: boolean;
|
|
27
|
+
showTooltip?: boolean;
|
|
28
|
+
/** Fixed chart height in px; defaults to a square capped at 320px. */
|
|
29
|
+
height?: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import S from './Kicker.styl';
|
|
4
|
+
import { KickerProps } from './Kicker.types';
|
|
5
|
+
|
|
6
|
+
function Kicker({ className, dash = false, children, ...props }: KickerProps) {
|
|
7
|
+
return (
|
|
8
|
+
<div data-slot="kicker" className={cn(S.root, className)} {...props}>
|
|
9
|
+
{dash && <span aria-hidden="true">{'\u2014 '}</span>}
|
|
10
|
+
{children}
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Kicker };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.root
|
|
2
|
+
border-left 2px solid var(--sb-cyan-400)
|
|
3
|
+
padding 6px 0 6px 20px
|
|
4
|
+
|
|
5
|
+
.body
|
|
6
|
+
font-family var(--font-family-heading)
|
|
7
|
+
font-size var(--text-2xl)
|
|
8
|
+
line-height 1.25
|
|
9
|
+
font-weight 400
|
|
10
|
+
letter-spacing var(--tracking-heading)
|
|
11
|
+
color var(--sb-slate-800)
|
|
12
|
+
text-wrap pretty
|
|
13
|
+
|
|
14
|
+
:global(.dark) &
|
|
15
|
+
color var(--sb-slate-200)
|
|
16
|
+
|
|
17
|
+
// Small text — Manrope, sentence case, zero tracking
|
|
18
|
+
.attribution
|
|
19
|
+
margin-top var(--p-4)
|
|
20
|
+
font-family var(--font-family-body)
|
|
21
|
+
font-size var(--text-xs)
|
|
22
|
+
font-weight 500
|
|
23
|
+
letter-spacing var(--tracking-body)
|
|
24
|
+
color var(--sb-slate-800)
|
|
25
|
+
|
|
26
|
+
:global(.dark) &
|
|
27
|
+
color var(--sb-slate-300)
|
|
28
|
+
|
|
29
|
+
.role
|
|
30
|
+
margin-left 6px
|
|
31
|
+
font-weight 400
|
|
32
|
+
color var(--sb-slate-500)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import S from './PullQuote.styl';
|
|
4
|
+
import { PullQuoteProps } from './PullQuote.types';
|
|
5
|
+
|
|
6
|
+
function PullQuote({
|
|
7
|
+
className,
|
|
8
|
+
attribution,
|
|
9
|
+
attributionRole,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}: PullQuoteProps) {
|
|
13
|
+
return (
|
|
14
|
+
<figure data-slot="pull-quote" className={cn(S.root, className)} {...props}>
|
|
15
|
+
<blockquote className={S.body}>{children}</blockquote>
|
|
16
|
+
{attribution != null && (
|
|
17
|
+
<figcaption className={S.attribution}>
|
|
18
|
+
{attribution}
|
|
19
|
+
{attributionRole != null && (
|
|
20
|
+
<span className={S.role}>
|
|
21
|
+
{'\u00b7 '}
|
|
22
|
+
{attributionRole}
|
|
23
|
+
</span>
|
|
24
|
+
)}
|
|
25
|
+
</figcaption>
|
|
26
|
+
)}
|
|
27
|
+
</figure>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { PullQuote };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PullQuoteProps extends ComponentProps<'figure'> {
|
|
4
|
+
/** Name of the person quoted. */
|
|
5
|
+
attribution?: ReactNode;
|
|
6
|
+
/** Role or affiliation shown after the attribution, sentence case. */
|
|
7
|
+
attributionRole?: ReactNode;
|
|
8
|
+
}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
overflow hidden
|
|
11
11
|
|
|
12
12
|
padding var(--p-1) var(--p-3)
|
|
13
|
-
// Match
|
|
14
|
-
border-radius var(--
|
|
13
|
+
// Match Input styling
|
|
14
|
+
border-radius var(--radius-input)
|
|
15
15
|
border none
|
|
16
16
|
box-shadow none
|
|
17
17
|
background-color var(--background)
|
|
@@ -46,26 +46,33 @@
|
|
|
46
46
|
box-shadow 0 0 0 2px var(--background)
|
|
47
47
|
// color var(--muted-foreground)
|
|
48
48
|
|
|
49
|
-
&[data-size="
|
|
49
|
+
&[data-size="xs"]
|
|
50
50
|
height auto
|
|
51
51
|
min-height 28px
|
|
52
|
-
padding 0
|
|
52
|
+
padding 0 10px
|
|
53
53
|
border-radius var(--p-4)
|
|
54
54
|
font-size var(--text-xs)
|
|
55
55
|
|
|
56
|
+
&[data-size="sm"]
|
|
57
|
+
height auto
|
|
58
|
+
min-height 32px
|
|
59
|
+
padding 0 14px
|
|
60
|
+
border-radius var(--radius-3)
|
|
61
|
+
font-size 13px
|
|
62
|
+
|
|
56
63
|
&[data-size="md"]
|
|
57
64
|
height auto
|
|
58
65
|
min-height 40px
|
|
59
|
-
padding
|
|
60
|
-
border-radius var(--
|
|
66
|
+
padding 11px 14px
|
|
67
|
+
border-radius var(--radius-input)
|
|
61
68
|
font-size var(--text-sm)
|
|
62
69
|
|
|
63
70
|
&[data-size="lg"]
|
|
64
71
|
height auto
|
|
65
|
-
min-height
|
|
72
|
+
min-height 48px
|
|
66
73
|
padding var(--p-4) var(--p-6)
|
|
67
|
-
border-radius var(--
|
|
68
|
-
font-size var(--text-
|
|
74
|
+
border-radius var(--radius-4)
|
|
75
|
+
font-size var(--text-base)
|
|
69
76
|
|
|
70
77
|
&[data-placeholder]
|
|
71
78
|
color var(--muted-foreground)
|
|
@@ -128,7 +135,7 @@
|
|
|
128
135
|
max-height var(--radix-select-content-available-height)
|
|
129
136
|
// Match Tooltip tooltipContent styling
|
|
130
137
|
background-color var(--popover)
|
|
131
|
-
border-radius var(--
|
|
138
|
+
border-radius var(--radius-input)
|
|
132
139
|
box-shadow 0 10px 15px -3px rgba(0, 0, 0, 0.1)
|
|
133
140
|
border 1px solid var(--border)
|
|
134
141
|
color var(--popover-foreground)
|
|
@@ -203,12 +210,12 @@
|
|
|
203
210
|
background-color var(--accent)
|
|
204
211
|
|
|
205
212
|
&:first-child
|
|
206
|
-
border-top-left-radius var(--
|
|
207
|
-
border-top-right-radius var(--
|
|
213
|
+
border-top-left-radius var(--radius-md)
|
|
214
|
+
border-top-right-radius var(--radius-md)
|
|
208
215
|
|
|
209
216
|
&:last-child
|
|
210
|
-
border-bottom-left-radius var(--
|
|
211
|
-
border-bottom-right-radius var(--
|
|
217
|
+
border-bottom-left-radius var(--radius-md)
|
|
218
|
+
border-bottom-right-radius var(--radius-md)
|
|
212
219
|
|
|
213
220
|
&:focus
|
|
214
221
|
background-color var(--accent)
|
|
@@ -3,7 +3,7 @@ import * as SelectPrimitive from '@radix-ui/react-select';
|
|
|
3
3
|
export interface SelectTriggerProps extends React.ComponentProps<
|
|
4
4
|
typeof SelectPrimitive.Trigger
|
|
5
5
|
> {
|
|
6
|
-
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
7
7
|
variant?: 'default' | 'clear';
|
|
8
8
|
darker?: boolean;
|
|
9
9
|
className?: string;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.root
|
|
2
|
+
gap 14px
|
|
3
|
+
padding var(--p-5)
|
|
4
|
+
box-shadow none
|
|
5
|
+
transition border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard)
|
|
6
|
+
|
|
7
|
+
&:hover
|
|
8
|
+
border-color var(--muted-border)
|
|
9
|
+
box-shadow var(--shadow-2)
|
|
10
|
+
|
|
11
|
+
.head
|
|
12
|
+
align-items center
|
|
13
|
+
gap 12px
|
|
14
|
+
justify-content flex-start
|
|
15
|
+
|
|
16
|
+
.headText
|
|
17
|
+
display flex
|
|
18
|
+
flex-direction column
|
|
19
|
+
gap 2px
|
|
20
|
+
min-width 0
|
|
21
|
+
|
|
22
|
+
.title
|
|
23
|
+
font-family var(--font-family-body)
|
|
24
|
+
font-size var(--text-base)
|
|
25
|
+
font-weight 600
|
|
26
|
+
line-height normal
|
|
27
|
+
color var(--sb-slate-900)
|
|
28
|
+
|
|
29
|
+
:global(.dark) &
|
|
30
|
+
color var(--sb-slate-100)
|
|
31
|
+
|
|
32
|
+
.subtitle
|
|
33
|
+
font-family var(--font-family-body)
|
|
34
|
+
font-size 13px
|
|
35
|
+
color var(--sb-slate-500)
|
|
36
|
+
|
|
37
|
+
:global(.dark) &
|
|
38
|
+
color var(--sb-slate-400)
|
|
39
|
+
|
|
40
|
+
.content
|
|
41
|
+
display flex
|
|
42
|
+
flex-direction column
|
|
43
|
+
gap 14px
|
|
44
|
+
|
|
45
|
+
// Numeric block — Manrope only, weight carries the emphasis
|
|
46
|
+
.figure
|
|
47
|
+
display flex
|
|
48
|
+
align-items baseline
|
|
49
|
+
gap 6px
|
|
50
|
+
font-family var(--font-family-body)
|
|
51
|
+
color var(--sb-slate-900)
|
|
52
|
+
|
|
53
|
+
:global(.dark) &
|
|
54
|
+
color var(--sb-slate-100)
|
|
55
|
+
|
|
56
|
+
.value
|
|
57
|
+
font-size var(--text-4xl)
|
|
58
|
+
font-weight 500
|
|
59
|
+
letter-spacing -0.05em
|
|
60
|
+
line-height 42px
|
|
61
|
+
|
|
62
|
+
.unit
|
|
63
|
+
font-size var(--text-base)
|
|
64
|
+
font-weight 500
|
|
65
|
+
letter-spacing var(--tracking-display)
|
|
66
|
+
color var(--sb-slate-800)
|
|
67
|
+
|
|
68
|
+
:global(.dark) &
|
|
69
|
+
color var(--sb-slate-300)
|
|
70
|
+
|
|
71
|
+
.tolerance
|
|
72
|
+
font-size var(--text-base)
|
|
73
|
+
font-weight 400
|
|
74
|
+
letter-spacing var(--tracking-display)
|
|
75
|
+
color var(--sb-slate-700)
|
|
76
|
+
|
|
77
|
+
:global(.dark) &
|
|
78
|
+
color var(--sb-slate-400)
|
|
79
|
+
|
|
80
|
+
.body
|
|
81
|
+
font-family var(--font-family-body)
|
|
82
|
+
font-size var(--text-sm)
|
|
83
|
+
line-height 1.5
|
|
84
|
+
color var(--sb-slate-800)
|
|
85
|
+
|
|
86
|
+
:global(.dark) &
|
|
87
|
+
color var(--sb-slate-300)
|
|
88
|
+
|
|
89
|
+
.sparkline
|
|
90
|
+
display flex
|
|
91
|
+
min-width 0
|
|
92
|
+
|
|
93
|
+
.foot
|
|
94
|
+
align-items baseline
|
|
95
|
+
justify-content flex-start
|
|
96
|
+
gap 12px
|
|
97
|
+
font-family var(--font-family-body)
|
|
98
|
+
font-size 13px
|
|
99
|
+
|
|
100
|
+
.dim
|
|
101
|
+
color var(--sb-slate-500)
|
|
102
|
+
|
|
103
|
+
:global(.dark) &
|
|
104
|
+
color var(--sb-slate-400)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// This file is automatically generated.
|
|
2
|
+
// Please do not change this file!
|
|
3
|
+
interface CssExports {
|
|
4
|
+
'body': string;
|
|
5
|
+
'content': string;
|
|
6
|
+
'dim': string;
|
|
7
|
+
'figure': string;
|
|
8
|
+
'foot': string;
|
|
9
|
+
'head': string;
|
|
10
|
+
'headText': string;
|
|
11
|
+
'root': string;
|
|
12
|
+
'sparkline': string;
|
|
13
|
+
'subtitle': string;
|
|
14
|
+
'title': string;
|
|
15
|
+
'tolerance': string;
|
|
16
|
+
'unit': string;
|
|
17
|
+
'value': string;
|
|
18
|
+
}
|
|
19
|
+
export const cssExports: CssExports;
|
|
20
|
+
export default cssExports;
|
|
@@ -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
|
+
}
|