lm-web-controls 1.0.6 → 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/build.bat ADDED
@@ -0,0 +1,10 @@
1
+ @echo off
2
+
3
+ echo Building modules...
4
+ call npm run build
5
+
6
+ echo Creating packages.cls..
7
+ call npm pack
8
+
9
+ echo Publishing to npm...
10
+ call npm publish
package/dist/index.es.js CHANGED
@@ -1 +1 @@
1
- import r from"react";var t=function(t){var a=t.value;return r.createElement("a",{href:"mailto:".concat(a),target:"_blank"},a)};export{t as Email};
1
+ import r from"react";import"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";function e(e){var s=e.value,c=e.className;return r.createElement("a",{href:"mailto:".concat(s),target:"_blank",className:c},s)}"function"==typeof SuppressedError&&SuppressedError;export{e as Email};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));exports.Email=function(e){var r=e.value;return t.default.createElement("a",{href:"mailto:".concat(r),target:"_blank"},r)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("react-slick"),require("slick-carousel/slick/slick.css"),require("slick-carousel/slick/slick-theme.css");var s=r(e);"function"==typeof SuppressedError&&SuppressedError,exports.Email=function(e){var r=e.value,t=e.className;return s.default.createElement("a",{href:"mailto:".concat(r),target:"_blank",className:t},r)};
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -35,13 +35,16 @@
35
35
  "@syncfusion/ej2-react-dropdowns": "21.1.41",
36
36
  "@syncfusion/ej2-react-grids": "21.1.41",
37
37
  "@syncfusion/ej2-react-inputs": "22.1.34",
38
+ "@types/react-slick": "^0.23.13",
38
39
  "acorn": "8.9.0",
39
40
  "acorn-walk": "8.2.0",
40
41
  "commander": "10.0.1",
42
+ "react-slick": "^0.30.2",
41
43
  "rollup-plugin-babel": "4.4.0",
42
44
  "rollup-plugin-peer-deps-external": "2.2.4",
43
45
  "rollup-plugin-terser": "7.0.2",
44
46
  "rollup-plugin-typescript2": "0.34.1",
47
+ "slick-carousel": "^1.8.1",
45
48
  "ts-loader": "9.4.3"
46
49
  }
47
50
  }
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ type CopyrightProps = {
4
+ name: string;
5
+ className: string;
6
+ };
7
+
8
+ export default function Copyright({ name, className }: CopyrightProps) {
9
+ return (
10
+ <span className={className}>
11
+ Copyright &copy 2024 {name}; Digital Marketing with AI Powered by
12
+ <a href="https://leadmetrics.ai/" target="_blank">
13
+ Leadmetrics
14
+ </a>
15
+ </span>
16
+ );
17
+ }
@@ -2,13 +2,13 @@ import React from "react";
2
2
 
3
3
  type EmailProps = {
4
4
  value: string;
5
+ className: string;
5
6
  };
6
7
 
7
- export const Email = ({ value }: EmailProps) => {
8
+ export function Email({ value, className }: EmailProps) {
8
9
  return (
9
- <a href={`mailto:${value}`} target="_blank">
10
+ <a href={`mailto:${value}`} target="_blank" className={className}>
10
11
  {value}
11
12
  </a>
12
13
  );
13
- };
14
- export default Email;
14
+ }
@@ -0,0 +1,91 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import Slider from "react-slick";
5
+
6
+ import "slick-carousel/slick/slick.css";
7
+ import "slick-carousel/slick/slick-theme.css";
8
+ import { useEffect, useState } from "react";
9
+
10
+ type InstaFeedProps = { key: string; className: string };
11
+
12
+ type InstagramPost = {
13
+ id: string;
14
+ caption: string;
15
+ media_type: string;
16
+ media_url: string;
17
+ timestamp: string;
18
+ };
19
+
20
+ type InstagramPostList = InstagramPost[];
21
+
22
+ export default function InstaFeed({ key, className }: InstaFeedProps) {
23
+ const [igFeeds, setIgFeeds] = useState<InstagramPostList | null>(null);
24
+ const [fetchStatus, setFetchStatus] = useState<string>("Loading feeds...");
25
+
26
+ const settings = {
27
+ dots: true,
28
+ infinite: true,
29
+ autoplay: true,
30
+ speed: 2000,
31
+ slidesToShow: 6,
32
+ slidesToScroll: 1,
33
+ responsive: [
34
+ {
35
+ breakpoint: 1024,
36
+ settings: {
37
+ slidesToShow: 3,
38
+ slidesToScroll: 3,
39
+ infinite: true,
40
+ dots: true,
41
+ },
42
+ },
43
+ {
44
+ breakpoint: 600,
45
+ settings: {
46
+ slidesToShow: 2,
47
+ slidesToScroll: 2,
48
+ },
49
+ },
50
+ {
51
+ breakpoint: 480,
52
+ settings: {
53
+ slidesToShow: 2,
54
+ slidesToScroll: 2,
55
+ },
56
+ },
57
+ ],
58
+ };
59
+
60
+ useEffect(() => {
61
+ const url = `https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,timestamp&access_token=${key}`;
62
+ const feed = fetch(url).then((data) => data.json());
63
+
64
+ feed
65
+ .then((a) => {
66
+ setIgFeeds(a.data as InstagramPostList);
67
+ })
68
+ .catch((err) => {
69
+ setFetchStatus("Something went wrong!");
70
+ console.error(err);
71
+ });
72
+ }, []);
73
+
74
+ return (
75
+ <>
76
+ {igFeeds ? (
77
+ <Slider {...settings}>
78
+ {igFeeds?.map((item, i) => {
79
+ return (
80
+ <div key={crypto.randomUUID()} className={className}>
81
+ <img src={item.media_url} alt={`image-${i}`} />
82
+ </div>
83
+ );
84
+ })}
85
+ </Slider>
86
+ ) : (
87
+ <h3 className="text-center">{fetchStatus}</h3>
88
+ )}
89
+ </>
90
+ );
91
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+
3
+ type MapProps = {
4
+ id?: string;
5
+ address: string;
6
+ height: string | number;
7
+ width: string | number;
8
+ key: string;
9
+ };
10
+
11
+ export default function Map({ id, address, height, width, key }: MapProps) {
12
+ return (
13
+ <iframe
14
+ id={id}
15
+ width={width}
16
+ height={height}
17
+ loading="lazy"
18
+ referrerPolicy="no-referrer-when-downgrade"
19
+ src={`https://www.google.com/maps/embed/v1/place?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&q=place_id:ChIJaZ6ne_U_rjsRFN98AFmq6hg`}
20
+ ></iframe>
21
+ );
22
+ }
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+
3
+ type PhoneProps = {
4
+ value: string;
5
+ country: string;
6
+ className: string;
7
+ };
8
+
9
+ export default function Phone({ value, country, className }: PhoneProps) {
10
+ return (
11
+ <a
12
+ href={`tel:+${country} ${value}`}
13
+ className={className}
14
+ >{`${country} ${value}`}</a>
15
+ );
16
+ }
package/src/index.ts CHANGED
@@ -1 +1,5 @@
1
- export * from './blocks/email'
1
+ export * from "./blocks/copyright";
2
+ export * from "./blocks/email";
3
+ export * from "./blocks/instaFeed";
4
+ //export * from "./blocks/map";
5
+ export * from "./blocks/phone";
package/tsconfig.json CHANGED
@@ -11,11 +11,11 @@
11
11
  "allowSyntheticDefaultImports": true,
12
12
  "esModuleInterop": true
13
13
  },
14
- "include": ["src/**/*"],
14
+ "include": ["src/**/*", "types"],
15
15
  "exclude": [
16
16
  "node_modules",
17
17
  "build",
18
18
  "src/**/*.stories.tsx",
19
19
  "src/**/*.test.tsx"
20
20
  ]
21
- }
21
+ }
@@ -3,7 +3,25 @@ import React, { Component, ChangeEvent } from "react";
3
3
  declare module "lm-web-controls" {
4
4
  type EmailProps = {
5
5
  value: string;
6
+ className: string;
6
7
  };
7
-
8
8
  export const Email: React.FC<EmailProps>;
9
+
10
+ type CopyrightProps = {
11
+ name: string;
12
+ className: string;
13
+ };
14
+ export const Copyright: React.FC<CopyrightProps>;
15
+
16
+ type PhoneProps = {
17
+ value: string;
18
+ country: string;
19
+ className: string;
20
+ };
21
+ export const Phone: React.FC<PhoneProps>;
22
+
23
+ //email
24
+
25
+ type InstaFeedProps = { key: string; className: string };
26
+ export const InstaFeed: React.FC<InstaFeedProps>;
9
27
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file