@weaverse/react 0.7.31 → 0.7.32
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/index.d.ts +6 -1
- package/dist/index.js +36 -23
- package/dist/index.mjs +36 -23
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -90,8 +90,13 @@ interface BackgroundDataProps {
|
|
|
90
90
|
backgroundImage?: string;
|
|
91
91
|
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
92
92
|
}
|
|
93
|
-
interface LayoutElementProps extends BackgroundDataProps,
|
|
93
|
+
interface LayoutElementProps extends BackgroundDataProps, WeaverseElementProps {
|
|
94
|
+
contentSize: number;
|
|
94
95
|
gridSize: number;
|
|
96
|
+
rows: number;
|
|
97
|
+
columns: number;
|
|
98
|
+
gap: number;
|
|
99
|
+
rowSize: number;
|
|
95
100
|
}
|
|
96
101
|
interface LayoutBackgroundProps {
|
|
97
102
|
imgUrl?: string;
|
package/dist/index.js
CHANGED
|
@@ -64,20 +64,26 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
64
64
|
});
|
|
65
65
|
Button.defaultProps = {
|
|
66
66
|
type: "button",
|
|
67
|
-
text: "
|
|
67
|
+
text: "Button",
|
|
68
68
|
clickAction: "none",
|
|
69
69
|
linkTo: "",
|
|
70
70
|
openInNewTab: false
|
|
71
71
|
};
|
|
72
72
|
var css = {
|
|
73
73
|
"@desktop": {
|
|
74
|
-
borderRadius: "
|
|
74
|
+
borderRadius: "8px",
|
|
75
75
|
border: "none",
|
|
76
76
|
backgroundColor: "#393e46",
|
|
77
77
|
color: "#fff",
|
|
78
|
-
fontSize: "
|
|
78
|
+
fontSize: "14px",
|
|
79
|
+
fontWeight: "medium",
|
|
79
80
|
padding: "10px 20px",
|
|
80
|
-
|
|
81
|
+
height: "42px",
|
|
82
|
+
minWidth: "120px",
|
|
83
|
+
textDecoration: "none",
|
|
84
|
+
":hover": {
|
|
85
|
+
backgroundColor: "#222831"
|
|
86
|
+
}
|
|
81
87
|
}
|
|
82
88
|
};
|
|
83
89
|
var Button_default = Button;
|
|
@@ -340,6 +346,7 @@ var Image = import_react5.default.forwardRef(
|
|
|
340
346
|
);
|
|
341
347
|
var css4 = {
|
|
342
348
|
"@desktop": {
|
|
349
|
+
display: "flex",
|
|
343
350
|
overflow: "hidden",
|
|
344
351
|
img: {
|
|
345
352
|
width: "100%",
|
|
@@ -372,6 +379,7 @@ var Layout = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
372
379
|
gap,
|
|
373
380
|
rowSize,
|
|
374
381
|
columns,
|
|
382
|
+
contentSize,
|
|
375
383
|
gridSize,
|
|
376
384
|
backgroundColor,
|
|
377
385
|
backgroundImage,
|
|
@@ -379,6 +387,8 @@ var Layout = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
379
387
|
...rest
|
|
380
388
|
} = props;
|
|
381
389
|
let style = {
|
|
390
|
+
"--layout-content-width": "100vw",
|
|
391
|
+
"--content-size": contentSize + "px",
|
|
382
392
|
"--grid-size": gridSize + "px",
|
|
383
393
|
"--rows": rows,
|
|
384
394
|
"--columns": columns,
|
|
@@ -404,42 +414,44 @@ var LayoutBackground = (props) => {
|
|
|
404
414
|
["--bg-color"]: bgColor,
|
|
405
415
|
["--object-fit"]: objectFit
|
|
406
416
|
};
|
|
407
|
-
|
|
408
|
-
"
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
417
|
+
if (imgUrl || bgColor) {
|
|
418
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
419
|
+
style,
|
|
420
|
+
className: "wv-layout-background"
|
|
421
|
+
}, imgUrl && /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
422
|
+
width: "100%",
|
|
423
|
+
height: "100%",
|
|
424
|
+
"data-blink-src": imgUrl,
|
|
425
|
+
alt: "Section background"
|
|
426
|
+
}));
|
|
427
|
+
}
|
|
428
|
+
return null;
|
|
416
429
|
};
|
|
417
430
|
var css5 = {
|
|
418
431
|
"@desktop": {
|
|
419
|
-
paddingTop: "16px",
|
|
420
|
-
paddingBottom: "16px",
|
|
421
|
-
paddingLeft: "var(--gap)",
|
|
422
|
-
paddingRight: "var(--gap)",
|
|
423
432
|
"> [data-layout-content]": {
|
|
433
|
+
paddingTop: "var(--gap)",
|
|
434
|
+
paddingBottom: "var(--gap)",
|
|
424
435
|
margin: "0 auto",
|
|
425
|
-
display: "grid
|
|
436
|
+
display: "grid",
|
|
426
437
|
gridTemplateRows: "repeat(var(--rows), var(--row-size))",
|
|
427
|
-
gridTemplateColumns: "repeat(var(--columns), minmax(0, var(--col-size)))",
|
|
438
|
+
gridTemplateColumns: "calc((var(--layout-content-width) - var(--content-size)) / 2) 1fr repeat(var(--columns), minmax(0, var(--col-size))) 1fr calc((var(--layout-content-width) - var(--content-size)) / 2)",
|
|
439
|
+
gridAutoRows: "var(--row-size)",
|
|
428
440
|
gap: "var(--gap)",
|
|
429
|
-
maxWidth: "var(--
|
|
441
|
+
maxWidth: "var(--layout-content-width)"
|
|
430
442
|
}
|
|
431
443
|
},
|
|
432
444
|
"@mobile": {
|
|
433
445
|
padding: "0 16px",
|
|
434
446
|
"> [data-layout-content]": {
|
|
435
|
-
display: "flex
|
|
447
|
+
display: "flex",
|
|
436
448
|
flexDirection: "column"
|
|
437
449
|
}
|
|
438
450
|
}
|
|
439
451
|
};
|
|
440
452
|
var permanentCss = {
|
|
441
453
|
"@desktop": {
|
|
442
|
-
"
|
|
454
|
+
".wv-layout-background": {
|
|
443
455
|
position: "absolute",
|
|
444
456
|
inset: 0,
|
|
445
457
|
backgroundColor: "var(--bg-color)"
|
|
@@ -450,8 +462,9 @@ var permanentCss = {
|
|
|
450
462
|
}
|
|
451
463
|
};
|
|
452
464
|
Layout.defaultProps = {
|
|
465
|
+
contentSize: 1600,
|
|
453
466
|
gridSize: 1224,
|
|
454
|
-
rows:
|
|
467
|
+
rows: 16,
|
|
455
468
|
columns: 12,
|
|
456
469
|
gap: 16,
|
|
457
470
|
rowSize: 48
|
package/dist/index.mjs
CHANGED
|
@@ -33,20 +33,26 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
33
33
|
});
|
|
34
34
|
Button.defaultProps = {
|
|
35
35
|
type: "button",
|
|
36
|
-
text: "
|
|
36
|
+
text: "Button",
|
|
37
37
|
clickAction: "none",
|
|
38
38
|
linkTo: "",
|
|
39
39
|
openInNewTab: false
|
|
40
40
|
};
|
|
41
41
|
var css = {
|
|
42
42
|
"@desktop": {
|
|
43
|
-
borderRadius: "
|
|
43
|
+
borderRadius: "8px",
|
|
44
44
|
border: "none",
|
|
45
45
|
backgroundColor: "#393e46",
|
|
46
46
|
color: "#fff",
|
|
47
|
-
fontSize: "
|
|
47
|
+
fontSize: "14px",
|
|
48
|
+
fontWeight: "medium",
|
|
48
49
|
padding: "10px 20px",
|
|
49
|
-
|
|
50
|
+
height: "42px",
|
|
51
|
+
minWidth: "120px",
|
|
52
|
+
textDecoration: "none",
|
|
53
|
+
":hover": {
|
|
54
|
+
backgroundColor: "#222831"
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
};
|
|
52
58
|
var Button_default = Button;
|
|
@@ -309,6 +315,7 @@ var Image = React5.forwardRef(
|
|
|
309
315
|
);
|
|
310
316
|
var css4 = {
|
|
311
317
|
"@desktop": {
|
|
318
|
+
display: "flex",
|
|
312
319
|
overflow: "hidden",
|
|
313
320
|
img: {
|
|
314
321
|
width: "100%",
|
|
@@ -341,6 +348,7 @@ var Layout = forwardRef4((props, ref) => {
|
|
|
341
348
|
gap,
|
|
342
349
|
rowSize,
|
|
343
350
|
columns,
|
|
351
|
+
contentSize,
|
|
344
352
|
gridSize,
|
|
345
353
|
backgroundColor,
|
|
346
354
|
backgroundImage,
|
|
@@ -348,6 +356,8 @@ var Layout = forwardRef4((props, ref) => {
|
|
|
348
356
|
...rest
|
|
349
357
|
} = props;
|
|
350
358
|
let style = {
|
|
359
|
+
"--layout-content-width": "100vw",
|
|
360
|
+
"--content-size": contentSize + "px",
|
|
351
361
|
"--grid-size": gridSize + "px",
|
|
352
362
|
"--rows": rows,
|
|
353
363
|
"--columns": columns,
|
|
@@ -373,42 +383,44 @@ var LayoutBackground = (props) => {
|
|
|
373
383
|
["--bg-color"]: bgColor,
|
|
374
384
|
["--object-fit"]: objectFit
|
|
375
385
|
};
|
|
376
|
-
|
|
377
|
-
"
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
386
|
+
if (imgUrl || bgColor) {
|
|
387
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
388
|
+
style,
|
|
389
|
+
className: "wv-layout-background"
|
|
390
|
+
}, imgUrl && /* @__PURE__ */ React6.createElement("img", {
|
|
391
|
+
width: "100%",
|
|
392
|
+
height: "100%",
|
|
393
|
+
"data-blink-src": imgUrl,
|
|
394
|
+
alt: "Section background"
|
|
395
|
+
}));
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
385
398
|
};
|
|
386
399
|
var css5 = {
|
|
387
400
|
"@desktop": {
|
|
388
|
-
paddingTop: "16px",
|
|
389
|
-
paddingBottom: "16px",
|
|
390
|
-
paddingLeft: "var(--gap)",
|
|
391
|
-
paddingRight: "var(--gap)",
|
|
392
401
|
"> [data-layout-content]": {
|
|
402
|
+
paddingTop: "var(--gap)",
|
|
403
|
+
paddingBottom: "var(--gap)",
|
|
393
404
|
margin: "0 auto",
|
|
394
|
-
display: "grid
|
|
405
|
+
display: "grid",
|
|
395
406
|
gridTemplateRows: "repeat(var(--rows), var(--row-size))",
|
|
396
|
-
gridTemplateColumns: "repeat(var(--columns), minmax(0, var(--col-size)))",
|
|
407
|
+
gridTemplateColumns: "calc((var(--layout-content-width) - var(--content-size)) / 2) 1fr repeat(var(--columns), minmax(0, var(--col-size))) 1fr calc((var(--layout-content-width) - var(--content-size)) / 2)",
|
|
408
|
+
gridAutoRows: "var(--row-size)",
|
|
397
409
|
gap: "var(--gap)",
|
|
398
|
-
maxWidth: "var(--
|
|
410
|
+
maxWidth: "var(--layout-content-width)"
|
|
399
411
|
}
|
|
400
412
|
},
|
|
401
413
|
"@mobile": {
|
|
402
414
|
padding: "0 16px",
|
|
403
415
|
"> [data-layout-content]": {
|
|
404
|
-
display: "flex
|
|
416
|
+
display: "flex",
|
|
405
417
|
flexDirection: "column"
|
|
406
418
|
}
|
|
407
419
|
}
|
|
408
420
|
};
|
|
409
421
|
var permanentCss = {
|
|
410
422
|
"@desktop": {
|
|
411
|
-
"
|
|
423
|
+
".wv-layout-background": {
|
|
412
424
|
position: "absolute",
|
|
413
425
|
inset: 0,
|
|
414
426
|
backgroundColor: "var(--bg-color)"
|
|
@@ -419,8 +431,9 @@ var permanentCss = {
|
|
|
419
431
|
}
|
|
420
432
|
};
|
|
421
433
|
Layout.defaultProps = {
|
|
434
|
+
contentSize: 1600,
|
|
422
435
|
gridSize: 1224,
|
|
423
|
-
rows:
|
|
436
|
+
rows: 16,
|
|
424
437
|
columns: 12,
|
|
425
438
|
gap: 16,
|
|
426
439
|
rowSize: 48
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.32",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@radix-ui/react-dialog": "^1.0.2",
|
|
35
35
|
"@stitches/react": "^1.2.8",
|
|
36
|
-
"@weaverse/core": "0.7.
|
|
36
|
+
"@weaverse/core": "0.7.32",
|
|
37
37
|
"nuka-carousel": "^5.4.1"
|
|
38
38
|
}
|
|
39
39
|
}
|