pixel-react 1.5.7 → 1.5.9

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 (47) hide show
  1. package/.storybook/main.ts +1 -7
  2. package/.storybook/preview-head.html +3 -0
  3. package/index.scss +5 -0
  4. package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +1 -1
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.d.ts +2 -2
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +17 -1
  7. package/lib/components/Excel/Types.d.ts +22 -1
  8. package/lib/components/Excel/dataConversion.d.ts +3 -0
  9. package/lib/components/LabelEditTextField/types.d.ts +5 -0
  10. package/lib/components/MiniModal/types.d.ts +9 -0
  11. package/lib/index.d.ts +15 -1
  12. package/lib/index.esm.js +381 -119
  13. package/lib/index.esm.js.map +1 -1
  14. package/lib/index.js +381 -119
  15. package/lib/index.js.map +1 -1
  16. package/lib/tsconfig.tsbuildinfo +1 -1
  17. package/package.json +1 -2
  18. package/src/assets/icons/license_info.svg +12 -12
  19. package/src/components/EditTextField/EditTextField.stories.tsx +1 -1
  20. package/src/components/Excel/ExcelFile/ExcelFile.tsx +60 -5
  21. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +39 -39
  22. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +34 -28
  23. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +0 -29
  24. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +29 -0
  25. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +33 -0
  26. package/src/components/Excel/ExcelFile.stories.tsx +77 -67
  27. package/src/components/Excel/Types.ts +23 -1
  28. package/src/components/Excel/dataConversion.ts +173 -0
  29. package/src/components/LabelEditTextField/LabelEditTextField.scss +1 -0
  30. package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +11 -15
  31. package/src/components/LabelEditTextField/LabelEditTextField.tsx +44 -13
  32. package/src/components/LabelEditTextField/types.ts +5 -0
  33. package/src/components/MiniModal/MiniModal.scss +9 -5
  34. package/src/components/MiniModal/MiniModal.stories.tsx +28 -1
  35. package/src/components/MiniModal/MiniModal.tsx +110 -74
  36. package/src/components/MiniModal/types.ts +9 -0
  37. package/src/components/MultiSelect/MultiSelect.stories.tsx +1 -1
  38. package/src/components/MultiSelect/MultiSelect.tsx +11 -8
  39. package/src/components/Typography/Typography.scss +1 -36
  40. package/src/assets/fonts/Poppins-Bold.ttf +0 -0
  41. package/src/assets/fonts/Poppins-Bold.woff2 +0 -0
  42. package/src/assets/fonts/Poppins-Medium.ttf +0 -0
  43. package/src/assets/fonts/Poppins-Medium.woff2 +0 -0
  44. package/src/assets/fonts/Poppins-Regular.ttf +0 -0
  45. package/src/assets/fonts/Poppins-Regular.woff2 +0 -0
  46. package/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
  47. package/src/assets/fonts/Poppins-SemiBold.woff2 +0 -0
@@ -4,6 +4,7 @@ import { LabelEditTextFieldTypes } from './types';
4
4
  import Typography from '../Typography';
5
5
  import HighlightText from '../HighlightText';
6
6
  import Icon from '../Icon';
7
+ import Tooltip from '../Tooltip';
7
8
 
8
9
  const getErrorMessage = (
9
10
  inputValue: string,
@@ -32,10 +33,12 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
32
33
  cancelIcon,
33
34
  variant = 'textField',
34
35
  dropdownData = [],
35
- width = '300px',
36
+ width,
36
37
  height = '22px',
37
38
  isOpen = false,
38
39
  confirmAction,
40
+ onClick,
41
+ tooltip,
39
42
  }) => {
40
43
  const [isEditing, setIsEditing] = useState(isOpen ?? false);
41
44
  const [inputValue, setInputValue] = useState(text);
@@ -47,12 +50,38 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
47
50
  const [isDropdownModified, setIsDropdownModified] = useState(false);
48
51
  const containerRef = useRef<HTMLDivElement | null>(null);
49
52
  const cancelRef = useRef<HTMLDivElement | null>(null); // New ref for cancel icon
50
-
53
+ const [clickTimeout, setClickTimeout] = useState<number | null>(null);
54
+ useEffect(() => {
55
+ return () => {
56
+ if (clickTimeout) {
57
+ clearTimeout(clickTimeout);
58
+ }
59
+ };
60
+ }, [clickTimeout]);
51
61
  const handleDoubleClick = () => {
62
+ if (clickTimeout) {
63
+ clearTimeout(clickTimeout);
64
+ setClickTimeout(null);
65
+ }
52
66
  setIsEditing(true);
53
67
  setShowError('');
54
68
  };
69
+ const handleSingleClick = () => {
70
+ if (onClick) onClick();
71
+ };
72
+ const handleClick = () => {
73
+ if (clickTimeout) {
74
+ clearTimeout(clickTimeout);
75
+ setClickTimeout(null);
76
+ }
55
77
 
78
+ const timeout = window.setTimeout(() => {
79
+ handleSingleClick();
80
+ setClickTimeout(null);
81
+ }, 1000);
82
+
83
+ setClickTimeout(timeout);
84
+ };
56
85
  const handleConfirm = () => {
57
86
  const errorMessage = getErrorMessage(
58
87
  inputValue,
@@ -116,11 +145,7 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
116
145
  }, [inputValue]);
117
146
 
118
147
  return (
119
- <div
120
- className="ff-label-edit-text-field"
121
- ref={containerRef}
122
- style={{ width }}
123
- >
148
+ <div className="ff-label-edit-text-field" ref={containerRef}>
124
149
  {isEditing ? (
125
150
  <div className="ff-label-text-field">
126
151
  {variant === 'textFieldWithDropdown' ? (
@@ -195,13 +220,19 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
195
220
  </div>
196
221
  </div>
197
222
  ) : (
198
- <span
199
- className="display-text"
200
- onDoubleClick={handleDoubleClick}
201
- role="button"
223
+ <Tooltip
224
+ title={tooltip?.tooltipTitle ? tooltip?.tooltipTitle : ''}
225
+ placement={'bottom'}
202
226
  >
203
- <HighlightText text={inputValue} highlight={highlightText} />
204
- </span>
227
+ <span
228
+ className="display-text"
229
+ onDoubleClick={handleDoubleClick}
230
+ role="button"
231
+ onClick={handleClick}
232
+ >
233
+ <HighlightText text={inputValue} highlight={highlightText} />
234
+ </span>
235
+ </Tooltip>
205
236
  )}
206
237
  {showError && isEditing && (
207
238
  <Typography as="p" fontSize={8} className="error-text">
@@ -38,4 +38,9 @@ export interface LabelEditTextFieldTypes {
38
38
  isOpen?: boolean;
39
39
  /**for conditionally handle custom error */
40
40
  customErrorCondition?: boolean;
41
+ onClick?: () => void;
42
+ tooltip?: {
43
+ tooltipTitle?: string;
44
+ tooltipPlacement?: string;
45
+ };
41
46
  }
@@ -8,6 +8,12 @@
8
8
  top: $top;
9
9
  left: $left;
10
10
  }
11
+ .ff-mini-modal-overlay {
12
+ position: fixed;
13
+ inset: 0;
14
+ width: 100vw;
15
+ height: 100vh;
16
+ }
11
17
  .ff-mini-edit-modal-container {
12
18
  width: fit-content;
13
19
  padding: 0;
@@ -17,9 +23,7 @@
17
23
  visibility: visible;
18
24
  }
19
25
  &.animatedModal {
20
- animation:
21
- slideDown 0.5s ease,
22
- opacity 0.5s ease;
26
+ animation: slideDown 0.5s ease, opacity 0.5s ease;
23
27
  }
24
28
 
25
29
  .popover-arrow {
@@ -91,7 +95,7 @@
91
95
  position: absolute;
92
96
  top: -34px;
93
97
  border-radius: 7px 7px 0 0;
94
- box-shadow: 0px -3px 4px 0px var(--ff-mini-modal-box-shadow);
98
+
95
99
  &::before,
96
100
  &::after {
97
101
  position: absolute;
@@ -121,7 +125,7 @@
121
125
  width: 100%;
122
126
  margin: 0 0 0 -5px;
123
127
  height: 100%;
124
- box-shadow: 0px 4px 8px var(--ff-mini-modal-arrow-shadow);
128
+
125
129
  &.mini-edit-modal-wrapper-shadow {
126
130
  box-shadow: 0px 0px 4px 0px var(--ff-mini-modal-box-shadow);
127
131
  }
@@ -51,6 +51,10 @@ const BasicModalComponent = () => {
51
51
  {currentModal === 1 && (
52
52
  <MiniModal
53
53
  anchorRef="112233"
54
+ overlay={{
55
+ isOverlay: true,
56
+ zIndexOverlay: 99,
57
+ }}
54
58
  modalProperties={{ width: 300, height: 180 }}
55
59
  headerProps={
56
60
  <>
@@ -263,7 +267,12 @@ export const CustomModalWithArrow = () => {
263
267
  {currentModal === 1 && (
264
268
  <MiniModal
265
269
  anchorRef="1a2b"
270
+ overlay={{
271
+ isOverlay: true,
272
+ zIndexOverlay: 99,
273
+ }}
266
274
  modalProperties={{ width: 300, height: 250 }}
275
+ arrowZIndex={1000}
267
276
  headerProps={
268
277
  <>
269
278
  <Typography as="p">Modal 1</Typography>
@@ -287,6 +296,7 @@ export const CustomModalWithArrow = () => {
287
296
  text: 'Cancel',
288
297
  onClick: handleCancel,
289
298
  }}
299
+ outSideClick={handleCancel}
290
300
  proceedButtonProps={{
291
301
  text: 'Proceed',
292
302
  onClick: () => {},
@@ -326,6 +336,7 @@ export const CustomModalWithArrow = () => {
326
336
  text: 'Cancel',
327
337
  onClick: handleCancel,
328
338
  }}
339
+ outSideClick={handleCancel}
329
340
  proceedButtonProps={{
330
341
  text: 'Proceed',
331
342
  onClick: () => {},
@@ -368,6 +379,7 @@ export const CustomModalWithArrow = () => {
368
379
  text: 'Cancel',
369
380
  onClick: handleCancel,
370
381
  }}
382
+ outSideClick={handleCancel}
371
383
  proceedButtonProps={{
372
384
  text: 'Proceed',
373
385
  onClick: () => {},
@@ -408,6 +420,7 @@ export const CustomModalWithArrow = () => {
408
420
  text: 'Cancel',
409
421
  onClick: handleCancel,
410
422
  }}
423
+ outSideClick={handleCancel}
411
424
  proceedButtonProps={{
412
425
  text: 'Proceed',
413
426
  onClick: () => {},
@@ -451,6 +464,7 @@ export const CustomModalWithArrow = () => {
451
464
  <button onClick={handleCancel}>Cancel</button>
452
465
  </>
453
466
  }
467
+ outSideClick={handleCancel}
454
468
  cancelButtonProps={{
455
469
  text: 'Cancel',
456
470
  onClick: handleCancel,
@@ -492,6 +506,11 @@ export const CustomModalWithWrapper = () => {
492
506
  {currentModal === 1 && (
493
507
  <MiniModal
494
508
  anchorRef={btnRef1}
509
+ overlay={{
510
+ isOverlay: true,
511
+ zIndexOverlay: 99,
512
+ backgroundColorOverlay: 'var(--pop-up-background-blur)',
513
+ }}
495
514
  modalProperties={{ width: 487, height: 180 }}
496
515
  headerProps={
497
516
  <>
@@ -506,6 +525,7 @@ export const CustomModalWithWrapper = () => {
506
525
  </Typography>
507
526
  </>
508
527
  }
528
+ outSideClick={handleCancel}
509
529
  cancelButtonProps={{
510
530
  text: 'Cancel',
511
531
  onClick: handleCancel,
@@ -551,6 +571,7 @@ export const CustomModalWithWrapper = () => {
551
571
  text: 'Export',
552
572
  onClick: () => {},
553
573
  }}
574
+ outSideClick={handleCancel}
554
575
  isWrapped={true}
555
576
  isAnimated={false}
556
577
  firstAnchorRef={btnRef1}
@@ -575,8 +596,9 @@ export const CustomModalWithWrapper = () => {
575
596
  height: 210,
576
597
  borderRadius: 0,
577
598
  zIndex: 3,
599
+ boxShadow: 'none',
578
600
  }}
579
- wrapperProperties={{ width: 30, zIndex: 4 }}
601
+ wrapperProperties={{ width: 30, zIndex: 4, boxShadow: 'none' }}
580
602
  headerProps={
581
603
  <>
582
604
  <Typography as="p">Delete Selected Scripts</Typography>
@@ -600,6 +622,7 @@ export const CustomModalWithWrapper = () => {
600
622
  }}
601
623
  isWrapped={true}
602
624
  isAnimated={true}
625
+ outSideClick={handleCancel}
603
626
  firstAnchorRef={btnRef1}
604
627
  anchorRefLeftNum={225}
605
628
  anchorLeftDistanceForWrapper={170}
@@ -630,6 +653,10 @@ export const normalModalFollowedByIcon = () => {
630
653
  <MiniModal
631
654
  anchorRef={iconRef1}
632
655
  modalProperties={{ width: 168, height: 108 }}
656
+ overlay={{
657
+ isOverlay: true,
658
+ zIndexOverlay: 99,
659
+ }}
633
660
  childContent={
634
661
  <>
635
662
  <Typography as="p">
@@ -31,6 +31,9 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
31
31
  extraLeftSpace,
32
32
  isIconModel,
33
33
  wrapperProperties,
34
+ arrowZIndex,
35
+ overlay,
36
+ outSideClick,
34
37
  },
35
38
  ref
36
39
  ) => {
@@ -127,9 +130,13 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
127
130
  } else if (modalPosition === 'right') {
128
131
  return leftTopArrow
129
132
  ? modalPositionState.top - (extraRightSpace?.leftTopArrow ?? 30)
130
- : modalPositionState?.top - safeHeight / (extraRightSpace?.middleLeftArrow ?? 3.5);
133
+ : modalPositionState?.top -
134
+ safeHeight / (extraRightSpace?.middleLeftArrow ?? 3.5);
131
135
  } else if (modalPosition === 'top') {
132
- return modalPositionState.top - (safeHeight + (extraTopSpace?.normalModal ?? 10));
136
+ return (
137
+ modalPositionState.top -
138
+ (safeHeight + (extraTopSpace?.normalModal ?? 10))
139
+ );
133
140
  }
134
141
  return modalPositionState.top - safeHeight / 1.5;
135
142
  };
@@ -138,7 +145,9 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
138
145
  // Specifying the modal left
139
146
  const calculateModalLeft = () => {
140
147
  if (modalPosition === 'right') {
141
- return modalPositionState.left + (extraLeftSpace?.rightAlignModal ?? 40);
148
+ return (
149
+ modalPositionState.left + (extraLeftSpace?.rightAlignModal ?? 40)
150
+ );
142
151
  } else if (firstAnchorRef) {
143
152
  return firstAnchor;
144
153
  } else if (modalPosition === 'left') {
@@ -152,9 +161,9 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
152
161
  // Handle escape and enter functionality
153
162
  const handleEsc = useEscapeKey('Escape');
154
163
  const handleEnter = useEscapeKey('Enter');
155
- handleEsc(cancelButtonProps?.onClick);
164
+ handleEsc(outSideClick);
156
165
  handleEnter(proceedButtonProps?.onClick);
157
- useClickOutside(modalRef, cancelButtonProps.onClick);
166
+ useClickOutside(modalRef, outSideClick);
158
167
 
159
168
  // Calculate the modal position
160
169
  const calculatePosition = useCallback(() => {
@@ -192,96 +201,123 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
192
201
  height: modalHeight,
193
202
  borderRadius: modalBorderRadius = 4,
194
203
  zIndex: modalZIndex = 99,
204
+ boxShadow: modalBoxShadow,
195
205
  } = modalProperties || {};
196
206
 
197
- const { width: wrapperWidth = 35, zIndex: wrapperZIndex = 101 } =
198
- wrapperProperties || {};
207
+ const {
208
+ width: wrapperWidth = 35,
209
+ zIndex: wrapperZIndex = 101,
210
+ boxShadow: wrapperBoxShadow,
211
+ } = wrapperProperties || {};
212
+ const { isOverlay, backgroundColorOverlay, zIndexOverlay } = overlay || {};
199
213
 
200
214
  if (isWrapped && isPopOver) {
201
215
  return null;
202
216
  }
203
217
 
204
218
  return createPortal(
205
- <div
206
- ref={ref || modalRef}
207
- className={classNames('ff-mini-edit-modal-container', {
208
- modalVisible: isVisible,
209
- animatedModal: isAnimated,
210
- })}
211
- style={{
212
- top: `${calculatedModalTop}px`,
213
- left: `${calculatedModalLeft}px`,
214
- }}
215
- >
216
- {isPopOver && (
217
- <div
218
- className={`popover-arrow popover-arrow-${
219
- modalPosition === 'right'
220
- ? 'left'
221
- : modalPosition === 'top'
222
- ? 'bottom'
223
- : modalPosition === 'left'
224
- ? 'right'
225
- : 'top'
226
- } ${getArrowClassName()}`}
227
- />
228
- )}
229
- {isWrapped && (
219
+ <>
220
+ {isOverlay && (
230
221
  <div
231
- className={'wrapped-div'}
222
+ className={classNames('ff-mini-modal-overlay')}
232
223
  style={{
233
- left: `${calculatedAnchorRefLeft}px`,
234
- width: `${wrapperWidth}px`,
235
- zIndex: `${wrapperZIndex}`,
224
+ zIndex: zIndexOverlay ?? 98,
225
+ backgroundColor: backgroundColorOverlay ?? 'transparent',
236
226
  }}
227
+ onClick={cancelButtonProps?.onClick}
237
228
  ></div>
238
229
  )}
239
230
  <div
240
- className={classNames('mini-edit-modal', {
241
- 'mini-edit-modal-wrapper-shadow': !!isWrapped,
242
- 'mini-edit-modal-arrow-shadow': !!isPopOver,
231
+ ref={ref || modalRef}
232
+ className={classNames('ff-mini-edit-modal-container', {
233
+ modalVisible: isVisible,
234
+ animatedModal: isAnimated,
243
235
  })}
244
236
  style={{
245
- minWidth: isWrapped ? '358px' : '',
246
- width: `${modalWidth}px`,
247
- height: `${modalHeight}px`,
248
- borderRadius: `${modalBorderRadius}px`,
249
- zIndex: `${modalZIndex}`,
237
+ top: `${calculatedModalTop}px`,
238
+ left: `${calculatedModalLeft}px`,
250
239
  }}
251
240
  >
252
- {headerProps ? (
253
- <Typography as="div">{headerProps}</Typography>
254
- ) : isIconModel ? (
255
- <></>
256
- ) : (
257
- <Typography as="header">
258
- <Typography as="h2">Header text</Typography>
259
- <hr />
260
- </Typography>
241
+ {isPopOver && (
242
+ <div
243
+ className={`popover-arrow popover-arrow-${
244
+ modalPosition === 'right'
245
+ ? 'left'
246
+ : modalPosition === 'top'
247
+ ? 'bottom'
248
+ : modalPosition === 'left'
249
+ ? 'right'
250
+ : 'top'
251
+ } ${getArrowClassName()}`}
252
+ style={{
253
+ zIndex: `${arrowZIndex}`,
254
+ }}
255
+ />
261
256
  )}
262
- <div>{childContent}</div>
263
- {footerContent ? (
264
- <Typography as="footer">{footerContent}</Typography>
265
- ) : isIconModel ? (
266
- <></>
267
- ) : (
268
- <footer className="modal-footer">
269
- <Button
270
- variant="primary"
271
- className="btn-cancel"
272
- onClick={cancelButtonProps?.onClick}
273
- label={cancelButtonProps?.text}
274
- />
275
- <Button
276
- variant="secondary"
277
- className="btn-proceed"
278
- label={proceedButtonProps?.text}
279
- onClick={proceedButtonProps?.onClick}
280
- />
281
- </footer>
257
+ {isWrapped && (
258
+ <div
259
+ className={'wrapped-div'}
260
+ style={{
261
+ left: `${calculatedAnchorRefLeft}px`,
262
+ width: `${wrapperWidth}px`,
263
+ zIndex: `${wrapperZIndex}`,
264
+ boxShadow:
265
+ wrapperBoxShadow ??
266
+ `0px -3px 4px 0px var(--ff-mini-modal-box-shadow)`,
267
+ }}
268
+ ></div>
282
269
  )}
270
+ <div
271
+ className={classNames('mini-edit-modal', {
272
+ 'mini-edit-modal-wrapper-shadow': !!isWrapped && !modalBoxShadow,
273
+ 'mini-edit-modal-arrow-shadow': !!isPopOver && !modalBoxShadow,
274
+ })}
275
+ style={{
276
+ minWidth: isWrapped ? '358px' : '',
277
+ width: `${modalWidth}px`,
278
+ height: `${modalHeight}px`,
279
+ borderRadius: `${modalBorderRadius}px`,
280
+ zIndex: `${modalZIndex}`,
281
+ boxShadow: `${
282
+ modalBoxShadow ??
283
+ '0px 4px 8px var(--ff-mini-modal-arrow-shadow)'
284
+ }`,
285
+ }}
286
+ >
287
+ {headerProps ? (
288
+ <Typography as="div">{headerProps}</Typography>
289
+ ) : isIconModel ? (
290
+ <></>
291
+ ) : (
292
+ <Typography as="header">
293
+ <Typography as="h2">Header text</Typography>
294
+ <hr />
295
+ </Typography>
296
+ )}
297
+ <div>{childContent}</div>
298
+ {footerContent ? (
299
+ <Typography as="footer">{footerContent}</Typography>
300
+ ) : isIconModel ? (
301
+ <></>
302
+ ) : (
303
+ <footer className="modal-footer">
304
+ <Button
305
+ variant="primary"
306
+ className="btn-cancel"
307
+ onClick={cancelButtonProps?.onClick}
308
+ label={cancelButtonProps?.text}
309
+ />
310
+ <Button
311
+ variant="secondary"
312
+ className="btn-proceed"
313
+ label={proceedButtonProps?.text}
314
+ onClick={proceedButtonProps?.onClick}
315
+ />
316
+ </footer>
317
+ )}
318
+ </div>
283
319
  </div>
284
- </div>,
320
+ </>,
285
321
  document.body
286
322
  );
287
323
  }
@@ -4,6 +4,7 @@ interface ModalDimensions {
4
4
  height?: number;
5
5
  borderRadius?: number;
6
6
  zIndex?: number;
7
+ boxShadow?: string;
7
8
  }
8
9
  export interface MiniEditModalProps {
9
10
  /**
@@ -90,7 +91,15 @@ export interface MiniEditModalProps {
90
91
  wrapperProperties?: {
91
92
  width?: number;
92
93
  zIndex?: number;
94
+ boxShadow?: string;
93
95
  };
96
+ arrowZIndex?: number;
97
+ overlay?: {
98
+ isOverlay?: boolean;
99
+ zIndexOverlay?: number;
100
+ backgroundColorOverlay?: string;
101
+ };
102
+ outSideClick?: any;
94
103
  }
95
104
  export interface Rect {
96
105
  top: number;
@@ -130,7 +130,7 @@ export const Controlled: Story = {
130
130
  const [options, setOptions] = useState<Option[]>([]);
131
131
  const [selectedOptions, setSelectedOptions] = useState<
132
132
  { label?: string; value?: string }[]
133
- >([{ label: 'Apple', value: 'apple' }]);
133
+ >([]);
134
134
  const onChange = (options: { label?: string; value?: string }[]) => {
135
135
  setSelectedOptions(options);
136
136
  };
@@ -265,15 +265,18 @@ const MultiSelect = ({
265
265
  };
266
266
  }, [isOpen]);
267
267
  useEffect(() => {
268
- if (options?.length > 0 && selectedOptions?.length) {
269
- const initializeOptions = options.map((option) => ({
270
- ...option,
271
- isChecked: selectedOptions.some(
272
- (selectedOption) =>
273
- getValue(selectedOption, valueAccessor) ===
268
+ if (!checkEmpty(options?.length)) {
269
+ let initializeOptions=options;
270
+ if(!checkEmpty(selectedOptions?.length)){
271
+ initializeOptions = options.map((option) => ({
272
+ ...option,
273
+ isChecked: selectedOptions.some(
274
+ (selectedOption) =>
275
+ getValue(selectedOption, valueAccessor) ===
274
276
  getValue(option, valueAccessor)
275
- ),
276
- }));
277
+ ),
278
+ }));
279
+ }
277
280
  setAllOptions(initializeOptions);
278
281
  }
279
282
  }, [options, selectedOptions]);
@@ -1,43 +1,8 @@
1
1
  @mixin fontPoppins($size: 16px) {
2
- font-family: 'Poppins';
2
+ font-family: 'Poppins', sans-serif;
3
3
  font-size: $size;
4
4
  }
5
5
 
6
- /* poppins-latin-400-normal */
7
- @font-face {
8
- font-family: 'Poppins';
9
- font-style: normal;
10
- font-display: swap;
11
- font-weight: 400;
12
- src: url(@fontsource/poppins/files/poppins-latin-400-normal.woff2) format('woff2'), url(@fontsource/poppins/files/poppins-latin-400-normal.woff) format('woff');
13
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
14
- }
15
-
16
-
17
- // @font-face {
18
- // font-family: 'Poppins';
19
- // font-weight: 500;
20
- // src:
21
- // local('Poppins-Medium'),
22
- // url(../../assets/fonts/Poppins-Medium.woff2) format('woff2');
23
- // }
24
-
25
- // @font-face {
26
- // font-family: 'Poppins';
27
- // font-weight: 600;
28
- // src:
29
- // local('Poppins-SemiBold'),
30
- // url(../../assets/fonts/Poppins-SemiBold.woff2) format('woff2');
31
- // }
32
-
33
- // @font-face {
34
- // font-family: 'Poppins';
35
- // font-weight: 700;
36
- // src:
37
- // local('Poppins-Bold'),
38
- // url(../../assets/fonts/Poppins-Bold.woff2) format('woff2');
39
- // }
40
-
41
6
  .ff-text {
42
7
  @include fontPoppins();
43
8
 
Binary file
Binary file
Binary file