@4alldigital/foundation-ui--core 3.9.0 → 3.11.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/package.json +5 -2
- package/src/components/Accordion/Accordion.tsx +3 -1
- package/src/components/AddressForm/AddressForm.tsx +4 -1
- package/src/components/AnimationCounter/AnimationCounter.tsx +3 -1
- package/src/components/AnimationSet1/AnimationSet1.tsx +3 -1
- package/src/components/Authenticator/Authenticator.tsx +2 -0
- package/src/components/Avatar/Avatar.tsx +2 -0
- package/src/components/Banner/Banner.tsx +1 -1
- package/src/components/Blockquote/Blockquote.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -2
- package/src/components/ButtonDeprecated/Button.tsx +3 -1
- package/src/components/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/components/Card/Card.types.ts +3 -3
- package/src/components/Card/types/CardBasic/CardBasic.tsx +44 -133
- package/src/components/Card/types/CardData/CardData.tsx +3 -1
- package/src/components/Card/types/CardHorz/CardHorz.tsx +3 -1
- package/src/components/Card/types/CardIcon/CardIcon.tsx +3 -1
- package/src/components/Card/types/CardMedia/CardMedia.tsx +3 -1
- package/src/components/Card/types/CardVideo/CardVideo.tsx +3 -1
- package/src/components/Carousel/Carousel.tsx +3 -1
- package/src/components/Cart/Cart.tsx +15 -5
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Chip/Chip.tsx +3 -1
- package/src/components/Collapsible/Collapsible.tsx +1 -1
- package/src/components/Container/Container.tsx +1 -1
- package/src/components/ContentPageLayout/ContentPageLayout.tsx +1 -1
- package/src/components/ContentRowsLayout/ContentRowsLayout.tsx +1 -1
- package/src/components/Copy/Copy.tsx +1 -1
- package/src/components/DisplayHeading/DisplayHeading.tsx +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +44 -0
- package/src/components/ErrorBoundary/ErrorBoundary.types.ts +12 -0
- package/src/components/ErrorBoundary/index.ts +2 -0
- package/src/components/FileUpload/FileUpload.tsx +3 -1
- package/src/components/Footer/Footer.tsx +3 -1
- package/src/components/Form/Form.tsx +10 -4
- package/src/components/Form/Form.types.ts +4 -3
- package/src/components/FormField/FormField.tsx +12 -10
- package/src/components/FormSelect/FormSelect.tsx +2 -2
- package/src/components/FormSelect/FormSelect.types.ts +5 -11
- package/src/components/FullScreenVideoModal/FullScreenVideoModal.tsx +3 -1
- package/src/components/Header/Header.tsx +27 -9
- package/src/components/Heading/Heading.tsx +12 -19
- package/src/components/Heading/Heading.types.ts +1 -1
- package/src/components/Hero/Hero.tsx +1 -1
- package/src/components/Hr/Hr.tsx +1 -1
- package/src/components/HtmlContent/HtmlContent.tsx +1 -1
- package/src/components/Image/Image.tsx +1 -1
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/Link/Link.tsx +3 -1
- package/src/components/List/List.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +3 -1
- package/src/components/Loader/Loader.tsx +1 -1
- package/src/components/Logo/Logo.tsx +1 -1
- package/src/components/Menu/Menu.tsx +1 -1
- package/src/components/Notice/Notice.tsx +3 -1
- package/src/components/OTPInput/OTPInput.tsx +4 -2
- package/src/components/PanelCards/PanelCards.tsx +3 -1
- package/src/components/PanelCustom/PanelCustom.tsx +1 -1
- package/src/components/PanelFeature/PanelFeature.tsx +1 -1
- package/src/components/PanelHero/PanelHero.tsx +3 -1
- package/src/components/PanelIntro/PanelIntro.tsx +3 -1
- package/src/components/PanelProduct/PanelProduct.tsx +1 -1
- package/src/components/PanelScroller/PanelScroller.tsx +3 -1
- package/src/components/PanelVideo/PanelVideo.tsx +3 -1
- package/src/components/ProductCard/ProductCard.tsx +2 -0
- package/src/components/ProductDetail/ProductDetail.tsx +2 -0
- package/src/components/Radio/Radio.tsx +1 -1
- package/src/components/Schedule/Schedule.tsx +2 -2
- package/src/components/ScheduleItem/ScheduleItem.tsx +2 -0
- package/src/components/Screen/Screen.tsx +1 -1
- package/src/components/ShadcnCarousel/ShadcnCarousel.tsx +2 -0
- package/src/components/Share/Share.tsx +2 -0
- package/src/components/SubscriptionManager/SubscriptionManager.tsx +3 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +3 -1
- package/src/components/TextInput/TextInput.tsx +6 -3
- package/src/components/TextInput/TextInput.types.ts +4 -55
- package/src/components/Toast/Toast.tsx +12 -0
- package/src/components/Toast/Toast.types.ts +6 -0
- package/src/components/Toast/index.ts +3 -0
- package/src/components/VariantSelector/VariantSelector.tsx +2 -0
- package/src/components/Video/Video.tsx +14 -13
- package/src/components/VisitUs/VisitUs.tsx +2 -0
- package/src/components/index.ts +13 -0
- package/src/context/Amplify/index.tsx +2 -1
- package/src/context/App/index.tsx +2 -0
- package/src/context/Cart/index.tsx +2 -0
- package/src/context/ExampleContext/index.tsx +3 -1
- package/src/context/Theme/index.tsx +2 -0
- package/src/context/index.ts +2 -0
- package/src/features/Search/Search.tsx +11 -0
- package/src/features/Search/Search.types.ts +1 -0
- package/src/features/Search/config/config-helper.ts +2 -0
- package/src/features/Search/views/Layout/Layout.tsx +1 -1
- package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.tsx +3 -1
- package/src/features/Search/views/Paging/Paging.tsx +3 -1
- package/src/features/Search/views/PagingInfo/PagingInfo.tsx +1 -1
- package/src/features/Search/views/Result/Result.tsx +1 -1
- package/src/features/Search/views/Results/Results.tsx +1 -1
- package/src/features/Search/views/ResultsPerPage/ResultsPerPage.tsx +3 -1
- package/src/features/Search/views/SearchBox/SearchBox.tsx +3 -1
- package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.tsx +3 -1
- package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.tsx +3 -1
- package/src/features/Search/views/Sorting/Sorting.tsx +3 -1
- package/src/features/index.ts +16 -0
- package/src/forms/ForgotPasswordForm/ForgotPasswordForm.types.ts +1 -1
- package/src/forms/LoginForm/LoginForm.stories.tsx +1 -1
- package/src/forms/LoginForm/LoginForm.tsx +7 -5
- package/src/forms/LoginForm/LoginForm.types.ts +7 -1
- package/src/forms/PromoCodeForm/PromoCodeForm.types.ts +1 -1
- package/src/forms/RegisterForm/RegisterForm.stories.tsx +1 -1
- package/src/forms/RegisterForm/RegisterForm.tsx +7 -10
- package/src/forms/RegisterForm/RegisterForm.types.ts +4 -2
- package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.types.ts +1 -1
- package/src/forms/ResetPasswordForm/ResetPasswordForm.types.ts +1 -1
- package/src/forms/index.ts +2 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useLanguage.ts +2 -0
- package/src/hooks/useTheme.ts +3 -1
- package/src/index.ts +2 -0
- package/src/templates/AccountScreen/AccountScreen.tsx +2 -0
- package/src/templates/ChallengeScreen/ChallengeScreen.tsx +2 -0
- package/src/templates/MenuScreen/MenuScreen.tsx +2 -0
- package/src/templates/OrderDetailScreen/OrderDetailScreen.tsx +2 -0
- package/src/templates/OrdersHistoryScreen/OrdersHistoryScreen.tsx +2 -0
- package/src/templates/PasswordResetScreen/PasswordResetScreen.types.ts +1 -1
- package/src/templates/ProductListScreen/ProductListScreen.tsx +2 -0
- package/src/templates/PurchaseConfirmationScreen/PurchaseConfirmationScreen.tsx +2 -0
- package/src/templates/SubscriptionScreen/SubscriptionScreen.tsx +2 -0
- package/src/templates/WorkoutScreen/WorkoutScreen.tsx +3 -1
- package/src/templates/index.ts +2 -0
- package/src/utils/htmlParser/index.tsx +11 -5
- package/src/utils/index.ts +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { toast } from '
|
|
4
|
+
import { toast } from 'sonner';
|
|
3
5
|
import Screen from '../../components/Screen';
|
|
4
6
|
import { format } from 'date-fns';
|
|
5
7
|
import { Props } from './WorkoutScreen.types';
|
package/src/templates/index.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
1
|
+
import { attributesToProps, domToReact, Element, type DOMNode } from 'html-react-parser';
|
|
2
2
|
import Link from '../../components/Link';
|
|
3
3
|
import Copy from '../../components/Copy';
|
|
4
4
|
|
|
5
|
+
function isElement(node: DOMNode): node is Element {
|
|
6
|
+
return node.type === 'tag' && 'name' in node;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
export const options = {
|
|
6
|
-
replace(domNode:
|
|
10
|
+
replace(domNode: DOMNode) {
|
|
11
|
+
if (!isElement(domNode)) return domNode;
|
|
12
|
+
|
|
7
13
|
// Handle a tag links.
|
|
8
14
|
if (domNode.name === 'a') {
|
|
9
15
|
const props = attributesToProps(domNode.attribs);
|
|
10
|
-
return <Link {...props}>{domToReact(domNode.children, options)}</Link>;
|
|
16
|
+
return <Link {...props}>{domToReact(domNode.children as DOMNode[], options)}</Link>;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
// Handle p tag copy.
|
|
14
|
-
if (domNode.
|
|
20
|
+
if (domNode.name === 'p') {
|
|
15
21
|
const props = attributesToProps(domNode.attribs);
|
|
16
|
-
return <Copy {...props}>{domToReact(domNode.children, options)}</Copy>;
|
|
22
|
+
return <Copy {...props}>{domToReact(domNode.children as DOMNode[], options)}</Copy>;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
// Handle default.
|
package/src/utils/index.ts
CHANGED
|
@@ -34,5 +34,5 @@ export function formatDuration(duration: string): string {
|
|
|
34
34
|
|
|
35
35
|
export function getRandomImageFromArray(images?: string[]): string | undefined {
|
|
36
36
|
if (!images || images.length === 0) return undefined;
|
|
37
|
-
return images
|
|
37
|
+
return images[Math.floor(Math.random() * images.length)];
|
|
38
38
|
}
|