@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
|
@@ -2,6 +2,7 @@ import { Foldable } from '#uilib/components/ui/Foldable';
|
|
|
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 FoldablePage() {
|
|
@@ -13,6 +14,21 @@ export default function FoldablePage() {
|
|
|
13
14
|
subheader="Expandable section with header."
|
|
14
15
|
actions={<DocsHeaderActions />}
|
|
15
16
|
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="Foldable is a collapsible section with a clickable header that shows or hides its content. Pass the header and content as props, and use defaultUnfolded to open the section initially."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'To tuck away secondary or advanced detail that most users do not need immediately.',
|
|
21
|
+
'To shorten long pages by letting users expand only the sections they care about.',
|
|
22
|
+
]}
|
|
23
|
+
whenNotToUse={[
|
|
24
|
+
'For content users must always see, such as warnings or required form fields.',
|
|
25
|
+
'For switching between parallel views of the same content; use Tabs instead.',
|
|
26
|
+
]}
|
|
27
|
+
doNotes={[
|
|
28
|
+
'Write headers that describe the hidden content, so users can decide whether to expand.',
|
|
29
|
+
'Set defaultUnfolded when the content is important enough to show on first view.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
16
32
|
<PageContentSection>
|
|
17
33
|
<Foldable
|
|
18
34
|
header={<span>Click to expand</span>}
|
|
@@ -4,6 +4,7 @@ import { GridLayout } from '#uilib/components/ui/GridLayout/GridLayout';
|
|
|
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 tileStyle: CSSProperties = {
|
|
@@ -27,6 +28,21 @@ export default function GridLayoutPage() {
|
|
|
27
28
|
subheader="Responsive CSS grid (`repeat(auto-fit, minmax(colWidth, 1fr))`), optional gap, polymorphic root via `as`."
|
|
28
29
|
actions={<DocsHeaderActions />}
|
|
29
30
|
/>
|
|
31
|
+
<DocsGuidance
|
|
32
|
+
overview="GridLayout is a responsive CSS grid that fits as many columns as the container allows, with each cell keeping at least colWidth before wrapping to a new row. Adjust spacing with the gap prop and change the root element with the polymorphic as prop."
|
|
33
|
+
whenToUse={[
|
|
34
|
+
'To lay out cards, tiles, or widgets in a dashboard-style grid inside a page section.',
|
|
35
|
+
'When the number of items varies and the grid should adapt to the viewport without media queries.',
|
|
36
|
+
]}
|
|
37
|
+
whenNotToUse={[
|
|
38
|
+
'For two fixed page columns such as main content plus an aside; use PageColumns.',
|
|
39
|
+
'For items of very different sizes that need manual placement; use custom CSS grid instead.',
|
|
40
|
+
]}
|
|
41
|
+
doNotes={[
|
|
42
|
+
'Tune colWidth to the smallest width at which a tile still reads comfortably.',
|
|
43
|
+
'Use spacing tokens such as var(--p-4) for the gap to stay consistent with the rest of the page.',
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
30
46
|
<PageContentSection
|
|
31
47
|
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
32
48
|
>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.toolbar
|
|
2
|
+
display flex
|
|
3
|
+
align-items center
|
|
4
|
+
gap var(--p-3)
|
|
5
|
+
margin-bottom var(--p-4)
|
|
6
|
+
|
|
7
|
+
> :first-child
|
|
8
|
+
max-width 320px
|
|
9
|
+
flex 1
|
|
10
|
+
|
|
11
|
+
.count
|
|
12
|
+
color var(--muted-foreground)
|
|
13
|
+
font-size var(--text-xs)
|
|
14
|
+
white-space nowrap
|
|
15
|
+
|
|
16
|
+
.grid
|
|
17
|
+
display grid
|
|
18
|
+
grid-template-columns repeat(auto-fill, minmax(104px, 1fr))
|
|
19
|
+
gap var(--p-2)
|
|
20
|
+
|
|
21
|
+
.cell
|
|
22
|
+
display flex
|
|
23
|
+
flex-direction column
|
|
24
|
+
align-items center
|
|
25
|
+
justify-content flex-start
|
|
26
|
+
gap var(--p-2)
|
|
27
|
+
padding var(--p-3) var(--p-1)
|
|
28
|
+
border 1px solid transparent
|
|
29
|
+
border-radius var(--radius-2)
|
|
30
|
+
cursor pointer
|
|
31
|
+
background none
|
|
32
|
+
color var(--foreground)
|
|
33
|
+
transition background var(--dur-fast) var(--ease-standard)
|
|
34
|
+
|
|
35
|
+
&:hover
|
|
36
|
+
border-color var(--border)
|
|
37
|
+
background var(--muted)
|
|
38
|
+
|
|
39
|
+
.cellCopied
|
|
40
|
+
border-color var(--brand-color)
|
|
41
|
+
|
|
42
|
+
.cellName
|
|
43
|
+
font-size var(--text-2xs)
|
|
44
|
+
line-height 1.2
|
|
45
|
+
color var(--muted-foreground)
|
|
46
|
+
word-break break-word
|
|
47
|
+
text-align center
|
|
48
|
+
user-select text
|
|
49
|
+
|
|
50
|
+
.more
|
|
51
|
+
margin-top var(--p-4)
|
|
52
|
+
color var(--muted-foreground)
|
|
53
|
+
font-size var(--text-sm)
|
|
54
|
+
|
|
55
|
+
.sizesRow
|
|
56
|
+
display flex
|
|
57
|
+
align-items flex-end
|
|
58
|
+
gap var(--p-8)
|
|
59
|
+
|
|
60
|
+
.sizeItem
|
|
61
|
+
display flex
|
|
62
|
+
flex-direction column
|
|
63
|
+
align-items center
|
|
64
|
+
gap var(--p-2)
|
|
65
|
+
|
|
66
|
+
.tokenName
|
|
67
|
+
font-family monospace
|
|
68
|
+
font-size var(--text-xs)
|
|
69
|
+
color var(--muted-foreground)
|
|
70
|
+
user-select text
|
|
71
|
+
|
|
72
|
+
.sectionNote
|
|
73
|
+
margin-bottom var(--p-3)
|
|
74
|
+
color var(--muted-foreground)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file is automatically generated.
|
|
2
|
+
// Please do not change this file!
|
|
3
|
+
interface CssExports {
|
|
4
|
+
'cell': string;
|
|
5
|
+
'cellCopied': string;
|
|
6
|
+
'cellName': string;
|
|
7
|
+
'count': string;
|
|
8
|
+
'grid': string;
|
|
9
|
+
'more': string;
|
|
10
|
+
'sectionNote': string;
|
|
11
|
+
'sizeItem': string;
|
|
12
|
+
'sizesRow': string;
|
|
13
|
+
'tokenName': string;
|
|
14
|
+
'toolbar': string;
|
|
15
|
+
}
|
|
16
|
+
export const cssExports: CssExports;
|
|
17
|
+
export default cssExports;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useMemo, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Input } from '#uilib/components/ui/Input';
|
|
4
|
+
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
5
|
+
import { Activity, icons } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
8
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
9
|
+
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
10
|
+
import S from './IconsPage.styl';
|
|
11
|
+
|
|
12
|
+
const ALL_ICONS = Object.entries(icons);
|
|
13
|
+
const VISIBLE_LIMIT = 300;
|
|
14
|
+
const ICON_STROKE = 1.5;
|
|
15
|
+
|
|
16
|
+
const SIZE_TOKENS = [
|
|
17
|
+
{ token: '--icon-size-sm', label: '14px' },
|
|
18
|
+
{ token: '--icon-size-md', label: '16px' },
|
|
19
|
+
{ token: '--icon-size-lg', label: '20px' },
|
|
20
|
+
{ token: '--icon-size-xl', label: '24px' },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export default function IconsPage() {
|
|
24
|
+
const [query, setQuery] = useState('');
|
|
25
|
+
const [copiedName, setCopiedName] = useState('');
|
|
26
|
+
const copyTimeoutRef = useRef(0);
|
|
27
|
+
|
|
28
|
+
const matches = useMemo(() => {
|
|
29
|
+
const q = query.trim().toLowerCase();
|
|
30
|
+
if (!q) return ALL_ICONS;
|
|
31
|
+
return ALL_ICONS.filter(([name]) => name.toLowerCase().includes(q));
|
|
32
|
+
}, [query]);
|
|
33
|
+
|
|
34
|
+
const visible = matches.slice(0, VISIBLE_LIMIT);
|
|
35
|
+
const hiddenCount = matches.length - visible.length;
|
|
36
|
+
|
|
37
|
+
const copyName = (name: string) => {
|
|
38
|
+
void navigator.clipboard.writeText(name);
|
|
39
|
+
setCopiedName(name);
|
|
40
|
+
window.clearTimeout(copyTimeoutRef.current);
|
|
41
|
+
copyTimeoutRef.current = window.setTimeout(() => setCopiedName(''), 1200);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<AppPageHeader
|
|
47
|
+
breadcrumbs={[{ label: 'Icons' }]}
|
|
48
|
+
title="Icons"
|
|
49
|
+
subheader="The full Lucide icon set, rendered at the system stroke and sizes."
|
|
50
|
+
actions={<DocsHeaderActions />}
|
|
51
|
+
/>
|
|
52
|
+
<DocsGuidance
|
|
53
|
+
overview="Icons come from the lucide-react package and are drawn at a 1.5px stroke (--icon-stroke). Use the --icon-size-* tokens to pick a size that matches the surrounding text, and keep one consistent size within a control or list."
|
|
54
|
+
whenToUse={[
|
|
55
|
+
'To reinforce the meaning of an action, status, or category next to its label.',
|
|
56
|
+
'As the only content of a square icon button, paired with an aria-label.',
|
|
57
|
+
]}
|
|
58
|
+
whenNotToUse={[
|
|
59
|
+
'To decorate text that is already clear on its own.',
|
|
60
|
+
'For brand or product marks; use the Logo component instead.',
|
|
61
|
+
]}
|
|
62
|
+
/>
|
|
63
|
+
<PageContentSection>
|
|
64
|
+
<h3>Sizes</h3>
|
|
65
|
+
<p className={S.sectionNote}>
|
|
66
|
+
One glyph at each size token, stroke 1.5.
|
|
67
|
+
</p>
|
|
68
|
+
<div className={S.sizesRow}>
|
|
69
|
+
{SIZE_TOKENS.map(({ token, label }) => (
|
|
70
|
+
<div key={token} className={S.sizeItem}>
|
|
71
|
+
<Activity
|
|
72
|
+
strokeWidth={ICON_STROKE}
|
|
73
|
+
style={{ width: `var(${token})`, height: `var(${token})` }}
|
|
74
|
+
/>
|
|
75
|
+
<span className={S.tokenName}>
|
|
76
|
+
{token} · {label}
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
</PageContentSection>
|
|
82
|
+
<PageContentSection>
|
|
83
|
+
<h3>Gallery</h3>
|
|
84
|
+
<div className={S.toolbar}>
|
|
85
|
+
<Input
|
|
86
|
+
type="search"
|
|
87
|
+
placeholder="Filter icons by name…"
|
|
88
|
+
value={query}
|
|
89
|
+
onChange={e => setQuery(e.target.value)}
|
|
90
|
+
aria-label="Filter icons by name"
|
|
91
|
+
/>
|
|
92
|
+
<span className={S.count}>
|
|
93
|
+
{matches.length} of {ALL_ICONS.length} icons
|
|
94
|
+
</span>
|
|
95
|
+
</div>
|
|
96
|
+
<div className={S.grid}>
|
|
97
|
+
{visible.map(([name, Icon]) => (
|
|
98
|
+
<button
|
|
99
|
+
key={name}
|
|
100
|
+
type="button"
|
|
101
|
+
className={
|
|
102
|
+
copiedName === name ? `${S.cell} ${S.cellCopied}` : S.cell
|
|
103
|
+
}
|
|
104
|
+
onClick={() => copyName(name)}
|
|
105
|
+
title={`Copy “${name}” to clipboard`}
|
|
106
|
+
>
|
|
107
|
+
<Icon size={20} strokeWidth={ICON_STROKE} />
|
|
108
|
+
<span className={S.cellName}>
|
|
109
|
+
{copiedName === name ? 'Copied' : name}
|
|
110
|
+
</span>
|
|
111
|
+
</button>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
{hiddenCount > 0 && (
|
|
115
|
+
<p className={S.more}>
|
|
116
|
+
{hiddenCount} more match — refine the filter to see them.
|
|
117
|
+
</p>
|
|
118
|
+
)}
|
|
119
|
+
{matches.length === 0 && (
|
|
120
|
+
<p className={S.more}>No icons match “{query.trim()}”.</p>
|
|
121
|
+
)}
|
|
122
|
+
</PageContentSection>
|
|
123
|
+
</>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
@@ -2,6 +2,7 @@ import { Image } from '#uilib/components/ui/Image';
|
|
|
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 ImagePage() {
|
|
@@ -13,6 +14,21 @@ export default function ImagePage() {
|
|
|
13
14
|
subheader="Responsive image wrapper."
|
|
14
15
|
actions={<DocsHeaderActions />}
|
|
15
16
|
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="Image is a thin wrapper around the native img element that loads a remote URL and accepts a fallback for when the request fails. Use it as the standard way to render external images in the library."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'To display remote images such as article thumbnails or user-provided media.',
|
|
21
|
+
'When you want a consistent image element with built-in fallback support.',
|
|
22
|
+
]}
|
|
23
|
+
whenNotToUse={[
|
|
24
|
+
'When you need visible error handling with custom fallback content; use ImageWithFallback.',
|
|
25
|
+
'For purely decorative backgrounds; prefer CSS backgrounds so they stay out of the accessibility tree.',
|
|
26
|
+
]}
|
|
27
|
+
doNotes={[
|
|
28
|
+
'Always provide meaningful alt text, or an empty alt for decorative images.',
|
|
29
|
+
'Constrain the image with max-width or explicit dimensions to avoid layout shift.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
16
32
|
<PageContentSection>
|
|
17
33
|
<Image
|
|
18
34
|
url="https://picsum.photos/seed/uilib/400/240"
|
|
@@ -2,6 +2,7 @@ import { ImageWithFallback } from '#uilib/components/ui/ImageWithFallback';
|
|
|
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 ImageWithFallbackPage() {
|
|
@@ -13,6 +14,20 @@ export default function ImageWithFallbackPage() {
|
|
|
13
14
|
subheader="Image with fallback on error."
|
|
14
15
|
actions={<DocsHeaderActions />}
|
|
15
16
|
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="ImageWithFallback renders an image from a URL and swaps in the provided fallback content when the image fails to load. The fallback can be any node, such as a placeholder icon or a short message."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'When image URLs come from external or user-supplied sources and may be broken.',
|
|
21
|
+
'When the layout must stay intact even if an image never loads, such as in cards or lists.',
|
|
22
|
+
]}
|
|
23
|
+
whenNotToUse={[
|
|
24
|
+
'When the image is bundled with the app and guaranteed to exist; plain Image is enough.',
|
|
25
|
+
]}
|
|
26
|
+
doNotes={[
|
|
27
|
+
'Give the fallback the same footprint as the image so the layout does not jump on error.',
|
|
28
|
+
'Keep fallback content simple, such as an icon or short label, rather than a detailed error message.',
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
16
31
|
<PageContentSection>
|
|
17
32
|
<p style={{ marginBottom: 12 }}>Broken URL shows fallback:</p>
|
|
18
33
|
<ImageWithFallback
|
|
@@ -10,6 +10,7 @@ import { Switch } from '#uilib/components/ui/Switch';
|
|
|
10
10
|
import { useTheme } from '#uilib/contexts/theme-context';
|
|
11
11
|
|
|
12
12
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
13
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
13
14
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
14
15
|
|
|
15
16
|
const FORECAST_BASELINE_ID = 1;
|
|
@@ -101,6 +102,19 @@ export default function IncludeHiddenInYScalePage() {
|
|
|
101
102
|
}
|
|
102
103
|
actions={<DocsHeaderActions />}
|
|
103
104
|
/>
|
|
105
|
+
<DocsGuidance
|
|
106
|
+
overview="includeHiddenInYScale is a BaseChartWrapper and ChartAreaInteractive prop that controls whether series hidden via the legend still contribute to the Y-axis domain. With the default of false, hiding an outlier series lets the chart rescale to the remaining data; setting it to true preserves the legacy behaviour where hidden values keep expanding the scale."
|
|
107
|
+
whenToUse={[
|
|
108
|
+
'Leave it false so hiding an extreme series rescales the chart and reveals detail in the rest.',
|
|
109
|
+
'Set it true when the axis must stay stable while users toggle series, for example in side-by-side comparisons.',
|
|
110
|
+
]}
|
|
111
|
+
whenNotToUse={[
|
|
112
|
+
'Do not combine it with a manually fixed yMin and yMax computed without the same setting, or the domain and the data will disagree.',
|
|
113
|
+
]}
|
|
114
|
+
doNotes={[
|
|
115
|
+
'Pass the same includeHiddenInYScale and hiddenSeries values to calculateChartYRange so the computed domain matches the chart.',
|
|
116
|
+
]}
|
|
117
|
+
/>
|
|
104
118
|
<PageContentSection>
|
|
105
119
|
<div
|
|
106
120
|
style={{
|
|
@@ -1,38 +1,153 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
1
|
import { Input } from '#uilib/components/ui/Input';
|
|
4
|
-
import { Label } from '#uilib/components/ui/Label';
|
|
5
2
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
6
3
|
|
|
7
4
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
8
6
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const VARIANTS = ['default', 'clean'] as const;
|
|
9
|
+
const SIZES = ['sm', 'md', 'lg'] as const;
|
|
12
10
|
|
|
11
|
+
export default function InputPage() {
|
|
13
12
|
return (
|
|
14
13
|
<>
|
|
15
14
|
<AppPageHeader
|
|
16
15
|
breadcrumbs={[{ label: 'Input' }]}
|
|
17
16
|
title="Input"
|
|
18
|
-
subheader="
|
|
17
|
+
subheader="Variants, sizes, textarea, placeholder, and disabled state."
|
|
19
18
|
actions={<DocsHeaderActions />}
|
|
20
19
|
/>
|
|
20
|
+
<DocsGuidance
|
|
21
|
+
overview="Input is the standard single-line text field. Pair it with a Label linked via htmlFor and id, and control the value through the onChange handler."
|
|
22
|
+
whenToUse={[
|
|
23
|
+
'To collect short, free-form text such as names, titles, or search terms.',
|
|
24
|
+
'In forms alongside Label, or use LabeledInput for the common label-plus-input row.',
|
|
25
|
+
]}
|
|
26
|
+
whenNotToUse={[
|
|
27
|
+
'For multi-line text; use Textarea instead.',
|
|
28
|
+
'When the value must come from a fixed set of options; use Select or Combobox.',
|
|
29
|
+
]}
|
|
30
|
+
doNotes={[
|
|
31
|
+
'Always associate a visible Label so the field is announced correctly by assistive technology.',
|
|
32
|
+
'Use placeholder text as a hint, not as a substitute for the label.',
|
|
33
|
+
]}
|
|
34
|
+
/>
|
|
21
35
|
<PageContentSection
|
|
22
|
-
style={{
|
|
23
|
-
display: 'flex',
|
|
24
|
-
flexDirection: 'column',
|
|
25
|
-
gap: 8,
|
|
26
|
-
maxWidth: 320,
|
|
27
|
-
}}
|
|
36
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
28
37
|
>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
<section>
|
|
39
|
+
<h3 style={{ marginBottom: '1rem' }}>Variants × sizes</h3>
|
|
40
|
+
<div style={{ overflowX: 'auto' }}>
|
|
41
|
+
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
|
|
42
|
+
<thead>
|
|
43
|
+
<tr>
|
|
44
|
+
<th style={{ textAlign: 'left', padding: '0.5rem' }} />
|
|
45
|
+
{SIZES.map(s => (
|
|
46
|
+
<th key={s} style={{ padding: '0.5rem' }}>
|
|
47
|
+
{s}
|
|
48
|
+
</th>
|
|
49
|
+
))}
|
|
50
|
+
</tr>
|
|
51
|
+
</thead>
|
|
52
|
+
<tbody>
|
|
53
|
+
{VARIANTS.map(v => (
|
|
54
|
+
<tr key={v}>
|
|
55
|
+
<td
|
|
56
|
+
style={{
|
|
57
|
+
padding: '0.5rem',
|
|
58
|
+
fontWeight: 600,
|
|
59
|
+
whiteSpace: 'nowrap',
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
{v}
|
|
63
|
+
</td>
|
|
64
|
+
{SIZES.map(s => (
|
|
65
|
+
<td key={s} style={{ padding: '0.5rem' }}>
|
|
66
|
+
<Input
|
|
67
|
+
variant={v}
|
|
68
|
+
size={s}
|
|
69
|
+
placeholder={`${v} ${s}`}
|
|
70
|
+
style={{ width: 200 }}
|
|
71
|
+
/>
|
|
72
|
+
</td>
|
|
73
|
+
))}
|
|
74
|
+
</tr>
|
|
75
|
+
))}
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>
|
|
78
|
+
</div>
|
|
79
|
+
</section>
|
|
80
|
+
<section>
|
|
81
|
+
<h3 style={{ marginBottom: '1rem' }}>Type variants</h3>
|
|
82
|
+
<p
|
|
83
|
+
style={{
|
|
84
|
+
marginBottom: '0.75rem',
|
|
85
|
+
color: 'var(--muted-foreground)',
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
Pass <code>type="textarea"</code> for a multi-line field — same{' '}
|
|
89
|
+
<code>size</code> and <code>variant</code> props apply.
|
|
90
|
+
</p>
|
|
91
|
+
<div style={{ overflowX: 'auto' }}>
|
|
92
|
+
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
|
|
93
|
+
<thead>
|
|
94
|
+
<tr>
|
|
95
|
+
<th style={{ textAlign: 'left', padding: '0.5rem' }} />
|
|
96
|
+
{SIZES.map(s => (
|
|
97
|
+
<th key={s} style={{ padding: '0.5rem' }}>
|
|
98
|
+
{s}
|
|
99
|
+
</th>
|
|
100
|
+
))}
|
|
101
|
+
</tr>
|
|
102
|
+
</thead>
|
|
103
|
+
<tbody>
|
|
104
|
+
<tr>
|
|
105
|
+
<td
|
|
106
|
+
style={{
|
|
107
|
+
padding: '0.5rem',
|
|
108
|
+
fontWeight: 600,
|
|
109
|
+
whiteSpace: 'nowrap',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
textarea
|
|
113
|
+
</td>
|
|
114
|
+
{SIZES.map(s => (
|
|
115
|
+
<td key={s} style={{ padding: '0.5rem' }}>
|
|
116
|
+
<Input
|
|
117
|
+
type="textarea"
|
|
118
|
+
size={s}
|
|
119
|
+
placeholder={`textarea ${s}`}
|
|
120
|
+
rows={3}
|
|
121
|
+
style={{ width: 200 }}
|
|
122
|
+
/>
|
|
123
|
+
</td>
|
|
124
|
+
))}
|
|
125
|
+
</tr>
|
|
126
|
+
</tbody>
|
|
127
|
+
</table>
|
|
128
|
+
</div>
|
|
129
|
+
</section>
|
|
130
|
+
<section>
|
|
131
|
+
<h3 style={{ marginBottom: '1rem' }}>Disabled</h3>
|
|
132
|
+
<div
|
|
133
|
+
style={{
|
|
134
|
+
display: 'flex',
|
|
135
|
+
flexWrap: 'wrap',
|
|
136
|
+
gap: '0.75rem',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
{VARIANTS.map(v => (
|
|
141
|
+
<Input
|
|
142
|
+
key={v}
|
|
143
|
+
variant={v}
|
|
144
|
+
disabled
|
|
145
|
+
placeholder={`Disabled ${v}`}
|
|
146
|
+
style={{ width: 200 }}
|
|
147
|
+
/>
|
|
148
|
+
))}
|
|
149
|
+
</div>
|
|
150
|
+
</section>
|
|
36
151
|
</PageContentSection>
|
|
37
152
|
</>
|
|
38
153
|
);
|
|
@@ -2,6 +2,7 @@ import { InteractiveContent } from '#uilib/components/ui/InteractiveContent';
|
|
|
2
2
|
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
3
3
|
|
|
4
4
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
5
6
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
6
7
|
|
|
7
8
|
const SAMPLE =
|
|
@@ -16,6 +17,20 @@ export default function InteractiveContentPage() {
|
|
|
16
17
|
subheader="Inline formatting from assistant-style text."
|
|
17
18
|
actions={<DocsHeaderActions />}
|
|
18
19
|
/>
|
|
20
|
+
<DocsGuidance
|
|
21
|
+
overview="InteractiveContent renders assistant-style plain text with inline formatting applied: markdown emphasis such as bold and italic, and bare URLs converted into clickable links. The inline variant restricts formatting to what is safe within a single line."
|
|
22
|
+
whenToUse={[
|
|
23
|
+
'To display assistant or model-generated text that may contain markdown emphasis and raw URLs.',
|
|
24
|
+
'When plain text needs lightweight formatting without a full markdown renderer.',
|
|
25
|
+
]}
|
|
26
|
+
whenNotToUse={[
|
|
27
|
+
'For trusted, authored content with rich structure such as headings, lists, or code blocks; use a full markdown component.',
|
|
28
|
+
'For static UI copy that needs no formatting; render the text directly.',
|
|
29
|
+
]}
|
|
30
|
+
doNotes={[
|
|
31
|
+
'Use the inline variant when the text sits inside a sentence or compact label.',
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
19
34
|
<PageContentSection>
|
|
20
35
|
<InteractiveContent text={SAMPLE} />
|
|
21
36
|
</PageContentSection>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Kicker } from '#uilib/components/ui/Kicker';
|
|
2
|
+
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
3
|
+
|
|
4
|
+
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
5
|
+
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
6
|
+
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
7
|
+
|
|
8
|
+
export default function KickerPage() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<AppPageHeader
|
|
12
|
+
breadcrumbs={[{ label: 'Kicker' }]}
|
|
13
|
+
title="Kicker"
|
|
14
|
+
subheader="Small eyebrow label that introduces a section or card."
|
|
15
|
+
actions={<DocsHeaderActions />}
|
|
16
|
+
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="Kicker is a small eyebrow label rendered above a heading, card, or section. It uses the 12px Manrope label style in sentence case with zero tracking; emphasis comes from weight, never from uppercase."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'Above a heading or card to name the topic or category at a glance.',
|
|
21
|
+
'As the eyebrow line of a SignalCard or editorial block.',
|
|
22
|
+
]}
|
|
23
|
+
whenNotToUse={[
|
|
24
|
+
'As a heading in its own right; pair it with a real heading element.',
|
|
25
|
+
'For interactive labels such as filters or status pills; use Chip instead.',
|
|
26
|
+
]}
|
|
27
|
+
dontNotes={[
|
|
28
|
+
'Do not set kicker text in uppercase or small caps; keep sentence case.',
|
|
29
|
+
'Do not add letter-spacing; small text keeps zero tracking.',
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
<PageContentSection
|
|
33
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
34
|
+
>
|
|
35
|
+
<section>
|
|
36
|
+
<h3 style={{ marginBottom: '1rem' }}>Default</h3>
|
|
37
|
+
<Kicker>Chips, tags, status indicators</Kicker>
|
|
38
|
+
</section>
|
|
39
|
+
<section>
|
|
40
|
+
<h3 style={{ marginBottom: '1rem' }}>With dash</h3>
|
|
41
|
+
<p
|
|
42
|
+
style={{
|
|
43
|
+
marginBottom: '0.75rem',
|
|
44
|
+
color: 'var(--muted-foreground)',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
Pass <code>dash</code> to render the leading em-dash used across the
|
|
48
|
+
design-system previews.
|
|
49
|
+
</p>
|
|
50
|
+
<Kicker dash>Signal card · product primitive</Kicker>
|
|
51
|
+
</section>
|
|
52
|
+
<section>
|
|
53
|
+
<h3 style={{ marginBottom: '1rem' }}>Above a heading</h3>
|
|
54
|
+
<div>
|
|
55
|
+
<Kicker dash>Quarterly outlook</Kicker>
|
|
56
|
+
<h2 style={{ marginTop: '0.5rem' }}>Polymer demand</h2>
|
|
57
|
+
</div>
|
|
58
|
+
</section>
|
|
59
|
+
</PageContentSection>
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -2,6 +2,7 @@ import { Label } from '#uilib/components/ui/Label';
|
|
|
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 LabelPage() {
|
|
@@ -13,6 +14,20 @@ export default function LabelPage() {
|
|
|
13
14
|
subheader="Form label."
|
|
14
15
|
actions={<DocsHeaderActions />}
|
|
15
16
|
/>
|
|
17
|
+
<DocsGuidance
|
|
18
|
+
overview="Label is the styled form label used across the library. Link it to its control with htmlFor so clicking the label focuses the field and assistive technology announces it."
|
|
19
|
+
whenToUse={[
|
|
20
|
+
'To caption any form control, including Input, Textarea, Select, Switch, and Checkbox.',
|
|
21
|
+
'Whenever a control needs an accessible name that is also visible on screen.',
|
|
22
|
+
]}
|
|
23
|
+
whenNotToUse={[
|
|
24
|
+
'For section headings or general text; use heading elements or SectionHeader.',
|
|
25
|
+
'As inline helper or error text; labels name the field, they do not explain it.',
|
|
26
|
+
]}
|
|
27
|
+
doNotes={[
|
|
28
|
+
'Keep labels short and descriptive, such as “Email address” rather than full sentences.',
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
16
31
|
<PageContentSection>
|
|
17
32
|
<Label htmlFor="x">Example label</Label>
|
|
18
33
|
</PageContentSection>
|