pixel-react 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
  3. package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
  4. package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
  5. package/lib/components/AddButton/AddButton.d.ts +5 -0
  6. package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
  7. package/lib/components/AddButton/index.d.ts +1 -0
  8. package/lib/components/AddButton/types.d.ts +4 -0
  9. package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
  10. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +1 -1
  11. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +7 -0
  12. package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
  13. package/lib/components/AppHeader/AppHeader.stories.d.ts +7 -0
  14. package/lib/components/AppHeader/types.d.ts +1 -0
  15. package/lib/components/AttachImage/AttachImage.stories.d.ts +7 -0
  16. package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
  17. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  18. package/lib/components/Button/Button.stories.d.ts +13 -0
  19. package/lib/components/Charts/BarChart/BarChart.stories.d.ts +6 -0
  20. package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +7 -0
  21. package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
  22. package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +8 -0
  23. package/lib/components/Charts/LineChart/LineChart.stories.d.ts +7 -0
  24. package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +8 -0
  25. package/lib/components/Charts/PieChart/PieChart.stories.d.ts +7 -0
  26. package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
  27. package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
  28. package/lib/components/Chip/Chip.stories.d.ts +14 -0
  29. package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +6 -0
  30. package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
  31. package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
  32. package/lib/components/Drawer/Drawer.stories.d.ts +12 -0
  33. package/lib/components/EditTextField/EditTextField.stories.d.ts +10 -0
  34. package/lib/components/Editor/Editor.stories.d.ts +6 -0
  35. package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
  36. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
  37. package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
  38. package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
  39. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
  40. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
  41. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
  42. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
  43. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
  44. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
  45. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
  46. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
  47. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
  48. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
  49. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
  50. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
  51. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +80 -0
  52. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
  53. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +174 -0
  54. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
  55. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
  56. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
  57. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
  58. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
  59. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
  60. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
  61. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
  62. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
  63. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
  64. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
  65. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
  66. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
  67. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
  68. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +178 -0
  69. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
  70. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
  71. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +44 -0
  72. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +19 -0
  73. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
  74. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +12 -0
  75. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +15 -0
  76. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
  77. package/lib/components/ExcelFile/Types.d.ts +129 -0
  78. package/lib/components/ExcelFile/index.d.ts +1 -0
  79. package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
  80. package/lib/components/FF_Captcha/captcha.stories.d.ts +8 -0
  81. package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
  82. package/lib/components/Form/Form.stories.d.ts +7 -0
  83. package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
  84. package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
  85. package/lib/components/Icon/Icon.stories.d.ts +8 -0
  86. package/lib/components/IconButton/IconButton.stories.d.ts +7 -0
  87. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
  88. package/lib/components/Input/Input.stories.d.ts +9 -0
  89. package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
  90. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +13 -0
  91. package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
  92. package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
  93. package/lib/components/MenuOption/MenuOption.stories.d.ts +16 -0
  94. package/lib/components/MenuOption/types.d.ts +1 -1
  95. package/lib/components/MiniModal/MiniModal.stories.d.ts +10 -0
  96. package/lib/components/Modal/Modal.stories.d.ts +7 -0
  97. package/lib/components/Modal/types.d.ts +4 -2
  98. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  99. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +11 -0
  100. package/lib/components/NLPInput/NlpInput.stories.d.ts +7 -0
  101. package/lib/components/Paper/Paper.stories.d.ts +11 -0
  102. package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
  103. package/lib/components/RadioGroup/RadioGroup.stories.d.ts +9 -0
  104. package/lib/components/Search/Search.stories.d.ts +6 -0
  105. package/lib/components/Select/Select.stories.d.ts +14 -0
  106. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
  107. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +17 -0
  108. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
  109. package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
  110. package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
  111. package/lib/components/StatusCard/StatusCard.stories.d.ts +11 -0
  112. package/lib/components/Table/Table.stories.d.ts +13 -0
  113. package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
  114. package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
  115. package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
  116. package/lib/components/Toast/Toast.stories.d.ts +6 -0
  117. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  118. package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
  119. package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
  120. package/lib/components/Typography/Typography.stories.d.ts +10 -0
  121. package/lib/components/VariableInput/VariableInput.stories.d.ts +6 -0
  122. package/lib/index.d.ts +7 -2
  123. package/lib/index.esm.js +116 -87
  124. package/lib/index.esm.js.map +1 -1
  125. package/lib/index.js +116 -87
  126. package/lib/index.js.map +1 -1
  127. package/lib/tsconfig.tsbuildinfo +1 -1
  128. package/lib/utils/capitalize/capitalize.d.ts +1 -0
  129. package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
  130. package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
  131. package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
  132. package/lib/utils/debounce/debounce.stories.d.ts +6 -0
  133. package/lib/utils/ffID/ffID.stories.d.ts +6 -0
  134. package/lib/utils/find/findAndInsert.d.ts +7 -0
  135. package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
  136. package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +7 -0
  137. package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +6 -0
  138. package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
  139. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  140. package/lib/utils/throttle/throttle.stories.d.ts +6 -0
  141. package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
  142. package/package.json +2 -2
  143. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +82 -12
  144. package/src/assets/Themes/BaseTheme.scss +36 -15
  145. package/src/assets/Themes/DarkTheme.scss +15 -1
  146. package/src/assets/icons/hide_access_icon.svg +3 -0
  147. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +58 -8
  148. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +83 -75
  149. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +31 -18
  150. package/src/components/AllProjectsDropdown/types.ts +2 -0
  151. package/src/components/AppHeader/AppHeader.scss +2 -2
  152. package/src/components/AppHeader/AppHeader.stories.tsx +5 -1
  153. package/src/components/AppHeader/AppHeader.tsx +107 -101
  154. package/src/components/AppHeader/types.ts +1 -0
  155. package/src/components/EditTextField/EditTextField.tsx +3 -5
  156. package/src/components/Icon/iconList.ts +2 -2
  157. package/src/components/MenuOption/MenuOption.scss +24 -27
  158. package/src/components/MenuOption/MenuOption.stories.tsx +90 -35
  159. package/src/components/MenuOption/MenuOption.tsx +18 -16
  160. package/src/components/MenuOption/types.ts +1 -1
  161. package/src/components/Modal/Modal.stories.tsx +2 -2
  162. package/src/components/Modal/Modal.tsx +6 -2
  163. package/src/components/Modal/modal.scss +2 -3
  164. package/src/components/Modal/types.ts +4 -2
  165. package/src/utils/capitalize/capitalize.stories.tsx +44 -0
  166. package/src/utils/capitalize/capitalize.tsx +4 -0
@@ -13,28 +13,33 @@ const meta: Meta<typeof MenuOption> = {
13
13
  argTypes: {
14
14
  iconName: {
15
15
  control: 'text',
16
+ description: 'Name of the icon to display in the button.',
16
17
  defaultValue: 'more',
17
18
  },
18
19
  labelName: {
19
20
  control: 'text',
20
- defaultValue: 'Controlled Menu',
21
+ description: 'Label text displayed beside the icon.',
22
+ defaultValue: 'Menu',
21
23
  },
22
24
  tooltipTitle: {
23
25
  control: 'text',
26
+ description: 'Tooltip text displayed on hover.',
24
27
  defaultValue: 'Select an option',
25
28
  },
26
29
  tooltipPlacement: {
27
30
  control: {
28
- type: 'select',
29
- options: ['top', 'down', 'left', 'right'],
31
+ type: 'text',
32
+ options: ['top', 'down', 'left', 'right'],
30
33
  },
34
+ description: 'Placement of the tooltip relative to the button.',
31
35
  defaultValue: 'top',
32
36
  },
33
37
  dropdownPlacement: {
34
38
  control: {
35
- type: 'select',
36
- options: ['top', 'down', 'left', 'right'],
39
+ type: 'text',
40
+ options: ['top', 'down', 'left', 'right'],
37
41
  },
42
+ description: 'Placement of the dropdown menu relative to the button.',
38
43
  defaultValue: 'down',
39
44
  },
40
45
  },
@@ -57,46 +62,96 @@ const handleOptionClick = (option: { label: string }) => {
57
62
  alert(`Option clicked: ${option.label}`);
58
63
  };
59
64
 
60
- export const ControlledMenuOptionTop: Story = {
65
+
66
+ export const ControlledMenuOption: Story = {
67
+ args: {
68
+ iconName: 'more',
69
+ labelName: 'Controlled Menu',
70
+ tooltipTitle: 'Select an option',
71
+ dropdownPlacement: "top",
72
+ },
61
73
  render: (args) => (
62
- <MenuOption
63
- iconName="more"
64
- labelName={args.labelName}
65
- options={options}
66
- tooltipTitle={args.tooltipTitle}
67
- tooltipPlacement={args.tooltipPlacement}
68
- dropdownPlacement="top" // Override dropdown position to top
69
- onOptionClick={handleOptionClick}
70
- />
74
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
71
75
  ),
76
+ parameters: {
77
+ docs: {
78
+ description: {
79
+ story:
80
+ 'A controlled `MenuOption` with customizable tooltip and dropdown placement.',
81
+ },
82
+ },
83
+ },
72
84
  };
73
85
 
74
- export const ControlledMenuOptionBottom: Story = {
86
+
87
+ export const MenuOptionTop: Story = {
88
+ args: {
89
+ ...ControlledMenuOption.args,
90
+ dropdownPlacement: 'top',
91
+ },
75
92
  render: (args) => (
76
- <MenuOption
77
- iconName="more"
78
- labelName={args.labelName}
79
- options={options}
80
- tooltipTitle={args.tooltipTitle}
81
- tooltipPlacement={args.tooltipPlacement}
82
- dropdownPlacement="down"
83
- onOptionClick={handleOptionClick}
84
- />
93
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
85
94
  ),
95
+ parameters: {
96
+ docs: {
97
+ description: {
98
+ story: 'Dropdown menu positioned above the button.',
99
+ },
100
+ },
101
+ },
86
102
  };
87
103
 
88
- export const ControlledMenuOptionRight: Story = {
104
+
105
+ export const MenuOptionBottom: Story = {
106
+ args: {
107
+ ...ControlledMenuOption.args,
108
+ dropdownPlacement: 'down',
109
+ },
89
110
  render: (args) => (
90
- <MenuOption
91
- iconName="more"
92
- labelName={args.labelName}
93
- options={options}
94
- tooltipTitle={args.tooltipTitle}
95
- tooltipPlacement={args.tooltipPlacement}
96
- dropdownPlacement="right"
97
- onOptionClick={handleOptionClick}
98
- />
111
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
99
112
  ),
113
+ parameters: {
114
+ docs: {
115
+ description: {
116
+ story: 'Dropdown menu positioned below the button.',
117
+ },
118
+ },
119
+ },
120
+ };
121
+
122
+
123
+ export const MenuOptionLeft: Story = {
124
+ args: {
125
+ ...ControlledMenuOption.args,
126
+ dropdownPlacement: 'left',
127
+ },
128
+ render: (args) => (
129
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
130
+ ),
131
+ parameters: {
132
+ docs: {
133
+ description: {
134
+ story: 'Dropdown menu positioned to the left of the button.',
135
+ },
136
+ },
137
+ },
138
+ };
139
+
140
+ export const MenuOptionRight: Story = {
141
+ args: {
142
+ ...ControlledMenuOption.args,
143
+ dropdownPlacement: 'right',
144
+ },
145
+ render: (args) => (
146
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
147
+ ),
148
+ parameters: {
149
+ docs: {
150
+ description: {
151
+ story: 'Dropdown menu positioned to the right of the button.',
152
+ },
153
+ },
154
+ },
100
155
  };
101
156
 
102
157
  export default meta;
@@ -45,24 +45,26 @@ const OptionCard = ({
45
45
  menuRef,
46
46
  closeDropdown,
47
47
  zIndex,
48
- dropdownPosition,
48
+ dropdownPlacement,
49
49
  }: OptionCardProps) => {
50
50
  const themeContext = useContext(ThemeContext);
51
51
  const currentTheme = themeContext?.currentTheme;
52
52
  const [optionsHeight, setOptionsHeight] = useState(0);
53
+ const [optionsWidth, setOptionsWidth] = useState(0);
53
54
  const optionCardRef = useRef<HTMLDivElement>(null);
54
55
 
55
56
  useEffect(() => {
56
57
  if (optionCardRef?.current) {
57
58
  const rect = optionCardRef?.current?.getBoundingClientRect();
58
59
  setOptionsHeight(rect?.height);
60
+ setOptionsWidth(rect?.width);
59
61
  }
60
62
  }, []);
61
63
 
62
64
  useClickOutside(menuRef, closeDropdown, [optionCardRef]);
63
65
 
64
66
  const style = (() => {
65
- switch (dropdownPosition) {
67
+ switch (dropdownPlacement) {
66
68
  case 'top':
67
69
  return {
68
70
  top: menuPosition.top - optionsHeight - 7,
@@ -70,18 +72,18 @@ const OptionCard = ({
70
72
  };
71
73
  case 'down':
72
74
  return {
73
- top: menuPosition.bottom - 5,
75
+ top: menuPosition.bottom,
74
76
  left: menuPosition.rightSpaceAvailable + 12,
75
77
  };
76
78
  case 'left':
77
79
  return {
78
80
  top: menuPosition.top,
79
- right: menuPosition.rightSpaceAvailable + 35,
81
+ left: menuPosition.left - optionsWidth - 7,
80
82
  };
81
83
  case 'right':
82
84
  return {
83
85
  top: menuPosition.top,
84
- left: menuPosition.rightSpaceAvailable + 35,
86
+ left: menuPosition.left + 20,
85
87
  };
86
88
  default:
87
89
  return {
@@ -94,14 +96,12 @@ const OptionCard = ({
94
96
  return createPortal(
95
97
  <div
96
98
  className={classNames('ff-option-card', currentTheme)}
97
- ref={optionCardRef}
98
99
  style={{ ...style, zIndex }}
100
+ ref={optionCardRef}
99
101
  >
100
- <div className="ff-option-wrapper">
101
- {options.map((opt) => (
102
- <Option key={opt.label} option={opt} onClick={onClick} />
103
- ))}
104
- </div>
102
+ {options.map((opt) => (
103
+ <Option key={opt.label} option={opt} onClick={onClick} />
104
+ ))}
105
105
  </div>,
106
106
  document.body
107
107
  );
@@ -126,10 +126,11 @@ const MenuOption = ({
126
126
  const menuRef = useRef<HTMLDivElement>(null);
127
127
  const [menuPosition, setMenuPosition] = useState({
128
128
  top: 0,
129
- bottom: 0,
129
+ left: 0,
130
130
  height: 0,
131
- fromBottom: 0,
131
+ right: 0,
132
132
  rightSpaceAvailable: 0,
133
+ bottomSpaceAvailable: 0,
133
134
  });
134
135
 
135
136
  const closeDropDown = () => setIsClicked(false);
@@ -151,10 +152,11 @@ const MenuOption = ({
151
152
 
152
153
  setMenuPosition({
153
154
  top: rect.top,
155
+ left: rect.left,
154
156
  height: rect.height,
157
+ right: rect.right,
155
158
  rightSpaceAvailable: document.body.clientWidth - rect.right,
156
- bottom: rect.bottom,
157
- fromBottom: window.innerHeight - rect.bottom,
159
+ bottomSpaceAvailable: window.innerHeight - menuRef.current.offsetTop,
158
160
  });
159
161
  }
160
162
  };
@@ -199,7 +201,7 @@ const MenuOption = ({
199
201
  menuRef={menuRef}
200
202
  closeDropdown={closeDropDown}
201
203
  zIndex={zIndex}
202
- dropdownPosition={dropdownPlacement}
204
+ dropdownPlacement={dropdownPlacement}
203
205
  />
204
206
  )}
205
207
  </div>
@@ -90,7 +90,7 @@ interface OptionCardProps {
90
90
  * @type {dropdownPosition}
91
91
  * @optional
92
92
  */
93
- dropdownPosition?: 'top' | 'down' | 'left' | 'right';
93
+ dropdownPlacement?: 'top' | 'down' | 'left' | 'right';
94
94
  }
95
95
 
96
96
  interface MenuOptionProps {
@@ -26,7 +26,7 @@ export const DefaultModalStory: Story = {
26
26
  footerContent: <Button variant="primary" label="continue" />,
27
27
  customWidth: '660px',
28
28
  customHeight: 'auto',
29
- boxShadow:'0px 1px 4px 0px #FFC600'
29
+ border: '1px solid #E79B0866',
30
30
  },
31
31
  };
32
32
 
@@ -58,7 +58,7 @@ export const Controlled: Story = {
58
58
  footerContent={<Button variant="primary" label="continue" />}
59
59
  customWidth="660px"
60
60
  customHeight="auto"
61
- boxShadow='0px 1px 4px 0px #FFC600'
61
+ border="1px solid #E79B0866"
62
62
  />
63
63
  )}
64
64
  </>
@@ -22,7 +22,9 @@ const Modal: React.FC<ModalProps> = ({
22
22
  customHeight = 'auto',
23
23
  children,
24
24
  zIndex = 999,
25
- boxShadow = '0px 1px 4px 0px #FFC600',
25
+ boxShadow = '',
26
+ border = '',
27
+ background='',
26
28
  }) => {
27
29
  useEffect(() => {
28
30
  const handleKeyDown = (e: KeyboardEvent) => {
@@ -58,7 +60,9 @@ const Modal: React.FC<ModalProps> = ({
58
60
  <div
59
61
  style={{
60
62
  boxShadow: boxShadow,
61
- borderRadius: '12px' ,
63
+ border: border,
64
+ borderRadius: '12px',
65
+ background: background,
62
66
  }}
63
67
  className="ff-modal-container"
64
68
  >
@@ -12,9 +12,8 @@
12
12
  }
13
13
 
14
14
  .ff-modal-container {
15
- box-shadow: 0px 1px 4px 0px #ffc600;
16
- border-radius: 12px; // Ensures box-shadow respects the rounded corners
17
- overflow: hidden; // Prevents content overflow
15
+ border-radius: 12px;
16
+ overflow: hidden;
18
17
  }
19
18
 
20
19
  .ff-modal-content {
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode } from 'react';
2
2
 
3
3
  export interface ModalProps {
4
4
  isOpen: boolean;
@@ -37,5 +37,7 @@ export interface ModalProps {
37
37
  customWidth: string;
38
38
  customHeight?: string;
39
39
  zIndex?: number;
40
- boxShadow:string;
40
+ boxShadow?: string;
41
+ border?: string;
42
+ background?: string;
41
43
  }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { capitalize } from './capitalize';
3
+
4
+ export default {
5
+ title: 'Utils/Capitalize', // Organize under the "Utils" category
6
+ component: capitalize,
7
+ };
8
+
9
+ export const Default = () => {
10
+ const examples = [
11
+ { input: 'hello', output: capitalize('hello') },
12
+ { input: 'world', output: capitalize('world') },
13
+ { input: '', output: capitalize('') },
14
+ { input: 'capitalize', output: capitalize('capitalize') },
15
+ ];
16
+
17
+ return (
18
+ <div>
19
+ <h3>Capitalize Function Examples</h3>
20
+ <table style={{ borderCollapse: 'collapse', width: '100%' }}>
21
+ <thead>
22
+ <tr>
23
+ <th style={{ border: '1px solid black', padding: '8px' }}>Input</th>
24
+ <th style={{ border: '1px solid black', padding: '8px' }}>
25
+ Output
26
+ </th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ {examples.map((example, index) => (
31
+ <tr key={index}>
32
+ <td style={{ border: '1px solid black', padding: '8px' }}>
33
+ {example.input}
34
+ </td>
35
+ <td style={{ border: '1px solid black', padding: '8px' }}>
36
+ {example.output}
37
+ </td>
38
+ </tr>
39
+ ))}
40
+ </tbody>
41
+ </table>
42
+ </div>
43
+ );
44
+ };
@@ -0,0 +1,4 @@
1
+ export const capitalize = (text: string): string => {
2
+ if (!text) return '';
3
+ return text.charAt(0).toUpperCase() + text.slice(1);
4
+ };