@adres/mgda-ui 0.0.0-stage → 0.0.2
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/brand-knowledge.json +451 -0
- package/knowledge/accordion.md +135 -0
- package/knowledge/activity-rings.md +123 -0
- package/knowledge/alert.md +184 -0
- package/knowledge/answer-actions.md +217 -0
- package/knowledge/aspect-ratio.md +82 -0
- package/knowledge/avatar.md +158 -0
- package/knowledge/badge.md +172 -0
- package/knowledge/bar-graph.md +167 -0
- package/knowledge/bento-grid.md +115 -0
- package/knowledge/blockquote.md +153 -0
- package/knowledge/box-list.md +177 -0
- package/knowledge/bullet-list.md +128 -0
- package/knowledge/button-group.md +179 -0
- package/knowledge/button.md +231 -0
- package/knowledge/calendar.md +168 -0
- package/knowledge/card.md +321 -0
- package/knowledge/cards-nav.md +170 -0
- package/knowledge/chain-of-thought.md +164 -0
- package/knowledge/chat-container.md +135 -0
- package/knowledge/chat-message.md +224 -0
- package/knowledge/checkbox-card.md +172 -0
- package/knowledge/checkbox.md +111 -0
- package/knowledge/citations.md +241 -0
- package/knowledge/combobox.md +265 -0
- package/knowledge/countdown-pill.md +153 -0
- package/knowledge/cta.md +118 -0
- package/knowledge/data-list.md +173 -0
- package/knowledge/data-table.md +220 -0
- package/knowledge/dialog.md +249 -0
- package/knowledge/drawer.md +236 -0
- package/knowledge/dropdown-menu.md +238 -0
- package/knowledge/dropzone.md +153 -0
- package/knowledge/email-chips-input.md +161 -0
- package/knowledge/empty-state.md +106 -0
- package/knowledge/entity-header.md +166 -0
- package/knowledge/feature-grid.md +120 -0
- package/knowledge/feedback-bar.md +127 -0
- package/knowledge/footer.md +116 -0
- package/knowledge/heading.md +189 -0
- package/knowledge/hero.md +361 -0
- package/knowledge/input-button.md +187 -0
- package/knowledge/input-group.md +185 -0
- package/knowledge/input.md +256 -0
- package/knowledge/inset.md +177 -0
- package/knowledge/kpi-card.md +206 -0
- package/knowledge/list-nav.md +181 -0
- package/knowledge/logo-cloud.md +102 -0
- package/knowledge/media-gallery.md +158 -0
- package/knowledge/message-actions.md +175 -0
- package/knowledge/nav-sidebar.md +225 -0
- package/knowledge/number-stepper.md +159 -0
- package/knowledge/page-header.md +109 -0
- package/knowledge/pagination.md +225 -0
- package/knowledge/popover.md +159 -0
- package/knowledge/pricing.md +132 -0
- package/knowledge/progress.md +156 -0
- package/knowledge/prompt-input.md +337 -0
- package/knowledge/prompt-suggestions.md +168 -0
- package/knowledge/quota-bar.md +160 -0
- package/knowledge/quote.md +116 -0
- package/knowledge/radio-card.md +172 -0
- package/knowledge/radio-group.md +135 -0
- package/knowledge/reasoning.md +142 -0
- package/knowledge/search.md +131 -0
- package/knowledge/section-nav.md +162 -0
- package/knowledge/segmented-control.md +181 -0
- package/knowledge/select-button.md +205 -0
- package/knowledge/select.md +210 -0
- package/knowledge/separator.md +75 -0
- package/knowledge/shimmer-text.md +140 -0
- package/knowledge/sidebar.md +227 -0
- package/knowledge/skeleton.md +142 -0
- package/knowledge/slider.md +133 -0
- package/knowledge/slideshow.md +159 -0
- package/knowledge/source.md +156 -0
- package/knowledge/spinner.md +120 -0
- package/knowledge/stat-strip.md +128 -0
- package/knowledge/stats.md +117 -0
- package/knowledge/step-indicator.md +157 -0
- package/knowledge/switch.md +88 -0
- package/knowledge/table.md +190 -0
- package/knowledge/tabs.md +169 -0
- package/knowledge/testimonials.md +115 -0
- package/knowledge/text-link.md +192 -0
- package/knowledge/text.md +194 -0
- package/knowledge/thinking-bar.md +115 -0
- package/knowledge/thinking-steps.md +140 -0
- package/knowledge/toaster.md +127 -0
- package/knowledge/toggle.md +113 -0
- package/knowledge/tool-call-card.md +241 -0
- package/knowledge/tooltip.md +120 -0
- package/knowledge/top-nav.md +138 -0
- package/knowledge.json +19854 -0
- package/package.json +94 -4
- package/src/components/accordion.stories.tsx +46 -0
- package/src/components/accordion.tsx +74 -0
- package/src/components/activity-rings.stories.tsx +73 -0
- package/src/components/activity-rings.tsx +121 -0
- package/src/components/alert.stories.tsx +43 -0
- package/src/components/alert.tsx +132 -0
- package/src/components/answer-actions.stories.tsx +54 -0
- package/src/components/answer-actions.test.tsx +37 -0
- package/src/components/answer-actions.tsx +313 -0
- package/src/components/aspect-ratio.stories.tsx +32 -0
- package/src/components/aspect-ratio.tsx +5 -0
- package/src/components/avatar.stories.tsx +40 -0
- package/src/components/avatar.tsx +154 -0
- package/src/components/badge.stories.tsx +27 -0
- package/src/components/badge.tsx +63 -0
- package/src/components/bar-graph.stories.tsx +28 -0
- package/src/components/bar-graph.tsx +204 -0
- package/src/components/bento-grid.stories.tsx +23 -0
- package/src/components/bento-grid.tsx +67 -0
- package/src/components/blockquote.stories.tsx +28 -0
- package/src/components/blockquote.tsx +88 -0
- package/src/components/box-list.stories.tsx +25 -0
- package/src/components/box-list.tsx +108 -0
- package/src/components/bullet-list.stories.tsx +22 -0
- package/src/components/bullet-list.tsx +101 -0
- package/src/components/button-group.stories.tsx +31 -0
- package/src/components/button-group.tsx +156 -0
- package/src/components/button.stories.tsx +66 -0
- package/src/components/button.test.ts +17 -0
- package/src/components/button.tsx +139 -0
- package/src/components/calendar.stories.tsx +25 -0
- package/src/components/calendar.tsx +367 -0
- package/src/components/card.stories.tsx +44 -0
- package/src/components/card.tsx +392 -0
- package/src/components/cards-nav.stories.tsx +35 -0
- package/src/components/cards-nav.tsx +115 -0
- package/src/components/chain-of-thought.stories.tsx +67 -0
- package/src/components/chain-of-thought.test.tsx +50 -0
- package/src/components/chain-of-thought.tsx +170 -0
- package/src/components/chat-container.stories.tsx +47 -0
- package/src/components/chat-container.test.tsx +49 -0
- package/src/components/chat-container.tsx +222 -0
- package/src/components/chat-message.stories.tsx +52 -0
- package/src/components/chat-message.test.tsx +36 -0
- package/src/components/chat-message.tsx +163 -0
- package/src/components/checkbox-card.stories.tsx +27 -0
- package/src/components/checkbox-card.tsx +200 -0
- package/src/components/checkbox.stories.tsx +26 -0
- package/src/components/checkbox.tsx +61 -0
- package/src/components/citations.stories.tsx +64 -0
- package/src/components/citations.test.tsx +61 -0
- package/src/components/citations.tsx +220 -0
- package/src/components/combobox.stories.tsx +184 -0
- package/src/components/combobox.test.tsx +82 -0
- package/src/components/combobox.tsx +407 -0
- package/src/components/countdown-pill.stories.tsx +24 -0
- package/src/components/countdown-pill.tsx +129 -0
- package/src/components/cta.stories.tsx +29 -0
- package/src/components/cta.tsx +52 -0
- package/src/components/data-list.stories.tsx +50 -0
- package/src/components/data-list.test.tsx +35 -0
- package/src/components/data-list.tsx +181 -0
- package/src/components/data-table.stories.tsx +29 -0
- package/src/components/data-table.tsx +200 -0
- package/src/components/dialog.stories.tsx +42 -0
- package/src/components/dialog.tsx +200 -0
- package/src/components/drawer.stories.tsx +48 -0
- package/src/components/drawer.tsx +385 -0
- package/src/components/dropdown-menu.stories.tsx +41 -0
- package/src/components/dropdown-menu.tsx +252 -0
- package/src/components/dropzone.stories.tsx +19 -0
- package/src/components/dropzone.tsx +250 -0
- package/src/components/email-chips-input.stories.tsx +135 -0
- package/src/components/email-chips-input.tsx +210 -0
- package/src/components/empty-state.stories.tsx +22 -0
- package/src/components/empty-state.tsx +35 -0
- package/src/components/entity-header.stories.tsx +43 -0
- package/src/components/entity-header.test.tsx +35 -0
- package/src/components/entity-header.tsx +92 -0
- package/src/components/feature-grid.stories.tsx +25 -0
- package/src/components/feature-grid.tsx +87 -0
- package/src/components/feedback-bar.stories.tsx +25 -0
- package/src/components/feedback-bar.test.tsx +24 -0
- package/src/components/feedback-bar.tsx +62 -0
- package/src/components/footer.stories.tsx +23 -0
- package/src/components/footer.tsx +78 -0
- package/src/components/heading.stories.tsx +45 -0
- package/src/components/heading.test.tsx +22 -0
- package/src/components/heading.tsx +77 -0
- package/src/components/hero.stories.tsx +38 -0
- package/src/components/hero.tsx +498 -0
- package/src/components/input-button.stories.tsx +19 -0
- package/src/components/input-button.tsx +112 -0
- package/src/components/input-group.stories.tsx +38 -0
- package/src/components/input-group.tsx +157 -0
- package/src/components/input.stories.tsx +31 -0
- package/src/components/input.tsx +284 -0
- package/src/components/inset.stories.tsx +29 -0
- package/src/components/inset.tsx +70 -0
- package/src/components/kpi-card.stories.tsx +29 -0
- package/src/components/kpi-card.tsx +284 -0
- package/src/components/list-nav.stories.tsx +22 -0
- package/src/components/list-nav.tsx +145 -0
- package/src/components/logo-cloud.stories.tsx +23 -0
- package/src/components/logo-cloud.tsx +42 -0
- package/src/components/media-gallery.stories.tsx +25 -0
- package/src/components/media-gallery.tsx +347 -0
- package/src/components/message-actions.stories.tsx +45 -0
- package/src/components/message-actions.test.tsx +32 -0
- package/src/components/message-actions.tsx +119 -0
- package/src/components/nav-sidebar.stories.tsx +58 -0
- package/src/components/nav-sidebar.test.tsx +54 -0
- package/src/components/nav-sidebar.tsx +462 -0
- package/src/components/number-stepper.stories.tsx +19 -0
- package/src/components/number-stepper.tsx +158 -0
- package/src/components/page-header.stories.tsx +25 -0
- package/src/components/page-header.tsx +64 -0
- package/src/components/pagination.stories.tsx +110 -0
- package/src/components/pagination.test.tsx +46 -0
- package/src/components/pagination.tsx +144 -0
- package/src/components/popover.stories.tsx +26 -0
- package/src/components/popover.tsx +62 -0
- package/src/components/pricing.stories.tsx +42 -0
- package/src/components/pricing.tsx +130 -0
- package/src/components/progress.stories.tsx +22 -0
- package/src/components/progress.tsx +189 -0
- package/src/components/prompt-input.stories.tsx +62 -0
- package/src/components/prompt-input.test.tsx +106 -0
- package/src/components/prompt-input.tsx +343 -0
- package/src/components/prompt-suggestions.stories.tsx +53 -0
- package/src/components/prompt-suggestions.test.tsx +37 -0
- package/src/components/prompt-suggestions.tsx +122 -0
- package/src/components/quota-bar.stories.tsx +19 -0
- package/src/components/quota-bar.tsx +191 -0
- package/src/components/quote.stories.tsx +18 -0
- package/src/components/quote.tsx +43 -0
- package/src/components/radio-card.stories.tsx +27 -0
- package/src/components/radio-card.tsx +225 -0
- package/src/components/radio-group.stories.tsx +32 -0
- package/src/components/radio-group.tsx +68 -0
- package/src/components/reasoning.stories.tsx +50 -0
- package/src/components/reasoning.test.tsx +48 -0
- package/src/components/reasoning.tsx +143 -0
- package/src/components/search.stories.tsx +18 -0
- package/src/components/search.tsx +133 -0
- package/src/components/section-nav.stories.tsx +59 -0
- package/src/components/section-nav.test.tsx +36 -0
- package/src/components/section-nav.tsx +146 -0
- package/src/components/segmented-control.stories.tsx +22 -0
- package/src/components/segmented-control.tsx +301 -0
- package/src/components/select-button.stories.tsx +27 -0
- package/src/components/select-button.tsx +174 -0
- package/src/components/select.stories.tsx +27 -0
- package/src/components/select.tsx +198 -0
- package/src/components/separator.stories.tsx +22 -0
- package/src/components/separator.tsx +23 -0
- package/src/components/shimmer-text.stories.tsx +23 -0
- package/src/components/shimmer-text.test.tsx +35 -0
- package/src/components/shimmer-text.tsx +43 -0
- package/src/components/sidebar.stories.tsx +25 -0
- package/src/components/sidebar.tsx +234 -0
- package/src/components/skeleton.stories.tsx +22 -0
- package/src/components/skeleton.tsx +96 -0
- package/src/components/slider.stories.tsx +20 -0
- package/src/components/slider.tsx +176 -0
- package/src/components/slideshow.stories.tsx +30 -0
- package/src/components/slideshow.tsx +291 -0
- package/src/components/source.stories.tsx +32 -0
- package/src/components/source.test.tsx +40 -0
- package/src/components/source.tsx +161 -0
- package/src/components/spinner.stories.tsx +19 -0
- package/src/components/spinner.tsx +76 -0
- package/src/components/stat-strip.stories.tsx +36 -0
- package/src/components/stat-strip.test.tsx +25 -0
- package/src/components/stat-strip.tsx +85 -0
- package/src/components/stats.stories.tsx +24 -0
- package/src/components/stats.tsx +83 -0
- package/src/components/step-indicator.stories.tsx +18 -0
- package/src/components/step-indicator.test.tsx +18 -0
- package/src/components/step-indicator.tsx +286 -0
- package/src/components/switch.stories.tsx +26 -0
- package/src/components/switch.tsx +32 -0
- package/src/components/table.stories.tsx +38 -0
- package/src/components/table.tsx +220 -0
- package/src/components/tabs.stories.tsx +25 -0
- package/src/components/tabs.tsx +276 -0
- package/src/components/testimonials.stories.tsx +22 -0
- package/src/components/testimonials.tsx +109 -0
- package/src/components/text-link.stories.tsx +47 -0
- package/src/components/text-link.test.tsx +18 -0
- package/src/components/text-link.tsx +88 -0
- package/src/components/text.stories.tsx +49 -0
- package/src/components/text.tsx +105 -0
- package/src/components/thinking-bar.stories.tsx +19 -0
- package/src/components/thinking-bar.test.tsx +27 -0
- package/src/components/thinking-bar.tsx +64 -0
- package/src/components/thinking-steps.stories.tsx +44 -0
- package/src/components/thinking-steps.test.tsx +42 -0
- package/src/components/thinking-steps.tsx +92 -0
- package/src/components/toaster.stories.tsx +80 -0
- package/src/components/toaster.tsx +36 -0
- package/src/components/toggle.stories.tsx +21 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tool-call-card.stories.tsx +97 -0
- package/src/components/tool-call-card.test.tsx +88 -0
- package/src/components/tool-call-card.tsx +231 -0
- package/src/components/tooltip.stories.tsx +25 -0
- package/src/components/tooltip.tsx +43 -0
- package/src/components/top-nav.stories.tsx +20 -0
- package/src/components/top-nav.tsx +76 -0
- package/src/docs/Colors.stories.tsx +192 -0
- package/src/docs/GettingStarted.mdx +72 -0
- package/src/docs/Mcp.mdx +52 -0
- package/src/docs/Typography.stories.tsx +114 -0
- package/src/hooks/use-in-view.ts +32 -0
- package/src/hooks/use-reduced-motion.ts +26 -0
- package/src/index.ts +343 -0
- package/src/lib/cn.test.ts +67 -0
- package/src/lib/cn.ts +81 -0
- package/src/lib/motion.ts +109 -0
- package/src/lib/prefix-utilities.test.ts +56 -0
- package/src/lib/prefix-utilities.ts +50 -0
- package/src/styles/base.css +489 -0
- package/src/styles/motion.css +69 -0
- package/src/styles/overrides.css +44 -0
- package/src/styles/typography.css +173 -0
- package/src/theme/theme.css +391 -0
- package/src/theme/tokens.ts +29 -0
- package/src/theme/types.ts +26 -0
- package/README.md +0 -3
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: shimmer-text
|
|
6
|
+
sourceFile: packages/design-system/src/components/shimmer-text.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-ai
|
|
9
|
+
categoryFromBarrel: web-app-ai
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: shimmerGradient
|
|
14
|
+
kind: function
|
|
15
|
+
typeText: "(spread: number) => string"
|
|
16
|
+
- name: ShimmerText
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<ShimmerTextProps & RefAttributes<HTMLElement>>"
|
|
19
|
+
- name: ShimmerTextAs
|
|
20
|
+
kind: type
|
|
21
|
+
- name: ShimmerTextProps
|
|
22
|
+
kind: type
|
|
23
|
+
primaryExport: ShimmerText
|
|
24
|
+
subcomponents: []
|
|
25
|
+
props:
|
|
26
|
+
ShimmerText:
|
|
27
|
+
- name: as
|
|
28
|
+
type: ShimmerTextAs
|
|
29
|
+
required: false
|
|
30
|
+
declaredIn: self
|
|
31
|
+
- name: duration
|
|
32
|
+
type: number
|
|
33
|
+
required: false
|
|
34
|
+
declaredIn: self
|
|
35
|
+
doc: "Seconds for one sweep."
|
|
36
|
+
- name: spread
|
|
37
|
+
type: number
|
|
38
|
+
required: false
|
|
39
|
+
declaredIn: self
|
|
40
|
+
doc: "Width of the highlight as a percentage either side of centre, clamped to 5-45."
|
|
41
|
+
extendsProps:
|
|
42
|
+
- "React.HTMLAttributes<HTMLElement>"
|
|
43
|
+
variants:
|
|
44
|
+
as:
|
|
45
|
+
kind: enum
|
|
46
|
+
options:
|
|
47
|
+
- div
|
|
48
|
+
- h2
|
|
49
|
+
- h3
|
|
50
|
+
- p
|
|
51
|
+
- span
|
|
52
|
+
- h1
|
|
53
|
+
- h4
|
|
54
|
+
- h5
|
|
55
|
+
- h6
|
|
56
|
+
- strong
|
|
57
|
+
default: null
|
|
58
|
+
on: ShimmerText
|
|
59
|
+
variantSource: prop-union
|
|
60
|
+
compoundVariants: []
|
|
61
|
+
sizeMaps: []
|
|
62
|
+
dataSlots:
|
|
63
|
+
- shimmer-text
|
|
64
|
+
dependsOn:
|
|
65
|
+
internal: []
|
|
66
|
+
lib:
|
|
67
|
+
- cn
|
|
68
|
+
hooks: []
|
|
69
|
+
external:
|
|
70
|
+
- react
|
|
71
|
+
contexts: []
|
|
72
|
+
stories:
|
|
73
|
+
- exportName: Default
|
|
74
|
+
id: components-shimmertext--default
|
|
75
|
+
- exportName: Heading
|
|
76
|
+
id: components-shimmertext--heading
|
|
77
|
+
- exportName: SlowWide
|
|
78
|
+
id: components-shimmertext--slow-wide
|
|
79
|
+
storybookTitle: Components/ShimmerText
|
|
80
|
+
docsId: components-shimmertext--documentation
|
|
81
|
+
argTypeOptions:
|
|
82
|
+
as:
|
|
83
|
+
- span
|
|
84
|
+
- p
|
|
85
|
+
- div
|
|
86
|
+
- strong
|
|
87
|
+
- h1
|
|
88
|
+
- h2
|
|
89
|
+
- h3
|
|
90
|
+
- h4
|
|
91
|
+
- h5
|
|
92
|
+
- h6
|
|
93
|
+
resolvedCleanly: true
|
|
94
|
+
contractHash: a190e87b4e79
|
|
95
|
+
factsHash: "98e1f6414f0c"
|
|
96
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
97
|
+
status: beta
|
|
98
|
+
summary: "Text with a highlight sweeping across it, for work in progress such as \"Thinking\" or \"Searching listings\". Set the element, sweep duration and highlight width."
|
|
99
|
+
useWhen:
|
|
100
|
+
- "a short label stands for work that is still happening, such as an assistant thinking or a search running"
|
|
101
|
+
- "a custom AI layout needs the same in-progress shimmer as ThinkingSteps and Reasoning"
|
|
102
|
+
useInstead:
|
|
103
|
+
- id: spinner
|
|
104
|
+
when: "there is no label, or the wait is not tied to text"
|
|
105
|
+
- id: skeleton
|
|
106
|
+
when: "content is loading and you want to hold its shape"
|
|
107
|
+
related:
|
|
108
|
+
- thinking-steps
|
|
109
|
+
- reasoning
|
|
110
|
+
a11y:
|
|
111
|
+
notes:
|
|
112
|
+
- "The shimmer is decorative; the text itself must say what is happening."
|
|
113
|
+
- "The sweep stops under reduced motion and the text stays readable."
|
|
114
|
+
- "It is not a live region; announce state changes separately if they matter."
|
|
115
|
+
radixHandles: false
|
|
116
|
+
pitfalls:
|
|
117
|
+
- "Use it only while the work is running; swap to plain text once done."
|
|
118
|
+
- "Keep it to a short label, not a paragraph; a long sweep is hard to read."
|
|
119
|
+
- "It sets its own colour through the gradient; text colour classes have no effect."
|
|
120
|
+
canonicalSnippet: |
|
|
121
|
+
import { ShimmerText } from "@adres/mgda-ui"
|
|
122
|
+
|
|
123
|
+
{searching ? <ShimmerText>Searching listings</ShimmerText> : "Searched 128 listings"}
|
|
124
|
+
reviewedAt: 2026-10-06
|
|
125
|
+
reviewedAgainstContractHash: a190e87b4e79
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Usage
|
|
129
|
+
|
|
130
|
+
`ShimmerText` renders its children with a bright band sweeping across muted
|
|
131
|
+
text. `as` picks the element (`span` by default), `duration` sets seconds per
|
|
132
|
+
sweep (2.5 by default) and `spread` sets the band's width as a percentage
|
|
133
|
+
either side of centre, from 5 to 45 (20 by default). `shimmerGradient`
|
|
134
|
+
returns the gradient for custom elements.
|
|
135
|
+
|
|
136
|
+
ThinkingSteps and Reasoning use it for their labels while running.
|
|
137
|
+
|
|
138
|
+
## Anatomy
|
|
139
|
+
|
|
140
|
+
- `ShimmerText` - the shimmering text element.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: sidebar
|
|
6
|
+
sourceFile: packages/design-system/src/components/sidebar.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-layout-navigation
|
|
9
|
+
categoryFromBarrel: web-app-layout-navigation
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Sidebar
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<SidebarProps & RefAttributes<HTMLElement>>"
|
|
16
|
+
- name: SidebarItem
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<SidebarItemProps & RefAttributes<HTMLAnchorElement>>"
|
|
19
|
+
- name: SidebarItemProps
|
|
20
|
+
kind: type
|
|
21
|
+
- name: SidebarProps
|
|
22
|
+
kind: type
|
|
23
|
+
- name: SidebarSection
|
|
24
|
+
kind: component
|
|
25
|
+
typeText: "ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & { label?: ReactNode; collapsed?: boolean | undefined; } & RefAttributes<HTMLDivElement>>"
|
|
26
|
+
- name: SidebarUserCard
|
|
27
|
+
kind: component
|
|
28
|
+
typeText: "ForwardRefExoticComponent<SidebarUserCardProps & RefAttributes<HTMLDivElement>>"
|
|
29
|
+
- name: SidebarUserCardProps
|
|
30
|
+
kind: type
|
|
31
|
+
primaryExport: Sidebar
|
|
32
|
+
subcomponents:
|
|
33
|
+
- SidebarItem
|
|
34
|
+
- SidebarSection
|
|
35
|
+
- SidebarUserCard
|
|
36
|
+
props:
|
|
37
|
+
Sidebar:
|
|
38
|
+
- name: brand
|
|
39
|
+
type: ReactNode
|
|
40
|
+
required: false
|
|
41
|
+
declaredIn: self
|
|
42
|
+
doc: "Optional logo / brand mark slot at the top."
|
|
43
|
+
- name: collapsed
|
|
44
|
+
type: boolean
|
|
45
|
+
required: false
|
|
46
|
+
declaredIn: self
|
|
47
|
+
doc: "Collapsed state - controlled. When undefined, sidebar is always open."
|
|
48
|
+
- name: footer
|
|
49
|
+
type: ReactNode
|
|
50
|
+
required: false
|
|
51
|
+
declaredIn: self
|
|
52
|
+
doc: "Optional footer slot (typically a `SidebarUserCard`)."
|
|
53
|
+
- name: width
|
|
54
|
+
type: number
|
|
55
|
+
required: false
|
|
56
|
+
declaredIn: self
|
|
57
|
+
doc: "Sidebar width in rem; default 16rem (256px)."
|
|
58
|
+
SidebarItem:
|
|
59
|
+
- name: active
|
|
60
|
+
type: boolean
|
|
61
|
+
required: false
|
|
62
|
+
declaredIn: self
|
|
63
|
+
- name: asChild
|
|
64
|
+
type: boolean
|
|
65
|
+
required: false
|
|
66
|
+
declaredIn: self
|
|
67
|
+
doc: "Render as the child element (e.g. a Next.js `<Link>`). The child receives the className, ref, and event props so it behaves as the sidebar row while keeping its own navigation behaviour."
|
|
68
|
+
- name: collapsed
|
|
69
|
+
type: boolean
|
|
70
|
+
required: false
|
|
71
|
+
declaredIn: self
|
|
72
|
+
- name: icon
|
|
73
|
+
type: ReactNode
|
|
74
|
+
required: false
|
|
75
|
+
declaredIn: self
|
|
76
|
+
SidebarSection:
|
|
77
|
+
- name: collapsed
|
|
78
|
+
type: boolean
|
|
79
|
+
required: false
|
|
80
|
+
declaredIn: self
|
|
81
|
+
- name: label
|
|
82
|
+
type: ReactNode
|
|
83
|
+
required: false
|
|
84
|
+
declaredIn: self
|
|
85
|
+
SidebarUserCard:
|
|
86
|
+
- name: action
|
|
87
|
+
type: ReactNode
|
|
88
|
+
required: false
|
|
89
|
+
declaredIn: self
|
|
90
|
+
doc: "Trailing slot - typically a DropdownMenu trigger for settings/logout."
|
|
91
|
+
- name: avatar
|
|
92
|
+
type: ReactNode
|
|
93
|
+
required: true
|
|
94
|
+
declaredIn: self
|
|
95
|
+
doc: "Avatar element (typically `<Avatar>` from the DS)."
|
|
96
|
+
- name: collapsed
|
|
97
|
+
type: boolean
|
|
98
|
+
required: false
|
|
99
|
+
declaredIn: self
|
|
100
|
+
doc: "Hides the name/role/action when the parent Sidebar is collapsed."
|
|
101
|
+
- name: name
|
|
102
|
+
type: ReactNode
|
|
103
|
+
required: true
|
|
104
|
+
declaredIn: self
|
|
105
|
+
doc: "Display name."
|
|
106
|
+
- name: role
|
|
107
|
+
type: ReactNode
|
|
108
|
+
required: false
|
|
109
|
+
declaredIn: self
|
|
110
|
+
doc: "Role / sub-label rendered under the name (e.g. \"Company Admin\")."
|
|
111
|
+
extendsProps:
|
|
112
|
+
- "React.HTMLAttributes<HTMLElement>"
|
|
113
|
+
variants: {}
|
|
114
|
+
variantSource: none
|
|
115
|
+
compoundVariants: []
|
|
116
|
+
sizeMaps: []
|
|
117
|
+
dataSlots: []
|
|
118
|
+
dependsOn:
|
|
119
|
+
internal:
|
|
120
|
+
- tooltip
|
|
121
|
+
lib:
|
|
122
|
+
- cn
|
|
123
|
+
hooks:
|
|
124
|
+
- use-reduced-motion
|
|
125
|
+
external:
|
|
126
|
+
- "@radix-ui/react-slot"
|
|
127
|
+
- motion/react
|
|
128
|
+
- react
|
|
129
|
+
contexts: []
|
|
130
|
+
stories:
|
|
131
|
+
- exportName: Default
|
|
132
|
+
id: components-sidebar--default
|
|
133
|
+
storybookTitle: Components/Sidebar
|
|
134
|
+
docsId: components-sidebar--documentation
|
|
135
|
+
argTypeOptions: {}
|
|
136
|
+
resolvedCleanly: true
|
|
137
|
+
contractHash: bd9b677804d5
|
|
138
|
+
factsHash: "9c211fee9f28"
|
|
139
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
140
|
+
status: stable
|
|
141
|
+
summary: "The structural app-shell nav column: brand, scrollable body, footer, with a collapse animation."
|
|
142
|
+
useWhen:
|
|
143
|
+
- "building a persistent left-hand app navigation shell"
|
|
144
|
+
- "you need the raw structural pieces (brand/body/footer, a row, a labeled section, a user footer card) to compose a custom nav"
|
|
145
|
+
useInstead:
|
|
146
|
+
- id: nav-sidebar
|
|
147
|
+
when: "you want ready-made active-state routing, nested items, and a collapse toggle instead of assembling them yourself"
|
|
148
|
+
- id: top-nav
|
|
149
|
+
when: "the app's primary navigation is horizontal, not a side column"
|
|
150
|
+
related:
|
|
151
|
+
- nav-sidebar
|
|
152
|
+
- tooltip
|
|
153
|
+
composesWith:
|
|
154
|
+
- tooltip
|
|
155
|
+
tokens:
|
|
156
|
+
- "--border"
|
|
157
|
+
- "--card"
|
|
158
|
+
- "--card-foreground"
|
|
159
|
+
- "--primary"
|
|
160
|
+
- "--primary-foreground"
|
|
161
|
+
- "--muted"
|
|
162
|
+
- "--muted-foreground"
|
|
163
|
+
- "--ring"
|
|
164
|
+
a11y:
|
|
165
|
+
notes:
|
|
166
|
+
- "Sidebar renders <aside aria-label=\"Primary\">, so a page with more than one landmark should not add a second aside labeled the same way."
|
|
167
|
+
- "SidebarItem shows the label as a Tooltip when collapsed, so keep children to a short string in that mode - a Tooltip cannot usefully render a paragraph."
|
|
168
|
+
- "The width-collapse animation is suppressed under prefers-reduced-motion via the useReducedMotion hook, falling back to a plain <aside> with no motion.aside."
|
|
169
|
+
requiredProps:
|
|
170
|
+
- "SidebarUserCard requires avatar and name; role and action are optional"
|
|
171
|
+
keyboard:
|
|
172
|
+
- "SidebarItem is a native <a> by default, so it is reachable and activatable via standard link semantics."
|
|
173
|
+
- "asChild hands the row to the child (e.g. a router Link), so the item keeps the visual row treatment while the child owns actual navigation and focus behavior."
|
|
174
|
+
radixHandles: false
|
|
175
|
+
pitfalls:
|
|
176
|
+
- "collapsed on Sidebar is controlled-only: passing undefined means the sidebar is always expanded, there is no internal uncontrolled fallback. Reach for NavSidebar if you want the collapse state managed for you."
|
|
177
|
+
- "SidebarItem's asChild uses Radix Slot, so it accepts exactly one child element - wrapping multiple children or a fragment throws the same way any other Slot consumer does."
|
|
178
|
+
- "width is a plain number of rem, not a CSS length string - passing \"16rem\" instead of 16 breaks the inline width calculation."
|
|
179
|
+
subcomponentNotes:
|
|
180
|
+
SidebarItem: "A row inside Sidebar. Renders <a> by default; pass asChild to wrap a router Link. Reserves a 2px start-edge bar on every row (active or not) so activating never shifts the label."
|
|
181
|
+
SidebarSection: "Groups SidebarItems with an optional overline label, hidden automatically when collapsed is true."
|
|
182
|
+
SidebarUserCard: "Conventional footer block: avatar + name + role + optional trailing action. Collapses to avatar-only when collapsed is true."
|
|
183
|
+
rtl: "Uses logical properties (border-e, ps-*/pe-*, border-s-2) throughout, so the column and its active-state bar flip correctly under RTL without extra work."
|
|
184
|
+
canonicalSnippet: |
|
|
185
|
+
import { Sidebar, SidebarSection, SidebarItem, SidebarUserCard, Avatar } from "@adres/mgda-ui"
|
|
186
|
+
import { Home, Book } from "lucide-react"
|
|
187
|
+
|
|
188
|
+
<Sidebar
|
|
189
|
+
brand={<img src="/logo.svg" alt="Acme" className="ax:h-6" />}
|
|
190
|
+
footer={<SidebarUserCard avatar={<Avatar />} name="Sara Ahmed" role="Company Admin" />}
|
|
191
|
+
>
|
|
192
|
+
<SidebarSection label="Main menu">
|
|
193
|
+
<SidebarItem icon={<Home />} active>Dashboard</SidebarItem>
|
|
194
|
+
<SidebarItem icon={<Book />}>Courses</SidebarItem>
|
|
195
|
+
</SidebarSection>
|
|
196
|
+
</Sidebar>
|
|
197
|
+
reviewedAt: 2026-08-31
|
|
198
|
+
reviewedAgainstContractHash: bd9b677804d5
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Usage
|
|
202
|
+
|
|
203
|
+
Sidebar is the low-level structural primitive: a fixed-width column with a brand
|
|
204
|
+
slot, a scrollable body, and an optional footer, plus a spring-animated
|
|
205
|
+
collapse transition. It does not know about routes, active state, or nested
|
|
206
|
+
menus - that behavior lives one level up in `NavSidebar`. Reach for `Sidebar`
|
|
207
|
+
directly only when you're building a custom navigation shell that doesn't fit
|
|
208
|
+
`NavSidebar`'s config-driven model.
|
|
209
|
+
|
|
210
|
+
`collapsed` is controlled: passing it drives the width animation between the
|
|
211
|
+
full `width` (default 16rem) and a fixed 4rem icon rail. Passing nothing
|
|
212
|
+
leaves the sidebar permanently expanded - there is no internal toggle.
|
|
213
|
+
|
|
214
|
+
## Anatomy
|
|
215
|
+
|
|
216
|
+
- **Sidebar** - the column itself: brand header, scrollable `<nav>` body,
|
|
217
|
+
footer. Wraps its content in a `TooltipProvider` so collapsed `SidebarItem`s
|
|
218
|
+
can show their label as a tooltip without the consumer wrapping the app root.
|
|
219
|
+
- **SidebarSection** - groups a set of `SidebarItem`s under an optional
|
|
220
|
+
overline label; the label (and its own spacing) disappears when the parent
|
|
221
|
+
is collapsed.
|
|
222
|
+
- **SidebarItem** - a single nav row. Shows an icon, and either the label text
|
|
223
|
+
(expanded) or a tooltip carrying the label (collapsed). `active` renders the
|
|
224
|
+
tinted background and start-edge accent bar.
|
|
225
|
+
- **SidebarUserCard** - the conventional footer block: avatar, name, an
|
|
226
|
+
optional role sub-label, and an optional trailing action slot (typically a
|
|
227
|
+
`DropdownMenu` trigger). Collapses to just the avatar.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: skeleton
|
|
6
|
+
sourceFile: packages/design-system/src/components/skeleton.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-core-primitives
|
|
9
|
+
categoryFromBarrel: web-app-core-primitives
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Skeleton
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<SkeletonProps & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
- name: SkeletonProps
|
|
17
|
+
kind: type
|
|
18
|
+
- name: SkeletonText
|
|
19
|
+
kind: component
|
|
20
|
+
typeText: "ForwardRefExoticComponent<SkeletonTextProps & RefAttributes<HTMLDivElement>>"
|
|
21
|
+
- name: SkeletonTextProps
|
|
22
|
+
kind: type
|
|
23
|
+
- name: SkeletonVariant
|
|
24
|
+
kind: type
|
|
25
|
+
primaryExport: Skeleton
|
|
26
|
+
subcomponents:
|
|
27
|
+
- SkeletonText
|
|
28
|
+
props:
|
|
29
|
+
Skeleton:
|
|
30
|
+
- name: variant
|
|
31
|
+
type: "\"none\" | \"pulse\" | \"shimmer\""
|
|
32
|
+
required: false
|
|
33
|
+
declaredIn: self
|
|
34
|
+
variantKey: true
|
|
35
|
+
SkeletonText:
|
|
36
|
+
- name: lineClassName
|
|
37
|
+
type: string
|
|
38
|
+
required: false
|
|
39
|
+
declaredIn: self
|
|
40
|
+
doc: "Line height - applied to every line. Default `h-3`."
|
|
41
|
+
- name: lines
|
|
42
|
+
type: number
|
|
43
|
+
required: false
|
|
44
|
+
declaredIn: self
|
|
45
|
+
doc: "Number of text lines to render. Default 3."
|
|
46
|
+
- name: variant
|
|
47
|
+
type: SkeletonVariant
|
|
48
|
+
required: false
|
|
49
|
+
declaredIn: self
|
|
50
|
+
doc: "Animation variant - applied to every line."
|
|
51
|
+
variantKey: true
|
|
52
|
+
extendsProps:
|
|
53
|
+
- "React.HTMLAttributes<HTMLDivElement>"
|
|
54
|
+
- "VariantProps<typeof skeletonVariants>"
|
|
55
|
+
variants:
|
|
56
|
+
variant:
|
|
57
|
+
kind: enum
|
|
58
|
+
options:
|
|
59
|
+
- pulse
|
|
60
|
+
- shimmer
|
|
61
|
+
- none
|
|
62
|
+
default: pulse
|
|
63
|
+
on: Skeleton
|
|
64
|
+
variantSource: cva
|
|
65
|
+
compoundVariants: []
|
|
66
|
+
sizeMaps: []
|
|
67
|
+
dataSlots: []
|
|
68
|
+
dependsOn:
|
|
69
|
+
internal: []
|
|
70
|
+
lib:
|
|
71
|
+
- cn
|
|
72
|
+
hooks: []
|
|
73
|
+
external:
|
|
74
|
+
- class-variance-authority
|
|
75
|
+
- react
|
|
76
|
+
contexts: []
|
|
77
|
+
stories:
|
|
78
|
+
- exportName: Default
|
|
79
|
+
id: components-skeleton--default
|
|
80
|
+
storybookTitle: Components/Skeleton
|
|
81
|
+
docsId: components-skeleton--documentation
|
|
82
|
+
argTypeOptions: {}
|
|
83
|
+
resolvedCleanly: true
|
|
84
|
+
contractHash: dcb07facc093
|
|
85
|
+
factsHash: bd7402c31120
|
|
86
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
87
|
+
status: stable
|
|
88
|
+
summary: "A placeholder block that mimics the shape of content still loading, plus SkeletonText for stacked paragraph-line placeholders."
|
|
89
|
+
useWhen:
|
|
90
|
+
- "content is loading asynchronously and a shape-matched placeholder reduces layout shift and perceived wait"
|
|
91
|
+
- "specifically placeholdering multiple lines of text (SkeletonText)"
|
|
92
|
+
useInstead:
|
|
93
|
+
- id: empty-state
|
|
94
|
+
when: "there is no content to eventually load - a genuinely empty result, not something still loading"
|
|
95
|
+
- id: spinner
|
|
96
|
+
when: "the eventual content's shape is not known or not worth matching - a spinner is a lighter-weight indicator for a short or generic wait"
|
|
97
|
+
related:
|
|
98
|
+
- empty-state
|
|
99
|
+
- spinner
|
|
100
|
+
a11y:
|
|
101
|
+
notes:
|
|
102
|
+
- "Both Skeleton and SkeletonText render aria-hidden=\"true\" and never announce to screen readers - pair them with a real loading indication elsewhere (aria-busy, or a visually-hidden status message) if the loading state itself needs to be announced."
|
|
103
|
+
radixHandles: false
|
|
104
|
+
pitfalls:
|
|
105
|
+
- "variant defaults to \"pulse\"; \"shimmer\" is heavier (an animated gradient overlay) and reads better on large blocks like hero images or card previews than on small text-line placeholders - picking shimmer for tiny skeletons can look busier than pulse."
|
|
106
|
+
- "Skeleton has no built-in size - width and height come entirely from className or inherited layout, so an unsized Skeleton with no explicit dimensions collapses to a zero-height block."
|
|
107
|
+
- "SkeletonText's last line is always forced to a shorter fixed width regardless of lines, to read as a paragraph ending - you cannot make every line the same width through lineClassName alone."
|
|
108
|
+
canonicalSnippet: |
|
|
109
|
+
import { Skeleton, SkeletonText } from "@adres/mgda-ui"
|
|
110
|
+
|
|
111
|
+
<div className="ax:flex ax:items-center ax:gap-md">
|
|
112
|
+
<Skeleton className="ax:size-10 ax:rounded-full" />
|
|
113
|
+
<SkeletonText lines={2} className="ax:flex-1" />
|
|
114
|
+
</div>
|
|
115
|
+
reviewedAt: 2026-08-31
|
|
116
|
+
reviewedAgainstContractHash: dcb07facc093
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
`Skeleton` is a shape, not a component with intrinsic sizing - give it width
|
|
122
|
+
and height (or `size-*`) through `className` to match whatever content it's
|
|
123
|
+
standing in for: a circle for an avatar, a rectangle for an image, a short bar
|
|
124
|
+
for a badge.
|
|
125
|
+
|
|
126
|
+
Reach for `SkeletonText` instead of stacking `Skeleton` lines by hand when
|
|
127
|
+
placeholdering a paragraph - it renders `lines` bars with naturally varied
|
|
128
|
+
widths and always shortens the last one, so it reads as text rather than a
|
|
129
|
+
uniform grey block.
|
|
130
|
+
|
|
131
|
+
`variant` picks the animation: `pulse` (default) is a quiet opacity
|
|
132
|
+
oscillation suited to most cases, `shimmer` is a sliding gradient better
|
|
133
|
+
suited to large placeholder blocks, and `none` is static, useful inside an
|
|
134
|
+
already-animated parent or for visual snapshot tests. `motion-reduce`
|
|
135
|
+
disables both animated variants automatically.
|
|
136
|
+
|
|
137
|
+
## Anatomy
|
|
138
|
+
|
|
139
|
+
| Part | Role |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `Skeleton` | The base placeholder block. `variant` picks pulse, shimmer, or no animation. |
|
|
142
|
+
| `SkeletonText` | A stack of `Skeleton` lines with naturally varied widths. The last line is always shorter, to read as a paragraph's end. |
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: slider
|
|
6
|
+
sourceFile: packages/design-system/src/components/slider.tsx
|
|
7
|
+
client: true
|
|
8
|
+
category: web-app-form-controls
|
|
9
|
+
categoryFromBarrel: web-app-form-controls
|
|
10
|
+
barrelExported: true
|
|
11
|
+
importPath: "@adres/mgda-ui"
|
|
12
|
+
exports:
|
|
13
|
+
- name: Slider
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLSpanElement>>"
|
|
16
|
+
- name: SliderProps
|
|
17
|
+
kind: type
|
|
18
|
+
- name: SliderSize
|
|
19
|
+
kind: type
|
|
20
|
+
- name: SliderValueLabel
|
|
21
|
+
kind: type
|
|
22
|
+
primaryExport: Slider
|
|
23
|
+
subcomponents: []
|
|
24
|
+
props:
|
|
25
|
+
Slider:
|
|
26
|
+
- name: formatValue
|
|
27
|
+
type: "((value: number) => ReactNode)"
|
|
28
|
+
required: false
|
|
29
|
+
declaredIn: self
|
|
30
|
+
doc: "Format the value rendered in the label (e.g. add a \"%\" suffix, currency). Default: the raw number."
|
|
31
|
+
- name: marks
|
|
32
|
+
type: "boolean | number[]"
|
|
33
|
+
required: false
|
|
34
|
+
declaredIn: self
|
|
35
|
+
doc: "Render tick marks along the track. - `true` - auto-generate at every `step` between `min` and `max` (auto-generation is skipped when it would produce more than 21 marks - for fine sliders, provide an explicit array instead) - `number[]` - render marks at exactly the provided positions"
|
|
36
|
+
- name: size
|
|
37
|
+
type: "\"lg\" | \"md\" | \"sm\""
|
|
38
|
+
required: false
|
|
39
|
+
declaredIn: self
|
|
40
|
+
variantKey: true
|
|
41
|
+
- name: valueLabel
|
|
42
|
+
type: SliderValueLabel
|
|
43
|
+
required: false
|
|
44
|
+
declaredIn: self
|
|
45
|
+
doc: "Show the current value in a small pill above each thumb. - `\"always\"` - pill is always visible - `\"active\"` - pill appears on hover / focus / drag, hidden otherwise - `false` (default) - no pill"
|
|
46
|
+
extendsProps:
|
|
47
|
+
- "React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>"
|
|
48
|
+
- "VariantProps<typeof trackVariants>"
|
|
49
|
+
variants:
|
|
50
|
+
size:
|
|
51
|
+
kind: enum
|
|
52
|
+
options:
|
|
53
|
+
- sm
|
|
54
|
+
- md
|
|
55
|
+
- lg
|
|
56
|
+
default: md
|
|
57
|
+
on: Slider
|
|
58
|
+
variantSource: cva
|
|
59
|
+
compoundVariants: []
|
|
60
|
+
sizeMaps:
|
|
61
|
+
- LABEL_OFFSET
|
|
62
|
+
- THUMB_SIZE
|
|
63
|
+
- TRACK_HEIGHT
|
|
64
|
+
dataSlots: []
|
|
65
|
+
dependsOn:
|
|
66
|
+
internal: []
|
|
67
|
+
lib:
|
|
68
|
+
- cn
|
|
69
|
+
hooks: []
|
|
70
|
+
external:
|
|
71
|
+
- "@radix-ui/react-slider"
|
|
72
|
+
- class-variance-authority
|
|
73
|
+
- react
|
|
74
|
+
contexts: []
|
|
75
|
+
stories:
|
|
76
|
+
- exportName: Default
|
|
77
|
+
id: components-slider--default
|
|
78
|
+
storybookTitle: Components/Slider
|
|
79
|
+
docsId: components-slider--documentation
|
|
80
|
+
argTypeOptions: {}
|
|
81
|
+
resolvedCleanly: true
|
|
82
|
+
contractHash: e376c3f50f6d
|
|
83
|
+
factsHash: "044041bba365"
|
|
84
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
85
|
+
status: stable
|
|
86
|
+
summary: "A drag-to-select range control (single or multi-thumb) built on Radix Slider, with optional tick marks and a per-thumb value label."
|
|
87
|
+
useWhen:
|
|
88
|
+
- "picking a numeric value, or a range between two values, by dragging rather than typing"
|
|
89
|
+
useInstead:
|
|
90
|
+
- id: input
|
|
91
|
+
when: "the value needs to be typed precisely rather than dragged"
|
|
92
|
+
related:
|
|
93
|
+
- input
|
|
94
|
+
tokens:
|
|
95
|
+
- "--muted"
|
|
96
|
+
- "--primary"
|
|
97
|
+
- "--background"
|
|
98
|
+
- "--ring"
|
|
99
|
+
- "--foreground"
|
|
100
|
+
a11y:
|
|
101
|
+
notes:
|
|
102
|
+
- "Each thumb is a real Radix slider thumb with native ARIA (role=\"slider\", aria-valuenow/min/max) - no additional labeling is required for the numeric value itself, though a visible field label is still needed to say what the slider controls."
|
|
103
|
+
- "valueLabel's pill is aria-hidden - it is a visual convenience, not the accessible value announcement, which Radix already provides through the native slider ARIA attributes."
|
|
104
|
+
keyboard:
|
|
105
|
+
- "Native Radix slider keyboard behavior: arrow keys nudge by step, Page Up/Down jump by a larger increment, Home/End jump to min/max."
|
|
106
|
+
radixHandles: true
|
|
107
|
+
pitfalls:
|
|
108
|
+
- "The number of thumbs is driven entirely by the length of value/defaultValue - passing a two-element array renders a range slider with two thumbs automatically; there is no separate range prop to set."
|
|
109
|
+
- "marks={true} silently renders nothing once the auto-generated tick count would exceed 21 for fine-grained step/min/max combinations - pass an explicit number[] for a fine slider that still needs visible marks."
|
|
110
|
+
- "valueLabel=\"active\" reveals the pill via CSS group-hover/group-focus-visible/group-active on the thumb - overriding the thumb's className in a way that drops the group class silently stops the pill from appearing on interaction."
|
|
111
|
+
canonicalSnippet: |
|
|
112
|
+
import { Slider } from "@adres/mgda-ui"
|
|
113
|
+
|
|
114
|
+
<Slider defaultValue={[50]} valueLabel="active" />
|
|
115
|
+
reviewedAt: 2026-08-31
|
|
116
|
+
reviewedAgainstContractHash: e376c3f50f6d
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
`Slider` is for picking a numeric value, or a range between two values, by
|
|
122
|
+
dragging - reach for `Input` instead when the value needs to be typed
|
|
123
|
+
precisely rather than dragged.
|
|
124
|
+
|
|
125
|
+
The number of thumbs is driven entirely by how many values `value`/
|
|
126
|
+
`defaultValue` holds - pass a two-element array for a range slider with two
|
|
127
|
+
thumbs; there is no separate prop to opt into range mode.
|
|
128
|
+
|
|
129
|
+
Set `valueLabel="always"` or `"active"` to show the current value in a pill
|
|
130
|
+
above each thumb (`"active"` reveals it only on hover, focus, or drag), and
|
|
131
|
+
`marks` to render tick marks along the track - `true` auto-generates one per
|
|
132
|
+
`step`, capped at 21 marks before it silently renders none, so pass an
|
|
133
|
+
explicit array for finer-grained sliders that still need visible marks.
|