@adityabheke/renderer-package 1.0.5 → 1.0.8

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/dist/index.cjs CHANGED
@@ -258,7 +258,8 @@ var Button = ({
258
258
  shadowBlur,
259
259
  shadowColor,
260
260
  className,
261
- animationType = "none"
261
+ animationType = "none",
262
+ navigate
262
263
  }) => {
263
264
  const styles = {
264
265
  backgroundColor: variant === "solid" ? isBackgroundTransparent ? "transparent" : backgroundColor : "transparent",
@@ -274,6 +275,20 @@ var Button = ({
274
275
  ...buildButtonRadiusVars(borderRadius)
275
276
  };
276
277
  const animationClass = ANIMATION_VARIANTS[animationType] || "";
278
+ const handleClick = () => {
279
+ if (navigate.type === "link") {
280
+ if (navigate.target === "internal") {
281
+ window.location.href = `/${navigate.destination}`;
282
+ } else {
283
+ window.open(`/${navigate.destination}`, "_blank");
284
+ }
285
+ } else if (navigate.type === "scroll") {
286
+ const element = document.getElementById(`/${navigate.destination}`);
287
+ if (element) {
288
+ element.scrollIntoView({ behavior: "smooth" });
289
+ }
290
+ }
291
+ };
277
292
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
278
293
  "div",
279
294
  {
@@ -285,6 +300,7 @@ var Button = ({
285
300
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
286
301
  "button",
287
302
  {
303
+ onClick: handleClick,
288
304
  className: cn(
289
305
  "transition-all duration-200",
290
306
  "[font-size:var(--btns-base)] @sm:[font-size:var(--btns-sm)] @md:[font-size:var(--btns-md)] @lg:[font-size:var(--btns-lg)] @xl:[font-size:var(--btns-xl)] @2xl:[font-size:var(--btns-2xl)]",
@@ -832,7 +848,7 @@ var FooterSimple = ({
832
848
  className
833
849
  ),
834
850
  style: { backgroundColor },
835
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "max-w-6xl mx-auto px-4 flex flex-col md:flex-row justify-between items-center gap-4", children: [
851
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "max-w-6xl mx-auto px-4 flex flex-row md:flex-row justify-between items-center gap-4", children: [
836
852
  slots?.["footer-logo"],
837
853
  slots?.["footer-copy"],
838
854
  slots?.["f-link-1"],
package/dist/index.d.cts CHANGED
@@ -145,6 +145,11 @@ interface HeadingProps {
145
145
  animationType?: AnimationType;
146
146
  }
147
147
 
148
+ interface ButtonAction {
149
+ type: "link" | "scroll";
150
+ target?: 'internal' | 'external';
151
+ destination: string;
152
+ }
148
153
  interface ButtonProps {
149
154
  text: string;
150
155
  fontSize: ResponsiveValue<number>;
@@ -159,6 +164,7 @@ interface ButtonProps {
159
164
  shadowColor: string;
160
165
  className?: string;
161
166
  animationType?: AnimationType;
167
+ navigate: ButtonAction;
162
168
  }
163
169
 
164
170
  declare const componentRegistry: {
package/dist/index.d.ts CHANGED
@@ -145,6 +145,11 @@ interface HeadingProps {
145
145
  animationType?: AnimationType;
146
146
  }
147
147
 
148
+ interface ButtonAction {
149
+ type: "link" | "scroll";
150
+ target?: 'internal' | 'external';
151
+ destination: string;
152
+ }
148
153
  interface ButtonProps {
149
154
  text: string;
150
155
  fontSize: ResponsiveValue<number>;
@@ -159,6 +164,7 @@ interface ButtonProps {
159
164
  shadowColor: string;
160
165
  className?: string;
161
166
  animationType?: AnimationType;
167
+ navigate: ButtonAction;
162
168
  }
163
169
 
164
170
  declare const componentRegistry: {
package/dist/index.js CHANGED
@@ -221,7 +221,8 @@ var Button = ({
221
221
  shadowBlur,
222
222
  shadowColor,
223
223
  className,
224
- animationType = "none"
224
+ animationType = "none",
225
+ navigate
225
226
  }) => {
226
227
  const styles = {
227
228
  backgroundColor: variant === "solid" ? isBackgroundTransparent ? "transparent" : backgroundColor : "transparent",
@@ -237,6 +238,20 @@ var Button = ({
237
238
  ...buildButtonRadiusVars(borderRadius)
238
239
  };
239
240
  const animationClass = ANIMATION_VARIANTS[animationType] || "";
241
+ const handleClick = () => {
242
+ if (navigate.type === "link") {
243
+ if (navigate.target === "internal") {
244
+ window.location.href = `/${navigate.destination}`;
245
+ } else {
246
+ window.open(`/${navigate.destination}`, "_blank");
247
+ }
248
+ } else if (navigate.type === "scroll") {
249
+ const element = document.getElementById(`/${navigate.destination}`);
250
+ if (element) {
251
+ element.scrollIntoView({ behavior: "smooth" });
252
+ }
253
+ }
254
+ };
240
255
  return /* @__PURE__ */ jsx(
241
256
  "div",
242
257
  {
@@ -248,6 +263,7 @@ var Button = ({
248
263
  children: /* @__PURE__ */ jsx(
249
264
  "button",
250
265
  {
266
+ onClick: handleClick,
251
267
  className: cn(
252
268
  "transition-all duration-200",
253
269
  "[font-size:var(--btns-base)] @sm:[font-size:var(--btns-sm)] @md:[font-size:var(--btns-md)] @lg:[font-size:var(--btns-lg)] @xl:[font-size:var(--btns-xl)] @2xl:[font-size:var(--btns-2xl)]",
@@ -795,7 +811,7 @@ var FooterSimple = ({
795
811
  className
796
812
  ),
797
813
  style: { backgroundColor },
798
- children: /* @__PURE__ */ jsxs5("div", { className: "max-w-6xl mx-auto px-4 flex flex-col md:flex-row justify-between items-center gap-4", children: [
814
+ children: /* @__PURE__ */ jsxs5("div", { className: "max-w-6xl mx-auto px-4 flex flex-row md:flex-row justify-between items-center gap-4", children: [
799
815
  slots?.["footer-logo"],
800
816
  slots?.["footer-copy"],
801
817
  slots?.["f-link-1"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adityabheke/renderer-package",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "description": "Production-ready React page renderer",
5
5
  "type": "module",
6
6
  "license": "MIT",