Skip to content

Commit e2c4f05

Browse files
Copilotmfranzkegithub-actions[bot]michaelmkraus
authored
feat: configurable infotext sizes for DBInput component (#4788)
* Initial plan * Add configurable infotext sizes to DBInput component Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> * refactor: codestyle * auto update snapshots (#4793) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review * auto update snapshots (#4795) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Forward new messageSize props to framework showcases and simplify input.json example Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> * auto update snapshots (#4826) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: we don't want to document these properties * docs: we don't want to document these properties * Apply suggestions from code review --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> Co-authored-by: Maximilian Franzke <Maximilian.Franzke@deutschebahn.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kraus <michael.m.kraus@deutschebahn.com>
1 parent d67eaa0 commit e2c4f05

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed
0 Bytes
Loading
902 Bytes
Loading
931 Bytes
Loading

packages/components/src/components/input/input.lite.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export default function DBInput(props: DBInputProps) {
279279
{props.children}
280280
<Show when={stringPropVisible(props.message, props.showMessage)}>
281281
<DBInfotext
282-
size="small"
282+
size={props.messageSize || 'small'}
283283
icon={props.messageIcon}
284284
id={state._messageId}>
285285
{props.message}
@@ -289,15 +289,15 @@ export default function DBInput(props: DBInputProps) {
289289
<Show when={state.hasValidState()}>
290290
<DBInfotext
291291
id={state._validMessageId}
292-
size="small"
292+
size={props.validMessageSize || 'small'}
293293
semantic="successful">
294294
{props.validMessage || DEFAULT_VALID_MESSAGE}
295295
</DBInfotext>
296296
</Show>
297297

298298
<DBInfotext
299299
id={state._invalidMessageId}
300-
size="small"
300+
size={props.invalidMessageSize || 'small'}
301301
semantic="critical">
302302
{state._invalidMessage}
303303
</DBInfotext>

packages/components/src/components/input/model.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
ShowIconLeadingProps,
2020
ShowIconProps,
2121
ShowIconTrailingProps,
22+
SizeType,
2223
ValueLabelType
2324
} from '../../shared/model';
2425

@@ -76,6 +77,18 @@ export type DBInputDefaultProps = {
7677
* Sets [step value](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step).
7778
*/
7879
step?: number | string;
80+
/**
81+
* The size of the message infotext. Defaults to "small".
82+
*/
83+
messageSize?: SizeType;
84+
/**
85+
* The size of the valid message infotext. Defaults to "small".
86+
*/
87+
validMessageSize?: SizeType;
88+
/**
89+
* The size of the invalid message infotext. Defaults to "small".
90+
*/
91+
invalidMessageSize?: SizeType;
7992
};
8093

8194
export type DBInputProps = DBInputDefaultProps &

0 commit comments

Comments
 (0)