pixel-react 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/AppHeader/types.d.ts +11 -2
- package/lib/components/Avatar/Avatar.d.ts +5 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Avatar/index.d.ts +1 -0
- package/lib/components/Avatar/types.d.ts +26 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
- package/lib/components/ExcelFile/Types.d.ts +2 -49
- package/lib/components/Form/Form.d.ts +1 -15
- package/lib/components/Form/Form.stories.d.ts +6 -5
- package/lib/components/Form/Forms.d.ts +8 -0
- package/lib/components/Form/index.d.ts +1 -1
- package/lib/components/InputWithDropdown/types.d.ts +1 -1
- package/lib/components/LabelEditTextField/LabelEditTextField.d.ts +5 -0
- package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +11 -0
- package/lib/components/LabelEditTextField/index.d.ts +1 -0
- package/lib/components/LabelEditTextField/types.d.ts +38 -0
- package/lib/components/MenuOption/types.d.ts +7 -7
- package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/ModulesChip/index.d.ts +1 -0
- package/lib/components/ModulesChip/types.d.ts +14 -0
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +2 -0
- package/lib/components/Select/types.d.ts +11 -4
- package/lib/components/Toastify/Toastify.d.ts +8 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toastify/index.d.ts +1 -0
- package/lib/components/Toastify/types.d.ts +7 -0
- package/lib/components/Tooltip/types.d.ts +6 -0
- package/lib/components/Typography/types.d.ts +1 -0
- package/lib/index.d.ts +130 -29
- package/lib/index.esm.js +26882 -872
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26881 -866
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getSelectOptionValue/getSelectOptionValue.d.ts +8 -0
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
- package/src/assets/Themes/BaseTheme.scss +10 -1
- package/src/assets/Themes/DarkTheme.scss +19 -8
- package/src/assets/icons/client_profile.svg +4 -0
- package/src/assets/icons/fireflink_finder_logo.svg +7 -0
- package/src/assets/icons/fireflink_platform.svg +4 -0
- package/src/assets/icons/license_expired.svg +20 -0
- package/src/components/AppHeader/AppHeader.scss +5 -2
- package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
- package/src/components/AppHeader/AppHeader.tsx +29 -11
- package/src/components/AppHeader/types.ts +11 -3
- package/src/components/Avatar/Avatar.scss +24 -0
- package/src/components/Avatar/Avatar.stories.tsx +56 -0
- package/src/components/Avatar/Avatar.tsx +25 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Avatar/types.ts +27 -0
- package/src/components/Drawer/Drawer.scss +0 -1
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
- package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
- package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
- package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
- package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
- package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
- package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
- package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
- package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
- package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
- package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
- package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
- package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
- package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
- package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
- package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
- package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
- package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
- package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
- package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
- package/src/components/ExcelFile/Types.ts +3 -70
- package/src/components/ExcelFile/index.ts +1 -1
- package/src/components/Form/Form.d.ts +3 -0
- package/src/components/Form/Form.scss +31 -4
- package/src/components/Form/Form.stories.tsx +172 -138
- package/src/components/Form/Form.ts +2 -0
- package/src/components/Form/Forms.tsx +25 -0
- package/src/components/Form/index.ts +1 -1
- package/src/components/Icon/Icons.scss +1 -0
- package/src/components/Icon/iconList.ts +8 -0
- package/src/components/IconButton/IconButton.scss +1 -1
- package/src/components/InputWithDropdown/types.ts +1 -1
- package/src/components/LabelEditTextField/LabelEditTextField.scss +85 -0
- package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +136 -0
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +207 -0
- package/src/components/LabelEditTextField/index.ts +1 -0
- package/src/components/LabelEditTextField/types.ts +38 -0
- package/src/components/MenuOption/types.ts +7 -6
- package/src/components/ModulesChip/ModuleChip.scss +20 -0
- package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
- package/src/components/ModulesChip/ModuleChip.tsx +31 -0
- package/src/components/ModulesChip/index.ts +1 -0
- package/src/components/ModulesChip/types.ts +14 -0
- package/src/components/MultiSelect/Dropdown.tsx +6 -1
- package/src/components/MultiSelect/MultiSelect.scss +17 -10
- package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
- package/src/components/MultiSelect/MultiSelect.tsx +11 -4
- package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.stories.tsx +5 -3
- package/src/components/Select/Select.tsx +15 -7
- package/src/components/Select/components/Dropdown/Dropdown.tsx +3 -1
- package/src/components/Select/components/Dropdown/dropdownTypes.ts +3 -0
- package/src/components/Select/types.ts +12 -5
- package/src/components/Toastify/Toastify.stories.tsx +52 -0
- package/src/components/Toastify/Toastify.tsx +66 -0
- package/src/components/Toastify/index.ts +1 -0
- package/src/components/Toastify/types.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/Tooltip/types.ts +6 -0
- package/src/components/Typography/Typography.scss +12 -4
- package/src/components/Typography/Typography.stories.tsx +2 -0
- package/src/components/Typography/Typography.tsx +2 -0
- package/src/components/Typography/types.ts +1 -0
- package/src/index.ts +12 -2
- package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +31 -0
- package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
- package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
- package/src/components/Form/Form.tsx +0 -57
@@ -1,22 +1,31 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import {
|
1
|
+
import Forms from './Forms';
|
2
|
+
import Input from '../Input';
|
3
|
+
import RadioGroup from '../RadioGroup';
|
4
|
+
import Select from '../Select';
|
5
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
6
6
|
import Typography from '../Typography';
|
7
|
+
import './Form.scss';
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
type FormValues = {
|
10
|
+
username: string;
|
11
|
+
email: string;
|
12
|
+
password: string;
|
13
|
+
gender: string;
|
14
|
+
language: string;
|
15
|
+
};
|
16
|
+
|
17
|
+
const meta: Meta<typeof Forms> = {
|
18
|
+
title: 'Components/Forms',
|
19
|
+
component: Forms,
|
11
20
|
parameters: {
|
12
21
|
layout: 'centered',
|
13
22
|
},
|
14
23
|
tags: ['autodocs'],
|
15
24
|
};
|
16
25
|
|
17
|
-
type Story = StoryObj<typeof
|
26
|
+
type Story = StoryObj<typeof Forms>;
|
18
27
|
|
19
|
-
export const
|
28
|
+
export const WithDefaultValues: Story = {
|
20
29
|
render: () => {
|
21
30
|
const initialFormState: FormValues = {
|
22
31
|
username: '',
|
@@ -26,152 +35,177 @@ export const WithControlledState: Story = {
|
|
26
35
|
language: '',
|
27
36
|
};
|
28
37
|
|
29
|
-
const
|
30
|
-
|
31
|
-
const handleSubmit = (data: FormValues) => {
|
32
|
-
setFormData(data);
|
38
|
+
const onSubmit = (data: FormValues) => {
|
33
39
|
alert('Form submitted with: ' + JSON.stringify(data));
|
34
40
|
};
|
35
41
|
|
36
|
-
const handleReset = (
|
37
|
-
setValue: (field: keyof FormValues, value: any) => void
|
38
|
-
) => {
|
39
|
-
Object.keys(initialFormState).forEach((field) => {
|
40
|
-
setValue(
|
41
|
-
field as keyof FormValues,
|
42
|
-
initialFormState[field as keyof FormValues]
|
43
|
-
);
|
44
|
-
});
|
45
|
-
setFormData(initialFormState);
|
46
|
-
};
|
47
|
-
|
48
42
|
return (
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
</
|
93
|
-
|
43
|
+
<Forms<FormValues> onSubmit={onSubmit} defaultValues={initialFormState}>
|
44
|
+
{({
|
45
|
+
register,
|
46
|
+
formState: { errors },
|
47
|
+
setValue,
|
48
|
+
watch,
|
49
|
+
reset,
|
50
|
+
trigger,
|
51
|
+
}) => {
|
52
|
+
return (
|
53
|
+
<div className="ff-main">
|
54
|
+
{/* Username Field */}
|
55
|
+
<div>
|
56
|
+
<Typography as="label">username</Typography>
|
57
|
+
<Input
|
58
|
+
type="text"
|
59
|
+
{...register('username', {
|
60
|
+
required: 'Username is required',
|
61
|
+
minLength: {
|
62
|
+
value: 3,
|
63
|
+
message: 'Username must be at least 3 characters',
|
64
|
+
},
|
65
|
+
maxLength: {
|
66
|
+
value: 15,
|
67
|
+
message: 'Username must not exceed 15 characters',
|
68
|
+
},
|
69
|
+
})}
|
70
|
+
error={!!errors.username?.message}
|
71
|
+
helperText={errors.username?.message}
|
72
|
+
value={watch('username')}
|
73
|
+
onChange={(e) =>
|
74
|
+
setValue('username', e.target.value, {
|
75
|
+
shouldValidate: false,
|
76
|
+
})
|
77
|
+
}
|
78
|
+
onBlur={() => {
|
79
|
+
trigger('username');
|
80
|
+
}}
|
81
|
+
/>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
{/* Email Field */}
|
85
|
+
<div>
|
86
|
+
<Typography as="label">Email</Typography>
|
87
|
+
|
88
|
+
<Input
|
89
|
+
type="email"
|
90
|
+
{...register('email', {
|
91
|
+
required: 'Email is required',
|
92
|
+
pattern: {
|
93
|
+
value: /^\S+@\S+\.\S+$/,
|
94
|
+
message: 'Please enter a valid email',
|
95
|
+
},
|
96
|
+
})}
|
97
|
+
error={!!errors.email?.message}
|
98
|
+
helperText={errors.email?.message}
|
99
|
+
value={watch('email')}
|
100
|
+
onChange={(e) =>
|
101
|
+
setValue('email', e.target.value, { shouldValidate: false })
|
102
|
+
}
|
103
|
+
onBlur={() => {
|
104
|
+
trigger('email');
|
105
|
+
}}
|
106
|
+
/>
|
107
|
+
</div>
|
94
108
|
|
95
|
-
{/*
|
96
|
-
<div
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
109
|
+
{/* Password Field */}
|
110
|
+
<div>
|
111
|
+
<Typography as="label">Password</Typography>
|
112
|
+
|
113
|
+
<Input
|
114
|
+
type="password"
|
115
|
+
{...register('password', {
|
116
|
+
required: 'Password is required',
|
117
|
+
minLength: {
|
118
|
+
value: 6,
|
119
|
+
message: 'Password must be at least 6 characters',
|
120
|
+
},
|
121
|
+
})}
|
122
|
+
error={!!errors.password?.message}
|
123
|
+
helperText={errors.password?.message}
|
124
|
+
value={watch('password')}
|
125
|
+
onChange={(e) =>
|
126
|
+
setValue('password', e.target.value, {
|
127
|
+
shouldValidate: true,
|
128
|
+
})
|
129
|
+
}
|
130
|
+
onBlur={() => {
|
131
|
+
trigger('password');
|
132
|
+
}}
|
133
|
+
/>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
{/* Gender Field */}
|
137
|
+
<div>
|
138
|
+
<Typography as="label">Gender</Typography>
|
139
|
+
|
140
|
+
<RadioGroup
|
141
|
+
options={[
|
142
|
+
{
|
143
|
+
label: 'Male',
|
144
|
+
value: 'male',
|
145
|
+
},
|
146
|
+
{
|
147
|
+
label: 'Female',
|
148
|
+
value: 'female',
|
149
|
+
},
|
150
|
+
{
|
151
|
+
label: 'Other',
|
152
|
+
value: 'other',
|
153
|
+
},
|
154
|
+
]}
|
155
|
+
selectedValue={watch('gender')}
|
156
|
+
onChange={(option) => {
|
157
|
+
setValue('gender', option.value);
|
158
|
+
}}
|
159
|
+
name="gender"
|
160
|
+
/>
|
161
|
+
{errors?.gender && (
|
162
|
+
<span className="ff-error">{errors.gender.message}</span>
|
120
163
|
)}
|
121
|
-
</div>
|
122
164
|
</div>
|
123
165
|
|
124
|
-
{/* Language
|
125
|
-
<div className="ff-
|
126
|
-
<Typography as=
|
127
|
-
<
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
...prev,
|
137
|
-
language: value,
|
138
|
-
}));
|
139
|
-
if (value) {
|
140
|
-
setValue('language', value);
|
141
|
-
}
|
166
|
+
{/* Language Field */}
|
167
|
+
<div className="ff-select">
|
168
|
+
<Typography as="label">Programming Language</Typography>
|
169
|
+
<Select
|
170
|
+
optionsList={[
|
171
|
+
{ label: 'Java', value: 'Java' },
|
172
|
+
{ label: 'Rust', value: 'Rust' },
|
173
|
+
{ label: 'Dart', value: 'Dart' },
|
174
|
+
]}
|
175
|
+
selectedOption={{
|
176
|
+
label: watch('language') || 'Select a language',
|
177
|
+
value: watch('language') || '',
|
142
178
|
}}
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
<span className="ff-error">
|
153
|
-
{String(errors.language.message)}
|
154
|
-
</span>
|
179
|
+
{...register('language', {
|
180
|
+
required: 'Programming language is required',
|
181
|
+
})}
|
182
|
+
onChange={(option) =>
|
183
|
+
setValue('language', option.value, { shouldValidate: true })
|
184
|
+
}
|
185
|
+
/>
|
186
|
+
{errors?.gender && (
|
187
|
+
<span className="ff-error">{errors?.language?.message}</span>
|
155
188
|
)}
|
156
189
|
</div>
|
157
190
|
|
191
|
+
{/* Buttons */}
|
158
192
|
<div className="ff-button-layout">
|
159
193
|
<button type="submit">Submit</button>
|
160
|
-
<button
|
194
|
+
<button
|
195
|
+
type="button"
|
196
|
+
onClick={() => {
|
197
|
+
reset(initialFormState);
|
198
|
+
}}
|
199
|
+
>
|
161
200
|
Reset
|
162
201
|
</button>
|
163
202
|
</div>
|
164
|
-
|
165
|
-
)
|
166
|
-
|
167
|
-
|
168
|
-
<pre>
|
169
|
-
<span>Payload Data:</span>
|
170
|
-
</pre>
|
171
|
-
<pre>{JSON.stringify(formData, null, 2)}</pre>
|
172
|
-
</div>
|
203
|
+
</div>
|
204
|
+
);
|
205
|
+
}}
|
206
|
+
</Forms>
|
173
207
|
);
|
174
208
|
},
|
175
209
|
};
|
176
210
|
|
177
|
-
export default meta;
|
211
|
+
export default meta;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import Form from './Form';
|
3
|
+
|
4
|
+
interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
5
|
+
onSubmit: Form.SubmitHandler<T>;
|
6
|
+
children: (methods: ReturnType<typeof Form.useForm<T>>) => React.ReactNode;
|
7
|
+
}
|
8
|
+
|
9
|
+
const Forms = <T extends Form.FieldValues>({
|
10
|
+
onSubmit,
|
11
|
+
children,
|
12
|
+
...rest
|
13
|
+
}: FormProps<T>) => {
|
14
|
+
const methods = Form.useForm<T>(rest);
|
15
|
+
|
16
|
+
const { handleSubmit } = methods;
|
17
|
+
|
18
|
+
return (
|
19
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
20
|
+
{children(methods)}
|
21
|
+
</form>
|
22
|
+
);
|
23
|
+
};
|
24
|
+
|
25
|
+
export default Forms;
|
@@ -1 +1 @@
|
|
1
|
-
export
|
1
|
+
export * from './Form';
|
@@ -120,6 +120,10 @@ import MoveIcon from '../../assets/icons/move_icon.svg?react';
|
|
120
120
|
import Jira from '../../assets/icons/jira.svg?react';
|
121
121
|
import HistoryIcon from '../../assets//icons/history_icon.svg?react';
|
122
122
|
import LinkedDefects from '../../assets//icons/linked_defects.svg?react';
|
123
|
+
import FireflinkPlatform from '../../assets//icons/fireflink_platform.svg?react';
|
124
|
+
import FireflinkFinder from '../../assets//icons/fireflink_finder_logo.svg?react';
|
125
|
+
import ClientProfile from '../../assets//icons/client_profile.svg?react'
|
126
|
+
import LicenseExpired from '../../assets//icons/license_expired.svg?react';
|
123
127
|
|
124
128
|
Components['delete_info'] = DeleteInfoIcon;
|
125
129
|
Components['success'] = ToastSuccessIcon;
|
@@ -238,5 +242,9 @@ Components['no_access_icon'] = NoAccessIcon;
|
|
238
242
|
Components['full_access_icon'] = FullAccessIcon;
|
239
243
|
Components['view_access_icon'] = ViewAccessIcon;
|
240
244
|
Components['eye_closed'] = EyeClosed;
|
245
|
+
Components['fireflink_platform_logo'] = FireflinkPlatform;
|
246
|
+
Components['fireflink_finder_logo'] = FireflinkFinder;
|
247
|
+
Components['client_profile'] = ClientProfile;
|
248
|
+
Components['license_expired'] = LicenseExpired;
|
241
249
|
|
242
250
|
export default Components;
|
@@ -74,7 +74,7 @@ export interface InputWithDropdownProps {
|
|
74
74
|
/**
|
75
75
|
* onChange handler for dropdown changes
|
76
76
|
*/
|
77
|
-
onDropdownChangeHandler?: (option:
|
77
|
+
onDropdownChangeHandler?: (option: any) => void;
|
78
78
|
|
79
79
|
/**
|
80
80
|
* onInputBlurHandler action for input field
|
@@ -0,0 +1,85 @@
|
|
1
|
+
@use '../../assets/styles/fonts' as *;
|
2
|
+
|
3
|
+
.ff-label-edit-text-field {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
position: relative;
|
7
|
+
width: 100%;
|
8
|
+
.ff-label-text-field {
|
9
|
+
display: flex;
|
10
|
+
gap: 10px;
|
11
|
+
}
|
12
|
+
.ff-label-text-field-with-dropdown,
|
13
|
+
.ff-label-text-field-without-dropdown {
|
14
|
+
position: relative;
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
}
|
18
|
+
.ff-label {
|
19
|
+
position: absolute;
|
20
|
+
top: 0;
|
21
|
+
left: 10px;
|
22
|
+
transform: translateY(-50%);
|
23
|
+
transition: all 0.2s ease;
|
24
|
+
color: var(--label-edit-text-label-color);
|
25
|
+
background: var(--label-edit-text-background-color);
|
26
|
+
padding: 0 4px;
|
27
|
+
@extend .font-size-8;
|
28
|
+
}
|
29
|
+
.ff-textfield-label {
|
30
|
+
@extend .ff-label;
|
31
|
+
top: 5px;
|
32
|
+
}
|
33
|
+
|
34
|
+
.display-text {
|
35
|
+
padding: 4px;
|
36
|
+
border-radius: 4px;
|
37
|
+
cursor: pointer;
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
}
|
41
|
+
|
42
|
+
.ff-text-field,
|
43
|
+
.dropdown {
|
44
|
+
border: 1px solid var(--label-edit-text-label-color);
|
45
|
+
outline: none;
|
46
|
+
width: fit-content;
|
47
|
+
@extend .fontSm;
|
48
|
+
}
|
49
|
+
.ff-text-field {
|
50
|
+
padding: 0 4px;
|
51
|
+
border-radius: 4px;
|
52
|
+
}
|
53
|
+
.ff-text-dropdown-field {
|
54
|
+
flex: 2;
|
55
|
+
border: 1px solid var(--label-edit-text-label-color);
|
56
|
+
border-radius: 4px 0 0 4px;
|
57
|
+
border-right: none;
|
58
|
+
border-width: thin;
|
59
|
+
padding-left: 5px;
|
60
|
+
@extend .fontSm;
|
61
|
+
&:focus-visible {
|
62
|
+
outline: none;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
.dropdown {
|
66
|
+
border-radius: 0 4px 4px 0;
|
67
|
+
flex: 1;
|
68
|
+
height: inherit;
|
69
|
+
}
|
70
|
+
|
71
|
+
.ff-icon-container {
|
72
|
+
display: flex;
|
73
|
+
gap: 8px;
|
74
|
+
align-items: center;
|
75
|
+
.confirm-icon,
|
76
|
+
.cancel-icon {
|
77
|
+
cursor: pointer;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
.error-text {
|
82
|
+
margin: 0;
|
83
|
+
color: var(--label-edit-error-text);
|
84
|
+
}
|
85
|
+
}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import LabelEditTextField from './LabelEditTextField';
|
3
|
+
import '../../assets/styles/_colors.scss';
|
4
|
+
import './LabelEditTextField.scss';
|
5
|
+
|
6
|
+
const meta: Meta<typeof LabelEditTextField> = {
|
7
|
+
title: 'Components/LabelEditTextField',
|
8
|
+
component: LabelEditTextField,
|
9
|
+
parameters: {
|
10
|
+
layout: 'centered',
|
11
|
+
},
|
12
|
+
tags: ['autodocs'],
|
13
|
+
};
|
14
|
+
|
15
|
+
type Story = StoryObj<typeof LabelEditTextField>;
|
16
|
+
export const textField: Story = {
|
17
|
+
render: () => {
|
18
|
+
const handleConfirmAction = (inputValue: string) => {
|
19
|
+
//DEMO: we are getting that value from LabelEditTextField
|
20
|
+
console.log('Confirmed input value:', inputValue);
|
21
|
+
};
|
22
|
+
return (
|
23
|
+
<LabelEditTextField
|
24
|
+
label="Add Module"
|
25
|
+
text="Verify The Function Of Categories For" //it might be state
|
26
|
+
confirmIcon={{
|
27
|
+
name: 'update_icon',
|
28
|
+
onClick: () => {},
|
29
|
+
}}
|
30
|
+
cancelIcon={{
|
31
|
+
name: 'close',
|
32
|
+
onClick: () => {},
|
33
|
+
}}
|
34
|
+
width="300px"
|
35
|
+
height="22px"
|
36
|
+
confirmAction={handleConfirmAction}
|
37
|
+
/>
|
38
|
+
);
|
39
|
+
},
|
40
|
+
};
|
41
|
+
export const textFieldWithOutLabel: Story = {
|
42
|
+
render: () => {
|
43
|
+
const handleConfirmAction = (inputValue: string) => {
|
44
|
+
//DEMO: we are getting that value from LabelEditTextField
|
45
|
+
console.log('Confirmed input value:', inputValue);
|
46
|
+
};
|
47
|
+
return (
|
48
|
+
<LabelEditTextField
|
49
|
+
text="Verify The Function Of Categories For" //it might be state
|
50
|
+
confirmIcon={{
|
51
|
+
name: 'update_icon',
|
52
|
+
onClick: () => {},
|
53
|
+
}}
|
54
|
+
cancelIcon={{
|
55
|
+
name: 'close',
|
56
|
+
onClick: () => {},
|
57
|
+
}}
|
58
|
+
width="300px"
|
59
|
+
height="22px"
|
60
|
+
confirmAction={handleConfirmAction}
|
61
|
+
/>
|
62
|
+
);
|
63
|
+
},
|
64
|
+
};
|
65
|
+
export const textFieldWithDropdown: Story = {
|
66
|
+
render: () => {
|
67
|
+
const handleConfirmAction = (inputValue: string, dropdownValue: string) => {
|
68
|
+
//DEMO: we are getting that value from LabelEditTextField
|
69
|
+
console.log(
|
70
|
+
'Confirmed input value and dropdown value:',
|
71
|
+
inputValue,
|
72
|
+
dropdownValue
|
73
|
+
);
|
74
|
+
};
|
75
|
+
return (
|
76
|
+
<LabelEditTextField
|
77
|
+
label="Add Module"
|
78
|
+
text="Verify The Function Of Categories For"
|
79
|
+
confirmIcon={{
|
80
|
+
name: 'update_icon',
|
81
|
+
onClick: () => {},
|
82
|
+
}}
|
83
|
+
cancelIcon={{
|
84
|
+
name: 'close',
|
85
|
+
onClick: () => {},
|
86
|
+
}}
|
87
|
+
variant="textFieldWithDropdown"
|
88
|
+
dropdownData={[
|
89
|
+
{ id: 1, value: 'web', label: 'Web & Mobile' },
|
90
|
+
{ id: 2, value: 'desktop', label: 'Desktop' },
|
91
|
+
]}
|
92
|
+
width="300px"
|
93
|
+
height="22px"
|
94
|
+
confirmAction={handleConfirmAction}
|
95
|
+
/>
|
96
|
+
);
|
97
|
+
},
|
98
|
+
};
|
99
|
+
export const textFieldWithHighlight: Story = {
|
100
|
+
render: () => {
|
101
|
+
const handleConfirmAction = (inputValue: string, dropdownValue: string) => {
|
102
|
+
//DEMO: we are getting that value from LabelEditTextField
|
103
|
+
|
104
|
+
console.log(
|
105
|
+
'Confirmed input value and dropdown value:',
|
106
|
+
inputValue,
|
107
|
+
dropdownValue
|
108
|
+
);
|
109
|
+
};
|
110
|
+
return (
|
111
|
+
<LabelEditTextField
|
112
|
+
label="Add Module"
|
113
|
+
text="Verify The Function Of Categories For"
|
114
|
+
highlightText="The Function"
|
115
|
+
confirmIcon={{
|
116
|
+
name: 'update_icon',
|
117
|
+
onClick: () => {},
|
118
|
+
}}
|
119
|
+
cancelIcon={{
|
120
|
+
name: 'close',
|
121
|
+
onClick: () => {},
|
122
|
+
}}
|
123
|
+
variant="textFieldWithDropdown"
|
124
|
+
dropdownData={[
|
125
|
+
{ id: 1, value: 'web', label: 'Web & Mobile' },
|
126
|
+
{ id: 2, value: 'desktop', label: 'Desktop' },
|
127
|
+
]}
|
128
|
+
width="400px"
|
129
|
+
height="22px"
|
130
|
+
confirmAction={handleConfirmAction}
|
131
|
+
/>
|
132
|
+
);
|
133
|
+
},
|
134
|
+
};
|
135
|
+
|
136
|
+
export default meta;
|