Comparing version 1.0.9 to 1.0.12
@@ -7,6 +7,20 @@ "use strict"; | ||
const react_1 = __importDefault(require("react")); | ||
const SanpperyItem = ({ children }) => { | ||
return react_1.default.createElement("div", { className: "snappery-item" }, children); | ||
const clsx_1 = __importDefault(require("clsx")); | ||
const getPositionClass = (position) => { | ||
switch (position) { | ||
case "center": | ||
return "snap-center"; | ||
case "end": | ||
return "snap-end"; | ||
case "start": | ||
default: | ||
return "snap-start"; | ||
} | ||
}; | ||
const SanpperyItem = ({ children, position = "start" }) => { | ||
const positionClass = getPositionClass(position); | ||
const classNames = (0, clsx_1.default)("snappery-item", positionClass); | ||
return react_1.default.createElement("div", { className: classNames }, children); | ||
}; | ||
exports.default = SanpperyItem; | ||
//# sourceMappingURL=SnapperyItem.js.map |
import React from "react"; | ||
const SanpperyItem = ({ children }) => { | ||
return React.createElement("div", { className: "snappery-item" }, children); | ||
import clsx from "clsx"; | ||
const getPositionClass = (position) => { | ||
switch (position) { | ||
case "center": | ||
return "snap-center"; | ||
case "end": | ||
return "snap-end"; | ||
case "start": | ||
default: | ||
return "snap-start"; | ||
} | ||
}; | ||
const SanpperyItem = ({ children, position = "start" }) => { | ||
const positionClass = getPositionClass(position); | ||
const classNames = clsx("snappery-item", positionClass); | ||
return React.createElement("div", { className: classNames }, children); | ||
}; | ||
export default SanpperyItem; | ||
//# sourceMappingURL=SnapperyItem.js.map |
import React, { ReactNode } from "react"; | ||
type SnapPosition = "start" | "center" | "end"; | ||
interface SanpperyItemProps { | ||
children: ReactNode; | ||
position?: SnapPosition; | ||
} | ||
declare const SanpperyItem: ({ children }: SanpperyItemProps) => React.JSX.Element; | ||
declare const SanpperyItem: ({ children, position }: SanpperyItemProps) => React.JSX.Element; | ||
export default SanpperyItem; |
{ | ||
"name": "snappery", | ||
"version": "1.0.9", | ||
"version": "1.0.12", | ||
"description": "A Scroll Slider Carousel for React that uses CSS scroll snap points with ESM & TypeScript support", | ||
@@ -36,10 +36,9 @@ "keywords": [ | ||
"scripts": { | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc --project tsconfig.cjs.json && pnpx postcss-cli src/styles.css -o dist/cjs/styles.css", | ||
"build:esm": "tsc --project tsconfig.esm.json && pnpx postcss-cli src/styles.css -o dist/esm/styles.css", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"clean": "rm -rf dist && rm -rf node_modules", | ||
"version:patch": "npm version patch", | ||
"version:minor": "npm version minor", | ||
"version:major": "npm version major", | ||
"publish": "npm publish" | ||
"patch": "pnpm clean && pnpm install && pnpm build && npm version patch && git push && git push --tags && npm publish", | ||
"minor": "pnpm clean && pnpm install && pnpm build && npm version minor && git push && git push --tags && npm publish", | ||
"major": "pnpm clean && pnpm install && pnpm build && npm version major && git push && git push --tags && npm publish" | ||
}, | ||
@@ -62,3 +61,6 @@ "packageManager": "pnpm@9.3.0+sha256.e1f9e8d1a16607a46dd3c158b5f7a7dc7945501d1c6222d454d63d033d1d918f", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"dependencies": { | ||
"clsx": "^2.1.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45151
1282
3
+ Addedclsx@^2.1.1
+ Addedclsx@2.1.1(transitive)