diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts b/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts index 3383705be8c..77b1b739e23 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts @@ -18,6 +18,7 @@ export const simple = (): string => html`
html`
html`
`; +export const invalidStatus_TestOnly = (): string => html` +
+ +
+`; + export const darkModeRTL_TestOnly = (): string => html`
html`
html``; + +export const invalidStatus_TestOnly = (): string => + html``; diff --git a/packages/calcite-components/src/components/input-time-picker/input-time-picker.stories.ts b/packages/calcite-components/src/components/input-time-picker/input-time-picker.stories.ts index 2d462c6f2f5..7b02d22bdee 100644 --- a/packages/calcite-components/src/components/input-time-picker/input-time-picker.stories.ts +++ b/packages/calcite-components/src/components/input-time-picker/input-time-picker.stories.ts @@ -20,6 +20,7 @@ export const simple = (): string => html` name="${text("name", "simple")}" placement="${select("placement", menuPlacements, defaultMenuPlacement)}" scale="${select("scale", ["s", "m", "l"], "m")}" + status="${select("status", ["idle", "invalid", "valid"], "idle")}" step="${number("step", 1)}" value="${text("value", "10:37")}" > @@ -27,106 +28,43 @@ export const simple = (): string => html` `; export const deciSeconds_TestOnly = (): string => html` - - + `; export const centiseconds_TestOnly = (): string => html` - - + `; export const milliseconds_TestOnly = (): string => html` - - + `; export const disabled_TestOnly = (): string => html``; export const darkModeRTL_TestOnly = (): string => html` - - + `; darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault }; export const open_TestOnly = (): string => html` - - + `; export const koreanLocale_TestOnly = (): string => html` - - + `; export const arabicLocaleNumberingSystem_TestOnly = (): string => html` - + `; export const readOnlyHasNoDropdownAffordance_TestOnly = (): string => html` `; + +export const invalidStatus_TestOnly = (): string => html` + +`; diff --git a/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx b/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx index 3a47a4485d3..558ab833a51 100644 --- a/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx +++ b/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx @@ -57,7 +57,7 @@ import { localizeTimeString, toISOTimeString, } from "../../utils/time"; -import { Scale } from "../interfaces"; +import { Scale, Status } from "../interfaces"; import { TimePickerMessages } from "../time-picker/assets/time-picker/t9n"; import { connectMessages, disconnectMessages, setUpMessages, T9nComponent } from "../../utils/t9n"; import { InputTimePickerMessages } from "./assets/input-time-picker/t9n"; @@ -272,6 +272,9 @@ export class InputTimePicker /** Specifies the size of the component. */ @Prop({ reflect: true }) scale: Scale = "m"; + /** Specifies the status of the input field, which determines message and icons. */ + @Prop({ reflect: true }) status: Status = "idle"; + /** * Determines the type of positioning to use for the overlaid content. * @@ -980,6 +983,7 @@ export class InputTimePicker readOnly={readOnly} role="combobox" scale={this.scale} + status={this.status} step={this.step} // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530) ref={this.setInputAndTransitionEl}