sag_components 2.0.0-beta176 → 2.0.0-beta177
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/dist/index.d.ts +14 -1
- package/dist/index.esm.js +214 -130
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +214 -130
- package/dist/index.js.map +1 -1
- package/dist/types/components/Input/Input.d.ts +14 -1
- package/dist/types/components/Input/Input.stories.d.ts +85 -14
- package/dist/types/components/Input/Input.style.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1300,7 +1300,7 @@ declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, t
|
|
|
1300
1300
|
selectedValue: any;
|
|
1301
1301
|
}): react_jsx_runtime.JSX.Element;
|
|
1302
1302
|
|
|
1303
|
-
declare function Input({ label, labelEmptyValue, size, selectedValue, placeHolder, onChange, onBlur, required, disabled, isDarkerBackground, width, error, errorMessage, labelColor, leftIcon, rightIcon, password, leftIconOnClick, rightIconOnClick, }: {
|
|
1303
|
+
declare function Input({ label, labelEmptyValue, size, selectedValue, placeHolder, onChange, onBlur, required, disabled, isDarkerBackground, width, height, error, errorMessage, labelColor, leftIcon, rightIcon, password, leftIconOnClick, rightIconOnClick, multiline, rows, maxLength, }: {
|
|
1304
1304
|
label: any;
|
|
1305
1305
|
labelEmptyValue: any;
|
|
1306
1306
|
size: any;
|
|
@@ -1312,6 +1312,7 @@ declare function Input({ label, labelEmptyValue, size, selectedValue, placeHolde
|
|
|
1312
1312
|
disabled: any;
|
|
1313
1313
|
isDarkerBackground?: boolean;
|
|
1314
1314
|
width: any;
|
|
1315
|
+
height?: string;
|
|
1315
1316
|
error: any;
|
|
1316
1317
|
errorMessage: any;
|
|
1317
1318
|
labelColor: any;
|
|
@@ -1320,6 +1321,9 @@ declare function Input({ label, labelEmptyValue, size, selectedValue, placeHolde
|
|
|
1320
1321
|
password: any;
|
|
1321
1322
|
leftIconOnClick: any;
|
|
1322
1323
|
rightIconOnClick: any;
|
|
1324
|
+
multiline?: boolean;
|
|
1325
|
+
rows?: number;
|
|
1326
|
+
maxLength: any;
|
|
1323
1327
|
}): react_jsx_runtime.JSX.Element;
|
|
1324
1328
|
declare namespace Input {
|
|
1325
1329
|
namespace propTypes {
|
|
@@ -1341,6 +1345,9 @@ declare namespace Input {
|
|
|
1341
1345
|
const leftIcon: PropTypes.Requireable<string>;
|
|
1342
1346
|
const rightIcon: PropTypes.Requireable<string>;
|
|
1343
1347
|
const password: PropTypes.Requireable<boolean>;
|
|
1348
|
+
const multiline: PropTypes.Requireable<boolean>;
|
|
1349
|
+
const rows: PropTypes.Requireable<number>;
|
|
1350
|
+
const maxLength: PropTypes.Requireable<number>;
|
|
1344
1351
|
}
|
|
1345
1352
|
namespace defaultProps {
|
|
1346
1353
|
const placeHolder_1: string;
|
|
@@ -1377,6 +1384,12 @@ declare namespace Input {
|
|
|
1377
1384
|
export { onBlur_1 as onBlur };
|
|
1378
1385
|
const password_1: boolean;
|
|
1379
1386
|
export { password_1 as password };
|
|
1387
|
+
const multiline_1: boolean;
|
|
1388
|
+
export { multiline_1 as multiline };
|
|
1389
|
+
const rows_1: number;
|
|
1390
|
+
export { rows_1 as rows };
|
|
1391
|
+
const maxLength_1: any;
|
|
1392
|
+
export { maxLength_1 as maxLength };
|
|
1380
1393
|
}
|
|
1381
1394
|
}
|
|
1382
1395
|
|
package/dist/index.esm.js
CHANGED
|
@@ -10545,24 +10545,23 @@ const QuarterPopupPicker = ({
|
|
|
10545
10545
|
};
|
|
10546
10546
|
|
|
10547
10547
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10548
|
-
const QuarterPicker =
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
} = _ref;
|
|
10548
|
+
const QuarterPicker = ({
|
|
10549
|
+
availableQuarters,
|
|
10550
|
+
// ["Q1-2024"]
|
|
10551
|
+
label,
|
|
10552
|
+
onChange,
|
|
10553
|
+
borderRadius,
|
|
10554
|
+
required,
|
|
10555
|
+
width,
|
|
10556
|
+
height,
|
|
10557
|
+
placeholder,
|
|
10558
|
+
disabled,
|
|
10559
|
+
borderColor,
|
|
10560
|
+
borderColorFocus,
|
|
10561
|
+
textColor,
|
|
10562
|
+
selectedValue,
|
|
10563
|
+
startYear
|
|
10564
|
+
}) => {
|
|
10566
10565
|
const [isFocused, setIsFocused] = useState(false);
|
|
10567
10566
|
const [isOpen, setIsOpen] = useState(false);
|
|
10568
10567
|
const [value, setValue] = useState('');
|
|
@@ -11004,23 +11003,22 @@ const MonthPopupPicker = ({
|
|
|
11004
11003
|
};
|
|
11005
11004
|
|
|
11006
11005
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
11007
|
-
const MonthPicker =
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
} = _ref;
|
|
11006
|
+
const MonthPicker = ({
|
|
11007
|
+
availableMonths,
|
|
11008
|
+
label,
|
|
11009
|
+
onChange,
|
|
11010
|
+
borderRadius,
|
|
11011
|
+
required,
|
|
11012
|
+
width,
|
|
11013
|
+
height,
|
|
11014
|
+
placeholder,
|
|
11015
|
+
disabled,
|
|
11016
|
+
borderColor,
|
|
11017
|
+
borderColorFocus,
|
|
11018
|
+
textColor,
|
|
11019
|
+
selectedValue,
|
|
11020
|
+
startYear
|
|
11021
|
+
}) => {
|
|
11024
11022
|
const [isFocused, setIsFocused] = useState(false);
|
|
11025
11023
|
const [isOpen, setIsOpen] = useState(false);
|
|
11026
11024
|
const [value, setValue] = useState('');
|
|
@@ -24131,22 +24129,21 @@ const DeleteIcon = styled.div`
|
|
|
24131
24129
|
position: absolute;
|
|
24132
24130
|
`;
|
|
24133
24131
|
|
|
24134
|
-
const QuickFilterDropdownSingle =
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24141
|
-
|
|
24142
|
-
|
|
24143
|
-
|
|
24144
|
-
|
|
24145
|
-
|
|
24146
|
-
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
} = _ref;
|
|
24132
|
+
const QuickFilterDropdownSingle = ({
|
|
24133
|
+
label,
|
|
24134
|
+
hoverColor,
|
|
24135
|
+
options,
|
|
24136
|
+
selectedValue,
|
|
24137
|
+
placeHolder,
|
|
24138
|
+
onChange,
|
|
24139
|
+
disabled,
|
|
24140
|
+
width,
|
|
24141
|
+
error,
|
|
24142
|
+
errorMessage,
|
|
24143
|
+
xIconShow,
|
|
24144
|
+
labelColor,
|
|
24145
|
+
showLabelOnTop
|
|
24146
|
+
}) => {
|
|
24150
24147
|
const [isFocused, setIsFocused] = useState(false);
|
|
24151
24148
|
const [showOptions, setShowOptions] = useState(false);
|
|
24152
24149
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -24543,24 +24540,23 @@ const IconContainer$2 = styled.div`
|
|
|
24543
24540
|
cursor: pointer;
|
|
24544
24541
|
`;
|
|
24545
24542
|
|
|
24546
|
-
const QuickFilterDropdownMultiSelection =
|
|
24547
|
-
|
|
24548
|
-
|
|
24549
|
-
|
|
24550
|
-
|
|
24551
|
-
|
|
24552
|
-
|
|
24553
|
-
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
} = _ref;
|
|
24543
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24544
|
+
label,
|
|
24545
|
+
labelEmptyValue,
|
|
24546
|
+
options,
|
|
24547
|
+
selectedValue,
|
|
24548
|
+
placeHolder,
|
|
24549
|
+
onChange,
|
|
24550
|
+
required,
|
|
24551
|
+
disabled,
|
|
24552
|
+
width,
|
|
24553
|
+
error,
|
|
24554
|
+
errorMessage,
|
|
24555
|
+
labelColor,
|
|
24556
|
+
xIconShow,
|
|
24557
|
+
checkBoxColor,
|
|
24558
|
+
showLabelOnTop
|
|
24559
|
+
}) => {
|
|
24564
24560
|
const [isFocused, setIsFocused] = useState(false);
|
|
24565
24561
|
const [showOptions, setShowOptions] = useState(false);
|
|
24566
24562
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -35400,18 +35396,19 @@ const MainContainer = styled.div`
|
|
|
35400
35396
|
display: flex;
|
|
35401
35397
|
flex-direction: column;
|
|
35402
35398
|
align-content: center;
|
|
35403
|
-
justify-content:
|
|
35399
|
+
justify-content: flex-start;
|
|
35404
35400
|
align-items: flex-start;
|
|
35405
|
-
width: ${props => props.width || '300px'};
|
|
35401
|
+
width: ${props => props.width || '300px'};
|
|
35402
|
+
height: ${props => props.height || '45px'};
|
|
35406
35403
|
font-family: "Poppins", sans-serif;
|
|
35407
35404
|
font-weight: 400;
|
|
35408
35405
|
font-size: 14px;
|
|
35409
35406
|
border-radius: ${props => props.size === 'small' ? '8px' : '12px'};
|
|
35410
35407
|
padding: 0;
|
|
35411
35408
|
cursor: ${props => props.disabled ? 'not-allowed' : 'default'};
|
|
35409
|
+
min-height: ${props => props.multiline ? '80px' : 'auto'};
|
|
35412
35410
|
`;
|
|
35413
35411
|
const Label$3 = styled.label`
|
|
35414
|
-
|
|
35415
35412
|
font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
|
|
35416
35413
|
font-weight: 400;
|
|
35417
35414
|
padding-inline-end: 5px;
|
|
@@ -35421,8 +35418,18 @@ const Label$3 = styled.label`
|
|
|
35421
35418
|
color: ${props => props.error ? 'red' : props.disabled ? '#D0D0D0' : props.labelColor};
|
|
35422
35419
|
background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
35423
35420
|
position: absolute;
|
|
35424
|
-
top: ${props =>
|
|
35425
|
-
|
|
35421
|
+
top: ${props => {
|
|
35422
|
+
if (props.multiline) {
|
|
35423
|
+
return props.isFocused || props.hasValue ? '0px' : '20px';
|
|
35424
|
+
}
|
|
35425
|
+
return props.isFocused || props.hasValue ? '0px' : props.size === 'medium' ? '27px' : '17px';
|
|
35426
|
+
}};
|
|
35427
|
+
left: ${props => {
|
|
35428
|
+
if (props.multiline) {
|
|
35429
|
+
return props.isFocused || props.hasValue ? '23px' : '16px';
|
|
35430
|
+
}
|
|
35431
|
+
return props.isFocused || props.hasValue ? '23px' : props.leftIcon && props.leftIcon !== 'none' ? '42px' : '16px';
|
|
35432
|
+
}};
|
|
35426
35433
|
font-family: Poppins;
|
|
35427
35434
|
transform: translateY(-50%);
|
|
35428
35435
|
transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;
|
|
@@ -35439,17 +35446,17 @@ const InputContainer = styled.div`
|
|
|
35439
35446
|
display: flex;
|
|
35440
35447
|
flex-wrap: nowrap;
|
|
35441
35448
|
justify-content: flex-start;
|
|
35442
|
-
align-content: center;
|
|
35449
|
+
align-content: ${props => props.multiline ? 'flex-start' : 'center'};
|
|
35443
35450
|
white-space: pre-wrap;
|
|
35444
|
-
align-items: center;
|
|
35451
|
+
align-items: ${props => props.multiline ? 'flex-start' : 'center'};
|
|
35445
35452
|
overflow: hidden;
|
|
35446
|
-
padding: 0 16px;
|
|
35447
|
-
gap: 14px;
|
|
35453
|
+
padding: ${props => props.multiline ? '16px' : '0 16px'};
|
|
35454
|
+
gap: ${props => props.multiline ? '0' : '14px'};
|
|
35448
35455
|
width: 100%;
|
|
35449
35456
|
height: 100%;
|
|
35450
35457
|
box-sizing: border-box;
|
|
35451
35458
|
background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
35452
|
-
border:
|
|
35459
|
+
border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : '#B1B1B1'};
|
|
35453
35460
|
font-family: "Poppins", sans-serif;
|
|
35454
35461
|
font-weight: 400;
|
|
35455
35462
|
font-size: 14px;
|
|
@@ -35461,10 +35468,9 @@ const InputContainer = styled.div`
|
|
|
35461
35468
|
border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : props.labelColor || '#212121'};
|
|
35462
35469
|
}
|
|
35463
35470
|
|
|
35464
|
-
&:focus {
|
|
35471
|
+
&:focus-within {
|
|
35465
35472
|
border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : props.labelColor || '#212121'};
|
|
35466
35473
|
}
|
|
35467
|
-
|
|
35468
35474
|
`;
|
|
35469
35475
|
const InputSubContainer = styled.div`
|
|
35470
35476
|
display: flex;
|
|
@@ -35472,13 +35478,16 @@ const InputSubContainer = styled.div`
|
|
|
35472
35478
|
flex-wrap: nowrap;
|
|
35473
35479
|
align-content: center;
|
|
35474
35480
|
align-items: flex-start;
|
|
35475
|
-
justify-content: center;
|
|
35481
|
+
justify-content: ${props => props.multiline ? 'flex-start' : 'center'};
|
|
35476
35482
|
white-space: pre-wrap;
|
|
35477
35483
|
overflow: hidden;
|
|
35478
|
-
padding: 5px 0;
|
|
35484
|
+
padding: ${props => props.multiline ? '5px 0 0 0' : '5px 0'};
|
|
35479
35485
|
width: 100%;
|
|
35480
|
-
height:
|
|
35481
|
-
min-height: ${props =>
|
|
35486
|
+
height: ${props => props.height || '45px'};
|
|
35487
|
+
min-height: ${props => {
|
|
35488
|
+
if (props.multiline) return 'auto';
|
|
35489
|
+
return props.size === 'medium' ? '52px' : '32px';
|
|
35490
|
+
}};
|
|
35482
35491
|
box-sizing: border-box;
|
|
35483
35492
|
background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
35484
35493
|
border-radius: ${props => props.size === 'small' ? '8px' : '12px'};
|
|
@@ -35488,14 +35497,59 @@ const InputSubContainer = styled.div`
|
|
|
35488
35497
|
`;
|
|
35489
35498
|
const StyledInput = styled.input`
|
|
35490
35499
|
width: calc(100% - 10px);
|
|
35491
|
-
height: 20px;
|
|
35500
|
+
height: ${props => props.height || '20px'};
|
|
35492
35501
|
font-weight: 400;
|
|
35493
35502
|
font-size: 14px;
|
|
35494
35503
|
outline: none;
|
|
35495
35504
|
color: ${props => props.disabled ? '#D0D0D0' : '#212121'};
|
|
35496
35505
|
background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
35497
35506
|
border: none;
|
|
35498
|
-
cursor: ${props => props.disabled ? 'not-allowed' : '
|
|
35507
|
+
cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
|
|
35508
|
+
font-family: "Poppins", sans-serif;
|
|
35509
|
+
`;
|
|
35510
|
+
const StyledTextarea = styled.textarea`
|
|
35511
|
+
width: 100%;
|
|
35512
|
+
min-height: 60px;
|
|
35513
|
+
font-weight: 400;
|
|
35514
|
+
font-size: 14px;
|
|
35515
|
+
outline: none;
|
|
35516
|
+
color: ${props => props.disabled ? '#D0D0D0' : '#212121'};
|
|
35517
|
+
background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
35518
|
+
border: none;
|
|
35519
|
+
cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
|
|
35520
|
+
font-family: "Poppins", sans-serif;
|
|
35521
|
+
resize: vertical;
|
|
35522
|
+
line-height: 1.4;
|
|
35523
|
+
padding: 0;
|
|
35524
|
+
margin-top: 10px;
|
|
35525
|
+
|
|
35526
|
+
&::placeholder {
|
|
35527
|
+
color: #999;
|
|
35528
|
+
font-style: italic;
|
|
35529
|
+
}
|
|
35530
|
+
|
|
35531
|
+
&:focus {
|
|
35532
|
+
outline: none;
|
|
35533
|
+
}
|
|
35534
|
+
|
|
35535
|
+
/* Remove default textarea styling */
|
|
35536
|
+
&::-webkit-scrollbar {
|
|
35537
|
+
width: 6px;
|
|
35538
|
+
}
|
|
35539
|
+
|
|
35540
|
+
&::-webkit-scrollbar-track {
|
|
35541
|
+
background: #f1f1f1;
|
|
35542
|
+
border-radius: 3px;
|
|
35543
|
+
}
|
|
35544
|
+
|
|
35545
|
+
&::-webkit-scrollbar-thumb {
|
|
35546
|
+
background: #c1c1c1;
|
|
35547
|
+
border-radius: 3px;
|
|
35548
|
+
}
|
|
35549
|
+
|
|
35550
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
35551
|
+
background: #a8a8a8;
|
|
35552
|
+
}
|
|
35499
35553
|
`;
|
|
35500
35554
|
const ErrorMessage = styled.div`
|
|
35501
35555
|
font-size: 12px;
|
|
@@ -35528,6 +35582,7 @@ const Input$2 = _ref => {
|
|
|
35528
35582
|
disabled,
|
|
35529
35583
|
isDarkerBackground = false,
|
|
35530
35584
|
width,
|
|
35585
|
+
height = '50px',
|
|
35531
35586
|
error,
|
|
35532
35587
|
errorMessage,
|
|
35533
35588
|
labelColor,
|
|
@@ -35535,7 +35590,12 @@ const Input$2 = _ref => {
|
|
|
35535
35590
|
rightIcon,
|
|
35536
35591
|
password,
|
|
35537
35592
|
leftIconOnClick,
|
|
35538
|
-
rightIconOnClick
|
|
35593
|
+
rightIconOnClick,
|
|
35594
|
+
multiline = false,
|
|
35595
|
+
// New prop to enable textarea mode
|
|
35596
|
+
rows = 3,
|
|
35597
|
+
// New prop for textarea rows
|
|
35598
|
+
maxLength // New prop for character limit
|
|
35539
35599
|
} = _ref;
|
|
35540
35600
|
const [isFocused, setIsFocused] = useState(false);
|
|
35541
35601
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -35609,12 +35669,24 @@ const Input$2 = _ref => {
|
|
|
35609
35669
|
}
|
|
35610
35670
|
return getIcon('eye', '14px', '14px', error ? 'red' : labelColor, disabled, 'pointer', toggleShowPassword);
|
|
35611
35671
|
};
|
|
35672
|
+
|
|
35673
|
+
// Calculate dynamic height for multiline inputs
|
|
35674
|
+
const calculateHeight = () => {
|
|
35675
|
+
if (!multiline) return height;
|
|
35676
|
+
const baseHeight = size === 'small' ? 32 : 52;
|
|
35677
|
+
const lineHeight = 20;
|
|
35678
|
+
const padding = 10;
|
|
35679
|
+
return `${baseHeight + (rows - 1) * lineHeight + padding}px`;
|
|
35680
|
+
};
|
|
35681
|
+
const InputElement = multiline ? StyledTextarea : StyledInput;
|
|
35612
35682
|
return /*#__PURE__*/React$1.createElement(MainContainer, {
|
|
35613
35683
|
className: "MainContainer",
|
|
35614
35684
|
width: width,
|
|
35685
|
+
height: calculateHeight(),
|
|
35615
35686
|
size: size,
|
|
35616
35687
|
disabled: disabled,
|
|
35617
|
-
isDarkerBackground: isDarkerBackground
|
|
35688
|
+
isDarkerBackground: isDarkerBackground,
|
|
35689
|
+
multiline: multiline
|
|
35618
35690
|
}, /*#__PURE__*/React$1.createElement(InputContainer, {
|
|
35619
35691
|
className: "InputContainer",
|
|
35620
35692
|
labelColor: labelColor,
|
|
@@ -35622,8 +35694,9 @@ const Input$2 = _ref => {
|
|
|
35622
35694
|
isDarkerBackground: isDarkerBackground,
|
|
35623
35695
|
error: error,
|
|
35624
35696
|
isFocused: isFocused,
|
|
35625
|
-
size: size
|
|
35626
|
-
|
|
35697
|
+
size: size,
|
|
35698
|
+
multiline: multiline
|
|
35699
|
+
}, !multiline && getLeftIcon(), /*#__PURE__*/React$1.createElement(InputSubContainer, {
|
|
35627
35700
|
className: "InputSubContainer",
|
|
35628
35701
|
ref: containerRef,
|
|
35629
35702
|
labelColor: labelColor,
|
|
@@ -35631,26 +35704,29 @@ const Input$2 = _ref => {
|
|
|
35631
35704
|
isDarkerBackground: isDarkerBackground,
|
|
35632
35705
|
error: error,
|
|
35633
35706
|
onClick: handleLabelClick,
|
|
35634
|
-
|
|
35707
|
+
height: calculateHeight(),
|
|
35708
|
+
size: size,
|
|
35709
|
+
multiline: multiline
|
|
35635
35710
|
}, /*#__PURE__*/React$1.createElement(Label$3, {
|
|
35636
35711
|
className: "Label",
|
|
35637
35712
|
isFocused: isFocused,
|
|
35638
35713
|
labelColor: labelColor,
|
|
35639
35714
|
hasValue: inputValue,
|
|
35640
|
-
leftIcon: leftIcon,
|
|
35715
|
+
leftIcon: !multiline ? leftIcon : 'none',
|
|
35641
35716
|
disabled: disabled,
|
|
35642
35717
|
isDarkerBackground: isDarkerBackground,
|
|
35643
35718
|
error: error,
|
|
35644
35719
|
errorMessage: errorMessage,
|
|
35645
35720
|
onClick: handleLabelClick,
|
|
35646
|
-
size: size
|
|
35721
|
+
size: size,
|
|
35722
|
+
multiline: multiline
|
|
35647
35723
|
}, inputValue ? label : labelEmptyValue || label, required && /*#__PURE__*/React$1.createElement("span", {
|
|
35648
35724
|
style: {
|
|
35649
35725
|
color: disabled ? '#D0D0D0' : 'red',
|
|
35650
35726
|
height: '16px'
|
|
35651
35727
|
}
|
|
35652
|
-
}, "*")), /*#__PURE__*/React$1.createElement(
|
|
35653
|
-
className: "StyledInput",
|
|
35728
|
+
}, "*")), /*#__PURE__*/React$1.createElement(InputElement, {
|
|
35729
|
+
className: multiline ? "StyledTextarea" : "StyledInput",
|
|
35654
35730
|
ref: inputRef,
|
|
35655
35731
|
type: password && !showPassword ? 'password' : 'text',
|
|
35656
35732
|
value: inputValue,
|
|
@@ -35662,11 +35738,22 @@ const Input$2 = _ref => {
|
|
|
35662
35738
|
isDarkerBackground: isDarkerBackground,
|
|
35663
35739
|
placeholder: isFocused ? placeHolder : '',
|
|
35664
35740
|
error: error,
|
|
35665
|
-
|
|
35666
|
-
|
|
35741
|
+
height: calculateHeight(),
|
|
35742
|
+
isFocused: isFocused,
|
|
35743
|
+
rows: multiline ? rows : undefined,
|
|
35744
|
+
maxLength: maxLength,
|
|
35745
|
+
multiline: multiline
|
|
35746
|
+
})), !multiline && (password ? getPasswordIcon() : getRightIcon())), error && errorMessage?.length > 0 && /*#__PURE__*/React$1.createElement(ErrorMessage, {
|
|
35667
35747
|
className: "ErrorMessage",
|
|
35668
35748
|
width: width
|
|
35669
|
-
}, errorMessage)
|
|
35749
|
+
}, errorMessage), multiline && maxLength && /*#__PURE__*/React$1.createElement("div", {
|
|
35750
|
+
style: {
|
|
35751
|
+
fontSize: '12px',
|
|
35752
|
+
color: inputValue.length > maxLength * 0.9 ? 'orange' : '#666',
|
|
35753
|
+
textAlign: 'right',
|
|
35754
|
+
marginTop: '4px'
|
|
35755
|
+
}
|
|
35756
|
+
}, inputValue.length, "/", maxLength));
|
|
35670
35757
|
};
|
|
35671
35758
|
Input$2.propTypes = {
|
|
35672
35759
|
placeHolder: PropTypes.string,
|
|
@@ -35686,7 +35773,10 @@ Input$2.propTypes = {
|
|
|
35686
35773
|
onBlur: PropTypes.func,
|
|
35687
35774
|
leftIcon: PropTypes.string,
|
|
35688
35775
|
rightIcon: PropTypes.string,
|
|
35689
|
-
password: PropTypes.bool
|
|
35776
|
+
password: PropTypes.bool,
|
|
35777
|
+
multiline: PropTypes.bool,
|
|
35778
|
+
rows: PropTypes.number,
|
|
35779
|
+
maxLength: PropTypes.number
|
|
35690
35780
|
};
|
|
35691
35781
|
Input$2.defaultProps = {
|
|
35692
35782
|
placeHolder: 'Type...',
|
|
@@ -35705,7 +35795,10 @@ Input$2.defaultProps = {
|
|
|
35705
35795
|
leftIconOnClick: () => {},
|
|
35706
35796
|
rightIconOnClick: () => {},
|
|
35707
35797
|
onBlur: () => {},
|
|
35708
|
-
password: false
|
|
35798
|
+
password: false,
|
|
35799
|
+
multiline: false,
|
|
35800
|
+
rows: 3,
|
|
35801
|
+
maxLength: undefined
|
|
35709
35802
|
};
|
|
35710
35803
|
|
|
35711
35804
|
const ToggleSwitchLabel = styled.label`
|
|
@@ -35713,12 +35806,9 @@ const ToggleSwitchLabel = styled.label`
|
|
|
35713
35806
|
position: relative;
|
|
35714
35807
|
cursor: pointer;
|
|
35715
35808
|
user-select: none;
|
|
35716
|
-
opacity: ${
|
|
35717
|
-
|
|
35718
|
-
|
|
35719
|
-
} = _ref;
|
|
35720
|
-
return disabled ? 0.5 : 1;
|
|
35721
|
-
}};
|
|
35809
|
+
opacity: ${({
|
|
35810
|
+
disabled
|
|
35811
|
+
}) => disabled ? 0.5 : 1};
|
|
35722
35812
|
`;
|
|
35723
35813
|
const ToggleInput = styled.input`
|
|
35724
35814
|
display: none;
|
|
@@ -35726,19 +35816,15 @@ const ToggleInput = styled.input`
|
|
|
35726
35816
|
const ToggleSlider = styled.span`
|
|
35727
35817
|
display: block;
|
|
35728
35818
|
position: relative;
|
|
35729
|
-
background: ${
|
|
35730
|
-
|
|
35731
|
-
|
|
35732
|
-
|
|
35733
|
-
} = _ref2;
|
|
35734
|
-
return checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc";
|
|
35735
|
-
}};
|
|
35819
|
+
background: ${({
|
|
35820
|
+
checked,
|
|
35821
|
+
disabled
|
|
35822
|
+
}) => checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc"};
|
|
35736
35823
|
border-radius: 999px;
|
|
35737
35824
|
transition: background 0.2s;
|
|
35738
|
-
${
|
|
35739
|
-
|
|
35740
|
-
|
|
35741
|
-
} = _ref3;
|
|
35825
|
+
${({
|
|
35826
|
+
size
|
|
35827
|
+
}) => {
|
|
35742
35828
|
switch (size) {
|
|
35743
35829
|
case "s":
|
|
35744
35830
|
return css`width: 40px; height: 20px;`;
|
|
@@ -35757,10 +35843,9 @@ const ToggleSlider = styled.span`
|
|
|
35757
35843
|
background: #fff;
|
|
35758
35844
|
border-radius: 50%;
|
|
35759
35845
|
transition: left 0.2s, width 0.2s, height 0.2s;
|
|
35760
|
-
${
|
|
35761
|
-
|
|
35762
|
-
|
|
35763
|
-
} = _ref4;
|
|
35846
|
+
${({
|
|
35847
|
+
size
|
|
35848
|
+
}) => {
|
|
35764
35849
|
switch (size) {
|
|
35765
35850
|
case "s":
|
|
35766
35851
|
return css`width: 14px; height: 14px;`;
|
|
@@ -35770,11 +35855,10 @@ const ToggleSlider = styled.span`
|
|
|
35770
35855
|
return css`width: 20px; height: 20px;`;
|
|
35771
35856
|
}
|
|
35772
35857
|
}}
|
|
35773
|
-
left: ${
|
|
35774
|
-
|
|
35775
|
-
|
|
35776
|
-
|
|
35777
|
-
} = _ref5;
|
|
35858
|
+
left: ${({
|
|
35859
|
+
checked,
|
|
35860
|
+
size
|
|
35861
|
+
}) => {
|
|
35778
35862
|
if (!checked) return "3px";
|
|
35779
35863
|
switch (size) {
|
|
35780
35864
|
case "s":
|
|
@@ -35788,9 +35872,9 @@ const ToggleSlider = styled.span`
|
|
|
35788
35872
|
}
|
|
35789
35873
|
`;
|
|
35790
35874
|
|
|
35791
|
-
/**
|
|
35792
|
-
* ToggleSwitch component for on/off states.
|
|
35793
|
-
* Supports small/large sizes and disabled state.
|
|
35875
|
+
/**
|
|
35876
|
+
* ToggleSwitch component for on/off states.
|
|
35877
|
+
* Supports small/large sizes and disabled state.
|
|
35794
35878
|
*/
|
|
35795
35879
|
function ToggleSwitch(_ref) {
|
|
35796
35880
|
let {
|