Comparing version 1.0.12 to 1.0.14
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,8 +29,10 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const react_1 = __importDefault(require("react")); | ||
const react_1 = __importStar(require("react")); | ||
const clsx_1 = __importDefault(require("clsx")); | ||
require("./styles.css"); | ||
const Snappery = ({ children }) => { | ||
return react_1.default.createElement("div", { className: "snappery" }, children); | ||
}; | ||
const Snappery = (0, react_1.forwardRef)(({ children, className }, ref) => { | ||
const classNames = (0, clsx_1.default)("snappery sn-overflow-x-scroll sn-snap-mandatory sn-snap-x sn-overscroll-x-contain sn-scroll-smooth", className && className); | ||
return (react_1.default.createElement("div", { ref: ref, className: classNames }, children)); | ||
}); | ||
exports.default = Snappery; | ||
//# sourceMappingURL=Snappery.js.map |
@@ -7,6 +7,8 @@ "use strict"; | ||
const react_1 = __importDefault(require("react")); | ||
const SanpperyContent = ({ children }) => { | ||
return react_1.default.createElement("div", { className: "snappery-content" }, children); | ||
const clsx_1 = __importDefault(require("clsx")); | ||
const SanpperyContent = ({ children, className }) => { | ||
const classNames = (0, clsx_1.default)("snappery-content", className && className); | ||
return react_1.default.createElement("div", { className: classNames }, children); | ||
}; | ||
exports.default = SanpperyContent; | ||
//# sourceMappingURL=SnapperyContent.js.map |
@@ -11,8 +11,8 @@ "use strict"; | ||
case "center": | ||
return "snap-center"; | ||
return "sn-snap-center"; | ||
case "end": | ||
return "snap-end"; | ||
return "sn-snap-end"; | ||
case "start": | ||
default: | ||
return "snap-start"; | ||
return "sn-snap-start"; | ||
} | ||
@@ -19,0 +19,0 @@ }; |
@@ -1,7 +0,9 @@ | ||
import React from "react"; | ||
import React, { forwardRef } from "react"; | ||
import clsx from "clsx"; | ||
import "./styles.css"; | ||
const Snappery = ({ children }) => { | ||
return React.createElement("div", { className: "snappery" }, children); | ||
}; | ||
const Snappery = forwardRef(({ children, className }, ref) => { | ||
const classNames = clsx("snappery sn-overflow-x-scroll sn-snap-mandatory sn-snap-x sn-overscroll-x-contain sn-scroll-smooth", className && className); | ||
return (React.createElement("div", { ref: ref, className: classNames }, children)); | ||
}); | ||
export default Snappery; | ||
//# sourceMappingURL=Snappery.js.map |
import React from "react"; | ||
const SanpperyContent = ({ children }) => { | ||
return React.createElement("div", { className: "snappery-content" }, children); | ||
import clsx from "clsx"; | ||
const SanpperyContent = ({ children, className }) => { | ||
const classNames = clsx("snappery-content", className && className); | ||
return React.createElement("div", { className: classNames }, children); | ||
}; | ||
export default SanpperyContent; | ||
//# sourceMappingURL=SnapperyContent.js.map |
@@ -6,8 +6,8 @@ import React from "react"; | ||
case "center": | ||
return "snap-center"; | ||
return "sn-snap-center"; | ||
case "end": | ||
return "snap-end"; | ||
return "sn-snap-end"; | ||
case "start": | ||
default: | ||
return "snap-start"; | ||
return "sn-snap-start"; | ||
} | ||
@@ -14,0 +14,0 @@ }; |
@@ -5,4 +5,5 @@ import React, { ReactNode } from "react"; | ||
children: ReactNode; | ||
className?: string; | ||
} | ||
declare const Snappery: ({ children }: SanpperyProps) => React.JSX.Element; | ||
declare const Snappery: React.ForwardRefExoticComponent<SanpperyProps & React.RefAttributes<HTMLDivElement>>; | ||
export default Snappery; |
import React, { ReactNode } from "react"; | ||
interface SanpperyContentProps { | ||
children: ReactNode; | ||
className?: string; | ||
} | ||
declare const SanpperyContent: ({ children }: SanpperyContentProps) => React.JSX.Element; | ||
declare const SanpperyContent: ({ children, className }: SanpperyContentProps) => React.JSX.Element; | ||
export default SanpperyContent; |
{ | ||
"name": "snappery", | ||
"version": "1.0.12", | ||
"version": "1.0.14", | ||
"description": "A Scroll Slider Carousel for React that uses CSS scroll snap points with ESM & TypeScript support", | ||
@@ -37,4 +37,4 @@ "keywords": [ | ||
"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:cjs": "tsc --project tsconfig.cjs.json && NODE_ENV=production tailwindcss -i src/styles.css -o dist/cjs/styles.css", | ||
"build:esm": "tsc --project tsconfig.esm.json && NODE_ENV=production tailwindcss -i src/styles.css -o dist/esm/styles.css", | ||
"clean": "rm -rf dist && rm -rf node_modules", | ||
@@ -41,0 +41,0 @@ "patch": "pnpm clean && pnpm install && pnpm build && npm version patch && git push && git push --tags && npm publish", |
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
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
33842
711