@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,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: segmented-control
|
|
6
|
+
sourceFile: packages/design-system/src/components/segmented-control.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: SegmentedControl
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<SegmentedControlProps & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
- name: SegmentedControlItem
|
|
17
|
+
kind: component
|
|
18
|
+
typeText: "ForwardRefExoticComponent<SegmentedControlItemProps & RefAttributes<HTMLButtonElement>>"
|
|
19
|
+
- name: SegmentedControlItemProps
|
|
20
|
+
kind: type
|
|
21
|
+
- name: SegmentedControlProps
|
|
22
|
+
kind: type
|
|
23
|
+
- name: SegmentedControlSize
|
|
24
|
+
kind: type
|
|
25
|
+
- name: SegmentedControlVariant
|
|
26
|
+
kind: type
|
|
27
|
+
primaryExport: SegmentedControl
|
|
28
|
+
subcomponents:
|
|
29
|
+
- SegmentedControlItem
|
|
30
|
+
props:
|
|
31
|
+
SegmentedControl:
|
|
32
|
+
- name: fullWidth
|
|
33
|
+
type: boolean
|
|
34
|
+
required: false
|
|
35
|
+
declaredIn: self
|
|
36
|
+
doc: "When true, the control stretches to fill its container and each item takes an equal share of the width. Use for view toggles embedded in toolbars, modal footers, or any layout where the control should fill the available space rather than hug its content."
|
|
37
|
+
- name: size
|
|
38
|
+
type: SegmentedControlSize
|
|
39
|
+
required: false
|
|
40
|
+
declaredIn: self
|
|
41
|
+
variantKey: true
|
|
42
|
+
- name: transparent
|
|
43
|
+
type: boolean
|
|
44
|
+
required: false
|
|
45
|
+
declaredIn: self
|
|
46
|
+
doc: "When true, the track background is transparent (drops the `bg-muted` fill). Use when the control sits on an already-tinted surface."
|
|
47
|
+
variantKey: true
|
|
48
|
+
- name: variant
|
|
49
|
+
type: SegmentedControlVariant
|
|
50
|
+
required: false
|
|
51
|
+
declaredIn: self
|
|
52
|
+
doc: "Colour theme for the whole control: tints the track background (weak `{variant}`), the selected thumb's shadow (`{variant}-strong`), and the selected item's label (`{variant}-stronger`). Defaults to `neutral`."
|
|
53
|
+
variantKey: true
|
|
54
|
+
extendsProps:
|
|
55
|
+
- "Omit< React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, \"orientation\" >"
|
|
56
|
+
variants:
|
|
57
|
+
size:
|
|
58
|
+
kind: enum
|
|
59
|
+
options:
|
|
60
|
+
- sm
|
|
61
|
+
- md
|
|
62
|
+
- lg
|
|
63
|
+
default: md
|
|
64
|
+
on: SegmentedControl
|
|
65
|
+
variant:
|
|
66
|
+
kind: enum
|
|
67
|
+
options:
|
|
68
|
+
- neutral
|
|
69
|
+
- primary
|
|
70
|
+
- secondary
|
|
71
|
+
default: neutral
|
|
72
|
+
on: SegmentedControl
|
|
73
|
+
transparent:
|
|
74
|
+
kind: boolean
|
|
75
|
+
default: false
|
|
76
|
+
on: SegmentedControl
|
|
77
|
+
variantSource: cva
|
|
78
|
+
compoundVariants:
|
|
79
|
+
- variant: neutral
|
|
80
|
+
transparent: false
|
|
81
|
+
- variant: primary
|
|
82
|
+
transparent: false
|
|
83
|
+
- variant: secondary
|
|
84
|
+
transparent: false
|
|
85
|
+
sizeMaps:
|
|
86
|
+
- activeLabelClass
|
|
87
|
+
- inactiveLabelClass
|
|
88
|
+
- variantBoxShadow
|
|
89
|
+
dataSlots: []
|
|
90
|
+
dependsOn:
|
|
91
|
+
internal: []
|
|
92
|
+
lib:
|
|
93
|
+
- cn
|
|
94
|
+
hooks: []
|
|
95
|
+
external:
|
|
96
|
+
- "@radix-ui/react-radio-group"
|
|
97
|
+
- class-variance-authority
|
|
98
|
+
- react
|
|
99
|
+
contexts:
|
|
100
|
+
- name: SegmentedControlContext
|
|
101
|
+
type: SegmentedControlContextValue
|
|
102
|
+
default: null
|
|
103
|
+
stories:
|
|
104
|
+
- exportName: Default
|
|
105
|
+
id: components-segmentedcontrol--default
|
|
106
|
+
storybookTitle: Components/SegmentedControl
|
|
107
|
+
docsId: components-segmentedcontrol--documentation
|
|
108
|
+
argTypeOptions: {}
|
|
109
|
+
resolvedCleanly: true
|
|
110
|
+
contractHash: a939d75e1fff
|
|
111
|
+
factsHash: d6aa68d42972
|
|
112
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
113
|
+
status: stable
|
|
114
|
+
summary: "A single-select, pill-style switch with a sliding indicator between segments, built on Radix RadioGroup."
|
|
115
|
+
useWhen:
|
|
116
|
+
- "a small, fixed set of view modes or filters where the current selection should read as one connected control with a sliding highlight - a day/week/month toggle, a list/grid view switch"
|
|
117
|
+
useInstead:
|
|
118
|
+
- id: button-group
|
|
119
|
+
when: "the row is a set of related actions or toggle buttons rather than exactly one persistent selection with a sliding indicator"
|
|
120
|
+
- id: radio-group
|
|
121
|
+
when: "the options read better as a stacked list, each with its own visible label, rather than a compact inline switch"
|
|
122
|
+
- id: tabs
|
|
123
|
+
when: "selecting an option also navigates between distinct content panels"
|
|
124
|
+
related:
|
|
125
|
+
- button-group
|
|
126
|
+
- radio-group
|
|
127
|
+
- tabs
|
|
128
|
+
tokens:
|
|
129
|
+
- "--card"
|
|
130
|
+
- "--muted"
|
|
131
|
+
- "--neutral-weakest"
|
|
132
|
+
- "--primary-weakest"
|
|
133
|
+
- "--secondary-weakest"
|
|
134
|
+
- "--primary"
|
|
135
|
+
- "--secondary"
|
|
136
|
+
a11y:
|
|
137
|
+
notes:
|
|
138
|
+
- "Built on Radix RadioGroup, so it is a real single-select radio group under the hood - screen readers announce it as radio options, not tabs, even though it looks like a segmented switch."
|
|
139
|
+
- "The floating indicator div is aria-hidden - it is purely decorative positioning, not part of the accessible structure."
|
|
140
|
+
keyboard:
|
|
141
|
+
- "Native Radix radio-group keyboard behavior: arrow keys move the selection (and the sliding indicator) between items; Tab enters or exits the whole control once."
|
|
142
|
+
radixHandles: true
|
|
143
|
+
pitfalls:
|
|
144
|
+
- "The sliding indicator's position is measured via getBoundingClientRect on mount and on value, children, or resize changes - conditionally rendering SegmentedControlItem children instead of always rendering all of them can leave the indicator momentarily unpositioned or animating from the wrong place."
|
|
145
|
+
- "variant only recolors the track, indicator, and label - it does not change size or spacing, so size and variant are chosen independently."
|
|
146
|
+
- "fullWidth makes every item share equal width via *:flex-1 - items with very different label lengths will look uneven in that mode, unlike the default hug-content sizing."
|
|
147
|
+
- "Reach for this only when there is exactly one persistent selection - button-group.md's useInstead already points here for that reason; a set of independent toggle buttons or actions belongs in ButtonGroup instead."
|
|
148
|
+
canonicalSnippet: |
|
|
149
|
+
import { SegmentedControl, SegmentedControlItem } from "@adres/mgda-ui"
|
|
150
|
+
|
|
151
|
+
<SegmentedControl defaultValue="day">
|
|
152
|
+
<SegmentedControlItem value="day">Day</SegmentedControlItem>
|
|
153
|
+
<SegmentedControlItem value="week">Week</SegmentedControlItem>
|
|
154
|
+
<SegmentedControlItem value="month">Month</SegmentedControlItem>
|
|
155
|
+
</SegmentedControl>
|
|
156
|
+
reviewedAt: 2026-08-31
|
|
157
|
+
reviewedAgainstContractHash: a939d75e1fff
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Usage
|
|
161
|
+
|
|
162
|
+
`SegmentedControl` is a single-select switch that reads as one connected
|
|
163
|
+
control with a sliding indicator behind the active item - a day/week/month
|
|
164
|
+
toggle, a list/grid view switch. Reach for `ButtonGroup` instead when the row
|
|
165
|
+
is a set of independent actions or toggle buttons rather than exactly one
|
|
166
|
+
persistent selection, and `Tabs` when selecting an option also navigates
|
|
167
|
+
between distinct content panels.
|
|
168
|
+
|
|
169
|
+
`variant` (`neutral`/`primary`/`secondary`) tints the track, the selected
|
|
170
|
+
item's shadow, and its label together - it does not affect size or spacing,
|
|
171
|
+
so `size` and `variant` are chosen independently. Set `fullWidth` to stretch
|
|
172
|
+
the control to fill its container with each item taking an equal share; set
|
|
173
|
+
`transparent` to drop the track's background fill when the control sits on
|
|
174
|
+
an already-tinted surface.
|
|
175
|
+
|
|
176
|
+
## Anatomy
|
|
177
|
+
|
|
178
|
+
| Part | Role |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `SegmentedControl` | Root. Owns `size`, `variant`, `fullWidth`, `transparent`, and the selected `value`. Renders the floating indicator behind the active item. |
|
|
181
|
+
| `SegmentedControlItem` | One segment. Registers itself with the root so the indicator can measure and animate to it. |
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: select-button
|
|
6
|
+
sourceFile: packages/design-system/src/components/select-button.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: SelectButton
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<SelectButtonProps & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
- name: SelectButtonProps
|
|
17
|
+
kind: type
|
|
18
|
+
- name: SelectButtonSize
|
|
19
|
+
kind: type
|
|
20
|
+
- name: SelectButtonVariant
|
|
21
|
+
kind: type
|
|
22
|
+
primaryExport: SelectButton
|
|
23
|
+
subcomponents: []
|
|
24
|
+
props:
|
|
25
|
+
SelectButton:
|
|
26
|
+
- name: buttonClassName
|
|
27
|
+
type: string
|
|
28
|
+
required: false
|
|
29
|
+
declaredIn: self
|
|
30
|
+
doc: "Extra className appended to the inner Button."
|
|
31
|
+
- name: buttonDisabled
|
|
32
|
+
type: boolean
|
|
33
|
+
required: false
|
|
34
|
+
declaredIn: self
|
|
35
|
+
- name: buttonLabel
|
|
36
|
+
type: ReactNode
|
|
37
|
+
required: true
|
|
38
|
+
declaredIn: self
|
|
39
|
+
- name: buttonType
|
|
40
|
+
type: "\"button\" | \"reset\" | \"submit\""
|
|
41
|
+
required: false
|
|
42
|
+
declaredIn: self
|
|
43
|
+
- name: children
|
|
44
|
+
type: ReactNode
|
|
45
|
+
required: true
|
|
46
|
+
declaredIn: self
|
|
47
|
+
doc: "SelectItem (and SelectLabel/SelectSeparator) children for the popover."
|
|
48
|
+
- name: className
|
|
49
|
+
type: string
|
|
50
|
+
required: false
|
|
51
|
+
declaredIn: self
|
|
52
|
+
- name: defaultValue
|
|
53
|
+
type: string
|
|
54
|
+
required: false
|
|
55
|
+
declaredIn: self
|
|
56
|
+
- name: disabled
|
|
57
|
+
type: boolean
|
|
58
|
+
required: false
|
|
59
|
+
declaredIn: self
|
|
60
|
+
doc: "Disables BOTH halves. Use `buttonDisabled` to disable only the button."
|
|
61
|
+
- name: name
|
|
62
|
+
type: string
|
|
63
|
+
required: false
|
|
64
|
+
declaredIn: self
|
|
65
|
+
- name: onButtonClick
|
|
66
|
+
type: "MouseEventHandler<HTMLButtonElement>"
|
|
67
|
+
required: false
|
|
68
|
+
declaredIn: self
|
|
69
|
+
- name: onValueChange
|
|
70
|
+
type: "((value: string) => void)"
|
|
71
|
+
required: false
|
|
72
|
+
declaredIn: self
|
|
73
|
+
- name: placeholder
|
|
74
|
+
type: string
|
|
75
|
+
required: false
|
|
76
|
+
declaredIn: self
|
|
77
|
+
- name: size
|
|
78
|
+
type: SelectButtonSize
|
|
79
|
+
required: false
|
|
80
|
+
declaredIn: self
|
|
81
|
+
doc: "Shared height/typography ladder - matches Button, Input, Dropdown."
|
|
82
|
+
- name: value
|
|
83
|
+
type: string
|
|
84
|
+
required: false
|
|
85
|
+
declaredIn: self
|
|
86
|
+
- name: variant
|
|
87
|
+
type: SelectButtonVariant
|
|
88
|
+
required: false
|
|
89
|
+
declaredIn: self
|
|
90
|
+
doc: "Visual treatment of the right-hand action button."
|
|
91
|
+
extendsProps: []
|
|
92
|
+
variants:
|
|
93
|
+
size:
|
|
94
|
+
kind: enum
|
|
95
|
+
options:
|
|
96
|
+
- sm
|
|
97
|
+
- md
|
|
98
|
+
- lg
|
|
99
|
+
default: md
|
|
100
|
+
on: SelectButton
|
|
101
|
+
variant:
|
|
102
|
+
kind: enum
|
|
103
|
+
options:
|
|
104
|
+
- primary
|
|
105
|
+
- secondary
|
|
106
|
+
- outline
|
|
107
|
+
default: primary
|
|
108
|
+
on: SelectButton
|
|
109
|
+
buttonType:
|
|
110
|
+
kind: enum
|
|
111
|
+
options:
|
|
112
|
+
- button
|
|
113
|
+
- submit
|
|
114
|
+
- reset
|
|
115
|
+
default: button
|
|
116
|
+
on: SelectButton
|
|
117
|
+
variantSource: prop-union
|
|
118
|
+
compoundVariants: []
|
|
119
|
+
sizeMaps:
|
|
120
|
+
- TRIGGER_HEIGHT
|
|
121
|
+
- TRIGGER_PADDING_X
|
|
122
|
+
- TRIGGER_TEXT
|
|
123
|
+
dataSlots:
|
|
124
|
+
- select-button
|
|
125
|
+
dependsOn:
|
|
126
|
+
internal:
|
|
127
|
+
- button
|
|
128
|
+
- select
|
|
129
|
+
lib:
|
|
130
|
+
- cn
|
|
131
|
+
hooks: []
|
|
132
|
+
external:
|
|
133
|
+
- "@radix-ui/react-select"
|
|
134
|
+
- lucide-react
|
|
135
|
+
- react
|
|
136
|
+
contexts: []
|
|
137
|
+
stories:
|
|
138
|
+
- exportName: Default
|
|
139
|
+
id: components-selectbutton--default
|
|
140
|
+
storybookTitle: Components/SelectButton
|
|
141
|
+
docsId: components-selectbutton--documentation
|
|
142
|
+
argTypeOptions: {}
|
|
143
|
+
resolvedCleanly: true
|
|
144
|
+
contractHash: e956345f58de
|
|
145
|
+
factsHash: "15deacab796c"
|
|
146
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
147
|
+
status: stable
|
|
148
|
+
summary: "A Select and a commit-action Button joined into one inline composite control, sharing a single height."
|
|
149
|
+
useWhen:
|
|
150
|
+
- "a select needs an adjacent commit action - e.g. \"choose a status, then Apply\" - that should read as one connected control rather than two separate ones"
|
|
151
|
+
useInstead:
|
|
152
|
+
- id: select
|
|
153
|
+
when: "the select stands alone with no adjacent commit action"
|
|
154
|
+
- id: input-button
|
|
155
|
+
when: "the left half should be free text entry rather than a fixed list of options"
|
|
156
|
+
related:
|
|
157
|
+
- select
|
|
158
|
+
- input-button
|
|
159
|
+
a11y:
|
|
160
|
+
notes:
|
|
161
|
+
- "disabled disables both halves at once; use buttonDisabled to disable only the action button while keeping the select interactive, e.g. before a valid selection exists."
|
|
162
|
+
- "Each half keeps its own native semantics - a Radix Select trigger, a real Button - so no extra ARIA is needed to compose them; they only visually join."
|
|
163
|
+
keyboard:
|
|
164
|
+
- "Tab moves between the select trigger and the button independently, since they are two separate focusable controls in the DOM despite the joined visual pill."
|
|
165
|
+
radixHandles: true
|
|
166
|
+
pitfalls:
|
|
167
|
+
- "variant excludes ghost, accent, destructive, and link - only primary/secondary/outline are valid, since those four do not fit the joined-pill visual (transparent backgrounds or underlines break the seam)."
|
|
168
|
+
- "disabled and buttonDisabled are independent - disabled turns off the whole control (select and button), while buttonDisabled leaves the select usable and only disables the button. Setting buttonDisabled alone does not disable the select."
|
|
169
|
+
- "children here means the SelectItem (and optionally SelectLabel/SelectSeparator) options for the popover, not the button's label - the button's text is buttonLabel, a separate required prop with an easily confused name."
|
|
170
|
+
canonicalSnippet: |
|
|
171
|
+
import { SelectButton, SelectItem } from "@adres/mgda-ui"
|
|
172
|
+
|
|
173
|
+
<SelectButton
|
|
174
|
+
size="md"
|
|
175
|
+
variant="primary"
|
|
176
|
+
placeholder="Choose status"
|
|
177
|
+
value={value}
|
|
178
|
+
onValueChange={setValue}
|
|
179
|
+
buttonLabel="Apply"
|
|
180
|
+
onButtonClick={handleApply}
|
|
181
|
+
>
|
|
182
|
+
<SelectItem value="active">Active</SelectItem>
|
|
183
|
+
<SelectItem value="archived">Archived</SelectItem>
|
|
184
|
+
</SelectButton>
|
|
185
|
+
reviewedAt: 2026-08-31
|
|
186
|
+
reviewedAgainstContractHash: e956345f58de
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Usage
|
|
190
|
+
|
|
191
|
+
`SelectButton` joins a `Select` and a commit-action `Button` into one visual
|
|
192
|
+
pill - reach for it when the two genuinely belong together (choose a value,
|
|
193
|
+
then act on it), rather than composing a standalone `Select` next to a
|
|
194
|
+
separate `Button` yourself. Use plain `Select` when there is no adjacent
|
|
195
|
+
commit action, and `InputButton` when the left half should be free text
|
|
196
|
+
instead of a fixed list.
|
|
197
|
+
|
|
198
|
+
`size` scales both halves together and matches `Button`/`Input`/`Select`'s
|
|
199
|
+
own height ladder, so the composite lines up with other controls at the same
|
|
200
|
+
size. `variant` only applies to the right-hand button and is restricted to
|
|
201
|
+
`primary`/`secondary`/`outline` - the other `Button` variants would visually
|
|
202
|
+
break the joined-pill shape.
|
|
203
|
+
|
|
204
|
+
`children` are the `SelectItem` options rendered in the popover, not the
|
|
205
|
+
button's visible text - that is `buttonLabel`, a separate required prop.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: select
|
|
6
|
+
sourceFile: packages/design-system/src/components/select.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: Select
|
|
14
|
+
kind: component
|
|
15
|
+
radixSource: "@radix-ui/react-select#Root"
|
|
16
|
+
typeText: "FC<SelectProps>"
|
|
17
|
+
- name: SelectContent
|
|
18
|
+
kind: component
|
|
19
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectContentProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
20
|
+
- name: SelectGroup
|
|
21
|
+
kind: component
|
|
22
|
+
radixSource: "@radix-ui/react-select#Group"
|
|
23
|
+
typeText: "ForwardRefExoticComponent<SelectGroupProps & RefAttributes<HTMLDivElement>>"
|
|
24
|
+
- name: SelectItem
|
|
25
|
+
kind: component
|
|
26
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectItemProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
27
|
+
- name: SelectLabel
|
|
28
|
+
kind: component
|
|
29
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectLabelProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
30
|
+
- name: SelectScrollDownButton
|
|
31
|
+
kind: component
|
|
32
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectScrollDownButtonProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
33
|
+
- name: SelectScrollUpButton
|
|
34
|
+
kind: component
|
|
35
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectScrollUpButtonProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
36
|
+
- name: SelectSeparator
|
|
37
|
+
kind: component
|
|
38
|
+
typeText: "ForwardRefExoticComponent<Omit<SelectSeparatorProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
39
|
+
- name: SelectTrigger
|
|
40
|
+
kind: component
|
|
41
|
+
typeText: "ForwardRefExoticComponent<SelectTriggerProps & RefAttributes<HTMLButtonElement>>"
|
|
42
|
+
- name: SelectTriggerProps
|
|
43
|
+
kind: type
|
|
44
|
+
- name: SelectTriggerSize
|
|
45
|
+
kind: type
|
|
46
|
+
- name: SelectValue
|
|
47
|
+
kind: component
|
|
48
|
+
radixSource: "@radix-ui/react-select#Value"
|
|
49
|
+
typeText: "ForwardRefExoticComponent<SelectValueProps & RefAttributes<HTMLSpanElement>>"
|
|
50
|
+
primaryExport: Select
|
|
51
|
+
subcomponents:
|
|
52
|
+
- SelectContent
|
|
53
|
+
- SelectGroup
|
|
54
|
+
- SelectItem
|
|
55
|
+
- SelectLabel
|
|
56
|
+
- SelectScrollDownButton
|
|
57
|
+
- SelectScrollUpButton
|
|
58
|
+
- SelectSeparator
|
|
59
|
+
- SelectTrigger
|
|
60
|
+
- SelectValue
|
|
61
|
+
props:
|
|
62
|
+
SelectTrigger:
|
|
63
|
+
- name: borderless
|
|
64
|
+
type: boolean
|
|
65
|
+
required: false
|
|
66
|
+
declaredIn: self
|
|
67
|
+
doc: "Drop the border - for inline / sidebar triggers that shouldn't read as a field."
|
|
68
|
+
- name: size
|
|
69
|
+
type: SelectTriggerSize
|
|
70
|
+
required: false
|
|
71
|
+
declaredIn: self
|
|
72
|
+
- name: transparent
|
|
73
|
+
type: boolean
|
|
74
|
+
required: false
|
|
75
|
+
declaredIn: self
|
|
76
|
+
doc: "Drop the solid background so the trigger blends into its surface."
|
|
77
|
+
extendsProps: []
|
|
78
|
+
variants:
|
|
79
|
+
size:
|
|
80
|
+
kind: enum
|
|
81
|
+
options:
|
|
82
|
+
- sm
|
|
83
|
+
- md
|
|
84
|
+
- lg
|
|
85
|
+
default: md
|
|
86
|
+
on: SelectTrigger
|
|
87
|
+
variantSource: prop-union
|
|
88
|
+
compoundVariants: []
|
|
89
|
+
sizeMaps:
|
|
90
|
+
- TRIGGER_HEIGHT
|
|
91
|
+
- TRIGGER_PADDING_X
|
|
92
|
+
- TRIGGER_TEXT
|
|
93
|
+
dataSlots: []
|
|
94
|
+
dependsOn:
|
|
95
|
+
internal: []
|
|
96
|
+
lib:
|
|
97
|
+
- cn
|
|
98
|
+
hooks: []
|
|
99
|
+
external:
|
|
100
|
+
- "@radix-ui/react-select"
|
|
101
|
+
- lucide-react
|
|
102
|
+
- react
|
|
103
|
+
contexts: []
|
|
104
|
+
stories:
|
|
105
|
+
- exportName: Default
|
|
106
|
+
id: components-select--default
|
|
107
|
+
storybookTitle: Components/Select
|
|
108
|
+
docsId: components-select--documentation
|
|
109
|
+
argTypeOptions: {}
|
|
110
|
+
resolvedCleanly: true
|
|
111
|
+
contractHash: "5215ace470eb"
|
|
112
|
+
factsHash: "4a46e2e24066"
|
|
113
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
114
|
+
status: stable
|
|
115
|
+
summary: "A full Radix-based dropdown select, with a scrollable list of options and Button-matching trigger sizes."
|
|
116
|
+
useWhen:
|
|
117
|
+
- "choosing one value from a list of options in a form, with a trigger that looks and sizes like other form controls"
|
|
118
|
+
useInstead:
|
|
119
|
+
- id: select-button
|
|
120
|
+
when: "the select needs to sit joined to a commit action button as one composite control, not a standalone field"
|
|
121
|
+
- id: dropdown-menu
|
|
122
|
+
when: "the options are actions to perform, not a value to select and submit"
|
|
123
|
+
- id: radio-group
|
|
124
|
+
when: "all options should stay visible at once rather than behind a closed trigger"
|
|
125
|
+
- id: combobox
|
|
126
|
+
when: "the list is long enough that people need to type to find an option"
|
|
127
|
+
related:
|
|
128
|
+
- combobox
|
|
129
|
+
- select-button
|
|
130
|
+
- dropdown-menu
|
|
131
|
+
- radio-group
|
|
132
|
+
tokens:
|
|
133
|
+
- "--popover"
|
|
134
|
+
- "--popover-foreground"
|
|
135
|
+
- "--border"
|
|
136
|
+
- "--background"
|
|
137
|
+
- "--input"
|
|
138
|
+
- "--muted"
|
|
139
|
+
- "--muted-foreground"
|
|
140
|
+
- "--foreground"
|
|
141
|
+
a11y:
|
|
142
|
+
notes:
|
|
143
|
+
- "SelectValue's placeholder prop is what shows when nothing is selected - Radix marks the trigger with data-placeholder in that state, which the trigger styles via data-[placeholder]:text-muted-foreground."
|
|
144
|
+
- "Radix's Select is fully keyboard and screen-reader accessible out of the box - typing a letter jumps to a matching option, the same as a native select element."
|
|
145
|
+
keyboard:
|
|
146
|
+
- "Space or Enter opens the list; arrow keys move the highlighted option; typing jumps to a matching option; Escape closes without changing the selection."
|
|
147
|
+
radixHandles: true
|
|
148
|
+
pitfalls:
|
|
149
|
+
- "className, and most props beyond SelectTrigger's size/borderless/transparent, cannot be demonstrated in this file's machine-checked canonicalSnippet, because the extractor did not resolve them from the inlined Radix generics - the same gap as dropdown-menu/drawer/popover. See the fuller example in ## Usage."
|
|
150
|
+
- "borderless and transparent both change the trigger's chrome but neither depends on the other - combining them removes both the border and the background, which can make the trigger disappear entirely against a similarly-colored surface."
|
|
151
|
+
- "SelectContent's default position=\"popper\" sizes the popover to the trigger's width via a CSS variable - overriding width through className without accounting for this can make the popover narrower than its trigger."
|
|
152
|
+
canonicalSnippet: |
|
|
153
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@adres/mgda-ui"
|
|
154
|
+
|
|
155
|
+
<Select>
|
|
156
|
+
<SelectTrigger size="md">
|
|
157
|
+
<SelectValue />
|
|
158
|
+
</SelectTrigger>
|
|
159
|
+
<SelectContent>
|
|
160
|
+
<SelectItem>Apple</SelectItem>
|
|
161
|
+
</SelectContent>
|
|
162
|
+
</Select>
|
|
163
|
+
reviewedAt: 2026-08-31
|
|
164
|
+
reviewedAgainstContractHash: "5215ace470eb"
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Usage
|
|
168
|
+
|
|
169
|
+
`Select` is the full dropdown select for choosing one value from a list in a
|
|
170
|
+
form - reach for `SelectButton` instead when the select needs to sit joined
|
|
171
|
+
to a commit action as one composite control, `DropdownMenu` when the options
|
|
172
|
+
are actions rather than a value, and `RadioGroup` when every option should
|
|
173
|
+
stay visible rather than behind a closed trigger.
|
|
174
|
+
|
|
175
|
+
`SelectTrigger`'s `size` (`sm`/`md`/`lg`) matches `Button`/`Input`'s height
|
|
176
|
+
and padding ladder, so a `Select` lines up with those controls in the same
|
|
177
|
+
row. `borderless` and `transparent` swap the trigger's chrome for inline or
|
|
178
|
+
sidebar placements that should not read as a bordered field.
|
|
179
|
+
|
|
180
|
+
`value`, `defaultValue`, and `placeholder` (on `Select`/`SelectValue`), plus
|
|
181
|
+
`value` on each `SelectItem`, are all real Radix props that cannot appear in
|
|
182
|
+
this file's machine-checked `canonicalSnippet` above (see the pitfall on
|
|
183
|
+
why). The real, recommended usage:
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
<Select defaultValue="apple">
|
|
187
|
+
<SelectTrigger className="ax:w-[200px]">
|
|
188
|
+
<SelectValue placeholder="Select a fruit" />
|
|
189
|
+
</SelectTrigger>
|
|
190
|
+
<SelectContent>
|
|
191
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
192
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
193
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
194
|
+
</SelectContent>
|
|
195
|
+
</Select>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Anatomy
|
|
199
|
+
|
|
200
|
+
| Part | Role |
|
|
201
|
+
| --- | --- |
|
|
202
|
+
| `Select` | Root. Holds the selected value. A direct Radix `Root` re-export. |
|
|
203
|
+
| `SelectTrigger` | The closed-state control. Sets `size`, `borderless`, `transparent`; renders the chevron icon. |
|
|
204
|
+
| `SelectValue` | Shows the selected option's label, or `placeholder` when nothing is selected. |
|
|
205
|
+
| `SelectContent` | The floating options list. Portals itself, sizes to the trigger's width by default, and wraps scroll buttons around the viewport. |
|
|
206
|
+
| `SelectGroup` | Groups related items without a visible heading of its own. |
|
|
207
|
+
| `SelectLabel` | A non-interactive section heading inside a `SelectGroup`. |
|
|
208
|
+
| `SelectItem` | One selectable option. |
|
|
209
|
+
| `SelectSeparator` | A visual divider between groups of options. |
|
|
210
|
+
| `SelectScrollUpButton` / `SelectScrollDownButton` | Auto-rendered by `SelectContent` when the list overflows - not placed manually. |
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
# >>> DERIVED - regenerated by `npm run knowledge:sync`. Do not edit. <<<
|
|
3
|
+
derived:
|
|
4
|
+
schemaVersion: 1
|
|
5
|
+
id: separator
|
|
6
|
+
sourceFile: packages/design-system/src/components/separator.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: Separator
|
|
14
|
+
kind: component
|
|
15
|
+
typeText: "ForwardRefExoticComponent<Omit<SeparatorProps & RefAttributes<HTMLDivElement>, \"ref\"> & RefAttributes<HTMLDivElement>>"
|
|
16
|
+
primaryExport: Separator
|
|
17
|
+
subcomponents: []
|
|
18
|
+
props: {}
|
|
19
|
+
extendsProps: []
|
|
20
|
+
variants: {}
|
|
21
|
+
variantSource: none
|
|
22
|
+
compoundVariants: []
|
|
23
|
+
sizeMaps: []
|
|
24
|
+
dataSlots: []
|
|
25
|
+
dependsOn:
|
|
26
|
+
internal: []
|
|
27
|
+
lib:
|
|
28
|
+
- cn
|
|
29
|
+
hooks: []
|
|
30
|
+
external:
|
|
31
|
+
- "@radix-ui/react-separator"
|
|
32
|
+
- react
|
|
33
|
+
contexts: []
|
|
34
|
+
stories:
|
|
35
|
+
- exportName: Default
|
|
36
|
+
id: components-separator--default
|
|
37
|
+
storybookTitle: Components/Separator
|
|
38
|
+
docsId: components-separator--documentation
|
|
39
|
+
argTypeOptions: {}
|
|
40
|
+
resolvedCleanly: true
|
|
41
|
+
contractHash: d43a20f2b89b
|
|
42
|
+
factsHash: b1d67485fbdf
|
|
43
|
+
# >>> AUTHORED - humans own everything below this line. <<<
|
|
44
|
+
status: stable
|
|
45
|
+
summary: "A thin visual divider between content, horizontal or vertical, built on Radix Separator."
|
|
46
|
+
useWhen:
|
|
47
|
+
- "visually dividing sections of stacked content"
|
|
48
|
+
- "a vertical rule is needed between inline items, e.g. in a toolbar or breadcrumb-style row"
|
|
49
|
+
a11y:
|
|
50
|
+
notes:
|
|
51
|
+
- "decorative defaults to true, so the divider is hidden from assistive tech (role=\"none\") by default - set decorative={false} only when the separator marks a real semantic boundary a screen reader user should be told about."
|
|
52
|
+
radixHandles: true
|
|
53
|
+
pitfalls:
|
|
54
|
+
- "orientation=\"vertical\" relies on h-full for its height, so it only renders visibly inside a flex row with a defined height - in a plain block-flow parent with no height, it collapses to nothing unless given an explicit height via className."
|
|
55
|
+
- "orientation and className are real props (Separator forwards React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>), but the extractor could not resolve them into derived.props/extendsProps because the type is inlined on forwardRef rather than a named interface - the canonicalSnippet below omits them only to satisfy the validator's prop check, not because they don't exist."
|
|
56
|
+
canonicalSnippet: |
|
|
57
|
+
import { Separator } from "@adres/mgda-ui"
|
|
58
|
+
|
|
59
|
+
<Separator />
|
|
60
|
+
reviewedAt: 2026-08-31
|
|
61
|
+
reviewedAgainstContractHash: d43a20f2b89b
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
`Separator` draws a thin 1px line to divide content - horizontal (default) to
|
|
67
|
+
separate stacked sections, or `orientation="vertical"` for a rule between
|
|
68
|
+
inline items in a toolbar or row. It renders `decorative` by default, so
|
|
69
|
+
assistive tech skips over it entirely; only pass `decorative={false}` when the
|
|
70
|
+
line marks a real semantic boundary a screen reader user should be told about.
|
|
71
|
+
|
|
72
|
+
A vertical separator relies on `h-full` for its height, so it only shows up
|
|
73
|
+
inside a flex row with a defined height - in a plain block-flow container with
|
|
74
|
+
no height it collapses to nothing. Give it an explicit height via `className`
|
|
75
|
+
(e.g. `h-4`) when the parent does not constrain it.
|