react-validate-component 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 JongGeun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # TSDX React User Guide
2
+
3
+ Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
4
+
5
+ > This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`.
6
+
7
+ > If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/)
8
+
9
+ ## Commands
10
+
11
+ TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.
12
+
13
+ The recommended workflow is to run TSDX in one terminal:
14
+
15
+ ```bash
16
+ npm start # or yarn start
17
+ ```
18
+
19
+ This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
+
21
+ Then run the example inside another:
22
+
23
+ ```bash
24
+ cd example
25
+ npm i # or yarn to install dependencies
26
+ npm start # or yarn start
27
+ ```
28
+
29
+ The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, we use [Parcel's aliasing](https://parceljs.org/module_resolution.html#aliases).
30
+
31
+ To do a one-off build, use `npm run build` or `yarn build`.
32
+
33
+ To run tests, use `npm test` or `yarn test`.
34
+
35
+ ## Configuration
36
+
37
+ Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
38
+
39
+ ### Jest
40
+
41
+ Jest tests are set up to run with `npm test` or `yarn test`.
42
+
43
+ ### Bundle analysis
44
+
45
+ Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visulize it with `npm run analyze`.
46
+
47
+ #### Setup Files
48
+
49
+ This is the folder structure we set up for you:
50
+
51
+ ```txt
52
+ /example
53
+ index.html
54
+ index.tsx # test your component here in a demo app
55
+ package.json
56
+ tsconfig.json
57
+ /src
58
+ index.tsx # EDIT THIS
59
+ /test
60
+ blah.test.tsx # EDIT THIS
61
+ .gitignore
62
+ package.json
63
+ README.md # EDIT THIS
64
+ tsconfig.json
65
+ ```
66
+
67
+ #### React Testing Library
68
+
69
+ We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.
70
+
71
+ ### Rollup
72
+
73
+ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
74
+
75
+ ### TypeScript
76
+
77
+ `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
78
+
79
+ ## Continuous Integration
80
+
81
+ ### GitHub Actions
82
+
83
+ Two actions are added by default:
84
+
85
+ - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
86
+ - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)
87
+
88
+ ## Optimizations
89
+
90
+ Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
91
+
92
+ ```js
93
+ // ./types/index.d.ts
94
+ declare var __DEV__: boolean;
95
+
96
+ // inside your code...
97
+ if (__DEV__) {
98
+ console.log('foo');
99
+ }
100
+ ```
101
+
102
+ You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
103
+
104
+ ## Module Formats
105
+
106
+ CJS, ESModules, and UMD module formats are supported.
107
+
108
+ The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
109
+
110
+ ## Deploying the Example Playground
111
+
112
+ The Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`):
113
+
114
+ ```bash
115
+ cd example # if not already in the example folder
116
+ npm run build # builds to dist
117
+ netlify deploy # deploy the dist folder
118
+ ```
119
+
120
+ Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:
121
+
122
+ ```bash
123
+ netlify init
124
+ # build command: yarn build && cd example && yarn && yarn build
125
+ # directory to deploy: example/dist
126
+ # pick yes for netlify.toml
127
+ ```
128
+
129
+ ## Named Exports
130
+
131
+ Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
132
+
133
+ ## Including Styles
134
+
135
+ There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
136
+
137
+ For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
138
+
139
+ ## Publishing to NPM
140
+
141
+ We recommend using [np](https://github.com/sindresorhus/np).
142
+
143
+ ## Usage with Lerna
144
+
145
+ When creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_.
146
+
147
+ The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.
148
+
149
+ Change the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.
150
+
151
+ ```diff
152
+ "alias": {
153
+ - "react": "../node_modules/react",
154
+ - "react-dom": "../node_modules/react-dom"
155
+ + "react": "../../../node_modules/react",
156
+ + "react-dom": "../../../node_modules/react-dom"
157
+ },
158
+ ```
159
+
160
+ An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { VINPUT_PARAMS } from './types/vinput';
3
+ export declare const VText: ({ maxLength, value, className, props, }: VINPUT_PARAMS) => React.JSX.Element;
4
+ export declare const VCheckbox: () => React.JSX.Element;
5
+ export declare const VRadio: () => React.JSX.Element;
6
+ export declare const VDate: () => React.JSX.Element;
7
+ export declare const VColor: () => React.JSX.Element;
8
+ export declare const VEmail: () => React.JSX.Element;
9
+ export declare const VRange: () => React.JSX.Element;
10
+ export declare const VUrl: () => React.JSX.Element;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./react-validate-component.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./react-validate-component.cjs.development.js')
8
+ }
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ // Text
8
+ var VText = function VText(_ref) {
9
+ var maxLength = _ref.maxLength,
10
+ value = _ref.value,
11
+ className = _ref.className,
12
+ props = _ref.props;
13
+ return React.createElement("input", Object.assign({
14
+ type: "text"
15
+ }, props, {
16
+ className: className,
17
+ maxLength: maxLength,
18
+ value: value
19
+ }));
20
+ };
21
+ // Checkbox
22
+ var VCheckbox = function VCheckbox() {
23
+ return React.createElement("input", {
24
+ type: "checkbox"
25
+ });
26
+ };
27
+ // Radio
28
+ var VRadio = function VRadio() {
29
+ return React.createElement("input", {
30
+ type: "radio"
31
+ });
32
+ };
33
+ // Date
34
+ var VDate = function VDate() {
35
+ return React.createElement("input", {
36
+ type: "date"
37
+ });
38
+ };
39
+ // Color
40
+ var VColor = function VColor() {
41
+ return React.createElement("input", {
42
+ type: "color"
43
+ });
44
+ };
45
+ // Email
46
+ var VEmail = function VEmail() {
47
+ return React.createElement("input", {
48
+ type: "email"
49
+ });
50
+ };
51
+ // Range
52
+ var VRange = function VRange() {
53
+ return React.createElement("input", {
54
+ type: "range"
55
+ });
56
+ };
57
+ // Url
58
+ var VUrl = function VUrl() {
59
+ return React.createElement("input", {
60
+ type: "url"
61
+ });
62
+ };
63
+
64
+ exports.VCheckbox = VCheckbox;
65
+ exports.VColor = VColor;
66
+ exports.VDate = VDate;
67
+ exports.VEmail = VEmail;
68
+ exports.VRadio = VRadio;
69
+ exports.VRange = VRange;
70
+ exports.VText = VText;
71
+ exports.VUrl = VUrl;
72
+ //# sourceMappingURL=react-validate-component.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-validate-component.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { VINPUT_PARAMS } from './types/vinput';\n\n// Text\nexport const VText = ({\n maxLength,\n value,\n className,\n props,\n}: VINPUT_PARAMS) => {\n return (\n <input\n type=\"text\"\n {...props}\n className={className}\n maxLength={maxLength}\n value={value}\n />\n );\n};\n\n// Checkbox\nexport const VCheckbox = () => {\n return <input type=\"checkbox\" />;\n};\n\n// Radio\nexport const VRadio = () => {\n return <input type=\"radio\" />;\n};\n\n// Date\nexport const VDate = () => {\n return <input type=\"date\" />;\n};\n\n// Color\nexport const VColor = () => {\n return <input type=\"color\" />;\n};\n\n// Email\nexport const VEmail = () => {\n return <input type=\"email\" />;\n};\n\n// Range\nexport const VRange = () => {\n return <input type=\"range\" />;\n};\n\n// Url\nexport const VUrl = () => {\n return <input type=\"url\" />;\n};\n"],"names":["VText","_ref","maxLength","value","className","props","React","type","VCheckbox","VRadio","VDate","VColor","VEmail","VRange","VUrl"],"mappings":";;;;;;AAGA;IACaA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA;MAChBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,KAAK,GAAAJ,IAAA,CAALI,KAAK;EAEL,OACEC;IACEC,IAAI,EAAC;KACDF,KAAK;IACTD,SAAS,EAAEA,SAAS;IACpBF,SAAS,EAAEA,SAAS;IACpBC,KAAK,EAAEA;KACP;AAEN;AAEA;IACaK,SAAS,GAAG,SAAZA,SAASA;EACpB,OAAOF;IAAOC,IAAI,EAAC;IAAa;AAClC;AAEA;IACaE,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOH;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaG,KAAK,GAAG,SAARA,KAAKA;EAChB,OAAOJ;IAAOC,IAAI,EAAC;IAAS;AAC9B;AAEA;IACaI,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOL;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaK,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAON;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaM,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOP;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaO,IAAI,GAAG,SAAPA,IAAIA;EACf,OAAOR;IAAOC,IAAI,EAAC;IAAQ;AAC7B;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.VCheckbox=function(){return e.createElement("input",{type:"checkbox"})},exports.VColor=function(){return e.createElement("input",{type:"color"})},exports.VDate=function(){return e.createElement("input",{type:"date"})},exports.VEmail=function(){return e.createElement("input",{type:"email"})},exports.VRadio=function(){return e.createElement("input",{type:"radio"})},exports.VRange=function(){return e.createElement("input",{type:"range"})},exports.VText=function(t){return e.createElement("input",Object.assign({type:"text"},t.props,{className:t.className,maxLength:t.maxLength,value:t.value}))},exports.VUrl=function(){return e.createElement("input",{type:"url"})};
2
+ //# sourceMappingURL=react-validate-component.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-validate-component.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { VINPUT_PARAMS } from './types/vinput';\n\n// Text\nexport const VText = ({\n maxLength,\n value,\n className,\n props,\n}: VINPUT_PARAMS) => {\n return (\n <input\n type=\"text\"\n {...props}\n className={className}\n maxLength={maxLength}\n value={value}\n />\n );\n};\n\n// Checkbox\nexport const VCheckbox = () => {\n return <input type=\"checkbox\" />;\n};\n\n// Radio\nexport const VRadio = () => {\n return <input type=\"radio\" />;\n};\n\n// Date\nexport const VDate = () => {\n return <input type=\"date\" />;\n};\n\n// Color\nexport const VColor = () => {\n return <input type=\"color\" />;\n};\n\n// Email\nexport const VEmail = () => {\n return <input type=\"email\" />;\n};\n\n// Range\nexport const VRange = () => {\n return <input type=\"range\" />;\n};\n\n// Url\nexport const VUrl = () => {\n return <input type=\"url\" />;\n};\n"],"names":["React","type","_ref","props","className","maxLength","value"],"mappings":"6GAsByB,WACvB,OAAOA,yBAAOC,KAAK,6BAcC,WACpB,OAAOD,yBAAOC,KAAK,yBANA,WACnB,OAAOD,yBAAOC,KAAK,yBASC,WACpB,OAAOD,yBAAOC,KAAK,0BAhBC,WACpB,OAAOD,yBAAOC,KAAK,0BAmBC,WACpB,OAAOD,yBAAOC,KAAK,yBA5CA,SAAHC,GAMhB,OACEF,uCACEC,KAAK,QAJJC,EAALC,OAMIC,UAPKF,EAATE,UAQIC,UAVKH,EAATG,UAWIC,MAVCJ,EAALI,uBA8CkB,WAClB,OAAON,yBAAOC,KAAK"}
@@ -0,0 +1,61 @@
1
+ import { createElement } from 'react';
2
+
3
+ // Text
4
+ var VText = function VText(_ref) {
5
+ var maxLength = _ref.maxLength,
6
+ value = _ref.value,
7
+ className = _ref.className,
8
+ props = _ref.props;
9
+ return createElement("input", Object.assign({
10
+ type: "text"
11
+ }, props, {
12
+ className: className,
13
+ maxLength: maxLength,
14
+ value: value
15
+ }));
16
+ };
17
+ // Checkbox
18
+ var VCheckbox = function VCheckbox() {
19
+ return createElement("input", {
20
+ type: "checkbox"
21
+ });
22
+ };
23
+ // Radio
24
+ var VRadio = function VRadio() {
25
+ return createElement("input", {
26
+ type: "radio"
27
+ });
28
+ };
29
+ // Date
30
+ var VDate = function VDate() {
31
+ return createElement("input", {
32
+ type: "date"
33
+ });
34
+ };
35
+ // Color
36
+ var VColor = function VColor() {
37
+ return createElement("input", {
38
+ type: "color"
39
+ });
40
+ };
41
+ // Email
42
+ var VEmail = function VEmail() {
43
+ return createElement("input", {
44
+ type: "email"
45
+ });
46
+ };
47
+ // Range
48
+ var VRange = function VRange() {
49
+ return createElement("input", {
50
+ type: "range"
51
+ });
52
+ };
53
+ // Url
54
+ var VUrl = function VUrl() {
55
+ return createElement("input", {
56
+ type: "url"
57
+ });
58
+ };
59
+
60
+ export { VCheckbox, VColor, VDate, VEmail, VRadio, VRange, VText, VUrl };
61
+ //# sourceMappingURL=react-validate-component.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-validate-component.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { VINPUT_PARAMS } from './types/vinput';\n\n// Text\nexport const VText = ({\n maxLength,\n value,\n className,\n props,\n}: VINPUT_PARAMS) => {\n return (\n <input\n type=\"text\"\n {...props}\n className={className}\n maxLength={maxLength}\n value={value}\n />\n );\n};\n\n// Checkbox\nexport const VCheckbox = () => {\n return <input type=\"checkbox\" />;\n};\n\n// Radio\nexport const VRadio = () => {\n return <input type=\"radio\" />;\n};\n\n// Date\nexport const VDate = () => {\n return <input type=\"date\" />;\n};\n\n// Color\nexport const VColor = () => {\n return <input type=\"color\" />;\n};\n\n// Email\nexport const VEmail = () => {\n return <input type=\"email\" />;\n};\n\n// Range\nexport const VRange = () => {\n return <input type=\"range\" />;\n};\n\n// Url\nexport const VUrl = () => {\n return <input type=\"url\" />;\n};\n"],"names":["VText","_ref","maxLength","value","className","props","React","type","VCheckbox","VRadio","VDate","VColor","VEmail","VRange","VUrl"],"mappings":";;AAGA;IACaA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA;MAChBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,KAAK,GAAAJ,IAAA,CAALI,KAAK;EAEL,OACEC;IACEC,IAAI,EAAC;KACDF,KAAK;IACTD,SAAS,EAAEA,SAAS;IACpBF,SAAS,EAAEA,SAAS;IACpBC,KAAK,EAAEA;KACP;AAEN;AAEA;IACaK,SAAS,GAAG,SAAZA,SAASA;EACpB,OAAOF;IAAOC,IAAI,EAAC;IAAa;AAClC;AAEA;IACaE,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOH;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaG,KAAK,GAAG,SAARA,KAAKA;EAChB,OAAOJ;IAAOC,IAAI,EAAC;IAAS;AAC9B;AAEA;IACaI,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOL;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaK,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAON;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaM,MAAM,GAAG,SAATA,MAAMA;EACjB,OAAOP;IAAOC,IAAI,EAAC;IAAU;AAC/B;AAEA;IACaO,IAAI,GAAG,SAAPA,IAAIA;EACf,OAAOR;IAAOC,IAAI,EAAC;IAAQ;AAC7B;;;;"}
@@ -0,0 +1,6 @@
1
+ export interface VINPUT_PARAMS {
2
+ maxLength: number;
3
+ value: string;
4
+ className: string;
5
+ props: object;
6
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "license": "MIT",
4
+ "main": "dist/index.js",
5
+ "typings": "dist/index.d.ts",
6
+ "files": [
7
+ "dist",
8
+ "src"
9
+ ],
10
+ "engines": {
11
+ "node": ">=10"
12
+ },
13
+ "scripts": {
14
+ "start": "tsdx watch",
15
+ "build": "tsdx build",
16
+ "test": "tsdx test --passWithNoTests",
17
+ "lint": "tsdx lint",
18
+ "prepare": "tsdx build",
19
+ "size": "size-limit",
20
+ "analyze": "size-limit --why"
21
+ },
22
+ "peerDependencies": {
23
+ "react": ">=16"
24
+ },
25
+ "husky": {
26
+ "hooks": {
27
+ "pre-commit": "tsdx lint"
28
+ }
29
+ },
30
+ "prettier": {
31
+ "printWidth": 80,
32
+ "semi": true,
33
+ "singleQuote": true,
34
+ "trailingComma": "es5"
35
+ },
36
+ "name": "react-validate-component",
37
+ "author": "JongGeun",
38
+ "module": "dist/react-validate-component.esm.js",
39
+ "size-limit": [
40
+ {
41
+ "path": "dist/react-validate-component.cjs.production.min.js",
42
+ "limit": "10 KB"
43
+ },
44
+ {
45
+ "path": "dist/react-validate-component.esm.js",
46
+ "limit": "10 KB"
47
+ }
48
+ ],
49
+ "devDependencies": {
50
+ "@size-limit/preset-small-lib": "^11.1.4",
51
+ "@types/react": "^18.3.3",
52
+ "@types/react-dom": "^18.3.0",
53
+ "husky": "^9.1.4",
54
+ "react": "^18.3.1",
55
+ "react-dom": "^18.3.1",
56
+ "size-limit": "^11.1.4",
57
+ "tsdx": "^0.14.1",
58
+ "tslib": "^2.6.3",
59
+ "typescript": "^3.9.10"
60
+ }
61
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import { VINPUT_PARAMS } from './types/vinput';
3
+
4
+ // Text
5
+ export const VText = ({
6
+ maxLength,
7
+ value,
8
+ className,
9
+ props,
10
+ }: VINPUT_PARAMS) => {
11
+ return (
12
+ <input
13
+ type="text"
14
+ {...props}
15
+ className={className}
16
+ maxLength={maxLength}
17
+ value={value}
18
+ />
19
+ );
20
+ };
21
+
22
+ // Checkbox
23
+ export const VCheckbox = () => {
24
+ return <input type="checkbox" />;
25
+ };
26
+
27
+ // Radio
28
+ export const VRadio = () => {
29
+ return <input type="radio" />;
30
+ };
31
+
32
+ // Date
33
+ export const VDate = () => {
34
+ return <input type="date" />;
35
+ };
36
+
37
+ // Color
38
+ export const VColor = () => {
39
+ return <input type="color" />;
40
+ };
41
+
42
+ // Email
43
+ export const VEmail = () => {
44
+ return <input type="email" />;
45
+ };
46
+
47
+ // Range
48
+ export const VRange = () => {
49
+ return <input type="range" />;
50
+ };
51
+
52
+ // Url
53
+ export const VUrl = () => {
54
+ return <input type="url" />;
55
+ };
@@ -0,0 +1,7 @@
1
+ // VInput 파라미터
2
+ export interface VINPUT_PARAMS {
3
+ maxLength: number;
4
+ value: string;
5
+ className: string;
6
+ props: object;
7
+ }