pixel-react 1.2.2 → 1.2.4
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.
- package/lib/components/AddResourceButton/type.d.ts +3 -3
- package/lib/components/Form/Forms.d.ts +2 -1
- package/lib/components/Icon/types.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/MiniModal/MiniModal.stories.d.ts +1 -0
- package/lib/components/MiniModal/types.d.ts +6 -6
- package/lib/index.d.ts +14 -13
- package/lib/index.esm.js +91 -27
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +91 -27
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +5 -0
- package/src/assets/Themes/BaseTheme.scss +1 -0
- package/src/assets/Themes/DarkTheme.scss +1 -0
- package/src/assets/icons/add_testcase.svg +3 -0
- package/src/assets/icons/add_variable_icon.svg +3 -4
- package/src/assets/icons/attachment_icon.svg +3 -0
- package/src/assets/icons/authorization_icon.svg +3 -0
- package/src/assets/icons/automation_testcase.svg +4 -0
- package/src/assets/icons/back_icon.svg +3 -0
- package/src/assets/icons/browserstack_icon.svg +24 -0
- package/src/assets/icons/edge.svg +30 -0
- package/src/assets/icons/fire_fox.svg +106 -0
- package/src/assets/icons/internet_explorer.svg +3 -0
- package/src/assets/icons/lambda_icon.svg +3 -0
- package/src/assets/icons/linux.svg +42 -0
- package/src/assets/icons/local.svg +3 -0
- package/src/assets/icons/manual_testcase.svg +3 -0
- package/src/assets/icons/maximize_script.svg +12 -0
- package/src/assets/icons/opera.svg +9 -0
- package/src/assets/icons/safari_icon.svg +12 -0
- package/src/assets/icons/sause_lab.svg +3 -0
- package/src/assets/icons/variable_icon.svg +4 -0
- package/src/components/AddResourceButton/ArrowsButton/ArrowsButton.scss +1 -0
- package/src/components/AddResourceButton/type.ts +3 -3
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +1 -1
- package/src/components/Button/types.ts +1 -1
- package/src/components/Form/Form.scss +18 -1
- package/src/components/Form/Form.stories.tsx +86 -13
- package/src/components/Form/Forms.tsx +2 -0
- package/src/components/Icon/iconList.ts +41 -1
- package/src/components/Icon/types.ts +1 -1
- package/src/components/IconButton/IconButton.scss +1 -1
- package/src/components/IconButton/IconButton.tsx +12 -7
- package/src/components/Input/Input.scss +1 -1
- package/src/components/MenuOption/MenuOption.tsx +25 -23
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/MiniModal/MiniModal.scss +5 -0
- package/src/components/MiniModal/MiniModal.stories.tsx +95 -0
- package/src/components/MiniModal/MiniModal.tsx +11 -6
- package/src/components/MiniModal/types.ts +6 -6
- package/src/components/Search/Search.tsx +6 -3
- package/src/components/Table/Table.scss +0 -1
- package/src/index.ts +2 -2
@@ -5,6 +5,8 @@ import Select from '../Select';
|
|
5
5
|
import { Meta, StoryObj } from '@storybook/react/*';
|
6
6
|
import Typography from '../Typography';
|
7
7
|
import './Form.scss';
|
8
|
+
import Checkbox from '../Checkbox';
|
9
|
+
import TextArea from '../TextArea';
|
8
10
|
|
9
11
|
type FormValues = {
|
10
12
|
username: string;
|
@@ -12,6 +14,8 @@ type FormValues = {
|
|
12
14
|
password: string;
|
13
15
|
gender: string;
|
14
16
|
language: string;
|
17
|
+
check: boolean;
|
18
|
+
description: string;
|
15
19
|
};
|
16
20
|
|
17
21
|
const meta: Meta<typeof Forms> = {
|
@@ -33,6 +37,8 @@ export const WithDefaultValues: Story = {
|
|
33
37
|
password: '',
|
34
38
|
gender: '',
|
35
39
|
language: '',
|
40
|
+
check: false,
|
41
|
+
description: '',
|
36
42
|
};
|
37
43
|
|
38
44
|
const onSubmit = (data: FormValues) => {
|
@@ -56,8 +62,12 @@ export const WithDefaultValues: Story = {
|
|
56
62
|
<Typography as="label">username</Typography>
|
57
63
|
<Input
|
58
64
|
type="text"
|
65
|
+
disabled={false}
|
59
66
|
{...register('username', {
|
60
|
-
required:
|
67
|
+
required: {
|
68
|
+
value: true,
|
69
|
+
message: 'Username is required',
|
70
|
+
},
|
61
71
|
minLength: {
|
62
72
|
value: 3,
|
63
73
|
message: 'Username must be at least 3 characters',
|
@@ -72,7 +82,7 @@ export const WithDefaultValues: Story = {
|
|
72
82
|
value={watch('username')}
|
73
83
|
onChange={(e) =>
|
74
84
|
setValue('username', e.target.value, {
|
75
|
-
shouldValidate:
|
85
|
+
shouldValidate: true,
|
76
86
|
})
|
77
87
|
}
|
78
88
|
onBlur={() => {
|
@@ -87,8 +97,9 @@ export const WithDefaultValues: Story = {
|
|
87
97
|
|
88
98
|
<Input
|
89
99
|
type="email"
|
100
|
+
disabled={false}
|
90
101
|
{...register('email', {
|
91
|
-
required: 'Email is required',
|
102
|
+
required: { value: true, message: 'Email is required' },
|
92
103
|
pattern: {
|
93
104
|
value: /^\S+@\S+\.\S+$/,
|
94
105
|
message: 'Please enter a valid email',
|
@@ -98,7 +109,7 @@ export const WithDefaultValues: Story = {
|
|
98
109
|
helperText={errors.email?.message}
|
99
110
|
value={watch('email')}
|
100
111
|
onChange={(e) =>
|
101
|
-
setValue('email', e.target.value, { shouldValidate:
|
112
|
+
setValue('email', e.target.value, { shouldValidate: true })
|
102
113
|
}
|
103
114
|
onBlur={() => {
|
104
115
|
trigger('email');
|
@@ -109,11 +120,14 @@ export const WithDefaultValues: Story = {
|
|
109
120
|
{/* Password Field */}
|
110
121
|
<div>
|
111
122
|
<Typography as="label">Password</Typography>
|
112
|
-
|
113
123
|
<Input
|
124
|
+
disabled={false}
|
114
125
|
type="password"
|
115
126
|
{...register('password', {
|
116
|
-
required:
|
127
|
+
required: {
|
128
|
+
value: true,
|
129
|
+
message: 'Password is required',
|
130
|
+
},
|
117
131
|
minLength: {
|
118
132
|
value: 6,
|
119
133
|
message: 'Password must be at least 6 characters',
|
@@ -134,9 +148,8 @@ export const WithDefaultValues: Story = {
|
|
134
148
|
</div>
|
135
149
|
|
136
150
|
{/* Gender Field */}
|
137
|
-
<div>
|
151
|
+
<div className="ff-radio">
|
138
152
|
<Typography as="label">Gender</Typography>
|
139
|
-
|
140
153
|
<RadioGroup
|
141
154
|
options={[
|
142
155
|
{
|
@@ -152,14 +165,23 @@ export const WithDefaultValues: Story = {
|
|
152
165
|
value: 'other',
|
153
166
|
},
|
154
167
|
]}
|
168
|
+
{...register('gender', {
|
169
|
+
required: {
|
170
|
+
value: true,
|
171
|
+
message: 'select the Gender',
|
172
|
+
},
|
173
|
+
})}
|
155
174
|
selectedValue={watch('gender')}
|
156
175
|
onChange={(option) => {
|
157
|
-
setValue('gender', option.value
|
176
|
+
setValue('gender', option.value, {
|
177
|
+
shouldValidate: true,
|
178
|
+
});
|
158
179
|
}}
|
159
|
-
name="gender"
|
160
180
|
/>
|
161
181
|
{errors?.gender && (
|
162
|
-
<
|
182
|
+
<Typography className="ff-error">
|
183
|
+
{errors.gender.message}
|
184
|
+
</Typography>
|
163
185
|
)}
|
164
186
|
</div>
|
165
187
|
|
@@ -177,17 +199,68 @@ export const WithDefaultValues: Story = {
|
|
177
199
|
value: watch('language') || '',
|
178
200
|
}}
|
179
201
|
{...register('language', {
|
180
|
-
required:
|
202
|
+
required: {
|
203
|
+
value: true,
|
204
|
+
message: 'language is required',
|
205
|
+
},
|
181
206
|
})}
|
182
207
|
onChange={(option) =>
|
183
208
|
setValue('language', option.value, { shouldValidate: true })
|
184
209
|
}
|
185
210
|
/>
|
186
211
|
{errors?.gender && (
|
187
|
-
<
|
212
|
+
<Typography className="ff-error">
|
213
|
+
{errors?.language?.message}
|
214
|
+
</Typography>
|
188
215
|
)}
|
189
216
|
</div>
|
190
217
|
|
218
|
+
{/* TextArea Field */}
|
219
|
+
<div className="ff-textarea">
|
220
|
+
<TextArea
|
221
|
+
label="Description"
|
222
|
+
value={watch('description')}
|
223
|
+
{...register('description', {
|
224
|
+
required: 'Description is required',
|
225
|
+
maxLength: {
|
226
|
+
value: 30,
|
227
|
+
message: 'Maximum length is 200 characters',
|
228
|
+
},
|
229
|
+
})}
|
230
|
+
error={!!errors?.description?.message}
|
231
|
+
onChange={(e) => {
|
232
|
+
setValue('description', e.target.value, {
|
233
|
+
shouldValidate: true,
|
234
|
+
});
|
235
|
+
}}
|
236
|
+
onBlur={() => {
|
237
|
+
trigger('description');
|
238
|
+
}}
|
239
|
+
/>
|
240
|
+
</div>
|
241
|
+
{/* check box Field */}
|
242
|
+
<div className="ff-check">
|
243
|
+
<Checkbox
|
244
|
+
label="terms condition"
|
245
|
+
disabled={false}
|
246
|
+
{...register('check', {
|
247
|
+
required: {
|
248
|
+
value: true,
|
249
|
+
message: 'Please select the checkbox',
|
250
|
+
},
|
251
|
+
})}
|
252
|
+
onChange={(e) => {
|
253
|
+
setValue('check', e.target.checked, {
|
254
|
+
shouldValidate: true,
|
255
|
+
});
|
256
|
+
}}
|
257
|
+
/>
|
258
|
+
{errors?.check && (
|
259
|
+
<Typography className="ff-error">
|
260
|
+
{errors.check.message}
|
261
|
+
</Typography>
|
262
|
+
)}
|
263
|
+
</div>
|
191
264
|
{/* Buttons */}
|
192
265
|
<div className="ff-button-layout">
|
193
266
|
<button type="submit">Submit</button>
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import Form from './Form';
|
3
3
|
|
4
4
|
interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
5
|
+
id?:'string',
|
5
6
|
onSubmit: Form.SubmitHandler<T>;
|
6
7
|
children: (methods: ReturnType<typeof Form.useForm<T>>) => React.ReactNode;
|
7
8
|
}
|
@@ -9,6 +10,7 @@ interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
|
9
10
|
const Forms = <T extends Form.FieldValues>({
|
10
11
|
onSubmit,
|
11
12
|
children,
|
13
|
+
id,
|
12
14
|
...rest
|
13
15
|
}: FormProps<T>) => {
|
14
16
|
const methods = Form.useForm<T>(rest);
|
@@ -114,6 +114,9 @@ import NLPHelpIcon from '../../assets/icons/nlp_help_icon.svg?react';
|
|
114
114
|
import UpdateIcon from '../../assets/icons/update_icon.svg?react';
|
115
115
|
import AddFile from '../../assets/icons/add_file.svg?react';
|
116
116
|
import EyeClosed from '../../assets/icons/eye_closed.svg?react';
|
117
|
+
import AttachmentIcon from '../../assets/icons/attachment_icon.svg?react';
|
118
|
+
import VariableIcon from '../../assets/icons/variable_icon.svg?react';
|
119
|
+
import AuthorizationIcon from '../../assets/icons/authorization_icon.svg?react';
|
117
120
|
|
118
121
|
import CloneIcon from '../../assets/icons/clone_icon.svg?react';
|
119
122
|
import MoveIcon from '../../assets/icons/move_icon.svg?react';
|
@@ -122,8 +125,24 @@ import HistoryIcon from '../../assets//icons/history_icon.svg?react';
|
|
122
125
|
import LinkedDefects from '../../assets//icons/linked_defects.svg?react';
|
123
126
|
import FireflinkPlatform from '../../assets//icons/fireflink_platform.svg?react';
|
124
127
|
import FireflinkFinder from '../../assets//icons/fireflink_finder_logo.svg?react';
|
125
|
-
import ClientProfile from '../../assets//icons/client_profile.svg?react'
|
128
|
+
import ClientProfile from '../../assets//icons/client_profile.svg?react';
|
126
129
|
import LicenseExpired from '../../assets//icons/license_expired.svg?react';
|
130
|
+
import AddTestCaseIcon from '../../assets/icons/add_testcase.svg?react';
|
131
|
+
import AutomationTestCaseIcon from '../../assets/icons/automation_testcase.svg?react';
|
132
|
+
import ManualTestCaseIcon from '../../assets/icons/manual_testcase.svg?react';
|
133
|
+
import BackIcon from '../../assets/icons/back_icon.svg?react';
|
134
|
+
|
135
|
+
import SauseLabIcon from '../../assets/icons/sause_lab.svg?react';
|
136
|
+
import LocalIcon from '../../assets/icons/local.svg?react';
|
137
|
+
import InternetExplorerIcon from '../../assets/icons/internet_explorer.svg?react';
|
138
|
+
import BrowserstackIcon from '../../assets/icons/browserstack_icon.svg?react';
|
139
|
+
import EdgeIcon from '../../assets/icons/edge.svg?react';
|
140
|
+
import FirefoxIcon from '../../assets/icons/fire_fox.svg?react';
|
141
|
+
import LambdaIcon from '../../assets/icons/lambda_icon.svg?react';
|
142
|
+
import LinuxIcon from '../../assets/icons/linux.svg?react';
|
143
|
+
import OperaIcon from '../../assets/icons/opera.svg?react';
|
144
|
+
import SafariIcon from '../../assets/icons/safari_icon.svg?react';
|
145
|
+
import MaximizeScript from '../../assets/icons/maximize_script.svg?react';
|
127
146
|
|
128
147
|
Components['delete_info'] = DeleteInfoIcon;
|
129
148
|
Components['success'] = ToastSuccessIcon;
|
@@ -242,9 +261,30 @@ Components['no_access_icon'] = NoAccessIcon;
|
|
242
261
|
Components['full_access_icon'] = FullAccessIcon;
|
243
262
|
Components['view_access_icon'] = ViewAccessIcon;
|
244
263
|
Components['eye_closed'] = EyeClosed;
|
264
|
+
Components['attachment_icon'] = AttachmentIcon;
|
265
|
+
Components['variable_icon'] = VariableIcon;
|
266
|
+
Components['authorization_icon'] = AuthorizationIcon;
|
267
|
+
|
245
268
|
Components['fireflink_platform_logo'] = FireflinkPlatform;
|
246
269
|
Components['fireflink_finder_logo'] = FireflinkFinder;
|
247
270
|
Components['client_profile'] = ClientProfile;
|
248
271
|
Components['license_expired'] = LicenseExpired;
|
272
|
+
Components['add_testcase'] = AddTestCaseIcon;
|
273
|
+
Components['automation_testcase'] = AutomationTestCaseIcon;
|
274
|
+
Components['manual_testcass'] = ManualTestCaseIcon;
|
275
|
+
Components['back_icon'] = BackIcon;
|
276
|
+
|
277
|
+
Components['sause_lab'] = SauseLabIcon;
|
278
|
+
Components['local'] = LocalIcon;
|
279
|
+
Components['internet_explorer'] = InternetExplorerIcon;
|
280
|
+
Components['browserstack_icon'] = BrowserstackIcon;
|
281
|
+
Components['edge'] = EdgeIcon;
|
282
|
+
Components['fire_fox'] = FirefoxIcon;
|
283
|
+
Components['lambda_icon'] = LambdaIcon;
|
284
|
+
Components['linux'] = LinuxIcon;
|
285
|
+
Components['opera'] = OperaIcon;
|
286
|
+
Components['safari_icon'] = SafariIcon;
|
287
|
+
Components['maximize_script'] = MaximizeScript;
|
288
|
+
|
249
289
|
|
250
290
|
export default Components;
|
@@ -13,14 +13,19 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
13
13
|
return (
|
14
14
|
<button onClick={onClick} className={classNames('ff-plus-icon')}>
|
15
15
|
<div className={classNames('button-icon')}>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
<Icon
|
17
|
+
height={12}
|
18
|
+
width={12}
|
19
|
+
name={iconName}
|
20
|
+
className={'ff-icon-color'}
|
21
|
+
/>
|
22
22
|
</div>
|
23
|
-
<Typography
|
23
|
+
<Typography
|
24
|
+
as="div"
|
25
|
+
textAlign="center"
|
26
|
+
className="icon-name"
|
27
|
+
fontWeight="semi-bold"
|
28
|
+
>
|
24
29
|
{label}
|
25
30
|
</Typography>
|
26
31
|
</button>
|
@@ -19,7 +19,7 @@ const Option = ({ option, onClick }: OptionProps) => (
|
|
19
19
|
})}
|
20
20
|
onClick={() => !option.disable && onClick(option)}
|
21
21
|
>
|
22
|
-
<Icon name={option.icon} height={16} width={16} />
|
22
|
+
{option.icon && <Icon name={option.icon} height={16} width={16} />}
|
23
23
|
<Typography
|
24
24
|
as="label"
|
25
25
|
color={option.icon === 'delete' ? 'var(--delete-text-color)' : ''}
|
@@ -88,28 +88,30 @@ const MenuOption = ({
|
|
88
88
|
<div className="ff-menu-option-container" ref={menuRef}>
|
89
89
|
<Tooltip title={tooltipTitle} placement={tooltipPlacement}>
|
90
90
|
<div className="ff-icon-label">
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
91
|
+
<div
|
92
|
+
className={classNames('ff-menuicon-container', {
|
93
|
+
'ff-menuicon-container-clicked': isClicked,
|
94
|
+
dark: variant === 'dark',
|
95
|
+
})}
|
96
|
+
onClick={onIconClickHandler}
|
97
|
+
style={{
|
98
|
+
width: `${iconButtonSize}px`,
|
99
|
+
height: `${iconButtonSize}px`,
|
100
|
+
borderRadius: `${iconButtonBorderRadius}px`,
|
101
|
+
display: 'flex',
|
102
|
+
flexDirection: 'column',
|
103
|
+
}}
|
104
|
+
>
|
105
|
+
<Icon
|
106
|
+
height={iconSize}
|
107
|
+
width={iconSize}
|
108
|
+
name={iconName}
|
109
|
+
color={
|
110
|
+
isClicked === (variant === 'dark')
|
111
|
+
? 'var(--menu-option-icon-clicked)'
|
112
|
+
: 'var(--menu-option-icon-color)'
|
113
|
+
}
|
114
|
+
/>
|
113
115
|
</div>
|
114
116
|
{labelName && <Typography as="label">{labelName} </Typography>}
|
115
117
|
</div>
|
@@ -4,6 +4,7 @@ import MiniModal from './MiniModal';
|
|
4
4
|
import Button from '../Button/Button';
|
5
5
|
import './MiniModal.scss';
|
6
6
|
import Typography from '../Typography';
|
7
|
+
import Icon from '../Icon';
|
7
8
|
|
8
9
|
const meta: Meta<typeof MiniModal> = {
|
9
10
|
title: 'Components/MiniModal',
|
@@ -595,5 +596,99 @@ export const CustomModalWithWrapper = () => {
|
|
595
596
|
</div>
|
596
597
|
);
|
597
598
|
};
|
599
|
+
export const normalModalFollowedByIcon = () => {
|
600
|
+
const iconRef1 = useRef<HTMLButtonElement>(null);
|
601
|
+
const iconRef2 = useRef<HTMLButtonElement>(null);
|
602
|
+
const iconRef3 = useRef<HTMLButtonElement>(null);
|
603
|
+
const { currentModal, openModal } = useModal();
|
604
|
+
|
605
|
+
return (
|
606
|
+
<div className="ff-mini-modal-buttons-flex ff-mini-modal-gap-10">
|
607
|
+
<Icon
|
608
|
+
className="ff-mini-edit-model-icon"
|
609
|
+
width={16}
|
610
|
+
height={16}
|
611
|
+
onClick={() => openModal(1)}
|
612
|
+
ref={iconRef1}
|
613
|
+
name="user_profile"
|
614
|
+
/>
|
615
|
+
|
616
|
+
{currentModal === 1 && (
|
617
|
+
<MiniModal
|
618
|
+
anchorRef={iconRef1}
|
619
|
+
modalProperties={{ width: 168, height: 108 }}
|
620
|
+
childContent={
|
621
|
+
<>
|
622
|
+
<Typography as="p">
|
623
|
+
This is some content inside the first modal.
|
624
|
+
</Typography>
|
625
|
+
</>
|
626
|
+
}
|
627
|
+
isIconModel={true}
|
628
|
+
isAnimated={true}
|
629
|
+
firstAnchorRef={iconRef1}
|
630
|
+
anchorLeftDistanceForWrapper={0}
|
631
|
+
extraTopSpace={{ normalModal: 5 }}
|
632
|
+
/>
|
633
|
+
)}
|
634
|
+
|
635
|
+
<Icon
|
636
|
+
className="ff-mini-edit-model-icon"
|
637
|
+
width={16}
|
638
|
+
height={16}
|
639
|
+
onClick={() => openModal(2)}
|
640
|
+
ref={iconRef2}
|
641
|
+
name="user_profile"
|
642
|
+
/>
|
643
|
+
|
644
|
+
{currentModal === 2 && (
|
645
|
+
<MiniModal
|
646
|
+
anchorRef={iconRef2}
|
647
|
+
modalProperties={{ width: 193, height: 128 }}
|
648
|
+
childContent={
|
649
|
+
<>
|
650
|
+
<Typography as="p">
|
651
|
+
This is some content inside the Second modal.
|
652
|
+
</Typography>
|
653
|
+
</>
|
654
|
+
}
|
655
|
+
isIconModel={true}
|
656
|
+
isAnimated={true}
|
657
|
+
firstAnchorRef={iconRef2}
|
658
|
+
anchorLeftDistanceForWrapper={20}
|
659
|
+
extraTopSpace={{ normalModal: 15 }}
|
660
|
+
/>
|
661
|
+
)}
|
662
|
+
|
663
|
+
<Icon
|
664
|
+
className="ff-mini-edit-model-icon"
|
665
|
+
width={16}
|
666
|
+
height={16}
|
667
|
+
onClick={() => openModal(3)}
|
668
|
+
ref={iconRef3}
|
669
|
+
name="user_profile"
|
670
|
+
/>
|
671
|
+
|
672
|
+
{currentModal === 3 && (
|
673
|
+
<MiniModal
|
674
|
+
anchorRef={iconRef3}
|
675
|
+
modalProperties={{ width: 168, height: 108 }}
|
676
|
+
childContent={
|
677
|
+
<>
|
678
|
+
<Typography as="p">
|
679
|
+
This is some content inside the third modal.
|
680
|
+
</Typography>
|
681
|
+
</>
|
682
|
+
}
|
683
|
+
isIconModel={true}
|
684
|
+
isAnimated={true}
|
685
|
+
firstAnchorRef={iconRef3}
|
686
|
+
anchorLeftDistanceForWrapper={10}
|
687
|
+
extraTopSpace={{ normalModal: 10 }}
|
688
|
+
/>
|
689
|
+
)}
|
690
|
+
</div>
|
691
|
+
);
|
692
|
+
};
|
598
693
|
|
599
694
|
export default meta;
|
@@ -14,8 +14,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
14
14
|
anchorRef,
|
15
15
|
headerProps,
|
16
16
|
childContent,
|
17
|
-
cancelButtonProps,
|
18
|
-
proceedButtonProps,
|
17
|
+
cancelButtonProps = () => {},
|
18
|
+
proceedButtonProps = () => {},
|
19
19
|
footerContent,
|
20
20
|
isWrapped = false,
|
21
21
|
isAnimated = false,
|
@@ -29,6 +29,7 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
29
29
|
extraTopSpace,
|
30
30
|
extraRightSpace,
|
31
31
|
extraLeftSpace,
|
32
|
+
isIconModel,
|
32
33
|
},
|
33
34
|
ref
|
34
35
|
) => {
|
@@ -144,8 +145,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
144
145
|
//specifying the modal's escape and enter functionality
|
145
146
|
const handleEsc = useEscapeKey('Escape');
|
146
147
|
const handleEnter = useEscapeKey('Enter');
|
147
|
-
handleEsc(cancelButtonProps
|
148
|
-
handleEnter(proceedButtonProps
|
148
|
+
handleEsc(cancelButtonProps?.onClick);
|
149
|
+
handleEnter(proceedButtonProps?.onClick);
|
149
150
|
useClickOutside(modalRef, cancelButtonProps.onClick);
|
150
151
|
|
151
152
|
//calculate the modal position
|
@@ -227,6 +228,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
227
228
|
>
|
228
229
|
{headerProps ? (
|
229
230
|
<Typography as="div">{headerProps}</Typography>
|
231
|
+
) : isIconModel ? (
|
232
|
+
<></>
|
230
233
|
) : (
|
231
234
|
<Typography as="header">
|
232
235
|
<Typography as="h2">Header text</Typography>
|
@@ -236,13 +239,15 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
236
239
|
<div className="modal-content">{childContent}</div>
|
237
240
|
{footerContent ? (
|
238
241
|
<Typography as="footer">{footerContent}</Typography>
|
242
|
+
) : isIconModel ? (
|
243
|
+
<></>
|
239
244
|
) : (
|
240
245
|
<footer className="modal-footer">
|
241
246
|
<Button
|
242
247
|
variant="primary"
|
243
248
|
className="btn-cancel"
|
244
|
-
onClick={cancelButtonProps
|
245
|
-
label={cancelButtonProps
|
249
|
+
onClick={cancelButtonProps?.onClick}
|
250
|
+
label={cancelButtonProps?.text}
|
246
251
|
/>
|
247
252
|
<Button
|
248
253
|
variant="secondary"
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
2
|
-
interface ButtonProps {
|
3
|
-
text: string;
|
4
|
-
onClick: () => void;
|
5
|
-
}
|
6
2
|
interface ModalDimensions {
|
7
3
|
width?: number;
|
8
4
|
height?: number;
|
@@ -23,11 +19,11 @@ export interface MiniEditModalProps {
|
|
23
19
|
/**
|
24
20
|
* Props for the cancel button inside the modal
|
25
21
|
*/
|
26
|
-
cancelButtonProps
|
22
|
+
cancelButtonProps?: any;
|
27
23
|
/**
|
28
24
|
* Props for the proceed button inside the modal.
|
29
25
|
*/
|
30
|
-
proceedButtonProps
|
26
|
+
proceedButtonProps?: any;
|
31
27
|
/**
|
32
28
|
* Optional content for the footer of the modal.
|
33
29
|
*/
|
@@ -44,6 +40,10 @@ export interface MiniEditModalProps {
|
|
44
40
|
* Specifies if the modal should behave as a popover with an arrow.
|
45
41
|
*/
|
46
42
|
isPopOver?: boolean;
|
43
|
+
/**
|
44
|
+
* Specifies if the modal should behave as a popover with an arrow.
|
45
|
+
*/
|
46
|
+
isIconModel?: boolean;
|
47
47
|
/**
|
48
48
|
* Sets the position of the modal relative to its anchor.
|
49
49
|
* bottom: The modal appears below the anchor.
|
@@ -5,6 +5,7 @@ import Icon from '../Icon';
|
|
5
5
|
import { SearchProps } from './types';
|
6
6
|
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
7
7
|
import Typography from '../Typography';
|
8
|
+
import Tooltip from '../Tooltip';
|
8
9
|
|
9
10
|
const Search = ({
|
10
11
|
placeholder = 'Search',
|
@@ -45,9 +46,11 @@ const Search = ({
|
|
45
46
|
disabled: disabled,
|
46
47
|
})}
|
47
48
|
>
|
48
|
-
<
|
49
|
-
<
|
50
|
-
|
49
|
+
<Tooltip placement="top" title="Search">
|
50
|
+
<div className="ff-search-icon" onClick={handleIconClick}>
|
51
|
+
<Icon name="search" height={14} width={14} />
|
52
|
+
</div>
|
53
|
+
</Tooltip>
|
51
54
|
<div
|
52
55
|
className={classNames('ff-vertical-line', {
|
53
56
|
expanded: isExpanded,
|
package/src/index.ts
CHANGED
@@ -23,7 +23,7 @@ import LazyLoad from './components/LazyLoad/LazyLoad';
|
|
23
23
|
import ThemeProvider from './components/ThemeProvider';
|
24
24
|
import Typography from './components/Typography';
|
25
25
|
import useTheme from './hooks/useTheme';
|
26
|
-
import
|
26
|
+
import Form from './components/Form/Forms';
|
27
27
|
import InputWithDropdown from './components/InputWithDropdown';
|
28
28
|
import RadioButton from './components/RadioButton';
|
29
29
|
import RadioGroup from './components/RadioGroup';
|
@@ -98,7 +98,7 @@ export {
|
|
98
98
|
Table,
|
99
99
|
RadioButton,
|
100
100
|
RadioGroup,
|
101
|
-
|
101
|
+
Form,
|
102
102
|
MiniModal,
|
103
103
|
Container,
|
104
104
|
Row,
|