@ttoss/landing-pages 0.9.9 → 0.10.0
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/esm/index.js +19 -9
- package/dist/index.js +25 -15
- package/package.json +5 -3
- package/src/Footer/Footer.tsx +2 -1
- package/src/HeroCarousel/HeroCarousel.tsx +14 -6
- package/src/Navbar/Navbar.tsx +3 -2
package/dist/esm/index.js
CHANGED
|
@@ -69,16 +69,18 @@ var Hero = ({
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
// src/HeroCarousel/HeroCarousel.tsx
|
|
72
|
+
import * as React2 from "react";
|
|
72
73
|
import { Box, Flex as Flex2, Image as Image2 } from "@ttoss/ui";
|
|
73
|
-
import { Icon } from "@
|
|
74
|
-
import React2 from "react";
|
|
74
|
+
import { Icon } from "@ttoss/react-icons";
|
|
75
75
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
76
76
|
var HeroCarousel = ({
|
|
77
77
|
images = []
|
|
78
78
|
}) => {
|
|
79
79
|
const [selectedImage, setSelectedImage] = React2.useState(images[0].id);
|
|
80
80
|
const handleRight = () => {
|
|
81
|
-
const currentIndex = images.findIndex(item =>
|
|
81
|
+
const currentIndex = images.findIndex(item => {
|
|
82
|
+
return item.id === selectedImage;
|
|
83
|
+
});
|
|
82
84
|
const isLast = currentIndex === images.length - 1;
|
|
83
85
|
if (isLast) {
|
|
84
86
|
return setSelectedImage(images[0].id);
|
|
@@ -86,7 +88,9 @@ var HeroCarousel = ({
|
|
|
86
88
|
setSelectedImage(images[currentIndex + 1].id);
|
|
87
89
|
};
|
|
88
90
|
const handleLeft = () => {
|
|
89
|
-
const currentIndex = images.findIndex(item =>
|
|
91
|
+
const currentIndex = images.findIndex(item => {
|
|
92
|
+
return item.id === selectedImage;
|
|
93
|
+
});
|
|
90
94
|
const isFirst = currentIndex === 0;
|
|
91
95
|
if (isFirst) {
|
|
92
96
|
return setSelectedImage(images[images.length - 1].id);
|
|
@@ -94,7 +98,9 @@ var HeroCarousel = ({
|
|
|
94
98
|
setSelectedImage(images[currentIndex - 1].id);
|
|
95
99
|
};
|
|
96
100
|
const image = React2.useMemo(() => {
|
|
97
|
-
const result = images.find(item =>
|
|
101
|
+
const result = images.find(item => {
|
|
102
|
+
return item.id === selectedImage;
|
|
103
|
+
});
|
|
98
104
|
return result;
|
|
99
105
|
}, [selectedImage, images]);
|
|
100
106
|
return /* @__PURE__ */jsx2(Flex2, {
|
|
@@ -153,7 +159,9 @@ var HeroCarousel = ({
|
|
|
153
159
|
children: images.map(image2 => {
|
|
154
160
|
return /* @__PURE__ */jsx2(Box, {
|
|
155
161
|
role: "button",
|
|
156
|
-
onClick: () =>
|
|
162
|
+
onClick: () => {
|
|
163
|
+
return setSelectedImage(image2.id);
|
|
164
|
+
},
|
|
157
165
|
sx: {
|
|
158
166
|
background: image2.id === selectedImage ? "gray" : "black",
|
|
159
167
|
width: 10,
|
|
@@ -169,7 +177,8 @@ var HeroCarousel = ({
|
|
|
169
177
|
};
|
|
170
178
|
|
|
171
179
|
// src/Footer/Footer.tsx
|
|
172
|
-
import { Flex as Flex3, Grid,
|
|
180
|
+
import { Flex as Flex3, Grid, Image as Image3, Link, Text as Text2 } from "@ttoss/ui";
|
|
181
|
+
import { Icon as Icon2 } from "@ttoss/react-icons";
|
|
173
182
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
174
183
|
var Footer = ({
|
|
175
184
|
links,
|
|
@@ -241,9 +250,10 @@ var Footer = ({
|
|
|
241
250
|
};
|
|
242
251
|
|
|
243
252
|
// src/Navbar/Navbar.tsx
|
|
253
|
+
import * as React3 from "react";
|
|
244
254
|
import { Collapse } from "react-collapse";
|
|
245
|
-
import { Flex as Flex4, Grid as Grid2,
|
|
246
|
-
import
|
|
255
|
+
import { Flex as Flex4, Grid as Grid2, Image as Image4, Link as Link2, Text as Text3 } from "@ttoss/ui";
|
|
256
|
+
import { Icon as Icon3 } from "@ttoss/react-icons";
|
|
247
257
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
248
258
|
var Navbar = ({
|
|
249
259
|
links,
|
package/dist/index.js
CHANGED
|
@@ -114,16 +114,18 @@ var Hero = ({
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
// src/HeroCarousel/HeroCarousel.tsx
|
|
117
|
+
var React2 = __toESM(require("react"));
|
|
117
118
|
var import_ui2 = require("@ttoss/ui");
|
|
118
|
-
var
|
|
119
|
-
var import_react2 = __toESM(require("react"));
|
|
119
|
+
var import_react_icons = require("@ttoss/react-icons");
|
|
120
120
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
121
121
|
var HeroCarousel = ({
|
|
122
122
|
images = []
|
|
123
123
|
}) => {
|
|
124
|
-
const [selectedImage, setSelectedImage] =
|
|
124
|
+
const [selectedImage, setSelectedImage] = React2.useState(images[0].id);
|
|
125
125
|
const handleRight = () => {
|
|
126
|
-
const currentIndex = images.findIndex(item =>
|
|
126
|
+
const currentIndex = images.findIndex(item => {
|
|
127
|
+
return item.id === selectedImage;
|
|
128
|
+
});
|
|
127
129
|
const isLast = currentIndex === images.length - 1;
|
|
128
130
|
if (isLast) {
|
|
129
131
|
return setSelectedImage(images[0].id);
|
|
@@ -131,15 +133,19 @@ var HeroCarousel = ({
|
|
|
131
133
|
setSelectedImage(images[currentIndex + 1].id);
|
|
132
134
|
};
|
|
133
135
|
const handleLeft = () => {
|
|
134
|
-
const currentIndex = images.findIndex(item =>
|
|
136
|
+
const currentIndex = images.findIndex(item => {
|
|
137
|
+
return item.id === selectedImage;
|
|
138
|
+
});
|
|
135
139
|
const isFirst = currentIndex === 0;
|
|
136
140
|
if (isFirst) {
|
|
137
141
|
return setSelectedImage(images[images.length - 1].id);
|
|
138
142
|
}
|
|
139
143
|
setSelectedImage(images[currentIndex - 1].id);
|
|
140
144
|
};
|
|
141
|
-
const image =
|
|
142
|
-
const result = images.find(item =>
|
|
145
|
+
const image = React2.useMemo(() => {
|
|
146
|
+
const result = images.find(item => {
|
|
147
|
+
return item.id === selectedImage;
|
|
148
|
+
});
|
|
143
149
|
return result;
|
|
144
150
|
}, [selectedImage, images]);
|
|
145
151
|
return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
|
|
@@ -169,7 +175,7 @@ var HeroCarousel = ({
|
|
|
169
175
|
alignItems: "center"
|
|
170
176
|
},
|
|
171
177
|
onClick: handleLeft,
|
|
172
|
-
children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(
|
|
178
|
+
children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react_icons.Icon, {
|
|
173
179
|
icon: "akar-icons:chevron-left"
|
|
174
180
|
})
|
|
175
181
|
}), image && /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Image, {
|
|
@@ -185,7 +191,7 @@ var HeroCarousel = ({
|
|
|
185
191
|
alignItems: "center"
|
|
186
192
|
},
|
|
187
193
|
onClick: handleRight,
|
|
188
|
-
children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(
|
|
194
|
+
children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react_icons.Icon, {
|
|
189
195
|
icon: "akar-icons:chevron-right"
|
|
190
196
|
})
|
|
191
197
|
})]
|
|
@@ -198,7 +204,9 @@ var HeroCarousel = ({
|
|
|
198
204
|
children: images.map(image2 => {
|
|
199
205
|
return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Box, {
|
|
200
206
|
role: "button",
|
|
201
|
-
onClick: () =>
|
|
207
|
+
onClick: () => {
|
|
208
|
+
return setSelectedImage(image2.id);
|
|
209
|
+
},
|
|
202
210
|
sx: {
|
|
203
211
|
background: image2.id === selectedImage ? "gray" : "black",
|
|
204
212
|
width: 10,
|
|
@@ -215,6 +223,7 @@ var HeroCarousel = ({
|
|
|
215
223
|
|
|
216
224
|
// src/Footer/Footer.tsx
|
|
217
225
|
var import_ui3 = require("@ttoss/ui");
|
|
226
|
+
var import_react_icons2 = require("@ttoss/react-icons");
|
|
218
227
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
219
228
|
var Footer = ({
|
|
220
229
|
links,
|
|
@@ -265,7 +274,7 @@ var Footer = ({
|
|
|
265
274
|
children: socialMedia.map(social => {
|
|
266
275
|
return /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Link, {
|
|
267
276
|
href: social.href,
|
|
268
|
-
children: /* @__PURE__ */(0, import_jsx_runtime3.jsx)(
|
|
277
|
+
children: /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_react_icons2.Icon, {
|
|
269
278
|
icon: social.icon
|
|
270
279
|
})
|
|
271
280
|
}, `social-media-${social.icon}`);
|
|
@@ -286,9 +295,10 @@ var Footer = ({
|
|
|
286
295
|
};
|
|
287
296
|
|
|
288
297
|
// src/Navbar/Navbar.tsx
|
|
298
|
+
var React3 = __toESM(require("react"));
|
|
289
299
|
var import_react_collapse = require("react-collapse");
|
|
290
300
|
var import_ui4 = require("@ttoss/ui");
|
|
291
|
-
var
|
|
301
|
+
var import_react_icons3 = require("@ttoss/react-icons");
|
|
292
302
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
293
303
|
var Navbar = ({
|
|
294
304
|
links,
|
|
@@ -296,13 +306,13 @@ var Navbar = ({
|
|
|
296
306
|
cta,
|
|
297
307
|
type = "1"
|
|
298
308
|
}) => {
|
|
299
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
309
|
+
const [isMenuOpen, setIsMenuOpen] = React3.useState(false);
|
|
300
310
|
const {
|
|
301
311
|
gridTemplateAreas,
|
|
302
312
|
heightLogo,
|
|
303
313
|
gridTemplateColumns,
|
|
304
314
|
justifySelfLogo
|
|
305
|
-
} =
|
|
315
|
+
} = React3.useMemo(() => {
|
|
306
316
|
if (type === "1") {
|
|
307
317
|
return {
|
|
308
318
|
gridTemplateAreas: '"logo links cta"',
|
|
@@ -336,7 +346,7 @@ var Navbar = ({
|
|
|
336
346
|
justifySelf: "start",
|
|
337
347
|
fontSize: "3xl"
|
|
338
348
|
},
|
|
339
|
-
children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(
|
|
349
|
+
children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_react_icons3.Icon, {
|
|
340
350
|
onClick: () => {
|
|
341
351
|
setIsMenuOpen(prev => {
|
|
342
352
|
return !prev;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/landing-pages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Package for creating landing pages.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=16.8.0",
|
|
28
|
-
"@ttoss/
|
|
28
|
+
"@ttoss/react-icons": "^0.1.0",
|
|
29
|
+
"@ttoss/ui": "^3.1.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/jest": "^29.5.3",
|
|
@@ -34,8 +35,9 @@
|
|
|
34
35
|
"jest": "^29.6.1",
|
|
35
36
|
"tsup": "^7.1.0",
|
|
36
37
|
"@ttoss/config": "^1.30.5",
|
|
38
|
+
"@ttoss/react-icons": "^0.1.0",
|
|
37
39
|
"@ttoss/test-utils": "^1.23.6",
|
|
38
|
-
"@ttoss/ui": "^
|
|
40
|
+
"@ttoss/ui": "^3.1.0"
|
|
39
41
|
},
|
|
40
42
|
"keywords": [
|
|
41
43
|
"React",
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Box, Flex, Image } from '@ttoss/ui';
|
|
2
|
-
import { Icon } from '@
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import { Icon } from '@ttoss/react-icons';
|
|
4
4
|
|
|
5
5
|
export type HeroCarouselProps = {
|
|
6
6
|
images: {
|
|
@@ -14,7 +14,9 @@ export const HeroCarousel = ({ images = [] }: HeroCarouselProps) => {
|
|
|
14
14
|
const [selectedImage, setSelectedImage] = React.useState(images[0].id);
|
|
15
15
|
|
|
16
16
|
const handleRight = () => {
|
|
17
|
-
const currentIndex = images.findIndex((item) =>
|
|
17
|
+
const currentIndex = images.findIndex((item) => {
|
|
18
|
+
return item.id === selectedImage;
|
|
19
|
+
});
|
|
18
20
|
const isLast = currentIndex === images.length - 1;
|
|
19
21
|
|
|
20
22
|
if (isLast) {
|
|
@@ -25,7 +27,9 @@ export const HeroCarousel = ({ images = [] }: HeroCarouselProps) => {
|
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
const handleLeft = () => {
|
|
28
|
-
const currentIndex = images.findIndex((item) =>
|
|
30
|
+
const currentIndex = images.findIndex((item) => {
|
|
31
|
+
return item.id === selectedImage;
|
|
32
|
+
});
|
|
29
33
|
const isFirst = currentIndex === 0;
|
|
30
34
|
|
|
31
35
|
if (isFirst) {
|
|
@@ -36,7 +40,9 @@ export const HeroCarousel = ({ images = [] }: HeroCarouselProps) => {
|
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
const image = React.useMemo(() => {
|
|
39
|
-
const result = images.find((item) =>
|
|
43
|
+
const result = images.find((item) => {
|
|
44
|
+
return item.id === selectedImage;
|
|
45
|
+
});
|
|
40
46
|
|
|
41
47
|
return result;
|
|
42
48
|
}, [selectedImage, images]);
|
|
@@ -93,7 +99,9 @@ export const HeroCarousel = ({ images = [] }: HeroCarouselProps) => {
|
|
|
93
99
|
<Box
|
|
94
100
|
key={image.id}
|
|
95
101
|
role="button"
|
|
96
|
-
onClick={() =>
|
|
102
|
+
onClick={() => {
|
|
103
|
+
return setSelectedImage(image.id);
|
|
104
|
+
}}
|
|
97
105
|
sx={{
|
|
98
106
|
background: image.id === selectedImage ? 'gray' : 'black',
|
|
99
107
|
width: 10,
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Collapse } from 'react-collapse';
|
|
2
|
-
import { Flex, Grid,
|
|
3
|
-
import
|
|
3
|
+
import { Flex, Grid, Image, Link, Text } from '@ttoss/ui';
|
|
4
|
+
import { Icon } from '@ttoss/react-icons';
|
|
4
5
|
|
|
5
6
|
type NavbarLink = {
|
|
6
7
|
label: string;
|