@ttoss/landing-pages 0.1.6 → 0.1.7
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 +207 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +210 -2
- package/package.json +6 -4
- package/src/Footer/Footer.tsx +93 -0
- package/src/Navbar/Navbar.tsx +154 -0
- package/src/index.ts +7 -2
package/dist/esm/index.js
CHANGED
|
@@ -164,7 +164,213 @@ var HeroCarousel = ({ images = [] }) => {
|
|
|
164
164
|
})
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
|
+
|
|
168
|
+
// src/Footer/Footer.tsx
|
|
169
|
+
import { Flex as Flex3, Grid, Icon as Icon2, Image as Image3, Link, Text as Text2 } from "@ttoss/ui";
|
|
170
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
171
|
+
var Footer = ({ links, logo, socialMedia, reserved }) => {
|
|
172
|
+
return /* @__PURE__ */ jsxs3(Flex3, {
|
|
173
|
+
sx: { flexDirection: "column", paddingY: "40px" },
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx3(Image3, {
|
|
176
|
+
sx: {
|
|
177
|
+
maxWidth: ["90px", "212px"],
|
|
178
|
+
alignSelf: "center",
|
|
179
|
+
marginBottom: [3, 4]
|
|
180
|
+
},
|
|
181
|
+
src: logo
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ jsxs3(Flex3, {
|
|
184
|
+
sx: {
|
|
185
|
+
flexDirection: ["column", "row"],
|
|
186
|
+
justifyContent: ["unset", "center"],
|
|
187
|
+
paddingX: 3
|
|
188
|
+
},
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsx3(Grid, {
|
|
191
|
+
sx: {
|
|
192
|
+
justifyContent: "center",
|
|
193
|
+
gridTemplateColumns: ["6fr 3fr 3fr", "1fr 1fr 1fr"]
|
|
194
|
+
},
|
|
195
|
+
children: links.map((link, idx) => {
|
|
196
|
+
return /* @__PURE__ */ jsx3(Link, {
|
|
197
|
+
sx: {
|
|
198
|
+
fontSize: "xs",
|
|
199
|
+
fontFamily: "body",
|
|
200
|
+
textDecorationLine: "none"
|
|
201
|
+
},
|
|
202
|
+
href: link.href,
|
|
203
|
+
children: link.label
|
|
204
|
+
}, `link-${link.label}-${idx}`);
|
|
205
|
+
})
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ jsx3(Flex3, {
|
|
208
|
+
sx: {
|
|
209
|
+
marginTop: [3],
|
|
210
|
+
gap: [4],
|
|
211
|
+
justifyContent: "center"
|
|
212
|
+
},
|
|
213
|
+
children: socialMedia.map((social) => {
|
|
214
|
+
return /* @__PURE__ */ jsx3(Link, {
|
|
215
|
+
href: social.href,
|
|
216
|
+
children: /* @__PURE__ */ jsx3(Icon2, {
|
|
217
|
+
icon: social.icon
|
|
218
|
+
})
|
|
219
|
+
}, `social-media-${social.icon}`);
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx3(Text2, {
|
|
225
|
+
sx: {
|
|
226
|
+
fontSize: "xxs",
|
|
227
|
+
color: "gray",
|
|
228
|
+
fontFamily: "heading",
|
|
229
|
+
textAlign: "center",
|
|
230
|
+
lineHeight: "1.5",
|
|
231
|
+
marginTop: [3, 4]
|
|
232
|
+
},
|
|
233
|
+
children: reserved
|
|
234
|
+
})
|
|
235
|
+
]
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// src/Navbar/Navbar.tsx
|
|
240
|
+
import { Collapse } from "react-collapse";
|
|
241
|
+
import { Flex as Flex4, Grid as Grid2, Icon as Icon3, Image as Image4, Link as Link2 } from "@ttoss/ui";
|
|
242
|
+
import React3 from "react";
|
|
243
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
244
|
+
var Navbar = ({ links, logo, cta, type = "1" }) => {
|
|
245
|
+
const [isMenuOpen, setIsMenuOpen] = React3.useState(false);
|
|
246
|
+
const {
|
|
247
|
+
gridTemplateAreas,
|
|
248
|
+
heightLogo,
|
|
249
|
+
gridTemplateColumns,
|
|
250
|
+
justifySelfLogo
|
|
251
|
+
} = React3.useMemo(() => {
|
|
252
|
+
if (type === "1") {
|
|
253
|
+
return {
|
|
254
|
+
gridTemplateAreas: '"logo links cta"',
|
|
255
|
+
gridTemplateColumns: "2fr 5fr 2fr",
|
|
256
|
+
heightLogo: "42px",
|
|
257
|
+
justifySelfLogo: "unset"
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
gridTemplateAreas: '"links logo cta"',
|
|
262
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
263
|
+
heightLogo: "54px",
|
|
264
|
+
justifySelfLogo: "center"
|
|
265
|
+
};
|
|
266
|
+
}, [type]);
|
|
267
|
+
return /* @__PURE__ */ jsxs4(Fragment, {
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ jsxs4(Flex4, {
|
|
270
|
+
sx: { flexDirection: "column", display: ["flex", "none"] },
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ jsxs4(Grid2, {
|
|
273
|
+
sx: {
|
|
274
|
+
justifyContent: "space-between",
|
|
275
|
+
alignItems: "center",
|
|
276
|
+
gridTemplateColumns: "1fr 1fr 1fr"
|
|
277
|
+
},
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsx4(Icon3, {
|
|
280
|
+
sx: { cursor: "pointer", justifySelf: "start", fontSize: "3xl" },
|
|
281
|
+
onClick: () => setIsMenuOpen((prev) => !prev),
|
|
282
|
+
icon: isMenuOpen ? "ic:outline-menu-open" : "ic:outline-menu"
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ jsx4(Image4, {
|
|
285
|
+
src: logo,
|
|
286
|
+
sx: { maxWidth: "112px" }
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ jsx4(Flex4, {
|
|
289
|
+
sx: { justifyContent: "end", width: "100%", alignItems: "center" },
|
|
290
|
+
children: cta && /* @__PURE__ */ jsx4(Link2, {
|
|
291
|
+
sx: { fontSize: "xs" },
|
|
292
|
+
href: cta.href,
|
|
293
|
+
children: cta.label
|
|
294
|
+
})
|
|
295
|
+
})
|
|
296
|
+
]
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ jsx4(Collapse, {
|
|
299
|
+
isOpened: isMenuOpen,
|
|
300
|
+
initialStyle: { height: 0, overflow: "hidden" },
|
|
301
|
+
children: /* @__PURE__ */ jsx4(Flex4, {
|
|
302
|
+
sx: {
|
|
303
|
+
flexDirection: "column",
|
|
304
|
+
width: "100%",
|
|
305
|
+
gap: 3,
|
|
306
|
+
paddingY: 3,
|
|
307
|
+
paddingLeft: 3
|
|
308
|
+
},
|
|
309
|
+
children: links.map((link) => {
|
|
310
|
+
return /* @__PURE__ */ jsx4(Link2, {
|
|
311
|
+
sx: { fontSize: "xs" },
|
|
312
|
+
href: link.href,
|
|
313
|
+
children: link.label
|
|
314
|
+
}, link.label);
|
|
315
|
+
})
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ jsxs4(Grid2, {
|
|
321
|
+
sx: {
|
|
322
|
+
display: ["none", "grid"],
|
|
323
|
+
gridTemplateAreas,
|
|
324
|
+
gridTemplateColumns,
|
|
325
|
+
alignItems: "center",
|
|
326
|
+
paddingX: 6,
|
|
327
|
+
paddingY: 4
|
|
328
|
+
},
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx4(Image4, {
|
|
331
|
+
sx: {
|
|
332
|
+
gridArea: "logo",
|
|
333
|
+
height: heightLogo,
|
|
334
|
+
justifySelf: justifySelfLogo
|
|
335
|
+
},
|
|
336
|
+
src: logo
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx4(Flex4, {
|
|
339
|
+
sx: { gridArea: "links", justifyContent: "space-around" },
|
|
340
|
+
children: links.map((link) => {
|
|
341
|
+
return /* @__PURE__ */ jsx4(Link2, {
|
|
342
|
+
sx: { fontSize: "2xl" },
|
|
343
|
+
href: link.href,
|
|
344
|
+
children: link.label
|
|
345
|
+
}, link.label);
|
|
346
|
+
})
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ jsx4(Flex4, {
|
|
349
|
+
sx: { gridArea: "cta", justifyContent: "end" },
|
|
350
|
+
children: cta && /* @__PURE__ */ jsx4(Link2, {
|
|
351
|
+
href: cta.href,
|
|
352
|
+
sx: {
|
|
353
|
+
backgroundColor: "background",
|
|
354
|
+
borderColor: "text",
|
|
355
|
+
color: "text",
|
|
356
|
+
borderRadius: "10px",
|
|
357
|
+
fontSize: "base",
|
|
358
|
+
textDecorationLine: "none",
|
|
359
|
+
paddingX: 3,
|
|
360
|
+
paddingY: 2
|
|
361
|
+
},
|
|
362
|
+
as: "button",
|
|
363
|
+
children: cta.label
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
})
|
|
368
|
+
]
|
|
369
|
+
});
|
|
370
|
+
};
|
|
167
371
|
export {
|
|
372
|
+
Footer,
|
|
168
373
|
Hero,
|
|
169
|
-
HeroCarousel
|
|
374
|
+
HeroCarousel,
|
|
375
|
+
Navbar
|
|
170
376
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,35 @@ declare type HeroCarouselProps = {
|
|
|
17
17
|
};
|
|
18
18
|
declare const HeroCarousel: ({ images }: HeroCarouselProps) => JSX.Element;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
declare type FooterLink = {
|
|
21
|
+
label: string;
|
|
22
|
+
href: string;
|
|
23
|
+
};
|
|
24
|
+
declare type SocialMedia = {
|
|
25
|
+
icon: string;
|
|
26
|
+
href: string;
|
|
27
|
+
};
|
|
28
|
+
declare type FooterProps = {
|
|
29
|
+
links: FooterLink[];
|
|
30
|
+
logo: string;
|
|
31
|
+
socialMedia: SocialMedia[];
|
|
32
|
+
reserved: string;
|
|
33
|
+
};
|
|
34
|
+
declare const Footer: ({ links, logo, socialMedia, reserved }: FooterProps) => JSX.Element;
|
|
35
|
+
|
|
36
|
+
declare type NavbarLink = {
|
|
37
|
+
label: string;
|
|
38
|
+
href: string;
|
|
39
|
+
};
|
|
40
|
+
declare type NavbarProps = {
|
|
41
|
+
type?: '1' | '2';
|
|
42
|
+
logo: string;
|
|
43
|
+
cta?: {
|
|
44
|
+
label: string;
|
|
45
|
+
href: string;
|
|
46
|
+
};
|
|
47
|
+
links: NavbarLink[];
|
|
48
|
+
};
|
|
49
|
+
declare const Navbar: ({ links, logo, cta, type }: NavbarProps) => JSX.Element;
|
|
50
|
+
|
|
51
|
+
export { Footer, FooterProps, Hero, HeroCarousel, HeroCarouselProps, HeroProps, Navbar, NavbarProps };
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
var src_exports = {};
|
|
29
29
|
__export(src_exports, {
|
|
30
|
+
Footer: () => Footer,
|
|
30
31
|
Hero: () => Hero,
|
|
31
|
-
HeroCarousel: () => HeroCarousel
|
|
32
|
+
HeroCarousel: () => HeroCarousel,
|
|
33
|
+
Navbar: () => Navbar
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(src_exports);
|
|
34
36
|
|
|
@@ -196,8 +198,214 @@ var HeroCarousel = ({ images = [] }) => {
|
|
|
196
198
|
})
|
|
197
199
|
});
|
|
198
200
|
};
|
|
201
|
+
|
|
202
|
+
// src/Footer/Footer.tsx
|
|
203
|
+
var import_ui3 = require("@ttoss/ui");
|
|
204
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
205
|
+
var Footer = ({ links, logo, socialMedia, reserved }) => {
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ui3.Flex, {
|
|
207
|
+
sx: { flexDirection: "column", paddingY: "40px" },
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Image, {
|
|
210
|
+
sx: {
|
|
211
|
+
maxWidth: ["90px", "212px"],
|
|
212
|
+
alignSelf: "center",
|
|
213
|
+
marginBottom: [3, 4]
|
|
214
|
+
},
|
|
215
|
+
src: logo
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ui3.Flex, {
|
|
218
|
+
sx: {
|
|
219
|
+
flexDirection: ["column", "row"],
|
|
220
|
+
justifyContent: ["unset", "center"],
|
|
221
|
+
paddingX: 3
|
|
222
|
+
},
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Grid, {
|
|
225
|
+
sx: {
|
|
226
|
+
justifyContent: "center",
|
|
227
|
+
gridTemplateColumns: ["6fr 3fr 3fr", "1fr 1fr 1fr"]
|
|
228
|
+
},
|
|
229
|
+
children: links.map((link, idx) => {
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Link, {
|
|
231
|
+
sx: {
|
|
232
|
+
fontSize: "xs",
|
|
233
|
+
fontFamily: "body",
|
|
234
|
+
textDecorationLine: "none"
|
|
235
|
+
},
|
|
236
|
+
href: link.href,
|
|
237
|
+
children: link.label
|
|
238
|
+
}, `link-${link.label}-${idx}`);
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Flex, {
|
|
242
|
+
sx: {
|
|
243
|
+
marginTop: [3],
|
|
244
|
+
gap: [4],
|
|
245
|
+
justifyContent: "center"
|
|
246
|
+
},
|
|
247
|
+
children: socialMedia.map((social) => {
|
|
248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Link, {
|
|
249
|
+
href: social.href,
|
|
250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Icon, {
|
|
251
|
+
icon: social.icon
|
|
252
|
+
})
|
|
253
|
+
}, `social-media-${social.icon}`);
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Text, {
|
|
259
|
+
sx: {
|
|
260
|
+
fontSize: "xxs",
|
|
261
|
+
color: "gray",
|
|
262
|
+
fontFamily: "heading",
|
|
263
|
+
textAlign: "center",
|
|
264
|
+
lineHeight: "1.5",
|
|
265
|
+
marginTop: [3, 4]
|
|
266
|
+
},
|
|
267
|
+
children: reserved
|
|
268
|
+
})
|
|
269
|
+
]
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// src/Navbar/Navbar.tsx
|
|
274
|
+
var import_react_collapse = require("react-collapse");
|
|
275
|
+
var import_ui4 = require("@ttoss/ui");
|
|
276
|
+
var import_react3 = __toESM(require("react"));
|
|
277
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
278
|
+
var Navbar = ({ links, logo, cta, type = "1" }) => {
|
|
279
|
+
const [isMenuOpen, setIsMenuOpen] = import_react3.default.useState(false);
|
|
280
|
+
const {
|
|
281
|
+
gridTemplateAreas,
|
|
282
|
+
heightLogo,
|
|
283
|
+
gridTemplateColumns,
|
|
284
|
+
justifySelfLogo
|
|
285
|
+
} = import_react3.default.useMemo(() => {
|
|
286
|
+
if (type === "1") {
|
|
287
|
+
return {
|
|
288
|
+
gridTemplateAreas: '"logo links cta"',
|
|
289
|
+
gridTemplateColumns: "2fr 5fr 2fr",
|
|
290
|
+
heightLogo: "42px",
|
|
291
|
+
justifySelfLogo: "unset"
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
gridTemplateAreas: '"links logo cta"',
|
|
296
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
297
|
+
heightLogo: "54px",
|
|
298
|
+
justifySelfLogo: "center"
|
|
299
|
+
};
|
|
300
|
+
}, [type]);
|
|
301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, {
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_ui4.Flex, {
|
|
304
|
+
sx: { flexDirection: "column", display: ["flex", "none"] },
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_ui4.Grid, {
|
|
307
|
+
sx: {
|
|
308
|
+
justifyContent: "space-between",
|
|
309
|
+
alignItems: "center",
|
|
310
|
+
gridTemplateColumns: "1fr 1fr 1fr"
|
|
311
|
+
},
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Icon, {
|
|
314
|
+
sx: { cursor: "pointer", justifySelf: "start", fontSize: "3xl" },
|
|
315
|
+
onClick: () => setIsMenuOpen((prev) => !prev),
|
|
316
|
+
icon: isMenuOpen ? "ic:outline-menu-open" : "ic:outline-menu"
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Image, {
|
|
319
|
+
src: logo,
|
|
320
|
+
sx: { maxWidth: "112px" }
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
|
|
323
|
+
sx: { justifyContent: "end", width: "100%", alignItems: "center" },
|
|
324
|
+
children: cta && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Link, {
|
|
325
|
+
sx: { fontSize: "xs" },
|
|
326
|
+
href: cta.href,
|
|
327
|
+
children: cta.label
|
|
328
|
+
})
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_collapse.Collapse, {
|
|
333
|
+
isOpened: isMenuOpen,
|
|
334
|
+
initialStyle: { height: 0, overflow: "hidden" },
|
|
335
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
|
|
336
|
+
sx: {
|
|
337
|
+
flexDirection: "column",
|
|
338
|
+
width: "100%",
|
|
339
|
+
gap: 3,
|
|
340
|
+
paddingY: 3,
|
|
341
|
+
paddingLeft: 3
|
|
342
|
+
},
|
|
343
|
+
children: links.map((link) => {
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Link, {
|
|
345
|
+
sx: { fontSize: "xs" },
|
|
346
|
+
href: link.href,
|
|
347
|
+
children: link.label
|
|
348
|
+
}, link.label);
|
|
349
|
+
})
|
|
350
|
+
})
|
|
351
|
+
})
|
|
352
|
+
]
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_ui4.Grid, {
|
|
355
|
+
sx: {
|
|
356
|
+
display: ["none", "grid"],
|
|
357
|
+
gridTemplateAreas,
|
|
358
|
+
gridTemplateColumns,
|
|
359
|
+
alignItems: "center",
|
|
360
|
+
paddingX: 6,
|
|
361
|
+
paddingY: 4
|
|
362
|
+
},
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Image, {
|
|
365
|
+
sx: {
|
|
366
|
+
gridArea: "logo",
|
|
367
|
+
height: heightLogo,
|
|
368
|
+
justifySelf: justifySelfLogo
|
|
369
|
+
},
|
|
370
|
+
src: logo
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
|
|
373
|
+
sx: { gridArea: "links", justifyContent: "space-around" },
|
|
374
|
+
children: links.map((link) => {
|
|
375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Link, {
|
|
376
|
+
sx: { fontSize: "2xl" },
|
|
377
|
+
href: link.href,
|
|
378
|
+
children: link.label
|
|
379
|
+
}, link.label);
|
|
380
|
+
})
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Flex, {
|
|
383
|
+
sx: { gridArea: "cta", justifyContent: "end" },
|
|
384
|
+
children: cta && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui4.Link, {
|
|
385
|
+
href: cta.href,
|
|
386
|
+
sx: {
|
|
387
|
+
backgroundColor: "background",
|
|
388
|
+
borderColor: "text",
|
|
389
|
+
color: "text",
|
|
390
|
+
borderRadius: "10px",
|
|
391
|
+
fontSize: "base",
|
|
392
|
+
textDecorationLine: "none",
|
|
393
|
+
paddingX: 3,
|
|
394
|
+
paddingY: 2
|
|
395
|
+
},
|
|
396
|
+
as: "button",
|
|
397
|
+
children: cta.label
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
]
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
});
|
|
404
|
+
};
|
|
199
405
|
// Annotate the CommonJS export names for ESM import in node:
|
|
200
406
|
0 && (module.exports = {
|
|
407
|
+
Footer,
|
|
201
408
|
Hero,
|
|
202
|
-
HeroCarousel
|
|
409
|
+
HeroCarousel,
|
|
410
|
+
Navbar
|
|
203
411
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/landing-pages",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Package for creating landing pages.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"typings": "dist/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@iconify/react": "^4.0.0"
|
|
23
|
+
"@iconify/react": "^4.0.0",
|
|
24
|
+
"react-collapse": "^5.1.1"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"@ttoss/ui": "^1.21.0",
|
|
@@ -29,8 +30,9 @@
|
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@ttoss/config": "^1.18.3",
|
|
31
32
|
"@ttoss/test-utils": "^1.16.10",
|
|
32
|
-
"@ttoss/ui": "^1.23.
|
|
33
|
+
"@ttoss/ui": "^1.23.1",
|
|
33
34
|
"@types/jest": "^29.1.1",
|
|
35
|
+
"@types/react-collapse": "^5.0.1",
|
|
34
36
|
"jest": "^29.1.2",
|
|
35
37
|
"tsup": "^6.2.3"
|
|
36
38
|
},
|
|
@@ -41,5 +43,5 @@
|
|
|
41
43
|
"publishConfig": {
|
|
42
44
|
"access": "public"
|
|
43
45
|
},
|
|
44
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e9c6b47f9b2ff9a44358a16c9feff84ba9342346"
|
|
45
47
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Flex, Grid, Icon, Image, Link, Text } from '@ttoss/ui';
|
|
2
|
+
|
|
3
|
+
type FooterLink = {
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type SocialMedia = {
|
|
9
|
+
icon: string;
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type FooterProps = {
|
|
14
|
+
links: FooterLink[];
|
|
15
|
+
logo: string;
|
|
16
|
+
socialMedia: SocialMedia[];
|
|
17
|
+
reserved: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Footer = ({ links, logo, socialMedia, reserved }: FooterProps) => {
|
|
21
|
+
return (
|
|
22
|
+
<Flex sx={{ flexDirection: 'column', paddingY: '40px' }}>
|
|
23
|
+
<Image
|
|
24
|
+
sx={{
|
|
25
|
+
maxWidth: ['90px', '212px'],
|
|
26
|
+
alignSelf: 'center',
|
|
27
|
+
marginBottom: [3, 4],
|
|
28
|
+
}}
|
|
29
|
+
src={logo}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<Flex
|
|
33
|
+
sx={{
|
|
34
|
+
flexDirection: ['column', 'row'],
|
|
35
|
+
justifyContent: ['unset', 'center'],
|
|
36
|
+
paddingX: 3,
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Grid
|
|
40
|
+
sx={{
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
gridTemplateColumns: ['6fr 3fr 3fr', '1fr 1fr 1fr'],
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{links.map((link, idx) => {
|
|
46
|
+
return (
|
|
47
|
+
<Link
|
|
48
|
+
sx={{
|
|
49
|
+
fontSize: 'xs',
|
|
50
|
+
fontFamily: 'body',
|
|
51
|
+
textDecorationLine: 'none',
|
|
52
|
+
}}
|
|
53
|
+
key={`link-${link.label}-${idx}`}
|
|
54
|
+
href={link.href}
|
|
55
|
+
>
|
|
56
|
+
{link.label}
|
|
57
|
+
</Link>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</Grid>
|
|
61
|
+
|
|
62
|
+
<Flex
|
|
63
|
+
sx={{
|
|
64
|
+
marginTop: [3],
|
|
65
|
+
gap: [4],
|
|
66
|
+
justifyContent: 'center',
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{socialMedia.map((social) => {
|
|
70
|
+
return (
|
|
71
|
+
<Link href={social.href} key={`social-media-${social.icon}`}>
|
|
72
|
+
<Icon icon={social.icon} />
|
|
73
|
+
</Link>
|
|
74
|
+
);
|
|
75
|
+
})}
|
|
76
|
+
</Flex>
|
|
77
|
+
</Flex>
|
|
78
|
+
|
|
79
|
+
<Text
|
|
80
|
+
sx={{
|
|
81
|
+
fontSize: 'xxs',
|
|
82
|
+
color: 'gray',
|
|
83
|
+
fontFamily: 'heading',
|
|
84
|
+
textAlign: 'center',
|
|
85
|
+
lineHeight: '1.5',
|
|
86
|
+
marginTop: [3, 4],
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{reserved}
|
|
90
|
+
</Text>
|
|
91
|
+
</Flex>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Collapse } from 'react-collapse';
|
|
2
|
+
import { Flex, Grid, Icon, Image, Link } from '@ttoss/ui';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
type NavbarLink = {
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type NavbarProps = {
|
|
11
|
+
type?: '1' | '2';
|
|
12
|
+
logo: string;
|
|
13
|
+
cta?: {
|
|
14
|
+
label: string;
|
|
15
|
+
href: string;
|
|
16
|
+
};
|
|
17
|
+
links: NavbarLink[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Navbar = ({ links, logo, cta, type = '1' }: NavbarProps) => {
|
|
21
|
+
const [isMenuOpen, setIsMenuOpen] = React.useState(false);
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
gridTemplateAreas,
|
|
25
|
+
heightLogo,
|
|
26
|
+
gridTemplateColumns,
|
|
27
|
+
justifySelfLogo,
|
|
28
|
+
} = React.useMemo(() => {
|
|
29
|
+
if (type === '1') {
|
|
30
|
+
return {
|
|
31
|
+
gridTemplateAreas: '"logo links cta"',
|
|
32
|
+
gridTemplateColumns: '2fr 5fr 2fr',
|
|
33
|
+
heightLogo: '42px',
|
|
34
|
+
justifySelfLogo: 'unset',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
gridTemplateAreas: '"links logo cta"',
|
|
40
|
+
gridTemplateColumns: '1fr 1fr 1fr',
|
|
41
|
+
heightLogo: '54px',
|
|
42
|
+
justifySelfLogo: 'center',
|
|
43
|
+
};
|
|
44
|
+
}, [type]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
{/* Layout Mobile */}
|
|
49
|
+
|
|
50
|
+
<Flex sx={{ flexDirection: 'column', display: ['flex', 'none'] }}>
|
|
51
|
+
<Grid
|
|
52
|
+
sx={{
|
|
53
|
+
justifyContent: 'space-between',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
gridTemplateColumns: '1fr 1fr 1fr',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<Icon
|
|
59
|
+
sx={{ cursor: 'pointer', justifySelf: 'start', fontSize: '3xl' }}
|
|
60
|
+
onClick={() => setIsMenuOpen((prev) => !prev)}
|
|
61
|
+
icon={isMenuOpen ? 'ic:outline-menu-open' : 'ic:outline-menu'}
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<Image src={logo} sx={{ maxWidth: '112px' }} />
|
|
65
|
+
|
|
66
|
+
<Flex
|
|
67
|
+
sx={{ justifyContent: 'end', width: '100%', alignItems: 'center' }}
|
|
68
|
+
>
|
|
69
|
+
{cta && (
|
|
70
|
+
<Link sx={{ fontSize: 'xs' }} href={cta.href}>
|
|
71
|
+
{cta.label}
|
|
72
|
+
</Link>
|
|
73
|
+
)}
|
|
74
|
+
</Flex>
|
|
75
|
+
</Grid>
|
|
76
|
+
|
|
77
|
+
<Collapse
|
|
78
|
+
isOpened={isMenuOpen}
|
|
79
|
+
initialStyle={{ height: 0, overflow: 'hidden' }}
|
|
80
|
+
>
|
|
81
|
+
<Flex
|
|
82
|
+
sx={{
|
|
83
|
+
flexDirection: 'column',
|
|
84
|
+
width: '100%',
|
|
85
|
+
gap: 3,
|
|
86
|
+
paddingY: 3,
|
|
87
|
+
paddingLeft: 3,
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{links.map((link) => {
|
|
91
|
+
return (
|
|
92
|
+
<Link sx={{ fontSize: 'xs' }} key={link.label} href={link.href}>
|
|
93
|
+
{link.label}
|
|
94
|
+
</Link>
|
|
95
|
+
);
|
|
96
|
+
})}
|
|
97
|
+
</Flex>
|
|
98
|
+
</Collapse>
|
|
99
|
+
</Flex>
|
|
100
|
+
|
|
101
|
+
{/* Layout Desktop */}
|
|
102
|
+
<Grid
|
|
103
|
+
sx={{
|
|
104
|
+
display: ['none', 'grid'],
|
|
105
|
+
gridTemplateAreas,
|
|
106
|
+
gridTemplateColumns,
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
paddingX: 6,
|
|
109
|
+
paddingY: 4,
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<Image
|
|
113
|
+
sx={{
|
|
114
|
+
gridArea: 'logo',
|
|
115
|
+
height: heightLogo,
|
|
116
|
+
justifySelf: justifySelfLogo,
|
|
117
|
+
}}
|
|
118
|
+
src={logo}
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<Flex sx={{ gridArea: 'links', justifyContent: 'space-around' }}>
|
|
122
|
+
{links.map((link) => {
|
|
123
|
+
return (
|
|
124
|
+
<Link sx={{ fontSize: '2xl' }} key={link.label} href={link.href}>
|
|
125
|
+
{link.label}
|
|
126
|
+
</Link>
|
|
127
|
+
);
|
|
128
|
+
})}
|
|
129
|
+
</Flex>
|
|
130
|
+
|
|
131
|
+
<Flex sx={{ gridArea: 'cta', justifyContent: 'end' }}>
|
|
132
|
+
{cta && (
|
|
133
|
+
<Link
|
|
134
|
+
href={cta.href}
|
|
135
|
+
sx={{
|
|
136
|
+
backgroundColor: 'background',
|
|
137
|
+
borderColor: 'text',
|
|
138
|
+
color: 'text',
|
|
139
|
+
borderRadius: '10px',
|
|
140
|
+
fontSize: 'base',
|
|
141
|
+
textDecorationLine: 'none',
|
|
142
|
+
paddingX: 3,
|
|
143
|
+
paddingY: 2,
|
|
144
|
+
}}
|
|
145
|
+
as="button"
|
|
146
|
+
>
|
|
147
|
+
{cta.label}
|
|
148
|
+
</Link>
|
|
149
|
+
)}
|
|
150
|
+
</Flex>
|
|
151
|
+
</Grid>
|
|
152
|
+
</>
|
|
153
|
+
);
|
|
154
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export { Hero, HeroProps } from './Hero/Hero';
|
|
2
|
-
export {
|
|
1
|
+
export { Hero, type HeroProps } from './Hero/Hero';
|
|
2
|
+
export {
|
|
3
|
+
HeroCarousel,
|
|
4
|
+
type HeroCarouselProps,
|
|
5
|
+
} from './HeroCarousel/HeroCarousel';
|
|
6
|
+
export { Footer, type FooterProps } from './Footer/Footer';
|
|
7
|
+
export { Navbar, type NavbarProps } from './Navbar/Navbar';
|