@treely/strapi-slices 5.8.1 → 5.10.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/dist/components/PreviewAlert/PreviewAlert.d.ts +2 -0
- package/dist/components/PreviewAlert/PreviewAlert.stories.d.ts +3 -0
- package/dist/components/PreviewAlert/index.d.ts +1 -0
- package/dist/components/portfolio/SmallCheckout/SmallCheckout.d.ts +2 -1
- package/dist/components/portfolio/SmallCheckout/messages.de.d.ts +2 -0
- package/dist/components/portfolio/SmallCheckout/messages.en.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/rootMessages.de.d.ts +2 -0
- package/dist/rootMessages.en.d.ts +2 -0
- package/dist/slices/Hero/Hero.d.ts +2 -2
- package/dist/slices/IconGrid/IconGrid.d.ts +2 -2
- package/dist/slices/ProjectFacts/ProjectFacts.d.ts +1 -0
- package/dist/strapi-slices.cjs.development.js +41 -4
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +42 -6
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/PreviewAlert/PreviewAlert.stories.tsx +12 -0
- package/src/components/PreviewAlert/PreviewAlert.test.tsx +15 -0
- package/src/components/PreviewAlert/PreviewAlert.tsx +10 -0
- package/src/components/PreviewAlert/index.ts +1 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx +7 -0
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +31 -2
- package/src/components/portfolio/SmallCheckout/messages.de.ts +4 -0
- package/src/components/portfolio/SmallCheckout/messages.en.ts +3 -0
- package/src/index.tsx +1 -0
- package/src/slices/Hero/Hero.tsx +1 -1
- package/src/slices/IconGrid/IconGrid.tsx +1 -1
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +1 -0
- package/src/slices/ProjectFacts/ProjectFacts.tsx +2 -0
|
@@ -2,8 +2,8 @@ import axios from 'axios';
|
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { setupCache } from 'axios-cache-interceptor';
|
|
4
4
|
import React, { useState, useRef, useMemo, useCallback, useEffect, Fragment, createRef, createContext, useContext } from 'react';
|
|
5
|
+
import { Box, BoemlyAlert, BoemlyModal, Flex, IconButton, useMediaQuery, DefaultSectionContainer, Wrapper, DefaultSectionHeader, Button, Gradient, Spacer, SimpleGrid, Heading, Text, useToken, Grid, GridItem, BoemlyList, PortfolioCard, RichText, BoemlyAccordion, HeroCard, Shape, QuoteCard, Center, ShapesCard, TextCardWithIcon, ContactArea, ProjectCard, Tag, Link as Link$1, DatePersonPair, BoemlyThemeProvider, Badge, useDisclosure, Container, AvatarWithName, Divider, LabelNumberPair, BoemlyFormControl, InputRightAddon, LabelTextPair } from 'boemly';
|
|
5
6
|
import Head from 'next/head';
|
|
6
|
-
import { Box, BoemlyModal, Flex, IconButton, useMediaQuery, DefaultSectionContainer, Wrapper, DefaultSectionHeader, Button, Gradient, Spacer, SimpleGrid, Heading, Text, useToken, Grid, GridItem, BoemlyList, PortfolioCard, RichText, BoemlyAccordion, HeroCard, Shape, QuoteCard, Center, ShapesCard, TextCardWithIcon, ContactArea, ProjectCard, Tag, Link as Link$1, DatePersonPair, BoemlyThemeProvider, Badge, useDisclosure, Container, AvatarWithName, Divider, LabelNumberPair, BoemlyFormControl, InputRightAddon, LabelTextPair } from 'boemly';
|
|
7
7
|
import Image from 'next/image';
|
|
8
8
|
import { useLockBodyScroll, useKey, useWindowScroll, useWindowSize, useMeasure, useCopyToClipboard } from 'react-use';
|
|
9
9
|
import { CaretLeft, CaretRight, Globe, ArrowRight, ArrowLeft, MapPin, Check, Link as Link$2, FilePdf, DownloadSimple, X } from '@phosphor-icons/react';
|
|
@@ -13,7 +13,7 @@ import { useRouter } from 'next/router';
|
|
|
13
13
|
import styled from '@emotion/styled';
|
|
14
14
|
import { css, Global } from '@emotion/react';
|
|
15
15
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
16
|
-
import { createIntl, createIntlCache, IntlProvider, IntlContext as IntlContext$1
|
|
16
|
+
import { createIntl, createIntlCache, IntlProvider, FormattedMessage, IntlContext as IntlContext$1 } from 'react-intl';
|
|
17
17
|
import mapboxgl, { Map, Marker } from 'mapbox-gl';
|
|
18
18
|
import { createRoot } from 'react-dom/client';
|
|
19
19
|
import { Formik, Form, Field } from 'formik';
|
|
@@ -741,6 +741,17 @@ var strapiLinkUrl = function strapiLinkUrl(strapiLink) {
|
|
|
741
741
|
return ((_strapiLink2 = strapiLink) == null ? void 0 : _strapiLink2.url) || '/';
|
|
742
742
|
};
|
|
743
743
|
|
|
744
|
+
var PreviewAlert = function PreviewAlert() {
|
|
745
|
+
return React.createElement(Box, {
|
|
746
|
+
position: "fixed",
|
|
747
|
+
top: "4",
|
|
748
|
+
left: "4"
|
|
749
|
+
}, React.createElement(BoemlyAlert, {
|
|
750
|
+
text: "Preview",
|
|
751
|
+
status: "error"
|
|
752
|
+
}));
|
|
753
|
+
};
|
|
754
|
+
|
|
744
755
|
var SEOTags = function SEOTags(_ref) {
|
|
745
756
|
var _shareImage$url, _shareImage$alt;
|
|
746
757
|
var title = _ref.title,
|
|
@@ -2210,6 +2221,8 @@ var messagesDe$5 = {
|
|
|
2210
2221
|
};
|
|
2211
2222
|
|
|
2212
2223
|
var messagesDe$4 = {
|
|
2224
|
+
'portfolio.smallCheckout.price.taxNotIncluded': 'ohne Steuern',
|
|
2225
|
+
'portfolio.smallCheckout.price.taxIncluded': 'Preis inklusive Steuern: {number}',
|
|
2213
2226
|
'portfolio.smallCheckout.contributionValueCurrency.label.CHF': 'Geben Sie den Beitrag in Fr. ein',
|
|
2214
2227
|
'portfolio.smallCheckout.contributionValueCurrency.label.EUR': 'Geben Sie den Beitrag in € ein',
|
|
2215
2228
|
'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': '€',
|
|
@@ -2325,6 +2338,8 @@ var messagesEn$3 = {
|
|
|
2325
2338
|
};
|
|
2326
2339
|
|
|
2327
2340
|
var messagesEn$2 = {
|
|
2341
|
+
'portfolio.smallCheckout.price.taxNotIncluded': 'not including tax',
|
|
2342
|
+
'portfolio.smallCheckout.price.taxIncluded': 'Price including tax: {number}',
|
|
2328
2343
|
'portfolio.smallCheckout.contributionValueCurrency.label.CHF': 'Contribution Amount in CHF',
|
|
2329
2344
|
'portfolio.smallCheckout.contributionValueCurrency.label.EUR': 'Contribution Amount in €',
|
|
2330
2345
|
'portfolio.smallCheckout.contributionValueCurrency.unit.EUR': '€',
|
|
@@ -4315,6 +4330,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4315
4330
|
currency = _ref.currency,
|
|
4316
4331
|
batchId = _ref.batchId,
|
|
4317
4332
|
initialContributionValue = _ref.initialContributionValue,
|
|
4333
|
+
taxInPercent = _ref.taxInPercent,
|
|
4318
4334
|
checkoutText = _ref.checkoutText,
|
|
4319
4335
|
title = _ref.title,
|
|
4320
4336
|
subtitle = _ref.subtitle,
|
|
@@ -4325,6 +4341,9 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4325
4341
|
locale = _useContext.locale;
|
|
4326
4342
|
var _useRouter = useRouter(),
|
|
4327
4343
|
push = _useRouter.push;
|
|
4344
|
+
var _useState = useState(initialContributionValue),
|
|
4345
|
+
contributionValue = _useState[0],
|
|
4346
|
+
setContributionValue = _useState[1];
|
|
4328
4347
|
var validateForm = useCallback(function (values) {
|
|
4329
4348
|
var errors = {};
|
|
4330
4349
|
var value = parseInt(values.contributionValueCurrency);
|
|
@@ -4374,7 +4393,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4374
4393
|
padding: "6",
|
|
4375
4394
|
direction: "column"
|
|
4376
4395
|
}, React.createElement(Flex, {
|
|
4377
|
-
gap: "
|
|
4396
|
+
gap: "2",
|
|
4378
4397
|
alignItems: "end",
|
|
4379
4398
|
mb: "6"
|
|
4380
4399
|
}, React.createElement(Text, {
|
|
@@ -4392,6 +4411,10 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4392
4411
|
currency: currency,
|
|
4393
4412
|
maximumFractionDigits: 0
|
|
4394
4413
|
}))
|
|
4414
|
+
})), React.createElement(Text, {
|
|
4415
|
+
size: "smLowNormal"
|
|
4416
|
+
}, React.createElement(FormattedMessage, {
|
|
4417
|
+
id: "portfolio.smallCheckout.price.taxNotIncluded"
|
|
4395
4418
|
}))), React.createElement(Formik, {
|
|
4396
4419
|
initialValues: {
|
|
4397
4420
|
contributionValueCurrency: initialContributionValue.toString(),
|
|
@@ -4422,6 +4445,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4422
4445
|
value: field.value || '',
|
|
4423
4446
|
onChange: function onChange(e) {
|
|
4424
4447
|
var value = e.target.valueAsNumber;
|
|
4448
|
+
setContributionValue(value);
|
|
4425
4449
|
setValues({
|
|
4426
4450
|
contributionValueCurrency: value.toString(),
|
|
4427
4451
|
contributionValueKgs: (value / pricePerKg / 1000).toString()
|
|
@@ -4468,7 +4492,18 @@ var SmallCheckout = function SmallCheckout(_ref) {
|
|
|
4468
4492
|
isInvalid: !!errors.contributionValueKgs && touched.contributionValueKgs,
|
|
4469
4493
|
errorMessage: errors.contributionValueKgs
|
|
4470
4494
|
});
|
|
4471
|
-
}))), React.createElement(
|
|
4495
|
+
}))), contributionValue > 0 && taxInPercent && taxInPercent > 0 && React.createElement(Text, {
|
|
4496
|
+
size: "smLowNormal",
|
|
4497
|
+
mt: "2"
|
|
4498
|
+
}, formatMessage({
|
|
4499
|
+
id: 'portfolio.smallCheckout.price.taxIncluded'
|
|
4500
|
+
}, {
|
|
4501
|
+
number: formatNumber(contributionValue + contributionValue * taxInPercent / 100, {
|
|
4502
|
+
style: 'currency',
|
|
4503
|
+
currency: currency,
|
|
4504
|
+
maximumFractionDigits: 2
|
|
4505
|
+
})
|
|
4506
|
+
})), React.createElement(Spacer, {
|
|
4472
4507
|
height: "4"
|
|
4473
4508
|
}), React.createElement(Button, {
|
|
4474
4509
|
type: "submit",
|
|
@@ -4786,7 +4821,8 @@ var ProjectFacts = function ProjectFacts(_ref) {
|
|
|
4786
4821
|
pricePerKg: slice.pricePerKg,
|
|
4787
4822
|
title: slice.customTitle,
|
|
4788
4823
|
subtitle: slice.customSubtitle,
|
|
4789
|
-
button: slice.customButton
|
|
4824
|
+
button: slice.customButton,
|
|
4825
|
+
taxInPercent: slice.taxInPercent
|
|
4790
4826
|
}) : (slice.contactTitle || slice.contactText || slice.contactButton || slice.contactAvatar) && React.createElement(Contact, {
|
|
4791
4827
|
title: slice.contactTitle,
|
|
4792
4828
|
text: slice.contactText,
|
|
@@ -5566,5 +5602,5 @@ var SliceRenderer = function SliceRenderer(_ref) {
|
|
|
5566
5602
|
}));
|
|
5567
5603
|
};
|
|
5568
5604
|
|
|
5569
|
-
export { SEOTags, SliceRenderer, getPortfolioProjects, getStaticPathsFromStrapi, getStaticPropsFromStrapi, mergeGlobalAndStrapiBlogPostData, mergeGlobalAndStrapiCustomerStoryData, mergeGlobalAndStrapiPageData, mergeGlobalAndStrapiProject as mergeGlobalAndStrapiProjectData, strapiLinkUrl, strapiMediaUrl };
|
|
5605
|
+
export { PreviewAlert, SEOTags, SliceRenderer, getPortfolioProjects, getStaticPathsFromStrapi, getStaticPropsFromStrapi, mergeGlobalAndStrapiBlogPostData, mergeGlobalAndStrapiCustomerStoryData, mergeGlobalAndStrapiPageData, mergeGlobalAndStrapiProject as mergeGlobalAndStrapiProjectData, strapiLinkUrl, strapiMediaUrl };
|
|
5570
5606
|
//# sourceMappingURL=strapi-slices.esm.js.map
|