@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.
Files changed (198) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +91 -0
  3. package/bin/uikit-mcp.mjs +23 -0
  4. package/data/pages/Components/components/accentbar.json +207 -0
  5. package/data/pages/Components/components/activity.json +87 -0
  6. package/data/pages/Components/components/animatednumber.json +99 -0
  7. package/data/pages/Components/components/animations.json +87 -0
  8. package/data/pages/Components/components/appheader.json +291 -0
  9. package/data/pages/Components/components/applayout.json +1198 -0
  10. package/data/pages/Components/components/appnavigationbar.json +327 -0
  11. package/data/pages/Components/components/areacharts.json +563 -0
  12. package/data/pages/Components/components/aspectratioplaceholder.json +75 -0
  13. package/data/pages/Components/components/assettree.json +3080 -0
  14. package/data/pages/Components/components/autosuggests.json +710 -0
  15. package/data/pages/Components/components/avatar.json +157 -0
  16. package/data/pages/Components/components/banner.json +599 -0
  17. package/data/pages/Components/components/barcharts.json +1507 -0
  18. package/data/pages/Components/components/barlist.json +223 -0
  19. package/data/pages/Components/components/basicmap.json +68 -0
  20. package/data/pages/Components/components/bottomsheet.json +601 -0
  21. package/data/pages/Components/components/button.json +583 -0
  22. package/data/pages/Components/components/buttontoolbar.json +63 -0
  23. package/data/pages/Components/components/calendarstripe.json +235 -0
  24. package/data/pages/Components/components/card.json +69 -0
  25. package/data/pages/Components/components/carousel.json +39 -0
  26. package/data/pages/Components/components/chartcolors.json +34 -0
  27. package/data/pages/Components/components/chartsgettingstarted.json +32 -0
  28. package/data/pages/Components/components/chat.json +39 -0
  29. package/data/pages/Components/components/checkbox.json +847 -0
  30. package/data/pages/Components/components/clearableinput.json +789 -0
  31. package/data/pages/Components/components/collapse.json +175 -0
  32. package/data/pages/Components/components/composedcharts.json +159 -0
  33. package/data/pages/Components/components/contentloader.json +233 -0
  34. package/data/pages/Components/components/datatabs.json +680 -0
  35. package/data/pages/Components/components/datepickers.json +287 -0
  36. package/data/pages/Components/components/dialogs.json +1492 -0
  37. package/data/pages/Components/components/divider.json +93 -0
  38. package/data/pages/Components/components/dropdowns.json +936 -0
  39. package/data/pages/Components/components/editablecontent.json +1117 -0
  40. package/data/pages/Components/components/expander.json +377 -0
  41. package/data/pages/Components/components/fade.json +403 -0
  42. package/data/pages/Components/components/fadeexpander.json +75 -0
  43. package/data/pages/Components/components/fadeup.json +127 -0
  44. package/data/pages/Components/components/feedback.json +269 -0
  45. package/data/pages/Components/components/filepickers.json +269 -0
  46. package/data/pages/Components/components/formlabel.json +115 -0
  47. package/data/pages/Components/components/fullscreenmap.json +22 -0
  48. package/data/pages/Components/components/groupeditemlist.json +323 -0
  49. package/data/pages/Components/components/iconlist.json +45 -0
  50. package/data/pages/Components/components/imagepreloader.json +81 -0
  51. package/data/pages/Components/components/labeledelement.json +75 -0
  52. package/data/pages/Components/components/licenseplate.json +69 -0
  53. package/data/pages/Components/components/linecharts.json +987 -0
  54. package/data/pages/Components/components/listmenu.json +313 -0
  55. package/data/pages/Components/components/loadmore.json +175 -0
  56. package/data/pages/Components/components/mainnavigation.json +39 -0
  57. package/data/pages/Components/components/mapcircle.json +34 -0
  58. package/data/pages/Components/components/mapcluster.json +51 -0
  59. package/data/pages/Components/components/mapcontext.json +105 -0
  60. package/data/pages/Components/components/mapdraggablemarker.json +34 -0
  61. package/data/pages/Components/components/mapgettingstarted.json +27 -0
  62. package/data/pages/Components/components/mapgroup.json +1198 -0
  63. package/data/pages/Components/components/mapinfobubble.json +34 -0
  64. package/data/pages/Components/components/maplayergroup.json +34 -0
  65. package/data/pages/Components/components/mapmarker.json +700 -0
  66. package/data/pages/Components/components/mappolygon.json +45 -0
  67. package/data/pages/Components/components/maproute.json +623 -0
  68. package/data/pages/Components/components/maproutegenerator.json +16 -0
  69. package/data/pages/Components/components/mapsettings.json +51 -0
  70. package/data/pages/Components/components/maputils.json +34 -0
  71. package/data/pages/Components/components/multiselects.json +1451 -0
  72. package/data/pages/Components/components/nodata.json +139 -0
  73. package/data/pages/Components/components/notifications.json +65 -0
  74. package/data/pages/Components/components/numbercontrol.json +301 -0
  75. package/data/pages/Components/components/onboarding.json +302 -0
  76. package/data/pages/Components/components/page.json +197 -0
  77. package/data/pages/Components/components/pager.json +93 -0
  78. package/data/pages/Components/components/piecharts.json +731 -0
  79. package/data/pages/Components/components/popover.json +251 -0
  80. package/data/pages/Components/components/position.json +69 -0
  81. package/data/pages/Components/components/radialbarcharts.json +1304 -0
  82. package/data/pages/Components/components/radiobutton.json +1105 -0
  83. package/data/pages/Components/components/releasenotes.json +44 -0
  84. package/data/pages/Components/components/resizer.json +93 -0
  85. package/data/pages/Components/components/responsivecolumnstripe.json +123 -0
  86. package/data/pages/Components/components/responsivevideo.json +75 -0
  87. package/data/pages/Components/components/rioglyph.json +93 -0
  88. package/data/pages/Components/components/rules.json +410 -0
  89. package/data/pages/Components/components/saveableinput.json +703 -0
  90. package/data/pages/Components/components/selects.json +701 -0
  91. package/data/pages/Components/components/sidebar.json +243 -0
  92. package/data/pages/Components/components/sliders.json +235 -0
  93. package/data/pages/Components/components/smoothscrollbars.json +335 -0
  94. package/data/pages/Components/components/spinners.json +343 -0
  95. package/data/pages/Components/components/states.json +1705 -0
  96. package/data/pages/Components/components/statswidgets.json +314 -0
  97. package/data/pages/Components/components/statusbar.json +177 -0
  98. package/data/pages/Components/components/stepbutton.json +57 -0
  99. package/data/pages/Components/components/steppedprogressbars.json +417 -0
  100. package/data/pages/Components/components/subnavigation.json +107 -0
  101. package/data/pages/Components/components/supportmarker.json +45 -0
  102. package/data/pages/Components/components/svgimage.json +81 -0
  103. package/data/pages/Components/components/switch.json +111 -0
  104. package/data/pages/Components/components/tables.json +144 -0
  105. package/data/pages/Components/components/tagmanager.json +86 -0
  106. package/data/pages/Components/components/tags.json +146 -0
  107. package/data/pages/Components/components/teaser.json +188 -0
  108. package/data/pages/Components/components/timeline.json +45 -0
  109. package/data/pages/Components/components/timepicker.json +163 -0
  110. package/data/pages/Components/components/togglebutton.json +247 -0
  111. package/data/pages/Components/components/tooltip.json +270 -0
  112. package/data/pages/Components/components/virtuallist.json +175 -0
  113. package/data/pages/Foundations/foundations.json +2475 -0
  114. package/data/pages/Getting-started/start/changelog.json +22 -0
  115. package/data/pages/Getting-started/start/goodtoknow.json +32 -0
  116. package/data/pages/Getting-started/start/guidelines/color-combinations.json +58 -0
  117. package/data/pages/Getting-started/start/guidelines/custom-css.json +27 -0
  118. package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +22 -0
  119. package/data/pages/Getting-started/start/guidelines/formatting.json +97 -0
  120. package/data/pages/Getting-started/start/guidelines/iframe.json +93 -0
  121. package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +22 -0
  122. package/data/pages/Getting-started/start/guidelines/print-css.json +37 -0
  123. package/data/pages/Getting-started/start/guidelines/spinner.json +144 -0
  124. package/data/pages/Getting-started/start/guidelines/supported-browsers.json +22 -0
  125. package/data/pages/Getting-started/start/guidelines/writing.json +242 -0
  126. package/data/pages/Getting-started/start/howto.json +72 -0
  127. package/data/pages/Getting-started/start/intro.json +37 -0
  128. package/data/pages/Getting-started/start/responsiveness.json +52 -0
  129. package/data/pages/Templates/templates/common-table.json +39 -0
  130. package/data/pages/Templates/templates/detail-views.json +71 -0
  131. package/data/pages/Templates/templates/expandable-details.json +39 -0
  132. package/data/pages/Templates/templates/feature-cards.json +103 -0
  133. package/data/pages/Templates/templates/form-summary.json +39 -0
  134. package/data/pages/Templates/templates/form-toggle.json +39 -0
  135. package/data/pages/Templates/templates/list-blocks.json +119 -0
  136. package/data/pages/Templates/templates/loading-progress.json +39 -0
  137. package/data/pages/Templates/templates/options-panel.json +39 -0
  138. package/data/pages/Templates/templates/panel-variants.json +39 -0
  139. package/data/pages/Templates/templates/progress-cards.json +71 -0
  140. package/data/pages/Templates/templates/progress-success.json +39 -0
  141. package/data/pages/Templates/templates/settings-form.json +39 -0
  142. package/data/pages/Templates/templates/stats-blocks.json +135 -0
  143. package/data/pages/Templates/templates/table-panel.json +39 -0
  144. package/data/pages/Templates/templates/table-row-animation.json +39 -0
  145. package/data/pages/Templates/templates/usage-cards.json +39 -0
  146. package/data/pages/Utilities/utilities/deviceutils.json +39 -0
  147. package/data/pages/Utilities/utilities/featuretoggles.json +42 -0
  148. package/data/pages/Utilities/utilities/fueltypeutils.json +118 -0
  149. package/data/pages/Utilities/utilities/routeutils.json +34 -0
  150. package/data/pages/Utilities/utilities/useaftermount.json +63 -0
  151. package/data/pages/Utilities/utilities/useaverage.json +86 -0
  152. package/data/pages/Utilities/utilities/useclickoutside.json +69 -0
  153. package/data/pages/Utilities/utilities/useclipboard.json +57 -0
  154. package/data/pages/Utilities/utilities/usecount.json +92 -0
  155. package/data/pages/Utilities/utilities/usedarkmode.json +50 -0
  156. package/data/pages/Utilities/utilities/usedebuginfo.json +63 -0
  157. package/data/pages/Utilities/utilities/useeffectonce.json +57 -0
  158. package/data/pages/Utilities/utilities/useelapsedtime.json +57 -0
  159. package/data/pages/Utilities/utilities/useelementsize.json +63 -0
  160. package/data/pages/Utilities/utilities/useesc.json +57 -0
  161. package/data/pages/Utilities/utilities/useevent.json +75 -0
  162. package/data/pages/Utilities/utilities/usefocustrap.json +57 -0
  163. package/data/pages/Utilities/utilities/usefullscreen.json +197 -0
  164. package/data/pages/Utilities/utilities/usehover.json +57 -0
  165. package/data/pages/Utilities/utilities/useinterval.json +63 -0
  166. package/data/pages/Utilities/utilities/useisfocuswithin.json +75 -0
  167. package/data/pages/Utilities/utilities/usekey.json +75 -0
  168. package/data/pages/Utilities/utilities/uselocalstorage.json +69 -0
  169. package/data/pages/Utilities/utilities/uselocationsuggestions.json +110 -0
  170. package/data/pages/Utilities/utilities/usemax.json +86 -0
  171. package/data/pages/Utilities/utilities/usemin.json +86 -0
  172. package/data/pages/Utilities/utilities/usemutationobserver.json +69 -0
  173. package/data/pages/Utilities/utilities/useonlinestatus.json +39 -0
  174. package/data/pages/Utilities/utilities/useonscreen.json +63 -0
  175. package/data/pages/Utilities/utilities/usepostmessage.json +80 -0
  176. package/data/pages/Utilities/utilities/useprevious.json +63 -0
  177. package/data/pages/Utilities/utilities/useresizeobserver.json +65 -0
  178. package/data/pages/Utilities/utilities/usescrollposition.json +103 -0
  179. package/data/pages/Utilities/utilities/usesearch.json +197 -0
  180. package/data/pages/Utilities/utilities/usesorting.json +139 -0
  181. package/data/pages/Utilities/utilities/usestatewithvalidation.json +69 -0
  182. package/data/pages/Utilities/utilities/usesum.json +86 -0
  183. package/data/pages/Utilities/utilities/usetableexport.json +87 -0
  184. package/data/pages/Utilities/utilities/usetableselection.json +311 -0
  185. package/data/pages/Utilities/utilities/usetimeout.json +63 -0
  186. package/data/pages/Utilities/utilities/usetoggle.json +75 -0
  187. package/data/pages/Utilities/utilities/usewindowresize.json +63 -0
  188. package/data/version.json +4 -0
  189. package/docs/content-schema.md +147 -0
  190. package/docs/navigation-inventory.json +1310 -0
  191. package/docs/search-synonyms.json +43 -0
  192. package/package.json +38 -0
  193. package/server/index.mjs +268 -0
  194. package/server/lib/load-docs.mjs +48 -0
  195. package/server/lib/normalise-doc.mjs +220 -0
  196. package/server/lib/render-markdown.mjs +82 -0
  197. package/server/lib/search-index.mjs +49 -0
  198. package/server/lib/types.js +99 -0
@@ -0,0 +1,92 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:46.987Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useCount",
5
+ "category": "Utilities",
6
+ "section": "Data aggregation hooks",
7
+ "slug": "utilities/usecount",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "a1224bd244964781733ef45fcd2d89e33bc6da785f144cd38be4d8e37a09ea04"
11
+ },
12
+ "title": "useCount",
13
+ "lead": "useCount is a utility hook for counting how many objects in a list contain a specific value or match a custom condition at a given property path. It supports exact value matching (e.g. true, 0, 'PENDING') or predicate-based logic using a match function. By default, all values that are not null or undefined are counted.",
14
+ "content": [
15
+ {
16
+ "heading": "useCount",
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%;\"><table><tbody><tr><td>Deliveries marked as delivered:</td><td class=\"text-right width-20\">3</td></tr><tr><td>Deliveries marked as not delivered:</td><td class=\"text-right width-20\">2</td></tr><tr><td>Deliveries with status \"PENDING\":</td><td class=\"text-right width-20\">2</td></tr><tr><td>Deliveries with quantity 0:</td><td class=\"text-right width-20\">2</td></tr><tr><td>Deliveries with a written note:</td><td class=\"text-right width-20\">2</td></tr><tr><td>Deliveries with at least one item:</td><td class=\"text-right width-20\">3</td></tr></tbody></table></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import useCount from '@rio-cloud/rio-uikit/useCount';\n\nconst deliveries = [\n {\n id: 'D-001',\n delivered: true,\n status: 'PENDING',\n quantity: 0,\n notes: '',\n items: [],\n },\n {\n id: 'D-002',\n delivered: false,\n status: 'CONFIRMED',\n quantity: 20,\n notes: 'Customer confirmed by phone.',\n items: [1, 2],\n },\n {\n id: 'D-003',\n delivered: true,\n status: 'CANCELLED',\n quantity: 0,\n notes: null,\n items: [],\n },\n {\n id: 'D-004',\n delivered: false,\n status: 'PENDING',\n quantity: 10,\n notes: 'Leave at front desk.',\n items: [1],\n },\n {\n id: 'D-005',\n delivered: true,\n status: 'CONFIRMED',\n quantity: 5,\n notes: '',\n items: [1, 2, 3],\n },\n];\n\nexport default () => {\n const countDelivered = useCount(deliveries, 'delivered', { equals: true });\n const countUndelivered = useCount(deliveries, 'delivered', { equals: false });\n\n const countPendingStatus = useCount(deliveries, 'status', { equals: 'PENDING' });\n\n const countQuantityZero = useCount(deliveries, 'quantity', { equals: 0 });\n\n const countWithNotes = useCount(deliveries, 'notes', {\n match: val => typeof val === 'string' && val.trim().length > 0,\n });\n\n const countWithItems = useCount(deliveries, 'items', {\n match: val => Array.isArray(val) && val.length > 0,\n });\n\n return (\n <table>\n <tbody>\n <tr>\n <td>Deliveries marked as delivered:</td>\n <td className='text-right width-20'>{countDelivered}</td>\n </tr>\n <tr>\n <td>Deliveries marked as not delivered:</td>\n <td className='text-right width-20'>{countUndelivered}</td>\n </tr>\n <tr>\n <td>Deliveries with status \"PENDING\":</td>\n <td className='text-right width-20'>{countPendingStatus}</td>\n </tr>\n <tr>\n <td>Deliveries with quantity 0:</td>\n <td className='text-right width-20'>{countQuantityZero}</td>\n </tr>\n <tr>\n <td>Deliveries with a written note:</td>\n <td className='text-right width-20'>{countWithNotes}</td>\n </tr>\n <tr>\n <td>Deliveries with at least one item:</td>\n <td className='text-right width-20'>{countWithItems}</td>\n </tr>\n </tbody>\n </table>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<table>\n <tbody>\n <tr>\n <td>Deliveries marked as delivered:</td>\n <td class=\"text-right width-20\">3</td>\n </tr>\n <tr>\n <td>Deliveries marked as not delivered:</td>\n <td class=\"text-right width-20\">2</td>\n </tr>\n <tr>\n <td>Deliveries with status \"PENDING\":</td>\n <td class=\"text-right width-20\">2</td>\n </tr>\n <tr>\n <td>Deliveries with quantity 0:</td>\n <td class=\"text-right width-20\">2</td>\n </tr>\n <tr>\n <td>Deliveries with a written note:</td>\n <td class=\"text-right width-20\">2</td>\n </tr>\n <tr>\n <td>Deliveries with at least one item:</td>\n <td class=\"text-right width-20\">3</td>\n </tr>\n </tbody>\n</table>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": "Options for the `useCount` hook",
40
+ "rows": [
41
+ {
42
+ "name": "items",
43
+ "type": "unknown[]",
44
+ "default": "",
45
+ "description": "The array of objects to evaluate."
46
+ },
47
+ {
48
+ "name": "path",
49
+ "type": "string",
50
+ "default": "",
51
+ "description": "Dot-separated path to the field that should be checked in each object."
52
+ },
53
+ {
54
+ "name": "options",
55
+ "type": "object",
56
+ "default": "",
57
+ "description": "Optional configuration for counting logic."
58
+ },
59
+ {
60
+ "name": "└equals",
61
+ "type": "unknown",
62
+ "default": "",
63
+ "description": "The exact value to match against. Only values that strictly equal this will be counted. Ignored if `match` is defined."
64
+ },
65
+ {
66
+ "name": "└match",
67
+ "type": "(value: unknown) => boolean",
68
+ "default": "",
69
+ "description": "Custom predicate function that determines whether a value should be counted. Overrides `equals` if defined."
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "heading": "Return value of the `useCount` hook",
75
+ "rows": [
76
+ {
77
+ "name": "count",
78
+ "type": "number",
79
+ "default": "",
80
+ "description": "The number of objects where the target value matches the given condition."
81
+ }
82
+ ]
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ }
88
+ ]
89
+ }
90
+ ],
91
+ "see_also": []
92
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:44.021Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useDarkMode",
5
+ "category": "Utilities",
6
+ "section": "Browser & device hooks",
7
+ "slug": "utilities/usedarkmode",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "f6bbcfae4bddbe420e300c18e9a5a4ef1e60bdc308360edbc656cf11881d361e"
11
+ },
12
+ "title": "useDarkMode",
13
+ "lead": "The useDarkMode hook enables you to listen for the color scheme change and react accordingly.",
14
+ "content": [
15
+ {
16
+ "heading": "useDarkMode",
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=\"display-flex flex-column justify-content-center align-items-center\"><label>isDarkMode:</label><div class=\"margin-15\">false</div></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import useDarkMode from '@rio-cloud/rio-uikit/useDarkMode';\n\nexport default () => {\n const isDarkMode = useDarkMode();\n\n return (\n <div className='display-flex flex-column justify-content-center align-items-center'>\n <label>isDarkMode:</label>\n <div className='margin-15'>{`${isDarkMode}`}</div>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div class=\"display-flex flex-column justify-content-center align-items-center\">\n <label>isDarkMode:</label>\n <div class=\"margin-15\">false</div>\n</div>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": null,
40
+ "rows": []
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }
48
+ ],
49
+ "see_also": []
50
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:45.352Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useDebugInfo",
5
+ "category": "Utilities",
6
+ "section": "UI state & input hooks",
7
+ "slug": "utilities/usedebuginfo",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "b6da444b07670e29579d78b5be339ed9b851f20e190af374a46ef4310d2e6f13"
11
+ },
12
+ "title": "useDebugInfo",
13
+ "lead": "The useDebugInfo hook allows to return detailed information about render count, render time and changed component props and also to print these information to the console.",
14
+ "content": [
15
+ {
16
+ "heading": "useDebugInfo",
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><div class=\"margin-bottom-25 padding-15 border\"><div><label>Component props:</label><div><b>isToggled: </b>false</div><div><b>count: </b>0</div></div><div class=\"margin-top-20\"><label>Debug Info:</label><pre class=\"bg-none text-size-12 text-color-darker\">{\n \"renderCount\": 1,\n \"changedProps\": {},\n \"timeSinceLastRender\": 0,\n \"lastRenderTimestamp\": 1763726924627\n}</pre></div></div><div class=\"btn-toolbar\"><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Toggle</button><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Increment</button></div></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState } from 'react';\n\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport useDebugInfo from '@rio-cloud/rio-uikit/useDebugInfo';\n\nconst ChildComponent = (props: { isToggled?: boolean; count?: number }) => {\n const { isToggled, count } = props;\n\n const info = useDebugInfo('ChildComponent', props);\n\n return (\n <div className='margin-bottom-25 padding-15 border'>\n <div>\n <label>Component props:</label>\n <div>\n <b>isToggled: </b>\n {isToggled?.toString()}\n </div>\n <div>\n <b>count: </b>\n {count}\n </div>\n </div>\n <div className='margin-top-20'>\n <label>Debug Info:</label>\n <pre className='bg-none text-size-12 text-color-darker'>{JSON.stringify(info, null, 1)}</pre>\n </div>\n </div>\n );\n};\n\nexport default () => {\n const [toggle, setToggle] = useState(false);\n const [count, setCount] = useState(0);\n\n return (\n <div>\n <ChildComponent isToggled={toggle} count={count} />\n <div className='btn-toolbar'>\n <Button onClick={() => setToggle(!toggle)}>Toggle</Button>\n <Button onClick={() => setCount(prevCount => prevCount + 1)}>Increment</Button>\n </div>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div>\n <div class=\"margin-bottom-25 padding-15 border\">\n <div>\n <label>Component props:</label>\n <div>\n <b>isToggled: </b>false\n </div>\n <div>\n <b>count: </b>0\n </div>\n </div>\n <div class=\"margin-top-20\">\n <label>Debug Info:</label>\n <pre class=\"bg-none text-size-12 text-color-darker\">{\n \"renderCount\": 1,\n \"changedProps\": {},\n \"timeSinceLastRender\": 0,\n \"lastRenderTimestamp\": 1763726924627\n}</pre>\n </div>\n </div>\n <div class=\"btn-toolbar\">\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Toggle</button>\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Increment</button>\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": "component",
43
+ "type": "String",
44
+ "default": "",
45
+ "description": "The name of the component that will be printed out."
46
+ },
47
+ {
48
+ "name": "props",
49
+ "type": "Object",
50
+ "default": "",
51
+ "description": "The component props that will be checked for changed values."
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ }
61
+ ],
62
+ "see_also": []
63
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:36.068Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useEffectOnce",
5
+ "category": "Utilities",
6
+ "section": "Lifecycle & execution hooks",
7
+ "slug": "utilities/useeffectonce",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "d4e780db1eda085c0cfc3eef1f2115174d7f2feb8a7670559ea36ec8b662854c"
11
+ },
12
+ "title": "useEffectOnce",
13
+ "lead": "The useEffectOnce hook allows to use a side effect only once after the component has been mounted.",
14
+ "content": [
15
+ {
16
+ "heading": "useEffectOnce",
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=\"display-flex flex-column justify-content-center align-items-center\"><div class=\"margin-15\">0</div><button class=\"btn btn-default\" type=\"button\">Increment</button></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState } from 'react';\n\nimport useEffectOnce from '@rio-cloud/rio-uikit/useEffectOnce';\n\nexport default () => {\n const [count, setCount] = useState(0);\n\n useEffectOnce(() => alert('Hi'));\n\n return (\n <div className='display-flex flex-column justify-content-center align-items-center'>\n <div className='margin-15'>{count}</div>\n <button className='btn btn-default' type='button' onClick={() => setCount(value => value + 1)}>\n Increment\n </button>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div class=\"display-flex flex-column justify-content-center align-items-center\">\n <div class=\"margin-15\">0</div>\n <button class=\"btn btn-default\" type=\"button\">Increment</button>\n</div>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": null,
40
+ "rows": [
41
+ {
42
+ "name": "callback",
43
+ "type": "Function",
44
+ "default": "",
45
+ "description": "The effect callback function to be used after the component has been mounted."
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "see_also": []
57
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:36.087Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useElapsedTime",
5
+ "category": "Utilities",
6
+ "section": "Lifecycle & execution hooks",
7
+ "slug": "utilities/useelapsedtime",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "58b8a7f8d9944ba4b87cc924dd011d3faf8fcf0209109c3acb3e2e75fdc6c48e"
11
+ },
12
+ "title": "useElapsedTime",
13
+ "lead": null,
14
+ "content": [
15
+ {
16
+ "heading": "useElapsedTime",
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><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Get elapsed time</button><p>Elapsed time sind mount: 0 ms</p></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState } from 'react';\n\nimport useElapsedTime from '@rio-cloud/rio-uikit/useElapsedTime';\nimport Button from '@rio-cloud/rio-uikit/Button';\n\nexport default () => {\n const [timeValue, setTimeValue] = useState(0);\n\n const getElapsedTime = useElapsedTime();\n\n const handleClick = () => {\n const elapsedTime = getElapsedTime();\n setTimeValue(elapsedTime);\n };\n\n return (\n <div>\n <Button onClick={handleClick}>Get elapsed time</Button>\n <p>Elapsed time sind mount: {timeValue} ms</p>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div>\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Get elapsed time</button>\n <p>Elapsed time sind mount: 0 ms</p>\n</div>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": null,
40
+ "rows": [
41
+ {
42
+ "name": "startTime",
43
+ "type": "Function",
44
+ "default": "Date.now()",
45
+ "description": "The start time in milliseconds from which to measure the elapsed time."
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "see_also": []
57
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:38.704Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useElementSize",
5
+ "category": "Utilities",
6
+ "section": "DOM behavior hooks",
7
+ "slug": "utilities/useelementsize",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "d3eea30c6bc4d40dc62b3d9f6be6e3d8ebac7915a1d64a8a9917b7cde007275c"
11
+ },
12
+ "title": "useElementSize",
13
+ "lead": "The useElementSize hook allows to easily detect an elements dimension.",
14
+ "content": [
15
+ {
16
+ "heading": "useElementSize",
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=\"display-flex flex-column justify-content-center align-items-center height-100\"><label>Resize box to see it's width updating</label><div class=\"height-50 bg-info position-relative\" style=\"width: 50px;\"><div class=\"Resizer resize-horizontal resize-right\"></div></div><div>Width: 50, Height: 50</div></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState, useRef } from 'react';\n\nimport useElementSize from '@rio-cloud/rio-uikit/useElementSize';\nimport Resizer from '@rio-cloud/rio-uikit/Resizer';\n\nexport default () => {\n const [boxWidth, setBoxWidth] = useState(50);\n\n const elementRef = useRef<HTMLDivElement>(null);\n const [width, height] = useElementSize(elementRef);\n\n const handleResize = (diff: number) => setBoxWidth(oldWidth => oldWidth - diff);\n\n return (\n <div className='display-flex flex-column justify-content-center align-items-center height-100'>\n <label>Resize box to see it's width updating</label>\n <div className='height-50 bg-info position-relative' style={{ width: boxWidth }} ref={elementRef}>\n <Resizer onResize={handleResize} />\n </div>\n\n <div>{`Width: ${width}, Height: ${height}`}</div>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div class=\"display-flex flex-column justify-content-center align-items-center height-100\">\n <label>Resize box to see it's width updating</label>\n <div class=\"height-50 bg-info position-relative\" style=\"width: 50px;\">\n <div class=\"Resizer resize-horizontal resize-right\">\n </div>\n </div>\n <div>Width: 50, Height: 50</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": "ref",
43
+ "type": "Function",
44
+ "default": "",
45
+ "description": "Pass a ref of the target element as parameter to the hook to get its height and width."
46
+ },
47
+ {
48
+ "name": "[width, height]",
49
+ "type": "Number",
50
+ "default": "",
51
+ "description": "Returns height and width values of the referenced element."
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ }
61
+ ],
62
+ "see_also": []
63
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:39.036Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useEsc",
5
+ "category": "Utilities",
6
+ "section": "DOM behavior hooks",
7
+ "slug": "utilities/useesc",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "0b41d89fcc5123c69a3746ce1711d60bf9a4cdadc180564e42062f4436ec8f43"
11
+ },
12
+ "title": "useEsc",
13
+ "lead": "The useEsc hook allows to easily detect keydown events for escape key to to react on. This comes in handy when closing something or aborting some operation on esc.",
14
+ "content": [
15
+ {
16
+ "heading": "useEsc",
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=\"display-flex flex-column justify-content-center align-items-center height-100\"><label class=\"margin-bottom-10\">Press \"esc\" key</label><textarea class=\"form-control width-50pct\" readonly=\"\" rows=\"4\"></textarea></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState } from 'react';\n\nimport useEsc from '@rio-cloud/rio-uikit/useEsc';\n\nexport default () => {\n const [log, setLog] = useState('');\n\n useEsc(event => {\n console.log(event);\n setLog(`${log}Esc pressed\\n`);\n });\n\n return (\n <div className='display-flex flex-column justify-content-center align-items-center height-100'>\n <label className='margin-bottom-10'>Press \"esc\" key</label>\n <textarea className='form-control width-50pct' value={log} readOnly rows={4} />\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div class=\"display-flex flex-column justify-content-center align-items-center height-100\">\n <label class=\"margin-bottom-10\">Press \"esc\" key</label>\n <textarea class=\"form-control width-50pct\" readonly=\"\" rows=\"4\">\n</textarea>\n</div>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": null,
40
+ "rows": [
41
+ {
42
+ "name": "callback",
43
+ "type": "Function",
44
+ "default": "",
45
+ "description": "The callback function to be triggered. It passes the key event as argument."
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "see_also": []
57
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:45.470Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useEvent",
5
+ "category": "Utilities",
6
+ "section": "UI state & input hooks",
7
+ "slug": "utilities/useevent",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "6a7d8a54014bf8a51b9d0a2ec6c7ae7f8f78118bfc291cb0473ffc6820524fba"
11
+ },
12
+ "title": "useEvent",
13
+ "lead": "The useEvent hook allows to easily detect given events registered on the document.",
14
+ "content": [
15
+ {
16
+ "heading": "useEvent",
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=\"display-flex justify-content-center align-items-center height-50\"><div class=\"margin-right-10\">Mouse position: </div><div class=\"label label-default\"> </div></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useState } from 'react';\nimport throttle from 'lodash/fp/throttle';\n\nimport useEvent from '@rio-cloud/rio-uikit/useEvent';\n\nconst THROTTLE_TIMEOUT_IN_MS = 100;\n\nexport default () => {\n const [mousePosition, setMousePosition] = useState(' ');\n\n const handleMouseMove = throttle(THROTTLE_TIMEOUT_IN_MS)(event => {\n setMousePosition(`x: ${event.screenX} - y: ${event.screenY}`);\n });\n\n useEvent('mousemove', handleMouseMove);\n\n return (\n <div className='display-flex justify-content-center align-items-center height-50'>\n <div className='margin-right-10'>{'Mouse position: '}</div>\n <div className='label label-default'>{mousePosition}</div>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div class=\"display-flex justify-content-center align-items-center height-50\">\n <div class=\"margin-right-10\">Mouse position: </div>\n <div class=\"label label-default\">x: 775 - y: 355</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": "callback",
43
+ "type": "Function",
44
+ "default": "",
45
+ "description": "The callback function to be triggered. It passes the key event as argument."
46
+ },
47
+ {
48
+ "name": "eventType",
49
+ "type": "String",
50
+ "default": "",
51
+ "description": "The event type to listen on."
52
+ },
53
+ {
54
+ "name": "options",
55
+ "type": "Boolean",
56
+ "default": "false",
57
+ "description": "Flag for event listener options."
58
+ },
59
+ {
60
+ "name": "target",
61
+ "type": "Node",
62
+ "default": "document",
63
+ "description": "The target the event shall be registered for. Use \"window\" for \"resize\" events."
64
+ }
65
+ ]
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ ],
74
+ "see_also": []
75
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "metadata": {
3
+ "captured_at": "2025-11-21T12:08:39.001Z",
4
+ "source": "https://uikit.developers.rio.cloud/#utilities/useFocusTrap",
5
+ "category": "Utilities",
6
+ "section": "DOM behavior hooks",
7
+ "slug": "utilities/usefocustrap",
8
+ "version": "v1.13.2",
9
+ "hash_algorithm": "sha256",
10
+ "hash": "da8de485bc0289908edaac6d3a1451a0f595c585af970ce6a71c3c8eebb4ec74"
11
+ },
12
+ "title": "useFocusTrap",
13
+ "lead": "This custom hook allows to keep the focus inside a defined wrapper element. This might be a dialog or a custom overlay.",
14
+ "content": [
15
+ {
16
+ "heading": "useFocusTrap",
17
+ "body": "- When you have a external component that will be re-rendered after the overlay opens, you can use the built-in ref. This ref will be returned from this hook and can be set on the respective wrapper element.\n- When you have an element that does not re-render, use a local state setter function to be set as the ref. This element can then be passed as a parameter to this hook and it will be used instead of the built-in ref.const [focusTrapRef, setFocusTrapRef] = useState<HTMLDivElement | null>(null); useFocusTrap(focusTrapRef); <div ref={setFocusTrapRef}>...</div>",
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><button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Open Dialog</button></div></div>",
22
+ "tabs": [
23
+ {
24
+ "label": "React",
25
+ "language": "tsx",
26
+ "code": "import { useEffect, useRef, useState } from 'react';\n\nimport Dialog from '@rio-cloud/rio-uikit/Dialog';\nimport Button from '@rio-cloud/rio-uikit/Button';\nimport useFocusTrap from '@rio-cloud/rio-uikit/useFocusTrap';\n\nconst DemoBody = () => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const focusTrapRef = useFocusTrap();\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, [inputRef.current]);\n\n return (\n <div ref={focusTrapRef} className='form-group display-flex gap-10'>\n <input ref={inputRef} className='form-control' />\n <div className='btn-toolbar flex-nowrap'>\n <Button>Button 1</Button>\n <Button>Button 2</Button>\n </div>\n </div>\n );\n};\n\nexport default () => {\n const [showDialog, setShowDialog] = useState(false);\n\n return (\n <div>\n <Dialog\n show={showDialog}\n onClose={() => setShowDialog(false)}\n title='Demo Focus Trap'\n showCloseButton\n bsSize='sm'\n body={<DemoBody />}\n />\n <Button onClick={() => setShowDialog(true)}>Open Dialog</Button>\n </div>\n );\n};"
27
+ },
28
+ {
29
+ "label": "HTML",
30
+ "language": "html",
31
+ "code": "<div>\n <button type=\"button\" class=\"btn btn-default btn-component\" tabindex=\"0\">Open Dialog</button>\n</div>"
32
+ },
33
+ {
34
+ "label": "Props",
35
+ "language": "json",
36
+ "code": null,
37
+ "props": [
38
+ {
39
+ "heading": null,
40
+ "rows": [
41
+ {
42
+ "name": "element",
43
+ "type": "HTMLDivElement | null",
44
+ "default": "",
45
+ "description": "The wrapper element that traps the focus. Use this if your component does not rerender, otherwise use the internal ref that gets returned from the hook."
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "see_also": []
57
+ }