Skip to content

Commit

Permalink
refactor(odyssey-react-mui): adding missing props to Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
bryancunningham-okta committed Aug 2, 2024
1 parent 766f3e7 commit dec1a31
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
3 changes: 3 additions & 0 deletions packages/odyssey-react-mui/src/labs/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type DateFieldProps = {
| "errorMessage"
| "hasInitialFocus"
| "hint"
| "HintLinkComponent"
| "id"
| "isDisabled"
| "isOptional"
Expand Down Expand Up @@ -71,6 +72,7 @@ const DateField = ({
errorMessage,
hasInitialFocus,
hint,
HintLinkComponent,
id: idOverride,
inputRef,
isDisabled = false,
Expand Down Expand Up @@ -253,6 +255,7 @@ const DateField = ({
fieldType="single"
hasVisibleLabel
hint={hint}
HintLinkComponent={HintLinkComponent}
id={idOverride}
isDisabled={isDisabled}
isOptional={isOptional}
Expand Down
10 changes: 9 additions & 1 deletion packages/odyssey-react-mui/src/labs/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,19 @@ export type DatePickerProps = {
} & OdysseyDateFieldProps &
Pick<
FieldComponentProps,
"errorMessage" | "hint" | "isDisabled" | "isReadOnly" | "isOptional"
| "errorMessage"
| "hint"
| "HintLinkComponent"
| "isDisabled"
| "isReadOnly"
| "isOptional"
>;

const DatePicker = ({
defaultValue: defaultValueProp,
errorMessage,
hint,
HintLinkComponent,
isDateEnabled = () => true,
isDisabled,
isOptional,
Expand Down Expand Up @@ -267,6 +273,7 @@ const DatePicker = ({
}
errorMessage={errorMessage}
hint={hint}
HintLinkComponent={HintLinkComponent}
inputRef={inputRef}
isDisabled={isDisabled}
isOptional={isOptional}
Expand All @@ -284,6 +291,7 @@ const DatePicker = ({
[
errorMessage,
hint,
HintLinkComponent,
internalTimeZone,
isDisabled,
isOptional,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@ const storybookMeta: Meta<DatePickerProps> = {
},
},
errorMessage: fieldComponentPropsMetaData.errorMessage,
hint: {
control: "text",
description: "The hint text for the autocomplete input",
table: {
type: {
summary: "string",
},
},
},
hint: fieldComponentPropsMetaData.hint,
HintLinkComponent: fieldComponentPropsMetaData.HintLinkComponent,
isDisabled: fieldComponentPropsMetaData.isDisabled,
isOptional: fieldComponentPropsMetaData.isOptional,
isReadOnly: fieldComponentPropsMetaData.isReadOnly,
Expand All @@ -70,6 +63,32 @@ const storybookMeta: Meta<DatePickerProps> = {
},
},
},
timeZone: {
description: "an IANA time zone applied to the DatePicker",
table: {
type: {
summary: "string",
},
},
},
timeZonePickerLabel: {
description:
"label applied to the `TimeZonePicker` field if `TimeZonePicker` field is rendered",
table: {
type: {
summary: "string",
},
},
},
timeZoneOptions: {
control: "none",
description: "an array of options for the TimeZonePicker",
table: {
type: {
summary: "[{label: string, value: string(valid IANA time zone)}]",
},
},
},
},
args: {
label: "Date picker label",
Expand Down

0 comments on commit dec1a31

Please sign in to comment.