form-input-fields 1.0.17 → 1.0.18

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.
package/README.md CHANGED
@@ -2,10 +2,14 @@
2
2
 
3
3
  A collection of Material-UI form field components with Formik integration.
4
4
 
5
- **Version 1.0.16**
5
+ **Version 1.0.18**
6
6
 
7
7
  More control in the progress of development.
8
8
 
9
+ ## Storybook
10
+
11
+ View interactive examples and documentation at: [https://formik-input-fields.netlify.app/](https://formik-input-fields.netlify.app/)
12
+
9
13
  ## Installation
10
14
 
11
15
  ### Prerequisites
@@ -553,18 +557,18 @@ The FormDateField component accepts all props from `FormDateFieldProps`, `FieldP
553
557
 
554
558
  #### FormDateFieldProps Interface
555
559
 
556
- | Prop | Type | Default | Description |
557
- | ----------------- | ---------- | ------------------------ | --------------------------------------------- |
558
- | `format` | `string` | `FORM_DATE_FORMAT.short` | Date format string using dayjs format tokens |
559
- | `minDate` | `Dayjs` | - | Minimum selectable date |
560
- | `maxDate` | `Dayjs` | - | Maximum selectable date |
561
- | `disablePast` | `boolean` | `false` | Disable past dates |
562
- | `disableFuture` | `boolean` | `false` | Disable future dates |
563
- | `showTodayButton` | `boolean` | `false` | Show today button in the picker |
564
- | `readOnly` | `boolean` | `false` | Make the field read-only |
565
- | `showDateFormat` | `boolean` | `false` | Show the date format as helper text |
566
- | `onChange` | `function` | - | Custom change handler with additional context |
567
- | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
560
+ | Prop | Type | Default | Description |
561
+ | ----------------- | ---------------- | ------------------------ | -------------------------------------------------------------------------------------- |
562
+ | `format` | `string` | `FORM_DATE_FORMAT.short` | Date format string using dayjs format tokens |
563
+ | `minDate` | `Dayjs` | - | Minimum selectable date |
564
+ | `maxDate` | `Dayjs` | - | Maximum selectable date |
565
+ | `disablePast` | `boolean` | `false` | Disable past dates |
566
+ | `disableFuture` | `boolean` | `false` | Disable future dates |
567
+ | `showTodayButton` | `boolean` | `false` | Show today button in the picker |
568
+ | `readOnly` | `boolean` | `false` | Make the field read-only |
569
+ | `showDateFormat` | `boolean` | `false` | Show the date format as helper text |
570
+ | `onChange` | `function` | - | Custom change handler with additional context |
571
+ | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
568
572
 
569
573
  #### Common Props (from FieldProps & TextFieldProps)
570
574
 
@@ -890,7 +894,7 @@ The FormSwitch component accepts all props from `FormSwitchProps`, `FieldProps`
890
894
  | `helperText` | `string` | - | Helper text to display below the switch |
891
895
  | `error` | `boolean` | `false` | Error state of the switch |
892
896
  | `className` | `string` | - | Custom class name for the root element |
893
- | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
897
+ | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
894
898
 
895
899
  #### Common Props (from FieldProps & SwitchProps)
896
900
 
@@ -1084,16 +1088,16 @@ The FormDateTextField component accepts all props from `FormDateTextFieldProps`,
1084
1088
 
1085
1089
  #### FormDateTextFieldProps Interface
1086
1090
 
1087
- | Prop | Type | Default | Description |
1088
- | ------------ | ----------------------------------------------------- | ----------------------- | -------------------------------------- |
1089
- | `format` | `string` | `FORM_DATE_FORMAT.long` | Date format string using day.js tokens |
1090
- | `required` | `boolean` | `false` | Whether the field is required |
1091
- | `disabled` | `boolean` | `false` | Whether the field is disabled |
1092
- | `className` | `string` | - | Custom class name for the root element |
1093
- | `helperText` | `string` | - | Helper text to display below the field |
1094
- | `error` | `boolean` | - | Error state of the field |
1095
- | `onChange` | `(value: Dayjs \| null) => void` | - | Custom change handler |
1096
- | `onBlur` | `(event: React.FocusEvent<HTMLInputElement>) => void` | - | Custom blur handler |
1091
+ | Prop | Type | Default | Description |
1092
+ | ------------ | ----------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------- |
1093
+ | `format` | `string` | `FORM_DATE_FORMAT.long` | Date format string using day.js tokens |
1094
+ | `required` | `boolean` | `false` | Whether the field is required |
1095
+ | `disabled` | `boolean` | `false` | Whether the field is disabled |
1096
+ | `className` | `string` | - | Custom class name for the root element |
1097
+ | `helperText` | `string` | - | Helper text to display below the field |
1098
+ | `error` | `boolean` | - | Error state of the field |
1099
+ | `onChange` | `(value: Dayjs \| null) => void` | - | Custom change handler |
1100
+ | `onBlur` | `(event: React.FocusEvent<HTMLInputElement>) => void` | - | Custom blur handler |
1097
1101
  | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
1098
1102
 
1099
1103
  #### Common Props (from FieldProps & TextFieldProps)
@@ -1257,32 +1261,32 @@ import { FormMaskField } from 'form-input-fields';
1257
1261
 
1258
1262
  ### Props
1259
1263
 
1260
- | Prop | Type | Default | Description |
1261
- | ------------------ | ----------- | ---------- | -------------------------------------------------------------- |
1262
- | `mask` | `string` | - | Mask pattern using the characters above |
1263
- | `placeholderChar` | `string` | `'_'` | Character shown in placeholder for mask positions |
1264
- | `toUpperCase` | `boolean` | `false` | Convert input to uppercase automatically |
1265
- | `returnCleanValue` | `boolean` | `false` | Return unmasked value to Formik (true) or masked value (false) |
1266
- | `showMaskPattern` | `boolean` | `false` | Show the mask pattern as helper text below the input field |
1267
- | `showPlaceholder` | `boolean` | `false` | Show placeholder text with mask pattern in the input field |
1268
- | `onChange` | `function` | - | Custom change handler with masked, clean, and raw values |
1269
- | `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
1270
- | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
1264
+ | Prop | Type | Default | Description |
1265
+ | ------------------ | ---------------- | ---------- | -------------------------------------------------------------------------------------- | ---------- | --------------------------------- |
1266
+ | `mask` | `string` | - | Mask pattern using the characters above |
1267
+ | `placeholderChar` | `string` | `'_'` | Character shown in placeholder for mask positions |
1268
+ | `toUpperCase` | `boolean` | `false` | Convert input to uppercase automatically |
1269
+ | `returnCleanValue` | `boolean` | `false` | Return unmasked value to Formik (true) or masked value (false) |
1270
+ | `showMaskPattern` | `boolean` | `false` | Show the mask pattern as helper text below the input field |
1271
+ | `showPlaceholder` | `boolean` | `false` | Show placeholder text with mask pattern in the input field |
1272
+ | `onChange` | `function` | - | Custom change handler with masked, clean, and raw values |
1273
+ | `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
1274
+ | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
1271
1275
 
1272
1276
  Plus all standard Material-UI TextField props and Formik FieldProps.
1273
1277
 
1274
1278
  #### FormMaskFieldProps Interface
1275
1279
 
1276
- | Prop | Type | Default | Description |
1277
- | ------------------ | ---------------- | ---------- | -------------------------------------------------------------- |
1278
- | `mask` | `string` | - | Mask pattern using the characters above |
1279
- | `placeholderChar` | `string` | `'_'` | Character shown in placeholder for mask positions |
1280
- | `toUpperCase` | `boolean` | `false` | Convert input to uppercase automatically |
1281
- | `returnCleanValue` | `boolean` | `false` | Return unmasked value to Formik (true) or masked value (false) |
1282
- | `showMaskPattern` | `boolean` | `false` | Show the mask pattern as helper text below the input field |
1283
- | `showPlaceholder` | `boolean` | `false` | Show placeholder text with mask pattern in the input field |
1284
- | `onChange` | `function` | - | Custom change handler with masked, clean, and raw values |
1285
- | `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
1280
+ | Prop | Type | Default | Description |
1281
+ | ------------------ | ---------------- | ---------- | -------------------------------------------------------------------------------------- | ---------- | --------------------------------- |
1282
+ | `mask` | `string` | - | Mask pattern using the characters above |
1283
+ | `placeholderChar` | `string` | `'_'` | Character shown in placeholder for mask positions |
1284
+ | `toUpperCase` | `boolean` | `false` | Convert input to uppercase automatically |
1285
+ | `returnCleanValue` | `boolean` | `false` | Return unmasked value to Formik (true) or masked value (false) |
1286
+ | `showMaskPattern` | `boolean` | `false` | Show the mask pattern as helper text below the input field |
1287
+ | `showPlaceholder` | `boolean` | `false` | Show placeholder text with mask pattern in the input field |
1288
+ | `onChange` | `function` | - | Custom change handler with masked, clean, and raw values |
1289
+ | `variant` | `'standard' | 'outlined' | 'filled'` | 'standard' | The variant of the MUI TextField. |
1286
1290
  | `sx` | `SxProps<Theme>` | - | The system prop that allows defining system overrides as well as additional CSS styles |
1287
1291
 
1288
1292
  ### Examples
@@ -0,0 +1,22 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import('react').MemoExoticComponent<({ id, label, checked, onChange, sx, }: import('..').FormCheckboxFieldProps) => import("react/jsx-runtime").JSX.Element>;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ argTypes: {
10
+ checked: {
11
+ control: "boolean";
12
+ };
13
+ label: {
14
+ control: "text";
15
+ };
16
+ };
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Basic: Story;
21
+ export declare const WithFormik: Story;
22
+ //# sourceMappingURL=FormCheckboxField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormCheckboxField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormCheckboxField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAWgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KA2BnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA8DxB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Basic: Story;
6
+ export declare const WithValidation: Story;
7
+ export declare const AppointmentScheduler: Story;
8
+ export declare const ReadOnly: Story;
9
+ export declare const CustomChangeHandler: Story;
10
+ //# sourceMappingURL=FormDateField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormDateField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormDateField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAK5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CA0BnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAanB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAwB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA0BlC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAuCjC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Basic: Story;
6
+ export declare const WithFormik: Story;
7
+ export declare const CustomFormat: Story;
8
+ //# sourceMappingURL=FormDateTextField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormDateTextField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormDateTextField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CAyBnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAsBnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAmDxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAsB1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Basic: Story;
6
+ export declare const WithDefaultSelection: Story;
7
+ export declare const RequiredWithValidation: Story;
8
+ //# sourceMappingURL=FormDropDownField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormDropDownField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormDropDownField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CA2BnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KA8BnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA4BlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAiEpC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const PhoneNumber: Story;
6
+ export declare const DateInput: Story;
7
+ export declare const ProductCode: Story;
8
+ export declare const CreditCard: Story;
9
+ export declare const CustomChangeHandler: Story;
10
+ export declare const ShowMaskPattern: Story;
11
+ //# sourceMappingURL=FormMaskField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormMaskField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormMaskField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CA2BnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA0BzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAwBxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAkCjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Basic: Story;
6
+ export declare const WithFormik: Story;
7
+ //# sourceMappingURL=FormSwitch.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormSwitch.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormSwitch.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CAiCnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAoBnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAqDxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta<any>;
3
+ export default meta;
4
+ type Story = StoryObj<typeof meta>;
5
+ export declare const Basic: Story;
6
+ export declare const WithFormikValidation: Story;
7
+ export declare const CustomValidation: Story;
8
+ //# sourceMappingURL=FormTextField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormTextField.stories.d.ts","sourceRoot":"","sources":["../../src/stories/FormTextField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CAyBnB,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAwBnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA+DlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KA+B9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-input-fields",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "A customizable form field components built with TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -17,7 +17,9 @@
17
17
  "test": "jest --detectOpenHandles --forceExit --logHeapUsage",
18
18
  "test:watch": "jest --watch --detectOpenHandles --forceExit",
19
19
  "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand --verbose",
20
- "test:coverage": "jest --coverage --detectOpenHandles --forceExit"
20
+ "test:coverage": "jest --coverage --detectOpenHandles --forceExit",
21
+ "storybook": "storybook dev -p 6006",
22
+ "build-storybook": "storybook build"
21
23
  },
22
24
  "keywords": [
23
25
  "react",
@@ -48,9 +50,12 @@
48
50
  "@babel/preset-typescript": "^7.28.5",
49
51
  "@emotion/react": "^11.14.0",
50
52
  "@emotion/styled": "^11.14.1",
51
- "@mui/styles": "^6.4.8",
52
53
  "@mui/material": "^7.3.5",
54
+ "@mui/styles": "^6.4.8",
53
55
  "@mui/x-date-pickers": "^8.17.0",
56
+ "@storybook/addon-docs": "10.0.6",
57
+ "@storybook/addon-onboarding": "10.0.6",
58
+ "@storybook/react-vite": "10.0.6",
54
59
  "@testing-library/dom": "^10.4.1",
55
60
  "@testing-library/jest-dom": "^6.9.1",
56
61
  "@testing-library/react": "^16.3.0",
@@ -60,12 +65,14 @@
60
65
  "@types/react": "^19.2.2",
61
66
  "@types/react-dom": "^19.2.2",
62
67
  "dayjs": "^1.11.19",
68
+ "eslint-plugin-storybook": "10.0.6",
63
69
  "formik": "^2.4.9",
64
70
  "jest": "^30.2.0",
65
71
  "jest-environment-jsdom": "^30.2.0",
66
72
  "jsdom": "^27.1.0",
67
73
  "react": "^19.2.0",
68
74
  "react-dom": "^19.2.0",
75
+ "storybook": "10.0.6",
69
76
  "ts-jest": "^29.4.5",
70
77
  "typescript": "^5.9.3",
71
78
  "vite": "^7.2.2",
@@ -74,8 +81,8 @@
74
81
  "peerDependencies": {
75
82
  "@emotion/react": "^11.14.0",
76
83
  "@emotion/styled": "^11.14.1",
77
- "@mui/styles": "^6.4.8",
78
84
  "@mui/material": "^7.2.0",
85
+ "@mui/styles": "^6.4.8",
79
86
  "@mui/x-date-pickers": "^8.7.0",
80
87
  "dayjs": "^1.11.13",
81
88
  "formik": "^2.4.6",