@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
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '#uilib/components/ui/Sidebar/Sidebar';
|
|
8
8
|
|
|
9
9
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
10
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
10
11
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
11
12
|
|
|
12
13
|
export default function SidebarPage() {
|
|
@@ -18,6 +19,20 @@ export default function SidebarPage() {
|
|
|
18
19
|
subheader="Sidebar menu primitives (isolated preview)."
|
|
19
20
|
actions={<DocsHeaderActions />}
|
|
20
21
|
/>
|
|
22
|
+
<DocsGuidance
|
|
23
|
+
overview="Sidebar provides the primitives for building application navigation rails: SidebarGroup, SidebarMenu, SidebarMenuItem, and SidebarMenuButton. Compose them to create grouped menus with active-state styling."
|
|
24
|
+
whenToUse={[
|
|
25
|
+
'To build the primary navigation of an application shell.',
|
|
26
|
+
'When menu items need consistent hover, focus, and active styling on a sidebar surface.',
|
|
27
|
+
]}
|
|
28
|
+
whenNotToUse={[
|
|
29
|
+
'For in-page navigation such as tabs or table of contents; use PageTabs or links.',
|
|
30
|
+
'For contextual action menus; use DropdownMenu.',
|
|
31
|
+
]}
|
|
32
|
+
doNotes={[
|
|
33
|
+
'Mark the current route’s item with isActive so users can orient themselves.',
|
|
34
|
+
]}
|
|
35
|
+
/>
|
|
21
36
|
<PageContentSection>
|
|
22
37
|
<SidebarGroup
|
|
23
38
|
style={{
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Chip } from '#uilib/components/ui/Chip';
|
|
2
|
+
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
3
|
+
import { SignalCard } from '#uilib/components/ui/SignalCard';
|
|
4
|
+
import { Sparkline } from '#uilib/components/ui/Sparkline';
|
|
5
|
+
import { Activity, BarChart3, Clock, TrendingUp } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
8
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
9
|
+
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
10
|
+
|
|
11
|
+
const SPARK_DATA = [12, 14, 13, 16, 18, 17, 21, 20, 24, 23, 26, 28];
|
|
12
|
+
|
|
13
|
+
const GRID_STYLE = {
|
|
14
|
+
display: 'grid',
|
|
15
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))',
|
|
16
|
+
gap: '0.75rem',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export default function SignalCardPage() {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<AppPageHeader
|
|
23
|
+
breadcrumbs={[{ label: 'SignalCard' }]}
|
|
24
|
+
title="SignalCard"
|
|
25
|
+
subheader="Metric card with kicker, figure, delta chip, and sparkline slot."
|
|
26
|
+
actions={<DocsHeaderActions />}
|
|
27
|
+
/>
|
|
28
|
+
<DocsGuidance
|
|
29
|
+
overview="SignalCard is the product primitive for a single metric: an optional kicker and icon header, a large Manrope figure with unit and tolerance suffixes, body copy, a sparkline slot, and a footer with a delta indicator and muted meta items. Weight carries the emphasis in the numeric block, not colour."
|
|
30
|
+
whenToUse={[
|
|
31
|
+
'To present a forecast, spot price, or index value with its direction and confidence.',
|
|
32
|
+
'In a dashboard grid where each card answers one quantitative question.',
|
|
33
|
+
]}
|
|
34
|
+
whenNotToUse={[
|
|
35
|
+
'For general grouped content without a headline metric; use Card.',
|
|
36
|
+
'For dense tabular comparisons across many series; use Table.',
|
|
37
|
+
]}
|
|
38
|
+
doNotes={[
|
|
39
|
+
'Keep the footer meta short, such as horizon and confidence.',
|
|
40
|
+
'Pass a Chip with a status variant as the delta so direction reads at a glance.',
|
|
41
|
+
]}
|
|
42
|
+
/>
|
|
43
|
+
<PageContentSection
|
|
44
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
45
|
+
>
|
|
46
|
+
<section>
|
|
47
|
+
<h3 style={{ marginBottom: '1rem' }}>Forecast and spot cards</h3>
|
|
48
|
+
<div style={GRID_STYLE}>
|
|
49
|
+
<SignalCard
|
|
50
|
+
icon={<TrendingUp strokeWidth={1.5} />}
|
|
51
|
+
title="March 2025"
|
|
52
|
+
subtitle="Summary"
|
|
53
|
+
value="1.006"
|
|
54
|
+
unit="M"
|
|
55
|
+
tolerance="± 0.001"
|
|
56
|
+
description="If energy pressures, trade fragility, and climate disruptions persist, PVC additive demand is likely to remain flat or decline."
|
|
57
|
+
/>
|
|
58
|
+
<SignalCard
|
|
59
|
+
icon={<Activity strokeWidth={1.5} />}
|
|
60
|
+
title="Propylene · Rotterdam"
|
|
61
|
+
subtitle="Spot · 48h horizon"
|
|
62
|
+
value="€1,180"
|
|
63
|
+
unit="/t"
|
|
64
|
+
delta={
|
|
65
|
+
<Chip variant="positive" trend="up">
|
|
66
|
+
3.4%
|
|
67
|
+
</Chip>
|
|
68
|
+
}
|
|
69
|
+
meta={['48h', 'conf 0.82']}
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
<section>
|
|
74
|
+
<h3 style={{ marginBottom: '1rem' }}>Footer deltas</h3>
|
|
75
|
+
<div style={GRID_STYLE}>
|
|
76
|
+
<SignalCard
|
|
77
|
+
icon={<Clock strokeWidth={1.5} />}
|
|
78
|
+
title="Gas · TTF front-month"
|
|
79
|
+
subtitle="Continuous · 48h"
|
|
80
|
+
value="€42.1"
|
|
81
|
+
unit="/MWh"
|
|
82
|
+
delta={
|
|
83
|
+
<Chip variant="negative" trend="down">
|
|
84
|
+
1.2%
|
|
85
|
+
</Chip>
|
|
86
|
+
}
|
|
87
|
+
meta={['48h', 'conf 0.76']}
|
|
88
|
+
/>
|
|
89
|
+
<SignalCard
|
|
90
|
+
icon={<BarChart3 strokeWidth={1.5} />}
|
|
91
|
+
title="Freight · Baltic Dry"
|
|
92
|
+
subtitle="Index · daily"
|
|
93
|
+
value="1,642"
|
|
94
|
+
unit="pts"
|
|
95
|
+
delta={
|
|
96
|
+
<Chip variant="positive" trend="up">
|
|
97
|
+
0.9%
|
|
98
|
+
</Chip>
|
|
99
|
+
}
|
|
100
|
+
meta={['24h', 'conf 0.68']}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
<section>
|
|
105
|
+
<h3 style={{ marginBottom: '1rem' }}>Kicker and sparkline</h3>
|
|
106
|
+
<div style={GRID_STYLE}>
|
|
107
|
+
<SignalCard
|
|
108
|
+
kicker="Signal · active"
|
|
109
|
+
title="PVC additives"
|
|
110
|
+
subtitle="Demand index · weekly"
|
|
111
|
+
value="128.4"
|
|
112
|
+
unit="pts"
|
|
113
|
+
sparkline={<Sparkline data={SPARK_DATA} height={36} />}
|
|
114
|
+
delta={
|
|
115
|
+
<Chip variant="positive" trend="up">
|
|
116
|
+
2.1%
|
|
117
|
+
</Chip>
|
|
118
|
+
}
|
|
119
|
+
meta={['7d', 'conf 0.71']}
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
</PageContentSection>
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -2,6 +2,7 @@ import { PageContentSection } from '#uilib/components/ui/Page';
|
|
|
2
2
|
import { Skeleton } from '#uilib/components/ui/Skeleton';
|
|
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 SkeletonPage() {
|
|
@@ -13,6 +14,21 @@ export default function SkeletonPage() {
|
|
|
13
14
|
subheader="Loading placeholder."
|
|
14
15
|
actions={<DocsHeaderActions />}
|
|
15
16
|
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="Skeleton is a loading placeholder that reserves space for content while it loads. Compose simple shapes — lines and blocks — to mirror the layout of the content that will eventually appear."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'While fetching data for content whose layout is known in advance, such as cards, lists, or text blocks.',
|
|
21
|
+
'To reduce layout shift by holding the space the real content will occupy.',
|
|
22
|
+
'When loading takes long enough that an empty area would feel broken.',
|
|
23
|
+
]}
|
|
24
|
+
whenNotToUse={[
|
|
25
|
+
'For very fast operations where the skeleton would only flash briefly.',
|
|
26
|
+
'For indeterminate background work with no incoming content; use a spinner or progress indicator instead.',
|
|
27
|
+
]}
|
|
28
|
+
doNotes={[
|
|
29
|
+
'Match skeleton shapes to the dimensions of the real content so the swap feels seamless.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
16
32
|
<PageContentSection
|
|
17
33
|
style={{
|
|
18
34
|
display: 'flex',
|
|
@@ -4,8 +4,23 @@ import { PageContentSection } from '#uilib/components/ui/Page';
|
|
|
4
4
|
import { Slider } from '#uilib/components/ui/Slider';
|
|
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
|
|
|
10
|
+
const VALUE_DEMOS = [
|
|
11
|
+
{ label: '0%', value: 0 },
|
|
12
|
+
{ label: '50%', value: 50 },
|
|
13
|
+
{ label: '100%', value: 100 },
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
const RANGE_DEMOS = [
|
|
17
|
+
{ label: '0–100 (step 1)', min: 0, max: 100, step: 1, value: 40 },
|
|
18
|
+
{ label: '0–10 (step 1)', min: 0, max: 10, step: 1, value: 7 },
|
|
19
|
+
{ label: '0–1000 (step 100)', min: 0, max: 1000, step: 100, value: 500 },
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
const SLIDER_WIDTH = 280;
|
|
23
|
+
|
|
9
24
|
export default function SliderPage() {
|
|
10
25
|
const [v, setV] = useState([40]);
|
|
11
26
|
|
|
@@ -14,12 +29,63 @@ export default function SliderPage() {
|
|
|
14
29
|
<AppPageHeader
|
|
15
30
|
breadcrumbs={[{ label: 'Slider' }]}
|
|
16
31
|
title="Slider"
|
|
17
|
-
subheader="
|
|
32
|
+
subheader="Value positions, range configurations, and disabled state."
|
|
18
33
|
actions={<DocsHeaderActions />}
|
|
19
34
|
/>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
<DocsGuidance
|
|
36
|
+
overview="Slider lets users select a numeric value from a continuous or stepped range by dragging a thumb along a track. Control it with value and onValueChange, and constrain it with max and step."
|
|
37
|
+
whenToUse={[
|
|
38
|
+
'To adjust a value within a known range, such as volume, opacity, or a threshold.',
|
|
39
|
+
'When the approximate value matters more than a precise figure.',
|
|
40
|
+
'For filtering by a numeric range where immediate feedback is useful.',
|
|
41
|
+
]}
|
|
42
|
+
whenNotToUse={[
|
|
43
|
+
'When users need to enter an exact value; use a number input instead.',
|
|
44
|
+
'For ranges so large that fine control by dragging becomes impractical.',
|
|
45
|
+
]}
|
|
46
|
+
doNotes={[
|
|
47
|
+
'Display the current value next to the slider so users can see the effect of their adjustment.',
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
50
|
+
<PageContentSection
|
|
51
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
52
|
+
>
|
|
53
|
+
<section>
|
|
54
|
+
<h3 style={{ marginBottom: '1rem' }}>Interactive</h3>
|
|
55
|
+
<Slider
|
|
56
|
+
value={v}
|
|
57
|
+
onValueChange={setV}
|
|
58
|
+
max={100}
|
|
59
|
+
step={1}
|
|
60
|
+
style={{ width: SLIDER_WIDTH }}
|
|
61
|
+
/>
|
|
62
|
+
<p style={{ marginTop: 8, fontSize: 14 }}>Value: {v[0]}</p>
|
|
63
|
+
</section>
|
|
64
|
+
<section>
|
|
65
|
+
<h3 style={{ marginBottom: '1rem' }}>Disabled</h3>
|
|
66
|
+
<div
|
|
67
|
+
style={{
|
|
68
|
+
display: 'flex',
|
|
69
|
+
flexDirection: 'column',
|
|
70
|
+
gap: '0.75rem',
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<Slider
|
|
74
|
+
defaultValue={[25]}
|
|
75
|
+
max={100}
|
|
76
|
+
step={1}
|
|
77
|
+
disabled
|
|
78
|
+
style={{ width: SLIDER_WIDTH }}
|
|
79
|
+
/>
|
|
80
|
+
<Slider
|
|
81
|
+
defaultValue={[75]}
|
|
82
|
+
max={100}
|
|
83
|
+
step={1}
|
|
84
|
+
disabled
|
|
85
|
+
style={{ width: SLIDER_WIDTH }}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</section>
|
|
23
89
|
</PageContentSection>
|
|
24
90
|
</>
|
|
25
91
|
);
|
|
@@ -2,7 +2,9 @@ import { PageContentSection } from '#uilib/components/ui/Page';
|
|
|
2
2
|
import { SmartTextTruncate } from '#uilib/components/ui/SmartTextTruncate';
|
|
3
3
|
|
|
4
4
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
5
6
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
7
|
+
import S from './SmartTextTruncatePage.styl';
|
|
6
8
|
|
|
7
9
|
const LONG =
|
|
8
10
|
'Very-long-identifier-that-might-not-fit-in-a-narrow-container-without-smart-truncation';
|
|
@@ -16,10 +18,21 @@ export default function SmartTextTruncatePage() {
|
|
|
16
18
|
subheader="Smart ellipsis for long strings."
|
|
17
19
|
actions={<DocsHeaderActions />}
|
|
18
20
|
/>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
<DocsGuidance
|
|
22
|
+
overview="SmartTextTruncate shortens a long string in the middle so it fits its container, keeping the end of the string visible. This preserves distinguishing suffixes such as file extensions or trailing identifiers that a plain end ellipsis would hide."
|
|
23
|
+
whenToUse={[
|
|
24
|
+
'For long identifiers, file names, or paths where the ending carries meaning.',
|
|
25
|
+
'In narrow containers, such as table cells or sidebars, where strings of unpredictable length must fit on one line.',
|
|
26
|
+
]}
|
|
27
|
+
whenNotToUse={[
|
|
28
|
+
'For prose or sentences; standard end truncation reads more naturally.',
|
|
29
|
+
'When the full value must always be visible; let the text wrap instead.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
<PageContentSection>
|
|
33
|
+
<div className={S.resizableDemo}>
|
|
34
|
+
<SmartTextTruncate className={S.demoText}>{LONG}</SmartTextTruncate>
|
|
35
|
+
</div>
|
|
23
36
|
</PageContentSection>
|
|
24
37
|
</>
|
|
25
38
|
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.scale
|
|
2
|
+
display flex
|
|
3
|
+
flex-direction column
|
|
4
|
+
gap var(--p-2)
|
|
5
|
+
|
|
6
|
+
.row
|
|
7
|
+
display flex
|
|
8
|
+
align-items center
|
|
9
|
+
gap var(--p-4)
|
|
10
|
+
|
|
11
|
+
.token
|
|
12
|
+
font-family monospace
|
|
13
|
+
font-size var(--text-xs)
|
|
14
|
+
color var(--muted-foreground)
|
|
15
|
+
min-width 64px
|
|
16
|
+
user-select text
|
|
17
|
+
|
|
18
|
+
.bar
|
|
19
|
+
height 20px
|
|
20
|
+
background var(--brand-color-200)
|
|
21
|
+
border-radius var(--radius-1)
|
|
22
|
+
flex none
|
|
23
|
+
|
|
24
|
+
.value
|
|
25
|
+
font-size var(--text-xs)
|
|
26
|
+
color var(--muted-foreground)
|
|
27
|
+
white-space nowrap
|
|
28
|
+
|
|
29
|
+
.sectionNote
|
|
30
|
+
margin-bottom var(--p-3)
|
|
31
|
+
color var(--muted-foreground)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file is automatically generated.
|
|
2
|
+
// Please do not change this file!
|
|
3
|
+
interface CssExports {
|
|
4
|
+
'bar': string;
|
|
5
|
+
'row': string;
|
|
6
|
+
'scale': string;
|
|
7
|
+
'sectionNote': string;
|
|
8
|
+
'token': string;
|
|
9
|
+
'value': string;
|
|
10
|
+
}
|
|
11
|
+
export const cssExports: CssExports;
|
|
12
|
+
export default cssExports;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 './SpacingPage.styl';
|
|
7
|
+
|
|
8
|
+
/** Steps defined in globals.css; each step is 4px. */
|
|
9
|
+
const STEPS = [
|
|
10
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 23, 24,
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export default function SpacingPage() {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<AppPageHeader
|
|
17
|
+
breadcrumbs={[{ label: 'Spacing' }]}
|
|
18
|
+
title="Spacing"
|
|
19
|
+
subheader="The --p-* scale — a 4px-based rhythm for padding, gaps, and margins."
|
|
20
|
+
actions={<DocsHeaderActions />}
|
|
21
|
+
/>
|
|
22
|
+
<DocsGuidance
|
|
23
|
+
overview="The --p-* tokens are the canonical spacing scale: each step is a multiple of 4px, from --p-1 (4px) up to --p-24 (96px). Use them for padding, gaps, and margins instead of raw pixel values, so layouts share the same rhythm everywhere."
|
|
24
|
+
whenToUse={[
|
|
25
|
+
'Gaps and padding inside components and page sections.',
|
|
26
|
+
'Vertical rhythm between sections, cards, and form fields.',
|
|
27
|
+
]}
|
|
28
|
+
whenNotToUse={[
|
|
29
|
+
'One-off pixel values that sit between steps; pick the nearest token instead.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
<PageContentSection>
|
|
33
|
+
<h3>Scale</h3>
|
|
34
|
+
<p className={S.sectionNote}>
|
|
35
|
+
Bar length equals the token value. Steps 13–15 and 21–22 are
|
|
36
|
+
intentionally not defined.
|
|
37
|
+
</p>
|
|
38
|
+
<div className={S.scale}>
|
|
39
|
+
{STEPS.map(step => (
|
|
40
|
+
<div key={step} className={S.row}>
|
|
41
|
+
<span className={S.token}>--p-{step}</span>
|
|
42
|
+
<div className={S.bar} style={{ width: `var(--p-${step})` }} />
|
|
43
|
+
<span className={S.value}>{step * 4}px</span>
|
|
44
|
+
</div>
|
|
45
|
+
))}
|
|
46
|
+
</div>
|
|
47
|
+
</PageContentSection>
|
|
48
|
+
</>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -2,6 +2,7 @@ import { PageContentSection } from '#uilib/components/ui/Page';
|
|
|
2
2
|
import { Sparkline } from '#uilib/components/ui/Sparkline';
|
|
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 DATA = [2, 5, 3, 8, 6, 9, 7, 10];
|
|
@@ -15,6 +16,20 @@ export default function SparklinePage() {
|
|
|
15
16
|
subheader="Compact line chart."
|
|
16
17
|
actions={<DocsHeaderActions />}
|
|
17
18
|
/>
|
|
19
|
+
<DocsGuidance
|
|
20
|
+
overview="Sparkline renders a compact line chart from an array of numbers, sized to fit inline alongside text or inside table cells and cards. Use showEndDot to emphasise the most recent value."
|
|
21
|
+
whenToUse={[
|
|
22
|
+
'To show the trend of a metric at a glance, such as price or activity over time.',
|
|
23
|
+
'Inside dense layouts — table rows, KPI cards, or list items — where a full chart would not fit.',
|
|
24
|
+
]}
|
|
25
|
+
whenNotToUse={[
|
|
26
|
+
'When users need axes, labels, or precise values; use a full chart component instead.',
|
|
27
|
+
'For comparing many series against each other; sparklines carry no scale.',
|
|
28
|
+
]}
|
|
29
|
+
doNotes={[
|
|
30
|
+
'Pair the sparkline with the current value or a delta so the trend has context.',
|
|
31
|
+
]}
|
|
32
|
+
/>
|
|
18
33
|
<PageContentSection>
|
|
19
34
|
<Sparkline data={DATA} width={120} height={36} showEndDot />
|
|
20
35
|
</PageContentSection>
|
|
@@ -24,6 +24,7 @@ import { GearSixIcon, UserCircleIcon } from '@phosphor-icons/react';
|
|
|
24
24
|
import { House } from 'lucide-react';
|
|
25
25
|
|
|
26
26
|
import { AppPageHeader } from '../../components/AppPageHeader/AppPageHeader';
|
|
27
|
+
import { DocsGuidance } from '../../components/DocsGuidance/DocsGuidance';
|
|
27
28
|
import { DocsHeaderActions } from '../../docsHeaderActions';
|
|
28
29
|
import {
|
|
29
30
|
DOCS_PREVIEW_APPS,
|
|
@@ -203,6 +204,21 @@ export default function StandaloneAppLayoutPage() {
|
|
|
203
204
|
}
|
|
204
205
|
actions={<DocsHeaderActions />}
|
|
205
206
|
/>
|
|
207
|
+
<DocsGuidance
|
|
208
|
+
overview="The standalone app layout composes AppShell, Sidebar, and AppShellMainContent into the full chrome for a Sybilion standalone application: collapsible sidebar, sticky app header, scrollable main column, and page footer. This page embeds a live, layout-only preview; for real wiring, copy the standalone app template and follow its README."
|
|
209
|
+
whenToUse={[
|
|
210
|
+
'When building a new standalone Sybilion app that needs the standard workspace shell.',
|
|
211
|
+
'As a reference for how AppShell, Sidebar, PageScroll, and SybilionAppHeader fit together.',
|
|
212
|
+
'To verify scrolling, sidebar resizing, and header behaviour before wiring real routes.',
|
|
213
|
+
]}
|
|
214
|
+
whenNotToUse={[
|
|
215
|
+
'For individual pages inside an existing app; use PageHeader, PageContent, and PageContentSection instead.',
|
|
216
|
+
'As a nested shell inside another AppShell; an app should have exactly one shell.',
|
|
217
|
+
]}
|
|
218
|
+
doNotes={[
|
|
219
|
+
'Start from the app template rather than assembling the shell by hand, so auth and SDK wiring come for free.',
|
|
220
|
+
]}
|
|
221
|
+
/>
|
|
206
222
|
<PageContentSection title="Embedded mini-app (layout preview)">
|
|
207
223
|
<StandaloneLayoutPreview />
|
|
208
224
|
</PageContentSection>
|
|
@@ -1,28 +1,167 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
1
|
import { Label } from '#uilib/components/ui/Label';
|
|
4
2
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
5
3
|
import { Switch } from '#uilib/components/ui/Switch';
|
|
6
4
|
|
|
7
5
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
6
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
8
7
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const SIZES = ['sm', 'md', 'lg'] as const;
|
|
10
|
+
|
|
11
|
+
const STATES = [
|
|
12
|
+
{ label: 'off', checked: false },
|
|
13
|
+
{ label: 'on', checked: true },
|
|
14
|
+
] as const;
|
|
12
15
|
|
|
16
|
+
export default function SwitchPage() {
|
|
13
17
|
return (
|
|
14
18
|
<>
|
|
15
19
|
<AppPageHeader
|
|
16
20
|
breadcrumbs={[{ label: 'Switch' }]}
|
|
17
21
|
title="Switch"
|
|
18
|
-
subheader="
|
|
22
|
+
subheader="Sizes, on/off states, and disabled state."
|
|
19
23
|
actions={<DocsHeaderActions />}
|
|
20
24
|
/>
|
|
25
|
+
<DocsGuidance
|
|
26
|
+
overview="Switch is a binary control for turning a setting on or off. Unlike a checkbox, a switch implies the change takes effect immediately, without a separate save step."
|
|
27
|
+
whenToUse={[
|
|
28
|
+
'For settings that apply instantly, such as enabling notifications or a feature flag.',
|
|
29
|
+
'When the two states are clearly opposites, such as on and off.',
|
|
30
|
+
]}
|
|
31
|
+
whenNotToUse={[
|
|
32
|
+
'In forms where changes are committed by a submit action; use Checkbox instead.',
|
|
33
|
+
'For selecting one of several options; use RadioGroup, Toggle, or ToggleGroup.',
|
|
34
|
+
]}
|
|
35
|
+
doNotes={[
|
|
36
|
+
'Pair the switch with a Label linked via htmlFor so the state being controlled is clear.',
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
21
39
|
<PageContentSection
|
|
22
|
-
style={{ display: 'flex',
|
|
40
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
23
41
|
>
|
|
24
|
-
<
|
|
25
|
-
|
|
42
|
+
<section>
|
|
43
|
+
<h3 style={{ marginBottom: '1rem' }}>States × sizes</h3>
|
|
44
|
+
<div style={{ overflowX: 'auto' }}>
|
|
45
|
+
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
|
|
46
|
+
<thead>
|
|
47
|
+
<tr>
|
|
48
|
+
<th style={{ textAlign: 'left', padding: '0.5rem' }} />
|
|
49
|
+
{SIZES.map(s => (
|
|
50
|
+
<th key={s} style={{ padding: '0.5rem' }}>
|
|
51
|
+
{s}
|
|
52
|
+
</th>
|
|
53
|
+
))}
|
|
54
|
+
</tr>
|
|
55
|
+
</thead>
|
|
56
|
+
<tbody>
|
|
57
|
+
{STATES.map(st => (
|
|
58
|
+
<tr key={st.label}>
|
|
59
|
+
<td
|
|
60
|
+
style={{
|
|
61
|
+
padding: '0.5rem',
|
|
62
|
+
fontWeight: 600,
|
|
63
|
+
whiteSpace: 'nowrap',
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
{st.label}
|
|
67
|
+
</td>
|
|
68
|
+
{SIZES.map(s => (
|
|
69
|
+
<td key={s} style={{ padding: '0.5rem' }}>
|
|
70
|
+
<Switch
|
|
71
|
+
id={`sw-${st.label}-${s}`}
|
|
72
|
+
size={s}
|
|
73
|
+
checked={st.checked}
|
|
74
|
+
aria-label={`${st.label} ${s}`}
|
|
75
|
+
/>
|
|
76
|
+
</td>
|
|
77
|
+
))}
|
|
78
|
+
</tr>
|
|
79
|
+
))}
|
|
80
|
+
</tbody>
|
|
81
|
+
</table>
|
|
82
|
+
</div>
|
|
83
|
+
</section>
|
|
84
|
+
<section>
|
|
85
|
+
<h3 style={{ marginBottom: '1rem' }}>With label</h3>
|
|
86
|
+
<div
|
|
87
|
+
style={{
|
|
88
|
+
display: 'flex',
|
|
89
|
+
flexWrap: 'wrap',
|
|
90
|
+
gap: '1.5rem',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{SIZES.map(s => (
|
|
95
|
+
<div
|
|
96
|
+
key={s}
|
|
97
|
+
style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}
|
|
98
|
+
>
|
|
99
|
+
<Switch id={`sw-label-${s}`} size={s} defaultChecked />
|
|
100
|
+
<Label htmlFor={`sw-label-${s}`}>{s}</Label>
|
|
101
|
+
</div>
|
|
102
|
+
))}
|
|
103
|
+
</div>
|
|
104
|
+
</section>
|
|
105
|
+
<section>
|
|
106
|
+
<h3 style={{ marginBottom: '1rem' }}>Disabled</h3>
|
|
107
|
+
<div style={{ overflowX: 'auto' }}>
|
|
108
|
+
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
|
|
109
|
+
<thead>
|
|
110
|
+
<tr>
|
|
111
|
+
<th style={{ textAlign: 'left', padding: '0.5rem' }} />
|
|
112
|
+
{SIZES.map(s => (
|
|
113
|
+
<th key={s} style={{ padding: '0.5rem' }}>
|
|
114
|
+
{s}
|
|
115
|
+
</th>
|
|
116
|
+
))}
|
|
117
|
+
</tr>
|
|
118
|
+
</thead>
|
|
119
|
+
<tbody>
|
|
120
|
+
<tr>
|
|
121
|
+
<td
|
|
122
|
+
style={{
|
|
123
|
+
padding: '0.5rem',
|
|
124
|
+
fontWeight: 600,
|
|
125
|
+
whiteSpace: 'nowrap',
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
off
|
|
129
|
+
</td>
|
|
130
|
+
{SIZES.map(s => (
|
|
131
|
+
<td key={s} style={{ padding: '0.5rem' }}>
|
|
132
|
+
<Switch
|
|
133
|
+
size={s}
|
|
134
|
+
disabled
|
|
135
|
+
aria-label={`Disabled off ${s}`}
|
|
136
|
+
/>
|
|
137
|
+
</td>
|
|
138
|
+
))}
|
|
139
|
+
</tr>
|
|
140
|
+
<tr>
|
|
141
|
+
<td
|
|
142
|
+
style={{
|
|
143
|
+
padding: '0.5rem',
|
|
144
|
+
fontWeight: 600,
|
|
145
|
+
whiteSpace: 'nowrap',
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
on
|
|
149
|
+
</td>
|
|
150
|
+
{SIZES.map(s => (
|
|
151
|
+
<td key={s} style={{ padding: '0.5rem' }}>
|
|
152
|
+
<Switch
|
|
153
|
+
size={s}
|
|
154
|
+
checked
|
|
155
|
+
disabled
|
|
156
|
+
aria-label={`Disabled on ${s}`}
|
|
157
|
+
/>
|
|
158
|
+
</td>
|
|
159
|
+
))}
|
|
160
|
+
</tr>
|
|
161
|
+
</tbody>
|
|
162
|
+
</table>
|
|
163
|
+
</div>
|
|
164
|
+
</section>
|
|
26
165
|
</PageContentSection>
|
|
27
166
|
</>
|
|
28
167
|
);
|