oolib 2.176.5 → 2.177.1

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 (88) hide show
  1. package/dist/icons/index.d.ts +2 -0
  2. package/dist/icons/index.js +1 -0
  3. package/dist/stories/v2/components/Dropdowns.stories.d.ts +121 -0
  4. package/dist/stories/v2/components/Dropdowns.stories.js +289 -0
  5. package/dist/utils/useStyleUpdateAfterToggleTransition.d.ts +8 -0
  6. package/dist/utils/useStyleUpdateAfterToggleTransition.js +41 -0
  7. package/dist/v2/components/Accordion/index.js +7 -25
  8. package/dist/v2/components/Dropdowns/DropdownMulti/index.d.ts +38 -0
  9. package/dist/v2/components/Dropdowns/DropdownMulti/index.js +172 -0
  10. package/dist/v2/components/Dropdowns/DropdownSingle/index.d.ts +40 -0
  11. package/dist/v2/components/Dropdowns/DropdownSingle/index.js +158 -0
  12. package/dist/v2/components/Dropdowns/comps/Caret/index.d.ts +6 -0
  13. package/dist/v2/components/Dropdowns/comps/Caret/index.js +19 -0
  14. package/dist/v2/components/Dropdowns/comps/Caret/styled.d.ts +2 -0
  15. package/dist/v2/components/Dropdowns/comps/Caret/styled.js +14 -0
  16. package/dist/v2/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +7 -0
  17. package/dist/v2/components/Dropdowns/comps/DisplayCompSingle/index.js +39 -0
  18. package/dist/v2/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +4 -0
  19. package/dist/v2/components/Dropdowns/comps/NoOptionResultsComp/index.js +15 -0
  20. package/dist/v2/components/Dropdowns/comps/OptionContent/index.d.ts +8 -0
  21. package/dist/v2/components/Dropdowns/comps/OptionContent/index.js +35 -0
  22. package/dist/v2/components/Dropdowns/comps/OptionsMulti/index.d.ts +28 -0
  23. package/dist/v2/components/Dropdowns/comps/OptionsMulti/index.js +158 -0
  24. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +13 -0
  25. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +75 -0
  26. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.d.ts +2 -0
  27. package/dist/v2/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +22 -0
  28. package/dist/v2/components/Dropdowns/comps/OptionsShell/index.d.ts +2 -0
  29. package/dist/v2/components/Dropdowns/comps/OptionsShell/index.js +101 -0
  30. package/dist/v2/components/Dropdowns/comps/OptionsShell/styled.d.ts +5 -0
  31. package/dist/v2/components/Dropdowns/comps/OptionsShell/styled.js +51 -0
  32. package/dist/v2/components/Dropdowns/comps/OptionsSingle/index.d.ts +28 -0
  33. package/dist/v2/components/Dropdowns/comps/OptionsSingle/index.js +105 -0
  34. package/dist/v2/components/Dropdowns/comps/OptionsSingle/styled.d.ts +1 -0
  35. package/dist/v2/components/Dropdowns/comps/OptionsSingle/styled.js +69 -0
  36. package/dist/v2/components/Dropdowns/comps/SelectDropdown/index.d.ts +13 -0
  37. package/dist/v2/components/Dropdowns/comps/SelectDropdown/index.js +54 -0
  38. package/dist/v2/components/Dropdowns/comps/SelectDropdown/styled.d.ts +1 -0
  39. package/dist/v2/components/Dropdowns/comps/SelectDropdown/styled.js +71 -0
  40. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.d.ts +18 -0
  41. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/index.js +124 -0
  42. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +2 -0
  43. package/dist/v2/components/Dropdowns/comps/SelectTagsInput/styled.js +53 -0
  44. package/dist/v2/components/Dropdowns/handlers/index.d.ts +14 -0
  45. package/dist/v2/components/Dropdowns/handlers/index.js +52 -0
  46. package/dist/v2/components/Dropdowns/styled.d.ts +2 -0
  47. package/dist/v2/components/Dropdowns/styled.js +49 -0
  48. package/dist/v2/components/Dropdowns/utils/genColor.d.ts +4 -0
  49. package/dist/v2/components/Dropdowns/utils/genColor.js +15 -0
  50. package/dist/v2/components/Dropdowns/utils/genIcon.d.ts +9 -0
  51. package/dist/v2/components/Dropdowns/utils/genIcon.js +18 -0
  52. package/dist/v2/components/Dropdowns/utils/genLinkOrText.d.ts +1 -0
  53. package/dist/v2/components/Dropdowns/utils/genLinkOrText.js +48 -0
  54. package/dist/v2/components/Dropdowns/utils/genProfileImg.d.ts +6 -0
  55. package/dist/v2/components/Dropdowns/utils/genProfileImg.js +14 -0
  56. package/dist/v2/components/Dropdowns/utils/genTagComp.d.ts +2 -0
  57. package/dist/v2/components/Dropdowns/utils/genTagComp.js +27 -0
  58. package/dist/v2/components/Dropdowns/utils/generateOptions.d.ts +5 -0
  59. package/dist/v2/components/Dropdowns/utils/generateOptions.js +19 -0
  60. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +1 -0
  61. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +40 -0
  62. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +4 -0
  63. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +11 -0
  64. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +4 -0
  65. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +62 -0
  66. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +1 -0
  67. package/dist/v2/components/Dropdowns/utils/getAllOptionsFns/index.js +19 -0
  68. package/dist/v2/components/Dropdowns/utils/getValue.d.ts +14 -0
  69. package/dist/v2/components/Dropdowns/utils/getValue.js +32 -0
  70. package/dist/v2/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
  71. package/dist/v2/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
  72. package/dist/v2/components/Dropdowns/utils/keywordSearchOptions.d.ts +6 -0
  73. package/dist/v2/components/Dropdowns/utils/keywordSearchOptions.js +18 -0
  74. package/dist/v2/components/Dropdowns/utils/setDropdownSelectText.d.ts +12 -0
  75. package/dist/v2/components/Dropdowns/utils/setDropdownSelectText.js +19 -0
  76. package/dist/v2/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +5 -0
  77. package/dist/v2/components/Dropdowns/utils/useCreateDropdownRefs.js +15 -0
  78. package/dist/v2/components/Dropdowns/utils/useHideShowOptions.d.ts +5 -0
  79. package/dist/v2/components/Dropdowns/utils/useHideShowOptions.js +20 -0
  80. package/dist/v2/components/Dropdowns/utils/useKeyboardControl.d.ts +12 -0
  81. package/dist/v2/components/Dropdowns/utils/useKeyboardControl.js +73 -0
  82. package/dist/v2/components/Dropdowns/utils/useSearchString.d.ts +4 -0
  83. package/dist/v2/components/Dropdowns/utils/useSearchString.js +20 -0
  84. package/dist/v2/components/Dropdowns/utils/useSetYOrientation.d.ts +9 -0
  85. package/dist/v2/components/Dropdowns/utils/useSetYOrientation.js +46 -0
  86. package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +2 -1
  87. package/dist/v2/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +2 -2
  88. package/package.json +1 -1
@@ -121,6 +121,7 @@ export namespace icons {
121
121
  export { CirclesFour };
122
122
  export { ArrowLineDown };
123
123
  export { PaperPlaneTilt };
124
+ export { NotePencil };
124
125
  export { OkeGoogleIcon };
125
126
  export { LetterH };
126
127
  export { IndexIcon };
@@ -307,6 +308,7 @@ import { ArrowsVertical } from 'phosphor-react';
307
308
  import { CirclesFour } from 'phosphor-react';
308
309
  import { ArrowLineDown } from 'phosphor-react';
309
310
  import { PaperPlaneTilt } from 'phosphor-react';
311
+ import { NotePencil } from 'phosphor-react';
310
312
  import { OkeGoogleIcon } from "./custom";
311
313
  import { LetterH } from "./custom";
312
314
  import { IndexIcon } from "./custom";
@@ -126,6 +126,7 @@ exports.icons = {
126
126
  CirclesFour: phosphor_react_1.CirclesFour,
127
127
  ArrowLineDown: phosphor_react_1.ArrowLineDown,
128
128
  PaperPlaneTilt: phosphor_react_1.PaperPlaneTilt,
129
+ NotePencil: phosphor_react_1.NotePencil,
129
130
  //custom icons
130
131
  OkeGoogleIcon: custom_1.OkeGoogleIcon,
131
132
  LetterH: custom_1.LetterH,
@@ -0,0 +1,121 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ namespace argTypes {
4
+ namespace placeholder {
5
+ let name: string;
6
+ }
7
+ namespace optionIcon {
8
+ export { availableIcons as options };
9
+ export namespace control {
10
+ let type: string;
11
+ }
12
+ }
13
+ namespace selection {
14
+ let name_1: string;
15
+ export { name_1 as name };
16
+ export let options: string[];
17
+ export namespace control_1 {
18
+ let type_1: string;
19
+ export { type_1 as type };
20
+ }
21
+ export { control_1 as control };
22
+ }
23
+ namespace size {
24
+ let name_2: string;
25
+ export { name_2 as name };
26
+ export namespace control_2 {
27
+ let type_2: string;
28
+ export { type_2 as type };
29
+ }
30
+ export { control_2 as control };
31
+ let options_1: string[];
32
+ export { options_1 as options };
33
+ export namespace mapping {
34
+ let Small: string;
35
+ let Medium: string;
36
+ }
37
+ }
38
+ namespace isSearchable {
39
+ let name_3: string;
40
+ export { name_3 as name };
41
+ }
42
+ namespace showIconInSelectArea {
43
+ let name_4: string;
44
+ export { name_4 as name };
45
+ }
46
+ namespace optionImage {
47
+ let name_5: string;
48
+ export { name_5 as name };
49
+ }
50
+ namespace optionDescription {
51
+ let name_6: string;
52
+ export { name_6 as name };
53
+ }
54
+ namespace colors {
55
+ let name_7: string;
56
+ export { name_7 as name };
57
+ }
58
+ namespace disabled {
59
+ let name_8: string;
60
+ export { name_8 as name };
61
+ }
62
+ namespace readOnly {
63
+ let name_9: string;
64
+ export { name_9 as name };
65
+ }
66
+ namespace invert {
67
+ let name_10: string;
68
+ export { name_10 as name };
69
+ }
70
+ namespace showColorInSelectArea {
71
+ let name_11: string;
72
+ export { name_11 as name };
73
+ }
74
+ namespace alignDropdown {
75
+ let name_12: string;
76
+ export { name_12 as name };
77
+ let options_2: string[];
78
+ export { options_2 as options };
79
+ export namespace control_3 {
80
+ let type_3: string;
81
+ export { type_3 as type };
82
+ }
83
+ export { control_3 as control };
84
+ }
85
+ }
86
+ namespace args {
87
+ let placeholder_1: string;
88
+ export { placeholder_1 as placeholder };
89
+ let size_1: string;
90
+ export { size_1 as size };
91
+ let selection_1: string;
92
+ export { selection_1 as selection };
93
+ let isSearchable_1: boolean;
94
+ export { isSearchable_1 as isSearchable };
95
+ let optionDescription_1: string;
96
+ export { optionDescription_1 as optionDescription };
97
+ let optionImage_1: string;
98
+ export { optionImage_1 as optionImage };
99
+ let optionIcon_1: any;
100
+ export { optionIcon_1 as optionIcon };
101
+ let showIconInSelectArea_1: boolean;
102
+ export { showIconInSelectArea_1 as showIconInSelectArea };
103
+ let colors_1: boolean;
104
+ export { colors_1 as colors };
105
+ let showColorInSelectArea_1: boolean;
106
+ export { showColorInSelectArea_1 as showColorInSelectArea };
107
+ let disabled_1: boolean;
108
+ export { disabled_1 as disabled };
109
+ let readOnly_1: boolean;
110
+ export { readOnly_1 as readOnly };
111
+ let invert_1: boolean;
112
+ export { invert_1 as invert };
113
+ export let popOutOfOverflowHiddenParent: boolean;
114
+ let alignDropdown_1: string;
115
+ export { alignDropdown_1 as alignDropdown };
116
+ }
117
+ }
118
+ export default _default;
119
+ export function Dropdowns(args: any): React.JSX.Element;
120
+ declare const availableIcons: string[];
121
+ import React from "react";
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
47
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
48
+ if (ar || !(i in from)) {
49
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
50
+ ar[i] = from[i];
51
+ }
52
+ }
53
+ return to.concat(ar || Array.prototype.slice.call(from));
54
+ };
55
+ Object.defineProperty(exports, "__esModule", { value: true });
56
+ exports.Dropdowns = void 0;
57
+ var react_1 = __importStar(require("react"));
58
+ var Container_1 = require("../../../components/Container");
59
+ var Paddings_1 = require("../../../components/Paddings");
60
+ var themes_1 = require("../../../themes");
61
+ var icons_1 = require("../../../icons");
62
+ var DropdownMulti_1 = require("../../../v2/components/Dropdowns/DropdownMulti");
63
+ var DropdownSingle_1 = require("../../../v2/components/Dropdowns/DropdownSingle");
64
+ // import { faker } from '@faker-js/faker';
65
+ // const generateRandomCountry = () => ({
66
+ // display: faker.address.country(),
67
+ // value: faker.address.countryCode().toLowerCase(),
68
+ // });
69
+ // const generateDropdownOptions = (length) => {
70
+ // const dropdownOptions = [];
71
+ // for (let i = 0; i < length; i++) {
72
+ // dropdownOptions.push(generateRandomCountry());
73
+ // }
74
+ // return dropdownOptions;
75
+ // };
76
+ // const dropdownOptions2 = generateDropdownOptions(200);
77
+ var availableIcons = __spreadArray([undefined], Object.keys(icons_1.icons).sort(), true);
78
+ exports.default = {
79
+ title: "Oolib V 2.0/Components/Dropdowns",
80
+ argTypes: {
81
+ // label: {
82
+ // name: "Label",
83
+ // },
84
+ // sublabel: {
85
+ // name: "Sub Label",
86
+ // },
87
+ placeholder: {
88
+ name: "Placeholder Text",
89
+ },
90
+ optionIcon: {
91
+ options: availableIcons,
92
+ control: { type: "select" },
93
+ },
94
+ selection: {
95
+ options: ["single", "multi"],
96
+ control: { type: "inline-radio" },
97
+ },
98
+ size: {
99
+ name: "Size",
100
+ control: { type: "inline-radio" },
101
+ options: ["Small", "Medium"],
102
+ mapping: {
103
+ Small: "S",
104
+ Medium: "M",
105
+ },
106
+ },
107
+ selection: {
108
+ name: "Selection Type",
109
+ options: ["single", "multi"],
110
+ control: { type: "select" },
111
+ },
112
+ isSearchable: {
113
+ name: "Searchable",
114
+ },
115
+ showIconInSelectArea: {
116
+ name: "Show Icon in Select Area",
117
+ },
118
+ optionImage: {
119
+ name: "Option Image",
120
+ },
121
+ optionDescription: {
122
+ name: "Option Description",
123
+ },
124
+ colors: {
125
+ name: 'Show Colors'
126
+ },
127
+ disabled: {
128
+ name: "Disabled",
129
+ },
130
+ readOnly: {
131
+ name: "Read Only",
132
+ },
133
+ invert: {
134
+ name: "Invert",
135
+ },
136
+ showColorInSelectArea: {
137
+ name: "Show Color in Select Area"
138
+ },
139
+ alignDropdown: {
140
+ name: "Align Dropdown",
141
+ options: ["left", "right"],
142
+ control: { type: "select" }
143
+ },
144
+ },
145
+ args: {
146
+ // label: "This is a label",
147
+ // sublabel: "This is a sub label",
148
+ placeholder: "",
149
+ size: "Medium",
150
+ selection: "single",
151
+ isSearchable: false,
152
+ optionDescription: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
153
+ optionImage: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrVSkmNOQ6abMCc5e6R2r7VwRZDkBHFTyzAg&usqp=CAU",
154
+ optionIcon: undefined,
155
+ showIconInSelectArea: false,
156
+ colors: false,
157
+ showColorInSelectArea: false,
158
+ disabled: false,
159
+ readOnly: false,
160
+ invert: false,
161
+ popOutOfOverflowHiddenParent: false,
162
+ alignDropdown: "left",
163
+ }
164
+ };
165
+ var dropdownOptions = [
166
+ {
167
+ display: "Option with a slightly longer name",
168
+ value: "india",
169
+ color: themes_1.colors.lightRed,
170
+ // image: "xyz",
171
+ // icon: "Trash",
172
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
173
+ },
174
+ {
175
+ display: "Sri Lanka",
176
+ value: "sriLanka",
177
+ color: themes_1.colors.invertRed,
178
+ // image: "xyz",
179
+ // icon: "Trash",
180
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
181
+ },
182
+ {
183
+ display: "Japan",
184
+ value: "japan",
185
+ color: themes_1.colors.lightBlue
186
+ // image: "xyz",
187
+ // icon: "Trash",
188
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
189
+ },
190
+ {
191
+ display: "Germany",
192
+ value: "germany",
193
+ color: themes_1.colors.primaryColor100
194
+ // image: "xyz",
195
+ // icon: "Trash",
196
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
197
+ },
198
+ {
199
+ display: "USA",
200
+ value: "usa",
201
+ color: themes_1.colors.greyColor100
202
+ // image: "xyz",
203
+ // icon: "Trash",
204
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
205
+ },
206
+ {
207
+ display: "Columbia",
208
+ value: "columbia",
209
+ color: themes_1.colors.lightRed,
210
+ // image: "xyz",
211
+ // icon: "Trash",
212
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
213
+ },
214
+ {
215
+ display: "Brazil",
216
+ value: "brazil",
217
+ color: themes_1.colors.invertRed,
218
+ // image: "xyz",
219
+ // icon: "Trash",
220
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
221
+ },
222
+ {
223
+ display: "Australia",
224
+ value: "australia",
225
+ color: themes_1.colors.lightBlue
226
+ // image: "xyz",
227
+ // icon: "Trash",
228
+ // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
229
+ },
230
+ ];
231
+ var Dropdowns = function (args) {
232
+ var _a = (0, react_1.useState)({
233
+ single: undefined,
234
+ multi: undefined,
235
+ }), val = _a[0], setVal = _a[1];
236
+ var _b = (0, react_1.useState)([]), options = _b[0], setOptions = _b[1];
237
+ (0, react_1.useEffect)(function () {
238
+ var delayOptions = setTimeout(function () {
239
+ var newOptions = dropdownOptions.map(function (op) { return (__assign(__assign({}, op), { desc: args.optionDescription, icon: !args.optionImage && args.optionIcon, image: args.optionImage && [{ publicUrl: args.optionImage }], color: args.colors && op.color })); });
240
+ setOptions(newOptions);
241
+ }, 2000);
242
+ // Cleanup the timeout on component unmount
243
+ return function () { return clearTimeout(delayOptions); };
244
+ }, [args.optionDescription, args.optionImage, args.optionIcon, args.colors]);
245
+ var Comp = args.selection === "single" ? DropdownSingle_1.DropdownSingle : DropdownMulti_1.DropdownMulti;
246
+ return (react_1.default.createElement("div", { style: { background: args.invert && themes_1.colors.greyColor100 } },
247
+ react_1.default.createElement(Container_1.Container, null,
248
+ react_1.default.createElement(Paddings_1.PaddingTopBottom40, null,
249
+ react_1.default.createElement(Comp, __assign({ key: args.selection }, args, { S: args.size == "S", options: dropdownOptions.map(function (op) { return (__assign(__assign({}, op), { desc: args.optionDescription, icon: !args.optionImage && args.optionIcon, image: args.optionImage && [{ publicUrl: args.optionImage }], color: args.colors && op.color })); }), value: val[args.selection], onChange: function (k, v) {
250
+ return setVal(function (prev) {
251
+ var _a;
252
+ return (__assign(__assign({}, prev), (_a = {}, _a[args.selection] = v, _a)));
253
+ });
254
+ }, selectConfig: args.showIconInSelectArea ? ["display", "icon"] : args.showColorInSelectArea ? ["display", "color"] : ["display"], label: "Dropdown Component", sublabel: "Select single or multiple options in dropdown based on Selection Type", popOutOfOverflowHiddenParent: args.popOutOfOverflowHiddenParent }))),
255
+ react_1.default.createElement("div", { style: { height: '1000px', background: 'red' } }))));
256
+ };
257
+ exports.Dropdowns = Dropdowns;
258
+ // export const Button_Primary = (args) => (
259
+ // <GenButtonStory args={args} Comp={ButtonPrimary} />
260
+ // )
261
+ // Button_Primary.parameters = { controls: { exclude: ['variant', 'color'] } }
262
+ // export const Button_Secondary = (args) => (
263
+ // <GenButtonStory args={args} Comp={ButtonSecondary} />
264
+ // )
265
+ // Button_Secondary.parameters = { controls: { exclude: ['variant', 'color'] } }
266
+ // Button_Secondary.args = {
267
+ // active: false,
268
+ // }
269
+ // export const Button_Ghost = (args) => (
270
+ // <GenButtonStory args={args} Comp={ButtonGhost} />
271
+ // )
272
+ // Button_Ghost.args = {
273
+ // active: false,
274
+ // }
275
+ // Button_Ghost.parameters = { controls: { exclude: ['variant'] } }
276
+ // export const Button_Custom = (args) => (
277
+ // <GenButtonStory args={args} Comp={ButtonCustom} />
278
+ // )
279
+ // Button_Custom.parameters = { controls: { exclude: ['variant', 'color'] } }
280
+ // export const Google_Login = (args) => (
281
+ // <GenButtonStory args={args} Comp={GoogleLogin} />
282
+ // )
283
+ // Google_Login.parameters = {
284
+ // controls: { exclude: ['variant', 'color', 'iconOnly', 'icon + text'] },
285
+ // }
286
+ // export const Upload_Button = (args) => (
287
+ // <GenButtonStory args={{ ...args, children: 'Upload' }} Comp={UploadButton} />
288
+ // )
289
+ // Upload_Button.parameters = { controls: { exclude: ['color'] } }
@@ -0,0 +1,8 @@
1
+ export declare const useStyleUpdateAfterToggleTransition: ({ styleOptions, initStyle: _initStyle, toggleState, transitionDuration }: {
2
+ styleOptions: any;
3
+ initStyle: any;
4
+ toggleState: any;
5
+ transitionDuration: any;
6
+ }) => {
7
+ style: any;
8
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStyleUpdateAfterToggleTransition = void 0;
4
+ var react_1 = require("react");
5
+ var useStyleUpdateAfterToggleTransition = function (_a) {
6
+ var styleOptions = _a.styleOptions, // ['hidden', 'visible']
7
+ _initStyle = _a.initStyle, //hidden
8
+ toggleState = _a.toggleState, //isExpanded
9
+ transitionDuration = _a.transitionDuration //300
10
+ ;
11
+ var initStyle = (0, react_1.useRef)(_initStyle);
12
+ //helps to make the accordionOverflow visible once its open,
13
+ //for scenarios where a data viz tooltip needs to stick out
14
+ var _b = (0, react_1.useState)(initStyle.current), style = _b[0], setStyle = _b[1];
15
+ (0, react_1.useEffect)(function () {
16
+ var timeoutId;
17
+ if (toggleState) {
18
+ // Set timeout for making content visible after animation
19
+ timeoutId = setTimeout(function () {
20
+ // Double check if still expanded before setting to visible
21
+ if (toggleState) {
22
+ setStyle(styleOptions.find(function (op) { return op !== initStyle.current; }));
23
+ }
24
+ }, transitionDuration);
25
+ }
26
+ else {
27
+ // Immediately set to hidden when closing
28
+ setStyle(initStyle.current);
29
+ }
30
+ // Cleanup function to clear timeout if component updates/unmounts
31
+ return function () {
32
+ if (timeoutId) {
33
+ clearTimeout(timeoutId);
34
+ }
35
+ };
36
+ }, [toggleState, transitionDuration]);
37
+ return ({
38
+ style: style
39
+ });
40
+ };
41
+ exports.useStyleUpdateAfterToggleTransition = useStyleUpdateAfterToggleTransition;
@@ -48,6 +48,7 @@ var ActionMenu_1 = require("../../../components/ActionMenu");
48
48
  var phosphor_react_1 = require("phosphor-react");
49
49
  var mixins_1 = require("../../../themes/mixins");
50
50
  var Typo2_1 = require("../Typo2");
51
+ var useStyleUpdateAfterToggleTransition_1 = require("../../../utils/useStyleUpdateAfterToggleTransition");
51
52
  var StyledContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 0.8rem;\n border: 1px solid ", ";\n background: #ffffff;\n box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.06);\n"], ["\n border-radius: 0.8rem;\n border: 1px solid ", ";\n background: #ffffff;\n box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.06);\n"])), colors_1.colors.grey10);
52
53
  var StyledHeader = styled_components_1.default.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n padding: 1rem 1.6rem;\n text-align: left;\n background: none;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n"], ["\n width: 100%;\n padding: 1rem 1.6rem;\n text-align: left;\n background: none;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n"])));
53
54
  var StyledRightHeaderSection = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
@@ -104,31 +105,12 @@ var Accordion = function (_a) {
104
105
  var _d = (0, react_1.useState)(defaultExpanded), isExpanded = _d[0], setIsExpanded = _d[1];
105
106
  var _e = useCalculateWrapperHeight({ isExpanded: isExpanded }), wrapperRef = _e.wrapperRef, wrapperHeight = _e.wrapperHeight;
106
107
  var expandAnimationDuration = 300;
107
- //helps to make the accordionOverflow visible once its open,
108
- //for scenarios where a data viz tooltip needs to stick out
109
- var _f = (0, react_1.useState)("hidden"), accordionOverflow = _f[0], setAccordionOverflow = _f[1];
110
- (0, react_1.useEffect)(function () {
111
- var timeoutId;
112
- if (isExpanded) {
113
- // Set timeout for making content visible after animation
114
- timeoutId = setTimeout(function () {
115
- // Double check if still expanded before setting to visible
116
- if (isExpanded) {
117
- setAccordionOverflow("visible");
118
- }
119
- }, expandAnimationDuration);
120
- }
121
- else {
122
- // Immediately set to hidden when closing
123
- setAccordionOverflow("hidden");
124
- }
125
- // Cleanup function to clear timeout if component updates/unmounts
126
- return function () {
127
- if (timeoutId) {
128
- clearTimeout(timeoutId);
129
- }
130
- };
131
- }, [isExpanded, expandAnimationDuration]);
108
+ var accordionOverflow = (0, useStyleUpdateAfterToggleTransition_1.useStyleUpdateAfterToggleTransition)({
109
+ styleOptions: ['hidden', 'visible'],
110
+ initStyle: 'hidden',
111
+ toggleState: isExpanded,
112
+ transitionDuration: expandAnimationDuration
113
+ }).style;
132
114
  return (react_1.default.createElement(StyledContainer, null,
133
115
  react_1.default.createElement(StyledHeader, { onClick: function () { return setIsExpanded(!isExpanded); } },
134
116
  react_1.default.createElement("div", { style: { flex: "1 0 0" } },
@@ -0,0 +1,38 @@
1
+ export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChange: parentOnChange, className, readOnly, invert, selectClassName, optionsClassName, selectStyleOverride, optionsFn, options: optionsProp, isTagsStyle, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, label, optionsModalLabel, genCreateTagButton, placeholder, genCustomSelectComp, disableSelectTextUpdate, selectConfig, lightboxHeight, lightboxStyle, optionsAnchor, popOutOfOverflowHiddenParent, S, disabled, broadcastShowOptions, tagColor, searchbarPlaceholder, alignDropdown }: {
2
+ saveValueAsString: any;
3
+ value: any;
4
+ id: any;
5
+ onChange: any;
6
+ className: any;
7
+ readOnly: any;
8
+ invert: any;
9
+ selectClassName: any;
10
+ optionsClassName: any;
11
+ selectStyleOverride: any;
12
+ optionsFn: any;
13
+ options: any;
14
+ isTagsStyle: any;
15
+ isSearchable: any;
16
+ searchFieldsConfig: any;
17
+ setFilteredOptions: any;
18
+ setSearchString: any;
19
+ searchString: any;
20
+ label: any;
21
+ optionsModalLabel: any;
22
+ genCreateTagButton: any;
23
+ placeholder: any;
24
+ genCustomSelectComp: any;
25
+ disableSelectTextUpdate: any;
26
+ selectConfig: any;
27
+ lightboxHeight: any;
28
+ lightboxStyle: any;
29
+ optionsAnchor: any;
30
+ popOutOfOverflowHiddenParent: any;
31
+ S: any;
32
+ disabled: any;
33
+ broadcastShowOptions: any;
34
+ tagColor: any;
35
+ searchbarPlaceholder: any;
36
+ alignDropdown?: string;
37
+ }, ...args: any[]): React.JSX.Element;
38
+ import React from "react";