UNPKG

components-switch

Version:

A lightweight React utility component library featuring Switch and Match for conditional rendering, inspired by SolidJS. Simplifies readable and declarative conditional logic in JSX.

72 lines (71 loc) 2.33 kB
{ "name": "components-switch", "version": "1.0.0", "type": "module", "source": "src/index.ts", "files": [ "dist" ], "license": "MIT", "author": "Łukasz Rafa <lkr.rafa@gmail.com> (https://github.com/Luka-stack)", "description": "A lightweight React utility component library featuring Switch and Match for conditional rendering, inspired by SolidJS. Simplifies readable and declarative conditional logic in JSX.", "repository": { "type": "git", "url": "https://github.com/Luka-stack/components-switch" }, "keywords": [ "react", "if", "if-statement", "if-else", "if-else-statement", "switch", "modals", "react-component" ], "scripts": { "dev": "vite", "clean": "rimraf dist", "build": "npm run clean && npm run build:core && npm run pack-and-extract", "build:core": "microbundle --jsx React.createElement --jsxFragment React.Fragment", "pack-and-extract": "yarn pack -f components-switch.tgz && npm run rm-pkg && npm run extract-pkg", "rm-pkg": "rimraf node_modules/components-switch && mkdir node_modules/components-switch", "extract-pkg": "tar -xzf components-switch.tgz -C node_modules/components-switch --strip-components 1 && rimraf components-switch.tgz", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" }, "devDependencies": { "@eslint/js": "^9.22.0", "@types/react": "^19.0.10", "@types/react-dom": "^19.0.4", "@vitejs/plugin-react": "^4.3.4", "eslint": "^9.22.0", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.19", "globals": "^16.0.0", "microbundle": "^0.15.1", "mkdirp": "^3.0.1", "rimraf": "^6.0.1", "typescript": "~5.7.2", "typescript-eslint": "^8.26.1", "vite": "^6.3.1", "vite-plugin-dts": "^4.5.3" }, "main": "dist/components-switch.js", "module": "dist/components-switch.esm.mjs", "umd:main": "dist/components-switch.umd.js", "unpkg": "dist/components-switch.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/components-switch.js", "import": "./dist/components-switch.esm.mjs", "umd": "./dist/components-switch.umd.js" }, "./package.json": "./package.json" } }