@synerise/ds-context-selector 1.3.16 → 1.3.17
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/CHANGELOG.md +4 -0
- package/dist/ContextSelector.d.ts +2 -2
- package/dist/ContextSelector.js +112 -179
- package/dist/ContextSelector.styles.d.ts +10 -10
- package/dist/ContextSelector.styles.js +30 -32
- package/dist/ContextSelector.types.d.ts +6 -6
- package/dist/ContextSelector.types.js +5 -2
- package/dist/ContextSelectorDropdown/ContextSelectorDropdown.d.ts +2 -2
- package/dist/ContextSelectorDropdown/ContextSelectorDropdown.js +173 -252
- package/dist/ContextSelectorDropdown/ContextSelectorDropdownItem.d.ts +2 -2
- package/dist/ContextSelectorDropdown/ContextSelectorDropdownItem.js +29 -42
- package/dist/ContextSelectorDropdown/utils.d.ts +1 -1
- package/dist/ContextSelectorDropdown/utils.js +9 -5
- package/dist/constants.js +23 -10
- package/dist/hooks/useTexts.d.ts +1 -1
- package/dist/hooks/useTexts.js +37 -35
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +18 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.17](https://github.com/Synerise/synerise-design/compare/@synerise/ds-context-selector@1.3.16...@synerise/ds-context-selector@1.3.17) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-context-selector
|
|
9
|
+
|
|
6
10
|
## [1.3.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-context-selector@1.3.15...@synerise/ds-context-selector@1.3.16) (2026-03-20)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @synerise/ds-context-selector
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ContextProps } from './ContextSelector.types';
|
|
3
3
|
declare const ContextSelector: ({ defaultDropdownVisibility, selectedItem, onSelectItem, onSetGroup, groups, items, recentItems, texts, opened, addMode, loading, customTriggerComponent, trigger, menuItemHeight, dropdownWrapperStyles, onClickOutsideEvents, onClickOutside, onSearch, hideSearchField, hasMoreItems, onFetchData, onActivate, onDeactivate, onOpen, getPopupContainerOverride, type, dropdownProps, disabled, errorText, isError, readOnly, popoverDelay, dropdownDimensionsConfig, }: ContextProps) => React.JSX.Element;
|
|
4
4
|
export default ContextSelector;
|
package/dist/ContextSelector.js
CHANGED
|
@@ -1,218 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import Button from
|
|
4
|
-
import Dropdown from
|
|
5
|
-
import Icon, {
|
|
6
|
-
import InformationCard, { InformationCardTooltip } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import ContextSelectorDropdown from
|
|
10
|
-
import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from
|
|
11
|
-
import { useTexts } from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _useState = useState(defaultDropdownVisibility != null ? defaultDropdownVisibility : false),
|
|
51
|
-
dropdownVisible = _useState[0],
|
|
52
|
-
setDropdownVisible = _useState[1];
|
|
53
|
-
var dimensionsConfig = _extends({
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import Button from "@synerise/ds-button";
|
|
4
|
+
import Dropdown from "@synerise/ds-dropdown";
|
|
5
|
+
import Icon, { AngleDownS, Add3M } from "@synerise/ds-icon";
|
|
6
|
+
import InformationCard, { InformationCardTooltip } from "@synerise/ds-information-card";
|
|
7
|
+
import { getPopupContainer, getClosest } from "@synerise/ds-utils";
|
|
8
|
+
import { ItemWrapper, ErrorWrapper } from "./ContextSelector.styles.js";
|
|
9
|
+
import ContextSelectorDropdown from "./ContextSelectorDropdown/ContextSelectorDropdown.js";
|
|
10
|
+
import { DROPDOWN_HEIGHT, DROPDOWN_HEIGHT_BELOW_THRESHOLD, DROPDOWN_HEIGHT_THRESHOLD } from "./constants.js";
|
|
11
|
+
import { useTexts } from "./hooks/useTexts.js";
|
|
12
|
+
const ContextSelector = ({
|
|
13
|
+
defaultDropdownVisibility,
|
|
14
|
+
selectedItem,
|
|
15
|
+
onSelectItem,
|
|
16
|
+
onSetGroup,
|
|
17
|
+
groups,
|
|
18
|
+
items,
|
|
19
|
+
recentItems,
|
|
20
|
+
texts,
|
|
21
|
+
opened,
|
|
22
|
+
addMode,
|
|
23
|
+
loading,
|
|
24
|
+
customTriggerComponent,
|
|
25
|
+
trigger = ["click"],
|
|
26
|
+
menuItemHeight,
|
|
27
|
+
dropdownWrapperStyles,
|
|
28
|
+
onClickOutsideEvents,
|
|
29
|
+
onClickOutside,
|
|
30
|
+
onSearch,
|
|
31
|
+
hideSearchField = false,
|
|
32
|
+
hasMoreItems,
|
|
33
|
+
onFetchData,
|
|
34
|
+
onActivate,
|
|
35
|
+
onDeactivate,
|
|
36
|
+
onOpen,
|
|
37
|
+
getPopupContainerOverride,
|
|
38
|
+
type,
|
|
39
|
+
dropdownProps,
|
|
40
|
+
disabled,
|
|
41
|
+
errorText,
|
|
42
|
+
isError,
|
|
43
|
+
readOnly = false,
|
|
44
|
+
popoverDelay,
|
|
45
|
+
dropdownDimensionsConfig
|
|
46
|
+
}) => {
|
|
47
|
+
const allTexts = useTexts(texts);
|
|
48
|
+
const [dropdownVisible, setDropdownVisible] = useState(defaultDropdownVisibility ?? false);
|
|
49
|
+
const dimensionsConfig = {
|
|
54
50
|
defaultHeight: DROPDOWN_HEIGHT,
|
|
55
51
|
lowerHeight: DROPDOWN_HEIGHT_BELOW_THRESHOLD,
|
|
56
|
-
threshold: DROPDOWN_HEIGHT_THRESHOLD
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var checkViewportHeight = function checkViewportHeight() {
|
|
63
|
-
return setOuterHeight(window.innerHeight < dimensionsConfig.threshold ? dimensionsConfig.lowerHeight : dimensionsConfig.defaultHeight);
|
|
64
|
-
};
|
|
52
|
+
threshold: DROPDOWN_HEIGHT_THRESHOLD,
|
|
53
|
+
...dropdownDimensionsConfig
|
|
54
|
+
};
|
|
55
|
+
const [outerHeight, setOuterHeight] = useState(dimensionsConfig.defaultHeight);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const checkViewportHeight = () => setOuterHeight(window.innerHeight < dimensionsConfig.threshold ? dimensionsConfig.lowerHeight : dimensionsConfig.defaultHeight);
|
|
65
58
|
checkViewportHeight();
|
|
66
|
-
window.addEventListener(
|
|
67
|
-
return
|
|
68
|
-
window.removeEventListener(
|
|
59
|
+
window.addEventListener("resize", checkViewportHeight);
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener("resize", checkViewportHeight);
|
|
69
62
|
};
|
|
70
63
|
}, [dimensionsConfig.defaultHeight, dimensionsConfig.lowerHeight, dimensionsConfig.threshold]);
|
|
71
|
-
useEffect(
|
|
72
|
-
setDropdownVisible(defaultDropdownVisibility
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
setDropdownVisible(defaultDropdownVisibility ?? false);
|
|
73
66
|
}, [defaultDropdownVisibility]);
|
|
74
|
-
|
|
67
|
+
const handleChange = useCallback((val) => {
|
|
75
68
|
setDropdownVisible(false);
|
|
76
69
|
onSelectItem(val);
|
|
77
70
|
}, [onSelectItem]);
|
|
78
|
-
|
|
71
|
+
const handleOnSetGroup = useCallback((val) => {
|
|
79
72
|
onSetGroup && onSetGroup(val);
|
|
80
73
|
}, [onSetGroup]);
|
|
81
|
-
useEffect(
|
|
74
|
+
useEffect(() => {
|
|
82
75
|
if (opened) {
|
|
83
76
|
setDropdownVisible(true);
|
|
84
77
|
}
|
|
85
78
|
}, [opened]);
|
|
86
|
-
|
|
79
|
+
const triggerMode = useMemo(() => {
|
|
87
80
|
if (selectedItem) {
|
|
88
|
-
return readOnly ?
|
|
81
|
+
return readOnly ? "icon-label" : "two-icons";
|
|
89
82
|
}
|
|
90
|
-
return readOnly ?
|
|
83
|
+
return readOnly ? "simple" : "label-icon";
|
|
91
84
|
}, [selectedItem, readOnly]);
|
|
92
|
-
|
|
85
|
+
const triggerColor = useMemo(() => {
|
|
93
86
|
if (!selectedItem) {
|
|
94
|
-
return
|
|
87
|
+
return "blue";
|
|
95
88
|
}
|
|
96
|
-
return type ===
|
|
89
|
+
return type === "event" ? "cyan" : "green";
|
|
97
90
|
}, [selectedItem, type]);
|
|
98
|
-
|
|
91
|
+
const handleClick = useCallback(() => {
|
|
99
92
|
onOpen && onOpen();
|
|
100
93
|
setDropdownVisible(true);
|
|
101
94
|
}, [onOpen]);
|
|
102
|
-
|
|
103
|
-
return selectedItem && (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
descriptionConfig: selectedItem.description ? {
|
|
109
|
-
value: selectedItem.description,
|
|
110
|
-
disabled: true,
|
|
111
|
-
label: undefined
|
|
112
|
-
} : undefined
|
|
113
|
-
}, selectedItem.informationCardProps)));
|
|
95
|
+
const selectedItemInfoCard = useMemo(() => {
|
|
96
|
+
return selectedItem && (selectedItem.renderHoverTooltip?.() || /* @__PURE__ */ jsx(InformationCard, { icon: selectedItem.icon, subtitle: selectedItem.subtitle, title: selectedItem.name, renderAdditionalDescription: selectedItem.renderAdditionalDescription, descriptionConfig: selectedItem.description ? {
|
|
97
|
+
value: selectedItem.description,
|
|
98
|
+
disabled: true,
|
|
99
|
+
label: void 0
|
|
100
|
+
} : void 0, ...selectedItem.informationCardProps }));
|
|
114
101
|
}, [selectedItem]);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
error: hasError,
|
|
136
|
-
disabled: disabled,
|
|
137
|
-
type: "custom-color",
|
|
138
|
-
color: triggerColor,
|
|
139
|
-
mode: triggerMode,
|
|
140
|
-
onClick: !readOnly ? handleClick : undefined,
|
|
141
|
-
readOnly: readOnly
|
|
142
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
143
|
-
component: selectedItem.icon
|
|
144
|
-
}), /*#__PURE__*/React.createElement(ItemWrapper, null, selectedItem.name), !readOnly && /*#__PURE__*/React.createElement(Icon, {
|
|
145
|
-
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
146
|
-
}))) : /*#__PURE__*/React.createElement(Button, {
|
|
147
|
-
error: hasError,
|
|
148
|
-
disabled: disabled,
|
|
149
|
-
type: "custom-color",
|
|
150
|
-
color: triggerColor,
|
|
151
|
-
mode: triggerMode,
|
|
152
|
-
onClick: !readOnly ? handleClick : undefined,
|
|
153
|
-
readOnly: readOnly
|
|
154
|
-
}, /*#__PURE__*/React.createElement(ItemWrapper, null, buttonLabel), !readOnly && /*#__PURE__*/React.createElement(Icon, {
|
|
155
|
-
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
156
|
-
}));
|
|
102
|
+
const triggerButton = useMemo(() => {
|
|
103
|
+
const {
|
|
104
|
+
buttonLabel
|
|
105
|
+
} = allTexts;
|
|
106
|
+
const hasError = Boolean(errorText) || isError;
|
|
107
|
+
const addModeButton = /* @__PURE__ */ jsxs(Button, { error: hasError, disabled, type: "primary", mode: "icon-label", onClick: !readOnly ? handleClick : void 0, readOnly, children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}) }),
|
|
109
|
+
buttonLabel
|
|
110
|
+
] });
|
|
111
|
+
const standardButton = selectedItem ? /* @__PURE__ */ jsx(InformationCardTooltip, { content: selectedItemInfoCard, popoverProps: {
|
|
112
|
+
placement: "top",
|
|
113
|
+
getPopupContainer: getPopupContainerOverride || getPopupContainer
|
|
114
|
+
}, children: /* @__PURE__ */ jsxs(Button, { error: hasError, disabled, type: "custom-color", color: triggerColor, mode: triggerMode, onClick: !readOnly ? handleClick : void 0, readOnly, children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Icon, { component: selectedItem.icon }),
|
|
116
|
+
/* @__PURE__ */ jsx(ItemWrapper, { children: selectedItem.name }),
|
|
117
|
+
!readOnly && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}) })
|
|
118
|
+
] }) }) : /* @__PURE__ */ jsxs(Button, { error: hasError, disabled, type: "custom-color", color: triggerColor, mode: triggerMode, onClick: !readOnly ? handleClick : void 0, readOnly, children: [
|
|
119
|
+
/* @__PURE__ */ jsx(ItemWrapper, { children: buttonLabel }),
|
|
120
|
+
!readOnly && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}) })
|
|
121
|
+
] });
|
|
157
122
|
return addMode && !selectedItem ? addModeButton : standardButton;
|
|
158
123
|
}, [allTexts, errorText, isError, disabled, readOnly, handleClick, selectedItem, selectedItemInfoCard, getPopupContainerOverride, triggerColor, triggerMode, addMode]);
|
|
159
|
-
|
|
124
|
+
const onDropdownVisibilityChange = useCallback((value) => {
|
|
160
125
|
if (value) {
|
|
161
|
-
onActivate && onActivate(
|
|
126
|
+
onActivate && onActivate("");
|
|
162
127
|
setDropdownVisible(true);
|
|
163
128
|
} else {
|
|
164
129
|
setDropdownVisible(false);
|
|
165
130
|
}
|
|
166
131
|
}, [onActivate]);
|
|
167
132
|
if (readOnly) {
|
|
168
|
-
return
|
|
133
|
+
return /* @__PURE__ */ jsx(Fragment, { children: customTriggerComponent ?? triggerButton });
|
|
169
134
|
}
|
|
170
|
-
return
|
|
171
|
-
"data-popup-container": true
|
|
172
|
-
}, /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
173
|
-
getPopupContainer: getPopupContainerOverride || getPopupContainer,
|
|
174
|
-
onOpenChange: onDropdownVisibilityChange,
|
|
175
|
-
onDismiss: function onDismiss() {
|
|
135
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
136
|
+
/* @__PURE__ */ jsx("div", { "data-popup-container": true, children: /* @__PURE__ */ jsx(Dropdown, { getPopupContainer: getPopupContainerOverride || getPopupContainer, onOpenChange: onDropdownVisibilityChange, onDismiss: () => {
|
|
176
137
|
onClickOutside && onClickOutside();
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
open: dropdownVisible,
|
|
182
|
-
size: "medium"
|
|
183
|
-
}, dropdownProps, {
|
|
184
|
-
popoverProps: _extends({
|
|
185
|
-
testId: 'context-selector'
|
|
186
|
-
}, dropdownProps == null ? void 0 : dropdownProps.popoverProps, {
|
|
138
|
+
onDeactivate?.();
|
|
139
|
+
}, trigger, open: dropdownVisible, size: "medium", ...dropdownProps, popoverProps: {
|
|
140
|
+
testId: "context-selector",
|
|
141
|
+
...dropdownProps?.popoverProps,
|
|
187
142
|
dismissConfig: {
|
|
188
|
-
outsidePress:
|
|
189
|
-
return getClosest(event.target, '.ds-info-card') === null;
|
|
190
|
-
}
|
|
143
|
+
outsidePress: (event) => getClosest(event.target, ".ds-info-card") === null
|
|
191
144
|
}
|
|
192
|
-
}),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
onSetGroup: handleOnSetGroup,
|
|
199
|
-
groups: groups,
|
|
200
|
-
items: items,
|
|
201
|
-
recentItems: recentItems,
|
|
202
|
-
texts: allTexts,
|
|
203
|
-
visible: dropdownVisible,
|
|
204
|
-
loading: loading,
|
|
205
|
-
menuItemHeight: menuItemHeight,
|
|
206
|
-
dropdownWrapperStyles: dropdownWrapperStyles,
|
|
207
|
-
onClickOutsideEvents: onClickOutsideEvents,
|
|
208
|
-
onClickOutside: onClickOutside,
|
|
209
|
-
onSearch: onSearch,
|
|
210
|
-
hideSearchField: hideSearchField,
|
|
211
|
-
hasMoreItems: hasMoreItems,
|
|
212
|
-
onFetchData: onFetchData,
|
|
213
|
-
outerHeight: outerHeight,
|
|
214
|
-
popoverDelay: popoverDelay
|
|
215
|
-
})
|
|
216
|
-
}), customTriggerComponent != null ? customTriggerComponent : triggerButton)), errorText && /*#__PURE__*/React.createElement(ErrorWrapper, null, errorText));
|
|
145
|
+
}, overlay: /* @__PURE__ */ jsx(ContextSelectorDropdown, { value: selectedItem, onDeactivate, setDropdownVisible, setSelected: handleChange, onSetGroup: handleOnSetGroup, groups, items, recentItems, texts: allTexts, visible: dropdownVisible, loading, menuItemHeight, dropdownWrapperStyles, onClickOutsideEvents, onClickOutside, onSearch, hideSearchField, hasMoreItems, onFetchData, outerHeight, popoverDelay }), children: customTriggerComponent ?? triggerButton }) }),
|
|
146
|
+
errorText && /* @__PURE__ */ jsx(ErrorWrapper, { children: errorText })
|
|
147
|
+
] });
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
ContextSelector as default
|
|
217
151
|
};
|
|
218
|
-
export default ContextSelector;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const TabsWrapper: import(
|
|
2
|
-
export declare const ContentPlaceholder: import(
|
|
3
|
-
export declare const ItemsList: import(
|
|
1
|
+
export declare const TabsWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const ContentPlaceholder: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const ItemsList: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
contentHeight?: number;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const SearchResult: import(
|
|
7
|
-
export declare const SearchResultHighlight: import(
|
|
8
|
-
export declare const Title: import(
|
|
9
|
-
export declare const ItemWrapper: import(
|
|
10
|
-
export declare const ShowMoreItem: import(
|
|
11
|
-
export declare const ErrorWrapper: import(
|
|
12
|
-
export declare const Skeleton: import(
|
|
6
|
+
export declare const SearchResult: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
7
|
+
export declare const SearchResultHighlight: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
8
|
+
export declare const Title: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const ItemWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
10
|
+
export declare const ShowMoreItem: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const ErrorWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const Skeleton: import('styled-components').StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import('@synerise/ds-skeleton').SkeletonProps) => React.JSX.Element, any, {
|
|
13
13
|
contentHeight?: number;
|
|
14
14
|
}, never>;
|
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import DropdownSkeleton from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import DropdownSkeleton from "@synerise/ds-skeleton";
|
|
3
|
+
const TabsWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "ContextSelectorstyles__TabsWrapper",
|
|
5
5
|
componentId: "sc-1tuu6xk-0"
|
|
6
6
|
})(["width:100%;padding:0 0 8px 0;"]);
|
|
7
|
-
|
|
7
|
+
const ContentPlaceholder = /* @__PURE__ */ styled.div.withConfig({
|
|
8
8
|
displayName: "ContextSelectorstyles__ContentPlaceholder",
|
|
9
9
|
componentId: "sc-1tuu6xk-1"
|
|
10
10
|
})(["height:100px;"]);
|
|
11
|
-
|
|
11
|
+
const ItemsList = /* @__PURE__ */ styled.div.withConfig({
|
|
12
12
|
displayName: "ContextSelectorstyles__ItemsList",
|
|
13
13
|
componentId: "sc-1tuu6xk-2"
|
|
14
|
-
})(["width:100%;background:", ";.ds-context-selector-list{height:auto !important;max-height:300px;}", ""],
|
|
15
|
-
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.contentHeight !== undefined && "height: " + props.contentHeight + "px;";
|
|
18
|
-
});
|
|
19
|
-
export var SearchResult = styled.span.withConfig({
|
|
14
|
+
})(["width:100%;background:", ";.ds-context-selector-list{height:auto !important;max-height:300px;}", ""], (props) => props.theme.palette.white, (props) => props.contentHeight !== void 0 && `height: ${props.contentHeight}px;`);
|
|
15
|
+
const SearchResult = /* @__PURE__ */ styled.span.withConfig({
|
|
20
16
|
displayName: "ContextSelectorstyles__SearchResult",
|
|
21
17
|
componentId: "sc-1tuu6xk-3"
|
|
22
|
-
})(["font-weight:400;color:", ";"],
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
export var SearchResultHighlight = styled.span.withConfig({
|
|
18
|
+
})(["font-weight:400;color:", ";"], (props) => props.theme.palette["grey-500"]);
|
|
19
|
+
const SearchResultHighlight = /* @__PURE__ */ styled.span.withConfig({
|
|
26
20
|
displayName: "ContextSelectorstyles__SearchResultHighlight",
|
|
27
21
|
componentId: "sc-1tuu6xk-4"
|
|
28
|
-
})(["font-weight:500;color:", ";"],
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
export var Title = styled.div.withConfig({
|
|
22
|
+
})(["font-weight:500;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
23
|
+
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
32
24
|
displayName: "ContextSelectorstyles__Title",
|
|
33
25
|
componentId: "sc-1tuu6xk-5"
|
|
34
|
-
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"],
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
export var ItemWrapper = styled.span.withConfig({
|
|
26
|
+
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"], (props) => props.theme.palette["grey-500"]);
|
|
27
|
+
const ItemWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
38
28
|
displayName: "ContextSelectorstyles__ItemWrapper",
|
|
39
29
|
componentId: "sc-1tuu6xk-6"
|
|
40
30
|
})(["max-width:170px;overflow:hidden;text-overflow:ellipsis;"]);
|
|
41
|
-
|
|
31
|
+
const ShowMoreItem = /* @__PURE__ */ styled.div.withConfig({
|
|
42
32
|
displayName: "ContextSelectorstyles__ShowMoreItem",
|
|
43
33
|
componentId: "sc-1tuu6xk-7"
|
|
44
34
|
})(["font-weight:500;"]);
|
|
45
|
-
|
|
35
|
+
const ErrorWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
46
36
|
displayName: "ContextSelectorstyles__ErrorWrapper",
|
|
47
37
|
componentId: "sc-1tuu6xk-8"
|
|
48
|
-
})(["color:", ";margin-top:8px;"],
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
export var Skeleton = styled(DropdownSkeleton).withConfig({
|
|
38
|
+
})(["color:", ";margin-top:8px;"], (props) => props.theme.palette["red-600"]);
|
|
39
|
+
const Skeleton = /* @__PURE__ */ styled(DropdownSkeleton).withConfig({
|
|
52
40
|
displayName: "ContextSelectorstyles__Skeleton",
|
|
53
41
|
componentId: "sc-1tuu6xk-9"
|
|
54
|
-
})(["", ""],
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
})(["", ""], (props) => props.contentHeight !== void 0 && `height: ${props.contentHeight}px;`);
|
|
43
|
+
export {
|
|
44
|
+
ContentPlaceholder,
|
|
45
|
+
ErrorWrapper,
|
|
46
|
+
ItemWrapper,
|
|
47
|
+
ItemsList,
|
|
48
|
+
SearchResult,
|
|
49
|
+
SearchResultHighlight,
|
|
50
|
+
ShowMoreItem,
|
|
51
|
+
Skeleton,
|
|
52
|
+
TabsWrapper,
|
|
53
|
+
Title
|
|
54
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { CSSProperties, ReactNode, ReactText } from 'react';
|
|
2
|
+
import { DropdownSharedProps } from '@synerise/ds-dropdown';
|
|
3
|
+
import { InformationCardProps } from '@synerise/ds-information-card';
|
|
4
|
+
import { ItemSize, ListItemProps } from '@synerise/ds-list-item';
|
|
5
|
+
import { DelayConfig, PopoverTriggerType } from '@synerise/ds-popover';
|
|
6
|
+
import { HandledEventsType } from '@synerise/ds-utils';
|
|
7
7
|
export type ContextTexts = {
|
|
8
8
|
buttonLabel: ReactNode;
|
|
9
9
|
searchPlaceholder: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ContextDropdownProps } from '../ContextSelector.types';
|
|
3
3
|
declare const ContextSelectorDropdown: ({ texts, setSelected, onSetGroup, groups, items, recentItems, setDropdownVisible, value, visible, hideSearchField, loading, menuItemHeight, dropdownWrapperStyles, onSearch, onFetchData, hasMoreItems, outerHeight, popoverDelay, maxSearchResultsInGroup, }: ContextDropdownProps) => React.JSX.Element;
|
|
4
4
|
export default ContextSelectorDropdown;
|