Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Dec 1, 2023
1 parent 97f9559 commit f7e48f1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
@apply mt-0;
}

.message-container {
padding-block-start: 0.5rem;
display: flex;
flex-direction: column;
align-items: flex-start;
align-self: stretch;
}

:host([range][layout="vertical"][scale="m"]) .vertical-arrow-container {
inset-block-start: theme("spacing.6");
padding-inline-start: theme("spacing.3");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ export class InputDatePicker
}}
disabled={disabled}
icon="calendar"
messageIcon={this.messageIcon}
messageText={this.messageText}
onCalciteInputTextInput={this.calciteInternalInputInputHandler}
onCalciteInternalInputTextBlur={this.calciteInternalInputBlurHandler}
onCalciteInternalInputTextFocus={this.endInputFocus}
Expand All @@ -652,6 +650,13 @@ export class InputDatePicker
</div>
)}
<HiddenFormInputSlot component={this} />
{this.messageText ? (
<div class={CSS.messageContainer}>
<calcite-input-message icon={this.messageIcon} scale={this.scale} status={this.status}>
{this.messageText}
</calcite-input-message>
</div>
) : null}
</Host>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ export const darkModeRTL_TestOnly = (): string => html`
${boolean("disabled", false)}
value="${text("value", "")}"
placeholder="${text("placeholder", "Placeholder text")}"
message-text="My great input message"
>
</calcite-input-number>
<calcite-input-message status="${select("input message status", ["idle", "valid", "invalid"], "idle")}"
>${text("input message text", "My great input message")}</calcite-input-message
>
</calcite-label>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ export const darkModeRTL_TestOnly = (): string => html`
${boolean("disabled", false)}
value="${text("value", "")}"
placeholder="${text("placeholder", "Placeholder text")}"
message-text="My great input message"
>
</calcite-input-text>
<calcite-input-message status="${select("input message status", ["idle", "valid", "invalid"], "idle")}"
>${text("input message text", "My great input message")}</calcite-input-message
>
</div>
`;
darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
@apply relative;
}

.message-container {
padding-block-start: 0.5rem;
display: flex;
flex-direction: column;
align-items: flex-start;
align-self: stretch;
}

.toggle-icon {
@apply absolute flex cursor-pointer items-center;
inset-inline-end: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,6 @@ export const withSlottedAction = (): string => html`
</div>
`;

export const textarea = (): string => html`
<div style="width:300px;max-width:100%;text-align:center;">
<calcite-input
id="input-with-text-area"
type="textarea"
${boolean("loading", false)}
${boolean("clearable", false)}
${boolean("disabled", false)}
prefix-text="${text("prefix-text", "")}"
suffix-text="${text("suffix-text", "")}"
value="${text("value", "")}"
scale="${select("scale", ["s", "m", "l"], "m")}"
status="${select("status", ["idle", "invalid", "valid"], "idle")}"
placeholder="${text("placeholder", "Placeholder text")}"
message-text="${text("message-text", "My great input message")}"
message-icon="${select("message-icon", ["", ...iconNames], "")}"
>
</calcite-input>
</div>
`;

export const disabled_TestOnly = (): string => html`<calcite-input disabled value="disabled"></calcite-input>`;

export const darkModeRTL_TestOnly = (): string => html`
Expand Down Expand Up @@ -123,11 +102,9 @@ export const darkModeRTL_TestOnly = (): string => html`
${boolean("disabled", false)}
value="${text("value", "")}"
placeholder="${text("placeholder", "Placeholder text")}"
message-text="My great input message"
>
</calcite-input>
<calcite-input-message status="${select("input message status", ["idle", "valid", "invalid"], "idle")}"
>${text("input message text", "My great input message")}</calcite-input-message
>
</calcite-label>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export const validationMessageAllScales_TestOnly = (): string =>
display: flex;
flex-direction: column;
width: 420px;
height: 240px;
gap: 69px;
height: 200px;
gap: 50px;
}
</style>
<div class="container">
Expand All @@ -112,14 +112,14 @@ export const validationMessageAllScales_TestOnly = (): string =>
status="invalid"
message-text="Less than the minimum length of 6 characters"
message-icon
value="HI"
value="Hi"
></calcite-text-area>
<calcite-text-area
scale="l"
status="invalid"
message-text="Exceeds the maximum length of 9 characters"
message-icon
value="LOREM IPSUM"
value="Lorem ipsum"
></calcite-text-area>
</div>
`;

0 comments on commit f7e48f1

Please sign in to comment.