@indico-data/design-system 2.9.0 → 2.10.0
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/index.css +112 -0
- package/lib/index.d.ts +41 -2
- package/lib/index.esm.css +112 -0
- package/lib/index.esm.js +19 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +20 -2
- package/lib/index.js.map +1 -1
- package/lib/src/components/forms/input/Input.d.ts +2 -1
- package/lib/src/components/forms/passwordInput/PasswordInput.d.ts +16 -0
- package/lib/src/components/forms/passwordInput/PasswordInput.stories.d.ts +11 -0
- package/lib/src/components/forms/passwordInput/__tests__/PasswordInput.test.d.ts +1 -0
- package/lib/src/components/forms/passwordInput/index.d.ts +1 -0
- package/lib/src/components/index.d.ts +2 -0
- package/lib/src/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/forms/input/Input.stories.tsx +0 -5
- package/src/components/forms/input/Input.tsx +3 -1
- package/src/components/forms/input/styles/Input.scss +1 -0
- package/src/components/forms/passwordInput/PasswordInput.mdx +28 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +269 -0
- package/src/components/forms/passwordInput/PasswordInput.tsx +82 -0
- package/src/components/forms/passwordInput/__tests__/PasswordInput.test.tsx +129 -0
- package/src/components/forms/passwordInput/index.ts +1 -0
- package/src/components/forms/passwordInput/styles/PasswordInput.scss +120 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles/index.scss +1 -0
package/lib/index.css
CHANGED
|
@@ -956,6 +956,7 @@
|
|
|
956
956
|
top: var(--pf-margin-3);
|
|
957
957
|
right: var(--pf-margin-2);
|
|
958
958
|
color: var(--pf-input-text-color);
|
|
959
|
+
cursor: pointer;
|
|
959
960
|
}
|
|
960
961
|
.form-control .is-visually-hidden {
|
|
961
962
|
position: absolute;
|
|
@@ -1243,6 +1244,117 @@
|
|
|
1243
1244
|
margin-bottom: var(--pf-margin-2);
|
|
1244
1245
|
}
|
|
1245
1246
|
|
|
1247
|
+
:root,
|
|
1248
|
+
:root [data-theme=light],
|
|
1249
|
+
:root [data-theme=dark] {
|
|
1250
|
+
--pf-password-input-background-color: var(--pf-white-color);
|
|
1251
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1252
|
+
--pf-password-input-text-color: var(--pf-gray-color);
|
|
1253
|
+
--pf-password-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1254
|
+
--pf-password-input-help-text-color: var(--pf-gray-color-400);
|
|
1255
|
+
--pf-password-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1256
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1257
|
+
--pf-password-input-disabled-color: var(--pf-gray-color-400);
|
|
1258
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1259
|
+
--pf-password-input-rounded: var(--pf-rounded);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
:root [data-theme=dark] {
|
|
1263
|
+
--pf-password-input-background-color: var(--pf-primary-color);
|
|
1264
|
+
--pf-password-input-border-color: var(--pf-gray-color-100);
|
|
1265
|
+
--pf-password-input-text-color: var(--pf-gray-color-100);
|
|
1266
|
+
--pf-password-input-placeholder-text-color: var(--pf-gray-color);
|
|
1267
|
+
--pf-password-input-help-text-color: var(--pf-gray-color-200);
|
|
1268
|
+
--pf-password-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1269
|
+
--pf-password-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1270
|
+
--pf-password-input-disabled-color: var(--pf-gray-color-400);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.password-input {
|
|
1274
|
+
background-color: var(--pf-password-input-background-color);
|
|
1275
|
+
border: 1px solid var(--pf-password-input-border-color);
|
|
1276
|
+
border-radius: var(--pf-password-input-rounded);
|
|
1277
|
+
color: var(--pf-password-input-text-color);
|
|
1278
|
+
padding: 10px;
|
|
1279
|
+
width: 100%;
|
|
1280
|
+
box-sizing: border-box;
|
|
1281
|
+
height: 36px;
|
|
1282
|
+
}
|
|
1283
|
+
.password-input::-moz-placeholder {
|
|
1284
|
+
color: var(--pf-password-input-placeholder-text-color);
|
|
1285
|
+
}
|
|
1286
|
+
.password-input::placeholder {
|
|
1287
|
+
color: var(--pf-password-input-placeholder-text-color);
|
|
1288
|
+
}
|
|
1289
|
+
.password-input:focus {
|
|
1290
|
+
border-color: var(--pf-primary-color);
|
|
1291
|
+
}
|
|
1292
|
+
.password-input.error {
|
|
1293
|
+
border-color: var(--pf-error-color);
|
|
1294
|
+
}
|
|
1295
|
+
.password-input.success {
|
|
1296
|
+
border-color: var(--pf-success-color);
|
|
1297
|
+
}
|
|
1298
|
+
.password-input.warning {
|
|
1299
|
+
border-color: var(--pf-warning-color);
|
|
1300
|
+
}
|
|
1301
|
+
.password-input.info {
|
|
1302
|
+
border-color: var(--pf-info-color);
|
|
1303
|
+
}
|
|
1304
|
+
.password-input:disabled {
|
|
1305
|
+
background-color: var(--pf-password-input-disabled-background-color);
|
|
1306
|
+
border-color: var(--pf-password-input-disabled-border-color);
|
|
1307
|
+
color: var(--pf-password-input-disabled-color);
|
|
1308
|
+
}
|
|
1309
|
+
.password-input--has-icon {
|
|
1310
|
+
padding-left: var(--pf-padding-7);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.form-control .error-list {
|
|
1314
|
+
list-style: none;
|
|
1315
|
+
padding: 0;
|
|
1316
|
+
margin: 0;
|
|
1317
|
+
margin-top: var(--pf-margin-2);
|
|
1318
|
+
margin-bottom: var(--pf-margin-2);
|
|
1319
|
+
color: var(--pf-error-color);
|
|
1320
|
+
}
|
|
1321
|
+
.form-control .help-text {
|
|
1322
|
+
margin-top: var(--pf-margin-2);
|
|
1323
|
+
margin-bottom: var(--pf-margin-2);
|
|
1324
|
+
color: var(--pf-password-input-help-text-color);
|
|
1325
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1326
|
+
}
|
|
1327
|
+
.form-control .password-input-wrapper {
|
|
1328
|
+
position: relative;
|
|
1329
|
+
}
|
|
1330
|
+
.form-control .password-input-wrapper .embedded-icon {
|
|
1331
|
+
position: absolute;
|
|
1332
|
+
top: 10px;
|
|
1333
|
+
left: var(--pf-margin-2);
|
|
1334
|
+
color: var(--pf-password-input-text-color);
|
|
1335
|
+
}
|
|
1336
|
+
.form-control .password-input-wrapper .toggle-show-password-icon {
|
|
1337
|
+
position: absolute;
|
|
1338
|
+
top: var(--pf-margin-3);
|
|
1339
|
+
right: var(--pf-margin-2);
|
|
1340
|
+
color: var(--pf-password-input-text-color);
|
|
1341
|
+
cursor: pointer;
|
|
1342
|
+
}
|
|
1343
|
+
.form-control .is-visually-hidden {
|
|
1344
|
+
position: absolute;
|
|
1345
|
+
width: 1px;
|
|
1346
|
+
height: 1px;
|
|
1347
|
+
padding: 0;
|
|
1348
|
+
margin: -1px;
|
|
1349
|
+
overflow: hidden;
|
|
1350
|
+
clip: rect(0, 0, 0, 0);
|
|
1351
|
+
white-space: nowrap;
|
|
1352
|
+
border: 0;
|
|
1353
|
+
}
|
|
1354
|
+
.form-control .form-label {
|
|
1355
|
+
margin-bottom: var(--pf-margin-2);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1246
1358
|
:root,
|
|
1247
1359
|
:root [data-theme=light],
|
|
1248
1360
|
:root [data-theme=dark] {
|
package/lib/index.d.ts
CHANGED
|
@@ -936,8 +936,9 @@ interface InputProps {
|
|
|
936
936
|
hasHiddenLabel?: boolean;
|
|
937
937
|
iconName?: IconName$1;
|
|
938
938
|
isClearable?: boolean;
|
|
939
|
+
className?: string;
|
|
939
940
|
}
|
|
940
|
-
declare const Input: ({ ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
941
|
+
declare const Input: ({ ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable, className, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
941
942
|
|
|
942
943
|
interface RadioProps {
|
|
943
944
|
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
@@ -974,4 +975,42 @@ interface ToggleProps {
|
|
|
974
975
|
}
|
|
975
976
|
declare const Toggle: ({ ref, id, label, name, value, onChange, isDisabled, isChecked, ...rest }: ToggleProps) => react_jsx_runtime.JSX.Element;
|
|
976
977
|
|
|
977
|
-
|
|
978
|
+
interface TextareaProps {
|
|
979
|
+
ref?: React$1.LegacyRef<HTMLTextAreaElement>;
|
|
980
|
+
label: string;
|
|
981
|
+
name: string;
|
|
982
|
+
placeholder: string;
|
|
983
|
+
value: string;
|
|
984
|
+
onChange: (e: React$1.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
985
|
+
isRequired?: boolean;
|
|
986
|
+
isDisabled?: boolean;
|
|
987
|
+
errorList?: string[];
|
|
988
|
+
helpText?: string;
|
|
989
|
+
hasHiddenLabel?: boolean;
|
|
990
|
+
rows?: number;
|
|
991
|
+
cols?: number;
|
|
992
|
+
readonly?: boolean;
|
|
993
|
+
wrap?: 'hard' | 'soft';
|
|
994
|
+
form?: string;
|
|
995
|
+
maxLength?: number;
|
|
996
|
+
autofocus?: boolean;
|
|
997
|
+
}
|
|
998
|
+
declare const Textarea: ({ ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus, ...rest }: TextareaProps) => react_jsx_runtime.JSX.Element;
|
|
999
|
+
|
|
1000
|
+
interface PasswordInputProps {
|
|
1001
|
+
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
1002
|
+
label: string;
|
|
1003
|
+
name: string;
|
|
1004
|
+
placeholder: string;
|
|
1005
|
+
value: string;
|
|
1006
|
+
onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
1007
|
+
isRequired?: boolean;
|
|
1008
|
+
isDisabled?: boolean;
|
|
1009
|
+
errorList?: string[];
|
|
1010
|
+
helpText?: string;
|
|
1011
|
+
hasHiddenLabel?: boolean;
|
|
1012
|
+
hasShowPassword?: boolean;
|
|
1013
|
+
}
|
|
1014
|
+
declare const PasswordInput: ({ label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, hasHiddenLabel, hasShowPassword, ...rest }: PasswordInputProps) => react_jsx_runtime.JSX.Element;
|
|
1015
|
+
|
|
1016
|
+
export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PasswordInput, PercentageRing, Radio$2 as Radio, RadioGroup$1 as RadioGroup, Radio as RadioInput, RandomLoadingMessage, Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table, TextInput, TextTruncate, Textarea, Toggle$1 as Toggle, Toggle as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
|
package/lib/index.esm.css
CHANGED
|
@@ -956,6 +956,7 @@
|
|
|
956
956
|
top: var(--pf-margin-3);
|
|
957
957
|
right: var(--pf-margin-2);
|
|
958
958
|
color: var(--pf-input-text-color);
|
|
959
|
+
cursor: pointer;
|
|
959
960
|
}
|
|
960
961
|
.form-control .is-visually-hidden {
|
|
961
962
|
position: absolute;
|
|
@@ -1243,6 +1244,117 @@
|
|
|
1243
1244
|
margin-bottom: var(--pf-margin-2);
|
|
1244
1245
|
}
|
|
1245
1246
|
|
|
1247
|
+
:root,
|
|
1248
|
+
:root [data-theme=light],
|
|
1249
|
+
:root [data-theme=dark] {
|
|
1250
|
+
--pf-password-input-background-color: var(--pf-white-color);
|
|
1251
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1252
|
+
--pf-password-input-text-color: var(--pf-gray-color);
|
|
1253
|
+
--pf-password-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1254
|
+
--pf-password-input-help-text-color: var(--pf-gray-color-400);
|
|
1255
|
+
--pf-password-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1256
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1257
|
+
--pf-password-input-disabled-color: var(--pf-gray-color-400);
|
|
1258
|
+
--pf-password-input-border-color: var(--pf-gray-color);
|
|
1259
|
+
--pf-password-input-rounded: var(--pf-rounded);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
:root [data-theme=dark] {
|
|
1263
|
+
--pf-password-input-background-color: var(--pf-primary-color);
|
|
1264
|
+
--pf-password-input-border-color: var(--pf-gray-color-100);
|
|
1265
|
+
--pf-password-input-text-color: var(--pf-gray-color-100);
|
|
1266
|
+
--pf-password-input-placeholder-text-color: var(--pf-gray-color);
|
|
1267
|
+
--pf-password-input-help-text-color: var(--pf-gray-color-200);
|
|
1268
|
+
--pf-password-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1269
|
+
--pf-password-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1270
|
+
--pf-password-input-disabled-color: var(--pf-gray-color-400);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.password-input {
|
|
1274
|
+
background-color: var(--pf-password-input-background-color);
|
|
1275
|
+
border: 1px solid var(--pf-password-input-border-color);
|
|
1276
|
+
border-radius: var(--pf-password-input-rounded);
|
|
1277
|
+
color: var(--pf-password-input-text-color);
|
|
1278
|
+
padding: 10px;
|
|
1279
|
+
width: 100%;
|
|
1280
|
+
box-sizing: border-box;
|
|
1281
|
+
height: 36px;
|
|
1282
|
+
}
|
|
1283
|
+
.password-input::-moz-placeholder {
|
|
1284
|
+
color: var(--pf-password-input-placeholder-text-color);
|
|
1285
|
+
}
|
|
1286
|
+
.password-input::placeholder {
|
|
1287
|
+
color: var(--pf-password-input-placeholder-text-color);
|
|
1288
|
+
}
|
|
1289
|
+
.password-input:focus {
|
|
1290
|
+
border-color: var(--pf-primary-color);
|
|
1291
|
+
}
|
|
1292
|
+
.password-input.error {
|
|
1293
|
+
border-color: var(--pf-error-color);
|
|
1294
|
+
}
|
|
1295
|
+
.password-input.success {
|
|
1296
|
+
border-color: var(--pf-success-color);
|
|
1297
|
+
}
|
|
1298
|
+
.password-input.warning {
|
|
1299
|
+
border-color: var(--pf-warning-color);
|
|
1300
|
+
}
|
|
1301
|
+
.password-input.info {
|
|
1302
|
+
border-color: var(--pf-info-color);
|
|
1303
|
+
}
|
|
1304
|
+
.password-input:disabled {
|
|
1305
|
+
background-color: var(--pf-password-input-disabled-background-color);
|
|
1306
|
+
border-color: var(--pf-password-input-disabled-border-color);
|
|
1307
|
+
color: var(--pf-password-input-disabled-color);
|
|
1308
|
+
}
|
|
1309
|
+
.password-input--has-icon {
|
|
1310
|
+
padding-left: var(--pf-padding-7);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.form-control .error-list {
|
|
1314
|
+
list-style: none;
|
|
1315
|
+
padding: 0;
|
|
1316
|
+
margin: 0;
|
|
1317
|
+
margin-top: var(--pf-margin-2);
|
|
1318
|
+
margin-bottom: var(--pf-margin-2);
|
|
1319
|
+
color: var(--pf-error-color);
|
|
1320
|
+
}
|
|
1321
|
+
.form-control .help-text {
|
|
1322
|
+
margin-top: var(--pf-margin-2);
|
|
1323
|
+
margin-bottom: var(--pf-margin-2);
|
|
1324
|
+
color: var(--pf-password-input-help-text-color);
|
|
1325
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1326
|
+
}
|
|
1327
|
+
.form-control .password-input-wrapper {
|
|
1328
|
+
position: relative;
|
|
1329
|
+
}
|
|
1330
|
+
.form-control .password-input-wrapper .embedded-icon {
|
|
1331
|
+
position: absolute;
|
|
1332
|
+
top: 10px;
|
|
1333
|
+
left: var(--pf-margin-2);
|
|
1334
|
+
color: var(--pf-password-input-text-color);
|
|
1335
|
+
}
|
|
1336
|
+
.form-control .password-input-wrapper .toggle-show-password-icon {
|
|
1337
|
+
position: absolute;
|
|
1338
|
+
top: var(--pf-margin-3);
|
|
1339
|
+
right: var(--pf-margin-2);
|
|
1340
|
+
color: var(--pf-password-input-text-color);
|
|
1341
|
+
cursor: pointer;
|
|
1342
|
+
}
|
|
1343
|
+
.form-control .is-visually-hidden {
|
|
1344
|
+
position: absolute;
|
|
1345
|
+
width: 1px;
|
|
1346
|
+
height: 1px;
|
|
1347
|
+
padding: 0;
|
|
1348
|
+
margin: -1px;
|
|
1349
|
+
overflow: hidden;
|
|
1350
|
+
clip: rect(0, 0, 0, 0);
|
|
1351
|
+
white-space: nowrap;
|
|
1352
|
+
border: 0;
|
|
1353
|
+
}
|
|
1354
|
+
.form-control .form-label {
|
|
1355
|
+
margin-bottom: var(--pf-margin-2);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1246
1358
|
:root,
|
|
1247
1359
|
:root [data-theme=light],
|
|
1248
1360
|
:root [data-theme=dark] {
|
package/lib/index.esm.js
CHANGED
|
@@ -18641,12 +18641,12 @@ const ErrorList = ({ errorList, name }) => {
|
|
|
18641
18641
|
};
|
|
18642
18642
|
|
|
18643
18643
|
const Input = (_a) => {
|
|
18644
|
-
var { ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable } = _a, rest = __rest$1(_a, ["ref", "label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorList", "helpText", "iconName", "hasHiddenLabel", "isClearable"]);
|
|
18644
|
+
var { ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable, className = '' } = _a, rest = __rest$1(_a, ["ref", "label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorList", "helpText", "iconName", "hasHiddenLabel", "isClearable", "className"]);
|
|
18645
18645
|
const hasErrors = errorList && errorList.length > 0;
|
|
18646
18646
|
const handleClear = () => {
|
|
18647
18647
|
onChange({ target: { value: '' } });
|
|
18648
18648
|
};
|
|
18649
|
-
return (jsxs("div", { className: "form-control", children: [jsx(Label, { label: label, name: name, isRequired: isRequired, hasHiddenLabel: hasHiddenLabel }), jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, required: isRequired, placeholder: placeholder, value: value, onChange: onChange, className: `input ${hasErrors ? 'error' : ''} ${iconName ? 'input--has-icon' : ''}`, "aria-invalid": hasErrors, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)), isClearable && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(ErrorList, { errorList: errorList, name: name }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
18649
|
+
return (jsxs("div", { className: "form-control", children: [jsx(Label, { label: label, name: name, isRequired: isRequired, hasHiddenLabel: hasHiddenLabel }), jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, required: isRequired, placeholder: placeholder, value: value, onChange: onChange, className: `input ${hasErrors ? 'error' : ''} ${iconName ? 'input--has-icon' : ''} ${className}`, "aria-invalid": hasErrors, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)), isClearable && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(ErrorList, { errorList: errorList, name: name }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
18650
18650
|
};
|
|
18651
18651
|
|
|
18652
18652
|
const Radio$2 = (_a) => {
|
|
@@ -18664,6 +18664,22 @@ const Toggle$1 = (_a) => {
|
|
|
18664
18664
|
return (jsx("div", { className: "form-control", children: jsxs("div", { className: "toggle-wrapper", children: [jsx("input", Object.assign({ "data-testid": `form-toggle-input-${name}`, className: "toggle-input", type: "checkbox", id: id, checked: isChecked, name: name, value: value, disabled: isDisabled, ref: ref, onChange: onChange, tabIndex: 0, "aria-describedby": id, "aria-label": label }, rest)), jsx("label", { htmlFor: id, className: "switch" }), jsx("label", { className: 'toggle-label', htmlFor: id, children: label })] }) }));
|
|
18665
18665
|
};
|
|
18666
18666
|
|
|
18667
|
+
const Textarea = (_a) => {
|
|
18668
|
+
var { ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus } = _a, rest = __rest$1(_a, ["ref", "label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorList", "helpText", "hasHiddenLabel", "rows", "cols", "readonly", "wrap", "form", "maxLength", "autofocus"]);
|
|
18669
|
+
const hasErrors = errorList && errorList.length > 0;
|
|
18670
|
+
return (jsxs("div", { className: "form-control", children: [jsx(Label, { label: label, name: name, isRequired: isRequired, hasHiddenLabel: hasHiddenLabel }), jsx("div", { className: "textarea-wrapper", children: jsx("textarea", Object.assign({ ref: ref, rows: rows, cols: cols, autoFocus: autofocus, wrap: wrap, form: form, value: value, maxLength: maxLength, readOnly: readonly, "data-testid": `form-textarea-${name}`, name: name, disabled: isDisabled, required: isRequired, placeholder: placeholder, onChange: onChange, className: `textarea ${hasErrors ? 'error' : ''}`, "aria-invalid": hasErrors, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)) }), hasErrors && jsx(ErrorList, { errorList: errorList, name: name }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
18671
|
+
};
|
|
18672
|
+
|
|
18673
|
+
const PasswordInput = (_a) => {
|
|
18674
|
+
var { label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, hasHiddenLabel, hasShowPassword = true } = _a, rest = __rest$1(_a, ["label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorList", "helpText", "hasHiddenLabel", "hasShowPassword"]);
|
|
18675
|
+
const hasErrors = errorList && errorList.length > 0;
|
|
18676
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
18677
|
+
const handleShowPassword = () => {
|
|
18678
|
+
setShowPassword((prevShowPassword) => !prevShowPassword);
|
|
18679
|
+
};
|
|
18680
|
+
return (jsxs("div", { className: "form-control", children: [jsx(Label, { label: label, name: name, isRequired: isRequired, hasHiddenLabel: hasHiddenLabel }), jsxs("div", { className: "password-input-wrapper", children: [jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon" }), jsx("input", Object.assign({ "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, required: isRequired, placeholder: placeholder, value: value, onChange: onChange, className: `password-input ${hasErrors ? 'error' : ''} password-input--has-icon`, "aria-invalid": hasErrors, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)), hasShowPassword && (jsx(Icon, { name: showPassword ? 'fa-eye-slash' : 'eye', "data-testid": `${name}-${showPassword ? 'hide' : 'show'}-password-icon`, size: "md", onClick: handleShowPassword, className: "toggle-show-password-icon" }))] }), hasErrors && jsx(ErrorList, { errorList: errorList, name: name }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
18681
|
+
};
|
|
18682
|
+
|
|
18667
18683
|
const StyledAccordion = styled.details `
|
|
18668
18684
|
summary {
|
|
18669
18685
|
display: inherit;
|
|
@@ -41485,5 +41501,5 @@ const Tooltip = (props) => {
|
|
|
41485
41501
|
openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
|
|
41486
41502
|
};
|
|
41487
41503
|
|
|
41488
|
-
export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, Toggle, Toggle$1 as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
|
|
41504
|
+
export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PasswordInput, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, Textarea, Toggle, Toggle$1 as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
|
|
41489
41505
|
//# sourceMappingURL=index.esm.js.map
|