@ttoss/landing-pages 0.12.5 → 0.12.6

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