@rio-cloud/rio-uikit 1.1.0 → 1.2.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/DropdownHeader.d.ts +2 -0
- package/DropdownHeader.js +2 -0
- package/FeedbackInlineButtons.d.ts +2 -0
- package/FeedbackInlineButtons.js +2 -0
- package/FeedbackRating.d.ts +2 -0
- package/FeedbackRating.js +2 -0
- package/FeedbackReactions.d.ts +2 -0
- package/FeedbackReactions.js +2 -0
- package/MapAdditionalLayerSettings.d.ts +2 -0
- package/MapAdditionalLayerSettings.js +2 -0
- package/MapSettingsDropdownHeader.d.ts +2 -0
- package/MapSettingsDropdownHeader.js +2 -0
- package/SmoothScrollbars.d.ts +2 -0
- package/SmoothScrollbars.js +2 -0
- package/components/feedback/FeedbackInlineButtons.d.ts +13 -0
- package/components/feedback/FeedbackInlineButtons.js +9 -0
- package/components/feedback/FeedbackRating.d.ts +65 -0
- package/components/feedback/FeedbackRating.js +23 -0
- package/components/feedback/FeedbackReactions.d.ts +71 -0
- package/components/feedback/FeedbackReactions.js +26 -0
- package/components/listMenu/ListMenu.d.ts +5 -1
- package/components/listMenu/ListMenu.js +2 -2
- package/components/map/components/features/settings/MapSettingsItem.d.ts +1 -0
- package/components/map/components/features/settings/MapSettingsItem.js +14 -11
- package/components/map/components/features/settings/MapSettingsTile.d.ts +3 -2
- package/components/map/components/features/settings/MapSettingsTile.js +40 -5
- package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.d.ts +9 -0
- package/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.js +15 -0
- package/components/map/components/features/settings/builtinSettings/MapClusterSettings.d.ts +3 -0
- package/components/map/components/features/settings/builtinSettings/MapClusterSettings.js +8 -2
- package/components/map/components/features/settings/builtinSettings/MapLayerSettings.js +15 -9
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +6 -0
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +20 -2
- package/components/map/components/features/settings/buttons/MapCenterMarkerButton.js +2 -2
- package/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerIncidentsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerRoadRestrictionsItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapLayerTrafficItem.d.ts +2 -0
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -0
- package/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +9 -0
- package/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.d.ts +2 -0
- package/components/map/icons/MapIcon.d.ts +1 -2
- package/components/map/icons/MapIcon.js +3 -1
- package/components/mapMarker/ClusterMapMarker.d.ts +4 -0
- package/components/mapMarker/ClusterMapMarker.js +2 -2
- package/components/mapMarker/SingleMapMarker.d.ts +4 -0
- package/components/mapMarker/SingleMapMarker.js +3 -3
- package/components/selects/DropdownHeader.d.ts +1 -0
- package/components/selects/DropdownHeader.js +2 -2
- package/components/selects/Multiselect.js +2 -2
- package/components/selects/MultiselectToggleFilter.js +1 -1
- package/components/states/CustomState.js +2 -2
- package/hooks/useAfterMount.js +8 -4
- package/lib/es/DropdownHeader.d.ts +2 -0
- package/lib/es/DropdownHeader.js +7 -0
- package/lib/es/FeedbackInlineButtons.d.ts +2 -0
- package/lib/es/FeedbackInlineButtons.js +7 -0
- package/lib/es/FeedbackRating.d.ts +2 -0
- package/lib/es/FeedbackRating.js +7 -0
- package/lib/es/FeedbackReactions.d.ts +2 -0
- package/lib/es/FeedbackReactions.js +7 -0
- package/lib/es/MapAdditionalLayerSettings.d.ts +2 -0
- package/lib/es/MapAdditionalLayerSettings.js +7 -0
- package/lib/es/MapSettingsDropdownHeader.d.ts +2 -0
- package/lib/es/MapSettingsDropdownHeader.js +7 -0
- package/lib/es/SmoothScrollbars.d.ts +2 -0
- package/lib/es/SmoothScrollbars.js +7 -0
- package/lib/es/components/feedback/FeedbackInlineButtons.d.ts +13 -0
- package/lib/es/components/feedback/FeedbackInlineButtons.js +11 -0
- package/lib/es/components/feedback/FeedbackRating.d.ts +65 -0
- package/lib/es/components/feedback/FeedbackRating.js +25 -0
- package/lib/es/components/feedback/FeedbackReactions.d.ts +71 -0
- package/lib/es/components/feedback/FeedbackReactions.js +28 -0
- package/lib/es/components/listMenu/ListMenu.d.ts +5 -1
- package/lib/es/components/listMenu/ListMenu.js +2 -2
- package/lib/es/components/map/components/features/settings/MapSettingsItem.d.ts +1 -0
- package/lib/es/components/map/components/features/settings/MapSettingsItem.js +13 -10
- package/lib/es/components/map/components/features/settings/MapSettingsTile.d.ts +3 -2
- package/lib/es/components/map/components/features/settings/MapSettingsTile.js +39 -4
- package/lib/es/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.d.ts +9 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings.js +17 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.d.ts +3 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapClusterSettings.js +8 -2
- package/lib/es/components/map/components/features/settings/builtinSettings/MapLayerSettings.js +14 -8
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +6 -0
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +20 -2
- package/lib/es/components/map/components/features/settings/buttons/MapCenterMarkerButton.js +1 -1
- package/lib/es/components/map/components/features/settings/items/MapCustomerPoiSettingsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerIncidentsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerRoadRestrictionsItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapLayerTrafficItem.d.ts +2 -0
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.d.ts +4 -0
- package/lib/es/components/map/components/features/settings/items/MapSettingsDropdownHeader.js +11 -0
- package/lib/es/components/map/components/features/settings/items/MapWorkshopPoiSettingsItem.d.ts +2 -0
- package/lib/es/components/map/icons/MapIcon.d.ts +1 -2
- package/lib/es/components/map/icons/MapIcon.js +3 -1
- package/lib/es/components/mapMarker/ClusterMapMarker.d.ts +4 -0
- package/lib/es/components/mapMarker/ClusterMapMarker.js +2 -2
- package/lib/es/components/mapMarker/SingleMapMarker.d.ts +4 -0
- package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
- package/lib/es/components/selects/DropdownHeader.d.ts +1 -0
- package/lib/es/components/selects/DropdownHeader.js +2 -2
- package/lib/es/components/selects/Multiselect.js +1 -1
- package/lib/es/components/selects/MultiselectToggleFilter.js +1 -1
- package/lib/es/components/states/CustomState.js +2 -2
- package/lib/es/hooks/useAfterMount.js +8 -4
- package/lib/es/utils/deviceUtils.d.ts +1 -0
- package/lib/es/utils/deviceUtils.js +3 -1
- package/lib/es/version.json +1 -1
- package/package.json +1 -1
- package/utils/deviceUtils.d.ts +1 -0
- package/utils/deviceUtils.js +1 -0
- package/version.json +1 -1
|
@@ -2,13 +2,15 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import noop from 'lodash/fp/noop';
|
|
5
|
+
import compact from 'lodash/fp/compact';
|
|
5
6
|
import { MAP_TYPE_DEFAULT, MAP_TYPE_FLEET_STYLE, MAP_TYPE_NIGHT, MAP_TYPE_SATELLITE, MAP_TYPE_TERRAIN, } from '../../../constants';
|
|
6
7
|
import MapSettingsPanel from '../MapSettingsPanel';
|
|
7
8
|
import MapSettingsItem from '../MapSettingsItem';
|
|
8
9
|
import MapSettingsTile from '../MapSettingsTile';
|
|
9
10
|
import { MapIcon, MAP_TYPE_FLAT_ACTIVE, MAP_TYPE_FLAT_INACTIVE, MAP_TYPE_FLAT_TRUCK_ACTIVE, MAP_TYPE_FLAT_TRUCK_INACTIVE, MAP_TYPE_SATELLITE_ACTIVE, MAP_TYPE_SATELLITE_INACTIVE, MAP_TYPE_TERRAIN_ACTIVE, MAP_TYPE_TERRAIN_INACTIVE, MAP_TYPE_NIGHT_ACTIVE, MAP_TYPE_NIGHT_INACTIVE, } from '../../../../icons/MapIcon';
|
|
11
|
+
import MapSettingsDropdownHeader from '../items/MapSettingsDropdownHeader';
|
|
10
12
|
const MapTypeSettings = (props) => {
|
|
11
|
-
const { mapType, onMapTypeChange = noop, enableNightMap = true } = props, remainingProps = __rest(props, ["mapType", "onMapTypeChange", "enableNightMap"]);
|
|
13
|
+
const { mapType, onMapTypeChange = noop, enableNightMap = true, defaultTypeLabel, truckTypeLabel, terrainTypeLabel, satelliteTypeLabel, nightTypeLabel, dropdownHeaderText } = props, remainingProps = __rest(props, ["mapType", "onMapTypeChange", "enableNightMap", "defaultTypeLabel", "truckTypeLabel", "terrainTypeLabel", "satelliteTypeLabel", "nightTypeLabel", "dropdownHeaderText"]);
|
|
12
14
|
const type = useMemo(() => ({
|
|
13
15
|
isDefault: mapType === MAP_TYPE_DEFAULT,
|
|
14
16
|
isFleetStyle: mapType === MAP_TYPE_FLEET_STYLE,
|
|
@@ -33,6 +35,22 @@ const MapTypeSettings = (props) => {
|
|
|
33
35
|
return _jsx(MapIcon, { name: MAP_TYPE_NIGHT_INACTIVE });
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
|
-
|
|
38
|
+
const dropdownHeader = dropdownHeaderText && (_jsx(MapSettingsDropdownHeader, { label: dropdownHeaderText }, 'mapTypeDropdownHeader'));
|
|
39
|
+
const mapTypeNight = (_jsx(MapSettingsItem, { className: 'MapTypeNight', onClick: () => onMapTypeChange(MAP_TYPE_NIGHT), isActive: type.isNight, activeIcon: _jsx(MapIcon, { name: MAP_TYPE_NIGHT_ACTIVE }), inactiveIcon: _jsx(MapIcon, { name: MAP_TYPE_NIGHT_INACTIVE }), label: nightTypeLabel }, 'MapTypeNight'));
|
|
40
|
+
const mapTypeSatellite = (_jsx(MapSettingsItem, { className: 'MapTypeSatellite', onClick: () => onMapTypeChange(MAP_TYPE_SATELLITE), isActive: type.isSatellite, activeIcon: _jsx(MapIcon, { name: MAP_TYPE_SATELLITE_ACTIVE }), inactiveIcon: _jsx(MapIcon, { name: MAP_TYPE_SATELLITE_INACTIVE }), label: satelliteTypeLabel }, 'MapTypeSatellite'));
|
|
41
|
+
const mapTypeTerrain = (_jsx(MapSettingsItem, { className: 'MapTypeTerrain', onClick: () => onMapTypeChange(MAP_TYPE_TERRAIN), isActive: type.isTerrain, activeIcon: _jsx(MapIcon, { name: MAP_TYPE_TERRAIN_ACTIVE }), inactiveIcon: _jsx(MapIcon, { name: MAP_TYPE_TERRAIN_INACTIVE }), label: terrainTypeLabel }, 'MapTypeTerrain'));
|
|
42
|
+
const mapTypeTruck = (_jsx(MapSettingsItem, { className: 'MapTypeFlatTruck', onClick: () => onMapTypeChange(MAP_TYPE_FLEET_STYLE), isActive: type.isFleetStyle, activeIcon: _jsx(MapIcon, { name: MAP_TYPE_FLAT_TRUCK_ACTIVE }), inactiveIcon: _jsx(MapIcon, { name: MAP_TYPE_FLAT_TRUCK_INACTIVE }), label: truckTypeLabel }, 'MapTypeFlatTruck'));
|
|
43
|
+
const mapTypeDefault = (_jsx(MapSettingsItem, { className: 'MapTypeFlat', onClick: () => onMapTypeChange(MAP_TYPE_DEFAULT), isActive: type.isDefault, activeIcon: _jsx(MapIcon, { name: MAP_TYPE_FLAT_ACTIVE }), inactiveIcon: _jsx(MapIcon, { name: MAP_TYPE_FLAT_INACTIVE }), label: defaultTypeLabel }, 'MapTypeFlat'));
|
|
44
|
+
const hasLabels = !!defaultTypeLabel || !!truckTypeLabel || !!terrainTypeLabel || !!satelliteTypeLabel || !!nightTypeLabel;
|
|
45
|
+
return (_jsx(MapSettingsTile, Object.assign({ className: 'MapTypeSettings', inactiveIcon: getIcon(type), items: hasLabels
|
|
46
|
+
? compact([
|
|
47
|
+
dropdownHeader,
|
|
48
|
+
mapTypeNight,
|
|
49
|
+
mapTypeSatellite,
|
|
50
|
+
mapTypeTerrain,
|
|
51
|
+
mapTypeTruck,
|
|
52
|
+
mapTypeDefault,
|
|
53
|
+
])
|
|
54
|
+
: undefined, panel: !hasLabels && (_jsxs(MapSettingsPanel, { children: [enableNightMap && mapTypeNight, mapTypeSatellite, mapTypeTerrain, mapTypeTruck, mapTypeDefault] })) }, remainingProps)));
|
|
37
55
|
};
|
|
38
56
|
export default MapTypeSettings;
|
|
@@ -3,9 +3,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
4
|
import 'react';
|
|
5
5
|
import MapSettingsTile from '../MapSettingsTile';
|
|
6
|
-
import { MapIcon
|
|
6
|
+
import { MapIcon } from '../../../../icons/MapIcon';
|
|
7
7
|
const MapCenterMarkerButton = (props) => {
|
|
8
8
|
const { isActive = false, onToggle } = props, remainingProps = __rest(props, ["isActive", "onToggle"]);
|
|
9
|
-
return (_jsx(MapSettingsTile, Object.assign({ className: 'MapCenterMarkerButton', isActive: isActive, activeIcon: _jsx(MapIcon, { name:
|
|
9
|
+
return (_jsx(MapSettingsTile, Object.assign({ className: 'MapCenterMarkerButton', isActive: isActive, activeIcon: isActive ? (_jsx(MapIcon, { name: 'rioglyph-position text-color-primary', className: 'MapCenterMarkerButtonIcon' })) : undefined, inactiveIcon: !isActive ? (_jsx(MapIcon, { name: 'rioglyph-position text-color-gray', className: 'MapCenterMarkerButtonIconInactive' })) : undefined, onToggle: onToggle }, remainingProps)));
|
|
10
10
|
};
|
|
11
11
|
export default MapCenterMarkerButton;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type MapCustomerPoiSettingsItemProps = {
|
|
2
3
|
onToggle?: (setIsShown: boolean) => void;
|
|
3
4
|
isActive?: boolean;
|
|
5
|
+
label?: string | JSX.Element;
|
|
4
6
|
};
|
|
5
7
|
declare const MapCustomerPoiSettingsItem: (props: MapCustomerPoiSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default MapCustomerPoiSettingsItem;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DropdownHeaderProps } from '../../../../../selects/DropdownHeader';
|
|
2
|
+
export type MapSettingsDropdownHeaderProps = DropdownHeaderProps & {};
|
|
3
|
+
declare const MapSettingsDropdownHeader: (props: MapSettingsDropdownHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default MapSettingsDropdownHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import 'react';
|
|
4
|
+
import DropdownHeader from '../../../../../selects/DropdownHeader';
|
|
5
|
+
const MapSettingsDropdownHeader = (props) => {
|
|
6
|
+
const remainingProps = __rest(props, []);
|
|
7
|
+
return _jsx(DropdownHeader, Object.assign({ className: 'MapSettingsDropdownHeader' }, remainingProps));
|
|
8
|
+
};
|
|
9
|
+
export default MapSettingsDropdownHeader;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type MapWorkshopPoiSettingsItemProps = {
|
|
2
3
|
onToggle?: (setIsShown: boolean) => void;
|
|
3
4
|
isActive?: boolean;
|
|
5
|
+
label?: string | JSX.Element;
|
|
4
6
|
};
|
|
5
7
|
declare const MapWorkshopPoiSettingsItem: (props: MapWorkshopPoiSettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default MapWorkshopPoiSettingsItem;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type MapIconProps = {
|
|
3
2
|
name?: string;
|
|
4
3
|
height?: number;
|
|
5
4
|
width?: number;
|
|
6
5
|
className?: string;
|
|
7
6
|
};
|
|
8
|
-
export declare const MapIcon: (props: MapIconProps) =>
|
|
7
|
+
export declare const MapIcon: (props: MapIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export declare const ZOOM_IN = "zoomIn";
|
|
10
9
|
export declare const ZOOM_OUT = "zoomOut";
|
|
11
10
|
export declare const BOUNDING_BOX_ACTIVE = "boundingBoxActive";
|
|
@@ -3,7 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export const MapIcon = (props) => {
|
|
5
5
|
const { className = '', name = '', height = 40, width = 40 } = props;
|
|
6
|
-
|
|
6
|
+
if (name.includes('rioglyph')) {
|
|
7
|
+
return (_jsx("div", Object.assign({ className: 'height-40 width-40 text-size-16 display-grid place-items-center hover-scale-110' }, { children: _jsx("span", { className: `rioglyph ${name} text-size-200pct` }) })));
|
|
8
|
+
}
|
|
7
9
|
return React.cloneElement(icons[name], {
|
|
8
10
|
className,
|
|
9
11
|
height,
|
|
@@ -48,6 +48,10 @@ export type ClusterMapMarkerProps = {
|
|
|
48
48
|
* Name of a rioglyph icon.
|
|
49
49
|
*/
|
|
50
50
|
iconName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Marker cursor
|
|
53
|
+
*/
|
|
54
|
+
cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';
|
|
51
55
|
};
|
|
52
56
|
declare const ClusterMapMarker: (props: ClusterMapMarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
57
|
export default ClusterMapMarker;
|
|
@@ -3,8 +3,8 @@ import 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { markerColorMapping } from '../map/utils/mapTypes';
|
|
5
5
|
const ClusterMapMarker = (props) => {
|
|
6
|
-
const { count, exceptionCount = 0, markerColor = 'bg-map-marker-asset', warningCount = 0, active = false, clickable = true, iconName, } = props;
|
|
7
|
-
const clusterClasses = classNames('rio-map-cluster-circle', active && 'active');
|
|
6
|
+
const { count, exceptionCount = 0, markerColor = 'bg-map-marker-asset', warningCount = 0, active = false, clickable = true, iconName, cursor = 'cursor-pointer', } = props;
|
|
7
|
+
const clusterClasses = classNames('rio-map-cluster-circle', active && 'active', cursor);
|
|
8
8
|
const classes = classNames(active && 'active', 'rio-map-marker', 'rio-map-marker-center-center', !clickable && 'not-clickable');
|
|
9
9
|
const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;
|
|
10
10
|
return (_jsx("div", Object.assign({ className: classes, style: { color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'cluster-') }, { children: _jsx("div", Object.assign({ className: 'rio-map-marker-translate' }, { children: _jsxs("div", Object.assign({ className: 'rio-map-cluster' }, { children: [_jsx("div", Object.assign({ className: clusterClasses }, { children: _jsxs("div", Object.assign({ className: 'rio-map-cluster-content' }, { children: [iconName && _jsx("div", { className: `rio-map-icon rioglyph rioglyph-${iconName}` }), _jsx("div", Object.assign({ className: 'rio-map-count' }, { children: count }))] })) })), exceptionCount > 0 && _jsx("div", Object.assign({ className: 'rio-map-bubble exception' }, { children: exceptionCount })), warningCount > 0 && _jsx("div", Object.assign({ className: 'rio-map-bubble warning' }, { children: warningCount }))] })) })) })));
|
|
@@ -114,6 +114,10 @@ export type SingleMapMarkerProps = {
|
|
|
114
114
|
* Shows only the anchor without the rest of the marker.
|
|
115
115
|
*/
|
|
116
116
|
anchorOnly?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Marker cursor
|
|
119
|
+
*/
|
|
120
|
+
cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';
|
|
117
121
|
};
|
|
118
122
|
declare const SingleMapMarker: (props: SingleMapMarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
119
123
|
export default SingleMapMarker;
|
|
@@ -16,11 +16,11 @@ const MapStateIndicator = (props) => {
|
|
|
16
16
|
};
|
|
17
17
|
const getIcons = (iconNames = []) => iconNames.map((name, index) => (_jsx("div", { className: `rio-map-icon rioglyph rioglyph-${name}` }, `rio-map-icon-${name}-${index}`)));
|
|
18
18
|
const SingleMapMarker = (props) => {
|
|
19
|
-
const { bearing = DEFAULT_BEARING, name, warningCount = 0, exceptionCount = 0, active = false, clickable = true, fixed = false, moving = false, pinging = false, anchorIconName, stateIconName, iconNames, markerColor = 'bg-map-marker-asset', textColor, anchorSize, markerOnHover = false, anchorOnly = !name && !iconNames, } = props;
|
|
19
|
+
const { bearing = DEFAULT_BEARING, name, warningCount = 0, exceptionCount = 0, active = false, clickable = true, fixed = false, moving = false, pinging = false, anchorIconName, stateIconName, iconNames, markerColor = 'bg-map-marker-asset', textColor, anchorSize, markerOnHover = false, anchorOnly = !name && !iconNames, cursor = 'cursor-pointer', } = props;
|
|
20
20
|
const largeAnchor = anchorSize === 'lg';
|
|
21
21
|
const classes = classNames(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable');
|
|
22
|
-
const anchorClasses = classNames('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '');
|
|
23
|
-
const singleClasses = classNames('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging');
|
|
22
|
+
const anchorClasses = classNames('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);
|
|
23
|
+
const singleClasses = classNames('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', cursor);
|
|
24
24
|
const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;
|
|
25
25
|
return (_jsx("div", Object.assign({ className: classes, style: { color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'single-') }, { children: _jsxs("div", Object.assign({ className: 'rio-map-marker-translate' }, { children: [!anchorOnly && (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: singleClasses }, { children: [_jsx(MapStateIndicator, { moving: moving, bearing: bearing, stateIconName: stateIconName }), getIcons(iconNames), name && _jsx("div", Object.assign({ className: 'rio-map-name' }, { children: name })), exceptionCount > 0 && _jsx("div", Object.assign({ className: 'rio-map-bubble exception' }, { children: exceptionCount })), warningCount > 0 && _jsx("div", Object.assign({ className: 'rio-map-bubble warning' }, { children: warningCount }))] })), _jsx("div", { className: 'rio-map-anchor-arrow' })] })), _jsx("div", Object.assign({ className: anchorClasses }, { children: anchorIconName && largeAnchor && _jsx("span", { className: `rioglyph rioglyph-${anchorIconName}` }) }))] })) })));
|
|
26
26
|
};
|
|
@@ -3,6 +3,7 @@ export type DropdownHeaderProps = {
|
|
|
3
3
|
icon?: React.ReactNode;
|
|
4
4
|
center?: boolean;
|
|
5
5
|
label: string | React.ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const DropdownHeader: (props: DropdownHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default DropdownHeader;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
3
3
|
import 'react';
|
|
4
4
|
const DropdownHeader = (props) => {
|
|
5
|
-
const { icon, label, center = true } = props;
|
|
6
|
-
return (_jsx("li", Object.assign({ className: `dropdown-header ${center ? 'center' : ''}` }, { children: _jsxs("span", Object.assign({ className: 'dropdown-header-text' }, { children: [icon && _jsx("span", Object.assign({ className: 'margin-right-5' }, { children: icon })), label] })) })));
|
|
5
|
+
const { icon, label, center = true, className = '' } = props;
|
|
6
|
+
return (_jsx("li", Object.assign({ className: `dropdown-header ${center ? 'center' : ''} ${className}` }, { children: _jsxs("span", Object.assign({ className: 'dropdown-header-text' }, { children: [icon && _jsx("span", Object.assign({ className: 'margin-right-5' }, { children: icon })), label] })) })));
|
|
7
7
|
};
|
|
8
8
|
export default DropdownHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
4
|
import { useRef, useState } from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -75,7 +75,7 @@ const Multiselect = (props) => {
|
|
|
75
75
|
const wrapperClassNames = classNames('dropdown-toggle', 'form-control', 'text-left', bsSize === 'sm' && 'input-sm', bsSize === 'lg' && 'input-lg', multiline && 'height-auto', disabled && 'disabled');
|
|
76
76
|
const showPlaceholder = isEmpty(selectedItemIds) && !showUnselectedItemIcons;
|
|
77
77
|
const showFilter = useFilter && isOpen && !counterMessage && !renderCounterMessage;
|
|
78
|
-
const toggleButton = (_jsxs("button", Object.assign({ type: 'button', id: id, name: name, className: wrapperClassNames, "data-toggle": 'dropdown', tabIndex: tabIndex, "aria-haspopup": 'true', "aria-expanded": isOpen, onClick: onToggle, onKeyDown: handleToggleKeyDown, ref: refToggle }, { children: [showPlaceholder ? _jsx(MultiselectTogglePlaceholder, { placeholder: placeholder }) : renderSelection(), showFilter && !multiline && renderFilter(), _jsx("span", { className: 'caret' })] })));
|
|
78
|
+
const toggleButton = (_jsxs("button", Object.assign({ type: 'button', id: id, name: name, className: wrapperClassNames, "data-toggle": 'dropdown', tabIndex: tabIndex, "aria-haspopup": 'true', "aria-expanded": isOpen, onClick: onToggle, onKeyDown: handleToggleKeyDown, ref: refToggle }, { children: [showPlaceholder ? (_jsxs(_Fragment, { children: [_jsx(MultiselectTogglePlaceholder, { placeholder: placeholder }), showFilter && renderFilter()] })) : (renderSelection()), showFilter && !multiline && renderFilter(), _jsx("span", { className: 'caret' })] })));
|
|
79
79
|
if (!inputAddon && !errorMessage && !warningMessage) {
|
|
80
80
|
return toggleButton;
|
|
81
81
|
}
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
6
6
|
const MultiselectToggleFilter = (props) => {
|
|
7
7
|
const { isActive, selectedItemIds, filterValue, multiline, onFilterChange } = props;
|
|
8
|
-
const inputClasses = classNames('multiselect-filter-input', isEmpty(selectedItemIds) && 'multiselect-filter-input-placeholder', isActive && 'multiselect-filter-input-active'
|
|
8
|
+
const inputClasses = classNames('multiselect-filter-input', isEmpty(selectedItemIds) && 'multiselect-filter-input-placeholder', isActive && 'multiselect-filter-input-active');
|
|
9
9
|
return (_jsx("input", { type: 'text', role: 'searchbox', className: inputClasses,
|
|
10
10
|
// biome-ignore lint/a11y/noAutofocus: autofocus is intentionally set to allow instant typing to filter
|
|
11
11
|
autoFocus: true, onChange: onFilterChange, defaultValue: filterValue }));
|
|
@@ -19,9 +19,9 @@ const renderButtons = (buttons) => {
|
|
|
19
19
|
return (_jsx("div", Object.assign({ className: 'btn-toolbar margin-top-20' }, { children: _jsx(StateButton, Object.assign({}, buttons[0])) })));
|
|
20
20
|
}
|
|
21
21
|
if (buttons.length === 2) {
|
|
22
|
-
return (_jsx("div", Object.assign({ className: 'btn-toolbar margin-top-20' }, { children: buttons.map((buttonProps, index) => (_jsx(StateButton, Object.assign({}, buttonProps), index))) })));
|
|
22
|
+
return (_jsx("div", Object.assign({ className: 'btn-toolbar margin-top-20 justify-content-center-xs' }, { children: buttons.map((buttonProps, index) => (_jsx(StateButton, Object.assign({}, buttonProps), index))) })));
|
|
23
23
|
}
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: 'btn-toolbar margin-top-20' }, { children: [_jsx(StateButton, Object.assign({}, buttons[0]), '1'), _jsx(StateButton, Object.assign({}, buttons[1]), '2')] })), _jsx("div", Object.assign({ className: 'btn-toolbar' }, { children: buttons.map((buttonProps, index) => {
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: 'btn-toolbar margin-top-20 justify-content-center-xs' }, { children: [_jsx(StateButton, Object.assign({}, buttons[0]), '1'), _jsx(StateButton, Object.assign({}, buttons[1]), '2')] })), _jsx("div", Object.assign({ className: 'btn-toolbar' }, { children: buttons.map((buttonProps, index) => {
|
|
25
25
|
return index > 1 && _jsx(StateButton, Object.assign({}, buttonProps), index);
|
|
26
26
|
}) }))] }));
|
|
27
27
|
};
|
package/hooks/useAfterMount.js
CHANGED
|
@@ -6,12 +6,16 @@ import { useEffect, useRef } from 'react';
|
|
|
6
6
|
* @param deps The deps of the callback (the same as if you were using useCallback or useEffect).
|
|
7
7
|
*/
|
|
8
8
|
const useAfterMount = (callback, deps) => {
|
|
9
|
-
const
|
|
9
|
+
const hasMountedRef = useRef(false);
|
|
10
10
|
useEffect(() => {
|
|
11
|
-
if (
|
|
12
|
-
|
|
11
|
+
if (hasMountedRef.current) {
|
|
12
|
+
// Run the callback only after the first render and
|
|
13
|
+
// whenever the dependencies change afterwards
|
|
14
|
+
callback();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
hasMountedRef.current = true;
|
|
13
18
|
}
|
|
14
|
-
componentJustMountedRef.current = false;
|
|
15
19
|
}, deps);
|
|
16
20
|
};
|
|
17
21
|
export default useAfterMount;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var DropdownHeader_1 = require("./components/selects/DropdownHeader");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(DropdownHeader_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/selects/DropdownHeader"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var FeedbackInlineButtons_1 = require("./components/feedback/FeedbackInlineButtons");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(FeedbackInlineButtons_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/feedback/FeedbackInlineButtons"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var FeedbackRating_1 = require("./components/feedback/FeedbackRating");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(FeedbackRating_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/feedback/FeedbackRating"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var FeedbackReactions_1 = require("./components/feedback/FeedbackReactions");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(FeedbackReactions_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/feedback/FeedbackReactions"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var MapAdditionalLayerSettings_1 = require("./components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(MapAdditionalLayerSettings_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/map/components/features/settings/builtinSettings/MapAdditionalLayerSettings"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var MapSettingsDropdownHeader_1 = require("./components/map/components/features/settings/items/MapSettingsDropdownHeader");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(MapSettingsDropdownHeader_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/map/components/features/settings/items/MapSettingsDropdownHeader"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var SmoothScrollbars_1 = require("./components/smoothScrollbars/SmoothScrollbars");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(SmoothScrollbars_1).default; } });
|
|
7
|
+
tslib_1.__exportStar(require("./components/smoothScrollbars/SmoothScrollbars"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
type FeedbackInlineButtonsProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Optional headline inlined with the buttons.
|
|
5
|
+
*/
|
|
6
|
+
headline?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* List of buttons to be shown.
|
|
9
|
+
*/
|
|
10
|
+
buttons?: React.ReactNode[];
|
|
11
|
+
};
|
|
12
|
+
declare const FeedbackInlineButtons: (props: FeedbackInlineButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default FeedbackInlineButtons;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// @ts-ignore-next-line importsNotUsedAsValues
|
|
6
|
+
require("react");
|
|
7
|
+
const FeedbackInlineButtons = (props) => {
|
|
8
|
+
const { buttons = [], headline } = props, remainingProps = tslib_1.__rest(props, ["buttons", "headline"]);
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: 'display-flex flex-wrap align-items-center column-gap-15 row-gap-5 user-select-none' }, { children: [headline && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'text-color-dark' }, { children: headline })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'btn-toolbar gap-5' }, { children: buttons.map(button => button) }))] })));
|
|
10
|
+
};
|
|
11
|
+
exports.default = FeedbackInlineButtons;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
import type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';
|
|
3
|
+
type FeedbackRatingProps = ComponentProps<'div'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Optional headline
|
|
6
|
+
*/
|
|
7
|
+
headline?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The amount of toggle buttons used to rate.
|
|
10
|
+
*
|
|
11
|
+
* @default 1
|
|
12
|
+
*/
|
|
13
|
+
count: number;
|
|
14
|
+
/**
|
|
15
|
+
* Defines whether the buttons are round.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
circleButtons?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Optional class names applied to all the buttons.
|
|
22
|
+
* If you need more control on styling individual buttons, see `buttonStyles`.
|
|
23
|
+
*/
|
|
24
|
+
buttonClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Array of button labels that will be used instead of the index.
|
|
27
|
+
* There needs to be a label for each button defined.
|
|
28
|
+
*/
|
|
29
|
+
buttonLabels?: React.ReactNode[];
|
|
30
|
+
/**
|
|
31
|
+
* Array of button styles to individually define the button size, style and variant.
|
|
32
|
+
* There needs to be a item for each button defined.
|
|
33
|
+
*/
|
|
34
|
+
buttonStyles?: {
|
|
35
|
+
bsSize?: BUTTON_SIZE;
|
|
36
|
+
bsStyle?: BUTTON_STYLE;
|
|
37
|
+
variant?: BUTTON_VARIANT;
|
|
38
|
+
className?: string;
|
|
39
|
+
}[];
|
|
40
|
+
/**
|
|
41
|
+
* Left aligned label to name the lowest rating option.
|
|
42
|
+
*/
|
|
43
|
+
leftLabel?: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Right aligned label to name the highest rating option.
|
|
46
|
+
*/
|
|
47
|
+
rightLabel?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Additional icon placed in front of the rating buttons.
|
|
50
|
+
*/
|
|
51
|
+
leadingIcon?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Additional icon placed after the rating buttons.
|
|
54
|
+
*/
|
|
55
|
+
trailingIcon?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Callback triggered when the rating changes.
|
|
58
|
+
*
|
|
59
|
+
* @param rating The rating value. Undefined, when a toggle is unchecked.
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
onRatingChanged?: (rating: number | undefined) => void;
|
|
63
|
+
};
|
|
64
|
+
declare const FeedbackRating: (props: FeedbackRatingProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export default FeedbackRating;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_2 = require("react");
|
|
7
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
+
const ToggleButton_1 = tslib_1.__importDefault(require("../button/ToggleButton"));
|
|
9
|
+
const FeedbackRating = (props) => {
|
|
10
|
+
const { headline, count = 1, circleButtons = false, buttonLabels, buttonStyles, buttonClassName = '', leftLabel, rightLabel, leadingIcon, trailingIcon, onRatingChanged = () => { } } = props, remainingProps = tslib_1.__rest(props, ["headline", "count", "circleButtons", "buttonLabels", "buttonStyles", "buttonClassName", "leftLabel", "rightLabel", "leadingIcon", "trailingIcon", "onRatingChanged"]);
|
|
11
|
+
const [rating, setRating] = (0, react_2.useState)();
|
|
12
|
+
const handleRating = (value) => {
|
|
13
|
+
setRating(value);
|
|
14
|
+
onRatingChanged(value);
|
|
15
|
+
};
|
|
16
|
+
const hasSubLabels = !!leftLabel || !!rightLabel;
|
|
17
|
+
const buttonWrapperClasses = (0, classnames_1.default)('display-flex gap-10', hasSubLabels ? 'align-items-start' : 'align-items-center', 'text-size-14', 'margin-bottom-25');
|
|
18
|
+
const leadingTrailingIconClasses = (0, classnames_1.default)('display-flex align-items-center', 'text-size-200pct', hasSubLabels && 'padding-top-3');
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: 'FeedbackRating' }, { children: [headline && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'text-medium text-size-16 margin-bottom-10' }, { children: headline })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: buttonWrapperClasses }, { children: [leadingIcon && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: leadingTrailingIconClasses }, { children: leadingIcon })), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'display-flex flex-wrap gap-10' }, { children: Array.from({ length: count }, (_, index) => {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const indexNumber = index + 1;
|
|
22
|
+
return ((0, react_1.createElement)(ToggleButton_1.default, Object.assign({}, buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles[index], { key: indexNumber, active: rating === indexNumber, onClick: (toggled) => handleRating(toggled ? indexNumber : undefined), className: `${circleButtons ? 'rounded-circle aspect-ratio-1' : ''} ${buttonClassName} ${(_a = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles[index].className) !== null && _a !== void 0 ? _a : ''}` }), (_b = buttonLabels === null || buttonLabels === void 0 ? void 0 : buttonLabels[index]) !== null && _b !== void 0 ? _b : indexNumber));
|
|
23
|
+
}) })), hasSubLabels && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'display-flex justify-content-between margin-top-5 gap-25' }, { children: [leftLabel ? (0, jsx_runtime_1.jsx)("label", Object.assign({ className: 'word-wrap text-color-dark' }, { children: leftLabel })) : (0, jsx_runtime_1.jsx)("div", {}), rightLabel ? (0, jsx_runtime_1.jsx)("label", Object.assign({ className: 'word-wrap text-color-dark' }, { children: rightLabel })) : (0, jsx_runtime_1.jsx)("div", {})] })))] }), trailingIcon && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: leadingTrailingIconClasses }, { children: trailingIcon }))] }))] })));
|
|
24
|
+
};
|
|
25
|
+
exports.default = FeedbackRating;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
type FeedbackReactionsProps = ComponentProps<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Optional headline inlined with the buttons.
|
|
5
|
+
*/
|
|
6
|
+
headline?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Size of the reaction buttons.
|
|
9
|
+
*
|
|
10
|
+
* @default 'md'
|
|
11
|
+
*/
|
|
12
|
+
size?: 'sm' | 'md';
|
|
13
|
+
/**
|
|
14
|
+
* Position of the reaction button labels.
|
|
15
|
+
*
|
|
16
|
+
* @default 'bottom'
|
|
17
|
+
*/
|
|
18
|
+
labelPosition?: 'right' | 'bottom';
|
|
19
|
+
/**
|
|
20
|
+
* Label for the up button.
|
|
21
|
+
*/
|
|
22
|
+
labelUp?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Label for the down button.
|
|
25
|
+
*/
|
|
26
|
+
labelDown?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Custom fill color for the up button.
|
|
29
|
+
*
|
|
30
|
+
* @default 'bg-lightest'
|
|
31
|
+
*/
|
|
32
|
+
colorFillUp?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom fill color for the down button.
|
|
35
|
+
*
|
|
36
|
+
* @default 'bg-lightest'
|
|
37
|
+
*/
|
|
38
|
+
colorFillDown?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Custom hover color for the up button.
|
|
41
|
+
*
|
|
42
|
+
* @default 'primary'
|
|
43
|
+
*/
|
|
44
|
+
colorHoverUp?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Custom hover color for the down button.
|
|
47
|
+
*
|
|
48
|
+
* @default 'primary'
|
|
49
|
+
*/
|
|
50
|
+
colorHoverDown?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Callback function triggered on up vote.
|
|
53
|
+
*/
|
|
54
|
+
onVoteUp?: VoidFunction;
|
|
55
|
+
/**
|
|
56
|
+
* Callback function triggered on down vote.
|
|
57
|
+
*/
|
|
58
|
+
onVoteDown?: VoidFunction;
|
|
59
|
+
/**
|
|
60
|
+
* Additional classes applied to the individual reaction item (button and label).
|
|
61
|
+
*/
|
|
62
|
+
itemClassName?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Defines whether the reaction icon is animated.
|
|
65
|
+
*
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
animated?: boolean;
|
|
69
|
+
};
|
|
70
|
+
declare const FeedbackReactions: (props: FeedbackReactionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export default FeedbackReactions;
|