@treely/strapi-slices 5.2.2 → 5.2.4

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": "@treely/strapi-slices",
3
- "version": "5.2.2",
3
+ "version": "5.2.4",
4
4
  "license": "MIT",
5
5
  "author": "Tree.ly GmbH",
6
6
  "description": "@treely/strapi-slices is a open source library maintained by Tree.ly.",
@@ -31,76 +31,91 @@ export interface IconGridProps {
31
31
  };
32
32
  }
33
33
 
34
- export const IconGrid: React.FC<IconGridProps> = ({ slice }: IconGridProps) => (
35
- <DefaultSectionContainer>
36
- <Wrapper>
37
- {slice.title ? (
38
- <>
39
- <Flex alignItems="center" flexDirection="column">
40
- <DefaultSectionHeader
41
- tagline={slice.tagline}
42
- title={slice.title}
43
- text={slice.subTitle}
44
- taglineProps={{ maxW: '2xl', textAlign: 'center' }}
45
- titleProps={{ maxW: '3xl', textAlign: 'center' }}
46
- textProps={{ maxW: '3xl', textAlign: 'center' }}
47
- />
48
- </Flex>
49
- <Spacer h="20" />
50
- </>
51
- ) : (
52
- <></>
53
- )}
34
+ export const IconGrid: React.FC<IconGridProps> = ({ slice }: IconGridProps) => {
35
+ const columns = () => {
36
+ if (slice.iconsWithTextAndButton.length === 2) {
37
+ return [1, null, null, 2, 2];
38
+ }
39
+ if (slice.iconsWithTextAndButton.length === 1) {
40
+ return 1;
41
+ }
42
+ return [1, null, null, 2, 3];
43
+ };
44
+
45
+ return (
46
+ <DefaultSectionContainer>
47
+ <Wrapper>
48
+ {slice.title ? (
49
+ <>
50
+ <Flex alignItems="center" flexDirection="column">
51
+ <DefaultSectionHeader
52
+ tagline={slice.tagline}
53
+ title={slice.title}
54
+ text={slice.subTitle}
55
+ taglineProps={{ maxW: '2xl', textAlign: 'center' }}
56
+ titleProps={{ maxW: '3xl', textAlign: 'center' }}
57
+ textProps={{ maxW: '3xl', textAlign: 'center' }}
58
+ />
59
+ </Flex>
60
+ <Spacer h="20" />
61
+ </>
62
+ ) : (
63
+ <></>
64
+ )}
54
65
 
55
- <SimpleGrid
56
- columns={[1, null, null, 2, 3]}
57
- gap="16"
58
- rowGap={['16', null, null, '20']}
59
- >
60
- {slice.iconsWithTextAndButton.map((iconWithTextAndButton) => (
61
- <Box key={iconWithTextAndButton.id}>
62
- <Box
63
- margin="0 auto"
64
- backgroundColor="primary.50"
65
- borderRadius="full"
66
- display="flex"
67
- alignItems="center"
68
- justifyContent="space-around"
69
- width="6.5rem"
70
- height="6.5rem"
71
- >
72
- <Box position="absolute" width="12" height="12">
73
- <Image
74
- src={strapiMediaUrl(iconWithTextAndButton.icon.img, 'xSmall')}
75
- alt={iconWithTextAndButton.icon.alt}
76
- fill
77
- style={{
78
- objectFit:
79
- iconWithTextAndButton.icon.objectFit || 'contain',
80
- }}
81
- />
66
+ <SimpleGrid
67
+ columns={columns()}
68
+ gap={slice.iconsWithTextAndButton.length === 2 ? '14' : '16'}
69
+ rowGap={['16', null, null, '20']}
70
+ >
71
+ {slice.iconsWithTextAndButton.map((iconWithTextAndButton) => (
72
+ <Box key={iconWithTextAndButton.id}>
73
+ <Box
74
+ margin="0 auto"
75
+ backgroundColor="primary.50"
76
+ borderRadius="full"
77
+ display="flex"
78
+ alignItems="center"
79
+ justifyContent="space-around"
80
+ width="6.5rem"
81
+ height="6.5rem"
82
+ >
83
+ <Box position="absolute" width="12" height="12">
84
+ <Image
85
+ src={strapiMediaUrl(
86
+ iconWithTextAndButton.icon.img,
87
+ 'xSmall'
88
+ )}
89
+ alt={iconWithTextAndButton.icon.alt}
90
+ fill
91
+ style={{
92
+ objectFit:
93
+ iconWithTextAndButton.icon.objectFit || 'contain',
94
+ }}
95
+ />
96
+ </Box>
82
97
  </Box>
98
+ <Heading size="xl" textAlign="center" mb="4" mt="8">
99
+ {iconWithTextAndButton.title}
100
+ </Heading>
101
+ <Text size="mdRegularNormal" textAlign="center">
102
+ {iconWithTextAndButton.text}
103
+ </Text>
104
+ {iconWithTextAndButton.button && (
105
+ <Box textAlign="center">
106
+ <StrapiLinkButton
107
+ key={iconWithTextAndButton.button.id}
108
+ mt="8"
109
+ size="md"
110
+ variant="outline"
111
+ link={iconWithTextAndButton.button}
112
+ />
113
+ </Box>
114
+ )}
83
115
  </Box>
84
- <Heading size="xl" textAlign="center" mb="4" mt="8">
85
- {iconWithTextAndButton.title}
86
- </Heading>
87
- <Text size="mdRegularNormal" textAlign="center">
88
- {iconWithTextAndButton.text}
89
- </Text>
90
- {iconWithTextAndButton.button && (
91
- <Box textAlign="center">
92
- <StrapiLinkButton
93
- key={iconWithTextAndButton.button.id}
94
- mt="8"
95
- size="md"
96
- variant="outline"
97
- link={iconWithTextAndButton.button}
98
- />
99
- </Box>
100
- )}
101
- </Box>
102
- ))}
103
- </SimpleGrid>
104
- </Wrapper>
105
- </DefaultSectionContainer>
106
- );
116
+ ))}
117
+ </SimpleGrid>
118
+ </Wrapper>
119
+ </DefaultSectionContainer>
120
+ );
121
+ };
@@ -124,7 +124,7 @@ export const TextCarousel: React.FC<TextCarouselProps> = ({
124
124
  })}
125
125
  icon={<ArrowLeft size={16} />}
126
126
  pointerEvents="auto"
127
- boxShadow="sm"
127
+ boxShadow="md"
128
128
  />
129
129
  )}
130
130
  </AnimatePresence>