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.
- package/.yarn/install-state.gz +0 -0
- package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
- package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
- package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/lib/components/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +1 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +7 -0
- package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
- package/lib/components/AppHeader/AppHeader.stories.d.ts +7 -0
- package/lib/components/AppHeader/types.d.ts +1 -0
- package/lib/components/AttachImage/AttachImage.stories.d.ts +7 -0
- package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Button/Button.stories.d.ts +13 -0
- package/lib/components/Charts/BarChart/BarChart.stories.d.ts +6 -0
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +7 -0
- package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
- package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/LineChart/LineChart.stories.d.ts +7 -0
- package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/PieChart/PieChart.stories.d.ts +7 -0
- package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
- package/lib/components/Chip/Chip.stories.d.ts +14 -0
- package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +6 -0
- package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
- package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
- package/lib/components/Drawer/Drawer.stories.d.ts +12 -0
- package/lib/components/EditTextField/EditTextField.stories.d.ts +10 -0
- package/lib/components/Editor/Editor.stories.d.ts +6 -0
- package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
- package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
- package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +80 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +174 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +178 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +44 -0
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +19 -0
- package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +12 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +15 -0
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
- package/lib/components/ExcelFile/Types.d.ts +129 -0
- package/lib/components/ExcelFile/index.d.ts +1 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
- package/lib/components/FF_Captcha/captcha.stories.d.ts +8 -0
- package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
- package/lib/components/Form/Form.stories.d.ts +7 -0
- package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
- package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
- package/lib/components/Icon/Icon.stories.d.ts +8 -0
- package/lib/components/IconButton/IconButton.stories.d.ts +7 -0
- package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
- package/lib/components/Input/Input.stories.d.ts +9 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
- package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +13 -0
- package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
- package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
- package/lib/components/MenuOption/MenuOption.stories.d.ts +16 -0
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/MiniModal/MiniModal.stories.d.ts +10 -0
- package/lib/components/Modal/Modal.stories.d.ts +7 -0
- package/lib/components/Modal/types.d.ts +4 -2
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +11 -0
- package/lib/components/NLPInput/NlpInput.stories.d.ts +7 -0
- package/lib/components/Paper/Paper.stories.d.ts +11 -0
- package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
- package/lib/components/RadioGroup/RadioGroup.stories.d.ts +9 -0
- package/lib/components/Search/Search.stories.d.ts +6 -0
- package/lib/components/Select/Select.stories.d.ts +14 -0
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +17 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/StatusCard/StatusCard.stories.d.ts +11 -0
- package/lib/components/Table/Table.stories.d.ts +13 -0
- package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
- package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
- package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
- package/lib/components/Toast/Toast.stories.d.ts +6 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
- package/lib/components/Typography/Typography.stories.d.ts +10 -0
- package/lib/components/VariableInput/VariableInput.stories.d.ts +6 -0
- package/lib/index.d.ts +7 -2
- package/lib/index.esm.js +116 -87
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +116 -87
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/capitalize/capitalize.d.ts +1 -0
- package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
- package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
- package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
- package/lib/utils/debounce/debounce.stories.d.ts +6 -0
- package/lib/utils/ffID/ffID.stories.d.ts +6 -0
- package/lib/utils/find/findAndInsert.d.ts +7 -0
- package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +6 -0
- package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/throttle/throttle.stories.d.ts +6 -0
- package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
- package/package.json +2 -2
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +82 -12
- package/src/assets/Themes/BaseTheme.scss +36 -15
- package/src/assets/Themes/DarkTheme.scss +15 -1
- package/src/assets/icons/hide_access_icon.svg +3 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +58 -8
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +83 -75
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +31 -18
- package/src/components/AllProjectsDropdown/types.ts +2 -0
- package/src/components/AppHeader/AppHeader.scss +2 -2
- package/src/components/AppHeader/AppHeader.stories.tsx +5 -1
- package/src/components/AppHeader/AppHeader.tsx +107 -101
- package/src/components/AppHeader/types.ts +1 -0
- package/src/components/EditTextField/EditTextField.tsx +3 -5
- package/src/components/Icon/iconList.ts +2 -2
- package/src/components/MenuOption/MenuOption.scss +24 -27
- package/src/components/MenuOption/MenuOption.stories.tsx +90 -35
- package/src/components/MenuOption/MenuOption.tsx +18 -16
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/Modal/Modal.stories.tsx +2 -2
- package/src/components/Modal/Modal.tsx +6 -2
- package/src/components/Modal/modal.scss +2 -3
- package/src/components/Modal/types.ts +4 -2
- package/src/utils/capitalize/capitalize.stories.tsx +44 -0
- 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
|
-
|
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: '
|
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: '
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 (
|
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
|
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
|
-
|
81
|
+
left: menuPosition.left - optionsWidth - 7,
|
80
82
|
};
|
81
83
|
case 'right':
|
82
84
|
return {
|
83
85
|
top: menuPosition.top,
|
84
|
-
left: menuPosition.
|
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
|
-
|
101
|
-
{
|
102
|
-
|
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
|
-
|
129
|
+
left: 0,
|
130
130
|
height: 0,
|
131
|
-
|
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
|
-
|
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
|
-
|
204
|
+
dropdownPlacement={dropdownPlacement}
|
203
205
|
/>
|
204
206
|
)}
|
205
207
|
</div>
|
@@ -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
|
-
|
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
|
-
|
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 = '
|
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
|
-
|
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
|
-
|
16
|
-
|
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
|
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
|
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
|
+
};
|