oolib 2.190.3 → 2.191.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/components/Divider/index.d.ts +2 -1
  2. package/dist/components/Divider/index.js +2 -2
  3. package/dist/components/Dropdowns/DropdownMulti/index.js +6 -1
  4. package/dist/components/Dropdowns/comps/OptionsMulti/index.js +1 -0
  5. package/dist/components/Dropdowns/utils/generateOptions.js +1 -0
  6. package/dist/components/ImageInput/comps/ImageEditor/index.js +1 -1
  7. package/dist/stories/v2/components/{Dropdowns.stories.d.ts → Dropdown/Dropdowns.stories.d.ts} +46 -18
  8. package/dist/stories/v2/components/Dropdown/Dropdowns.stories.js +204 -0
  9. package/dist/stories/v2/components/Dropdown/dropdownOptions.d.ts +15 -0
  10. package/dist/stories/v2/components/Dropdown/dropdownOptions.js +156 -0
  11. package/dist/stories/v2/components/List.stories.d.ts +96 -0
  12. package/dist/stories/v2/components/List.stories.js +219 -0
  13. package/dist/utils/useStyleUpdateAfterToggleTransition.js +6 -2
  14. package/dist/v2/components/Dropdowns/DropdownMulti/index.d.ts +3 -2
  15. package/dist/v2/components/Dropdowns/DropdownMulti/index.js +36 -19
  16. package/dist/v2/components/Dropdowns/DropdownSingle/index.d.ts +3 -2
  17. package/dist/v2/components/Dropdowns/DropdownSingle/index.js +12 -13
  18. package/dist/v2/components/Dropdowns/comps/Caret/index.d.ts +1 -2
  19. package/dist/v2/components/Dropdowns/comps/Caret/index.js +15 -5
  20. package/dist/v2/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +1 -2
  21. package/dist/v2/components/Dropdowns/comps/DisplayCompSingle/index.js +8 -8
  22. package/dist/v2/components/Dropdowns/comps/NoOptionResultsComp/index.js +4 -4
  23. package/dist/v2/components/Dropdowns/comps/OptionsMulti/index.d.ts +2 -2
  24. package/dist/v2/components/Dropdowns/comps/OptionsMulti/index.js +12 -70
  25. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +1 -2
  26. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +3 -3
  27. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +5 -2
  28. package/dist/v2/components/Dropdowns/comps/OptionsShell/index.js +12 -26
  29. package/dist/v2/components/Dropdowns/comps/OptionsShell/styled.js +8 -8
  30. package/dist/v2/components/Dropdowns/comps/OptionsSingle/index.d.ts +3 -3
  31. package/dist/v2/components/Dropdowns/comps/OptionsSingle/index.js +9 -33
  32. package/dist/v2/components/Dropdowns/comps/OptionsSingle/styled.js +13 -12
  33. package/dist/v2/components/Dropdowns/comps/SearchBar/index.d.ts +8 -0
  34. package/dist/v2/components/Dropdowns/comps/SearchBar/index.js +21 -0
  35. package/dist/v2/components/Dropdowns/comps/SelectDropdown/index.d.ts +2 -2
  36. package/dist/v2/components/Dropdowns/comps/SelectDropdown/index.js +13 -15
  37. package/dist/v2/components/Dropdowns/comps/SelectDropdown/styled.js +10 -9
  38. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.d.ts +1 -2
  39. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.js +6 -9
  40. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/styled.js +3 -6
  41. package/dist/v2/components/Dropdowns/styled.js +1 -1
  42. package/dist/v2/components/Dropdowns/utils/genColor.js +2 -2
  43. package/dist/v2/components/Dropdowns/utils/genIcon.d.ts +3 -3
  44. package/dist/v2/components/Dropdowns/utils/genIcon.js +4 -2
  45. package/dist/v2/components/Dropdowns/utils/genProfileImg.d.ts +1 -2
  46. package/dist/v2/components/Dropdowns/utils/genProfileImg.js +2 -2
  47. package/dist/v2/components/Dropdowns/utils/genTagComp.js +3 -3
  48. package/dist/v2/components/Dropdowns/utils/getValue.d.ts +1 -0
  49. package/dist/v2/components/Dropdowns/utils/getValue.js +64 -10
  50. package/dist/v2/components/Dropdowns/utils/keywordSearchOptions.js +53 -9
  51. package/dist/v2/components/List/comps/ListGroup.d.ts +20 -0
  52. package/dist/v2/components/List/comps/ListGroup.js +39 -0
  53. package/dist/v2/components/List/comps/ListItem.d.ts +15 -0
  54. package/dist/v2/components/List/comps/ListItem.js +59 -0
  55. package/dist/v2/components/List/comps/styled.d.ts +1 -0
  56. package/dist/v2/components/List/comps/styled.js +71 -0
  57. package/dist/v2/components/List/index.d.ts +27 -0
  58. package/dist/v2/components/List/index.js +87 -0
  59. package/dist/v2/themes/globalStyles.js +2 -2
  60. package/package.json +1 -1
  61. package/dist/stories/v2/components/Dropdowns.stories.js +0 -289
  62. package/dist/v2/components/Dropdowns/comps/OptionContent/index.d.ts +0 -8
  63. package/dist/v2/components/Dropdowns/comps/OptionContent/index.js +0 -35
@@ -36,30 +36,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.OptionsMulti = void 0;
37
37
  var react_1 = __importStar(require("react"));
38
38
  var OptionsShell_1 = require("../OptionsShell");
39
- var colors_1 = require("../../../../themes/colors");
40
39
  var useSetYOrientation_1 = require("../../utils/useSetYOrientation");
41
40
  var useKeyboardControl_1 = require("../../utils/useKeyboardControl");
42
- var NoOptionResultsComp_1 = require("../NoOptionResultsComp");
43
- var OptionContent_1 = require("../OptionContent");
44
- var styled_1 = require("../OptionsSingle/styled");
45
- var CheckboxButton_1 = require("../../../RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton");
46
- var Divider_1 = require("../../../Divider");
47
- var TextInputs_1 = require("../../../TextInputs");
48
- var Typo_1 = require("../../../../../components/Typo");
49
- var TextLoader_1 = require("../../../../../components/LoadersAndProgress/TextLoader");
50
- var greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white;
51
- var CheckboxButtonShell = function (_a) {
52
- var children = _a.children, isSelected = _a.isSelected, invert = _a.invert;
53
- return (react_1.default.createElement("div", { style: {
54
- display: "flex",
55
- alignItems: "center",
56
- position: "relative",
57
- } },
58
- react_1.default.createElement(react_1.Fragment, null,
59
- react_1.default.createElement("div", { className: "OKE-Dropdown__checkboxClickArea" }),
60
- react_1.default.createElement(CheckboxButton_1.CheckboxButton, { invert: invert, isSelected: isSelected, className: "OKE-Dropdown__checkboxClickArea-box" })),
61
- children));
62
- };
41
+ var List_1 = require("../../../List");
42
+ var __1 = require("../../../../..");
43
+ var getValue_1 = require("../../utils/getValue");
63
44
  var OptionsMulti = function (_a) {
64
45
  var
65
46
  //from root
@@ -68,7 +49,7 @@ var OptionsMulti = function (_a) {
68
49
  relativeToRef = _a.relativeToRef, //the element that this lightbox is being rendered against. i.e top or bottom
69
50
  showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, handleSelect = _a.handleSelect, options = _a.options, isSearchable = _a.isSearchable, label = _a.label, optionsModalLabel = _a.optionsModalLabel, //label is just a fallback for optionsModalLabel. Don't know why both are needed
70
51
  searchString = _a.searchString, setSearchString = _a.setSearchString, SelectComp = _a.SelectComp, // for mobile
71
- isTagsStyle = _a.isTagsStyle, genCreateTagButton = _a.genCreateTagButton, invert = _a.invert, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, searchbarPlaceholder = _a.searchbarPlaceholder, alignDropdown = _a.alignDropdown;
52
+ isTagsStyle = _a.isTagsStyle, genCreateTagButton = _a.genCreateTagButton, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, searchbarPlaceholder = _a.searchbarPlaceholder, alignDropdown = _a.alignDropdown, matchSelectInputWidth = _a.matchSelectInputWidth;
72
53
  //INIT ORIENTATION STATE AND CUSTOM HOOK
73
54
  var optionsRef = (0, react_1.useRef)(null);
74
55
  var yOrientation = (0, useSetYOrientation_1.useSetYOrientation)({
@@ -100,59 +81,20 @@ var OptionsMulti = function (_a) {
100
81
  searchString: searchString,
101
82
  id: id,
102
83
  }), scrollFocussedOpIntoView = _b.scrollFocussedOpIntoView, focussedOp = _b.focussedOp;
103
- var opIsSelected = function (thisOpData) {
104
- return value === null || value === void 0 ? void 0 : value.some(function (d) { return d.value === thisOpData.value; });
105
- };
106
84
  var _c = (0, react_1.useState)(true), searchBarFocus = _c[0], setSearchBarFocus = _c[1];
107
85
  (0, react_1.useEffect)(function () {
108
86
  setSearchBarFocus(showOptions);
109
87
  }, [showOptions]);
110
- var createOption = function (d) {
111
- return isTagsStyle ? (react_1.default.createElement(OptionContent_1.OptionContent, { option: d, optionsClassName: optionsClassName, invert: invert })) : (react_1.default.createElement(CheckboxButtonShell, { invert: invert, isSelected: opIsSelected(d) },
112
- react_1.default.createElement(OptionContent_1.OptionContent, { option: d, optionsClassName: optionsClassName, invert: invert, S: S })));
113
- };
114
88
  var createSelectedOptions = function () {
115
- return (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 0 && (react_1.default.createElement("div", { style: {
116
- borderBottom: "1px solid ".concat(greyColor40),
117
- } },
118
- react_1.default.createElement(Typo_1.LABEL, { invert: invert, style: { padding: "2rem", paddingBottom: 0 }, color: colors_1.colors.greyColor70 }, "selected"),
119
- selectedOptions.map(function (d) {
120
- return (react_1.default.createElement(styled_1.StyledOption, { invert: invert, key: d.value, isSelected: opIsSelected(d), S: S, onClick: function (e) {
121
- if (!d.loading) {
122
- handleSelect(d);
123
- setSearchString("");
124
- setSearchBarFocus(true); //refocus on searchbar after select
125
- }
126
- },
127
- //this is important cuz if we dont, then the option will have the light blue background of the 'selected' state
128
- //is a bit hacky, but will do for now.
129
- style: { backgroundColor: invert ? colors_1.colors.greyColor90 : white } }, createOption(d)));
130
- })));
89
+ return (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 0 && (react_1.default.createElement("div", null,
90
+ react_1.default.createElement("div", { style: { padding: "0.4rem 0.8rem" } },
91
+ react_1.default.createElement(__1.UI_TAG, null, "Selected")),
92
+ react_1.default.createElement(List_1.List, { key: value, options: selectedOptions, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, handleSelect: handleSelect, setSearchString: setSearchString, optionsClassName: optionsClassName, setFocusSelectTagsInput: setFocusSelectTagsInput, S: S, isMulti: true, style: { padding: "0" }, disableShadow: true }),
93
+ react_1.default.createElement("div", { style: { margin: "0.4rem 0rem" } },
94
+ react_1.default.createElement(__1.Divider, { style: { borderBottom: "0.1rem solid ".concat(__1.colors2.grey20) } }))));
131
95
  };
132
- var genSearchBar = function () { return (react_1.default.createElement("div", { style: {
133
- position: "sticky",
134
- top: 0,
135
- zIndex: 1,
136
- background: invert ? colors_1.colors.greyColor90 : colors_1.colors.white,
137
- } },
138
- react_1.default.createElement("div", { style: { padding: "1rem" }, onBlur: function () { return setSearchBarFocus(false); }, tabIndex: 0 },
139
- react_1.default.createElement(TextInputs_1.TextInput, { placeholder: searchbarPlaceholder, forceFocus: searchBarFocus, invert: invert, type: "text", icon: "MagnifyingGlass", value: searchString, onChange: function (k, v) { return setSearchString(v); }, S: S })),
140
- react_1.default.createElement(Divider_1.Divider, { invert: invert }))); };
141
- return (react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, handleHideOptions: handleHideOptions, SelectComp: SelectComp, label: label, optionsModalLabel: optionsModalLabel, invert: invert, showDoneButton: true, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, relativeToRef: relativeToRef, S: S, alignDropdown: alignDropdown },
142
- isSearchable && genSearchBar(),
143
- !isTagsStyle && createSelectedOptions(),
144
- options.length === 0 ? (react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S })) : (options.map(function (d, i) {
145
- return (react_1.default.createElement(styled_1.StyledOption, { key: d.value, invert: invert, isSelected: opIsSelected(d), isFocussed: focussedOp === i, className: "OKE-Dropdown__option", ref: function (el) {
146
- return focussedOp === i && el && scrollFocussedOpIntoView(el);
147
- }, onClick: function (e) {
148
- if (!d.loading) {
149
- handleSelect(d);
150
- setSearchBarFocus(true);
151
- setSearchString("");
152
- setFocusSelectTagsInput && setFocusSelectTagsInput(true);
153
- }
154
- }, S: S }, d.loading ? (react_1.default.createElement(TextLoader_1.TextLoader, { style: { width: "8rem", height: "1.5rem" } })) : (createOption(d))));
155
- })),
96
+ return (react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, handleHideOptions: handleHideOptions, SelectComp: SelectComp, label: label, optionsModalLabel: optionsModalLabel, showDoneButton: true, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, relativeToRef: relativeToRef, S: S, alignDropdown: alignDropdown, matchSelectInputWidth: matchSelectInputWidth },
97
+ react_1.default.createElement(List_1.List, { options: options, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, handleSelect: handleSelect, optionsClassName: optionsClassName, S: S, grouped: (0, getValue_1.isGroupedData)(options), isMulti: true, disableShadow: true, isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, children: !isTagsStyle && createSelectedOptions() }),
156
98
  genCreateTagButton && genCreateTagButton(options)));
157
99
  };
158
100
  exports.OptionsMulti = OptionsMulti;
@@ -1,7 +1,6 @@
1
- export function OptionsAnimateWrapper({ relativeToRef, showOptions, invert, yOrientation, fixPos, optionsAnchor, children, lightboxStyle, alignDropdown, optionsToggleAnimationDuration }: {
1
+ export function OptionsAnimateWrapper({ relativeToRef, showOptions, yOrientation, fixPos, optionsAnchor, children, lightboxStyle, alignDropdown, optionsToggleAnimationDuration }: {
2
2
  relativeToRef: any;
3
3
  showOptions: any;
4
- invert: any;
5
4
  yOrientation: any;
6
5
  fixPos: any;
7
6
  optionsAnchor: any;
@@ -51,7 +51,7 @@ var useStyleUpdateAfterToggleTransition_1 = require("../../../../../../../utils/
51
51
  var OptionsAnimateWrapper = function (_a) {
52
52
  var _b;
53
53
  var _c;
54
- var relativeToRef = _a.relativeToRef, showOptions = _a.showOptions, invert = _a.invert, yOrientation = _a.yOrientation, fixPos = _a.fixPos, optionsAnchor = _a.optionsAnchor, children = _a.children, lightboxStyle = _a.lightboxStyle, alignDropdown = _a.alignDropdown, optionsToggleAnimationDuration = _a.optionsToggleAnimationDuration;
54
+ var relativeToRef = _a.relativeToRef, showOptions = _a.showOptions, yOrientation = _a.yOrientation, fixPos = _a.fixPos, optionsAnchor = _a.optionsAnchor, children = _a.children, lightboxStyle = _a.lightboxStyle, alignDropdown = _a.alignDropdown, optionsToggleAnimationDuration = _a.optionsToggleAnimationDuration;
55
55
  var selectCompRect = (_c = relativeToRef === null || relativeToRef === void 0 ? void 0 : relativeToRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
56
56
  var viewportWidth = document.documentElement.clientWidth; // excludes scrollbar
57
57
  var optionsDisplay = (0, useStyleUpdateAfterToggleTransition_1.useStyleUpdateAfterToggleTransition)({
@@ -60,8 +60,8 @@ var OptionsAnimateWrapper = function (_a) {
60
60
  toggleState: showOptions,
61
61
  transitionDuration: optionsToggleAnimationDuration
62
62
  }).style;
63
- var lightboxOffsetFromSelect = 6;
64
- return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { invert: invert, showOptions: showOptions, optionsToggleAnimationDuration: optionsToggleAnimationDuration, style: __assign(__assign(__assign({}, (lightboxStyle || {})), { display: optionsDisplay, zIndex: 100000 }), (fixPos
63
+ var lightboxOffsetFromSelect = 4;
64
+ return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { showOptions: showOptions, optionsToggleAnimationDuration: optionsToggleAnimationDuration, style: __assign(__assign(__assign({}, (lightboxStyle || {})), { display: optionsDisplay, zIndex: 100000 }), (fixPos
65
65
  ? __assign(__assign({ position: "fixed", top: "".concat(fixPos.y - (yOrientation === "top" ? ((selectCompRect === null || selectCompRect === void 0 ? void 0 : selectCompRect.height) + lightboxOffsetFromSelect) || -(lightboxOffsetFromSelect) : -(lightboxOffsetFromSelect)), "px") }, (alignDropdown === "right"
66
66
  ? {
67
67
  right: "".concat(viewportWidth - fixPos.right, "px")
@@ -12,11 +12,14 @@ var styled_components_1 = __importDefault(require("styled-components"));
12
12
  var mixins_1 = require("../../../../../../../themes/mixins");
13
13
  var themes_1 = require("../../../../../../themes");
14
14
  /** for lightbox shell */
15
- exports.StyledOptionsAnimateWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 'auto';\n /**\n 'else 100%' is very important. \n what this does is, on first render, it allows the optionsWrapper within to take whatever width \n its supposed to i.e max-content / 100% width of select / 36rem.\n Then on the next render (after the ref has already been attached to optionsWrapper), the proper width\n gets calculated and passed to this component.\n\n Without this 100%, this will not work > scenarios where there is enough space for the dropdown to \n stretch to the width of the select OR 36rem. Instead it will always stick to its min-width which is \n max-content\n */\n width:'100%';\n overflow: hidden;\n ", ";\n opacity: ", ";\n\n //could be turned into a global\n padding: 0 0.4rem;\n background-color: ", ";\n border-radius: 0.6rem;\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);\n"], ["\n height: 'auto';\n /**\n 'else 100%' is very important. \n what this does is, on first render, it allows the optionsWrapper within to take whatever width \n its supposed to i.e max-content / 100% width of select / 36rem.\n Then on the next render (after the ref has already been attached to optionsWrapper), the proper width\n gets calculated and passed to this component.\n\n Without this 100%, this will not work > scenarios where there is enough space for the dropdown to \n stretch to the width of the select OR 36rem. Instead it will always stick to its min-width which is \n max-content\n */\n width:'100%';\n overflow: hidden;\n ", ";\n opacity: ", ";\n\n //could be turned into a global\n padding: 0 0.4rem;\n background-color: ", ";\n border-radius: 0.6rem;\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);\n"])), function (_a) {
15
+ exports.StyledOptionsAnimateWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: auto;\n /**\n 'else 100%' is very important. \n what this does is, on first render, it allows the optionsWrapper within to take whatever width \n its supposed to i.e max-content / 100% width of select / 36rem.\n Then on the next render (after the ref has already been attached to optionsWrapper), the proper width\n gets calculated and passed to this component.\n\n Without this 100%, this will not work > scenarios where there is enough space for the dropdown to \n stretch to the width of the select OR 36rem. Instead it will always stick to its min-width which is \n max-content\n */\n /* width:100%; */\n overflow: hidden;\n ", ";\n opacity: ", ";\n pointer-events: ", ";\n\n\n background-color: ", ";\n border-radius: 0.6rem;\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);\n"], ["\n height: auto;\n /**\n 'else 100%' is very important. \n what this does is, on first render, it allows the optionsWrapper within to take whatever width \n its supposed to i.e max-content / 100% width of select / 36rem.\n Then on the next render (after the ref has already been attached to optionsWrapper), the proper width\n gets calculated and passed to this component.\n\n Without this 100%, this will not work > scenarios where there is enough space for the dropdown to \n stretch to the width of the select OR 36rem. Instead it will always stick to its min-width which is \n max-content\n */\n /* width:100%; */\n overflow: hidden;\n ", ";\n opacity: ", ";\n pointer-events: ", ";\n\n\n background-color: ", ";\n border-radius: 0.6rem;\n box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);\n"])), function (_a) {
16
16
  var optionsToggleAnimationDuration = _a.optionsToggleAnimationDuration;
17
- return (0, mixins_1.transition)("opacity ".concat(optionsToggleAnimationDuration / 1000, "s ease-out"));
17
+ return (0, mixins_1.transition)("opacity ".concat(optionsToggleAnimationDuration / 2000, "s ease-out"));
18
18
  }, function (_a) {
19
19
  var showOptions = _a.showOptions;
20
20
  return showOptions ? '1' : '0';
21
+ }, function (_a) {
22
+ var showOptions = _a.showOptions;
23
+ return showOptions ? 'auto' : 'none';
21
24
  }, themes_1.colors.white);
22
25
  var templateObject_1;
@@ -34,9 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.OptionsShell = void 0;
37
- var framer_motion_1 = require("framer-motion");
38
37
  var react_1 = __importStar(require("react"));
39
- var themes_1 = require("../../../../themes");
40
38
  var Buttons_1 = require("../../../Buttons");
41
39
  var styled_1 = require("./styled");
42
40
  var OptionsAnimateWrapper_1 = require("./comps/OptionsAnimateWrapper");
@@ -44,17 +42,19 @@ var styled_components_1 = require("styled-components");
44
42
  var usePopOutOfOverflowHiddenParent_1 = require("../../../../../utils/usePopOutOfOverflowHiddenParent");
45
43
  var _EXPORTS_1 = require("../../../../../utils/_EXPORTS");
46
44
  var mixins_1 = require("../../../../../themes/mixins");
45
+ var themes_1 = require("../../../../themes");
47
46
  var DefaultMobileShell = function (_a) {
48
47
  var children = _a.children;
49
48
  return (react_1.default.createElement("div", { style: { top: 0, left: 0, height: '100dvh', width: '100dvw', position: 'fixed', zIndex: '100000000', background: 'rgba(0,0,0,0.5)', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end' } }, children));
50
49
  };
51
50
  exports.OptionsShell = react_1.default.forwardRef(function (_a, ref) {
52
- var yOrientation = _a.yOrientation, lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, options = _a.options, optionsAnchor = _a.optionsAnchor, showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, children = _a.children, SelectComp = _a.SelectComp, label = _a.label, optionsModalLabel = _a.optionsModalLabel, invert = _a.invert, showDoneButton = _a.showDoneButton, _b = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _b === void 0 ? false : _b, relativeToRef = _a.relativeToRef, S = _a.S, alignDropdown = _a.alignDropdown;
51
+ var _b;
52
+ var yOrientation = _a.yOrientation, lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, options = _a.options, optionsAnchor = _a.optionsAnchor, showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, children = _a.children, SelectComp = _a.SelectComp, label = _a.label, optionsModalLabel = _a.optionsModalLabel, showDoneButton = _a.showDoneButton, _c = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _c === void 0 ? false : _c, relativeToRef = _a.relativeToRef, S = _a.S, alignDropdown = _a.alignDropdown, matchSelectInputWidth = _a.matchSelectInputWidth;
53
53
  var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
54
54
  var isDesktop = screenWidth >= (0, mixins_1.getBreakPoint)("sm");
55
55
  var currentTheme = (0, styled_components_1.useTheme)();
56
56
  var MobileShell = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.MobileShell) || DefaultMobileShell;
57
- var _c = (0, usePopOutOfOverflowHiddenParent_1.usePopOutOfOverflowHiddenParent)(popOutOfOverflowHiddenParent), fixPos = _c.fixPos, applyFixedPos = _c.applyFixedPos, removeFixedPos = _c.removeFixedPos, trackerRef = _c.trackerRef;
57
+ var _d = (0, usePopOutOfOverflowHiddenParent_1.usePopOutOfOverflowHiddenParent)(popOutOfOverflowHiddenParent), fixPos = _d.fixPos, applyFixedPos = _d.applyFixedPos, removeFixedPos = _d.removeFixedPos, trackerRef = _d.trackerRef;
58
58
  (0, react_1.useEffect)(function () {
59
59
  if (popOutOfOverflowHiddenParent) {
60
60
  if (showOptions)
@@ -66,36 +66,22 @@ exports.OptionsShell = react_1.default.forwardRef(function (_a, ref) {
66
66
  var optionsToggleAnimationDuration = 300;
67
67
  return isDesktop ? (react_1.default.createElement(react_1.Fragment, null,
68
68
  popOutOfOverflowHiddenParent && react_1.default.createElement("div", { ref: trackerRef }),
69
- react_1.default.createElement(OptionsAnimateWrapper_1.OptionsAnimateWrapper, { options: options, optionsRef: ref, relativeToRef: relativeToRef, showOptions: showOptions, invert: invert, yOrientation: yOrientation, fixPos: fixPos, optionsAnchor: optionsAnchor, children: children, lightboxStyle: lightboxStyle, alignDropdown: alignDropdown, optionsToggleAnimationDuration: optionsToggleAnimationDuration },
70
- react_1.default.createElement(styled_1.StyledOptionsWrapper, { id: "StyledOptionsWrapper", showOptions: showOptions, optionsToggleAnimationDuration: optionsToggleAnimationDuration, ref: ref, invert: invert, lightboxHeight: lightboxHeight,
69
+ react_1.default.createElement(OptionsAnimateWrapper_1.OptionsAnimateWrapper, { options: options, optionsRef: ref, relativeToRef: relativeToRef, showOptions: showOptions, yOrientation: yOrientation, fixPos: fixPos, optionsAnchor: optionsAnchor, children: children, lightboxStyle: lightboxStyle, alignDropdown: alignDropdown, optionsToggleAnimationDuration: optionsToggleAnimationDuration },
70
+ react_1.default.createElement(styled_1.StyledOptionsWrapper, { id: "StyledOptionsWrapper", showOptions: showOptions, optionsToggleAnimationDuration: optionsToggleAnimationDuration, ref: ref, lightboxHeight: lightboxHeight, matchSelectInputWidth: matchSelectInputWidth, selectRefwidth: (_b = relativeToRef === null || relativeToRef === void 0 ? void 0 : relativeToRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width,
71
71
  // className={className}
72
72
  style: {
73
73
  // position: "absolute",
74
74
  // bottom: yOrientation === "top" ? undefined : 0,
75
75
  // top: yOrientation === "top" ? 0 : undefined,
76
- } }, children)))) : (
77
- // <AnimatePresence>
78
- // {showOptions ? (
79
- // <Modal
80
- // fitToContentHeight
81
- // title={optionsModalLabel || label}
82
- // onClose={handleHideOptions}
83
- // invert={invert}
84
- // S={S}
85
- // dynamicHeaderHeight
86
- // >
87
- react_1.default.createElement(react_1.Fragment, null, showOptions ? (react_1.default.createElement(MobileShell, { onClose: handleHideOptions, title: optionsModalLabel || label },
76
+ } }, children)))) : (react_1.default.createElement(react_1.Fragment, null, showOptions ? (react_1.default.createElement(MobileShell, { onClose: handleHideOptions, title: optionsModalLabel || label },
88
77
  SelectComp && SelectComp,
89
- react_1.default.createElement(styled_1.StyledModalOptionsWrapper, { invert: invert, ref: ref }, children),
78
+ react_1.default.createElement(styled_1.StyledModalOptionsWrapper, { ref: ref }, children),
90
79
  showDoneButton && (react_1.default.createElement("div", { style: {
91
- backgroundColor: invert ? themes_1.colors.greyColor90 : themes_1.colors.white,
92
- padding: "1rem 2rem",
80
+ backgroundColor: themes_1.colors.white,
81
+ padding: "1rem 0.8rem",
93
82
  position: "sticky",
94
83
  bottom: "0",
84
+ width: "100%"
95
85
  } },
96
- react_1.default.createElement(Buttons_1.ButtonPrimary, { children: "Done", width: "100%", onClick: handleHideOptions, S: S }))))) : null)
97
- // </Modal>
98
- // ) : null}
99
- // </AnimatePresence>
100
- );
86
+ react_1.default.createElement(Buttons_1.ButtonPrimary, { children: "Done", style: { width: "100%" }, onClick: handleHideOptions, S: S }))))) : null));
101
87
  });
@@ -23,9 +23,12 @@ exports.StyledOptionsAnimateWrapper = styled_components_1.default.div(templateOb
23
23
  var isOpen = _a.isOpen;
24
24
  return isOpen ? '1px' : 0;
25
25
  });
26
- exports.StyledOptionsWrapper = styled_components_1.default.ul(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 100000; //show remove if we do animation thing\n padding-left: 0; //cancel out the ul's padding left\n cursor: pointer;\n width: 100%;\n min-width: max-content;\n max-width: 36rem;\n overflow: auto;\n margin-top: ", ";\n ", "\n max-height: ", ";\n"], ["\n z-index: 100000; //show remove if we do animation thing\n padding-left: 0; //cancel out the ul's padding left\n cursor: pointer;\n width: 100%;\n min-width: max-content;\n max-width: 36rem;\n overflow: auto;\n margin-top: ", ";\n ", "\n max-height: ", ";\n"
26
+ exports.StyledOptionsWrapper = styled_components_1.default.ul(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 100000; //show remove if we do animation thing\n padding-left: 0; //cancel out the ul's padding left\n cursor: pointer;\n width: 100%;\n min-width: ", ";\n max-width: 36rem;\n overflow: auto;\n margin-top: ", ";\n ", "\n max-height: ", ";\n\n ::-webkit-scrollbar { \n width: 0.5rem;// for vertical bars\n height: 0.2rem; //for horizontal bars \n }\n \n ::-webkit-scrollbar-track {\n background-color: ", ";\n }\n \n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 0.4rem;\n }\n \n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n \n }\n \n ", "{\n ::-webkit-scrollbar { \n width: 0.5rem;\n height: 0.7rem;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 0.5rem;\n }\n }\n"], ["\n z-index: 100000; //show remove if we do animation thing\n padding-left: 0; //cancel out the ul's padding left\n cursor: pointer;\n width: 100%;\n min-width: ", ";\n max-width: 36rem;\n overflow: auto;\n margin-top: ", ";\n ", "\n max-height: ", ";\n\n ::-webkit-scrollbar { \n width: 0.5rem;// for vertical bars\n height: 0.2rem; //for horizontal bars \n }\n \n ::-webkit-scrollbar-track {\n background-color: ", ";\n }\n \n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 0.4rem;\n }\n \n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n \n }\n \n ", "{\n ::-webkit-scrollbar { \n width: 0.5rem;\n height: 0.7rem;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 0.5rem;\n }\n }\n"
27
27
  /** for modal shell */
28
28
  ])), function (_a) {
29
+ var matchSelectInputWidth = _a.matchSelectInputWidth, selectRefwidth = _a.selectRefwidth;
30
+ return matchSelectInputWidth ? "".concat(selectRefwidth, "px") : "max-content";
31
+ }, function (_a) {
29
32
  var showOptions = _a.showOptions;
30
33
  return showOptions ? 'unset' : '-2rem';
31
34
  }, function (_a) {
@@ -35,17 +38,14 @@ exports.StyledOptionsWrapper = styled_components_1.default.ul(templateObject_2 |
35
38
  var lightboxHeight = _a.lightboxHeight;
36
39
  switch (lightboxHeight) {
37
40
  case 'large':
38
- return '33rem';
41
+ return '40rem';
39
42
  case 'small':
40
43
  return '20rem';
41
44
  case 'medium':
42
45
  default:
43
- return '24rem';
46
+ return '30rem';
44
47
  }
45
- });
48
+ }, themes_1.colors.grey5, themes_1.colors.grey40, themes_1.colors.grey80, (0, mixins_1.mediaQuery)('md'));
46
49
  /** for modal shell */
47
- exports.StyledModalOptionsWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n padding-left: 0;\n cursor: pointer;\n background-color: ", ";\n width: 100%;\n min-width: max-content;\n min-width: -moz-max-content;\n /* overflow: auto; */\n"], ["\n position: relative;\n padding-left: 0;\n cursor: pointer;\n background-color: ", ";\n width: 100%;\n min-width: max-content;\n min-width: -moz-max-content;\n /* overflow: auto; */\n"])), function (_a) {
48
- var invert = _a.invert;
49
- return invert ? themes_1.colors.greyColor90 : themes_1.colors.white;
50
- });
50
+ exports.StyledModalOptionsWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n padding-left: 0;\n cursor: pointer;\n background-color: ", ";\n width: 100%;\n min-width: max-content;\n min-width: -moz-max-content;\n /* overflow: auto; */\n"], ["\n position: relative;\n padding-left: 0;\n cursor: pointer;\n background-color: ", ";\n width: 100%;\n min-width: max-content;\n min-width: -moz-max-content;\n /* overflow: auto; */\n"])), themes_1.colors.white);
51
51
  var templateObject_1, templateObject_2, templateObject_3;
@@ -1,4 +1,4 @@
1
- export function OptionsSingle({ lightboxHeight, lightboxStyle, optionsAnchor, value, id, optionsClassName, relativeToRef, showOptions, handleHideOptions, handleSelect, options, isSearchable, label, optionsModalLabel, searchString, setSearchString, SelectComp, genCreateTagButton, invert, popOutOfOverflowHiddenParent, enableUseSetYOrientation, S, observerRef, searchbarPlaceholder, alignDropdown }: {
1
+ export function OptionsSingle({ lightboxHeight, lightboxStyle, optionsAnchor, value, id, optionsClassName, relativeToRef, showOptions, handleHideOptions, handleSelect, options, isSearchable, label, optionsModalLabel, searchString, setSearchString, SelectComp, genCreateTagButton, popOutOfOverflowHiddenParent, enableUseSetYOrientation, S, observerRef, searchbarPlaceholder, alignDropdown, matchSelectInputWidth, }: {
2
2
  lightboxHeight: any;
3
3
  lightboxStyle: any;
4
4
  optionsAnchor: any;
@@ -17,12 +17,12 @@ export function OptionsSingle({ lightboxHeight, lightboxStyle, optionsAnchor, va
17
17
  setSearchString: any;
18
18
  SelectComp: any;
19
19
  genCreateTagButton: any;
20
- invert: any;
21
20
  popOutOfOverflowHiddenParent: any;
22
21
  enableUseSetYOrientation?: boolean;
23
22
  S: any;
24
23
  observerRef: any;
25
- searchbarPlaceholder: any;
24
+ searchbarPlaceholder?: string;
26
25
  alignDropdown: any;
26
+ matchSelectInputWidth: any;
27
27
  }): React.JSX.Element;
28
28
  import React from "react";
@@ -35,16 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.OptionsSingle = void 0;
37
37
  var react_1 = __importStar(require("react"));
38
- var NoOptionResultsComp_1 = require("../NoOptionResultsComp");
39
- var OptionContent_1 = require("../OptionContent");
40
38
  var OptionsShell_1 = require("../OptionsShell");
41
- var styled_1 = require("./styled");
42
- var themes_1 = require("../../../../themes");
43
- var Divider_1 = require("../../../Divider");
44
- var TextInputs_1 = require("../../../TextInputs");
45
39
  var useKeyboardControl_1 = require("../../utils/useKeyboardControl");
46
40
  var useSetYOrientation_1 = require("../../utils/useSetYOrientation");
47
- var TextLoader_1 = require("../../../../../components/LoadersAndProgress/TextLoader");
41
+ var List_1 = require("../../../List");
42
+ var getValue_1 = require("../../utils/getValue");
48
43
  /**
49
44
  * if used independently, must be used inside a 'position: relative/absolute' div.
50
45
  */
@@ -55,11 +50,8 @@ var OptionsSingle = function (_a) {
55
50
  //from Dropdown
56
51
  relativeToRef = _a.relativeToRef, //the element that this lightbox is being rendered against. i.e top or bottom
57
52
  showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, handleSelect = _a.handleSelect, options = _a.options, isSearchable = _a.isSearchable, label = _a.label, optionsModalLabel = _a.optionsModalLabel, //label is just a fallback for optionsModalLabel. Don't know why both are needed
58
- searchString = _a.searchString, setSearchString = _a.setSearchString, SelectComp = _a.SelectComp, genCreateTagButton = _a.genCreateTagButton, invert = _a.invert, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, _b = _a.enableUseSetYOrientation, enableUseSetYOrientation = _b === void 0 ? true : _b, // if using this component standalone, this should be set to false ( if relativeToRef is not being passed thru)
59
- S = _a.S, observerRef = _a.observerRef, searchbarPlaceholder = _a.searchbarPlaceholder, alignDropdown = _a.alignDropdown
60
- //disabled only with this is being used for the RTEEmbedLightbox. Also this might be temp.
61
- //ensure this is set to false, if you are not passing a 'relativeToRef'
62
- ;
53
+ searchString = _a.searchString, setSearchString = _a.setSearchString, SelectComp = _a.SelectComp, genCreateTagButton = _a.genCreateTagButton, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, _b = _a.enableUseSetYOrientation, enableUseSetYOrientation = _b === void 0 ? true : _b, // if using this component standalone, this should be set to false ( if relativeToRef is not being passed thru)
54
+ S = _a.S, observerRef = _a.observerRef, _c = _a.searchbarPlaceholder, searchbarPlaceholder = _c === void 0 ? "Search" : _c, alignDropdown = _a.alignDropdown, matchSelectInputWidth = _a.matchSelectInputWidth;
63
55
  //INIT ORIENTATION STATE AND CUSTOM HOOK
64
56
  var optionsRef = (0, react_1.useRef)(null);
65
57
  var yOrientation = (0, useSetYOrientation_1.useSetYOrientation)({
@@ -68,7 +60,7 @@ var OptionsSingle = function (_a) {
68
60
  relativeToRef: relativeToRef,
69
61
  enabled: enableUseSetYOrientation,
70
62
  }).yOrientation;
71
- var _c = (0, useKeyboardControl_1.useKeyboardControl)({
63
+ var _d = (0, useKeyboardControl_1.useKeyboardControl)({
72
64
  showOptions: showOptions,
73
65
  optionsWrapperRef: optionsRef,
74
66
  handleHideOptions: handleHideOptions,
@@ -76,30 +68,14 @@ var OptionsSingle = function (_a) {
76
68
  options: options,
77
69
  searchString: searchString,
78
70
  id: id,
79
- }), scrollFocussedOpIntoView = _c.scrollFocussedOpIntoView, focussedOp = _c.focussedOp;
80
- var _d = (0, react_1.useState)(true), searchBarFocus = _d[0], setSearchBarFocus = _d[1];
71
+ }), scrollFocussedOpIntoView = _d.scrollFocussedOpIntoView, focussedOp = _d.focussedOp;
72
+ var _e = (0, react_1.useState)(true), searchBarFocus = _e[0], setSearchBarFocus = _e[1];
81
73
  (0, react_1.useEffect)(function () {
82
74
  setSearchBarFocus(showOptions);
83
75
  }, [showOptions]);
84
- var genSearchBar = function () { return (react_1.default.createElement("div", { style: {
85
- position: "sticky",
86
- top: 0,
87
- zIndex: 1,
88
- background: invert ? themes_1.colors.greyColor90 : themes_1.colors.white,
89
- } },
90
- react_1.default.createElement("div", { style: { padding: "1rem" } },
91
- react_1.default.createElement(TextInputs_1.TextInput, { placeholder: searchbarPlaceholder, invert: invert, forceFocus: searchBarFocus, type: "text", icon: "MagnifyingGlass", value: searchString, onChange: function (k, v) { return setSearchString(v); }, S: S })),
92
- react_1.default.createElement(Divider_1.Divider, { invert: invert }))); };
93
76
  return (react_1.default.createElement(react_1.default.Fragment, null,
94
- react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, SelectComp: SelectComp, handleHideOptions: handleHideOptions, label: label, optionsModalLabel: optionsModalLabel, invert: invert, relativeToRef: relativeToRef, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, alignDropdown: alignDropdown, S: S },
95
- isSearchable && genSearchBar(),
96
- options.length === 0 ? (react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S })) : (react_1.default.createElement(react_1.Fragment, null, options.map(function (option, index) { return (react_1.default.createElement(styled_1.StyledOption, { key: option.value, invert: invert, isSelected: !option.loading && (value === null || value === void 0 ? void 0 : value.value) === option.value, isFocussed: focussedOp === index, className: "OKE-Dropdown__option", ref: function (el) {
97
- return focussedOp === index && el && scrollFocussedOpIntoView(el);
98
- }, onClick: function (e) {
99
- if (!option.loading)
100
- handleSelect(option);
101
- setSearchString && setSearchString("");
102
- }, S: S }, option.loading ? (react_1.default.createElement(TextLoader_1.TextLoader, { style: { width: "8rem", height: "1.5rem" } })) : (react_1.default.createElement(OptionContent_1.OptionContent, { option: option, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: options.length === index + 1 ? observerRef : null })))); }))),
77
+ react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, SelectComp: SelectComp, handleHideOptions: handleHideOptions, label: label, optionsModalLabel: optionsModalLabel, relativeToRef: relativeToRef, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, alignDropdown: alignDropdown, matchSelectInputWidth: matchSelectInputWidth, S: S },
78
+ react_1.default.createElement(List_1.List, { options: options, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, handleSelect: handleSelect, optionsClassName: optionsClassName, S: S, observerRef: observerRef, grouped: (0, getValue_1.isGroupedData)(options), isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus }),
103
79
  genCreateTagButton && genCreateTagButton(options))));
104
80
  };
105
81
  exports.OptionsSingle = OptionsSingle;
@@ -39,26 +39,27 @@ var __importStar = (this && this.__importStar) || (function () {
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.StyledOption = void 0;
41
41
  var styled_components_1 = __importStar(require("styled-components"));
42
- var themes_1 = require("../../../../themes");
43
42
  var getDynamicColors_1 = require("../../../../themes/utils/getDynamicColors");
44
- var __1 = require("../../../../..");
45
- exports.StyledOption = styled_components_1.default.li(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: ", ";\n border-radius: 0.4rem;\n ", "\n \n\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", "\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", "\n } \n\n &:hover{\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", ";\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", ";\n } \n }\n\n \n\n &:first-of-type {\n margin-top: 0.4rem;\n }\n\n &:last-of-type {\n margin-bottom: 0.4rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: ", ";\n border-radius: 0.4rem;\n ", "\n \n\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", "\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", "\n } \n\n &:hover{\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", ";\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", ";\n } \n }\n\n \n\n &:first-of-type {\n margin-top: 0.4rem;\n }\n\n &:last-of-type {\n margin-bottom: 0.4rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-right: 1rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
43
+ var themes_1 = require("../../../../themes");
44
+ exports.StyledOption = styled_components_1.default.li(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: ", ";\n border-radius: 0.4rem;\n gap: 20rem;\n ", "\n \n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", "\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", "\n } \n\n &:hover{\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", ";\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", ";\n } \n }\n\n \n\n &:first-of-type {\n margin-top: 0.4rem;\n }\n\n &:last-of-type {\n margin-bottom: 0.4rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-top: 0.2rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n padding: ", ";\n border-radius: 0.4rem;\n gap: 20rem;\n ", "\n \n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", "\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", "\n } \n\n &:hover{\n background-color: ", ";\n\n .OKE-Dropdown__optionText{\n color: ", ";\n } \n\n .OKE-Dropdown__optionIcon{\n color: ", ";\n } \n }\n\n \n\n &:first-of-type {\n margin-top: 0.4rem;\n }\n\n &:last-of-type {\n margin-bottom: 0.4rem;\n }\n\n .OKE-Dropdown__optionDesc {\n @include kp-clamp-text(2);\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-top: 0.2rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
46
45
  var S = _a.S;
47
- return S ? '0.5rem 2rem' : ' 1rem';
46
+ return S ? '0.5rem 0.8rem' : '0.8rem';
48
47
  }, function (_a) {
49
48
  var S = _a.S;
50
49
  return !S
51
50
  ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n \n min-height: 3.8rem;\n "], ["\n \n min-height: 3.8rem;\n "]))) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n /* height: 3rem; */\n "], ["\n /* height: 3rem; */\n "])));
52
51
  }, function (_a) {
53
- var isFocussed = _a.isFocussed, isSelected = _a.isSelected, theme = _a.theme, invert = _a.invert;
54
- return isSelected
55
- ? (invert ? themes_1.colors.greyColor70 : (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors))
56
- : isFocussed
57
- ? (invert ? themes_1.colors.greyColor80 : themes_1.colors.greyColor5)
58
- : (invert ? themes_1.colors.greyColor90 : themes_1.colors.white);
59
- }, __1.colors2.grey80, __1.colors2.grey80, function (_a) {
52
+ var isFocussed = _a.isFocussed, isSelected = _a.isSelected, theme = _a.theme;
53
+ if (isSelected) {
54
+ var secondaryContainer = (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
55
+ return "".concat(secondaryContainer, " !important"); // 66 in hex is 40% opacity
56
+ }
57
+ else {
58
+ return isFocussed ? themes_1.colors.grey5 : themes_1.colors.white;
59
+ }
60
+ }, themes_1.colors.grey80, themes_1.colors.grey80, function (_a) {
60
61
  var theme = _a.theme;
61
- return (0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors);
62
+ return "".concat((0, getDynamicColors_1.getSecondaryContainer)(theme === null || theme === void 0 ? void 0 : theme.colors), "66");
62
63
  }, function (_a) {
63
64
  var theme = _a.theme;
64
65
  return (0, getDynamicColors_1.getOnSecondary)(theme === null || theme === void 0 ? void 0 : theme.colors);
@@ -0,0 +1,8 @@
1
+ export function SearchBar({ searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus }: {
2
+ searchbarPlaceholder: any;
3
+ searchBarFocus: any;
4
+ searchString: any;
5
+ setSearchString: any;
6
+ setSearchBarFocus: any;
7
+ }): React.JSX.Element;
8
+ import React from 'react';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SearchBar = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var TextInputs_1 = require("../../../TextInputs");
9
+ var SearchBar = function (_a) {
10
+ var searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus;
11
+ return (react_1.default.createElement("div", { style: {
12
+ position: "sticky",
13
+ top: 0,
14
+ zIndex: 1,
15
+ padding: "4px 0",
16
+ background: "white"
17
+ }, onBlur: function () { return setSearchBarFocus(false); }, tabIndex: 0 },
18
+ react_1.default.createElement("div", { style: { paddingBottom: "4px" } },
19
+ react_1.default.createElement(TextInputs_1.TextInput, { placeholder: searchbarPlaceholder, forceFocus: searchBarFocus, type: "text", icon: "MagnifyingGlass", value: searchString, onChange: function (k, v) { return setSearchString(v); }, S: true }))));
20
+ };
21
+ exports.SearchBar = SearchBar;
@@ -1,5 +1,4 @@
1
- export function SelectDropdown({ invert, value, placeholder, genCustomSelectComp, selectClassName, showOptions, disableSelectTextUpdate, selectConfig, selectStyleOverride, S, disabled, }: {
2
- invert: any;
1
+ export function SelectDropdown({ value, placeholder, genCustomSelectComp, selectClassName, showOptions, disableSelectTextUpdate, selectConfig, variant, selectStyleOverride, S, disabled, }: {
3
2
  value: any;
4
3
  placeholder: any;
5
4
  genCustomSelectComp: any;
@@ -7,6 +6,7 @@ export function SelectDropdown({ invert, value, placeholder, genCustomSelectComp
7
6
  showOptions: any;
8
7
  disableSelectTextUpdate: any;
9
8
  selectConfig?: string;
9
+ variant: any;
10
10
  selectStyleOverride: any;
11
11
  S: any;
12
12
  disabled: any;
@@ -10,17 +10,16 @@ var Caret_1 = require("../Caret");
10
10
  var genIcon_1 = require("../../utils/genIcon");
11
11
  var styled_1 = require("./styled");
12
12
  var genColor_1 = require("../../utils/genColor");
13
- var Typo_1 = require("../../../../../components/Typo");
14
13
  var Typo2_1 = require("../../../Typo2");
15
14
  var SelectDropdown = function (_a) {
16
15
  var
17
16
  //from root
18
- invert = _a.invert, value = _a.value, placeholder = _a.placeholder, genCustomSelectComp = _a.genCustomSelectComp, selectClassName = _a.selectClassName,
17
+ value = _a.value, placeholder = _a.placeholder, genCustomSelectComp = _a.genCustomSelectComp, selectClassName = _a.selectClassName,
19
18
  //from Dropdown
20
19
  showOptions = _a.showOptions,
21
20
  //used only for filters, where we dont remove the placeholder even when an option is selected, instead we sustain the blue underline
22
21
  // && header where we dont update the menu title if one of its options is selected
23
- disableSelectTextUpdate = _a.disableSelectTextUpdate, _b = _a.selectConfig, selectConfig = _b === void 0 ? "all" : _b, selectStyleOverride = _a.selectStyleOverride, //used curr only in access control table & header dropdowns
22
+ disableSelectTextUpdate = _a.disableSelectTextUpdate, _b = _a.selectConfig, selectConfig = _b === void 0 ? "all" : _b, variant = _a.variant, selectStyleOverride = _a.selectStyleOverride, //used curr only in access control table & header dropdowns
24
23
  S = _a.S, disabled = _a.disabled;
25
24
  var dropdownSelectText = (0, setDropdownSelectText_1.setDropdownSelectText)({
26
25
  placeholder: placeholder,
@@ -35,21 +34,20 @@ var SelectDropdown = function (_a) {
35
34
  return selectConfig.indexOf(elem) !== -1 ? true : false;
36
35
  };
37
36
  var TypoComp = S ? Typo2_1.UI_BODY_SM_DF : Typo2_1.UI_BODY_SM_DF;
38
- var genSelectComp = function () { return (react_1.default.createElement(styled_1.StyledSelectWrapper, { tabIndex: 0, invert: invert, S: S, isPlaceholder: !value, disabled: disabled, style: selectStyleOverride },
39
- react_1.default.createElement("div", { style: { zIndex: 1 } },
40
- react_1.default.createElement("div", { style: { display: "flex", gap: "1rem", alignItems: "center" } },
41
- showElem('color') && (0, genColor_1.genColor)({ color: value === null || value === void 0 ? void 0 : value.color }),
42
- showElem("icon") && (0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, invert: invert, S: S }),
43
- showElem("display") && (react_1.default.createElement(TypoComp
37
+ var genSelectComp = function () { return (react_1.default.createElement(styled_1.StyledSelectWrapper, { tabIndex: 0, S: S, isPlaceholder: (Array.isArray(value) && (value === null || value === void 0 ? void 0 : value.length) < 1) || !value, disabled: disabled, style: selectStyleOverride, variant: variant, showOptions: showOptions, id: "StyledSelectWrapper" },
38
+ react_1.default.createElement("div", { style: { display: "flex", gap: "1rem", alignItems: "center", zIndex: 1 } },
39
+ showElem('color') && (0, genColor_1.genColor)({ color: value === null || value === void 0 ? void 0 : value.color }),
40
+ showElem("icon") && (0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, S: S }),
41
+ showElem("display") && (react_1.default.createElement(TypoComp
42
+ // semibold={
43
+ // dropdownSelectText.desc && showElem("desc") ? true : undefined
44
+ // }
45
+ , {
44
46
  // semibold={
45
47
  // dropdownSelectText.desc && showElem("desc") ? true : undefined
46
48
  // }
47
- , {
48
- // semibold={
49
- // dropdownSelectText.desc && showElem("desc") ? true : undefined
50
- // }
51
- className: "".concat(selectClassName || "", " ").concat(!value && placeholder) }, dropdownSelectText.display)))),
52
- react_1.default.createElement(Caret_1.Caret, { showOptions: showOptions, invert: invert, disabled: disabled }))); };
49
+ className: "".concat(selectClassName || "", " ").concat(!value && placeholder) }, dropdownSelectText.display))),
50
+ react_1.default.createElement(Caret_1.Caret, { showOptions: showOptions, disabled: disabled }))); };
53
51
  return genCustomSelectComp ? genCustomSelectComp() : genSelectComp();
54
52
  };
55
53
  exports.SelectDropdown = SelectDropdown;
@@ -40,23 +40,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.StyledSelectWrapper = void 0;
41
41
  var styled_components_1 = __importStar(require("styled-components"));
42
42
  var themes_1 = require("../../../../themes");
43
- var utilsOolib_1 = require("../../../../../utilsOolib");
44
- var mixins_1 = require("../../../../../themes/mixins");
45
43
  var globalStyles_1 = require("../../../../themes/globalStyles");
46
- exports.StyledSelectWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n min-height: 4rem;\n \n \n\n ", "\n ", "\n\n ", ";\n ", "\n", "\n ", "\n ", "\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n min-height: 4rem;\n \n \n\n ", "\n ", "\n\n ", ";\n ", "\n", "\n ", "\n ", "\n ", "\n"])), function (_a) {
44
+ exports.StyledSelectWrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n min-height: 4rem;\n \n ", "\n ", "\n\n ", ";\n \n ", "\n \n ", "\n ", ";\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n position: relative;\n min-height: 4rem;\n \n ", "\n ", "\n\n ", ";\n \n ", "\n \n ", "\n ", ";\n ", "\n"])), function (_a) {
47
45
  var S = _a.S;
48
- return S && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-height: auto;\n height: 3rem;\n "], ["\n min-height: auto;\n height: 3rem;\n "])));
46
+ return S ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-height: auto;\n height: 3.6rem;\n "], ["\n min-height: auto;\n height: 3.6rem;\n "]))) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n min-height: auto;\n height: 4.5rem;\n "], ["\n min-height: auto;\n height: 4.5rem;\n "])));
49
47
  }, function (_a) {
50
48
  var disabled = _a.disabled;
51
- return disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
49
+ return disabled && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
52
50
  }, function (_a) {
53
51
  var isPlaceholder = _a.isPlaceholder;
54
52
  return isPlaceholder ? globalStyles_1.globalInputElemPlaceholderColor : globalStyles_1.globalInputElemTextColor;
55
- }, globalStyles_1.globalInputElemDisabledStyling_v2, globalStyles_1.globalInputElemPadding_v2, globalStyles_1.globalInputElemBaseBorderStyling_v2, function (_a) {
56
- var disabled = _a.disabled;
57
- return !disabled && globalStyles_1.globalInputElemHover_v2;
58
53
  }, function (_a) {
54
+ var variant = _a.variant;
55
+ return variant === "ghost" ? (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 6px;\n &:hover {\n background-color : ", ";\n }\n\n ", "\n\n "], ["\n border-radius: 6px;\n &:hover {\n background-color : ", ";\n }\n\n ", "\n\n "])), themes_1.colors.grey10, function (_a) {
56
+ var showOptions = _a.showOptions;
57
+ return showOptions ? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), globalStyles_1.globalInputElemBaseBorderStyling_v2) : (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n \n "], ["\n \n "])));
58
+ }) : (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n ", ";\n "], ["\n ", ";\n ", ";\n "])), globalStyles_1.globalInputElemBaseBorderStyling_v2, globalStyles_1.globalInputElemHover_v2);
59
+ }, globalStyles_1.globalInputElemDisabledStyling_v2, globalStyles_1.globalInputElemPadding_v2, function (_a) {
59
60
  var disabled = _a.disabled;
60
61
  return !disabled && globalStyles_1.globalInputElemFocused_v2;
61
62
  });
62
- var templateObject_1, templateObject_2, templateObject_3;
63
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -1,5 +1,4 @@
1
- export function SelectTagsInput({ invert, id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, tagColor, style }: {
2
- invert: any;
1
+ export function SelectTagsInput({ id, value, disabled, handleSelect, searchString, setSearchString, placeholder, setFocusSelectTagsInput, focusSelectTagsInput, single_multi, showOptions, S, tagColor, style }: {
3
2
  id: any;
4
3
  value: any;
5
4
  disabled: any;