Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(input-date-picker, input-time-picker): adjust chevron scale accordingly #8012

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ export const invalidStatus_TestOnly = (): string => html`
</div>
`;

export const scales_TestOnly = (): string =>
html`
<calcite-input-date-picker scale="s" icon value="2020-12-12"></calcite-input-date-picker>
<calcite-input-date-picker scale="m" icon value="2020-12-12"></calcite-input-date-picker>
<calcite-input-date-picker scale="l" icon value="2020-12-12"></calcite-input-date-picker>
`;

export const darkModeRTL_TestOnly = (): string => html`
<div style="width: 400px">
<calcite-input-date-picker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ export class InputDatePicker
renderToggleIcon(open: boolean): VNode {
return (
<span class={CSS.toggleIcon}>
<calcite-icon icon={open ? "chevron-up" : "chevron-down"} scale="s" />
<calcite-icon
icon={open ? "chevron-up" : "chevron-down"}
scale={getIconScale(this.scale)}
/>
</span>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export const milliseconds_TestOnly = (): string => html`
export const disabled_TestOnly = (): string =>
html`<calcite-input-time-picker disabled scale="l" icon step="1" value="01:02"></calcite-input-time-picker>`;

export const scales_TestOnly = (): string =>
html`
<calcite-input-time-picker scale="s" icon value="01:02"></calcite-input-time-picker>
<calcite-input-time-picker scale="m" icon value="01:02"></calcite-input-time-picker>
<calcite-input-time-picker scale="l" icon value="01:02"></calcite-input-time-picker>
`;

export const darkModeRTL_TestOnly = (): string => html`
<calcite-input-time-picker class="calcite-mode-dark" value="22:37" step="1"> </calcite-input-time-picker>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import updateLocale from "dayjs/esm/plugin/updateLocale";
import { getSupportedLocale } from "../../utils/locale";
import { onToggleOpenCloseComponent, OpenCloseComponent } from "../../utils/openCloseComponent";
import { decimalPlaces } from "../../utils/math";
import { getIconScale } from "../../utils/component";

// some bundlers (e.g., Webpack) need dynamic import paths to be static
const supportedDayjsLocaleToLocaleConfigImport = new Map([
Expand Down Expand Up @@ -1026,7 +1027,10 @@ export class InputTimePicker
renderToggleIcon(open: boolean): VNode {
return (
<span class={CSS.toggleIcon}>
<calcite-icon icon={open ? "chevron-up" : "chevron-down"} scale="s" />
<calcite-icon
icon={open ? "chevron-up" : "chevron-down"}
scale={getIconScale(this.scale)}
/>
</span>
);
}
Expand Down