@rio-cloud/uikit-mcp 1.0.0
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/LICENSE +202 -0
- package/README.md +91 -0
- package/bin/uikit-mcp.mjs +23 -0
- package/data/pages/Components/components/accentbar.json +207 -0
- package/data/pages/Components/components/activity.json +87 -0
- package/data/pages/Components/components/animatednumber.json +99 -0
- package/data/pages/Components/components/animations.json +87 -0
- package/data/pages/Components/components/appheader.json +291 -0
- package/data/pages/Components/components/applayout.json +1198 -0
- package/data/pages/Components/components/appnavigationbar.json +327 -0
- package/data/pages/Components/components/areacharts.json +563 -0
- package/data/pages/Components/components/aspectratioplaceholder.json +75 -0
- package/data/pages/Components/components/assettree.json +3080 -0
- package/data/pages/Components/components/autosuggests.json +710 -0
- package/data/pages/Components/components/avatar.json +157 -0
- package/data/pages/Components/components/banner.json +599 -0
- package/data/pages/Components/components/barcharts.json +1507 -0
- package/data/pages/Components/components/barlist.json +223 -0
- package/data/pages/Components/components/basicmap.json +68 -0
- package/data/pages/Components/components/bottomsheet.json +601 -0
- package/data/pages/Components/components/button.json +583 -0
- package/data/pages/Components/components/buttontoolbar.json +63 -0
- package/data/pages/Components/components/calendarstripe.json +235 -0
- package/data/pages/Components/components/card.json +69 -0
- package/data/pages/Components/components/carousel.json +39 -0
- package/data/pages/Components/components/chartcolors.json +34 -0
- package/data/pages/Components/components/chartsgettingstarted.json +32 -0
- package/data/pages/Components/components/chat.json +39 -0
- package/data/pages/Components/components/checkbox.json +847 -0
- package/data/pages/Components/components/clearableinput.json +789 -0
- package/data/pages/Components/components/collapse.json +175 -0
- package/data/pages/Components/components/composedcharts.json +159 -0
- package/data/pages/Components/components/contentloader.json +233 -0
- package/data/pages/Components/components/datatabs.json +680 -0
- package/data/pages/Components/components/datepickers.json +287 -0
- package/data/pages/Components/components/dialogs.json +1492 -0
- package/data/pages/Components/components/divider.json +93 -0
- package/data/pages/Components/components/dropdowns.json +936 -0
- package/data/pages/Components/components/editablecontent.json +1117 -0
- package/data/pages/Components/components/expander.json +377 -0
- package/data/pages/Components/components/fade.json +403 -0
- package/data/pages/Components/components/fadeexpander.json +75 -0
- package/data/pages/Components/components/fadeup.json +127 -0
- package/data/pages/Components/components/feedback.json +269 -0
- package/data/pages/Components/components/filepickers.json +269 -0
- package/data/pages/Components/components/formlabel.json +115 -0
- package/data/pages/Components/components/fullscreenmap.json +22 -0
- package/data/pages/Components/components/groupeditemlist.json +323 -0
- package/data/pages/Components/components/iconlist.json +45 -0
- package/data/pages/Components/components/imagepreloader.json +81 -0
- package/data/pages/Components/components/labeledelement.json +75 -0
- package/data/pages/Components/components/licenseplate.json +69 -0
- package/data/pages/Components/components/linecharts.json +987 -0
- package/data/pages/Components/components/listmenu.json +313 -0
- package/data/pages/Components/components/loadmore.json +175 -0
- package/data/pages/Components/components/mainnavigation.json +39 -0
- package/data/pages/Components/components/mapcircle.json +34 -0
- package/data/pages/Components/components/mapcluster.json +51 -0
- package/data/pages/Components/components/mapcontext.json +105 -0
- package/data/pages/Components/components/mapdraggablemarker.json +34 -0
- package/data/pages/Components/components/mapgettingstarted.json +27 -0
- package/data/pages/Components/components/mapgroup.json +1198 -0
- package/data/pages/Components/components/mapinfobubble.json +34 -0
- package/data/pages/Components/components/maplayergroup.json +34 -0
- package/data/pages/Components/components/mapmarker.json +700 -0
- package/data/pages/Components/components/mappolygon.json +45 -0
- package/data/pages/Components/components/maproute.json +623 -0
- package/data/pages/Components/components/maproutegenerator.json +16 -0
- package/data/pages/Components/components/mapsettings.json +51 -0
- package/data/pages/Components/components/maputils.json +34 -0
- package/data/pages/Components/components/multiselects.json +1451 -0
- package/data/pages/Components/components/nodata.json +139 -0
- package/data/pages/Components/components/notifications.json +65 -0
- package/data/pages/Components/components/numbercontrol.json +301 -0
- package/data/pages/Components/components/onboarding.json +302 -0
- package/data/pages/Components/components/page.json +197 -0
- package/data/pages/Components/components/pager.json +93 -0
- package/data/pages/Components/components/piecharts.json +731 -0
- package/data/pages/Components/components/popover.json +251 -0
- package/data/pages/Components/components/position.json +69 -0
- package/data/pages/Components/components/radialbarcharts.json +1304 -0
- package/data/pages/Components/components/radiobutton.json +1105 -0
- package/data/pages/Components/components/releasenotes.json +44 -0
- package/data/pages/Components/components/resizer.json +93 -0
- package/data/pages/Components/components/responsivecolumnstripe.json +123 -0
- package/data/pages/Components/components/responsivevideo.json +75 -0
- package/data/pages/Components/components/rioglyph.json +93 -0
- package/data/pages/Components/components/rules.json +410 -0
- package/data/pages/Components/components/saveableinput.json +703 -0
- package/data/pages/Components/components/selects.json +701 -0
- package/data/pages/Components/components/sidebar.json +243 -0
- package/data/pages/Components/components/sliders.json +235 -0
- package/data/pages/Components/components/smoothscrollbars.json +335 -0
- package/data/pages/Components/components/spinners.json +343 -0
- package/data/pages/Components/components/states.json +1705 -0
- package/data/pages/Components/components/statswidgets.json +314 -0
- package/data/pages/Components/components/statusbar.json +177 -0
- package/data/pages/Components/components/stepbutton.json +57 -0
- package/data/pages/Components/components/steppedprogressbars.json +417 -0
- package/data/pages/Components/components/subnavigation.json +107 -0
- package/data/pages/Components/components/supportmarker.json +45 -0
- package/data/pages/Components/components/svgimage.json +81 -0
- package/data/pages/Components/components/switch.json +111 -0
- package/data/pages/Components/components/tables.json +144 -0
- package/data/pages/Components/components/tagmanager.json +86 -0
- package/data/pages/Components/components/tags.json +146 -0
- package/data/pages/Components/components/teaser.json +188 -0
- package/data/pages/Components/components/timeline.json +45 -0
- package/data/pages/Components/components/timepicker.json +163 -0
- package/data/pages/Components/components/togglebutton.json +247 -0
- package/data/pages/Components/components/tooltip.json +270 -0
- package/data/pages/Components/components/virtuallist.json +175 -0
- package/data/pages/Foundations/foundations.json +2475 -0
- package/data/pages/Getting-started/start/changelog.json +22 -0
- package/data/pages/Getting-started/start/goodtoknow.json +32 -0
- package/data/pages/Getting-started/start/guidelines/color-combinations.json +58 -0
- package/data/pages/Getting-started/start/guidelines/custom-css.json +27 -0
- package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +22 -0
- package/data/pages/Getting-started/start/guidelines/formatting.json +97 -0
- package/data/pages/Getting-started/start/guidelines/iframe.json +93 -0
- package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +22 -0
- package/data/pages/Getting-started/start/guidelines/print-css.json +37 -0
- package/data/pages/Getting-started/start/guidelines/spinner.json +144 -0
- package/data/pages/Getting-started/start/guidelines/supported-browsers.json +22 -0
- package/data/pages/Getting-started/start/guidelines/writing.json +242 -0
- package/data/pages/Getting-started/start/howto.json +72 -0
- package/data/pages/Getting-started/start/intro.json +37 -0
- package/data/pages/Getting-started/start/responsiveness.json +52 -0
- package/data/pages/Templates/templates/common-table.json +39 -0
- package/data/pages/Templates/templates/detail-views.json +71 -0
- package/data/pages/Templates/templates/expandable-details.json +39 -0
- package/data/pages/Templates/templates/feature-cards.json +103 -0
- package/data/pages/Templates/templates/form-summary.json +39 -0
- package/data/pages/Templates/templates/form-toggle.json +39 -0
- package/data/pages/Templates/templates/list-blocks.json +119 -0
- package/data/pages/Templates/templates/loading-progress.json +39 -0
- package/data/pages/Templates/templates/options-panel.json +39 -0
- package/data/pages/Templates/templates/panel-variants.json +39 -0
- package/data/pages/Templates/templates/progress-cards.json +71 -0
- package/data/pages/Templates/templates/progress-success.json +39 -0
- package/data/pages/Templates/templates/settings-form.json +39 -0
- package/data/pages/Templates/templates/stats-blocks.json +135 -0
- package/data/pages/Templates/templates/table-panel.json +39 -0
- package/data/pages/Templates/templates/table-row-animation.json +39 -0
- package/data/pages/Templates/templates/usage-cards.json +39 -0
- package/data/pages/Utilities/utilities/deviceutils.json +39 -0
- package/data/pages/Utilities/utilities/featuretoggles.json +42 -0
- package/data/pages/Utilities/utilities/fueltypeutils.json +118 -0
- package/data/pages/Utilities/utilities/routeutils.json +34 -0
- package/data/pages/Utilities/utilities/useaftermount.json +63 -0
- package/data/pages/Utilities/utilities/useaverage.json +86 -0
- package/data/pages/Utilities/utilities/useclickoutside.json +69 -0
- package/data/pages/Utilities/utilities/useclipboard.json +57 -0
- package/data/pages/Utilities/utilities/usecount.json +92 -0
- package/data/pages/Utilities/utilities/usedarkmode.json +50 -0
- package/data/pages/Utilities/utilities/usedebuginfo.json +63 -0
- package/data/pages/Utilities/utilities/useeffectonce.json +57 -0
- package/data/pages/Utilities/utilities/useelapsedtime.json +57 -0
- package/data/pages/Utilities/utilities/useelementsize.json +63 -0
- package/data/pages/Utilities/utilities/useesc.json +57 -0
- package/data/pages/Utilities/utilities/useevent.json +75 -0
- package/data/pages/Utilities/utilities/usefocustrap.json +57 -0
- package/data/pages/Utilities/utilities/usefullscreen.json +197 -0
- package/data/pages/Utilities/utilities/usehover.json +57 -0
- package/data/pages/Utilities/utilities/useinterval.json +63 -0
- package/data/pages/Utilities/utilities/useisfocuswithin.json +75 -0
- package/data/pages/Utilities/utilities/usekey.json +75 -0
- package/data/pages/Utilities/utilities/uselocalstorage.json +69 -0
- package/data/pages/Utilities/utilities/uselocationsuggestions.json +110 -0
- package/data/pages/Utilities/utilities/usemax.json +86 -0
- package/data/pages/Utilities/utilities/usemin.json +86 -0
- package/data/pages/Utilities/utilities/usemutationobserver.json +69 -0
- package/data/pages/Utilities/utilities/useonlinestatus.json +39 -0
- package/data/pages/Utilities/utilities/useonscreen.json +63 -0
- package/data/pages/Utilities/utilities/usepostmessage.json +80 -0
- package/data/pages/Utilities/utilities/useprevious.json +63 -0
- package/data/pages/Utilities/utilities/useresizeobserver.json +65 -0
- package/data/pages/Utilities/utilities/usescrollposition.json +103 -0
- package/data/pages/Utilities/utilities/usesearch.json +197 -0
- package/data/pages/Utilities/utilities/usesorting.json +139 -0
- package/data/pages/Utilities/utilities/usestatewithvalidation.json +69 -0
- package/data/pages/Utilities/utilities/usesum.json +86 -0
- package/data/pages/Utilities/utilities/usetableexport.json +87 -0
- package/data/pages/Utilities/utilities/usetableselection.json +311 -0
- package/data/pages/Utilities/utilities/usetimeout.json +63 -0
- package/data/pages/Utilities/utilities/usetoggle.json +75 -0
- package/data/pages/Utilities/utilities/usewindowresize.json +63 -0
- package/data/version.json +4 -0
- package/docs/content-schema.md +147 -0
- package/docs/navigation-inventory.json +1310 -0
- package/docs/search-synonyms.json +43 -0
- package/package.json +38 -0
- package/server/index.mjs +268 -0
- package/server/lib/load-docs.mjs +48 -0
- package/server/lib/normalise-doc.mjs +220 -0
- package/server/lib/render-markdown.mjs +82 -0
- package/server/lib/search-index.mjs +49 -0
- package/server/lib/types.js +99 -0
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"captured_at": "2025-11-21T12:07:11.895Z",
|
|
4
|
+
"source": "https://uikit.developers.rio.cloud/#components/checkbox",
|
|
5
|
+
"category": "Components",
|
|
6
|
+
"section": "Interaction",
|
|
7
|
+
"slug": "components/checkbox",
|
|
8
|
+
"version": "v1.13.2",
|
|
9
|
+
"hash_algorithm": "sha256",
|
|
10
|
+
"hash": "13db96c691a7fca2b997bff95714c666a57f83ab59c23dfb2d957744ef7a9cda"
|
|
11
|
+
},
|
|
12
|
+
"title": "Checkbox",
|
|
13
|
+
"lead": null,
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"heading": "Checkbox",
|
|
17
|
+
"body": "",
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"caption": "Example 1",
|
|
21
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div class=\"row\"><fieldset class=\"col-sm-4\"><legend class=\"margin-bottom-5\">Select multiple</legend><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Some custom text</span></span></label></p><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\" checked=\"\"><span class=\"checkbox-text\"><span>This one is initially checked</span></span></label></p><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"indeterminate\"><span class=\"checkbox-text\"><span>Indeterminate state</span></span></label></p></fieldset><fieldset class=\"col-sm-4\"><legend class=\"margin-bottom-5\">Disabled checkboxes</legend><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" disabled=\"\" class=\"\"><span class=\"checkbox-text\"><span>Disabled checkbox</span></span></label></p><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" disabled=\"\" class=\"\" checked=\"\"><span class=\"checkbox-text\"><span>Disabled checked checkbox</span></span></label></p></fieldset><fieldset class=\"col-sm-4\"><legend class=\"margin-bottom-5\">Various props</legend><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Checkbox with provided label</span></span></label></p><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"error\"><span class=\"checkbox-text\"><span>Checkbox with error state</span></span></label></p><form><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" required=\"\" class=\"\"><span class=\"checkbox-text\"><span>Required Checkbox *</span></span></label></p><button class=\"btn btn-primary\" type=\"submit\">Required submit test</button></form></fieldset><div class=\"col-12\"><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span><span>Some text containing a link to <span class=\"link\">Terms and Condition</span> which need to be read.</span></span></span></label></p><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><p><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Option 1</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Option 2</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Option 3</span></span></label></p><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><div class=\"display-flex content-space-between gap-20\"><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</span></span></label><label class=\"checkbox checkbox-right\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</span></span></label></div><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><p><label class=\"checkbox checkbox-large\" tabindex=\"0\"><input type=\"checkbox\" class=\"large\"><span class=\"checkbox-text\"><span>Large checkbox</span></span></label></p><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div><p><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"></span></label></p><div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\"><div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\"></div></div></div><div class=\"col-12\"><div class=\"display-grid gap-20 align-items-baseline grid-cols-9\"><div class=\"grid-colspan-3\">\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</div><div class=\"grid-colspan-4\"><label class=\"checkbox\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Checkbox inside grid layout</span></span></label></div></div></div></div></div>",
|
|
22
|
+
"tabs": [
|
|
23
|
+
{
|
|
24
|
+
"label": "React",
|
|
25
|
+
"language": "tsx",
|
|
26
|
+
"code": "import Checkbox from '@rio-cloud/rio-uikit/Checkbox';\nimport Divider from '@rio-cloud/rio-uikit/Divider';\n\nimport { dummyTextShort } from '../../../utils/data';\n\nexport default () => (\n <div className='row'>\n <fieldset className='col-sm-4'>\n <legend className='margin-bottom-5'>Select multiple</legend>\n <p>\n <Checkbox>Some custom text</Checkbox>\n </p>\n <p>\n <Checkbox defaultChecked>This one is initially checked</Checkbox>\n </p>\n <p>\n <Checkbox indeterminate>Indeterminate state</Checkbox>\n </p>\n </fieldset>\n <fieldset className='col-sm-4'>\n <legend className='margin-bottom-5'>Disabled checkboxes</legend>\n <p>\n <Checkbox disabled>Disabled checkbox</Checkbox>\n </p>\n <p>\n <Checkbox disabled defaultChecked>\n Disabled checked checkbox\n </Checkbox>\n </p>\n </fieldset>\n <fieldset className='col-sm-4'>\n <legend className='margin-bottom-5'>Various props</legend>\n <p>\n <Checkbox label='Checkbox with provided label' />\n </p>\n <p>\n <Checkbox error label='Checkbox with error state' />\n </p>\n <form>\n <p>\n <Checkbox required label='Required Checkbox *' />\n </p>\n <button className='btn btn-primary' type='submit'>\n Required submit test\n </button>\n </form>\n </fieldset>\n <div className='col-12'>\n <Divider />\n <p>\n <Checkbox>\n <span>\n Some text containing a link to <span className='link'>Terms and Condition</span> which need to\n be read.\n </span>\n </Checkbox>\n </p>\n <Divider />\n <p>\n <Checkbox inline>Option 1</Checkbox>\n <Checkbox inline>Option 2</Checkbox>\n <Checkbox inline>Option 3</Checkbox>\n </p>\n <Divider />\n <div className='display-flex content-space-between gap-20'>\n <Checkbox>{dummyTextShort}</Checkbox>\n\n <Checkbox right>{dummyTextShort}</Checkbox>\n </div>\n <Divider />\n <p>\n <Checkbox size='large'>Large checkbox</Checkbox>\n </p>\n <Divider />\n <p>\n <Checkbox />\n </p>\n <Divider />\n </div>\n <div className='col-12'>\n <div className='display-grid gap-20 align-items-baseline grid-cols-9'>\n <div className='grid-colspan-3'>{dummyTextShort}</div>\n <div className='grid-colspan-4'>\n <Checkbox label='Checkbox inside grid layout' />\n </div>\n </div>\n </div>\n </div>\n);"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "HTML",
|
|
30
|
+
"language": "html",
|
|
31
|
+
"code": "<div class=\"row\">\n <fieldset class=\"col-sm-4\">\n <legend class=\"margin-bottom-5\">Select multiple</legend>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Some custom text</span>\n </span>\n </label>\n </p>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\" checked=\"\">\n <span class=\"checkbox-text\">\n <span>This one is initially checked</span>\n </span>\n </label>\n </p>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"indeterminate\">\n <span class=\"checkbox-text\">\n <span>Indeterminate state</span>\n </span>\n </label>\n </p>\n </fieldset>\n <fieldset class=\"col-sm-4\">\n <legend class=\"margin-bottom-5\">Disabled checkboxes</legend>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" disabled=\"\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Disabled checkbox</span>\n </span>\n </label>\n </p>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" disabled=\"\" class=\"\" checked=\"\">\n <span class=\"checkbox-text\">\n <span>Disabled checked checkbox</span>\n </span>\n </label>\n </p>\n </fieldset>\n <fieldset class=\"col-sm-4\">\n <legend class=\"margin-bottom-5\">Various props</legend>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Checkbox with provided label</span>\n </span>\n </label>\n </p>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"error\">\n <span class=\"checkbox-text\">\n <span>Checkbox with error state</span>\n </span>\n </label>\n </p>\n <form>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" required=\"\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Required Checkbox *</span>\n </span>\n </label>\n </p>\n <button class=\"btn btn-primary\" type=\"submit\">Required submit test</button>\n </form>\n </fieldset>\n <div class=\"col-12\">\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>\n <span>Some text containing a link to <span class=\"link\">Terms and Condition</span> which need to be read.</span>\n </span>\n </span>\n </label>\n </p>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <p>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Option 1</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Option 2</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Option 3</span>\n </span>\n </label>\n </p>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <div class=\"display-flex content-space-between gap-20\">\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-right\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</span>\n </span>\n </label>\n </div>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <p>\n <label class=\"checkbox checkbox-large\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"large\">\n <span class=\"checkbox-text\">\n <span>Large checkbox</span>\n </span>\n </label>\n </p>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n <p>\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n </span>\n </label>\n </p>\n <div class=\"Divider position-relative width-100pct\" style=\"padding-top: 15px; padding-bottom: 15px;\">\n <div class=\"divider-line bg-light\" style=\"width: 100%; height: 1px;\">\n </div>\n </div>\n </div>\n <div class=\"col-12\">\n <div class=\"display-grid gap-20 align-items-baseline grid-cols-9\">\n <div class=\"grid-colspan-3\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pharetra dui eget massa efficitur aliquam condimentum in felis. Integer eget metus vel nunc efficitur iaculis. Vivamus elementum ante et est sagittis semper. Ut consectetur enim nec tortor scelerisque tincidunt.</div>\n <div class=\"grid-colspan-4\">\n <label class=\"checkbox\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Checkbox inside grid layout</span>\n </span>\n </label>\n </div>\n </div>\n </div>\n</div>"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"label": "Props",
|
|
35
|
+
"language": "json",
|
|
36
|
+
"code": null,
|
|
37
|
+
"props": [
|
|
38
|
+
{
|
|
39
|
+
"heading": null,
|
|
40
|
+
"rows": [
|
|
41
|
+
{
|
|
42
|
+
"name": "id",
|
|
43
|
+
"type": "String",
|
|
44
|
+
"default": "",
|
|
45
|
+
"description": "Passed through as HTML attribute to the underlying input. id. (Uses name otherwise.)"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "name",
|
|
49
|
+
"type": "String",
|
|
50
|
+
"default": "",
|
|
51
|
+
"description": "Passed through as HTML attribute to the underlying inputname."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "label",
|
|
55
|
+
"type": "String / Node",
|
|
56
|
+
"default": "",
|
|
57
|
+
"description": "Define some text as a label."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "checked",
|
|
61
|
+
"type": "String / Boolean",
|
|
62
|
+
"default": "",
|
|
63
|
+
"description": "Defines whether the checkbox is checked or not (state cannot be changed)."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "defaultChecked",
|
|
67
|
+
"type": "String / Boolean",
|
|
68
|
+
"default": "",
|
|
69
|
+
"description": "Defines whether the checkbox is initially checked or not (state can be changed on click)."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "disabled",
|
|
73
|
+
"type": "Boolean",
|
|
74
|
+
"default": "false",
|
|
75
|
+
"description": "Defines whether the checkbox is disabled or not."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "indeterminate",
|
|
79
|
+
"type": "Boolean",
|
|
80
|
+
"default": "false",
|
|
81
|
+
"description": "Defines if the checkbox is in an indeterminate state with regards to other checkboxes that may be in different selection state."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "inline",
|
|
85
|
+
"type": "Boolean",
|
|
86
|
+
"default": "false",
|
|
87
|
+
"description": "Defines whether the checkbox is applying an inline style. Use this in combination with other checkboxes."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "right",
|
|
91
|
+
"type": "Boolean",
|
|
92
|
+
"default": "false",
|
|
93
|
+
"description": "Defines whether the checkbox is on the right side."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "custom",
|
|
97
|
+
"type": "Boolean",
|
|
98
|
+
"default": "false",
|
|
99
|
+
"description": "Allows for rendering a completely different layout with or without a checkbox tick."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "onClick",
|
|
103
|
+
"type": "Function",
|
|
104
|
+
"default": "() => {}",
|
|
105
|
+
"description": "Callback function that is invoked when the checkbox is checked or unchecked."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "onChange",
|
|
109
|
+
"type": "Function",
|
|
110
|
+
"default": "() => {}",
|
|
111
|
+
"description": "Callback function that is invoked when the checkbox value changes. This will also be invoked by a keyboard event."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "error",
|
|
115
|
+
"type": "Boolean",
|
|
116
|
+
"default": "false",
|
|
117
|
+
"description": "Use \"error\" to change color of the checkbox."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "required",
|
|
121
|
+
"type": "Boolean",
|
|
122
|
+
"default": "false",
|
|
123
|
+
"description": "Defines whether the checkbox is required or not."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "size",
|
|
127
|
+
"type": "String",
|
|
128
|
+
"default": "",
|
|
129
|
+
"description": "Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size. Possible values are: 'large'"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "tabIndex",
|
|
133
|
+
"type": "Number",
|
|
134
|
+
"default": "0",
|
|
135
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "className",
|
|
139
|
+
"type": "String",
|
|
140
|
+
"default": "",
|
|
141
|
+
"description": "Additional classes to be set on the input field."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "children",
|
|
145
|
+
"type": "any",
|
|
146
|
+
"default": "",
|
|
147
|
+
"description": "Any element to be rendered next to the checkbox."
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "icon",
|
|
151
|
+
"type": "String",
|
|
152
|
+
"default": "",
|
|
153
|
+
"description": "Define a custom icon for the checkbox by naming a rioglyph icon like \"rioglyph-truck\"."
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "iconSize",
|
|
157
|
+
"type": "Number",
|
|
158
|
+
"default": "",
|
|
159
|
+
"description": "The icon size in pixel."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "iconLabelPosition",
|
|
163
|
+
"type": "String",
|
|
164
|
+
"default": "",
|
|
165
|
+
"description": "The label position for a custom icon checkbox. Using this on a regular checkbox has no effect. Possible values are: \"horizontal\" or \"vertical\"."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "inputRef",
|
|
169
|
+
"type": "Ref",
|
|
170
|
+
"default": "",
|
|
171
|
+
"description": "A react ref assigned to the input itself."
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"heading": "Controlled example",
|
|
183
|
+
"body": "",
|
|
184
|
+
"examples": [
|
|
185
|
+
{
|
|
186
|
+
"caption": "Example 2",
|
|
187
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\" checked=\"\"><span class=\"checkbox-text\"><span>Option 1</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Option 2</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-text\"><span>Option 3</span></span></label></div></div>",
|
|
188
|
+
"tabs": [
|
|
189
|
+
{
|
|
190
|
+
"label": "React",
|
|
191
|
+
"language": "tsx",
|
|
192
|
+
"code": "import { useState } from 'react';\nimport pull from 'lodash/fp/pull';\n\nimport Checkbox from '@rio-cloud/rio-uikit/Checkbox';\n\nexport default () => {\n const [selectedOptions, setSelectedOptions] = useState([1]);\n\n const handleSelect = (selected: number) => {\n const updatedSelectedOptions = selectedOptions.includes(selected)\n ? pull(selected, selectedOptions)\n : [...selectedOptions, selected];\n\n setSelectedOptions(updatedSelectedOptions);\n };\n\n return (\n <div>\n <Checkbox onChange={() => handleSelect(1)} checked={selectedOptions.includes(1)} inline>\n Option 1\n </Checkbox>\n <Checkbox onChange={() => handleSelect(2)} checked={selectedOptions.includes(2)} inline>\n Option 2\n </Checkbox>\n <Checkbox onChange={() => handleSelect(3)} checked={selectedOptions.includes(3)} inline>\n Option 3\n </Checkbox>\n </div>\n );\n};"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"label": "HTML",
|
|
196
|
+
"language": "html",
|
|
197
|
+
"code": "<div>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\" checked=\"\">\n <span class=\"checkbox-text\">\n <span>Option 1</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Option 2</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-text\">\n <span>Option 3</span>\n </span>\n </label>\n</div>"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"label": "Props",
|
|
201
|
+
"language": "json",
|
|
202
|
+
"code": null,
|
|
203
|
+
"props": [
|
|
204
|
+
{
|
|
205
|
+
"heading": null,
|
|
206
|
+
"rows": [
|
|
207
|
+
{
|
|
208
|
+
"name": "id",
|
|
209
|
+
"type": "String",
|
|
210
|
+
"default": "",
|
|
211
|
+
"description": "Passed through as HTML attribute to the underlying input. id. (Uses name otherwise.)"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "name",
|
|
215
|
+
"type": "String",
|
|
216
|
+
"default": "",
|
|
217
|
+
"description": "Passed through as HTML attribute to the underlying inputname."
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "label",
|
|
221
|
+
"type": "String / Node",
|
|
222
|
+
"default": "",
|
|
223
|
+
"description": "Define some text as a label."
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "checked",
|
|
227
|
+
"type": "String / Boolean",
|
|
228
|
+
"default": "",
|
|
229
|
+
"description": "Defines whether the checkbox is checked or not (state cannot be changed)."
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "defaultChecked",
|
|
233
|
+
"type": "String / Boolean",
|
|
234
|
+
"default": "",
|
|
235
|
+
"description": "Defines whether the checkbox is initially checked or not (state can be changed on click)."
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "disabled",
|
|
239
|
+
"type": "Boolean",
|
|
240
|
+
"default": "false",
|
|
241
|
+
"description": "Defines whether the checkbox is disabled or not."
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "indeterminate",
|
|
245
|
+
"type": "Boolean",
|
|
246
|
+
"default": "false",
|
|
247
|
+
"description": "Defines if the checkbox is in an indeterminate state with regards to other checkboxes that may be in different selection state."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "inline",
|
|
251
|
+
"type": "Boolean",
|
|
252
|
+
"default": "false",
|
|
253
|
+
"description": "Defines whether the checkbox is applying an inline style. Use this in combination with other checkboxes."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "right",
|
|
257
|
+
"type": "Boolean",
|
|
258
|
+
"default": "false",
|
|
259
|
+
"description": "Defines whether the checkbox is on the right side."
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "custom",
|
|
263
|
+
"type": "Boolean",
|
|
264
|
+
"default": "false",
|
|
265
|
+
"description": "Allows for rendering a completely different layout with or without a checkbox tick."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "onClick",
|
|
269
|
+
"type": "Function",
|
|
270
|
+
"default": "() => {}",
|
|
271
|
+
"description": "Callback function that is invoked when the checkbox is checked or unchecked."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "onChange",
|
|
275
|
+
"type": "Function",
|
|
276
|
+
"default": "() => {}",
|
|
277
|
+
"description": "Callback function that is invoked when the checkbox value changes. This will also be invoked by a keyboard event."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "error",
|
|
281
|
+
"type": "Boolean",
|
|
282
|
+
"default": "false",
|
|
283
|
+
"description": "Use \"error\" to change color of the checkbox."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "required",
|
|
287
|
+
"type": "Boolean",
|
|
288
|
+
"default": "false",
|
|
289
|
+
"description": "Defines whether the checkbox is required or not."
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "size",
|
|
293
|
+
"type": "String",
|
|
294
|
+
"default": "",
|
|
295
|
+
"description": "Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size. Possible values are: 'large'"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "tabIndex",
|
|
299
|
+
"type": "Number",
|
|
300
|
+
"default": "0",
|
|
301
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "className",
|
|
305
|
+
"type": "String",
|
|
306
|
+
"default": "",
|
|
307
|
+
"description": "Additional classes to be set on the input field."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "children",
|
|
311
|
+
"type": "any",
|
|
312
|
+
"default": "",
|
|
313
|
+
"description": "Any element to be rendered next to the checkbox."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "icon",
|
|
317
|
+
"type": "String",
|
|
318
|
+
"default": "",
|
|
319
|
+
"description": "Define a custom icon for the checkbox by naming a rioglyph icon like \"rioglyph-truck\"."
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "iconSize",
|
|
323
|
+
"type": "Number",
|
|
324
|
+
"default": "",
|
|
325
|
+
"description": "The icon size in pixel."
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "iconLabelPosition",
|
|
329
|
+
"type": "String",
|
|
330
|
+
"default": "",
|
|
331
|
+
"description": "The label position for a custom icon checkbox. Using this on a regular checkbox has no effect. Possible values are: \"horizontal\" or \"vertical\"."
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "inputRef",
|
|
335
|
+
"type": "Ref",
|
|
336
|
+
"default": "",
|
|
337
|
+
"description": "A react ref assigned to the input itself."
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"heading": "Custom card example",
|
|
349
|
+
"body": "> Note: When using the custom option, make sure to wrap the children with the class name checkbox-text-wrapper. For using the checkbox tick, use an element with class name checkbox-text.",
|
|
350
|
+
"examples": [
|
|
351
|
+
{
|
|
352
|
+
"caption": "This option is a first option",
|
|
353
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><form><fieldset class=\"display-flex gap-15 margin-bottom-50\"><legend class=\"margin-bottom-20\">Custom checkbox list</legend><label class=\"checkbox padding-15 user-select-none border rounded border-color-highlight\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 user-select-none border rounded border-color-highlight\" checked=\"\"><div class=\"checkbox-text-wrapper display-flex justify-content-between\"><div class=\"margin-right-15\"><div class=\"text-medium text-size-16 text-color-darker\">Option 1</div><div class=\"text-color-dark\">This option is a first option</div></div><div class=\"checkbox-text\"></div></div></label><label class=\"checkbox padding-15 user-select-none border rounded \" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 user-select-none border rounded \"><div class=\"checkbox-text-wrapper display-flex justify-content-between\"><div class=\"margin-right-15\"><div class=\"text-medium text-size-16 text-color-darker\">Option 2</div><div class=\"text-color-dark\">This option is a second option</div></div><div class=\"checkbox-text\"></div></div></label><label class=\"checkbox padding-15 user-select-none border rounded \" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 user-select-none border rounded \"><div class=\"checkbox-text-wrapper display-flex justify-content-between\"><div class=\"margin-right-15\"><div class=\"text-medium text-size-16 text-color-darker\">Option 3</div><div class=\"text-color-dark\">This option is a third option</div></div><div class=\"checkbox-text\"></div></div></label></fieldset><fieldset class=\"display-flex gap-5\"><legend class=\"margin-bottom-20\">Custom checkbox list as pick list without tick</legend><label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\"><div class=\"checkbox-text-wrapper\">Banana</div></label><label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\"><div class=\"checkbox-text-wrapper\">Peach</div></label><label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\"><div class=\"checkbox-text-wrapper\">Pear</div></label><label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\"><div class=\"checkbox-text-wrapper\">Strawberry</div></label></fieldset></form></div>",
|
|
354
|
+
"tabs": [
|
|
355
|
+
{
|
|
356
|
+
"label": "React",
|
|
357
|
+
"language": "tsx",
|
|
358
|
+
"code": "import { useState } from 'react';\nimport pull from 'lodash/fp/pull';\n\nimport Checkbox from '@rio-cloud/rio-uikit/Checkbox';\n\nconst getCheckboxClasses = (isSelected: boolean) =>\n `padding-15 user-select-none border rounded ${isSelected ? 'border-color-highlight' : ''}`;\n\nconst getPicklistCheckboxClasses = (isSelected: boolean) =>\n `padding-x-15 padding-y-5 user-select-none rounded shadow-accent ${isSelected ? 'border-color-highlight bg-highlight text-color-white' : 'hover-bg-highlight-decent text-color-darker'}`;\n\nexport default () => {\n const [selectedOptions, setSelectedOptions] = useState([1]);\n\n const handleSelect = (selected: number) => {\n const updatedSelectedOptions = selectedOptions.includes(selected)\n ? pull(selected, selectedOptions)\n : [...selectedOptions, selected];\n\n setSelectedOptions(updatedSelectedOptions);\n };\n\n return (\n <form>\n <fieldset className='display-flex gap-15 margin-bottom-50'>\n <legend className='margin-bottom-20'>Custom checkbox list</legend>\n <Checkbox\n onChange={() => handleSelect(1)}\n checked={selectedOptions.includes(1)}\n custom\n className={getCheckboxClasses(selectedOptions.includes(1))}\n >\n <div className='checkbox-text-wrapper display-flex justify-content-between'>\n <div className='margin-right-15'>\n <div className='text-medium text-size-16 text-color-darker'>Option 1</div>\n <div className='text-color-dark'>This option is a first option</div>\n </div>\n <div className='checkbox-text' />\n </div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(2)}\n checked={selectedOptions.includes(2)}\n custom\n className={getCheckboxClasses(selectedOptions.includes(2))}\n >\n <div className='checkbox-text-wrapper display-flex justify-content-between'>\n <div className='margin-right-15'>\n <div className='text-medium text-size-16 text-color-darker'>Option 2</div>\n <div className='text-color-dark'>This option is a second option</div>\n </div>\n <div className='checkbox-text' />\n </div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(3)}\n checked={selectedOptions.includes(3)}\n custom\n className={getCheckboxClasses(selectedOptions.includes(3))}\n >\n <div className='checkbox-text-wrapper display-flex justify-content-between'>\n <div className='margin-right-15'>\n <div className='text-medium text-size-16 text-color-darker'>Option 3</div>\n <div className='text-color-dark'>This option is a third option</div>\n </div>\n <div className='checkbox-text' />\n </div>\n </Checkbox>\n </fieldset>\n\n <fieldset className='display-flex gap-5'>\n <legend className='margin-bottom-20'>Custom checkbox list as pick list without tick</legend>\n <Checkbox\n onChange={() => handleSelect(4)}\n checked={selectedOptions.includes(4)}\n custom\n className={getPicklistCheckboxClasses(selectedOptions.includes(4))}\n >\n <div className='checkbox-text-wrapper'>Banana</div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(5)}\n checked={selectedOptions.includes(5)}\n custom\n className={getPicklistCheckboxClasses(selectedOptions.includes(5))}\n >\n <div className='checkbox-text-wrapper'>Peach</div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(6)}\n checked={selectedOptions.includes(6)}\n custom\n className={getPicklistCheckboxClasses(selectedOptions.includes(6))}\n >\n <div className='checkbox-text-wrapper'>Pear</div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(7)}\n checked={selectedOptions.includes(7)}\n custom\n className={getPicklistCheckboxClasses(selectedOptions.includes(7))}\n >\n <div className='checkbox-text-wrapper'>Strawberry</div>\n </Checkbox>\n </fieldset>\n </form>\n );\n};"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"label": "HTML",
|
|
362
|
+
"language": "html",
|
|
363
|
+
"code": "<form>\n <fieldset class=\"display-flex gap-15 margin-bottom-50\">\n <legend class=\"margin-bottom-20\">Custom checkbox list</legend>\n <label class=\"checkbox padding-15 user-select-none border rounded border-color-highlight\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 user-select-none border rounded border-color-highlight\" checked=\"\">\n <div class=\"checkbox-text-wrapper display-flex justify-content-between\">\n <div class=\"margin-right-15\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 1</div>\n <div class=\"text-color-dark\">This option is a first option</div>\n </div>\n <div class=\"checkbox-text\">\n </div>\n </div>\n </label>\n <label class=\"checkbox padding-15 user-select-none border rounded \" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 user-select-none border rounded \">\n <div class=\"checkbox-text-wrapper display-flex justify-content-between\">\n <div class=\"margin-right-15\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 2</div>\n <div class=\"text-color-dark\">This option is a second option</div>\n </div>\n <div class=\"checkbox-text\">\n </div>\n </div>\n </label>\n <label class=\"checkbox padding-15 user-select-none border rounded \" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 user-select-none border rounded \">\n <div class=\"checkbox-text-wrapper display-flex justify-content-between\">\n <div class=\"margin-right-15\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 3</div>\n <div class=\"text-color-dark\">This option is a third option</div>\n </div>\n <div class=\"checkbox-text\">\n </div>\n </div>\n </label>\n </fieldset>\n <fieldset class=\"display-flex gap-5\">\n <legend class=\"margin-bottom-20\">Custom checkbox list as pick list without tick</legend>\n <label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\">\n <div class=\"checkbox-text-wrapper\">Banana</div>\n </label>\n <label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\">\n <div class=\"checkbox-text-wrapper\">Peach</div>\n </label>\n <label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\">\n <div class=\"checkbox-text-wrapper\">Pear</div>\n </label>\n <label class=\"checkbox padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-x-15 padding-y-5 user-select-none rounded shadow-accent hover-bg-highlight-decent text-color-darker\">\n <div class=\"checkbox-text-wrapper\">Strawberry</div>\n </label>\n </fieldset>\n</form>"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"label": "Props",
|
|
367
|
+
"language": "json",
|
|
368
|
+
"code": null,
|
|
369
|
+
"props": [
|
|
370
|
+
{
|
|
371
|
+
"heading": null,
|
|
372
|
+
"rows": [
|
|
373
|
+
{
|
|
374
|
+
"name": "id",
|
|
375
|
+
"type": "String",
|
|
376
|
+
"default": "",
|
|
377
|
+
"description": "Passed through as HTML attribute to the underlying input. id. (Uses name otherwise.)"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "name",
|
|
381
|
+
"type": "String",
|
|
382
|
+
"default": "",
|
|
383
|
+
"description": "Passed through as HTML attribute to the underlying inputname."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "label",
|
|
387
|
+
"type": "String / Node",
|
|
388
|
+
"default": "",
|
|
389
|
+
"description": "Define some text as a label."
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"name": "checked",
|
|
393
|
+
"type": "String / Boolean",
|
|
394
|
+
"default": "",
|
|
395
|
+
"description": "Defines whether the checkbox is checked or not (state cannot be changed)."
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "defaultChecked",
|
|
399
|
+
"type": "String / Boolean",
|
|
400
|
+
"default": "",
|
|
401
|
+
"description": "Defines whether the checkbox is initially checked or not (state can be changed on click)."
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"name": "disabled",
|
|
405
|
+
"type": "Boolean",
|
|
406
|
+
"default": "false",
|
|
407
|
+
"description": "Defines whether the checkbox is disabled or not."
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "indeterminate",
|
|
411
|
+
"type": "Boolean",
|
|
412
|
+
"default": "false",
|
|
413
|
+
"description": "Defines if the checkbox is in an indeterminate state with regards to other checkboxes that may be in different selection state."
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "inline",
|
|
417
|
+
"type": "Boolean",
|
|
418
|
+
"default": "false",
|
|
419
|
+
"description": "Defines whether the checkbox is applying an inline style. Use this in combination with other checkboxes."
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"name": "right",
|
|
423
|
+
"type": "Boolean",
|
|
424
|
+
"default": "false",
|
|
425
|
+
"description": "Defines whether the checkbox is on the right side."
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"name": "custom",
|
|
429
|
+
"type": "Boolean",
|
|
430
|
+
"default": "false",
|
|
431
|
+
"description": "Allows for rendering a completely different layout with or without a checkbox tick."
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "onClick",
|
|
435
|
+
"type": "Function",
|
|
436
|
+
"default": "() => {}",
|
|
437
|
+
"description": "Callback function that is invoked when the checkbox is checked or unchecked."
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "onChange",
|
|
441
|
+
"type": "Function",
|
|
442
|
+
"default": "() => {}",
|
|
443
|
+
"description": "Callback function that is invoked when the checkbox value changes. This will also be invoked by a keyboard event."
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"name": "error",
|
|
447
|
+
"type": "Boolean",
|
|
448
|
+
"default": "false",
|
|
449
|
+
"description": "Use \"error\" to change color of the checkbox."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "required",
|
|
453
|
+
"type": "Boolean",
|
|
454
|
+
"default": "false",
|
|
455
|
+
"description": "Defines whether the checkbox is required or not."
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "size",
|
|
459
|
+
"type": "String",
|
|
460
|
+
"default": "",
|
|
461
|
+
"description": "Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size. Possible values are: 'large'"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "tabIndex",
|
|
465
|
+
"type": "Number",
|
|
466
|
+
"default": "0",
|
|
467
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "className",
|
|
471
|
+
"type": "String",
|
|
472
|
+
"default": "",
|
|
473
|
+
"description": "Additional classes to be set on the input field."
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "children",
|
|
477
|
+
"type": "any",
|
|
478
|
+
"default": "",
|
|
479
|
+
"description": "Any element to be rendered next to the checkbox."
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "icon",
|
|
483
|
+
"type": "String",
|
|
484
|
+
"default": "",
|
|
485
|
+
"description": "Define a custom icon for the checkbox by naming a rioglyph icon like \"rioglyph-truck\"."
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"name": "iconSize",
|
|
489
|
+
"type": "Number",
|
|
490
|
+
"default": "",
|
|
491
|
+
"description": "The icon size in pixel."
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "iconLabelPosition",
|
|
495
|
+
"type": "String",
|
|
496
|
+
"default": "",
|
|
497
|
+
"description": "The label position for a custom icon checkbox. Using this on a regular checkbox has no effect. Possible values are: \"horizontal\" or \"vertical\"."
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "inputRef",
|
|
501
|
+
"type": "Ref",
|
|
502
|
+
"default": "",
|
|
503
|
+
"description": "A react ref assigned to the input itself."
|
|
504
|
+
}
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"heading": "Custom list example",
|
|
515
|
+
"body": "",
|
|
516
|
+
"examples": [
|
|
517
|
+
{
|
|
518
|
+
"caption": "This option is a first option",
|
|
519
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><fieldset class=\"display-flex flex-column width-300\"><legend>Custom checkbox list</legend><div class=\"border rounded\"><label class=\"checkbox padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent rounded-top\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent rounded-top\" checked=\"\"><div class=\"checkbox-text-wrapper display-flex gap-10\"><div class=\"checkbox-text\"></div><div class=\"flex-1-1\"><div class=\"text-medium text-size-16 text-color-darker\">Option 1</div><div class=\"text-color-dark\">This option is a first option</div></div></div></label><label class=\"checkbox padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent\"><div class=\"checkbox-text-wrapper display-flex gap-10\"><div class=\"checkbox-text\"></div><div class=\"flex-1-1\"><div class=\"text-medium text-size-16 text-color-darker\">Option 2</div><div class=\"text-color-dark\">This option is a second option</div></div></div></label><label class=\"checkbox padding-15 user-select-none hover-bg-highlight-decent rounded-bottom\" tabindex=\"0\"><input type=\"checkbox\" class=\"padding-15 user-select-none hover-bg-highlight-decent rounded-bottom\"><div class=\"checkbox-text-wrapper display-flex gap-10\"><div class=\"checkbox-text\"></div><div class=\"flex-1-1\"><div class=\"text-medium text-size-16 text-color-darker\">Option 3</div><div class=\"text-color-dark\">This option is a third option</div></div></div></label></div></fieldset></div>",
|
|
520
|
+
"tabs": [
|
|
521
|
+
{
|
|
522
|
+
"label": "React",
|
|
523
|
+
"language": "tsx",
|
|
524
|
+
"code": "import { useState } from 'react';\nimport pull from 'lodash/fp/pull';\n\nimport Checkbox from '@rio-cloud/rio-uikit/Checkbox';\n\nexport default () => {\n const [selectedOptions, setSelectedOptions] = useState([1]);\n\n const handleSelect = (selected: number) => {\n const updatedSelectedOptions = selectedOptions.includes(selected)\n ? pull(selected, selectedOptions)\n : [...selectedOptions, selected];\n\n setSelectedOptions(updatedSelectedOptions);\n };\n\n return (\n <fieldset className='display-flex flex-column width-300'>\n <legend>Custom checkbox list</legend>\n <div className='border rounded'>\n <Checkbox\n onChange={() => handleSelect(1)}\n checked={selectedOptions.includes(1)}\n custom\n className='padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent rounded-top'\n >\n <div className='checkbox-text-wrapper display-flex gap-10'>\n <div className='checkbox-text' />\n <div className='flex-1-1'>\n <div className='text-medium text-size-16 text-color-darker'>Option 1</div>\n <div className='text-color-dark'>This option is a first option</div>\n </div>\n </div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(2)}\n checked={selectedOptions.includes(2)}\n custom\n className='padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent'\n >\n <div className='checkbox-text-wrapper display-flex gap-10'>\n <div className='checkbox-text' />\n <div className='flex-1-1'>\n <div className='text-medium text-size-16 text-color-darker'>Option 2</div>\n <div className='text-color-dark'>This option is a second option</div>\n </div>\n </div>\n </Checkbox>\n <Checkbox\n onChange={() => handleSelect(3)}\n checked={selectedOptions.includes(3)}\n custom\n className='padding-15 user-select-none hover-bg-highlight-decent rounded-bottom'\n >\n <div className='checkbox-text-wrapper display-flex gap-10'>\n <div className='checkbox-text' />\n <div className='flex-1-1'>\n <div className='text-medium text-size-16 text-color-darker'>Option 3</div>\n <div className='text-color-dark'>This option is a third option</div>\n </div>\n </div>\n </Checkbox>\n </div>\n </fieldset>\n );\n};"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "HTML",
|
|
528
|
+
"language": "html",
|
|
529
|
+
"code": "<fieldset class=\"display-flex flex-column width-300\">\n <legend>Custom checkbox list</legend>\n <div class=\"border rounded\">\n <label class=\"checkbox padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent rounded-top\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent rounded-top\" checked=\"\">\n <div class=\"checkbox-text-wrapper display-flex gap-10\">\n <div class=\"checkbox-text\">\n </div>\n <div class=\"flex-1-1\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 1</div>\n <div class=\"text-color-dark\">This option is a first option</div>\n </div>\n </div>\n </label>\n <label class=\"checkbox padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 border border-bottom-only user-select-none hover-bg-highlight-decent\">\n <div class=\"checkbox-text-wrapper display-flex gap-10\">\n <div class=\"checkbox-text\">\n </div>\n <div class=\"flex-1-1\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 2</div>\n <div class=\"text-color-dark\">This option is a second option</div>\n </div>\n </div>\n </label>\n <label class=\"checkbox padding-15 user-select-none hover-bg-highlight-decent rounded-bottom\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"padding-15 user-select-none hover-bg-highlight-decent rounded-bottom\">\n <div class=\"checkbox-text-wrapper display-flex gap-10\">\n <div class=\"checkbox-text\">\n </div>\n <div class=\"flex-1-1\">\n <div class=\"text-medium text-size-16 text-color-darker\">Option 3</div>\n <div class=\"text-color-dark\">This option is a third option</div>\n </div>\n </div>\n </label>\n </div>\n</fieldset>"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"label": "Props",
|
|
533
|
+
"language": "json",
|
|
534
|
+
"code": null,
|
|
535
|
+
"props": [
|
|
536
|
+
{
|
|
537
|
+
"heading": null,
|
|
538
|
+
"rows": [
|
|
539
|
+
{
|
|
540
|
+
"name": "id",
|
|
541
|
+
"type": "String",
|
|
542
|
+
"default": "",
|
|
543
|
+
"description": "Passed through as HTML attribute to the underlying input. id. (Uses name otherwise.)"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"name": "name",
|
|
547
|
+
"type": "String",
|
|
548
|
+
"default": "",
|
|
549
|
+
"description": "Passed through as HTML attribute to the underlying inputname."
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"name": "label",
|
|
553
|
+
"type": "String / Node",
|
|
554
|
+
"default": "",
|
|
555
|
+
"description": "Define some text as a label."
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "checked",
|
|
559
|
+
"type": "String / Boolean",
|
|
560
|
+
"default": "",
|
|
561
|
+
"description": "Defines whether the checkbox is checked or not (state cannot be changed)."
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"name": "defaultChecked",
|
|
565
|
+
"type": "String / Boolean",
|
|
566
|
+
"default": "",
|
|
567
|
+
"description": "Defines whether the checkbox is initially checked or not (state can be changed on click)."
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"name": "disabled",
|
|
571
|
+
"type": "Boolean",
|
|
572
|
+
"default": "false",
|
|
573
|
+
"description": "Defines whether the checkbox is disabled or not."
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"name": "indeterminate",
|
|
577
|
+
"type": "Boolean",
|
|
578
|
+
"default": "false",
|
|
579
|
+
"description": "Defines if the checkbox is in an indeterminate state with regards to other checkboxes that may be in different selection state."
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "inline",
|
|
583
|
+
"type": "Boolean",
|
|
584
|
+
"default": "false",
|
|
585
|
+
"description": "Defines whether the checkbox is applying an inline style. Use this in combination with other checkboxes."
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "right",
|
|
589
|
+
"type": "Boolean",
|
|
590
|
+
"default": "false",
|
|
591
|
+
"description": "Defines whether the checkbox is on the right side."
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"name": "custom",
|
|
595
|
+
"type": "Boolean",
|
|
596
|
+
"default": "false",
|
|
597
|
+
"description": "Allows for rendering a completely different layout with or without a checkbox tick."
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "onClick",
|
|
601
|
+
"type": "Function",
|
|
602
|
+
"default": "() => {}",
|
|
603
|
+
"description": "Callback function that is invoked when the checkbox is checked or unchecked."
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"name": "onChange",
|
|
607
|
+
"type": "Function",
|
|
608
|
+
"default": "() => {}",
|
|
609
|
+
"description": "Callback function that is invoked when the checkbox value changes. This will also be invoked by a keyboard event."
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"name": "error",
|
|
613
|
+
"type": "Boolean",
|
|
614
|
+
"default": "false",
|
|
615
|
+
"description": "Use \"error\" to change color of the checkbox."
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "required",
|
|
619
|
+
"type": "Boolean",
|
|
620
|
+
"default": "false",
|
|
621
|
+
"description": "Defines whether the checkbox is required or not."
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "size",
|
|
625
|
+
"type": "String",
|
|
626
|
+
"default": "",
|
|
627
|
+
"description": "Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size. Possible values are: 'large'"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "tabIndex",
|
|
631
|
+
"type": "Number",
|
|
632
|
+
"default": "0",
|
|
633
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "className",
|
|
637
|
+
"type": "String",
|
|
638
|
+
"default": "",
|
|
639
|
+
"description": "Additional classes to be set on the input field."
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "children",
|
|
643
|
+
"type": "any",
|
|
644
|
+
"default": "",
|
|
645
|
+
"description": "Any element to be rendered next to the checkbox."
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "icon",
|
|
649
|
+
"type": "String",
|
|
650
|
+
"default": "",
|
|
651
|
+
"description": "Define a custom icon for the checkbox by naming a rioglyph icon like \"rioglyph-truck\"."
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "iconSize",
|
|
655
|
+
"type": "Number",
|
|
656
|
+
"default": "",
|
|
657
|
+
"description": "The icon size in pixel."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "iconLabelPosition",
|
|
661
|
+
"type": "String",
|
|
662
|
+
"default": "",
|
|
663
|
+
"description": "The label position for a custom icon checkbox. Using this on a regular checkbox has no effect. Possible values are: \"horizontal\" or \"vertical\"."
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "inputRef",
|
|
667
|
+
"type": "Ref",
|
|
668
|
+
"default": "",
|
|
669
|
+
"description": "A react ref assigned to the input itself."
|
|
670
|
+
}
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"heading": "Checkbox with custom icon",
|
|
681
|
+
"body": "",
|
|
682
|
+
"examples": [
|
|
683
|
+
{
|
|
684
|
+
"caption": "Example 5",
|
|
685
|
+
"rendered_html": "<div class=\"playground-content bg-white padding-20 padding-bottom-25\" style=\"width: 100%;\"><div><div><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-icon label-horizontal\"><span class=\"rioglyph rioglyph-truck\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\"></span><span class=\"checkbox-label\">Option 1</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-icon label-horizontal\"><span class=\"rioglyph rioglyph-bus\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\"></span><span class=\"checkbox-label\">Option 2</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-icon label-horizontal\"><span class=\"rioglyph rioglyph-van\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\"></span><span class=\"checkbox-label\">Option 3</span></span></label></div><hr><div><label class=\"checkbox checkbox-inline width-50\" tabindex=\"0\"><input type=\"checkbox\" class=\"width-50\"><span class=\"checkbox-icon label-vertical\"><span class=\"rioglyph rioglyph-truck\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\"></span><span class=\"checkbox-label\">Option 1</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-icon label-vertical\"><span class=\"rioglyph rioglyph-bus\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\"></span><span class=\"checkbox-label\">Option 2</span></span></label><label class=\"checkbox checkbox-inline\" tabindex=\"0\"><input type=\"checkbox\" class=\"\"><span class=\"checkbox-icon label-vertical\"><span class=\"rioglyph rioglyph-van\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\"></span><span class=\"checkbox-label\">Option 3</span></span></label></div></div></div>",
|
|
686
|
+
"tabs": [
|
|
687
|
+
{
|
|
688
|
+
"label": "React",
|
|
689
|
+
"language": "tsx",
|
|
690
|
+
"code": "import React from 'react';\n\nimport Checkbox from '@rio-cloud/rio-uikit/Checkbox';\n\nexport default () => (\n <div>\n <div>\n <Checkbox inline icon='rioglyph-truck' iconLabelPosition={Checkbox.ICON_LABEL_HORIZONTAL}>\n Option 1\n </Checkbox>\n <Checkbox inline icon='rioglyph-bus' iconLabelPosition={Checkbox.ICON_LABEL_HORIZONTAL}>\n Option 2\n </Checkbox>\n <Checkbox inline icon='rioglyph-van' iconLabelPosition='horizontal'>\n Option 3\n </Checkbox>\n </div>\n <hr />\n <div>\n <Checkbox inline className='width-50' icon='rioglyph-truck' iconSize={75}>\n Option 1\n </Checkbox>\n <Checkbox inline icon='rioglyph-bus' iconSize={75}>\n Option 2\n </Checkbox>\n <Checkbox inline icon='rioglyph-van' iconSize={75}>\n Option 3\n </Checkbox>\n </div>\n </div>\n);"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"label": "HTML",
|
|
694
|
+
"language": "html",
|
|
695
|
+
"code": "<div>\n <div>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-icon label-horizontal\">\n <span class=\"rioglyph rioglyph-truck\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\">\n </span>\n <span class=\"checkbox-label\">Option 1</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-icon label-horizontal\">\n <span class=\"rioglyph rioglyph-bus\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\">\n </span>\n <span class=\"checkbox-label\">Option 2</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-icon label-horizontal\">\n <span class=\"rioglyph rioglyph-van\" style=\"width: 16px; height: 16px; font-size: 16px; line-height: 16px;\">\n </span>\n <span class=\"checkbox-label\">Option 3</span>\n </span>\n </label>\n </div>\n <hr>\n <div>\n <label class=\"checkbox checkbox-inline width-50\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"width-50\">\n <span class=\"checkbox-icon label-vertical\">\n <span class=\"rioglyph rioglyph-truck\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\">\n </span>\n <span class=\"checkbox-label\">Option 1</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-icon label-vertical\">\n <span class=\"rioglyph rioglyph-bus\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\">\n </span>\n <span class=\"checkbox-label\">Option 2</span>\n </span>\n </label>\n <label class=\"checkbox checkbox-inline\" tabindex=\"0\">\n <input type=\"checkbox\" class=\"\">\n <span class=\"checkbox-icon label-vertical\">\n <span class=\"rioglyph rioglyph-van\" style=\"width: 75px; height: 75px; font-size: 75px; line-height: 75px;\">\n </span>\n <span class=\"checkbox-label\">Option 3</span>\n </span>\n </label>\n </div>\n</div>"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "Props",
|
|
699
|
+
"language": "json",
|
|
700
|
+
"code": null,
|
|
701
|
+
"props": [
|
|
702
|
+
{
|
|
703
|
+
"heading": null,
|
|
704
|
+
"rows": [
|
|
705
|
+
{
|
|
706
|
+
"name": "id",
|
|
707
|
+
"type": "String",
|
|
708
|
+
"default": "",
|
|
709
|
+
"description": "Passed through as HTML attribute to the underlying input. id. (Uses name otherwise.)"
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"name": "name",
|
|
713
|
+
"type": "String",
|
|
714
|
+
"default": "",
|
|
715
|
+
"description": "Passed through as HTML attribute to the underlying inputname."
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "label",
|
|
719
|
+
"type": "String / Node",
|
|
720
|
+
"default": "",
|
|
721
|
+
"description": "Define some text as a label."
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"name": "checked",
|
|
725
|
+
"type": "String / Boolean",
|
|
726
|
+
"default": "",
|
|
727
|
+
"description": "Defines whether the checkbox is checked or not (state cannot be changed)."
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "defaultChecked",
|
|
731
|
+
"type": "String / Boolean",
|
|
732
|
+
"default": "",
|
|
733
|
+
"description": "Defines whether the checkbox is initially checked or not (state can be changed on click)."
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"name": "disabled",
|
|
737
|
+
"type": "Boolean",
|
|
738
|
+
"default": "false",
|
|
739
|
+
"description": "Defines whether the checkbox is disabled or not."
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"name": "indeterminate",
|
|
743
|
+
"type": "Boolean",
|
|
744
|
+
"default": "false",
|
|
745
|
+
"description": "Defines if the checkbox is in an indeterminate state with regards to other checkboxes that may be in different selection state."
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "inline",
|
|
749
|
+
"type": "Boolean",
|
|
750
|
+
"default": "false",
|
|
751
|
+
"description": "Defines whether the checkbox is applying an inline style. Use this in combination with other checkboxes."
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "right",
|
|
755
|
+
"type": "Boolean",
|
|
756
|
+
"default": "false",
|
|
757
|
+
"description": "Defines whether the checkbox is on the right side."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"name": "custom",
|
|
761
|
+
"type": "Boolean",
|
|
762
|
+
"default": "false",
|
|
763
|
+
"description": "Allows for rendering a completely different layout with or without a checkbox tick."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "onClick",
|
|
767
|
+
"type": "Function",
|
|
768
|
+
"default": "() => {}",
|
|
769
|
+
"description": "Callback function that is invoked when the checkbox is checked or unchecked."
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"name": "onChange",
|
|
773
|
+
"type": "Function",
|
|
774
|
+
"default": "() => {}",
|
|
775
|
+
"description": "Callback function that is invoked when the checkbox value changes. This will also be invoked by a keyboard event."
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "error",
|
|
779
|
+
"type": "Boolean",
|
|
780
|
+
"default": "false",
|
|
781
|
+
"description": "Use \"error\" to change color of the checkbox."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"name": "required",
|
|
785
|
+
"type": "Boolean",
|
|
786
|
+
"default": "false",
|
|
787
|
+
"description": "Defines whether the checkbox is required or not."
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"name": "size",
|
|
791
|
+
"type": "String",
|
|
792
|
+
"default": "",
|
|
793
|
+
"description": "Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size. Possible values are: 'large'"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "tabIndex",
|
|
797
|
+
"type": "Number",
|
|
798
|
+
"default": "0",
|
|
799
|
+
"description": "The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation. See tabIndex"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "className",
|
|
803
|
+
"type": "String",
|
|
804
|
+
"default": "",
|
|
805
|
+
"description": "Additional classes to be set on the input field."
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"name": "children",
|
|
809
|
+
"type": "any",
|
|
810
|
+
"default": "",
|
|
811
|
+
"description": "Any element to be rendered next to the checkbox."
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"name": "icon",
|
|
815
|
+
"type": "String",
|
|
816
|
+
"default": "",
|
|
817
|
+
"description": "Define a custom icon for the checkbox by naming a rioglyph icon like \"rioglyph-truck\"."
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "iconSize",
|
|
821
|
+
"type": "Number",
|
|
822
|
+
"default": "",
|
|
823
|
+
"description": "The icon size in pixel."
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"name": "iconLabelPosition",
|
|
827
|
+
"type": "String",
|
|
828
|
+
"default": "",
|
|
829
|
+
"description": "The label position for a custom icon checkbox. Using this on a regular checkbox has no effect. Possible values are: \"horizontal\" or \"vertical\"."
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"name": "inputRef",
|
|
833
|
+
"type": "Ref",
|
|
834
|
+
"default": "",
|
|
835
|
+
"description": "A react ref assigned to the input itself."
|
|
836
|
+
}
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
]
|
|
840
|
+
}
|
|
841
|
+
]
|
|
842
|
+
}
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"see_also": []
|
|
847
|
+
}
|