@ttoss/landing-pages 0.11.17 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/landing-pages",
3
- "version": "0.11.17",
3
+ "version": "0.12.0",
4
4
  "description": "Package for creating landing pages.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -11,10 +11,10 @@
11
11
  "url": "https://github.com/ttoss/ttoss.git",
12
12
  "directory": "packages/landing-pages"
13
13
  },
14
+ "type": "module",
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": "./dist/esm/index.js",
17
- "require": "./dist/index.js",
18
18
  "types": "./dist/index.d.ts"
19
19
  }
20
20
  },
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=16.8.0",
31
- "@ttoss/react-icons": "^0.3.13",
32
- "@ttoss/ui": "^4.1.17"
31
+ "@ttoss/react-icons": "^0.4.0",
32
+ "@ttoss/ui": "^5.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/jest": "^29.5.12",
@@ -38,9 +38,9 @@
38
38
  "jest": "^29.7.0",
39
39
  "tsup": "^8.2.4",
40
40
  "@ttoss/config": "^1.32.9",
41
- "@ttoss/react-icons": "^0.3.13",
41
+ "@ttoss/ui": "^5.0.0",
42
42
  "@ttoss/test-utils": "^2.1.13",
43
- "@ttoss/ui": "^4.1.17"
43
+ "@ttoss/react-icons": "^0.4.0"
44
44
  },
45
45
  "keywords": [
46
46
  "React",
package/dist/index.d.mts 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 };
package/dist/index.js DELETED
@@ -1,458 +0,0 @@
1
- /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- "use strict";
3
-
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all) __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
- get: () => from[key],
20
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
- });
22
- }
23
- return to;
24
- };
25
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
- // If the importer is in node compatibility mode or this is not an ESM
27
- // file that has been converted to a CommonJS file using a Babel-
28
- // compatible transform (i.e. "__esModule" has not been set), then set
29
- // "default" to the CommonJS "module.exports" for node compatibility.
30
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
31
- value: mod,
32
- enumerable: true
33
- }) : target, mod));
34
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
35
- value: true
36
- }), mod);
37
-
38
- // src/index.ts
39
- var src_exports = {};
40
- __export(src_exports, {
41
- Footer: () => Footer,
42
- Hero: () => Hero,
43
- HeroCarousel: () => HeroCarousel,
44
- Navbar: () => Navbar
45
- });
46
- module.exports = __toCommonJS(src_exports);
47
-
48
- // src/Hero/Hero.tsx
49
- var import_ui = require("@ttoss/ui");
50
- var import_jsx_runtime = require("react/jsx-runtime");
51
- var Hero = ({
52
- alignment,
53
- headerText,
54
- subHeaderText,
55
- imageSrc,
56
- imageAlt,
57
- ctaLabel
58
- }) => {
59
- const isCentered = alignment === "center";
60
- return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_ui.Flex, {
61
- sx: {
62
- justifyContent: "space-between",
63
- paddingY: "10vh",
64
- paddingX: "186px"
65
- },
66
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_ui.Flex, {
67
- sx: {
68
- flexDirection: "column",
69
- alignItems: isCentered ? "center" : "start",
70
- backgroundImage: isCentered ? `url(${imageSrc})` : void 0,
71
- width: isCentered ? "100%" : void 0,
72
- minHeight: isCentered ? "80vh" : void 0,
73
- justifyContent: isCentered ? "center" : void 0
74
- },
75
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ui.Heading, {
76
- sx: {
77
- fontSize: "48px",
78
- color: isCentered ? "white" : void 0
79
- },
80
- as: "h1",
81
- children: headerText
82
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ui.Text, {
83
- sx: {
84
- fontSize: "24px",
85
- color: isCentered ? "white" : void 0,
86
- marginTop: "54px",
87
- marginBottom: "71px"
88
- },
89
- as: "h2",
90
- children: subHeaderText
91
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ui.Button, {
92
- sx: {
93
- background: isCentered ? "white" : "black",
94
- color: isCentered ? "black" : void 0,
95
- borderRadius: "10px",
96
- fontSize: "16px"
97
- },
98
- children: ctaLabel
99
- })]
100
- }), !isCentered && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ui.Flex, {
101
- children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ui.Image, {
102
- sx: {
103
- maxWidth: "60vw",
104
- maxHeight: "623px"
105
- },
106
- src: imageSrc,
107
- alt: imageAlt
108
- })
109
- })]
110
- });
111
- };
112
-
113
- // src/HeroCarousel/HeroCarousel.tsx
114
- var React = __toESM(require("react"));
115
- var import_ui2 = require("@ttoss/ui");
116
- var import_react_icons = require("@ttoss/react-icons");
117
- var import_jsx_runtime2 = require("react/jsx-runtime");
118
- var HeroCarousel = ({
119
- images = []
120
- }) => {
121
- const [selectedImage, setSelectedImage] = React.useState(images[0].id);
122
- const handleRight = () => {
123
- const currentIndex = images.findIndex(item => {
124
- return item.id === selectedImage;
125
- });
126
- const isLast = currentIndex === images.length - 1;
127
- if (isLast) {
128
- return setSelectedImage(images[0].id);
129
- }
130
- setSelectedImage(images[currentIndex + 1].id);
131
- };
132
- const handleLeft = () => {
133
- const currentIndex = images.findIndex(item => {
134
- return item.id === selectedImage;
135
- });
136
- const isFirst = currentIndex === 0;
137
- if (isFirst) {
138
- return setSelectedImage(images[images.length - 1].id);
139
- }
140
- setSelectedImage(images[currentIndex - 1].id);
141
- };
142
- const image = React.useMemo(() => {
143
- const result = images.find(item => {
144
- return item.id === selectedImage;
145
- });
146
- return result;
147
- }, [selectedImage, images]);
148
- return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
149
- sx: {
150
- width: "100%",
151
- height: "100%",
152
- maxHeight: "70vh",
153
- paddingX: 5
154
- },
155
- children: /* @__PURE__ */(0, import_jsx_runtime2.jsxs)(import_ui2.Flex, {
156
- sx: {
157
- width: "100%",
158
- height: "50vw",
159
- position: "relative",
160
- flexDirection: "column"
161
- },
162
- children: [/* @__PURE__ */(0, import_jsx_runtime2.jsxs)(import_ui2.Flex, {
163
- sx: {
164
- height: "100%",
165
- alignItems: "center",
166
- gap: 3
167
- },
168
- children: [/* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
169
- sx: {
170
- cursor: "pointer",
171
- height: "100%",
172
- alignItems: "center"
173
- },
174
- onClick: handleLeft,
175
- children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react_icons.Icon, {
176
- icon: "akar-icons:chevron-left"
177
- })
178
- }), image && /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Image, {
179
- sx: {
180
- height: "100%",
181
- width: "100%"
182
- },
183
- src: image.src
184
- }), /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
185
- sx: {
186
- cursor: "pointer",
187
- height: "100%",
188
- alignItems: "center"
189
- },
190
- onClick: handleRight,
191
- children: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react_icons.Icon, {
192
- icon: "akar-icons:chevron-right"
193
- })
194
- })]
195
- }), /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
196
- sx: {
197
- marginTop: 2,
198
- alignSelf: "center",
199
- gap: 3
200
- },
201
- children: images.map(image2 => {
202
- return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Box, {
203
- role: "button",
204
- onClick: () => {
205
- return setSelectedImage(image2.id);
206
- },
207
- sx: {
208
- background: image2.id === selectedImage ? "gray" : "black",
209
- width: 10,
210
- height: 10,
211
- borderRadius: "50%",
212
- cursor: "pointer"
213
- }
214
- }, image2.id);
215
- })
216
- })]
217
- })
218
- });
219
- };
220
-
221
- // src/Footer/Footer.tsx
222
- var import_ui3 = require("@ttoss/ui");
223
- var import_react_icons2 = require("@ttoss/react-icons");
224
- var import_jsx_runtime3 = require("react/jsx-runtime");
225
- var Footer = ({
226
- links,
227
- logo,
228
- socialMedia,
229
- reserved
230
- }) => {
231
- return /* @__PURE__ */(0, import_jsx_runtime3.jsxs)(import_ui3.Flex, {
232
- sx: {
233
- flexDirection: "column",
234
- paddingY: "40px"
235
- },
236
- children: [/* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Image, {
237
- sx: {
238
- maxWidth: ["90px", "212px"],
239
- alignSelf: "center",
240
- marginBottom: [3, 4]
241
- },
242
- src: logo
243
- }), /* @__PURE__ */(0, import_jsx_runtime3.jsxs)(import_ui3.Flex, {
244
- sx: {
245
- flexDirection: ["column", "row"],
246
- justifyContent: ["unset", "center"],
247
- paddingX: 3
248
- },
249
- children: [/* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Grid, {
250
- sx: {
251
- justifyContent: "center",
252
- gridTemplateColumns: ["6fr 3fr 3fr", "1fr 1fr 1fr"]
253
- },
254
- children: links.map((link, idx) => {
255
- return /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Link, {
256
- sx: {
257
- fontSize: "xs",
258
- fontFamily: "body",
259
- textDecorationLine: "none"
260
- },
261
- href: link.href,
262
- children: link.label
263
- }, `link-${link.label}-${idx}`);
264
- })
265
- }), /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Flex, {
266
- sx: {
267
- marginTop: [3],
268
- gap: [4],
269
- justifyContent: "center"
270
- },
271
- children: socialMedia.map(social => {
272
- return /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Link, {
273
- href: social.href,
274
- children: /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_react_icons2.Icon, {
275
- icon: social.icon
276
- })
277
- }, `social-media-${social.icon}`);
278
- })
279
- })]
280
- }), /* @__PURE__ */(0, import_jsx_runtime3.jsx)(import_ui3.Text, {
281
- sx: {
282
- fontSize: "xxs",
283
- color: "gray",
284
- fontFamily: "heading",
285
- textAlign: "center",
286
- lineHeight: "1.5",
287
- marginTop: [3, 4]
288
- },
289
- children: reserved
290
- })]
291
- });
292
- };
293
-
294
- // src/Navbar/Navbar.tsx
295
- var React2 = __toESM(require("react"));
296
- var import_react_collapse = require("react-collapse");
297
- var import_ui4 = require("@ttoss/ui");
298
- var import_react_icons3 = require("@ttoss/react-icons");
299
- var import_jsx_runtime4 = require("react/jsx-runtime");
300
- var Navbar = ({
301
- links,
302
- logo,
303
- cta,
304
- type = "1"
305
- }) => {
306
- const [isMenuOpen, setIsMenuOpen] = React2.useState(false);
307
- const {
308
- gridTemplateAreas,
309
- heightLogo,
310
- gridTemplateColumns,
311
- justifySelfLogo
312
- } = React2.useMemo(() => {
313
- if (type === "1") {
314
- return {
315
- gridTemplateAreas: '"logo links cta"',
316
- gridTemplateColumns: "2fr 5fr 2fr",
317
- heightLogo: "42px",
318
- justifySelfLogo: "unset"
319
- };
320
- }
321
- return {
322
- gridTemplateAreas: '"links logo cta"',
323
- gridTemplateColumns: "1fr 1fr 1fr",
324
- heightLogo: "54px",
325
- justifySelfLogo: "center"
326
- };
327
- }, [type]);
328
- return /* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, {
329
- children: [/* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_ui4.Flex, {
330
- sx: {
331
- flexDirection: "column",
332
- display: ["flex", "none"]
333
- },
334
- children: [/* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_ui4.Grid, {
335
- sx: {
336
- justifyContent: "space-between",
337
- alignItems: "center",
338
- gridTemplateColumns: "1fr 1fr 1fr"
339
- },
340
- children: [/* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Text, {
341
- sx: {
342
- cursor: "pointer",
343
- justifySelf: "start",
344
- fontSize: "3xl"
345
- },
346
- children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_react_icons3.Icon, {
347
- onClick: () => {
348
- setIsMenuOpen(prev => {
349
- return !prev;
350
- });
351
- },
352
- icon: isMenuOpen ? "ic:outline-menu-open" : "ic:outline-menu"
353
- })
354
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Image, {
355
- src: logo,
356
- sx: {
357
- maxWidth: "112px"
358
- }
359
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
360
- sx: {
361
- justifyContent: "end",
362
- width: "100%",
363
- alignItems: "center"
364
- },
365
- children: cta && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Link, {
366
- sx: {
367
- fontSize: "xs"
368
- },
369
- href: cta.href,
370
- children: cta.label
371
- })
372
- })]
373
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_react_collapse.Collapse, {
374
- isOpened: isMenuOpen,
375
- initialStyle: {
376
- height: 0,
377
- overflow: "hidden"
378
- },
379
- children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
380
- sx: {
381
- flexDirection: "column",
382
- width: "100%",
383
- gap: 3,
384
- paddingY: 3,
385
- paddingLeft: 3
386
- },
387
- children: links.map(link => {
388
- return /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Link, {
389
- sx: {
390
- fontSize: "xs"
391
- },
392
- href: link.href,
393
- children: link.label
394
- }, link.label);
395
- })
396
- })
397
- })]
398
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_ui4.Grid, {
399
- sx: {
400
- display: ["none", "grid"],
401
- gridTemplateAreas,
402
- gridTemplateColumns,
403
- alignItems: "center",
404
- paddingX: 6,
405
- paddingY: 4
406
- },
407
- children: [/* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Image, {
408
- sx: {
409
- gridArea: "logo",
410
- height: heightLogo,
411
- justifySelf: justifySelfLogo
412
- },
413
- src: logo
414
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
415
- sx: {
416
- gridArea: "links",
417
- justifyContent: "space-around"
418
- },
419
- children: links.map(link => {
420
- return /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Link, {
421
- sx: {
422
- fontSize: "2xl"
423
- },
424
- href: link.href,
425
- children: link.label
426
- }, link.label);
427
- })
428
- }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
429
- sx: {
430
- gridArea: "cta",
431
- justifyContent: "end"
432
- },
433
- children: cta && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_ui4.Link, {
434
- href: cta.href,
435
- sx: {
436
- backgroundColor: "background",
437
- borderColor: "text",
438
- color: "text",
439
- borderRadius: "10px",
440
- fontSize: "base",
441
- textDecorationLine: "none",
442
- paddingX: 3,
443
- paddingY: 2
444
- },
445
- as: "button",
446
- children: cta.label
447
- })
448
- })]
449
- })]
450
- });
451
- };
452
- // Annotate the CommonJS export names for ESM import in node:
453
- 0 && (module.exports = {
454
- Footer,
455
- Hero,
456
- HeroCarousel,
457
- Navbar
458
- });