@indico-data/design-system 2.33.1 → 2.34.1
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 -1
- package/lib/index.d.ts +8 -8
- package/lib/index.esm.css +95 -1
- 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/components/table/styles/Table.scss +0 -1
- 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
|
@@ -1012,7 +1012,6 @@ a:hover, .link:hover {
|
|
|
1012
1012
|
.table .highlighted {
|
|
1013
1013
|
box-shadow: var(--pf-table-highlighted-box-shadow);
|
|
1014
1014
|
transform: translateY(-2px);
|
|
1015
|
-
z-index: 1;
|
|
1016
1015
|
border-bottom: var(--pf-border-md) solid var(--pf-table-highlighted-color);
|
|
1017
1016
|
}
|
|
1018
1017
|
.table .highlighted .rdt_TableCell {
|
|
@@ -1117,6 +1116,101 @@ a:hover, .link:hover {
|
|
|
1117
1116
|
margin-bottom: var(--pf-margin-2);
|
|
1118
1117
|
}
|
|
1119
1118
|
|
|
1119
|
+
:root,
|
|
1120
|
+
:root [data-theme=light],
|
|
1121
|
+
:root [data-theme=dark] {
|
|
1122
|
+
--pf-number-input-background-color: var(--pf-white-color);
|
|
1123
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1124
|
+
--pf-number-input-text-color: var(--pf-gray-color);
|
|
1125
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1126
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-400);
|
|
1127
|
+
--pf-number-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1128
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1129
|
+
--pf-number-input-padding: 10px;
|
|
1130
|
+
--pf-number-input-rounded: var(--pf-rounded);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
:root [data-theme=dark] {
|
|
1134
|
+
--pf-number-input-background-color: var(--pf-primary-color);
|
|
1135
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1136
|
+
--pf-number-input-text-color: var(--pf-gray-color-100);
|
|
1137
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-600);
|
|
1138
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-200);
|
|
1139
|
+
--pf-number-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1140
|
+
--pf-number-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1141
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.number-input {
|
|
1145
|
+
background-color: var(--pf-number-input-background-color);
|
|
1146
|
+
border: var(--pf-border-thin) solid var(--pf-input-border-color);
|
|
1147
|
+
border-radius: var(--pf-number-input-rounded);
|
|
1148
|
+
color: var(--pf-number-input-text-color);
|
|
1149
|
+
width: 100%;
|
|
1150
|
+
box-sizing: border-box;
|
|
1151
|
+
height: var(--pf-size-9);
|
|
1152
|
+
padding-right: var(--pf-number-input-padding);
|
|
1153
|
+
padding-left: var(--pf-number-input-padding);
|
|
1154
|
+
}
|
|
1155
|
+
.number-input--is-clearable {
|
|
1156
|
+
padding-right: var(--pf-padding-7);
|
|
1157
|
+
}
|
|
1158
|
+
.number-input--has-icon {
|
|
1159
|
+
padding-left: var(--pf-padding-7);
|
|
1160
|
+
}
|
|
1161
|
+
.number-input::-moz-placeholder {
|
|
1162
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1163
|
+
}
|
|
1164
|
+
.number-input::placeholder {
|
|
1165
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1166
|
+
}
|
|
1167
|
+
.number-input:focus {
|
|
1168
|
+
border-color: var(--pf-primary-color);
|
|
1169
|
+
}
|
|
1170
|
+
.number-input.error {
|
|
1171
|
+
border-color: var(--pf-error-color);
|
|
1172
|
+
}
|
|
1173
|
+
.number-input.success {
|
|
1174
|
+
border-color: var(--pf-success-color);
|
|
1175
|
+
}
|
|
1176
|
+
.number-input.warning {
|
|
1177
|
+
border-color: var(--pf-warning-color);
|
|
1178
|
+
}
|
|
1179
|
+
.number-input.info {
|
|
1180
|
+
border-color: var(--pf-info-color);
|
|
1181
|
+
}
|
|
1182
|
+
.number-input:disabled {
|
|
1183
|
+
background-color: var(--pf-number-input-disabled-background-color);
|
|
1184
|
+
border-color: var(--pf-number-input-disabled-border-color);
|
|
1185
|
+
color: var(--pf-number-input-disabled-color);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.form-control .help-text {
|
|
1189
|
+
margin-top: var(--pf-margin-2);
|
|
1190
|
+
margin-bottom: var(--pf-margin-2);
|
|
1191
|
+
color: var(--pf-number-input-help-text-color);
|
|
1192
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1193
|
+
}
|
|
1194
|
+
.form-control .number-input-wrapper {
|
|
1195
|
+
position: relative;
|
|
1196
|
+
}
|
|
1197
|
+
.form-control .number-input-wrapper .embedded-icon {
|
|
1198
|
+
position: absolute;
|
|
1199
|
+
top: 10px;
|
|
1200
|
+
left: var(--pf-margin-2);
|
|
1201
|
+
color: var(--pf-number-input-text-color);
|
|
1202
|
+
}
|
|
1203
|
+
.form-control .number-input-wrapper .clearable-icon {
|
|
1204
|
+
position: absolute;
|
|
1205
|
+
top: var(--pf-margin-3);
|
|
1206
|
+
right: var(--pf-margin-2);
|
|
1207
|
+
color: var(--pf-number-input-text-color);
|
|
1208
|
+
cursor: pointer;
|
|
1209
|
+
}
|
|
1210
|
+
.form-control .form-label {
|
|
1211
|
+
margin-bottom: var(--pf-margin-2);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1120
1214
|
:root,
|
|
1121
1215
|
:root [data-theme=light],
|
|
1122
1216
|
: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
|
@@ -1012,7 +1012,6 @@ a:hover, .link:hover {
|
|
|
1012
1012
|
.table .highlighted {
|
|
1013
1013
|
box-shadow: var(--pf-table-highlighted-box-shadow);
|
|
1014
1014
|
transform: translateY(-2px);
|
|
1015
|
-
z-index: 1;
|
|
1016
1015
|
border-bottom: var(--pf-border-md) solid var(--pf-table-highlighted-color);
|
|
1017
1016
|
}
|
|
1018
1017
|
.table .highlighted .rdt_TableCell {
|
|
@@ -1117,6 +1116,101 @@ a:hover, .link:hover {
|
|
|
1117
1116
|
margin-bottom: var(--pf-margin-2);
|
|
1118
1117
|
}
|
|
1119
1118
|
|
|
1119
|
+
:root,
|
|
1120
|
+
:root [data-theme=light],
|
|
1121
|
+
:root [data-theme=dark] {
|
|
1122
|
+
--pf-number-input-background-color: var(--pf-white-color);
|
|
1123
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1124
|
+
--pf-number-input-text-color: var(--pf-gray-color);
|
|
1125
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-300);
|
|
1126
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-400);
|
|
1127
|
+
--pf-number-input-disabled-background-color: var(--pf-gray-color-100);
|
|
1128
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1129
|
+
--pf-number-input-padding: 10px;
|
|
1130
|
+
--pf-number-input-rounded: var(--pf-rounded);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
:root [data-theme=dark] {
|
|
1134
|
+
--pf-number-input-background-color: var(--pf-primary-color);
|
|
1135
|
+
--pf-number-input-border-color: var(--pf-form-input-border-color);
|
|
1136
|
+
--pf-number-input-text-color: var(--pf-gray-color-100);
|
|
1137
|
+
--pf-number-input-placeholder-text-color: var(--pf-gray-color-600);
|
|
1138
|
+
--pf-number-input-help-text-color: var(--pf-gray-color-200);
|
|
1139
|
+
--pf-number-input-disabled-background-color: var(--pf-primary-color-200);
|
|
1140
|
+
--pf-number-input-disabled-border-color: var(--pf-gray-color-300);
|
|
1141
|
+
--pf-number-input-disabled-color: var(--pf-gray-color-400);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.number-input {
|
|
1145
|
+
background-color: var(--pf-number-input-background-color);
|
|
1146
|
+
border: var(--pf-border-thin) solid var(--pf-input-border-color);
|
|
1147
|
+
border-radius: var(--pf-number-input-rounded);
|
|
1148
|
+
color: var(--pf-number-input-text-color);
|
|
1149
|
+
width: 100%;
|
|
1150
|
+
box-sizing: border-box;
|
|
1151
|
+
height: var(--pf-size-9);
|
|
1152
|
+
padding-right: var(--pf-number-input-padding);
|
|
1153
|
+
padding-left: var(--pf-number-input-padding);
|
|
1154
|
+
}
|
|
1155
|
+
.number-input--is-clearable {
|
|
1156
|
+
padding-right: var(--pf-padding-7);
|
|
1157
|
+
}
|
|
1158
|
+
.number-input--has-icon {
|
|
1159
|
+
padding-left: var(--pf-padding-7);
|
|
1160
|
+
}
|
|
1161
|
+
.number-input::-moz-placeholder {
|
|
1162
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1163
|
+
}
|
|
1164
|
+
.number-input::placeholder {
|
|
1165
|
+
color: var(--pf-number-input-placeholder-text-color);
|
|
1166
|
+
}
|
|
1167
|
+
.number-input:focus {
|
|
1168
|
+
border-color: var(--pf-primary-color);
|
|
1169
|
+
}
|
|
1170
|
+
.number-input.error {
|
|
1171
|
+
border-color: var(--pf-error-color);
|
|
1172
|
+
}
|
|
1173
|
+
.number-input.success {
|
|
1174
|
+
border-color: var(--pf-success-color);
|
|
1175
|
+
}
|
|
1176
|
+
.number-input.warning {
|
|
1177
|
+
border-color: var(--pf-warning-color);
|
|
1178
|
+
}
|
|
1179
|
+
.number-input.info {
|
|
1180
|
+
border-color: var(--pf-info-color);
|
|
1181
|
+
}
|
|
1182
|
+
.number-input:disabled {
|
|
1183
|
+
background-color: var(--pf-number-input-disabled-background-color);
|
|
1184
|
+
border-color: var(--pf-number-input-disabled-border-color);
|
|
1185
|
+
color: var(--pf-number-input-disabled-color);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.form-control .help-text {
|
|
1189
|
+
margin-top: var(--pf-margin-2);
|
|
1190
|
+
margin-bottom: var(--pf-margin-2);
|
|
1191
|
+
color: var(--pf-number-input-help-text-color);
|
|
1192
|
+
font-size: var(--pf-font-size-subtitle2);
|
|
1193
|
+
}
|
|
1194
|
+
.form-control .number-input-wrapper {
|
|
1195
|
+
position: relative;
|
|
1196
|
+
}
|
|
1197
|
+
.form-control .number-input-wrapper .embedded-icon {
|
|
1198
|
+
position: absolute;
|
|
1199
|
+
top: 10px;
|
|
1200
|
+
left: var(--pf-margin-2);
|
|
1201
|
+
color: var(--pf-number-input-text-color);
|
|
1202
|
+
}
|
|
1203
|
+
.form-control .number-input-wrapper .clearable-icon {
|
|
1204
|
+
position: absolute;
|
|
1205
|
+
top: var(--pf-margin-3);
|
|
1206
|
+
right: var(--pf-margin-2);
|
|
1207
|
+
color: var(--pf-number-input-text-color);
|
|
1208
|
+
cursor: pointer;
|
|
1209
|
+
}
|
|
1210
|
+
.form-control .form-label {
|
|
1211
|
+
margin-bottom: var(--pf-margin-2);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1120
1214
|
:root,
|
|
1121
1215
|
:root [data-theme=light],
|
|
1122
1216
|
: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
|
|