@rio-cloud/uikit-mcp 1.1.4 → 1.1.6
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/README.md +1 -0
- package/dist/doc-metadata.json +188 -88
- package/dist/docs/components/accentBar.md +35 -3
- package/dist/docs/components/activity.md +14 -3
- package/dist/docs/components/animatedNumber.md +17 -4
- package/dist/docs/components/animatedTextReveal.md +54 -8
- package/dist/docs/components/animations.md +33 -33
- package/dist/docs/components/appHeader.md +65 -9
- package/dist/docs/components/appLayout.md +566 -61
- package/dist/docs/components/appNavigationBar.md +55 -3
- package/dist/docs/components/areaCharts.md +14 -14
- package/dist/docs/components/aspectRatioPlaceholder.md +11 -3
- package/dist/docs/components/assetTree.md +1174 -328
- package/dist/docs/components/autosuggests.md +2 -2
- package/dist/docs/components/avatar.md +25 -3
- package/dist/docs/components/banner.md +3 -3
- package/dist/docs/components/barCharts.md +38 -38
- package/dist/docs/components/barList.md +22 -10
- package/dist/docs/components/basicMap.md +2 -2
- package/dist/docs/components/bottomSheet.md +100 -3
- package/dist/docs/components/button.md +549 -36
- package/dist/docs/components/buttonToolbar.md +10 -3
- package/dist/docs/components/calendarStripe.md +127 -85
- package/dist/docs/components/card.md +11 -3
- package/dist/docs/components/carousel.md +2 -2
- package/dist/docs/components/chartColors.md +2 -2
- package/dist/docs/components/chartsGettingStarted.md +2 -2
- package/dist/docs/components/chat.md +3 -3
- package/dist/docs/components/checkbox.md +67 -45
- package/dist/docs/components/circularProgress.md +465 -0
- package/dist/docs/components/clearableInput.md +18 -18
- package/dist/docs/components/collapse.md +28 -4
- package/dist/docs/components/composedCharts.md +20 -20
- package/dist/docs/components/contentLoader.md +126 -105
- package/dist/docs/components/dataTabs.md +191 -11
- package/dist/docs/components/datepickers.md +735 -723
- package/dist/docs/components/dialogs.md +362 -2
- package/dist/docs/components/divider.md +15 -3
- package/dist/docs/components/dropdowns.md +4548 -4355
- package/dist/docs/components/editableContent.md +187 -3
- package/dist/docs/components/expander.md +52 -5
- package/dist/docs/components/fade.md +42 -7
- package/dist/docs/components/fadeExpander.md +13 -4
- package/dist/docs/components/fadeUp.md +22 -4
- package/dist/docs/components/feedback.md +44 -3
- package/dist/docs/components/filePickers.md +45 -3
- package/dist/docs/components/formLabel.md +20 -5
- package/dist/docs/components/groupedItemList.md +54 -3
- package/dist/docs/components/iconList.md +5 -5
- package/dist/docs/components/imagePreloader.md +7 -3
- package/dist/docs/components/labeledElement.md +13 -3
- package/dist/docs/components/licensePlate.md +11 -3
- package/dist/docs/components/lineCharts.md +10 -10
- package/dist/docs/components/listMenu.md +78 -8
- package/dist/docs/components/loadMore.md +29 -3
- package/dist/docs/components/mainNavigation.md +5 -5
- package/dist/docs/components/mapCircle.md +2 -2
- package/dist/docs/components/mapCluster.md +2 -2
- package/dist/docs/components/mapContext.md +2 -2
- package/dist/docs/components/mapDraggableMarker.md +2 -2
- package/dist/docs/components/mapGettingStarted.md +2 -2
- package/dist/docs/components/mapInfoBubble.md +2 -2
- package/dist/docs/components/mapLayerGroup.md +2 -2
- package/dist/docs/components/mapMarker.md +2 -2
- package/dist/docs/components/mapPolygon.md +2 -2
- package/dist/docs/components/mapRoute.md +2 -2
- package/dist/docs/components/mapRouteGenerator.md +2 -2
- package/dist/docs/components/mapSettings.md +9 -9
- package/dist/docs/components/mapUtils.md +2 -2
- package/dist/docs/components/multiselects.md +2 -2
- package/dist/docs/components/noData.md +23 -3
- package/dist/docs/components/notifications.md +2 -2
- package/dist/docs/components/numbercontrol.md +54 -5
- package/dist/docs/components/onboarding.md +26 -2
- package/dist/docs/components/page.md +33 -3
- package/dist/docs/components/pager.md +15 -3
- package/dist/docs/components/pieCharts.md +89 -78
- package/dist/docs/components/popover.md +40 -2
- package/dist/docs/components/position.md +11 -3
- package/dist/docs/components/radialBarCharts.md +2054 -2012
- package/dist/docs/components/radioCardGroup.md +487 -0
- package/dist/docs/components/radiobutton.md +138 -10
- package/dist/docs/components/releaseNotes.md +19 -2
- package/dist/docs/components/resizer.md +14 -3
- package/dist/docs/components/responsiveColumnStripe.md +20 -3
- package/dist/docs/components/responsiveVideo.md +12 -3
- package/dist/docs/components/rioglyph.md +13 -3
- package/dist/docs/components/rules.md +95 -5
- package/dist/docs/components/saveableInput.md +400 -276
- package/dist/docs/components/selects.md +2 -2
- package/dist/docs/components/sidebar.md +39 -3
- package/dist/docs/components/sliders.md +38 -3
- package/dist/docs/components/smoothScrollbars.md +93 -3
- package/dist/docs/components/spinners.md +51 -3
- package/dist/docs/components/states.md +217 -2
- package/dist/docs/components/statsWidgets.md +123 -3
- package/dist/docs/components/statusBar.md +29 -3
- package/dist/docs/components/stepButton.md +9 -3
- package/dist/docs/components/steppedProgressBars.md +67 -3
- package/dist/docs/components/subNavigation.md +24 -17
- package/dist/docs/components/supportMarker.md +2 -2
- package/dist/docs/components/svgImage.md +13 -3
- package/dist/docs/components/switch.md +218 -82
- package/dist/docs/components/tables.md +2 -2
- package/dist/docs/components/tagManager.md +56 -2
- package/dist/docs/components/tags.md +33 -3
- package/dist/docs/components/teaser.md +30 -3
- package/dist/docs/components/textTruncateMiddle.md +151 -0
- package/dist/docs/components/timeline.md +2 -2
- package/dist/docs/components/timepicker.md +687 -63
- package/dist/docs/components/toggleButton.md +96 -10
- package/dist/docs/components/tooltip.md +30 -21
- package/dist/docs/components/tracker.md +631 -0
- package/dist/docs/components/virtualList.md +107 -84
- package/dist/docs/foundations.md +647 -275
- package/dist/docs/start/changelog.md +2 -738
- package/dist/docs/start/goodtoknow.md +2 -2
- package/dist/docs/start/guidelines/color-combinations.md +2 -2
- package/dist/docs/start/guidelines/custom-css.md +2 -2
- package/dist/docs/start/guidelines/custom-rioglyph.md +2 -2
- package/dist/docs/start/guidelines/formatting.md +2 -2
- package/dist/docs/start/guidelines/iframe.md +2 -2
- package/dist/docs/start/guidelines/obfuscate-data.md +2 -2
- package/dist/docs/start/guidelines/print-css.md +2 -2
- package/dist/docs/start/guidelines/spinner.md +82 -82
- package/dist/docs/start/guidelines/state-in-url.md +263 -0
- package/dist/docs/start/guidelines/supported-browsers.md +2 -2
- package/dist/docs/start/guidelines/writing.md +2 -2
- package/dist/docs/start/howto.md +10 -10
- package/dist/docs/start/intro.md +2 -2
- package/dist/docs/start/responsiveness.md +2 -2
- package/dist/docs/templates/common-table.md +15 -14
- package/dist/docs/templates/detail-views.md +3 -3
- package/dist/docs/templates/expandable-details.md +2 -2
- package/dist/docs/templates/feature-cards.md +56 -56
- package/dist/docs/templates/form-summary.md +23 -23
- package/dist/docs/templates/form-toggle.md +2 -2
- package/dist/docs/templates/list-blocks.md +204 -204
- package/dist/docs/templates/loading-progress.md +2 -2
- package/dist/docs/templates/options-panel.md +2 -2
- package/dist/docs/templates/panel-variants.md +2 -2
- package/dist/docs/templates/progress-cards.md +2 -2
- package/dist/docs/templates/progress-success.md +2 -2
- package/dist/docs/templates/settings-form.md +24 -24
- package/dist/docs/templates/stats-blocks.md +18 -18
- package/dist/docs/templates/table-panel.md +2 -2
- package/dist/docs/templates/table-row-animation.md +2 -2
- package/dist/docs/templates/usage-cards.md +2 -2
- package/dist/docs/utilities/classNames.md +191 -0
- package/dist/docs/utilities/deviceUtils.md +2 -2
- package/dist/docs/utilities/featureToggles.md +2 -2
- package/dist/docs/utilities/fuelTypeUtils.md +2 -2
- package/dist/docs/utilities/routeUtils.md +326 -90
- package/dist/docs/utilities/useAfterMount.md +2 -2
- package/dist/docs/utilities/useAutoAnimate.md +2 -2
- package/dist/docs/utilities/useAverage.md +2 -2
- package/dist/docs/utilities/useClickOutside.md +2 -2
- package/dist/docs/utilities/useClipboard.md +3 -3
- package/dist/docs/utilities/useCookies.md +188 -0
- package/dist/docs/utilities/useCount.md +2 -2
- package/dist/docs/utilities/useDarkMode.md +2 -2
- package/dist/docs/utilities/useDebugInfo.md +5 -5
- package/dist/docs/utilities/useEffectOnce.md +2 -2
- package/dist/docs/utilities/useElapsedTime.md +2 -2
- package/dist/docs/utilities/useElementSize.md +2 -2
- package/dist/docs/utilities/useEsc.md +2 -2
- package/dist/docs/utilities/useEvent.md +2 -2
- package/dist/docs/utilities/useFocusTrap.md +2 -2
- package/dist/docs/utilities/useFullscreen.md +2 -2
- package/dist/docs/utilities/useHover.md +2 -2
- package/dist/docs/utilities/useIncomingPostMessages.md +2 -2
- package/dist/docs/utilities/useInterval.md +2 -2
- package/dist/docs/utilities/useIsFocusWithin.md +2 -2
- package/dist/docs/utilities/useKey.md +2 -2
- package/dist/docs/utilities/useLocalStorage.md +2 -2
- package/dist/docs/utilities/useLocationSuggestions.md +2 -2
- package/dist/docs/utilities/useMax.md +2 -2
- package/dist/docs/utilities/useMin.md +2 -2
- package/dist/docs/utilities/useMutationObserver.md +2 -2
- package/dist/docs/utilities/useOnScreen.md +2 -2
- package/dist/docs/utilities/useOnlineStatus.md +2 -2
- package/dist/docs/utilities/usePostMessage.md +3 -3
- package/dist/docs/utilities/usePostMessageSender.md +2 -2
- package/dist/docs/utilities/usePrevious.md +2 -2
- package/dist/docs/utilities/useResizeObserver.md +2 -2
- package/dist/docs/utilities/useRioCookieConsent.md +90 -0
- package/dist/docs/utilities/useScrollPosition.md +2 -2
- package/dist/docs/utilities/useSearch.md +2 -2
- package/dist/docs/utilities/useSearchHighlight.md +815 -0
- package/dist/docs/utilities/useSorting.md +2 -2
- package/dist/docs/utilities/useStateWithValidation.md +2 -2
- package/dist/docs/utilities/useSum.md +2 -2
- package/dist/docs/utilities/useTableExport.md +53 -53
- package/dist/docs/utilities/useTableSelection.md +90 -90
- package/dist/docs/utilities/useTimeout.md +2 -2
- package/dist/docs/utilities/useToggle.md +3 -3
- package/dist/docs/utilities/useUrlState.md +418 -0
- package/dist/docs/utilities/useWindowResize.md +2 -2
- package/dist/index.mjs +8 -8
- package/dist/version.json +2 -2
- package/package.json +9 -9
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
# RadioCardGroup
|
|
2
|
+
|
|
3
|
+
*Category:* Components
|
|
4
|
+
*Section:* Interaction
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/components/radioCardGroup
|
|
6
|
+
*Captured:* 2026-02-23T13:41:43.932Z
|
|
7
|
+
|
|
8
|
+
Card-based radio selection built on top of RadioButton. Supports options-based usage and a compound API via RadioCardItem and RadioCardIndicator.
|
|
9
|
+
|
|
10
|
+
## RadioCardGroup
|
|
11
|
+
|
|
12
|
+
### Example: This option is a first option
|
|
13
|
+
|
|
14
|
+
Inline cardsOption 1
|
|
15
|
+
This option is a first option
|
|
16
|
+
|
|
17
|
+
Option 2
|
|
18
|
+
This option is a second option
|
|
19
|
+
|
|
20
|
+
Option 3
|
|
21
|
+
This option is a third option
|
|
22
|
+
|
|
23
|
+
Stacked horizontal cardsLorem ipsum
|
|
24
|
+
|
|
25
|
+
Dolor sit amet
|
|
26
|
+
|
|
27
|
+
Qui repellat dolores
|
|
28
|
+
|
|
29
|
+
Stacked cardsOption 1
|
|
30
|
+
This option is a first option
|
|
31
|
+
|
|
32
|
+
Option 2 (disabled)
|
|
33
|
+
This option is a second option
|
|
34
|
+
|
|
35
|
+
Option 3
|
|
36
|
+
This option is a third option
|
|
37
|
+
|
|
38
|
+
Option 4
|
|
39
|
+
This option is a forth option
|
|
40
|
+
|
|
41
|
+
Reset selectionUnselect
|
|
42
|
+
|
|
43
|
+
#### Summary
|
|
44
|
+
|
|
45
|
+
Inline cardsOption 1
|
|
46
|
+
This option is a first option
|
|
47
|
+
|
|
48
|
+
Option 2
|
|
49
|
+
This option is a second option
|
|
50
|
+
|
|
51
|
+
Option 3
|
|
52
|
+
This option is a third option
|
|
53
|
+
|
|
54
|
+
Stacked horizontal cardsLorem ipsum
|
|
55
|
+
|
|
56
|
+
Dolor sit amet
|
|
57
|
+
|
|
58
|
+
Qui repellat dolores
|
|
59
|
+
|
|
60
|
+
Stacked cardsOption 1
|
|
61
|
+
This option is a first option
|
|
62
|
+
|
|
63
|
+
Option 2 (disabled)
|
|
64
|
+
This option is a second option
|
|
65
|
+
|
|
66
|
+
Option 3
|
|
67
|
+
This option is a third option
|
|
68
|
+
|
|
69
|
+
Option 4
|
|
70
|
+
This option is a forth option
|
|
71
|
+
|
|
72
|
+
Reset selectionUnselect
|
|
73
|
+
|
|
74
|
+
#### React (tsx)
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { useState } from 'react';
|
|
78
|
+
|
|
79
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
80
|
+
import RadioCardGroup, { type RadioCardOption } from '@rio-cloud/rio-uikit/RadioCardGroup';
|
|
81
|
+
|
|
82
|
+
const boxOptions: RadioCardOption[] = [
|
|
83
|
+
{
|
|
84
|
+
value: 'option-1',
|
|
85
|
+
label: 'Option 1',
|
|
86
|
+
description: 'This option is a first option',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: 'option-2',
|
|
90
|
+
label: 'Option 2',
|
|
91
|
+
description: 'This option is a second option',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: 'option-3',
|
|
95
|
+
label: 'Option 3',
|
|
96
|
+
description: 'This option is a third option',
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
const stackedHorizontalOption: RadioCardOption[] = [
|
|
101
|
+
{
|
|
102
|
+
value: 'option-1',
|
|
103
|
+
label: 'Lorem ipsum',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: 'option-2',
|
|
107
|
+
label: 'Dolor sit amet',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
value: 'option-3',
|
|
111
|
+
label: 'Qui repellat dolores',
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
const stackedOptions: RadioCardOption[] = [
|
|
116
|
+
{
|
|
117
|
+
value: 'option-1',
|
|
118
|
+
label: 'Option 1',
|
|
119
|
+
description: 'This option is a first option',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
value: 'option-2',
|
|
123
|
+
label: 'Option 2 (disabled)',
|
|
124
|
+
description: 'This option is a second option',
|
|
125
|
+
disabled: true,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: 'option-3',
|
|
129
|
+
label: 'Option 3',
|
|
130
|
+
description: 'This option is a third option',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
value: 'option-4',
|
|
134
|
+
label: 'Option 4',
|
|
135
|
+
description: 'This option is a forth option',
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
export default () => {
|
|
140
|
+
const [boxValue, setBoxValue] = useState('option-1');
|
|
141
|
+
const [stackedValue, setStackedValue] = useState('option-1');
|
|
142
|
+
const [stackedHorizontalValue, setStackedHorizontalValue] = useState('option-1');
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<div className='space-y-50'>
|
|
146
|
+
<div>
|
|
147
|
+
<label>Inline cards</label>
|
|
148
|
+
<RadioCardGroup
|
|
149
|
+
name='radioCardGroupInline'
|
|
150
|
+
options={boxOptions}
|
|
151
|
+
value={boxValue}
|
|
152
|
+
onChange={nextValue => setBoxValue(nextValue)}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
<div>
|
|
156
|
+
<label>Stacked horizontal cards</label>
|
|
157
|
+
<RadioCardGroup
|
|
158
|
+
name='radioCardGroupStackedHorizontal'
|
|
159
|
+
options={stackedHorizontalOption}
|
|
160
|
+
value={stackedHorizontalValue}
|
|
161
|
+
onChange={nextValue => setStackedHorizontalValue(nextValue)}
|
|
162
|
+
variant='stacked-horizontal'
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
<div>
|
|
166
|
+
<label>Stacked cards</label>
|
|
167
|
+
<RadioCardGroup
|
|
168
|
+
name='radioCardGroupStacked'
|
|
169
|
+
options={stackedOptions}
|
|
170
|
+
value={stackedValue}
|
|
171
|
+
onChange={nextValue => setStackedValue(nextValue)}
|
|
172
|
+
variant='stacked'
|
|
173
|
+
/>
|
|
174
|
+
<div className='display-flex gap-10 margin-top-10'>
|
|
175
|
+
<Button onClick={() => setStackedValue('option-1')}>Reset selection</Button>
|
|
176
|
+
<Button onClick={() => setStackedValue('')}>Unselect</Button>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### HTML (html)
|
|
185
|
+
|
|
186
|
+
```html
|
|
187
|
+
<div class="space-y-50">
|
|
188
|
+
<div>
|
|
189
|
+
<label>Inline cards</label>
|
|
190
|
+
<div class="display-flex gap-15">
|
|
191
|
+
<label class="radio padding-15 border rounded border-color-highlight" tabindex="0">
|
|
192
|
+
<input type="radio" class="padding-15 border rounded border-color-highlight" name="radioCardGroupInline" value="option-1" checked="">
|
|
193
|
+
<div class="radio-text-wrapper display-flex">
|
|
194
|
+
<span class="radio-text">
|
|
195
|
+
</span>
|
|
196
|
+
<div class="margin-left-5 margin-right-5">
|
|
197
|
+
<div class="text-medium">Option 1</div>
|
|
198
|
+
<div class="text-color-dark">This option is a first option</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</label>
|
|
202
|
+
<label class="radio padding-15 border rounded" tabindex="0">
|
|
203
|
+
<input type="radio" class="padding-15 border rounded" name="radioCardGroupInline" value="option-2">
|
|
204
|
+
<div class="radio-text-wrapper display-flex">
|
|
205
|
+
<span class="radio-text">
|
|
206
|
+
</span>
|
|
207
|
+
<div class="margin-left-5 margin-right-5">
|
|
208
|
+
<div class="text-medium">Option 2</div>
|
|
209
|
+
<div class="text-color-dark">This option is a second option</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</label>
|
|
213
|
+
<label class="radio padding-15 border rounded" tabindex="0">
|
|
214
|
+
<input type="radio" class="padding-15 border rounded" name="radioCardGroupInline" value="option-3">
|
|
215
|
+
<div class="radio-text-wrapper display-flex">
|
|
216
|
+
<span class="radio-text">
|
|
217
|
+
</span>
|
|
218
|
+
<div class="margin-left-5 margin-right-5">
|
|
219
|
+
<div class="text-medium">Option 3</div>
|
|
220
|
+
<div class="text-color-dark">This option is a third option</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</label>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div>
|
|
227
|
+
<label>Stacked horizontal cards</label>
|
|
228
|
+
<div class="display-flex">
|
|
229
|
+
<label class="radio padding-15 border rounded-top-left rounded-bottom-left border-color-highlight bg-highlight-decent z-index-1" tabindex="0">
|
|
230
|
+
<input type="radio" class="padding-15 border rounded-top-left rounded-bottom-left border-color-highlight bg-highlight-decent z-index-1" name="radioCardGroupStackedHorizontal" value="option-1" checked="">
|
|
231
|
+
<div class="radio-text-wrapper display-flex">
|
|
232
|
+
<span class="radio-text">
|
|
233
|
+
</span>
|
|
234
|
+
<div class="margin-left-5 margin-right-5">
|
|
235
|
+
<div class="text-medium">Lorem ipsum</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</label>
|
|
239
|
+
<label class="radio padding-15 border margin-left--1" tabindex="0">
|
|
240
|
+
<input type="radio" class="padding-15 border margin-left--1" name="radioCardGroupStackedHorizontal" value="option-2">
|
|
241
|
+
<div class="radio-text-wrapper display-flex">
|
|
242
|
+
<span class="radio-text">
|
|
243
|
+
</span>
|
|
244
|
+
<div class="margin-left-5 margin-right-5">
|
|
245
|
+
<div class="text-medium">Dolor sit amet</div>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</label>
|
|
249
|
+
<label class="radio padding-15 border margin-left--1 rounded-top-right rounded-bottom-right" tabindex="0">
|
|
250
|
+
<input type="radio" class="padding-15 border margin-left--1 rounded-top-right rounded-bottom-right" name="radioCardGroupStackedHorizontal" value="option-3">
|
|
251
|
+
<div class="radio-text-wrapper display-flex">
|
|
252
|
+
<span class="radio-text">
|
|
253
|
+
</span>
|
|
254
|
+
<div class="margin-left-5 margin-right-5">
|
|
255
|
+
<div class="text-medium">Qui repellat dolores</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</label>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
<div>
|
|
262
|
+
<label>Stacked cards</label>
|
|
263
|
+
<div class="display-flex flex-column">
|
|
264
|
+
<label class="radio padding-15 border rounded-top-left rounded-top-right border-color-highlight bg-highlight-decent z-index-1" tabindex="0">
|
|
265
|
+
<input type="radio" class="padding-15 border rounded-top-left rounded-top-right border-color-highlight bg-highlight-decent z-index-1" name="radioCardGroupStacked" value="option-1" checked="">
|
|
266
|
+
<div class="radio-text-wrapper display-flex">
|
|
267
|
+
<span class="radio-text">
|
|
268
|
+
</span>
|
|
269
|
+
<div class="margin-left-5 margin-right-5">
|
|
270
|
+
<div class="text-medium">Option 1</div>
|
|
271
|
+
<div class="text-color-dark">This option is a first option</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
</label>
|
|
275
|
+
<label class="radio padding-15 border margin-top--1" tabindex="0">
|
|
276
|
+
<input type="radio" disabled="" class="padding-15 border margin-top--1" name="radioCardGroupStacked" value="option-2">
|
|
277
|
+
<div class="radio-text-wrapper display-flex">
|
|
278
|
+
<span class="radio-text">
|
|
279
|
+
</span>
|
|
280
|
+
<div class="margin-left-5 margin-right-5">
|
|
281
|
+
<div class="text-medium">Option 2 (disabled)</div>
|
|
282
|
+
<div class="text-color-dark">This option is a second option</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</label>
|
|
286
|
+
<label class="radio padding-15 border margin-top--1" tabindex="0">
|
|
287
|
+
<input type="radio" class="padding-15 border margin-top--1" name="radioCardGroupStacked" value="option-3">
|
|
288
|
+
<div class="radio-text-wrapper display-flex">
|
|
289
|
+
<span class="radio-text">
|
|
290
|
+
</span>
|
|
291
|
+
<div class="margin-left-5 margin-right-5">
|
|
292
|
+
<div class="text-medium">Option 3</div>
|
|
293
|
+
<div class="text-color-dark">This option is a third option</div>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
</label>
|
|
297
|
+
<label class="radio padding-15 border margin-top--1 rounded-bottom-left rounded-bottom-right" tabindex="0">
|
|
298
|
+
<input type="radio" class="padding-15 border margin-top--1 rounded-bottom-left rounded-bottom-right" name="radioCardGroupStacked" value="option-4">
|
|
299
|
+
<div class="radio-text-wrapper display-flex">
|
|
300
|
+
<span class="radio-text">
|
|
301
|
+
</span>
|
|
302
|
+
<div class="margin-left-5 margin-right-5">
|
|
303
|
+
<div class="text-medium">Option 4</div>
|
|
304
|
+
<div class="text-color-dark">This option is a forth option</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
</label>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="display-flex gap-10 margin-top-10">
|
|
310
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Reset selection</button>
|
|
311
|
+
<button type="button" class="btn btn-default btn-component" tabindex="0">Unselect</button>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
#### Props: RadioCardGroup
|
|
318
|
+
|
|
319
|
+
### RadioCardGroup
|
|
320
|
+
|
|
321
|
+
| Name | Type | Default | Description |
|
|
322
|
+
| --- | --- | --- | --- |
|
|
323
|
+
| name | string | — | Name used for all radios in this group. |
|
|
324
|
+
| options | RadioCardOption[] | — | List of selectable options. |
|
|
325
|
+
| value | string | — | Selected value (controlled usage). |
|
|
326
|
+
| defaultValue | string | — | Initially selected value (uncontrolled usage). |
|
|
327
|
+
| variant | 'inline' \| 'stacked' \| 'stacked-horizontal' | 'inline' | Card layout variant. Possible values are: 'inline', 'stacked' or 'stacked-horizontal'. |
|
|
328
|
+
| gap | string | 'gap-15' | Gap utility class used for the inline layout. |
|
|
329
|
+
| onChange | (value: string, event: ChangeEvent<HTMLInputElement>) => void | — | Callback invoked when selection changes. |
|
|
330
|
+
| cardClassName | string | — | Additional classes applied to each card. |
|
|
331
|
+
|
|
332
|
+
#### Props: RadioCardItem
|
|
333
|
+
|
|
334
|
+
### RadioCardItem
|
|
335
|
+
|
|
336
|
+
| Name | Type | Default | Description |
|
|
337
|
+
| --- | --- | --- | --- |
|
|
338
|
+
| value | string | — | Value passed to the underlying radio input. |
|
|
339
|
+
| disabled | boolean | false | Disables this radio card. |
|
|
340
|
+
|
|
341
|
+
## Compound API with mapped items
|
|
342
|
+
|
|
343
|
+
### Example: This option is a first option
|
|
344
|
+
|
|
345
|
+
Compound API with mapped itemsOption 1
|
|
346
|
+
This option is a first option
|
|
347
|
+
|
|
348
|
+
Option 2
|
|
349
|
+
This option is a second option
|
|
350
|
+
|
|
351
|
+
Option 3
|
|
352
|
+
This option is a third option
|
|
353
|
+
|
|
354
|
+
#### Summary
|
|
355
|
+
|
|
356
|
+
Compound API with mapped itemsOption 1
|
|
357
|
+
This option is a first option
|
|
358
|
+
|
|
359
|
+
Option 2
|
|
360
|
+
This option is a second option
|
|
361
|
+
|
|
362
|
+
Option 3
|
|
363
|
+
This option is a third option
|
|
364
|
+
|
|
365
|
+
#### React (tsx)
|
|
366
|
+
|
|
367
|
+
```tsx
|
|
368
|
+
import { useState } from 'react';
|
|
369
|
+
|
|
370
|
+
import RadioCardGroup, {
|
|
371
|
+
RadioCardIndicator,
|
|
372
|
+
RadioCardItem,
|
|
373
|
+
type RadioCardOption,
|
|
374
|
+
} from '@rio-cloud/rio-uikit/RadioCardGroup';
|
|
375
|
+
|
|
376
|
+
const options: RadioCardOption[] = [
|
|
377
|
+
{
|
|
378
|
+
value: 'option-1',
|
|
379
|
+
label: 'Option 1',
|
|
380
|
+
description: 'This option is a first option',
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
value: 'option-2',
|
|
384
|
+
label: 'Option 2',
|
|
385
|
+
description: 'This option is a second option',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
value: 'option-3',
|
|
389
|
+
label: 'Option 3',
|
|
390
|
+
description: 'This option is a third option',
|
|
391
|
+
},
|
|
392
|
+
];
|
|
393
|
+
|
|
394
|
+
export default () => {
|
|
395
|
+
const [value, setValue] = useState('option-1');
|
|
396
|
+
|
|
397
|
+
return (
|
|
398
|
+
<div className='max-width-500'>
|
|
399
|
+
<label>Compound API with mapped items</label>
|
|
400
|
+
<RadioCardGroup
|
|
401
|
+
name='radioCardGroupCompound'
|
|
402
|
+
value={value}
|
|
403
|
+
onChange={nextValue => setValue(nextValue)}
|
|
404
|
+
className='display-grid grid-cols-2 gap-10'
|
|
405
|
+
cardClassName='text-size-14'
|
|
406
|
+
>
|
|
407
|
+
{options.map(option => (
|
|
408
|
+
<RadioCardItem key={option.value} value={option.value}>
|
|
409
|
+
<div className='flex-1-1 margin-x-5'>
|
|
410
|
+
<div className='text-medium'>{option.label}</div>
|
|
411
|
+
<div className='text-color-dark'>{option.description}</div>
|
|
412
|
+
</div>
|
|
413
|
+
<RadioCardIndicator />
|
|
414
|
+
</RadioCardItem>
|
|
415
|
+
))}
|
|
416
|
+
</RadioCardGroup>
|
|
417
|
+
</div>
|
|
418
|
+
);
|
|
419
|
+
};
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
#### HTML (html)
|
|
423
|
+
|
|
424
|
+
```html
|
|
425
|
+
<div class="max-width-500">
|
|
426
|
+
<label>Compound API with mapped items</label>
|
|
427
|
+
<div class="display-flex gap-15 display-grid grid-cols-2 gap-10">
|
|
428
|
+
<label class="radio padding-15 border rounded border-color-highlight text-size-14" tabindex="0">
|
|
429
|
+
<input type="radio" class="padding-15 border rounded border-color-highlight text-size-14" name="radioCardGroupCompound" value="option-1" checked="">
|
|
430
|
+
<div class="radio-text-wrapper display-flex">
|
|
431
|
+
<div class="flex-1-1 margin-x-5">
|
|
432
|
+
<div class="text-medium">Option 1</div>
|
|
433
|
+
<div class="text-color-dark">This option is a first option</div>
|
|
434
|
+
</div>
|
|
435
|
+
<span class="radio-text">
|
|
436
|
+
</span>
|
|
437
|
+
</div>
|
|
438
|
+
</label>
|
|
439
|
+
<label class="radio padding-15 border rounded text-size-14" tabindex="0">
|
|
440
|
+
<input type="radio" class="padding-15 border rounded text-size-14" name="radioCardGroupCompound" value="option-2">
|
|
441
|
+
<div class="radio-text-wrapper display-flex">
|
|
442
|
+
<div class="flex-1-1 margin-x-5">
|
|
443
|
+
<div class="text-medium">Option 2</div>
|
|
444
|
+
<div class="text-color-dark">This option is a second option</div>
|
|
445
|
+
</div>
|
|
446
|
+
<span class="radio-text">
|
|
447
|
+
</span>
|
|
448
|
+
</div>
|
|
449
|
+
</label>
|
|
450
|
+
<label class="radio padding-15 border rounded text-size-14" tabindex="0">
|
|
451
|
+
<input type="radio" class="padding-15 border rounded text-size-14" name="radioCardGroupCompound" value="option-3">
|
|
452
|
+
<div class="radio-text-wrapper display-flex">
|
|
453
|
+
<div class="flex-1-1 margin-x-5">
|
|
454
|
+
<div class="text-medium">Option 3</div>
|
|
455
|
+
<div class="text-color-dark">This option is a third option</div>
|
|
456
|
+
</div>
|
|
457
|
+
<span class="radio-text">
|
|
458
|
+
</span>
|
|
459
|
+
</div>
|
|
460
|
+
</label>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### Props: RadioCardGroup
|
|
466
|
+
|
|
467
|
+
### RadioCardGroup
|
|
468
|
+
|
|
469
|
+
| Name | Type | Default | Description |
|
|
470
|
+
| --- | --- | --- | --- |
|
|
471
|
+
| name | string | — | Name used for all radios in this group. |
|
|
472
|
+
| options | RadioCardOption[] | — | List of selectable options. |
|
|
473
|
+
| value | string | — | Selected value (controlled usage). |
|
|
474
|
+
| defaultValue | string | — | Initially selected value (uncontrolled usage). |
|
|
475
|
+
| variant | 'inline' \| 'stacked' \| 'stacked-horizontal' | 'inline' | Card layout variant. Possible values are: 'inline', 'stacked' or 'stacked-horizontal'. |
|
|
476
|
+
| gap | string | 'gap-15' | Gap utility class used for the inline layout. |
|
|
477
|
+
| onChange | (value: string, event: ChangeEvent<HTMLInputElement>) => void | — | Callback invoked when selection changes. |
|
|
478
|
+
| cardClassName | string | — | Additional classes applied to each card. |
|
|
479
|
+
|
|
480
|
+
#### Props: RadioCardItem
|
|
481
|
+
|
|
482
|
+
### RadioCardItem
|
|
483
|
+
|
|
484
|
+
| Name | Type | Default | Description |
|
|
485
|
+
| --- | --- | --- | --- |
|
|
486
|
+
| value | string | — | Value passed to the underlying radio input. |
|
|
487
|
+
| disabled | boolean | false | Disables this radio card. |
|