@indico-data/design-system 2.18.0 → 2.19.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.
Files changed (28) hide show
  1. package/lib/index.css +0 -33
  2. package/lib/index.d.ts +17 -20
  3. package/lib/index.esm.css +0 -33
  4. package/lib/index.esm.js +31 -9
  5. package/lib/index.esm.js.map +1 -1
  6. package/lib/index.js +33 -11
  7. package/lib/index.js.map +1 -1
  8. package/lib/src/components/forms/input/Input.d.ts +5 -7
  9. package/lib/src/components/forms/passwordInput/PasswordInput.d.ts +5 -7
  10. package/lib/src/components/forms/subcomponents/Label.d.ts +6 -3
  11. package/lib/src/components/forms/textarea/Textarea.d.ts +5 -7
  12. package/lib/src/storybook/labelArgTypes.d.ts +3 -0
  13. package/package.json +1 -1
  14. package/src/components/forms/input/Input.mdx +15 -2
  15. package/src/components/forms/input/Input.stories.tsx +10 -45
  16. package/src/components/forms/input/Input.tsx +22 -15
  17. package/src/components/forms/input/styles/Input.scss +0 -11
  18. package/src/components/forms/passwordInput/PasswordInput.mdx +10 -8
  19. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +3 -44
  20. package/src/components/forms/passwordInput/PasswordInput.tsx +20 -15
  21. package/src/components/forms/passwordInput/styles/PasswordInput.scss +0 -11
  22. package/src/components/forms/subcomponents/Label.tsx +29 -6
  23. package/src/components/forms/subcomponents/__tests__/Label.test.tsx +63 -15
  24. package/src/components/forms/textarea/Textarea.mdx +12 -2
  25. package/src/components/forms/textarea/Textarea.stories.tsx +4 -46
  26. package/src/components/forms/textarea/Textarea.tsx +15 -13
  27. package/src/components/forms/textarea/styles/Textarea.scss +0 -11
  28. package/src/storybook/labelArgTypes.ts +50 -0
package/lib/index.css CHANGED
@@ -982,17 +982,6 @@
982
982
  color: var(--pf-input-text-color);
983
983
  cursor: pointer;
984
984
  }
985
- .form-control .is-visually-hidden {
986
- position: absolute;
987
- width: 1px;
988
- height: 1px;
989
- padding: 0;
990
- margin: -1px;
991
- overflow: hidden;
992
- clip: rect(0, 0, 0, 0);
993
- white-space: nowrap;
994
- border: 0;
995
- }
996
985
  .form-control .form-label {
997
986
  margin-bottom: var(--pf-margin-2);
998
987
  }
@@ -1252,17 +1241,6 @@
1252
1241
  color: var(--pf-textarea-help-text-color);
1253
1242
  font-size: var(--pf-font-size-subtitle2);
1254
1243
  }
1255
- .form-control .is-visually-hidden {
1256
- position: absolute;
1257
- width: 1px;
1258
- height: 1px;
1259
- padding: 0;
1260
- margin: -1px;
1261
- overflow: hidden;
1262
- clip: rect(0, 0, 0, 0);
1263
- white-space: nowrap;
1264
- border: 0;
1265
- }
1266
1244
  .form-control .form-label {
1267
1245
  margin-bottom: var(--pf-margin-2);
1268
1246
  }
@@ -1361,17 +1339,6 @@
1361
1339
  color: var(--pf-password-input-text-color);
1362
1340
  cursor: pointer;
1363
1341
  }
1364
- .form-control .is-visually-hidden {
1365
- position: absolute;
1366
- width: 1px;
1367
- height: 1px;
1368
- padding: 0;
1369
- margin: -1px;
1370
- overflow: hidden;
1371
- clip: rect(0, 0, 0, 0);
1372
- white-space: nowrap;
1373
- border: 0;
1374
- }
1375
1342
  .form-control .form-label {
1376
1343
  margin-bottom: var(--pf-margin-2);
1377
1344
  }
package/lib/index.d.ts CHANGED
@@ -919,23 +919,28 @@ declare const Icon: ({ name, size, className, ariaLabel, ...props }: IconProps)
919
919
 
920
920
  declare const Table: <T>(props: TableProps<T>) => react_jsx_runtime.JSX.Element;
921
921
 
922
- interface InputProps {
922
+ interface LabelProps {
923
923
  label: string;
924
924
  name: string;
925
+ isRequired?: boolean;
926
+ }
927
+ interface WithLabelProps extends LabelProps {
928
+ hasHiddenLabel?: boolean;
929
+ }
930
+
931
+ interface InputProps extends WithLabelProps {
925
932
  value?: string | undefined;
926
- placeholder: string;
933
+ placeholder?: string;
927
934
  onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
928
- isRequired?: boolean;
929
935
  isDisabled?: boolean;
930
936
  errorMessage?: string | undefined;
931
937
  helpText?: string;
932
- hasHiddenLabel?: boolean;
933
938
  iconName?: IconName$1;
934
939
  isClearable?: boolean;
935
940
  className?: string;
936
941
  defaultValue?: string;
937
942
  }
938
- declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
943
+ declare const LabeledInput: React$1.ForwardRefExoticComponent<Omit<InputProps & React$1.RefAttributes<HTMLInputElement> & WithLabelProps, "ref"> & React$1.RefAttributes<any>>;
939
944
 
940
945
  interface RadioProps {
941
946
  ref?: React$1.LegacyRef<HTMLInputElement>;
@@ -975,18 +980,14 @@ interface ToggleProps {
975
980
  }
976
981
  declare const Toggle: React$1.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
977
982
 
978
- interface TextareaProps {
983
+ interface TextareaProps extends WithLabelProps {
979
984
  ref?: React$1.LegacyRef<HTMLTextAreaElement>;
980
- label: string;
981
- name: string;
982
- placeholder: string;
985
+ placeholder?: string;
983
986
  value?: string | undefined;
984
987
  onChange: (e: React$1.ChangeEvent<HTMLTextAreaElement>) => void;
985
- isRequired?: boolean;
986
988
  isDisabled?: boolean;
987
989
  errorMessage?: string | undefined;
988
990
  helpText?: string;
989
- hasHiddenLabel?: boolean;
990
991
  rows?: number;
991
992
  cols?: number;
992
993
  readonly?: boolean;
@@ -996,24 +997,20 @@ interface TextareaProps {
996
997
  autofocus?: boolean;
997
998
  defaultValue?: string;
998
999
  }
999
- declare const Textarea: React$1.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
1000
+ declare const LabeledTextarea: React$1.ForwardRefExoticComponent<Omit<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement> & WithLabelProps, "ref"> & React$1.RefAttributes<any>>;
1000
1001
 
1001
- interface PasswordInputProps {
1002
+ interface PasswordInputProps extends WithLabelProps {
1002
1003
  ref?: React$1.LegacyRef<HTMLInputElement>;
1003
- label: string;
1004
1004
  value?: string | undefined;
1005
- name: string;
1006
- placeholder: string;
1005
+ placeholder?: string;
1007
1006
  onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
1008
- isRequired?: boolean;
1009
1007
  isDisabled?: boolean;
1010
1008
  errorMessage?: string | undefined;
1011
1009
  helpText?: string;
1012
- hasHiddenLabel?: boolean;
1013
1010
  hasShowPassword?: boolean;
1014
1011
  defaultValue?: string;
1015
1012
  }
1016
- declare const PasswordInput: React$1.ForwardRefExoticComponent<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
1013
+ declare const LabeledPasswordInput: React$1.ForwardRefExoticComponent<Omit<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement> & WithLabelProps, "ref"> & React$1.RefAttributes<any>>;
1017
1014
 
1018
1015
  interface SelectProps<OptionType extends SelectOption> extends Props$r<OptionType> {
1019
1016
  options: OptionType[];
@@ -1052,4 +1049,4 @@ type Props = {
1052
1049
  };
1053
1050
  declare const Card: React$1.FC<Props>;
1054
1051
 
1055
- export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, 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$1 as Select, Select as SelectInput, Shrug, SingleCombobox, Skeleton, typography as TYPOGRAPHY, Table, TextInput, TextTruncate, Textarea, Toggle$1 as Toggle, Toggle as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
1052
+ export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, GlobalStyles, Icon, IconButton, LabeledInput as Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, LabeledPasswordInput as 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$1 as Select, Select as SelectInput, Shrug, SingleCombobox, Skeleton, typography as TYPOGRAPHY, Table, TextInput, TextTruncate, LabeledTextarea as Textarea, Toggle$1 as Toggle, Toggle as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
package/lib/index.esm.css CHANGED
@@ -982,17 +982,6 @@
982
982
  color: var(--pf-input-text-color);
983
983
  cursor: pointer;
984
984
  }
985
- .form-control .is-visually-hidden {
986
- position: absolute;
987
- width: 1px;
988
- height: 1px;
989
- padding: 0;
990
- margin: -1px;
991
- overflow: hidden;
992
- clip: rect(0, 0, 0, 0);
993
- white-space: nowrap;
994
- border: 0;
995
- }
996
985
  .form-control .form-label {
997
986
  margin-bottom: var(--pf-margin-2);
998
987
  }
@@ -1252,17 +1241,6 @@
1252
1241
  color: var(--pf-textarea-help-text-color);
1253
1242
  font-size: var(--pf-font-size-subtitle2);
1254
1243
  }
1255
- .form-control .is-visually-hidden {
1256
- position: absolute;
1257
- width: 1px;
1258
- height: 1px;
1259
- padding: 0;
1260
- margin: -1px;
1261
- overflow: hidden;
1262
- clip: rect(0, 0, 0, 0);
1263
- white-space: nowrap;
1264
- border: 0;
1265
- }
1266
1244
  .form-control .form-label {
1267
1245
  margin-bottom: var(--pf-margin-2);
1268
1246
  }
@@ -1361,17 +1339,6 @@
1361
1339
  color: var(--pf-password-input-text-color);
1362
1340
  cursor: pointer;
1363
1341
  }
1364
- .form-control .is-visually-hidden {
1365
- position: absolute;
1366
- width: 1px;
1367
- height: 1px;
1368
- padding: 0;
1369
- margin: -1px;
1370
- overflow: hidden;
1371
- clip: rect(0, 0, 0, 0);
1372
- white-space: nowrap;
1373
- border: 0;
1374
- }
1375
1342
  .form-control .form-label {
1376
1343
  margin-bottom: var(--pf-margin-2);
1377
1344
  }
package/lib/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import styled, { css as css$1, createGlobalStyle, ThemeProvider, keyframes } from 'styled-components';
3
3
  import * as e from 'react';
4
- import e__default, { cloneElement, useState, useEffect, useRef, useCallback, useContext, useMemo, createContext, forwardRef, useLayoutEffect, useImperativeHandle } from 'react';
4
+ import e__default, { cloneElement, forwardRef, useState, useEffect, useRef, useCallback, useContext, useMemo, createContext, useLayoutEffect, useImperativeHandle } from 'react';
5
5
  import ReactSelect, { components } from 'react-select';
6
6
  import { Link } from 'react-router-dom';
7
7
  import * as ReactDOM from 'react-dom';
@@ -18589,22 +18589,38 @@ const Table$1 = (props) => {
18589
18589
  return (jsx("div", { className: "table-wrapper", children: jsx(Xe, Object.assign({ responsive: responsive, direction: direction, subHeaderAlign: subHeaderAlign, keyField: keyField, striped: striped, className: `${striped ? 'pf__table--striped' : ''}`, disabled: isDisabled, noDataComponent: noDataComponent, progressPending: isLoading, progressComponent: jsx(LoadingComponent, {}) }, rest)) }));
18590
18590
  };
18591
18591
 
18592
- const Label = ({ label, name, isRequired, hasHiddenLabel }) => {
18593
- return (jsx("div", { "data-testid": `${name}-testId`, className: `form-label ${hasHiddenLabel ? 'is-visually-hidden' : ''}`, children: jsxs("label", { htmlFor: `${name}`, children: [label, isRequired ? jsx("span", { className: "text-error", children: " *" }) : ''] }) }));
18592
+ const Label = ({ label, name, isRequired }) => {
18593
+ return (jsx("div", { "data-testid": `${name}-testId`, className: `form-label`, children: jsxs("label", { htmlFor: `${name}`, children: [label, isRequired ? jsx("span", { className: "text-error", children: " *" }) : ''] }) }));
18594
18594
  };
18595
+ // HOC to add common label functionality to components
18596
+ function withLabel(WrappedComponent) {
18597
+ const WithLabelComponent = (_a, ref) => {
18598
+ var { label, hasHiddenLabel = false, name, isRequired } = _a, rest = __rest$1(_a, ["label", "hasHiddenLabel", "name", "isRequired"]);
18599
+ const ariaLabel = hasHiddenLabel
18600
+ ? { 'aria-label': isRequired ? `${label} (required)` : label }
18601
+ : {};
18602
+ return (jsxs("div", { className: "form-control", children: [!hasHiddenLabel && jsx(Label, { label: label, name: name, isRequired: isRequired }), jsx(WrappedComponent, Object.assign({}, rest, { id: name, name: name }, ariaLabel, { ref: ref }))] }));
18603
+ };
18604
+ return forwardRef(WithLabelComponent);
18605
+ }
18595
18606
 
18596
18607
  const DisplayFormError = ({ message }) => {
18597
18608
  return jsx("p", { className: "form-errors", children: message });
18598
18609
  };
18599
18610
 
18600
18611
  const Input = e__default.forwardRef((_a, ref) => {
18601
- var { label, name, placeholder, onChange, isRequired, isDisabled, isClearable, errorMessage, helpText, iconName, hasHiddenLabel, className } = _a, rest = __rest$1(_a, ["label", "name", "placeholder", "onChange", "isRequired", "isDisabled", "isClearable", "errorMessage", "helpText", "iconName", "hasHiddenLabel", "className"]);
18612
+ var { name, placeholder, onChange, isRequired, isDisabled, isClearable, errorMessage, helpText, iconName, className } = _a, rest = __rest$1(_a, ["name", "placeholder", "onChange", "isRequired", "isDisabled", "isClearable", "errorMessage", "helpText", "iconName", "className"]);
18602
18613
  const hasErrors = errorMessage && errorMessage.length > 0;
18603
18614
  const handleClear = () => {
18604
18615
  onChange({ target: { value: '' } });
18605
18616
  };
18606
- 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, placeholder: placeholder, onChange: onChange, className: `input ${hasErrors ? 'error' : ''} ${iconName ? 'input--has-icon' : ''} ${className}`, "aria-invalid": hasErrors ? true : undefined, "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(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18617
+ const inputClasses = y$1('input', {
18618
+ error: hasErrors,
18619
+ 'input--has-icon': iconName,
18620
+ }, className);
18621
+ return (jsxs(Fragment, { children: [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, placeholder: placeholder, onChange: onChange, className: inputClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)), isClearable && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18607
18622
  });
18623
+ const LabeledInput = withLabel(Input);
18608
18624
 
18609
18625
  const Radio$2 = e__default.forwardRef((_a, ref) => {
18610
18626
  var { id, label, name, value, onChange, isDisabled } = _a, rest = __rest$1(_a, ["id", "label", "name", "value", "onChange", "isDisabled"]);
@@ -18624,18 +18640,24 @@ const Toggle$1 = e__default.forwardRef((_a, ref) => {
18624
18640
  const Textarea = e__default.forwardRef((_a, ref) => {
18625
18641
  var { label, name, placeholder, value, onChange, isRequired, isDisabled, errorMessage, helpText, hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus } = _a, rest = __rest$1(_a, ["label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorMessage", "helpText", "hasHiddenLabel", "rows", "cols", "readonly", "wrap", "form", "maxLength", "autofocus"]);
18626
18642
  const hasErrors = errorMessage && errorMessage.length > 0;
18627
- 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, maxLength: maxLength, readOnly: readonly, "data-testid": `form-textarea-${name}`, name: name, disabled: isDisabled, placeholder: placeholder, onChange: onChange, className: `textarea ${hasErrors ? 'error' : ''}`, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)) }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18643
+ const textareaClasses = y$1('textarea', { error: hasErrors });
18644
+ return (jsxs(Fragment, { children: [jsx("div", { className: "textarea-wrapper", children: jsx("textarea", Object.assign({ ref: ref, rows: rows, cols: cols, autoFocus: autofocus, wrap: wrap, form: form, maxLength: maxLength, readOnly: readonly, "data-testid": `form-textarea-${name}`, name: name, disabled: isDisabled, placeholder: placeholder, onChange: onChange, className: textareaClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, rest)) }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18628
18645
  });
18646
+ const LabeledTextarea = withLabel(Textarea);
18629
18647
 
18630
18648
  const PasswordInput = e__default.forwardRef((_a, ref) => {
18631
- var { label, name, placeholder, onChange, isRequired, isDisabled, errorMessage, helpText, hasHiddenLabel, hasShowPassword = true } = _a, rest = __rest$1(_a, ["label", "name", "placeholder", "onChange", "isRequired", "isDisabled", "errorMessage", "helpText", "hasHiddenLabel", "hasShowPassword"]);
18649
+ var { name, placeholder, onChange, isRequired, isDisabled, errorMessage, helpText, hasShowPassword = true } = _a, rest = __rest$1(_a, ["name", "placeholder", "onChange", "isRequired", "isDisabled", "errorMessage", "helpText", "hasShowPassword"]);
18632
18650
  const hasErrors = errorMessage && errorMessage.length > 0;
18633
18651
  const [showPassword, setShowPassword] = useState(false);
18634
18652
  const handleShowPassword = () => {
18635
18653
  setShowPassword((prevShowPassword) => !prevShowPassword);
18636
18654
  };
18637
- 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({ ref: ref, "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, placeholder: placeholder, onChange: onChange, className: `password-input ${hasErrors ? 'error' : ''} password-input--has-icon`, "aria-invalid": hasErrors ? 'true' : 'false', "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(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18655
+ const inputClasses = y$1('password-input', {
18656
+ error: hasErrors,
18657
+ }, 'password-input--has-icon');
18658
+ return (jsxs(Fragment, { children: [jsxs("div", { className: "password-input-wrapper", children: [jsx(Icon, { name: "lock", "data-testid": `${name}-embedded-icon`, className: "embedded-icon" }), jsx("input", Object.assign({ ref: ref, "data-testid": `form-password-input-${name}`, name: name, type: showPassword ? 'text' : 'password', disabled: isDisabled, placeholder: placeholder, onChange: onChange, className: inputClasses, "aria-invalid": hasErrors ? 'true' : 'false', "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired }, 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(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
18638
18659
  });
18660
+ const LabeledPasswordInput = withLabel(PasswordInput);
18639
18661
 
18640
18662
  const OptionComponent = (_a) => {
18641
18663
  var _b, _c, _d;
@@ -41053,5 +41075,5 @@ const Tooltip = (props) => {
41053
41075
  openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
41054
41076
  };
41055
41077
 
41056
- 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, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, 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, Select$1 as SelectInput, Shrug, SingleCombobox, Skeleton, 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 };
41078
+ 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, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, Form, GlobalStyles, Icon, IconButton, LabeledInput as Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, LabeledPasswordInput as PasswordInput, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Select$1 as SelectInput, Shrug, SingleCombobox, Skeleton, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, LabeledTextarea as Textarea, Toggle, Toggle$1 as ToggleInput, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
41057
41079
  //# sourceMappingURL=index.esm.js.map