@rio-cloud/uikit-mcp 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/doc-metadata.json +188 -88
- package/dist/docs/components/accentBar.md +35 -3
- package/dist/docs/components/activity.md +14 -3
- package/dist/docs/components/animatedNumber.md +17 -4
- package/dist/docs/components/animatedTextReveal.md +54 -8
- package/dist/docs/components/animations.md +33 -33
- package/dist/docs/components/appHeader.md +65 -9
- package/dist/docs/components/appLayout.md +566 -61
- package/dist/docs/components/appNavigationBar.md +55 -3
- package/dist/docs/components/areaCharts.md +14 -14
- package/dist/docs/components/aspectRatioPlaceholder.md +11 -3
- package/dist/docs/components/assetTree.md +1174 -328
- package/dist/docs/components/autosuggests.md +2 -2
- package/dist/docs/components/avatar.md +25 -3
- package/dist/docs/components/banner.md +3 -3
- package/dist/docs/components/barCharts.md +38 -38
- package/dist/docs/components/barList.md +22 -10
- package/dist/docs/components/basicMap.md +2 -2
- package/dist/docs/components/bottomSheet.md +100 -3
- package/dist/docs/components/button.md +549 -36
- package/dist/docs/components/buttonToolbar.md +10 -3
- package/dist/docs/components/calendarStripe.md +127 -85
- package/dist/docs/components/card.md +11 -3
- package/dist/docs/components/carousel.md +2 -2
- package/dist/docs/components/chartColors.md +2 -2
- package/dist/docs/components/chartsGettingStarted.md +2 -2
- package/dist/docs/components/chat.md +3 -3
- package/dist/docs/components/checkbox.md +67 -45
- package/dist/docs/components/circularProgress.md +465 -0
- package/dist/docs/components/clearableInput.md +18 -18
- package/dist/docs/components/collapse.md +28 -4
- package/dist/docs/components/composedCharts.md +20 -20
- package/dist/docs/components/contentLoader.md +126 -105
- package/dist/docs/components/dataTabs.md +191 -11
- package/dist/docs/components/datepickers.md +735 -723
- package/dist/docs/components/dialogs.md +362 -2
- package/dist/docs/components/divider.md +15 -3
- package/dist/docs/components/dropdowns.md +4548 -4355
- package/dist/docs/components/editableContent.md +187 -3
- package/dist/docs/components/expander.md +52 -5
- package/dist/docs/components/fade.md +42 -7
- package/dist/docs/components/fadeExpander.md +13 -4
- package/dist/docs/components/fadeUp.md +22 -4
- package/dist/docs/components/feedback.md +44 -3
- package/dist/docs/components/filePickers.md +45 -3
- package/dist/docs/components/formLabel.md +20 -5
- package/dist/docs/components/groupedItemList.md +54 -3
- package/dist/docs/components/iconList.md +5 -5
- package/dist/docs/components/imagePreloader.md +7 -3
- package/dist/docs/components/labeledElement.md +13 -3
- package/dist/docs/components/licensePlate.md +11 -3
- package/dist/docs/components/lineCharts.md +10 -10
- package/dist/docs/components/listMenu.md +78 -8
- package/dist/docs/components/loadMore.md +29 -3
- package/dist/docs/components/mainNavigation.md +5 -5
- package/dist/docs/components/mapCircle.md +2 -2
- package/dist/docs/components/mapCluster.md +2 -2
- package/dist/docs/components/mapContext.md +2 -2
- package/dist/docs/components/mapDraggableMarker.md +2 -2
- package/dist/docs/components/mapGettingStarted.md +2 -2
- package/dist/docs/components/mapInfoBubble.md +2 -2
- package/dist/docs/components/mapLayerGroup.md +2 -2
- package/dist/docs/components/mapMarker.md +2 -2
- package/dist/docs/components/mapPolygon.md +2 -2
- package/dist/docs/components/mapRoute.md +2 -2
- package/dist/docs/components/mapRouteGenerator.md +2 -2
- package/dist/docs/components/mapSettings.md +9 -9
- package/dist/docs/components/mapUtils.md +2 -2
- package/dist/docs/components/multiselects.md +2 -2
- package/dist/docs/components/noData.md +23 -3
- package/dist/docs/components/notifications.md +2 -2
- package/dist/docs/components/numbercontrol.md +54 -5
- package/dist/docs/components/onboarding.md +26 -2
- package/dist/docs/components/page.md +33 -3
- package/dist/docs/components/pager.md +15 -3
- package/dist/docs/components/pieCharts.md +89 -78
- package/dist/docs/components/popover.md +40 -2
- package/dist/docs/components/position.md +11 -3
- package/dist/docs/components/radialBarCharts.md +2054 -2012
- package/dist/docs/components/radioCardGroup.md +487 -0
- package/dist/docs/components/radiobutton.md +138 -10
- package/dist/docs/components/releaseNotes.md +19 -2
- package/dist/docs/components/resizer.md +14 -3
- package/dist/docs/components/responsiveColumnStripe.md +20 -3
- package/dist/docs/components/responsiveVideo.md +12 -3
- package/dist/docs/components/rioglyph.md +13 -3
- package/dist/docs/components/rules.md +95 -5
- package/dist/docs/components/saveableInput.md +400 -276
- package/dist/docs/components/selects.md +2 -2
- package/dist/docs/components/sidebar.md +39 -3
- package/dist/docs/components/sliders.md +38 -3
- package/dist/docs/components/smoothScrollbars.md +93 -3
- package/dist/docs/components/spinners.md +51 -3
- package/dist/docs/components/states.md +217 -2
- package/dist/docs/components/statsWidgets.md +123 -3
- package/dist/docs/components/statusBar.md +29 -3
- package/dist/docs/components/stepButton.md +9 -3
- package/dist/docs/components/steppedProgressBars.md +67 -3
- package/dist/docs/components/subNavigation.md +24 -17
- package/dist/docs/components/supportMarker.md +2 -2
- package/dist/docs/components/svgImage.md +13 -3
- package/dist/docs/components/switch.md +218 -82
- package/dist/docs/components/tables.md +2 -2
- package/dist/docs/components/tagManager.md +56 -2
- package/dist/docs/components/tags.md +33 -3
- package/dist/docs/components/teaser.md +30 -3
- package/dist/docs/components/textTruncateMiddle.md +151 -0
- package/dist/docs/components/timeline.md +2 -2
- package/dist/docs/components/timepicker.md +687 -63
- package/dist/docs/components/toggleButton.md +96 -10
- package/dist/docs/components/tooltip.md +30 -21
- package/dist/docs/components/tracker.md +631 -0
- package/dist/docs/components/virtualList.md +107 -84
- package/dist/docs/foundations.md +647 -275
- package/dist/docs/start/changelog.md +2 -738
- package/dist/docs/start/goodtoknow.md +2 -2
- package/dist/docs/start/guidelines/color-combinations.md +2 -2
- package/dist/docs/start/guidelines/custom-css.md +2 -2
- package/dist/docs/start/guidelines/custom-rioglyph.md +2 -2
- package/dist/docs/start/guidelines/formatting.md +2 -2
- package/dist/docs/start/guidelines/iframe.md +2 -2
- package/dist/docs/start/guidelines/obfuscate-data.md +2 -2
- package/dist/docs/start/guidelines/print-css.md +2 -2
- package/dist/docs/start/guidelines/spinner.md +82 -82
- package/dist/docs/start/guidelines/state-in-url.md +263 -0
- package/dist/docs/start/guidelines/supported-browsers.md +2 -2
- package/dist/docs/start/guidelines/writing.md +2 -2
- package/dist/docs/start/howto.md +10 -10
- package/dist/docs/start/intro.md +2 -2
- package/dist/docs/start/responsiveness.md +2 -2
- package/dist/docs/templates/common-table.md +15 -14
- package/dist/docs/templates/detail-views.md +3 -3
- package/dist/docs/templates/expandable-details.md +2 -2
- package/dist/docs/templates/feature-cards.md +56 -56
- package/dist/docs/templates/form-summary.md +23 -23
- package/dist/docs/templates/form-toggle.md +2 -2
- package/dist/docs/templates/list-blocks.md +204 -204
- package/dist/docs/templates/loading-progress.md +2 -2
- package/dist/docs/templates/options-panel.md +2 -2
- package/dist/docs/templates/panel-variants.md +2 -2
- package/dist/docs/templates/progress-cards.md +2 -2
- package/dist/docs/templates/progress-success.md +2 -2
- package/dist/docs/templates/settings-form.md +24 -24
- package/dist/docs/templates/stats-blocks.md +18 -18
- package/dist/docs/templates/table-panel.md +2 -2
- package/dist/docs/templates/table-row-animation.md +2 -2
- package/dist/docs/templates/usage-cards.md +2 -2
- package/dist/docs/utilities/classNames.md +191 -0
- package/dist/docs/utilities/deviceUtils.md +2 -2
- package/dist/docs/utilities/featureToggles.md +2 -2
- package/dist/docs/utilities/fuelTypeUtils.md +2 -2
- package/dist/docs/utilities/routeUtils.md +326 -90
- package/dist/docs/utilities/useAfterMount.md +2 -2
- package/dist/docs/utilities/useAutoAnimate.md +2 -2
- package/dist/docs/utilities/useAverage.md +2 -2
- package/dist/docs/utilities/useClickOutside.md +2 -2
- package/dist/docs/utilities/useClipboard.md +3 -3
- package/dist/docs/utilities/useCookies.md +188 -0
- package/dist/docs/utilities/useCount.md +2 -2
- package/dist/docs/utilities/useDarkMode.md +2 -2
- package/dist/docs/utilities/useDebugInfo.md +5 -5
- package/dist/docs/utilities/useEffectOnce.md +2 -2
- package/dist/docs/utilities/useElapsedTime.md +2 -2
- package/dist/docs/utilities/useElementSize.md +2 -2
- package/dist/docs/utilities/useEsc.md +2 -2
- package/dist/docs/utilities/useEvent.md +2 -2
- package/dist/docs/utilities/useFocusTrap.md +2 -2
- package/dist/docs/utilities/useFullscreen.md +2 -2
- package/dist/docs/utilities/useHover.md +2 -2
- package/dist/docs/utilities/useIncomingPostMessages.md +2 -2
- package/dist/docs/utilities/useInterval.md +2 -2
- package/dist/docs/utilities/useIsFocusWithin.md +2 -2
- package/dist/docs/utilities/useKey.md +2 -2
- package/dist/docs/utilities/useLocalStorage.md +2 -2
- package/dist/docs/utilities/useLocationSuggestions.md +2 -2
- package/dist/docs/utilities/useMax.md +2 -2
- package/dist/docs/utilities/useMin.md +2 -2
- package/dist/docs/utilities/useMutationObserver.md +2 -2
- package/dist/docs/utilities/useOnScreen.md +2 -2
- package/dist/docs/utilities/useOnlineStatus.md +2 -2
- package/dist/docs/utilities/usePostMessage.md +3 -3
- package/dist/docs/utilities/usePostMessageSender.md +2 -2
- package/dist/docs/utilities/usePrevious.md +2 -2
- package/dist/docs/utilities/useResizeObserver.md +2 -2
- package/dist/docs/utilities/useRioCookieConsent.md +90 -0
- package/dist/docs/utilities/useScrollPosition.md +2 -2
- package/dist/docs/utilities/useSearch.md +2 -2
- package/dist/docs/utilities/useSearchHighlight.md +815 -0
- package/dist/docs/utilities/useSorting.md +2 -2
- package/dist/docs/utilities/useStateWithValidation.md +2 -2
- package/dist/docs/utilities/useSum.md +2 -2
- package/dist/docs/utilities/useTableExport.md +53 -53
- package/dist/docs/utilities/useTableSelection.md +90 -90
- package/dist/docs/utilities/useTimeout.md +2 -2
- package/dist/docs/utilities/useToggle.md +3 -3
- package/dist/docs/utilities/useUrlState.md +418 -0
- package/dist/docs/utilities/useWindowResize.md +2 -2
- package/dist/index.mjs +8 -8
- package/dist/version.json +2 -2
- package/package.json +9 -9
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# State in URL (deep links)
|
|
2
|
+
|
|
3
|
+
*Category:* Getting started
|
|
4
|
+
*Section:* Guidelines
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/guidelines/state-in-url
|
|
6
|
+
*Captured:* 2026-02-23T13:48:34.867Z
|
|
7
|
+
|
|
8
|
+
Every service frontend should support deep linking and reflect meaningful UI state in the URL. This enables restoring state when links are shared, when they are stored as bookmarks, when users navigate with browser history, or when a service is opened from another app.
|
|
9
|
+
|
|
10
|
+
## State in URL (deep links)
|
|
11
|
+
|
|
12
|
+
## Mental model
|
|
13
|
+
|
|
14
|
+
Think of the URL as the external representation of app state. It should describe where the user is and what they are looking at (intent), not what they are currently doing (interaction).
|
|
15
|
+
|
|
16
|
+
State that only lives in memory breaks a core web expectation. If users refresh or navigate back and lose filters, view settings, or selections, the app feels unreliable. URLs should preserve context so users can return to the same place without redoing their work.
|
|
17
|
+
|
|
18
|
+
## Decision criteria
|
|
19
|
+
|
|
20
|
+
Before putting something in the URL, ask:
|
|
21
|
+
|
|
22
|
+
- Would the user expect this to persist after reload or sharing the link?
|
|
23
|
+
- Would the link feel “broken” without it?
|
|
24
|
+
- Does it describe intent rather than a transient UI interaction?
|
|
25
|
+
|
|
26
|
+
## What belongs in the URL
|
|
27
|
+
|
|
28
|
+
## Good candidates
|
|
29
|
+
|
|
30
|
+
- Search queries and filters
|
|
31
|
+
- Sorting and column visibility (when it changes what users see)
|
|
32
|
+
- View modes (list/grid/table/map)
|
|
33
|
+
- Date ranges and time periods
|
|
34
|
+
- Selected items or active tabs (focus)
|
|
35
|
+
- UI configuration that affects content (e.g. grouping, expanded views)
|
|
36
|
+
- Feature variants (only if stable and safe to share)
|
|
37
|
+
|
|
38
|
+
## Poor candidates
|
|
39
|
+
|
|
40
|
+
- Sensitive information (passwords, tokens, PII) - NEVER!
|
|
41
|
+
- Temporary UI states (e.g. dropdown expanded, tooltip open)
|
|
42
|
+
- Form input in progress (unsaved changes)
|
|
43
|
+
- Very large or complex nested data
|
|
44
|
+
- Base64 encoded data
|
|
45
|
+
- High-frequency transient state (mouse position, scroll)
|
|
46
|
+
|
|
47
|
+
## Example deep links
|
|
48
|
+
|
|
49
|
+
Prefer readable, self-describing URLs. Use consistent naming across services to make deep links easier to share and reason about.
|
|
50
|
+
|
|
51
|
+
## Annotated example
|
|
52
|
+
|
|
53
|
+
https://example.com/#/assets?q=truck&sort=-name&viewType=table&selectedAssetId=asset-123
|
|
54
|
+
|
|
55
|
+
q search query (user intent)
|
|
56
|
+
sort sort key with direction prefix ("-name" = descending by name)
|
|
57
|
+
viewType content representation mode
|
|
58
|
+
selectedAssetId focused entity that should be shareable/restorable
|
|
59
|
+
|
|
60
|
+
## More examples
|
|
61
|
+
|
|
62
|
+
https://example.com/#/overview?view=history&assetIds=5a88af1e-2fb2-494e-9240-6a833d5f1791&q=10&startDate=2019-06-17T00:00:00Z&endDate=2019-06-17T23:59:59Z&sort=timestamp#details
|
|
63
|
+
https://example.com/#/drivers/74eb88e1-1a84-4abe-90bc-9e0079807d57?driverState=ACTIVE&q=my%20test
|
|
64
|
+
https://example.com/#/users/0848-b02e-47be-bd77-d332f61a90d6?sort=-lastName
|
|
65
|
+
https://example.com/#/issues?projectKey=FM&view=details&selectedIssue=FM-4346
|
|
66
|
+
|
|
67
|
+
Treat the URL as user input. Invalid or unknown params should not break rendering. Fall back to defaults and keep the UI usable.
|
|
68
|
+
|
|
69
|
+
## Common param names
|
|
70
|
+
|
|
71
|
+
Use consistent, concise camelCase param names across services whenever possible. If URLs become verbose, prefer a well-known short form (e.g. q, lat / lng) and document it so other teams can align.
|
|
72
|
+
|
|
73
|
+
## URLs as contracts
|
|
74
|
+
|
|
75
|
+
Well-designed URLs are more than a storage place for state. They become a contract between your app and its consumers, setting expectations for humans, developers, and machines.
|
|
76
|
+
|
|
77
|
+
A clear URL draws boundaries between public and private state, shareable and session-only data, and client versus server responsibility. Developers know what is safe to persist, users know what they can bookmark, and machines know what is worth indexing.
|
|
78
|
+
|
|
79
|
+
Readable URLs communicate meaning. Compare:
|
|
80
|
+
|
|
81
|
+
// bad: unclear intent, hard to reason about
|
|
82
|
+
https://example.com/#/p?id=x7f2k&v=3
|
|
83
|
+
|
|
84
|
+
// good: self-describing, stable, easier to maintain
|
|
85
|
+
https://example.com/#/products/laptop?color=silver&sort=price
|
|
86
|
+
|
|
87
|
+
The first hides intent; the second explains itself and is easier to evolve without breaking consumers.
|
|
88
|
+
|
|
89
|
+
## How to
|
|
90
|
+
|
|
91
|
+
Typical flow:
|
|
92
|
+
|
|
93
|
+
- Define which parts of state belong in the URL and what the defaults are.
|
|
94
|
+
- Parse URL to initial state on load.
|
|
95
|
+
- Update URL when state changes (omit defaults to keep URLs compact).
|
|
96
|
+
- Choose history behavior (push vs replace) based on user expectations.
|
|
97
|
+
|
|
98
|
+
Use UIKIT utilities instead of hand-rolled parsers:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { useLocation, useNavigate, useNavigationType } from 'react-router-dom';
|
|
102
|
+
import useUrlState from '@rio-cloud/rio-uikit/useUrlState';
|
|
103
|
+
import type { UrlConfigItem } from '@rio-cloud/rio-uikit/routeUtils';
|
|
104
|
+
|
|
105
|
+
type ViewType = 'list' | 'grid';
|
|
106
|
+
type AppState = { query: string; viewType: ViewType; tags: string[] };
|
|
107
|
+
|
|
108
|
+
const actions = {
|
|
109
|
+
setQuery: (value: string) => ({ type: 'setQuery' as const, payload: value }),
|
|
110
|
+
setViewType: (value: ViewType) => ({ type: 'setViewType' as const, payload: value }),
|
|
111
|
+
setTags: (value: string[]) => ({ type: 'setTags' as const, payload: value }),
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const config: readonly UrlConfigItem<AppState, unknown>[] = [
|
|
115
|
+
{ key: 'q', selector: s => s.query, action: actions.setQuery, defaultValue: '' },
|
|
116
|
+
{ key: 'viewType', selector: s => s.viewType, action: actions.setViewType, defaultValue: 'list' },
|
|
117
|
+
{ key: 'tags', selector: s => s.tags, action: actions.setTags, type: 'array', defaultValue: [] },
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
const location = useLocation();
|
|
121
|
+
const navigate = useNavigate();
|
|
122
|
+
const navigationType = useNavigationType();
|
|
123
|
+
|
|
124
|
+
useUrlState({
|
|
125
|
+
config,
|
|
126
|
+
searchString: location.search,
|
|
127
|
+
storeValues: { q: state.query, viewType: state.viewType, tags: state.tags },
|
|
128
|
+
navigationType,
|
|
129
|
+
onUpdateStore: action => dispatch(action),
|
|
130
|
+
onNavigate: (search, mode) => navigate({ search }, { replace: mode === 'replace' }),
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> Implementation details: See useUrlState and route utils for details.
|
|
135
|
+
|
|
136
|
+
## Best practices
|
|
137
|
+
|
|
138
|
+
Keep URLs tidy, predictable, and easy to share. Compact URLs are easier to read, easier to compare, and less likely to break in older environments.
|
|
139
|
+
|
|
140
|
+
Handle defaults by omitting them from the URL. Only include values that differ from the default state.
|
|
141
|
+
|
|
142
|
+
// avoid: defaults add noise
|
|
143
|
+
?viewType=table&lang=en&sort=date&filters=type
|
|
144
|
+
|
|
145
|
+
// prefer: only non-default values
|
|
146
|
+
?viewType=grid
|
|
147
|
+
|
|
148
|
+
## pushState vs. replaceState
|
|
149
|
+
|
|
150
|
+
Use pushState when a change is a meaningful navigation step and should be undoable via the Back button (switching view type, applying a filter set). Use replaceState for small refinements where history noise would harm usability (search-as-you-type, incremental tweaks).
|
|
151
|
+
|
|
152
|
+
// use pushState for meaningful navigation steps (undoable via Back button)
|
|
153
|
+
?viewType=grid
|
|
154
|
+
?selectedAssetId=asset-123
|
|
155
|
+
?filters=type:truck,status:active
|
|
156
|
+
|
|
157
|
+
// use replaceState for refinements (avoid noisy history)
|
|
158
|
+
?q=tr
|
|
159
|
+
?q=tru
|
|
160
|
+
?q=truck
|
|
161
|
+
|
|
162
|
+
Respect the Back button: if a change should be undoable, use pushState. If it is just a refinement, prefer replaceState.
|
|
163
|
+
|
|
164
|
+
## URL state and Redux
|
|
165
|
+
|
|
166
|
+
Pick one source of truth and keep synchronization one-way to avoid loops.
|
|
167
|
+
|
|
168
|
+
**URL as source of truth (simple cases)**
|
|
169
|
+
|
|
170
|
+
- Read URL params directly (for example with React Router search params).
|
|
171
|
+
- Derive rendered state from URL values.
|
|
172
|
+
- Update URL directly from UI actions with push/replace based on intent.
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { useMemo } from 'react';
|
|
176
|
+
import { useSearchParams } from 'react-router-dom';
|
|
177
|
+
|
|
178
|
+
type ViewType = 'list' | 'grid';
|
|
179
|
+
|
|
180
|
+
// URL as source of truth (simple screens, no centralized store sync)
|
|
181
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
182
|
+
|
|
183
|
+
const urlState = useMemo(
|
|
184
|
+
() => ({
|
|
185
|
+
q: searchParams.get('q') ?? '',
|
|
186
|
+
viewType: (searchParams.get('viewType') as ViewType) ?? 'list',
|
|
187
|
+
}),
|
|
188
|
+
[searchParams]
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
const setUrlState = (patch: Partial<typeof urlState>, historyMode: 'push' | 'replace' = 'push') => {
|
|
192
|
+
const next = new URLSearchParams(searchParams);
|
|
193
|
+
const merged = { ...urlState, ...patch };
|
|
194
|
+
|
|
195
|
+
if (merged.q) next.set('q', merged.q);
|
|
196
|
+
else next.delete('q');
|
|
197
|
+
|
|
198
|
+
if (merged.viewType === 'list') next.delete('viewType');
|
|
199
|
+
else next.set('viewType', merged.viewType);
|
|
200
|
+
|
|
201
|
+
setSearchParams(next, { replace: historyMode === 'replace' });
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// Typical usage:
|
|
205
|
+
const onSearchChange = (q: string) => setUrlState({ q }, 'replace'); // typing/search refinement
|
|
206
|
+
const onViewTypeChange = (viewType: ViewType) => setUrlState({ viewType }, 'push'); // meaningful step
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Redux as source of truth (more complex but recommend for more complex SPAs)**
|
|
210
|
+
|
|
211
|
+
- Parse the URL once to seed initial Redux state.
|
|
212
|
+
- Subscribe to Redux and update the URL (debounced).
|
|
213
|
+
- Listen for URL changes and dispatch to Redux with guards to avoid loops and no-op updates.
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
import useUrlState from '@rio-cloud/rio-uikit/useUrlState';
|
|
217
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
218
|
+
import { useLocation, useNavigate, useNavigationType } from 'react-router-dom';
|
|
219
|
+
import type { AppDispatch } from '../../../../setup/store';
|
|
220
|
+
|
|
221
|
+
// Redux as source of truth (recommended for larger SPAs)
|
|
222
|
+
// 1) Parse URL and dispatch updates on URL changes (including browser POP).
|
|
223
|
+
// 2) Observe store values and write URL changes via push/replace rules.
|
|
224
|
+
// 3) Keep this logic centralized in one component near the router.
|
|
225
|
+
|
|
226
|
+
const dispatch = useDispatch<AppDispatch>();
|
|
227
|
+
const location = useLocation();
|
|
228
|
+
const navigate = useNavigate();
|
|
229
|
+
const navigationType = useNavigationType();
|
|
230
|
+
|
|
231
|
+
const storeValues = useSelector(state => ({
|
|
232
|
+
q: getSearchValue(state),
|
|
233
|
+
sort: { sortBy: getSortBy(state), sortDir: getSortDir(state) },
|
|
234
|
+
filters: getActivityFilter(state),
|
|
235
|
+
}));
|
|
236
|
+
|
|
237
|
+
useUrlState({
|
|
238
|
+
config: tableUrlConfig,
|
|
239
|
+
searchString: location.search,
|
|
240
|
+
storeValues,
|
|
241
|
+
localStorageKey: 'service.ui.state',
|
|
242
|
+
navigationType,
|
|
243
|
+
onUpdateStore: action => dispatch(action),
|
|
244
|
+
onNavigate: (search, mode) => navigate({ search }, { replace: mode === 'replace' }),
|
|
245
|
+
});
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
useUrlState supports this second model: centralized store-url synchronization. If you still use template helpers like routeHelper with qs, replace them with a centralized config + useUrlState synchronizer and define per-field history behavior with history: 'push' | 'replace'.
|
|
249
|
+
|
|
250
|
+
## Things to consider
|
|
251
|
+
|
|
252
|
+
- Use comma-separated values for lists (keep them readable, avoid encoding commas in lists).
|
|
253
|
+
- Keep param names explicit and avoid merging unrelated state into one param.
|
|
254
|
+
- If a value equals the default, omit it from the URL to reduce clutter.
|
|
255
|
+
- Encode user input (search strings) with encodeURIComponent.
|
|
256
|
+
- Document formats for dates and timezones (recommend UTC) and coordinate precision.
|
|
257
|
+
- Treat URL params as untrusted input: ignore unknown params, fall back to defaults for invalid values, and never break rendering due to a malformed URL.
|
|
258
|
+
|
|
259
|
+
## Limitations
|
|
260
|
+
|
|
261
|
+
URL length limits vary by browser, OS, and environment. Modern browsers typically handle very long URLs, but older/legacy browsers can fail around a few thousand characters.
|
|
262
|
+
|
|
263
|
+
Keep URLs concise. If you need to support older environments, validate URL length limits in your target setup and consider alternative persistence (e.g. server-side saved views) for large state.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Getting started
|
|
4
4
|
*Section:* Guidelines
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/guidelines/supported-browsers
|
|
6
|
+
*Captured:* 2026-02-23T13:48:36.676Z
|
|
7
7
|
|
|
8
8
|
We currently support the following browsers:
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Getting started
|
|
4
4
|
*Section:* Guidelines
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/guidelines/writing
|
|
6
|
+
*Captured:* 2026-02-23T13:48:37.143Z
|
|
7
7
|
|
|
8
8
|
UX writing doesn't receive as much attention as it should. In the past, digital experiences featured words written by different individuals - ranging from designers to engineers — at various times and in diverse styles, all without a centralized guide.
|
|
9
9
|
|
package/dist/docs/start/howto.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Getting started
|
|
4
4
|
*Section:* Welcome
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/howto
|
|
6
|
+
*Captured:* 2026-02-23T13:48:35.220Z
|
|
7
7
|
|
|
8
8
|
Install the latest version of the UIKIT (that includes latest beta versions as well) via
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ npm install @rio-cloud/rio-uikit
|
|
|
33
33
|
Or install a dedicated version via
|
|
34
34
|
|
|
35
35
|
```javascript
|
|
36
|
-
npm install @rio-cloud/rio-uikit@2.
|
|
36
|
+
npm install @rio-cloud/rio-uikit@2.2.0
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## TypeScript
|
|
@@ -85,7 +85,7 @@ ManualNot Recommended
|
|
|
85
85
|
Use the CSS Stylesheet as follows (specify your required version number in the URL) if you need more control on what style you want to use.
|
|
86
86
|
|
|
87
87
|
```html
|
|
88
|
-
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.
|
|
88
|
+
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.2.0/rio-uikit.css">
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
> Note: Please make sure to use the same UIKIT style version as the npm package, otherwise this will lead to inconsistency and UI bugs.
|
|
@@ -99,15 +99,15 @@ These other themes may only be used for applications or services who don't run o
|
|
|
99
99
|
In order to use such a brand theme, modify the URL in the <link> tag that loads the CSS
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.
|
|
102
|
+
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.2.0/vw-uikit.css">
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
```html
|
|
106
|
-
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.
|
|
106
|
+
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.2.0/man-uikit.css">
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.
|
|
110
|
+
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.2.0/scania-uikit.css">
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
ManagedRecommended
|
|
@@ -131,7 +131,7 @@ You can simply omit the <link> tag in your index.html altogether. The UIKIT will
|
|
|
131
131
|
The UIKIT supports simple print stylings in order to have printable content. See Print CSS
|
|
132
132
|
|
|
133
133
|
```html
|
|
134
|
-
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.
|
|
134
|
+
<link rel="stylesheet" type="text/css" href="https://uikit.developers.rio.cloud/2.2.0/rio-uikit-print-utilities.css">
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
## Additional styling information
|
|
@@ -139,7 +139,7 @@ The UIKIT supports simple print stylings in order to have printable content. See
|
|
|
139
139
|
In some cases like using D3 you may need the color variables as .json from the UIKIT provided via CDN. You can fetch the provided file from CDN via the following URL:
|
|
140
140
|
|
|
141
141
|
```html
|
|
142
|
-
https://uikit.developers.rio.cloud/2.
|
|
142
|
+
https://uikit.developers.rio.cloud/2.2.0/rio-uikit-colors.json
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
## Dark mode
|
|
@@ -168,7 +168,7 @@ The UIKIT is fully dark mode ready.
|
|
|
168
168
|
In cases where the React ApplicationLayout component cannot be used, you can import the new darkmode.js from the UIKIT CDN and add it to your index.html. This script will take care of listening to the theme switch for you.
|
|
169
169
|
|
|
170
170
|
```html
|
|
171
|
-
<script src="https://uikit.developers.rio.cloud/2.
|
|
171
|
+
<script src="https://uikit.developers.rio.cloud/2.2.0/rio-darkmode.js"></script>
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
If you want to react on the dark mode for instance to exchange some images or apply some specific utility classes, you can use the custom hook useDarkMode to do so.
|
package/dist/docs/start/intro.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Getting started
|
|
4
4
|
*Section:* Welcome
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/intro
|
|
6
|
+
*Captured:* 2026-02-23T13:48:34.460Z
|
|
7
7
|
|
|
8
8
|
Welcome! This UI library is designed to help you build beautiful, consistent, and maintainable user interfaces with minimal effort. Here’s how you can make the most of it:
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Getting started
|
|
4
4
|
*Section:* Guidelines
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/start/responsiveness
|
|
6
|
+
*Captured:* 2026-02-23T13:48:35.159Z
|
|
7
7
|
|
|
8
8
|
The UIKIT considers all platforms — both desktop and mobile. We recognize that people work across many different products and often need to support multiple platforms and the UIKIT is a foundation for that with its many responsive building blocks and responsive components.
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Templates
|
|
4
4
|
*Section:* Tables
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/templates/common-table
|
|
6
|
+
*Captured:* 2026-02-23T13:48:44.299Z
|
|
7
7
|
|
|
8
8
|
## Common table
|
|
9
9
|
|
|
@@ -80,8 +80,8 @@ Load more
|
|
|
80
80
|
```tsx
|
|
81
81
|
import { useEffect, useMemo, useState } from 'react';
|
|
82
82
|
import { isEmpty, omit } from 'es-toolkit/compat';
|
|
83
|
-
import classNames from 'classnames';
|
|
84
83
|
|
|
84
|
+
import classNames from '@rio-cloud/rio-uikit/classNames';
|
|
85
85
|
import TableToolbar from '@rio-cloud/rio-uikit/TableToolbar';
|
|
86
86
|
import TableViewToggles, { type TableViewTogglesViewType } from '@rio-cloud/rio-uikit/TableViewToggles';
|
|
87
87
|
import TableSearch from '@rio-cloud/rio-uikit/TableSearch';
|
|
@@ -307,7 +307,8 @@ const TableCommonDemo = (props: TableCommonDemoProps) => {
|
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
// Filter for hidden columns
|
|
310
|
-
const
|
|
310
|
+
const hiddenColumnsSet = new Set(hiddenColumns);
|
|
311
|
+
const columns = columnOrder.filter(name => !hiddenColumnsSet.has(name));
|
|
311
312
|
|
|
312
313
|
// Filter data to omit hidden columns
|
|
313
314
|
const filteredRows = sortedItems.map(vehicle => omit(vehicle, hiddenColumns)) as Vehicle[];
|
|
@@ -787,7 +788,7 @@ export default TableCommonDemo;
|
|
|
787
788
|
<td class="table-action">
|
|
788
789
|
<span>
|
|
789
790
|
<div class="dropdown btn-group">
|
|
790
|
-
<button type="button" id="
|
|
791
|
+
<button type="button" id="trd65487yqs" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
791
792
|
<span class="rioglyph rioglyph-option-vertical">
|
|
792
793
|
</span>
|
|
793
794
|
</button>
|
|
@@ -818,7 +819,7 @@ export default TableCommonDemo;
|
|
|
818
819
|
<td class="table-action">
|
|
819
820
|
<span>
|
|
820
821
|
<div class="dropdown btn-group">
|
|
821
|
-
<button type="button" id="
|
|
822
|
+
<button type="button" id="wdz1utbw6l9" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
822
823
|
<span class="rioglyph rioglyph-option-vertical">
|
|
823
824
|
</span>
|
|
824
825
|
</button>
|
|
@@ -849,7 +850,7 @@ export default TableCommonDemo;
|
|
|
849
850
|
<td class="table-action">
|
|
850
851
|
<span>
|
|
851
852
|
<div class="dropdown btn-group">
|
|
852
|
-
<button type="button" id="
|
|
853
|
+
<button type="button" id="1l0ty4wxe9n" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
853
854
|
<span class="rioglyph rioglyph-option-vertical">
|
|
854
855
|
</span>
|
|
855
856
|
</button>
|
|
@@ -880,7 +881,7 @@ export default TableCommonDemo;
|
|
|
880
881
|
<td class="table-action">
|
|
881
882
|
<span>
|
|
882
883
|
<div class="dropdown btn-group">
|
|
883
|
-
<button type="button" id="
|
|
884
|
+
<button type="button" id="ivqs9z3cr6h" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
884
885
|
<span class="rioglyph rioglyph-option-vertical">
|
|
885
886
|
</span>
|
|
886
887
|
</button>
|
|
@@ -911,7 +912,7 @@ export default TableCommonDemo;
|
|
|
911
912
|
<td class="table-action">
|
|
912
913
|
<span>
|
|
913
914
|
<div class="dropdown btn-group">
|
|
914
|
-
<button type="button" id="
|
|
915
|
+
<button type="button" id="w8r8fiunzde" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
915
916
|
<span class="rioglyph rioglyph-option-vertical">
|
|
916
917
|
</span>
|
|
917
918
|
</button>
|
|
@@ -938,7 +939,7 @@ export default TableCommonDemo;
|
|
|
938
939
|
<td class="table-action">
|
|
939
940
|
<span>
|
|
940
941
|
<div class="dropdown btn-group">
|
|
941
|
-
<button type="button" id="
|
|
942
|
+
<button type="button" id="lhbkn1zoxkg" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
942
943
|
<span class="rioglyph rioglyph-option-vertical">
|
|
943
944
|
</span>
|
|
944
945
|
</button>
|
|
@@ -969,7 +970,7 @@ export default TableCommonDemo;
|
|
|
969
970
|
<td class="table-action">
|
|
970
971
|
<span>
|
|
971
972
|
<div class="dropdown btn-group">
|
|
972
|
-
<button type="button" id="
|
|
973
|
+
<button type="button" id="as32daumgbi" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
973
974
|
<span class="rioglyph rioglyph-option-vertical">
|
|
974
975
|
</span>
|
|
975
976
|
</button>
|
|
@@ -1000,7 +1001,7 @@ export default TableCommonDemo;
|
|
|
1000
1001
|
<td class="table-action">
|
|
1001
1002
|
<span>
|
|
1002
1003
|
<div class="dropdown btn-group">
|
|
1003
|
-
<button type="button" id="
|
|
1004
|
+
<button type="button" id="d6k381docg9" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
1004
1005
|
<span class="rioglyph rioglyph-option-vertical">
|
|
1005
1006
|
</span>
|
|
1006
1007
|
</button>
|
|
@@ -1031,7 +1032,7 @@ export default TableCommonDemo;
|
|
|
1031
1032
|
<td class="table-action">
|
|
1032
1033
|
<span>
|
|
1033
1034
|
<div class="dropdown btn-group">
|
|
1034
|
-
<button type="button" id="
|
|
1035
|
+
<button type="button" id="olx3pb7wk5s" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
1035
1036
|
<span class="rioglyph rioglyph-option-vertical">
|
|
1036
1037
|
</span>
|
|
1037
1038
|
</button>
|
|
@@ -1058,7 +1059,7 @@ export default TableCommonDemo;
|
|
|
1058
1059
|
<td class="table-action">
|
|
1059
1060
|
<span>
|
|
1060
1061
|
<div class="dropdown btn-group">
|
|
1061
|
-
<button type="button" id="
|
|
1062
|
+
<button type="button" id="s04bj3kzc6d" class="btn btn-default btn-link btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
1062
1063
|
<span class="rioglyph rioglyph-option-vertical">
|
|
1063
1064
|
</span>
|
|
1064
1065
|
</button>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Templates
|
|
4
4
|
*Section:* Content
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/templates/detail-views
|
|
6
|
+
*Captured:* 2026-02-23T13:48:39.310Z
|
|
7
7
|
|
|
8
8
|
## Detail views
|
|
9
9
|
|
|
@@ -319,7 +319,7 @@ export default () => {
|
|
|
319
319
|
</div>
|
|
320
320
|
<div>
|
|
321
321
|
<div class="dropdown btn-group">
|
|
322
|
-
<button type="button" id="
|
|
322
|
+
<button type="button" id="t66oq22gd3" class="btn btn-default btn-md btn-icon-only btn-component dropdown-toggle" tabindex="0">
|
|
323
323
|
<span class="rioglyph rioglyph-option-horizontal" aria-hidden="true">
|
|
324
324
|
</span>
|
|
325
325
|
</button>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
*Category:* Templates
|
|
4
4
|
*Section:* Content
|
|
5
|
-
*Source:* https://uikit.developers.rio.cloud
|
|
6
|
-
*Captured:* 2026-
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/templates/expandable-details
|
|
6
|
+
*Captured:* 2026-02-23T13:48:38.521Z
|
|
7
7
|
|
|
8
8
|
## Expandable details
|
|
9
9
|
|