@luanmario/components 1.0.0 → 1.0.2

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.
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type Option = {
4
+ label: string;
5
+ value: string;
6
+ };
7
+ type Props = {
8
+ options: Option[];
9
+ onChange: (value: string) => void;
10
+ };
11
+ declare function SelectSearch({ options, onChange }: Props): react_jsx_runtime.JSX.Element;
12
+
13
+ export { SelectSearch };
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type Option = {
4
+ label: string;
5
+ value: string;
6
+ };
7
+ type Props = {
8
+ options: Option[];
9
+ onChange: (value: string) => void;
10
+ };
11
+ declare function SelectSearch({ options, onChange }: Props): react_jsx_runtime.JSX.Element;
12
+
13
+ export { SelectSearch };
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // src/components/SelectSearch/SelectSearch.tsx
6
+ function SelectSearch({ options, onChange }) {
7
+ return /* @__PURE__ */ jsxRuntime.jsx("select", { onChange: (e) => onChange(e.target.value), children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value)) });
8
+ }
9
+
10
+ exports.SelectSearch = SelectSearch;
package/dist/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ // src/components/SelectSearch/SelectSearch.tsx
4
+ function SelectSearch({ options, onChange }) {
5
+ return /* @__PURE__ */ jsx("select", { onChange: (e) => onChange(e.target.value), children: options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)) });
6
+ }
7
+
8
+ export { SelectSearch };
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@luanmario/components",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
- "main": "index.js",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "files": [
8
+ "dist"
9
+ ],
6
10
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "build": "tsup",
12
+ "prepublishOnly": "npm run build"
8
13
  },
9
14
  "keywords": [],
10
15
  "author": "Luan Mario",
@@ -1,21 +0,0 @@
1
- type Option = {
2
- label: string;
3
- value: string;
4
- };
5
-
6
- type Props = {
7
- options: Option[];
8
- onChange: (value: string) => void;
9
- };
10
-
11
- export function SelectSearch({ options, onChange }: Props) {
12
- return (
13
- <select onChange={(e) => onChange(e.target.value)}>
14
- {options.map(opt => (
15
- <option key={opt.value} value={opt.value}>
16
- {opt.label}
17
- </option>
18
- ))}
19
- </select>
20
- );
21
- }
@@ -1 +0,0 @@
1
- export { SelectSearch } from './SelectSearch';
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/SelectSearch';
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2019",
4
- "module": "ESNext",
5
- "jsx": "react-jsx",
6
- "declaration": true,
7
- "strict": true,
8
- "moduleResolution": "bundler",
9
- "allowSyntheticDefaultImports": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true
12
- },
13
- "include": [
14
- "src"
15
- ],
16
- "exclude": [
17
- "dist",
18
- "node_modules"
19
- ]
20
- }
package/tsup.config.ts DELETED
@@ -1,9 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['esm', 'cjs'],
6
- dts: true,
7
- clean: true,
8
- treeshake: true
9
- });