@cerebruminc/cerebellum 20.0.2 → 20.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +2 -2
  3. package/src/SharedStorybook/types.ts +1 -1
  4. package/src/codemods/formatMdxStorybook7Update.ts +4 -2
  5. package/src/components/Button/Button.stories.tsx +2 -2
  6. package/src/components/CheckboxGroup/CheckboxGroup.stories.tsx +2 -1
  7. package/src/components/CheckboxItem/CheckboxItem.stories.tsx +5 -4
  8. package/src/components/ClickOutHandler/ClickOutHandler.stories.tsx +3 -3
  9. package/src/components/ColorPickerInput/ColorPickerInput.stories.tsx +2 -1
  10. package/src/components/ColorPickerMenu/ColorPickerMenu.stories.tsx +2 -1
  11. package/src/components/ConfigurableInput/ConfigurableInput.stories.tsx +2 -1
  12. package/src/components/ConfigurableInput/ConfigurableInput.test.tsx +1 -1
  13. package/src/components/ConfirmModal/ConfirmModal.stories.tsx +2 -1
  14. package/src/components/CreditCardInput/CreditCardInput.stories.tsx +3 -2
  15. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +2 -1
  16. package/src/components/DescriptiveSwitchMenu/DescriptiveSwitchMenu.stories.tsx +3 -2
  17. package/src/components/Drawer/Drawer.stories.tsx +1 -1
  18. package/src/components/EmailInput/EmailInput.stories.tsx +2 -1
  19. package/src/components/FiltersBar/FiltersBar.stories.tsx +2 -1
  20. package/src/components/Form/Form.stories.tsx +1 -1
  21. package/src/components/Form/Form.test.tsx +1 -1
  22. package/src/components/Form/fields/AddressField/AddressField.stories.tsx +5 -4
  23. package/src/components/Form/fields/CheckboxField/CheckboxField.stories.tsx +4 -3
  24. package/src/components/Form/fields/CheckboxGroupField/CheckboxGroupField.stories.tsx +4 -3
  25. package/src/components/Form/fields/ColorPickerField/ColorPickerField.stories.tsx +2 -2
  26. package/src/components/Form/fields/ConfigurableInputField/ConfigurableInputField.stories.tsx +6 -5
  27. package/src/components/Form/fields/CountrySelectField/CountrySelectField.stories.tsx +4 -4
  28. package/src/components/Form/fields/CountySelectField/CountySelectField.stories.tsx +5 -5
  29. package/src/components/Form/fields/CreditCardField/CreditCardField.stories.tsx +2 -2
  30. package/src/components/Form/fields/CurrencyField/CurrencyField.stories.tsx +2 -2
  31. package/src/components/Form/fields/DatePickerField/DatePickerField.stories.tsx +7 -6
  32. package/src/components/Form/fields/DescriptiveDropdownInputField/DescriptiveDropdownInputField.stories.tsx +2 -2
  33. package/src/components/Form/fields/EmailField/EmailField.stories.tsx +2 -2
  34. package/src/components/Form/fields/HiddenField/HiddenField.stories.tsx +2 -2
  35. package/src/components/Form/fields/ImagePickerField/ImagePickerField.stories.tsx +6 -5
  36. package/src/components/Form/fields/MultiSelectField/MultiSelectField.stories.tsx +3 -3
  37. package/src/components/Form/fields/NationalitySelectField/NationalitySelectField.stories.tsx +3 -3
  38. package/src/components/Form/fields/NumberField/NumberField.stories.tsx +5 -4
  39. package/src/components/Form/fields/PasswordField/PasswordField.stories.tsx +5 -4
  40. package/src/components/Form/fields/PhoneField/PhoneField.stories.tsx +5 -4
  41. package/src/components/Form/fields/RadioGroupField/RadioGroupField.stories.tsx +4 -3
  42. package/src/components/Form/fields/RemovableField/RemovableField.stories.tsx +2 -2
  43. package/src/components/Form/fields/SectionHeader/SectionHeader.stories.tsx +2 -2
  44. package/src/components/Form/fields/SelectField/SelectField.stories.tsx +3 -3
  45. package/src/components/Form/fields/SocialSecurityField/SocialSecurityField.stories.tsx +5 -4
  46. package/src/components/Form/fields/SplitLineField/SplitLineField.stories.tsx +1 -1
  47. package/src/components/Form/fields/StateSelectField/StateSelectField.stories.tsx +3 -3
  48. package/src/components/Form/fields/TextField/TextField.stories.tsx +5 -4
  49. package/src/components/Form/fields/TextareaField/TextareaField.stories.tsx +5 -4
  50. package/src/components/Form/fields/ToggleField/ToggleField.stories.tsx +4 -3
  51. package/src/components/Form/fields/ToggleGroupField/ToggleGroupField.stories.tsx +4 -3
  52. package/src/components/Form/fields/ZipCodeField/ZipCodeField.stories.tsx +5 -4
  53. package/src/components/Form/stories/ClearingForms.stories.tsx +2 -1
  54. package/src/components/Form/stories/DynamicFields.stories.tsx +3 -3
  55. package/src/components/Form/stories/LeftLabels.stories.tsx +3 -2
  56. package/src/components/Form/stories/Loading.stories.tsx +2 -1
  57. package/src/components/Form/stories/StickyFooter.stories.tsx +2 -1
  58. package/src/components/HorizontalTabMenu/HorizontalTabMenu.stories.tsx +3 -2
  59. package/src/components/IconTile/IconTile.stories.tsx +2 -1
  60. package/src/components/InlineCreditCardInput/InlineCreditCardInput.stories.tsx +2 -1
  61. package/src/components/InlineCurrencyInput/InlineCurrencyInput.stories.tsx +2 -1
  62. package/src/components/InlineEmailInput/InlineEmailInput.stories.tsx +2 -1
  63. package/src/components/InlinePhoneInput/InlinePhoneInput.stories.tsx +2 -1
  64. package/src/components/InputButton/InputButton.stories.tsx +3 -2
  65. package/src/components/LogoSidebar/LogoSidebar.stories.tsx +3 -2
  66. package/src/components/Modal/Modal.stories.tsx +2 -2
  67. package/src/components/PasswordInput/PasswordInput.test.tsx +1 -1
  68. package/src/components/PhoneInput/PhoneInput.stories.tsx +2 -1
  69. package/src/components/RadioGroup/RadioGroup.stories.tsx +2 -1
  70. package/src/components/RadioItem/RadioItem.stories.tsx +5 -4
  71. package/src/components/Select/Select.stories.tsx +3 -2
  72. package/src/components/SelectSearch/SelectSearch.stories.tsx +2 -1
  73. package/src/components/SelectSearch/SelectSearch.test.tsx +11 -11
  74. package/src/components/SnackContainer/DialogHandler.stories.tsx +5 -5
  75. package/src/components/SsnInput/SsnInput.stories.tsx +3 -2
  76. package/src/components/Stepper/Stepper.stories.tsx +3 -2
  77. package/src/components/TabModal/TabModal.stories.tsx +5 -4
  78. package/src/components/Table/stories/Empty.stories.tsx +2 -2
  79. package/src/components/Table/stories/Filters.stories.tsx +2 -1
  80. package/src/components/Table/stories/Sorting.stories.tsx +2 -1
  81. package/src/components/Textarea/Textarea.stories.tsx +5 -4
  82. package/src/components/ToggleButtons/ToggleButtons.stories.tsx +2 -1
  83. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +2 -1
  84. package/src/components/ToggleItem/ToggleItem.stories.tsx +3 -2
  85. package/src/components/Tooltip/Tooltip.stories.tsx +4 -4
  86. package/src/components/TooltipLabel/TooltipLabel.stories.tsx +2 -1
  87. package/src/components/TooltipOptions/TooltipOptions.stories.tsx +6 -6
  88. package/src/components/Truncate/Truncate.stories.tsx +4 -4
  89. package/src/components/Typography/Typography.stories.tsx +3 -2
  90. package/src/components/UploadDropzone/UploadDropzone.stories.tsx +2 -1
  91. package/src/components/UserCard/UserCard.stories.tsx +3 -3
  92. package/src/components/UserCard/UserCard.test.tsx +4 -3
  93. package/src/components/ZipCodeInput/ZipCodeInput.stories.tsx +3 -2
  94. package/src/configuredComponents/AddMenu/AddMenu.stories.tsx +1 -1
  95. package/src/configuredComponents/ColorDotDropdown/ColorDotDropdown.stories.tsx +2 -1
  96. package/src/configuredComponents/ColorPicker/ColorPicker.stories.tsx +1 -1
  97. package/src/configuredComponents/CountryDropdown/CountryDropdown.stories.tsx +2 -1
  98. package/src/configuredComponents/CountyDropdown/CountyDropdown.stories.tsx +2 -1
  99. package/src/configuredComponents/DescriptiveDropdownInput/DescriptiveDropdownInput.stories.tsx +3 -2
  100. package/src/configuredComponents/DropdownButton/DropdownButton.stories.tsx +2 -1
  101. package/src/configuredComponents/DropdownInput/DropdownInput.stories.tsx +2 -1
  102. package/src/configuredComponents/IconSwitcher/IconSwitcher.stories.tsx +3 -2
  103. package/src/configuredComponents/InlineDescriptiveDropdown/InlineDescriptiveDropdown.stories.tsx +3 -2
  104. package/src/configuredComponents/InlineDropdown/InlineDropdown.stories.tsx +5 -4
  105. package/src/configuredComponents/MoreMenuButton/MoreMenuButton.stories.tsx +2 -1
  106. package/src/configuredComponents/MultiSelect/MultiSelect.stories.tsx +2 -1
  107. package/src/configuredComponents/NationalityDropdown/NationalityDropdown.stories.tsx +2 -1
  108. package/src/configuredComponents/StateDropdown/StateDropdown.stories.tsx +2 -1
  109. package/src/configuredComponents/StatusDropdown/StatusDropdown.stories.tsx +2 -1
  110. package/src/configuredComponents/TableFiltersPanel/TableFiltersPanel.stories.tsx +3 -3
  111. package/src/layout/LayoutSidebar/LayoutSidebar.stories.tsx +3 -2
  112. package/src/layout/NavLayout/NavLayout.stories.tsx +2 -1
  113. package/src/mantine/mantineTheme.ts +4 -2
  114. package/src/pages/NotFound/NotFound.stories.tsx +2 -1
  115. package/tsconfig.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
6
 
6
7
  /**
7
8
  * `DatePicker` is an input for entering dates. You can type in it, or click to use a picker.
@@ -13,7 +14,7 @@ export default meta;
13
14
 
14
15
  type Story = StoryObj<typeof FormikContainer>;
15
16
 
16
- const Template = (args) => (
17
+ const Template = (args: FormStorybookType) => (
17
18
  <FormWrapper $maxWidth={args.maxWidth}>
18
19
  <FormikContainer {...args} />
19
20
  </FormWrapper>
@@ -31,8 +32,8 @@ export const DatePicker: Story = {
31
32
  // today
32
33
  initialValue: Math.floor(new Date().valueOf() / 1000),
33
34
  options: {
34
- onChange: (returnedDate) => {
35
- const dateable = new Date(returnedDate * 1000);
35
+ onChange: (returnedDate: number | null) => {
36
+ const dateable = new Date((returnedDate ?? 0) * 1000);
36
37
  console.log("onChange", dateable);
37
38
  },
38
39
  dateFormat: "MM / dd / yyyy",
@@ -63,9 +64,9 @@ export const DatePickerOptions: Story = {
63
64
  maxDateUnix: 1843495645,
64
65
  minDateUnix: 1654092448,
65
66
  onEnter: () => console.log("onEnter - date picker"),
66
- onInputBlur: (event) => console.log("onInputBlur - date picker", event),
67
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - date picker", event),
67
68
  onInputFocus: () => console.log("onInputFocus - date picker"),
68
- onChange: (event) => console.log("onChange - date picker", event),
69
+ onChange: (event: number | null) => console.log("onChange - date picker", event),
69
70
  placeholder: "Type something",
70
71
  showIcon: true,
71
72
  yearOptionBegin: 2022,
@@ -4,7 +4,7 @@ import { descriptiveOptions } from "../../../DescriptiveSwitchMenu/mocks/options
4
4
  import { User } from "../../../Icons";
5
5
  import { FormWrapper } from "../../FormStyles";
6
6
  import { FormikContainer } from "../../FormikContainer";
7
- import { FormFieldTypeEnum } from "../../types";
7
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
8
8
 
9
9
  /**
10
10
  * `DescriptiveDropdownInput` is a select component that looks like a traditional input. It features a dropdown menu that has room for descriptive text along with the selection.
@@ -16,7 +16,7 @@ export default meta;
16
16
 
17
17
  type Story = StoryObj<typeof FormikContainer>;
18
18
 
19
- const Template = (args) => (
19
+ const Template = (args: FormStorybookType) => (
20
20
  <FormWrapper $maxWidth={args.maxWidth}>
21
21
  <FormikContainer {...args} />
22
22
  </FormWrapper>
@@ -1,7 +1,7 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
4
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
5
 
6
6
  /** `Email` is a text input configured for emails. */
7
7
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/Email" };
@@ -9,7 +9,7 @@ export default meta;
9
9
 
10
10
  type Story = StoryObj<typeof FormikContainer>;
11
11
 
12
- const Template = (args) => (
12
+ const Template = (args: FormStorybookType) => (
13
13
  <FormWrapper $maxWidth={args.maxWidth}>
14
14
  <FormikContainer {...args} />
15
15
  </FormWrapper>
@@ -1,7 +1,7 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
4
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
5
 
6
6
  /** `Hidden` is a hidden text input. */
7
7
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/Hidden" };
@@ -9,7 +9,7 @@ export default meta;
9
9
 
10
10
  type Story = StoryObj<typeof FormikContainer>;
11
11
 
12
- const Template = (args) => (
12
+ const Template = (args: FormStorybookType) => (
13
13
  <FormWrapper $maxWidth={args.maxWidth}>
14
14
  <FormikContainer {...args} />
15
15
  </FormWrapper>
@@ -1,10 +1,11 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { ChangeEvent } from "react";
2
3
  import { ButtonColorFamilyEnum } from "../../../../sharedTypes/enums";
3
4
  import { ButtonVariantEnum } from "../../../Button";
4
5
  import { AltIdFront, User } from "../../../Icons";
5
6
  import { FormWrapper } from "../../FormStyles";
6
7
  import { FormikContainer } from "../../FormikContainer";
7
- import { FormFieldTypeEnum } from "../../types";
8
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
8
9
 
9
10
  /**
10
11
  * `ImagePicker` is an image uploader component. It will display the selected image after the user chooses one.
@@ -14,7 +15,7 @@ export default meta;
14
15
 
15
16
  type Story = StoryObj<typeof FormikContainer>;
16
17
 
17
- const Template = (args) => (
18
+ const Template = (args: FormStorybookType) => (
18
19
  <FormWrapper $maxWidth={args.maxWidth}>
19
20
  <FormikContainer {...args} />
20
21
  </FormWrapper>
@@ -59,7 +60,7 @@ export const ImagePickerOptions: Story = {
59
60
  editButtonColorFamily: ButtonColorFamilyEnum.Red,
60
61
  helperText: "You can configure the options, like 'helperText', in field[n].options",
61
62
  maxFileSize: 20000,
62
- onChange: (event) => console.log("onChange - text", event),
63
+ onChange: (event: ChangeEvent<HTMLInputElement>) => console.log("onChange - text", event),
63
64
  placeholderInitials: "Type something",
64
65
  deleteButton: true,
65
66
  },
@@ -83,7 +84,7 @@ export const MoreImagePickerOptions: Story = {
83
84
  height: 280,
84
85
  pickerWidth: 320,
85
86
  helperText: "A big one",
86
- onChange: (event) => console.log("onChange - text", event),
87
+ onChange: (event: ChangeEvent<HTMLInputElement>) => console.log("onChange - text", event),
87
88
  actionText: "We can do things here",
88
89
  PlaceholderIcon: User,
89
90
  actionButtonVariant: ButtonVariantEnum.Secondary,
@@ -113,7 +114,7 @@ export const TwoButtons: Story = {
113
114
  disableClearOnImageClick: true,
114
115
  height: 263,
115
116
  helperText: "There's room for the helper text now!",
116
- onChange: (event) => console.log("onChange - text", event),
117
+ onChange: (event: ChangeEvent<HTMLInputElement>) => console.log("onChange - text", event),
117
118
  onPickerClick: () => console.log("Custom onClick"),
118
119
  pickerWidth: 320,
119
120
  PlaceholderIcon: () => <AltIdFront fill={"#E5EAF2"} />,
@@ -3,7 +3,7 @@ import { Calendar } from "../../../Icons";
3
3
  import { FormWrapper } from "../../FormStyles";
4
4
  import { FormikContainer } from "../../FormikContainer";
5
5
  import { options } from "../../mocks/options";
6
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType, SelectOptionType } from "../../types";
7
7
 
8
8
  /**
9
9
  * `MultiSelect` is a select component that looks like a traditional input. It can have multiple selections at once, that appear as tags in the input.
@@ -15,7 +15,7 @@ export default meta;
15
15
 
16
16
  type Story = StoryObj<typeof FormikContainer>;
17
17
 
18
- const Template = (args) => (
18
+ const Template = (args: FormStorybookType) => (
19
19
  <FormWrapper $maxWidth={args.maxWidth}>
20
20
  <FormikContainer {...args} />
21
21
  </FormWrapper>
@@ -59,7 +59,7 @@ export const MultiSelectOptions: Story = {
59
59
  selectOptions: options,
60
60
  clearAll: true,
61
61
  LeadingIcon: Calendar,
62
- onSelect: (event) => console.log("onSelect", event),
62
+ onSelect: (event: SelectOptionType | undefined) => console.log("onSelect", event),
63
63
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
64
64
  horizontal: true,
65
65
  placeholder: "Select an option",
@@ -1,7 +1,7 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
4
+ import { FormFieldTypeEnum, FormStorybookType, SelectOptionType } from "../../types";
5
5
 
6
6
  /**
7
7
  * `NationalitySelect` is a select component preconfigured to support all countries.
@@ -18,7 +18,7 @@ export default meta;
18
18
 
19
19
  type Story = StoryObj<typeof FormikContainer>;
20
20
 
21
- const Template = (args) => (
21
+ const Template = (args: FormStorybookType) => (
22
22
  <FormWrapper $maxWidth={args.maxWidth}>
23
23
  <FormikContainer {...args} />
24
24
  </FormWrapper>
@@ -56,7 +56,7 @@ export const NationalitySelectOptions: Story = {
56
56
  width: 400,
57
57
  initialValue: "us",
58
58
  options: {
59
- onSelect: (event) => console.log("onSelect", event),
59
+ onSelect: (event: SelectOptionType | undefined) => console.log("onSelect", event),
60
60
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
61
61
  innerSearch: true,
62
62
  label: "NationalitySelect with options",
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { Calendar } from "../../../Icons";
3
4
  import { FormWrapper } from "../../FormStyles";
4
5
  import { FormikContainer } from "../../FormikContainer";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /**
8
9
  * `Number` is an input configured for numbers. Please note that it uses `inputMode="numeric"` and `pattern="[0-9]*"` to do this, so it will return a string.
@@ -12,7 +13,7 @@ export default meta;
12
13
 
13
14
  type Story = StoryObj<typeof FormikContainer>;
14
15
 
15
- const Template = (args) => (
16
+ const Template = (args: FormStorybookType) => (
16
17
  <FormWrapper $maxWidth={args.maxWidth}>
17
18
  <FormikContainer {...args} />
18
19
  </FormWrapper>
@@ -49,9 +50,9 @@ export const NumberOptions: Story = {
49
50
  helperText: "You can configure the options, like 'helperText', in field[n].options",
50
51
  LeadingIcon: Calendar,
51
52
  onEnter: () => console.log("onEnter - phone"),
52
- onInputBlur: (event) => console.log("onInputBlur - phone", event),
53
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - phone", event),
53
54
  onInputFocus: () => console.log("onInputFocus - phone"),
54
- onChange: (event) => console.log("onChange - phone", event),
55
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - phone", event),
55
56
  placeholder: "How many pets do you have?",
56
57
  },
57
58
  },
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
6
 
6
7
  /**
7
8
  * `Password` is an input configured for passwords. It toggles back and forth between `"password"` and `"text"` inputs, based on user interaction.
@@ -13,7 +14,7 @@ export default meta;
13
14
 
14
15
  type Story = StoryObj<typeof FormikContainer>;
15
16
 
16
- const Template = (args) => (
17
+ const Template = (args: FormStorybookType) => (
17
18
  <FormWrapper $maxWidth={args.maxWidth}>
18
19
  <FormikContainer {...args} />
19
20
  </FormWrapper>
@@ -52,9 +53,9 @@ export const PasswordOptions: Story = {
52
53
  clearButton: true,
53
54
  helperText: "You can configure the options, like 'helperText', in field[n].options",
54
55
  onEnter: () => console.log("onEnter - phone"),
55
- onInputBlur: (event) => console.log("onInputBlur - phone", event),
56
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - phone", event),
56
57
  onInputFocus: () => console.log("onInputFocus - phone"),
57
- onChange: (event) => console.log("onChange - phone", event),
58
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - phone", event),
58
59
  placeholder: "Can I haz your password?",
59
60
  showIcon: true,
60
61
  },
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { CountryMaskEnum } from "../../../../sharedTypes/enums";
3
4
  import { FormWrapper } from "../../FormStyles";
4
5
  import { FormikContainer } from "../../FormikContainer";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /**
8
9
  * `Phone` will validate for, and format the display of phone numbers. It is configured to accept a US based phone number by default, but you can adjust this by passing a different function to `options.mask`.
@@ -12,7 +13,7 @@ export default meta;
12
13
 
13
14
  type Story = StoryObj<typeof FormikContainer>;
14
15
 
15
- const Template = (args) => (
16
+ const Template = (args: FormStorybookType) => (
16
17
  <FormWrapper $maxWidth={args.maxWidth}>
17
18
  <FormikContainer {...args} />
18
19
  </FormWrapper>
@@ -51,9 +52,9 @@ export const PhoneOptions: Story = {
51
52
  clearButton: true,
52
53
  helperText: "You can configure the options, like 'helperText', in field[n].options",
53
54
  onEnter: () => console.log("onEnter - phone"),
54
- onInputBlur: (event) => console.log("onInputBlur - phone", event),
55
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - phone", event),
55
56
  onInputFocus: () => console.log("onInputFocus - phone"),
56
- onChange: (event) => console.log("onChange - phone", event),
57
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - phone", event),
57
58
  placeholder: "Can I haz your digits?",
58
59
  region: CountryMaskEnum.United_States,
59
60
  showIcon: true,
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { ChangeEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
5
  import { switches } from "../../mocks/switches";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /**
8
9
  * `RadioGroup` is a group of radio toggles with labels.
@@ -14,7 +15,7 @@ export default meta;
14
15
 
15
16
  type Story = StoryObj<typeof FormikContainer>;
16
17
 
17
- const Template = (args) => (
18
+ const Template = (args: FormStorybookType) => (
18
19
  <FormWrapper $maxWidth={args.maxWidth}>
19
20
  <FormikContainer {...args} />
20
21
  </FormWrapper>
@@ -53,7 +54,7 @@ export const RadioGroupOptions: Story = {
53
54
  width: 400,
54
55
  options: {
55
56
  radios: switches,
56
- onRadioClick: (event) => console.log("onRadioClick", event),
57
+ onRadioClick: (event: ChangeEvent<HTMLInputElement>) => console.log("onRadioClick", event),
57
58
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
58
59
  horizontal: true,
59
60
  label: "RadioGroup with options",
@@ -5,7 +5,7 @@ import { descriptiveOptions } from "../../../DescriptiveSwitchMenu/mocks/options
5
5
  import { FormWrapper } from "../../FormStyles";
6
6
  import { FormikContainer } from "../../FormikContainer";
7
7
  import { options } from "../../mocks/options";
8
- import { FormFieldTypeEnum, RemovableFieldTypeEnum } from "../../types";
8
+ import { FormFieldTypeEnum, FormStorybookType, RemovableFieldTypeEnum } from "../../types";
9
9
 
10
10
  /** `Removable` initially displays an add button, then a single input if that button is clicked. This input can be removed once it's added. The button is removed once the input is present - it can only add one input.
11
11
  */
@@ -14,7 +14,7 @@ export default meta;
14
14
 
15
15
  type Story = StoryObj<typeof FormikContainer>;
16
16
 
17
- const Template = (args) => (
17
+ const Template = (args: FormStorybookType) => (
18
18
  <FormWrapper $maxWidth={args.maxWidth}>
19
19
  <FormikContainer {...args} />
20
20
  </FormWrapper>
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
4
  import { multiTwo, settingsForm } from "../../mocks/fields";
5
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
6
 
7
7
  /**
8
8
  * `SectionHeader` can be used to visually break your form up into different sections. It includes multiple text options and a divider.
@@ -12,7 +12,7 @@ export default meta;
12
12
 
13
13
  type Story = StoryObj<typeof FormikContainer>;
14
14
 
15
- const Template = (args) => (
15
+ const Template = (args: FormStorybookType) => (
16
16
  <FormWrapper $maxWidth={args.maxWidth}>
17
17
  <FormikContainer {...args} />
18
18
  </FormWrapper>
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
4
  import { options } from "../../mocks/options";
5
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType, SelectOptionType } from "../../types";
6
6
 
7
7
  /**
8
8
  * `Select` is a select component that looks like a traditional input.
@@ -14,7 +14,7 @@ export default meta;
14
14
 
15
15
  type Story = StoryObj<typeof FormikContainer>;
16
16
 
17
- const Template = (args) => (
17
+ const Template = (args: FormStorybookType) => (
18
18
  <FormWrapper $maxWidth={args.maxWidth}>
19
19
  <FormikContainer {...args} />
20
20
  </FormWrapper>
@@ -57,7 +57,7 @@ export const SelectOptions: Story = {
57
57
  width: 400,
58
58
  options: {
59
59
  selectOptions: options,
60
- onSelect: (event) => console.log("onSelect", event),
60
+ onSelect: (event: SelectOptionType | undefined) => console.log("onSelect", event),
61
61
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
62
62
  horizontal: true,
63
63
  placeholder: "Select an option",
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
6
 
6
7
  /** `SocialSecurity` is formatted specifically for United States Social Security Numbers. */
7
8
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/SocialSecurity" };
@@ -9,7 +10,7 @@ export default meta;
9
10
 
10
11
  type Story = StoryObj<typeof FormikContainer>;
11
12
 
12
- const Template = (args) => (
13
+ const Template = (args: FormStorybookType) => (
13
14
  <FormWrapper $maxWidth={args.maxWidth}>
14
15
  <FormikContainer {...args} />
15
16
  </FormWrapper>
@@ -48,9 +49,9 @@ export const SocialSecurityOptions: Story = {
48
49
  clearButton: true,
49
50
  helperText: "You can configure the options, like 'helperText', in field[n].options",
50
51
  onEnter: () => console.log("onEnter - text"),
51
- onInputBlur: (event) => console.log("onInputBlur - text", event),
52
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - text", event),
52
53
  onInputFocus: () => console.log("onInputFocus - text"),
53
- onChange: (event) => console.log("onChange - text", event),
54
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - text", event),
54
55
  placeholder: "SSN...",
55
56
  showIcon: true,
56
57
  },
@@ -16,7 +16,7 @@ export default meta;
16
16
  type Story = StoryObj<FormStorybookType>;
17
17
 
18
18
  // This has a slider to set the width of the container, since Storybook allows the contents to set the width.
19
- const Template = (args) => {
19
+ const Template = (args: FormStorybookType) => {
20
20
  const [width, setWidth] = React.useState(args.width || 800);
21
21
 
22
22
  return (
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react";
2
2
  import { FormWrapper } from "../../FormStyles";
3
3
  import { FormikContainer } from "../../FormikContainer";
4
4
  import { options } from "../../mocks/options";
5
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType, SelectOptionType } from "../../types";
6
6
 
7
7
  /** `StateSelect` is a select component preconfigured to support US States. */
8
8
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/StateSelect" };
@@ -10,7 +10,7 @@ export default meta;
10
10
 
11
11
  type Story = StoryObj<typeof FormikContainer>;
12
12
 
13
- const Template = (args) => (
13
+ const Template = (args: FormStorybookType) => (
14
14
  <FormWrapper $maxWidth={args.maxWidth}>
15
15
  <FormikContainer {...args} />
16
16
  </FormWrapper>
@@ -48,7 +48,7 @@ export const StateSelectOptions: Story = {
48
48
  options: {
49
49
  abbreviatedStateNames: true,
50
50
  selectOptions: options,
51
- onSelect: (event) => console.log("onSelect", event),
51
+ onSelect: (event: SelectOptionType | undefined) => console.log("onSelect", event),
52
52
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
53
53
  innerSearch: true,
54
54
  placeholder: "Select an option",
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { Attachment } from "../../../Icons";
3
4
  import { FormWrapper } from "../../FormStyles";
4
5
  import { FormikContainer } from "../../FormikContainer";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /**
8
9
  * `Text` is the standard text input. It's the default input type, and is the most configurable.
@@ -14,7 +15,7 @@ export default meta;
14
15
 
15
16
  type Story = StoryObj<typeof FormikContainer>;
16
17
 
17
- const Template = (args) => (
18
+ const Template = (args: FormStorybookType) => (
18
19
  <FormWrapper $maxWidth={args.maxWidth}>
19
20
  <FormikContainer {...args} />
20
21
  </FormWrapper>
@@ -50,9 +51,9 @@ export const TextOptions: Story = {
50
51
  helperText: "You can configure the options, like 'helperText', in field[n].options",
51
52
  LeadingIcon: Attachment,
52
53
  onEnter: () => console.log("onEnter - text"),
53
- onInputBlur: (event) => console.log("onInputBlur - text", event),
54
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - text", event),
54
55
  onInputFocus: () => console.log("onInputFocus - text"),
55
- onChange: (event) => console.log("onChange - text", event),
56
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - text", event),
56
57
  onTrailingIconClick: () => console.log("onTrailingIconClick - text"),
57
58
  placeholder: "Type something",
58
59
  type: "text",
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { ResizeEnum } from "../../../Textarea";
3
4
  import { FormWrapper } from "../../FormStyles";
4
5
  import { FormikContainer } from "../../FormikContainer";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /** `Textarea` is a textarea field. It includes most of the same options as a text field. */
8
9
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/Textarea" };
@@ -10,7 +11,7 @@ export default meta;
10
11
 
11
12
  type Story = StoryObj<typeof FormikContainer>;
12
13
 
13
- const Template = (args) => (
14
+ const Template = (args: FormStorybookType) => (
14
15
  <FormWrapper $maxWidth={args.maxWidth}>
15
16
  <FormikContainer {...args} />
16
17
  </FormWrapper>
@@ -47,9 +48,9 @@ export const TextareaOptions: Story = {
47
48
  characterLimit: 200,
48
49
  helperText: "You can configure the options, like 'helperText', in field[n].options",
49
50
  inputHeight: 200,
50
- onInputBlur: (event) => console.log("onInputBlur - phone", event),
51
+ onInputBlur: (event: FocusEvent<HTMLTextAreaElement>) => console.log("onInputBlur - phone", event),
51
52
  onInputFocus: () => console.log("onInputFocus - phone"),
52
- onChange: (event) => console.log("onChange - phone", event),
53
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - phone", event),
53
54
  placeholder: "Write something great, but only 200 characters...",
54
55
  resize: ResizeEnum.Horizontal,
55
56
  },
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { ChangeEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
6
 
6
7
  /** `Toggle` is a single toggle switch and label. For multiple toggles, use `ToggleGroup`. */
7
8
  const meta: Meta<typeof FormikContainer> = { component: FormikContainer, title: "organisms/Form/Fields/Toggle" };
@@ -9,7 +10,7 @@ export default meta;
9
10
 
10
11
  type Story = StoryObj<typeof FormikContainer>;
11
12
 
12
- const Template = (args) => (
13
+ const Template = (args: FormStorybookType) => (
13
14
  <FormWrapper $maxWidth={args.maxWidth}>
14
15
  <FormikContainer {...args} />
15
16
  </FormWrapper>
@@ -42,7 +43,7 @@ export const ToggleOptions: Story = {
42
43
  type: FormFieldTypeEnum.Toggle,
43
44
  options: {
44
45
  center: true,
45
- onToggleClick: (event) => console.log("onToggleClick", event),
46
+ onToggleClick: (event: ChangeEvent<HTMLInputElement>) => console.log("onToggleClick", event),
46
47
  text: "this is the 'text'",
47
48
  },
48
49
  },
@@ -1,8 +1,9 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { ChangeEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
5
  import { switches } from "../../mocks/switches";
5
- import { FormFieldTypeEnum } from "../../types";
6
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
6
7
 
7
8
  /**
8
9
  * `ToggleGroup` is a group of toggles with labels. For a single toggle, use `Toggle`.
@@ -14,7 +15,7 @@ export default meta;
14
15
 
15
16
  type Story = StoryObj<typeof FormikContainer>;
16
17
 
17
- const Template = (args) => (
18
+ const Template = (args: FormStorybookType) => (
18
19
  <FormWrapper $maxWidth={args.maxWidth}>
19
20
  <FormikContainer {...args} />
20
21
  </FormWrapper>
@@ -51,7 +52,7 @@ export const ToggleGroupOptions: Story = {
51
52
  required: true,
52
53
  options: {
53
54
  toggles: switches,
54
- onToggleClick: (event) => console.log("onToggleClick", event),
55
+ onToggleClick: (event: ChangeEvent<HTMLInputElement>) => console.log("onToggleClick", event),
55
56
  helperText: "This is the 'helperText', It's okay if this is a bit longer",
56
57
  label: "ToggleGroup with options",
57
58
  name: "foobar",
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { FocusEvent } from "react";
2
3
  import { FormWrapper } from "../../FormStyles";
3
4
  import { FormikContainer } from "../../FormikContainer";
4
- import { FormFieldTypeEnum } from "../../types";
5
+ import { FormFieldTypeEnum, FormStorybookType } from "../../types";
5
6
 
6
7
  /**
7
8
  * `ZipCode` is formatted specifically for United States postal codes. These can be either five or nine digits.
@@ -11,7 +12,7 @@ export default meta;
11
12
 
12
13
  type Story = StoryObj<typeof FormikContainer>;
13
14
 
14
- const Template = (args) => (
15
+ const Template = (args: FormStorybookType) => (
15
16
  <FormWrapper $maxWidth={args.maxWidth}>
16
17
  <FormikContainer {...args} />
17
18
  </FormWrapper>
@@ -50,9 +51,9 @@ export const ZipCodeOptions: Story = {
50
51
  clearButton: true,
51
52
  helperText: "You can configure the options, like 'helperText', in field[n].options",
52
53
  onEnter: () => console.log("onEnter - text"),
53
- onInputBlur: (event) => console.log("onInputBlur - text", event),
54
+ onInputBlur: (event: FocusEvent<HTMLInputElement>) => console.log("onInputBlur - text", event),
54
55
  onInputFocus: () => console.log("onInputFocus - text"),
55
- onChange: (event) => console.log("onChange - text", event),
56
+ onChange: (event: { target: { value: string; name?: string } }) => console.log("onChange - text", event),
56
57
  placeholder: "xxxxx-xxxx",
57
58
  },
58
59
  },
@@ -1,4 +1,5 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { ComponentProps } from "react";
2
3
  import { RelativeContainer } from "../../../SharedStorybook/Layout";
3
4
  import { colors } from "../../../const/colors";
4
5
  import { ButtonColorFamilyEnum } from "../../../sharedTypes/enums";
@@ -19,7 +20,7 @@ export default meta;
19
20
 
20
21
  type Story = StoryObj<typeof FormikContainer>;
21
22
 
22
- const Template = (args) => (
23
+ const Template = (args: ComponentProps<typeof FormikContainer>) => (
23
24
  <RelativeContainer $bgColor={colors.COOL_GREY_4} $paddingString={"20px 0"}>
24
25
  <FormWrapper>
25
26
  <FormikContainer {...args} />