@plurix/ecom-components 0.0.1 → 0.0.2-beta.0
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 +48 -48
- package/dist/assets/index.css +3 -1
- package/dist/assets/index2.css +3 -1
- package/dist/assets/index3.css +3 -1
- package/dist/components/Button/index.d.ts +3 -1
- package/dist/components/Button/index.js +9 -10
- package/dist/components/Input/index.d.ts +3 -1
- package/dist/components/Input/index.js +9 -10
- package/dist/components/Label/index.d.ts +3 -1
- package/dist/components/Label/index.js +9 -10
- package/dist/main.d.ts +3 -3
- package/dist/main.js +4 -8
- package/dist/vite-env.d.js +0 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
<img width="500" alt="ViteReactComponentLibrary" src="https://github.com/receter/my-component-library/assets/2504695/dbb53036-d228-477b-8cf8-f61cd6130776">
|
|
2
|
-
|
|
3
|
-
# A simple (demo) react component library
|
|
4
|
-
This repository was published together with an article on [how to create a react component library](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma) using Vite's library mode.
|
|
5
|
-
|
|
6
|
-
Here is another repo that consumes this libarary: https://github.com/receter/my-component-library-consumer
|
|
7
|
-
|
|
8
|
-
The demo library on npm: https://www.npmjs.com/package/@receter/my-component-library
|
|
9
|
-
|
|
10
|
-
## Installation
|
|
11
|
-
You can install it with npm (don't expect much fanciness):
|
|
12
|
-
```bash
|
|
13
|
-
npm i @receter/my-component-library
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
```javascript
|
|
18
|
-
import { Button, Label, Input } from '@receter/my-component-library';
|
|
19
|
-
```
|
|
20
|
-
See this file for an example on using this library: https://github.com/receter/my-component-library-consumer/blob/main/src/App.tsx
|
|
21
|
-
|
|
22
|
-
## React + TypeScript + Vite
|
|
23
|
-
|
|
24
|
-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
25
|
-
|
|
26
|
-
Currently, two official plugins are available:
|
|
27
|
-
|
|
28
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
29
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
30
|
-
|
|
31
|
-
### Expanding the ESLint configuration
|
|
32
|
-
|
|
33
|
-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
34
|
-
|
|
35
|
-
- Configure the top-level `parserOptions` property like this:
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
parserOptions: {
|
|
39
|
-
ecmaVersion: 'latest',
|
|
40
|
-
sourceType: 'module',
|
|
41
|
-
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
42
|
-
tsconfigRootDir: __dirname,
|
|
43
|
-
},
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
47
|
-
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
48
|
-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
1
|
+
<img width="500" alt="ViteReactComponentLibrary" src="https://github.com/receter/my-component-library/assets/2504695/dbb53036-d228-477b-8cf8-f61cd6130776">
|
|
2
|
+
|
|
3
|
+
# A simple (demo) react component library
|
|
4
|
+
This repository was published together with an article on [how to create a react component library](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma) using Vite's library mode.
|
|
5
|
+
|
|
6
|
+
Here is another repo that consumes this libarary: https://github.com/receter/my-component-library-consumer
|
|
7
|
+
|
|
8
|
+
The demo library on npm: https://www.npmjs.com/package/@receter/my-component-library
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
You can install it with npm (don't expect much fanciness):
|
|
12
|
+
```bash
|
|
13
|
+
npm i @receter/my-component-library
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
```javascript
|
|
18
|
+
import { Button, Label, Input } from '@receter/my-component-library';
|
|
19
|
+
```
|
|
20
|
+
See this file for an example on using this library: https://github.com/receter/my-component-library-consumer/blob/main/src/App.tsx
|
|
21
|
+
|
|
22
|
+
## React + TypeScript + Vite
|
|
23
|
+
|
|
24
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
25
|
+
|
|
26
|
+
Currently, two official plugins are available:
|
|
27
|
+
|
|
28
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
29
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
30
|
+
|
|
31
|
+
### Expanding the ESLint configuration
|
|
32
|
+
|
|
33
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
34
|
+
|
|
35
|
+
- Configure the top-level `parserOptions` property like this:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
parserOptions: {
|
|
39
|
+
ecmaVersion: 'latest',
|
|
40
|
+
sourceType: 'module',
|
|
41
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
42
|
+
tsconfigRootDir: __dirname,
|
|
43
|
+
},
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
47
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
48
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
package/dist/assets/index.css
CHANGED
package/dist/assets/index2.css
CHANGED
package/dist/assets/index3.css
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare function Button(
|
|
2
|
+
export declare function Button(
|
|
3
|
+
props: React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
4
|
+
): import('react/jsx-runtime').JSX.Element
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import '../../assets/index3.css'
|
|
2
|
-
import { jsx as s } from
|
|
3
|
-
const u =
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../../assets/index3.css'
|
|
2
|
+
import { jsx as s } from 'react/jsx-runtime'
|
|
3
|
+
const u = '_button_1m5ht_1',
|
|
4
|
+
r = {
|
|
5
|
+
button: u
|
|
6
|
+
}
|
|
6
7
|
function e(t) {
|
|
7
|
-
const { className: o, ...n } = t
|
|
8
|
-
return /* @__PURE__ */ s(
|
|
8
|
+
const { className: o, ...n } = t
|
|
9
|
+
return /* @__PURE__ */ s('button', { className: `${o} ${r.button}`, ...n })
|
|
9
10
|
}
|
|
10
|
-
export {
|
|
11
|
-
e as Button
|
|
12
|
-
};
|
|
11
|
+
export { e as Button }
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare function Input(
|
|
2
|
+
export declare function Input(
|
|
3
|
+
props: React.InputHTMLAttributes<HTMLInputElement>
|
|
4
|
+
): import('react/jsx-runtime').JSX.Element
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import '../../assets/index2.css'
|
|
2
|
-
import { jsx as p } from
|
|
3
|
-
const u =
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../../assets/index2.css'
|
|
2
|
+
import { jsx as p } from 'react/jsx-runtime'
|
|
3
|
+
const u = '_input_1auw0_1',
|
|
4
|
+
o = {
|
|
5
|
+
input: u
|
|
6
|
+
}
|
|
6
7
|
function r(t) {
|
|
7
|
-
const { className: n, ...s } = t
|
|
8
|
-
return /* @__PURE__ */ p(
|
|
8
|
+
const { className: n, ...s } = t
|
|
9
|
+
return /* @__PURE__ */ p('input', { className: `${n} ${o.input}`, ...s })
|
|
9
10
|
}
|
|
10
|
-
export {
|
|
11
|
-
r as Input
|
|
12
|
-
};
|
|
11
|
+
export { r as Input }
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare function Label(
|
|
2
|
+
export declare function Label(
|
|
3
|
+
props: React.LabelHTMLAttributes<HTMLLabelElement>
|
|
4
|
+
): import('react/jsx-runtime').JSX.Element
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import '../../assets/index.css'
|
|
2
|
-
import { jsx as a } from
|
|
3
|
-
const o =
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../../assets/index.css'
|
|
2
|
+
import { jsx as a } from 'react/jsx-runtime'
|
|
3
|
+
const o = '_label_mog69_1',
|
|
4
|
+
t = {
|
|
5
|
+
label: o
|
|
6
|
+
}
|
|
6
7
|
function b(l) {
|
|
7
|
-
const { className: e, ...s } = l
|
|
8
|
-
return /* @__PURE__ */ a(
|
|
8
|
+
const { className: e, ...s } = l
|
|
9
|
+
return /* @__PURE__ */ a('label', { className: `${e} ${t.label}`, ...s })
|
|
9
10
|
}
|
|
10
|
-
export {
|
|
11
|
-
b as Label
|
|
12
|
-
};
|
|
11
|
+
export { b as Label }
|
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Button } from './components/Button'
|
|
2
|
-
export { Input } from './components/Input'
|
|
3
|
-
export { Label } from './components/Label'
|
|
1
|
+
export { Button } from './components/Button'
|
|
2
|
+
export { Input } from './components/Input'
|
|
3
|
+
export { Label } from './components/Label'
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Button as t } from
|
|
2
|
-
import { Input as p } from
|
|
3
|
-
import { Label as m } from
|
|
4
|
-
export {
|
|
5
|
-
t as Button,
|
|
6
|
-
p as Input,
|
|
7
|
-
m as Label
|
|
8
|
-
};
|
|
1
|
+
import { Button as t } from './components/Button/index.js'
|
|
2
|
+
import { Input as p } from './components/Input/index.js'
|
|
3
|
+
import { Label as m } from './components/Label/index.js'
|
|
4
|
+
export { t as Button, p as Input, m as Label }
|
package/dist/vite-env.d.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@plurix/ecom-components",
|
|
3
3
|
"author": "Plurix",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.2-beta.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/main.js",
|
|
8
8
|
"types": "dist/main.d.ts",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite",
|
|
21
21
|
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
22
|
+
"format": "prettier --write .",
|
|
22
23
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
23
24
|
"preview": "vite preview"
|
|
24
25
|
},
|