@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.
Files changed (133) hide show
  1. package/package.json +5 -2
  2. package/src/components/Accordion/Accordion.tsx +3 -1
  3. package/src/components/AddressForm/AddressForm.tsx +4 -1
  4. package/src/components/AnimationCounter/AnimationCounter.tsx +3 -1
  5. package/src/components/AnimationSet1/AnimationSet1.tsx +3 -1
  6. package/src/components/Authenticator/Authenticator.tsx +2 -0
  7. package/src/components/Avatar/Avatar.tsx +2 -0
  8. package/src/components/Banner/Banner.tsx +1 -1
  9. package/src/components/Blockquote/Blockquote.tsx +1 -1
  10. package/src/components/Button/Button.tsx +1 -2
  11. package/src/components/ButtonDeprecated/Button.tsx +3 -1
  12. package/src/components/ButtonGroup/ButtonGroup.tsx +1 -1
  13. package/src/components/Card/Card.types.ts +3 -3
  14. package/src/components/Card/types/CardBasic/CardBasic.tsx +44 -133
  15. package/src/components/Card/types/CardData/CardData.tsx +3 -1
  16. package/src/components/Card/types/CardHorz/CardHorz.tsx +3 -1
  17. package/src/components/Card/types/CardIcon/CardIcon.tsx +3 -1
  18. package/src/components/Card/types/CardMedia/CardMedia.tsx +3 -1
  19. package/src/components/Card/types/CardVideo/CardVideo.tsx +3 -1
  20. package/src/components/Carousel/Carousel.tsx +3 -1
  21. package/src/components/Cart/Cart.tsx +15 -5
  22. package/src/components/Checkbox/Checkbox.tsx +4 -4
  23. package/src/components/Chip/Chip.tsx +3 -1
  24. package/src/components/Collapsible/Collapsible.tsx +1 -1
  25. package/src/components/Container/Container.tsx +1 -1
  26. package/src/components/ContentPageLayout/ContentPageLayout.tsx +1 -1
  27. package/src/components/ContentRowsLayout/ContentRowsLayout.tsx +1 -1
  28. package/src/components/Copy/Copy.tsx +1 -1
  29. package/src/components/DisplayHeading/DisplayHeading.tsx +1 -1
  30. package/src/components/ErrorBoundary/ErrorBoundary.tsx +44 -0
  31. package/src/components/ErrorBoundary/ErrorBoundary.types.ts +12 -0
  32. package/src/components/ErrorBoundary/index.ts +2 -0
  33. package/src/components/FileUpload/FileUpload.tsx +3 -1
  34. package/src/components/Footer/Footer.tsx +3 -1
  35. package/src/components/Form/Form.tsx +10 -4
  36. package/src/components/Form/Form.types.ts +4 -3
  37. package/src/components/FormField/FormField.tsx +12 -10
  38. package/src/components/FormSelect/FormSelect.tsx +2 -2
  39. package/src/components/FormSelect/FormSelect.types.ts +5 -11
  40. package/src/components/FullScreenVideoModal/FullScreenVideoModal.tsx +3 -1
  41. package/src/components/Header/Header.tsx +27 -9
  42. package/src/components/Heading/Heading.tsx +12 -19
  43. package/src/components/Heading/Heading.types.ts +1 -1
  44. package/src/components/Hero/Hero.tsx +1 -1
  45. package/src/components/Hr/Hr.tsx +1 -1
  46. package/src/components/HtmlContent/HtmlContent.tsx +1 -1
  47. package/src/components/Image/Image.tsx +1 -1
  48. package/src/components/Label/Label.tsx +1 -1
  49. package/src/components/Link/Link.tsx +3 -1
  50. package/src/components/List/List.tsx +1 -1
  51. package/src/components/ListItem/ListItem.tsx +3 -1
  52. package/src/components/Loader/Loader.tsx +1 -1
  53. package/src/components/Logo/Logo.tsx +1 -1
  54. package/src/components/Menu/Menu.tsx +1 -1
  55. package/src/components/Notice/Notice.tsx +3 -1
  56. package/src/components/OTPInput/OTPInput.tsx +4 -2
  57. package/src/components/PanelCards/PanelCards.tsx +3 -1
  58. package/src/components/PanelCustom/PanelCustom.tsx +1 -1
  59. package/src/components/PanelFeature/PanelFeature.tsx +1 -1
  60. package/src/components/PanelHero/PanelHero.tsx +3 -1
  61. package/src/components/PanelIntro/PanelIntro.tsx +3 -1
  62. package/src/components/PanelProduct/PanelProduct.tsx +1 -1
  63. package/src/components/PanelScroller/PanelScroller.tsx +3 -1
  64. package/src/components/PanelVideo/PanelVideo.tsx +3 -1
  65. package/src/components/ProductCard/ProductCard.tsx +2 -0
  66. package/src/components/ProductDetail/ProductDetail.tsx +2 -0
  67. package/src/components/Radio/Radio.tsx +1 -1
  68. package/src/components/Schedule/Schedule.tsx +2 -2
  69. package/src/components/ScheduleItem/ScheduleItem.tsx +2 -0
  70. package/src/components/Screen/Screen.tsx +1 -1
  71. package/src/components/ShadcnCarousel/ShadcnCarousel.tsx +2 -0
  72. package/src/components/Share/Share.tsx +2 -0
  73. package/src/components/SubscriptionManager/SubscriptionManager.tsx +3 -1
  74. package/src/components/Switch/Switch.tsx +1 -1
  75. package/src/components/Tabs/Tabs.tsx +3 -1
  76. package/src/components/TextInput/TextInput.tsx +6 -3
  77. package/src/components/TextInput/TextInput.types.ts +4 -55
  78. package/src/components/Toast/Toast.tsx +12 -0
  79. package/src/components/Toast/Toast.types.ts +6 -0
  80. package/src/components/Toast/index.ts +3 -0
  81. package/src/components/VariantSelector/VariantSelector.tsx +2 -0
  82. package/src/components/Video/Video.tsx +14 -13
  83. package/src/components/VisitUs/VisitUs.tsx +2 -0
  84. package/src/components/index.ts +13 -0
  85. package/src/context/Amplify/index.tsx +2 -1
  86. package/src/context/App/index.tsx +2 -0
  87. package/src/context/Cart/index.tsx +2 -0
  88. package/src/context/ExampleContext/index.tsx +3 -1
  89. package/src/context/Theme/index.tsx +2 -0
  90. package/src/context/index.ts +2 -0
  91. package/src/features/Search/Search.tsx +11 -0
  92. package/src/features/Search/Search.types.ts +1 -0
  93. package/src/features/Search/config/config-helper.ts +2 -0
  94. package/src/features/Search/views/Layout/Layout.tsx +1 -1
  95. package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.tsx +3 -1
  96. package/src/features/Search/views/Paging/Paging.tsx +3 -1
  97. package/src/features/Search/views/PagingInfo/PagingInfo.tsx +1 -1
  98. package/src/features/Search/views/Result/Result.tsx +1 -1
  99. package/src/features/Search/views/Results/Results.tsx +1 -1
  100. package/src/features/Search/views/ResultsPerPage/ResultsPerPage.tsx +3 -1
  101. package/src/features/Search/views/SearchBox/SearchBox.tsx +3 -1
  102. package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.tsx +3 -1
  103. package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.tsx +3 -1
  104. package/src/features/Search/views/Sorting/Sorting.tsx +3 -1
  105. package/src/features/index.ts +16 -0
  106. package/src/forms/ForgotPasswordForm/ForgotPasswordForm.types.ts +1 -1
  107. package/src/forms/LoginForm/LoginForm.stories.tsx +1 -1
  108. package/src/forms/LoginForm/LoginForm.tsx +7 -5
  109. package/src/forms/LoginForm/LoginForm.types.ts +7 -1
  110. package/src/forms/PromoCodeForm/PromoCodeForm.types.ts +1 -1
  111. package/src/forms/RegisterForm/RegisterForm.stories.tsx +1 -1
  112. package/src/forms/RegisterForm/RegisterForm.tsx +7 -10
  113. package/src/forms/RegisterForm/RegisterForm.types.ts +4 -2
  114. package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.types.ts +1 -1
  115. package/src/forms/ResetPasswordForm/ResetPasswordForm.types.ts +1 -1
  116. package/src/forms/index.ts +2 -0
  117. package/src/hooks/index.ts +2 -0
  118. package/src/hooks/useLanguage.ts +2 -0
  119. package/src/hooks/useTheme.ts +3 -1
  120. package/src/index.ts +2 -0
  121. package/src/templates/AccountScreen/AccountScreen.tsx +2 -0
  122. package/src/templates/ChallengeScreen/ChallengeScreen.tsx +2 -0
  123. package/src/templates/MenuScreen/MenuScreen.tsx +2 -0
  124. package/src/templates/OrderDetailScreen/OrderDetailScreen.tsx +2 -0
  125. package/src/templates/OrdersHistoryScreen/OrdersHistoryScreen.tsx +2 -0
  126. package/src/templates/PasswordResetScreen/PasswordResetScreen.types.ts +1 -1
  127. package/src/templates/ProductListScreen/ProductListScreen.tsx +2 -0
  128. package/src/templates/PurchaseConfirmationScreen/PurchaseConfirmationScreen.tsx +2 -0
  129. package/src/templates/SubscriptionScreen/SubscriptionScreen.tsx +2 -0
  130. package/src/templates/WorkoutScreen/WorkoutScreen.tsx +3 -1
  131. package/src/templates/index.ts +2 -0
  132. package/src/utils/htmlParser/index.tsx +11 -5
  133. package/src/utils/index.ts +1 -1
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React, { useMemo } from 'react';
2
4
  import { format } from 'date-fns';
3
5
  import Screen from '../../components/Screen';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React from 'react';
2
4
  import Screen from '../../components/Screen';
3
5
  import { Props } from './MenuScreen.types';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React from 'react';
2
4
  import Screen from '../../components/Screen';
3
5
  import DisplayHeading from '../../components/DisplayHeading';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React from 'react';
2
4
  import Screen from '../../components/Screen';
3
5
  import DisplayHeading from '../../components/DisplayHeading';
@@ -2,5 +2,5 @@ export interface Props {
2
2
  testID?: string;
3
3
  title: string;
4
4
  image?: string;
5
- handleSubmitCallback: (data: { password: string }) => void;
5
+ handleSubmitCallback: (data: Record<string, string>) => void;
6
6
  }
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import Screen from '../../components/Screen';
2
4
  import DisplayHeading from '../../components/DisplayHeading';
3
5
  import Copy from '../../components/Copy';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React from 'react';
2
4
  import Screen from '../../components/Screen';
3
5
  import { Props } from './PurchaseConfirmationScreen.types';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import React from 'react';
2
4
  import Screen from '../../components/Screen';
3
5
  import { Props } from './SubscriptionScreen.types';
@@ -1,5 +1,7 @@
1
+ "use client";
2
+
1
3
  import React, { useMemo } from 'react';
2
- import { toast } from 'react-toastify';
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';
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  export { default as AccountScreen } from './AccountScreen';
2
4
  export { default as AuthScreen } from './AuthScreen';
3
5
  export { default as CardGridScreen } from './CardGridScreen';
@@ -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: any) {
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.attribs && domNode.name === 'p') {
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.
@@ -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?.map((image: any) => image)?.[Math.floor(Math.random() * images?.map((image: any) => image).length)];
37
+ return images[Math.floor(Math.random() * images.length)];
38
38
  }