@ttoss/landing-pages 0.12.64 → 0.12.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/landing-pages",
3
- "version": "0.12.64",
3
+ "version": "0.12.65",
4
4
  "description": "Package for creating landing pages.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -28,19 +28,19 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=16.8.0",
31
- "@ttoss/ui": "^6.0.4",
32
- "@ttoss/react-icons": "^0.5.5"
31
+ "@ttoss/react-icons": "^0.5.6",
32
+ "@ttoss/ui": "^6.1.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/jest": "^30.0.0",
36
- "@types/react": "^19.2.6",
36
+ "@types/react": "^19.2.7",
37
37
  "@types/react-collapse": "^5.0.4",
38
38
  "jest": "^30.2.0",
39
39
  "tsup": "^8.5.1",
40
- "@ttoss/react-icons": "^0.5.5",
41
- "@ttoss/test-utils": "^4.0.1",
40
+ "@ttoss/react-icons": "^0.5.6",
41
+ "@ttoss/test-utils": "^4.0.2",
42
42
  "@ttoss/config": "^1.35.12",
43
- "@ttoss/ui": "^6.0.4"
43
+ "@ttoss/ui": "^6.1.0"
44
44
  },
45
45
  "keywords": [
46
46
  "React",
package/dist/esm/index.js DELETED
@@ -1,379 +0,0 @@
1
- /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import * as React from 'react';
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", {
5
- value,
6
- configurable: true
7
- });
8
-
9
- // src/Hero/Hero.tsx
10
- import { Button, Flex, Heading, Image, Text } from "@ttoss/ui";
11
- var Hero = /* @__PURE__ */__name(({
12
- alignment,
13
- headerText,
14
- subHeaderText,
15
- imageSrc,
16
- imageAlt,
17
- ctaLabel
18
- }) => {
19
- const isCentered = alignment === "center";
20
- return /* @__PURE__ */React.createElement(Flex, {
21
- sx: {
22
- justifyContent: "space-between",
23
- paddingY: "10vh",
24
- paddingX: "186px"
25
- }
26
- }, /* @__PURE__ */React.createElement(Flex, {
27
- sx: {
28
- flexDirection: "column",
29
- alignItems: isCentered ? "center" : "start",
30
- backgroundImage: isCentered ? `url(${imageSrc})` : void 0,
31
- width: isCentered ? "100%" : void 0,
32
- minHeight: isCentered ? "80vh" : void 0,
33
- justifyContent: isCentered ? "center" : void 0
34
- }
35
- }, /* @__PURE__ */React.createElement(Heading, {
36
- sx: {
37
- fontSize: "48px",
38
- color: isCentered ? "white" : void 0
39
- },
40
- as: "h1"
41
- }, headerText), /* @__PURE__ */React.createElement(Text, {
42
- sx: {
43
- fontSize: "24px",
44
- color: isCentered ? "white" : void 0,
45
- marginTop: "54px",
46
- marginBottom: "71px"
47
- },
48
- as: "h2"
49
- }, subHeaderText), /* @__PURE__ */React.createElement(Button, {
50
- sx: {
51
- background: isCentered ? "white" : "black",
52
- color: isCentered ? "black" : void 0,
53
- borderRadius: "10px",
54
- fontSize: "16px"
55
- }
56
- }, ctaLabel)), !isCentered && /* @__PURE__ */React.createElement(Flex, null, /* @__PURE__ */React.createElement(Image, {
57
- sx: {
58
- maxWidth: "60vw",
59
- maxHeight: "623px"
60
- },
61
- src: imageSrc,
62
- alt: imageAlt
63
- })));
64
- }, "Hero");
65
-
66
- // src/HeroCarousel/HeroCarousel.tsx
67
- import * as React2 from "react";
68
- import { Box, Flex as Flex2, Image as Image2 } from "@ttoss/ui";
69
- import { Icon } from "@ttoss/react-icons";
70
- var HeroCarousel = /* @__PURE__ */__name(({
71
- images = []
72
- }) => {
73
- const [selectedImage, setSelectedImage] = React2.useState(images[0].id);
74
- const handleRight = /* @__PURE__ */__name(() => {
75
- const currentIndex = images.findIndex(item => {
76
- return item.id === selectedImage;
77
- });
78
- const isLast = currentIndex === images.length - 1;
79
- if (isLast) {
80
- return setSelectedImage(images[0].id);
81
- }
82
- setSelectedImage(images[currentIndex + 1].id);
83
- }, "handleRight");
84
- const handleLeft = /* @__PURE__ */__name(() => {
85
- const currentIndex = images.findIndex(item => {
86
- return item.id === selectedImage;
87
- });
88
- const isFirst = currentIndex === 0;
89
- if (isFirst) {
90
- return setSelectedImage(images[images.length - 1].id);
91
- }
92
- setSelectedImage(images[currentIndex - 1].id);
93
- }, "handleLeft");
94
- const image = React2.useMemo(() => {
95
- const result = images.find(item => {
96
- return item.id === selectedImage;
97
- });
98
- return result;
99
- }, [selectedImage, images]);
100
- return /* @__PURE__ */React2.createElement(Flex2, {
101
- sx: {
102
- width: "100%",
103
- height: "100%",
104
- maxHeight: "70vh",
105
- paddingX: 5
106
- }
107
- }, /* @__PURE__ */React2.createElement(Flex2, {
108
- sx: {
109
- width: "100%",
110
- height: "50vw",
111
- position: "relative",
112
- flexDirection: "column"
113
- }
114
- }, /* @__PURE__ */React2.createElement(Flex2, {
115
- sx: {
116
- height: "100%",
117
- alignItems: "center",
118
- gap: 3
119
- }
120
- }, /* @__PURE__ */React2.createElement(Flex2, {
121
- sx: {
122
- cursor: "pointer",
123
- height: "100%",
124
- alignItems: "center"
125
- },
126
- onClick: handleLeft
127
- }, /* @__PURE__ */React2.createElement(Icon, {
128
- icon: "akar-icons:chevron-left"
129
- })), image && /* @__PURE__ */React2.createElement(Image2, {
130
- sx: {
131
- height: "100%",
132
- width: "100%"
133
- },
134
- src: image.src
135
- }), /* @__PURE__ */React2.createElement(Flex2, {
136
- sx: {
137
- cursor: "pointer",
138
- height: "100%",
139
- alignItems: "center"
140
- },
141
- onClick: handleRight
142
- }, /* @__PURE__ */React2.createElement(Icon, {
143
- icon: "akar-icons:chevron-right"
144
- }))), /* @__PURE__ */React2.createElement(Flex2, {
145
- sx: {
146
- marginTop: 2,
147
- alignSelf: "center",
148
- gap: 3
149
- }
150
- }, images.map(image2 => {
151
- return /* @__PURE__ */React2.createElement(Box, {
152
- key: image2.id,
153
- role: "button",
154
- onClick: /* @__PURE__ */__name(() => {
155
- return setSelectedImage(image2.id);
156
- }, "onClick"),
157
- sx: {
158
- background: image2.id === selectedImage ? "gray" : "black",
159
- width: 10,
160
- height: 10,
161
- borderRadius: "50%",
162
- cursor: "pointer"
163
- }
164
- });
165
- }))));
166
- }, "HeroCarousel");
167
-
168
- // src/Footer/Footer.tsx
169
- import { Flex as Flex3, Grid, Image as Image3, Link, Text as Text2 } from "@ttoss/ui";
170
- import { Icon as Icon2 } from "@ttoss/react-icons";
171
- var Footer = /* @__PURE__ */__name(({
172
- links,
173
- logo,
174
- socialMedia,
175
- reserved
176
- }) => {
177
- return /* @__PURE__ */React.createElement(Flex3, {
178
- sx: {
179
- flexDirection: "column",
180
- paddingY: "40px"
181
- }
182
- }, /* @__PURE__ */React.createElement(Image3, {
183
- sx: {
184
- maxWidth: ["90px", "212px"],
185
- alignSelf: "center",
186
- marginBottom: [3, 4]
187
- },
188
- src: logo
189
- }), /* @__PURE__ */React.createElement(Flex3, {
190
- sx: {
191
- flexDirection: ["column", "row"],
192
- justifyContent: ["unset", "center"],
193
- paddingX: 3
194
- }
195
- }, /* @__PURE__ */React.createElement(Grid, {
196
- sx: {
197
- justifyContent: "center",
198
- gridTemplateColumns: ["6fr 3fr 3fr", "1fr 1fr 1fr"]
199
- }
200
- }, links.map((link, idx) => {
201
- return /* @__PURE__ */React.createElement(Link, {
202
- sx: {
203
- fontSize: "xs",
204
- fontFamily: "body",
205
- textDecorationLine: "none"
206
- },
207
- key: `link-${link.label}-${idx}`,
208
- href: link.href
209
- }, link.label);
210
- })), /* @__PURE__ */React.createElement(Flex3, {
211
- sx: {
212
- marginTop: [3],
213
- gap: [4],
214
- justifyContent: "center"
215
- }
216
- }, socialMedia.map(social => {
217
- return /* @__PURE__ */React.createElement(Link, {
218
- href: social.href,
219
- key: `social-media-${social.icon}`
220
- }, /* @__PURE__ */React.createElement(Icon2, {
221
- icon: social.icon
222
- }));
223
- }))), /* @__PURE__ */React.createElement(Text2, {
224
- sx: {
225
- fontSize: "xxs",
226
- color: "gray",
227
- fontFamily: "heading",
228
- textAlign: "center",
229
- lineHeight: "1.5",
230
- marginTop: [3, 4]
231
- }
232
- }, reserved));
233
- }, "Footer");
234
-
235
- // src/Navbar/Navbar.tsx
236
- import * as React3 from "react";
237
- import { Collapse } from "react-collapse";
238
- import { Flex as Flex4, Grid as Grid2, Image as Image4, Link as Link2, Text as Text3 } from "@ttoss/ui";
239
- import { Icon as Icon3 } from "@ttoss/react-icons";
240
- var Navbar = /* @__PURE__ */__name(({
241
- links,
242
- logo,
243
- cta,
244
- type = "1"
245
- }) => {
246
- const [isMenuOpen, setIsMenuOpen] = React3.useState(false);
247
- const {
248
- gridTemplateAreas,
249
- heightLogo,
250
- gridTemplateColumns,
251
- justifySelfLogo
252
- } = React3.useMemo(() => {
253
- if (type === "1") {
254
- return {
255
- gridTemplateAreas: '"logo links cta"',
256
- gridTemplateColumns: "2fr 5fr 2fr",
257
- heightLogo: "42px",
258
- justifySelfLogo: "unset"
259
- };
260
- }
261
- return {
262
- gridTemplateAreas: '"links logo cta"',
263
- gridTemplateColumns: "1fr 1fr 1fr",
264
- heightLogo: "54px",
265
- justifySelfLogo: "center"
266
- };
267
- }, [type]);
268
- return /* @__PURE__ */React3.createElement(React3.Fragment, null, /* @__PURE__ */React3.createElement(Flex4, {
269
- sx: {
270
- flexDirection: "column",
271
- display: ["flex", "none"]
272
- }
273
- }, /* @__PURE__ */React3.createElement(Grid2, {
274
- sx: {
275
- justifyContent: "space-between",
276
- alignItems: "center",
277
- gridTemplateColumns: "1fr 1fr 1fr"
278
- }
279
- }, /* @__PURE__ */React3.createElement(Text3, {
280
- sx: {
281
- cursor: "pointer",
282
- justifySelf: "start",
283
- fontSize: "3xl"
284
- }
285
- }, /* @__PURE__ */React3.createElement(Icon3, {
286
- onClick: /* @__PURE__ */__name(() => {
287
- setIsMenuOpen(prev => {
288
- return !prev;
289
- });
290
- }, "onClick"),
291
- icon: isMenuOpen ? "ic:outline-menu-open" : "ic:outline-menu"
292
- })), /* @__PURE__ */React3.createElement(Image4, {
293
- src: logo,
294
- sx: {
295
- maxWidth: "112px"
296
- }
297
- }), /* @__PURE__ */React3.createElement(Flex4, {
298
- sx: {
299
- justifyContent: "end",
300
- width: "100%",
301
- alignItems: "center"
302
- }
303
- }, cta && /* @__PURE__ */React3.createElement(Link2, {
304
- sx: {
305
- fontSize: "xs"
306
- },
307
- href: cta.href
308
- }, cta.label))), /* @__PURE__ */React3.createElement(Collapse, {
309
- isOpened: isMenuOpen,
310
- initialStyle: {
311
- height: 0,
312
- overflow: "hidden"
313
- }
314
- }, /* @__PURE__ */React3.createElement(Flex4, {
315
- sx: {
316
- flexDirection: "column",
317
- width: "100%",
318
- gap: 3,
319
- paddingY: 3,
320
- paddingLeft: 3
321
- }
322
- }, links.map(link => {
323
- return /* @__PURE__ */React3.createElement(Link2, {
324
- sx: {
325
- fontSize: "xs"
326
- },
327
- key: link.label,
328
- href: link.href
329
- }, link.label);
330
- })))), /* @__PURE__ */React3.createElement(Grid2, {
331
- sx: {
332
- display: ["none", "grid"],
333
- gridTemplateAreas,
334
- gridTemplateColumns,
335
- alignItems: "center",
336
- paddingX: 6,
337
- paddingY: 4
338
- }
339
- }, /* @__PURE__ */React3.createElement(Image4, {
340
- sx: {
341
- gridArea: "logo",
342
- height: heightLogo,
343
- justifySelf: justifySelfLogo
344
- },
345
- src: logo
346
- }), /* @__PURE__ */React3.createElement(Flex4, {
347
- sx: {
348
- gridArea: "links",
349
- justifyContent: "space-around"
350
- }
351
- }, links.map(link => {
352
- return /* @__PURE__ */React3.createElement(Link2, {
353
- sx: {
354
- fontSize: "2xl"
355
- },
356
- key: link.label,
357
- href: link.href
358
- }, link.label);
359
- })), /* @__PURE__ */React3.createElement(Flex4, {
360
- sx: {
361
- gridArea: "cta",
362
- justifyContent: "end"
363
- }
364
- }, cta && /* @__PURE__ */React3.createElement(Link2, {
365
- href: cta.href,
366
- sx: {
367
- backgroundColor: "background",
368
- borderColor: "text",
369
- color: "text",
370
- borderRadius: "10px",
371
- fontSize: "base",
372
- textDecorationLine: "none",
373
- paddingX: 3,
374
- paddingY: 2
375
- },
376
- as: "button"
377
- }, cta.label))));
378
- }, "Navbar");
379
- export { Footer, Hero, HeroCarousel, Navbar };
package/dist/index.d.ts DELETED
@@ -1,53 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- type HeroProps = {
4
- headerText: string;
5
- subHeaderText: string;
6
- alignment: 'left' | 'center';
7
- imageSrc: string;
8
- imageAlt?: string;
9
- ctaLabel?: string;
10
- };
11
- declare const Hero: ({ alignment, headerText, subHeaderText, imageSrc, imageAlt, ctaLabel, }: HeroProps) => react_jsx_runtime.JSX.Element;
12
-
13
- type HeroCarouselProps = {
14
- images: {
15
- id: string;
16
- alt: string;
17
- src: string;
18
- }[];
19
- };
20
- declare const HeroCarousel: ({ images }: HeroCarouselProps) => react_jsx_runtime.JSX.Element;
21
-
22
- type FooterLink = {
23
- label: string;
24
- href: string;
25
- };
26
- type SocialMedia = {
27
- icon: string;
28
- href: string;
29
- };
30
- type FooterProps = {
31
- links: FooterLink[];
32
- logo: string;
33
- socialMedia: SocialMedia[];
34
- reserved: string;
35
- };
36
- declare const Footer: ({ links, logo, socialMedia, reserved }: FooterProps) => react_jsx_runtime.JSX.Element;
37
-
38
- type NavbarLink = {
39
- label: string;
40
- href: string;
41
- };
42
- type NavbarProps = {
43
- type?: '1' | '2';
44
- logo: string;
45
- cta?: {
46
- label: string;
47
- href: string;
48
- };
49
- links: NavbarLink[];
50
- };
51
- declare const Navbar: ({ links, logo, cta, type }: NavbarProps) => react_jsx_runtime.JSX.Element;
52
-
53
- export { Footer, type FooterProps, Hero, HeroCarousel, type HeroCarouselProps, type HeroProps, Navbar, type NavbarProps };