@indico-data/design-system 2.33.1 → 2.34.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/.storybook/preview-head.html +0 -4
- package/lib/index.css +95 -0
- package/lib/index.d.ts +8 -8
- package/lib/index.esm.css +95 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/src/components/forms/input/Input.d.ts +5 -3
- package/lib/src/components/forms/numberInput/NumberInput.d.ts +11 -0
- package/lib/src/components/forms/numberInput/NumberInput.stories.d.ts +12 -0
- package/lib/src/components/forms/numberInput/__tests__/NumberInput.test.d.ts +1 -0
- package/lib/src/components/forms/numberInput/index.d.ts +1 -0
- package/lib/src/components/forms/passwordInput/PasswordInput.d.ts +3 -3
- package/lib/src/components/forms/subcomponents/Label.d.ts +1 -3
- package/lib/src/components/forms/textarea/Textarea.d.ts +3 -3
- package/lib/src/storybook/formArgTypes.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/forms/input/Input.stories.tsx +2 -96
- package/src/components/forms/input/Input.tsx +5 -3
- package/src/components/forms/numberInput/NumberInput.mdx +32 -0
- package/src/components/forms/numberInput/NumberInput.stories.tsx +215 -0
- package/src/components/forms/numberInput/NumberInput.tsx +90 -0
- package/src/components/forms/numberInput/__tests__/NumberInput.test.tsx +94 -0
- package/src/components/forms/numberInput/index.ts +1 -0
- package/src/components/forms/numberInput/styles/NumberInput.scss +108 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +3 -70
- package/src/components/forms/passwordInput/PasswordInput.tsx +2 -2
- package/src/components/forms/subcomponents/Label.tsx +1 -4
- package/src/components/forms/textarea/Textarea.stories.tsx +3 -68
- package/src/components/forms/textarea/Textarea.tsx +2 -2
- package/src/storybook/formArgTypes.ts +152 -0
- package/src/styles/index.scss +1 -0
- package/lib/src/storybook/labelArgTypes.d.ts +0 -3
- package/src/storybook/labelArgTypes.ts +0 -50
package/lib/index.css
CHANGED
|
@@ -1117,6 +1117,101 @@ a:hover, .link:hover {
|
|
|
1117
1117
|
margin-bottom: var(--pf-margin-2);
|
|
1118
1118
|
}
|
|
1119
1119
|
|
|
1120
|
+
:root,
|
|
1121
|
+
:root [data-theme=light],
|
|
1122
|
+
:root [data-theme=dark] {
|
|
1123
|
+
--pf-number-input-background-color: var(--pf-white-color);
|
|
1124
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1125
|
+
--pf-number-input-text-color: var(--pf-gray-color);
|
|
1126
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1127
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-400);
|
|
1128
|
+
--pf-number-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1129
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1130
|
+
--pf-number-input-padding: 10px;
|
|
1131
|
+
--pf-number-input-rounded: var(--pf-rounded);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
:root [data-theme=dark] {
|
|
1135
|
+
--pf-number-input-background-color: var(--pf-primary-color);
|
|
1136
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1137
|
+
--pf-number-input-text-color: var(--pf-gray-color-100);
|
|
1138
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-600);
|
|
1139
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-200);
|
|
1140
|
+
--pf-number-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1141
|
+
--pf-number-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1142
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.number-input {
|
|
1146
|
+
background-color: var(--pf-number-input-background-color);
|
|
1147
|
+
border: var(--pf-border-thin) solid var(--pf-input-border-color);
|
|
1148
|
+
border-radius: var(--pf-number-input-rounded);
|
|
1149
|
+
color: var(--pf-number-input-text-color);
|
|
1150
|
+
width: 100%;
|
|
1151
|
+
box-sizing: border-box;
|
|
1152
|
+
height: var(--pf-size-9);
|
|
1153
|
+
padding-right: var(--pf-number-input-padding);
|
|
1154
|
+
padding-left: var(--pf-number-input-padding);
|
|
1155
|
+
}
|
|
1156
|
+
.number-input--is-clearable {
|
|
1157
|
+
padding-right: var(--pf-padding-7);
|
|
1158
|
+
}
|
|
1159
|
+
.number-input--has-icon {
|
|
1160
|
+
padding-left: var(--pf-padding-7);
|
|
1161
|
+
}
|
|
1162
|
+
.number-input::-moz-placeholder {
|
|
1163
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1164
|
+
}
|
|
1165
|
+
.number-input::placeholder {
|
|
1166
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1167
|
+
}
|
|
1168
|
+
.number-input:focus {
|
|
1169
|
+
border-color: var(--pf-primary-color);
|
|
1170
|
+
}
|
|
1171
|
+
.number-input.error {
|
|
1172
|
+
border-color: var(--pf-error-color);
|
|
1173
|
+
}
|
|
1174
|
+
.number-input.success {
|
|
1175
|
+
border-color: var(--pf-success-color);
|
|
1176
|
+
}
|
|
1177
|
+
.number-input.warning {
|
|
1178
|
+
border-color: var(--pf-warning-color);
|
|
1179
|
+
}
|
|
1180
|
+
.number-input.info {
|
|
1181
|
+
border-color: var(--pf-info-color);
|
|
1182
|
+
}
|
|
1183
|
+
.number-input:disabled {
|
|
1184
|
+
background-color: var(--pf-number-input-disabled-background-color);
|
|
1185
|
+
border-color: var(--pf-number-input-disabled-border-color);
|
|
1186
|
+
color: var(--pf-number-input-disabled-color);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.form-control .help-text {
|
|
1190
|
+
margin-top: var(--pf-margin-2);
|
|
1191
|
+
margin-bottom: var(--pf-margin-2);
|
|
1192
|
+
color: var(--pf-number-input-help-text-color);
|
|
1193
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1194
|
+
}
|
|
1195
|
+
.form-control .number-input-wrapper {
|
|
1196
|
+
position: relative;
|
|
1197
|
+
}
|
|
1198
|
+
.form-control .number-input-wrapper .embedded-icon {
|
|
1199
|
+
position: absolute;
|
|
1200
|
+
top: 10px;
|
|
1201
|
+
left: var(--pf-margin-2);
|
|
1202
|
+
color: var(--pf-number-input-text-color);
|
|
1203
|
+
}
|
|
1204
|
+
.form-control .number-input-wrapper .clearable-icon {
|
|
1205
|
+
position: absolute;
|
|
1206
|
+
top: var(--pf-margin-3);
|
|
1207
|
+
right: var(--pf-margin-2);
|
|
1208
|
+
color: var(--pf-number-input-text-color);
|
|
1209
|
+
cursor: pointer;
|
|
1210
|
+
}
|
|
1211
|
+
.form-control .form-label {
|
|
1212
|
+
margin-bottom: var(--pf-margin-2);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1120
1215
|
:root,
|
|
1121
1216
|
:root [data-theme=light],
|
|
1122
1217
|
:root [data-theme=dark] {
|
package/lib/index.d.ts
CHANGED
|
@@ -934,12 +934,10 @@ interface LabelProps {
|
|
|
934
934
|
label: string;
|
|
935
935
|
name: string;
|
|
936
936
|
isRequired?: boolean;
|
|
937
|
-
}
|
|
938
|
-
interface WithLabelProps extends LabelProps {
|
|
939
937
|
hasHiddenLabel?: boolean;
|
|
940
938
|
}
|
|
941
939
|
|
|
942
|
-
interface
|
|
940
|
+
interface BaseInputProps {
|
|
943
941
|
value?: string | undefined;
|
|
944
942
|
placeholder?: string;
|
|
945
943
|
onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -951,7 +949,9 @@ interface InputProps extends WithLabelProps {
|
|
|
951
949
|
className?: string;
|
|
952
950
|
defaultValue?: string;
|
|
953
951
|
}
|
|
954
|
-
|
|
952
|
+
interface InputProps extends BaseInputProps, LabelProps {
|
|
953
|
+
}
|
|
954
|
+
declare const LabeledInput: React$1.ForwardRefExoticComponent<Omit<InputProps & React$1.RefAttributes<HTMLInputElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
|
|
955
955
|
|
|
956
956
|
interface RadioProps {
|
|
957
957
|
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
@@ -991,7 +991,7 @@ interface ToggleProps {
|
|
|
991
991
|
}
|
|
992
992
|
declare const Toggle: React$1.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
993
993
|
|
|
994
|
-
interface TextareaProps extends
|
|
994
|
+
interface TextareaProps extends LabelProps {
|
|
995
995
|
ref?: React$1.LegacyRef<HTMLTextAreaElement>;
|
|
996
996
|
placeholder?: string;
|
|
997
997
|
value?: string | undefined;
|
|
@@ -1008,9 +1008,9 @@ interface TextareaProps extends WithLabelProps {
|
|
|
1008
1008
|
autofocus?: boolean;
|
|
1009
1009
|
defaultValue?: string;
|
|
1010
1010
|
}
|
|
1011
|
-
declare const LabeledTextarea: React$1.ForwardRefExoticComponent<Omit<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement> &
|
|
1011
|
+
declare const LabeledTextarea: React$1.ForwardRefExoticComponent<Omit<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
|
|
1012
1012
|
|
|
1013
|
-
interface PasswordInputProps extends
|
|
1013
|
+
interface PasswordInputProps extends LabelProps {
|
|
1014
1014
|
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
1015
1015
|
value?: string | undefined;
|
|
1016
1016
|
placeholder?: string;
|
|
@@ -1021,7 +1021,7 @@ interface PasswordInputProps extends WithLabelProps {
|
|
|
1021
1021
|
hasShowPassword?: boolean;
|
|
1022
1022
|
defaultValue?: string;
|
|
1023
1023
|
}
|
|
1024
|
-
declare const LabeledPasswordInput: React$1.ForwardRefExoticComponent<Omit<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement> &
|
|
1024
|
+
declare const LabeledPasswordInput: React$1.ForwardRefExoticComponent<Omit<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
|
|
1025
1025
|
|
|
1026
1026
|
interface SelectProps<OptionType extends SelectOption> extends Props$r<OptionType> {
|
|
1027
1027
|
options: OptionType[];
|
package/lib/index.esm.css
CHANGED
|
@@ -1117,6 +1117,101 @@ a:hover, .link:hover {
|
|
|
1117
1117
|
margin-bottom: var(--pf-margin-2);
|
|
1118
1118
|
}
|
|
1119
1119
|
|
|
1120
|
+
:root,
|
|
1121
|
+
:root [data-theme=light],
|
|
1122
|
+
:root [data-theme=dark] {
|
|
1123
|
+
--pf-number-input-background-color: var(--pf-white-color);
|
|
1124
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1125
|
+
--pf-number-input-text-color: var(--pf-gray-color);
|
|
1126
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1127
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-400);
|
|
1128
|
+
--pf-number-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1129
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1130
|
+
--pf-number-input-padding: 10px;
|
|
1131
|
+
--pf-number-input-rounded: var(--pf-rounded);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
:root [data-theme=dark] {
|
|
1135
|
+
--pf-number-input-background-color: var(--pf-primary-color);
|
|
1136
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1137
|
+
--pf-number-input-text-color: var(--pf-gray-color-100);
|
|
1138
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-600);
|
|
1139
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-200);
|
|
1140
|
+
--pf-number-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1141
|
+
--pf-number-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1142
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.number-input {
|
|
1146
|
+
background-color: var(--pf-number-input-background-color);
|
|
1147
|
+
border: var(--pf-border-thin) solid var(--pf-input-border-color);
|
|
1148
|
+
border-radius: var(--pf-number-input-rounded);
|
|
1149
|
+
color: var(--pf-number-input-text-color);
|
|
1150
|
+
width: 100%;
|
|
1151
|
+
box-sizing: border-box;
|
|
1152
|
+
height: var(--pf-size-9);
|
|
1153
|
+
padding-right: var(--pf-number-input-padding);
|
|
1154
|
+
padding-left: var(--pf-number-input-padding);
|
|
1155
|
+
}
|
|
1156
|
+
.number-input--is-clearable {
|
|
1157
|
+
padding-right: var(--pf-padding-7);
|
|
1158
|
+
}
|
|
1159
|
+
.number-input--has-icon {
|
|
1160
|
+
padding-left: var(--pf-padding-7);
|
|
1161
|
+
}
|
|
1162
|
+
.number-input::-moz-placeholder {
|
|
1163
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1164
|
+
}
|
|
1165
|
+
.number-input::placeholder {
|
|
1166
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1167
|
+
}
|
|
1168
|
+
.number-input:focus {
|
|
1169
|
+
border-color: var(--pf-primary-color);
|
|
1170
|
+
}
|
|
1171
|
+
.number-input.error {
|
|
1172
|
+
border-color: var(--pf-error-color);
|
|
1173
|
+
}
|
|
1174
|
+
.number-input.success {
|
|
1175
|
+
border-color: var(--pf-success-color);
|
|
1176
|
+
}
|
|
1177
|
+
.number-input.warning {
|
|
1178
|
+
border-color: var(--pf-warning-color);
|
|
1179
|
+
}
|
|
1180
|
+
.number-input.info {
|
|
1181
|
+
border-color: var(--pf-info-color);
|
|
1182
|
+
}
|
|
1183
|
+
.number-input:disabled {
|
|
1184
|
+
background-color: var(--pf-number-input-disabled-background-color);
|
|
1185
|
+
border-color: var(--pf-number-input-disabled-border-color);
|
|
1186
|
+
color: var(--pf-number-input-disabled-color);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.form-control .help-text {
|
|
1190
|
+
margin-top: var(--pf-margin-2);
|
|
1191
|
+
margin-bottom: var(--pf-margin-2);
|
|
1192
|
+
color: var(--pf-number-input-help-text-color);
|
|
1193
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1194
|
+
}
|
|
1195
|
+
.form-control .number-input-wrapper {
|
|
1196
|
+
position: relative;
|
|
1197
|
+
}
|
|
1198
|
+
.form-control .number-input-wrapper .embedded-icon {
|
|
1199
|
+
position: absolute;
|
|
1200
|
+
top: 10px;
|
|
1201
|
+
left: var(--pf-margin-2);
|
|
1202
|
+
color: var(--pf-number-input-text-color);
|
|
1203
|
+
}
|
|
1204
|
+
.form-control .number-input-wrapper .clearable-icon {
|
|
1205
|
+
position: absolute;
|
|
1206
|
+
top: var(--pf-margin-3);
|
|
1207
|
+
right: var(--pf-margin-2);
|
|
1208
|
+
color: var(--pf-number-input-text-color);
|
|
1209
|
+
cursor: pointer;
|
|
1210
|
+
}
|
|
1211
|
+
.form-control .form-label {
|
|
1212
|
+
margin-bottom: var(--pf-margin-2);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1120
1215
|
:root,
|
|
1121
1216
|
:root [data-theme=light],
|
|
1122
1217
|
:root [data-theme=dark] {
|
package/lib/index.esm.js
CHANGED
|
@@ -20973,7 +20973,7 @@ const Input = React__default.forwardRef((_a, ref) => {
|
|
|
20973
20973
|
error: hasErrors,
|
|
20974
20974
|
'input--has-icon': iconName,
|
|
20975
20975
|
}, className);
|
|
20976
|
-
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 }))] }));
|
|
20976
|
+
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 && !isDisabled && (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 }))] }));
|
|
20977
20977
|
});
|
|
20978
20978
|
const LabeledInput = withLabel(Input);
|
|
20979
20979
|
|