@coopdigital/react 1.30.0 → 1.30.2

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 (126) hide show
  1. package/dist/components/Combobox/Combobox.js +19 -3
  2. package/dist/components/Textarea/Textarea.js +14 -4
  3. package/dist/components/icons/AccountCircleFilledIcon.d.ts +2 -1
  4. package/dist/components/icons/AccountCircleIcon.d.ts +2 -1
  5. package/dist/components/icons/AccountFilledIcon.d.ts +2 -1
  6. package/dist/components/icons/AccountIcon.d.ts +2 -1
  7. package/dist/components/icons/AddIcon.d.ts +2 -1
  8. package/dist/components/icons/AppsFilledIcon.d.ts +2 -1
  9. package/dist/components/icons/AppsIcon.d.ts +2 -1
  10. package/dist/components/icons/ArrowDownIcon.d.ts +2 -1
  11. package/dist/components/icons/ArrowLeftIcon.d.ts +2 -1
  12. package/dist/components/icons/ArrowRightIcon.d.ts +2 -1
  13. package/dist/components/icons/ArrowUpIcon.d.ts +2 -1
  14. package/dist/components/icons/BackspaceFilledIcon.d.ts +2 -1
  15. package/dist/components/icons/BackspaceIcon.d.ts +2 -1
  16. package/dist/components/icons/BasketFilledIcon.d.ts +2 -1
  17. package/dist/components/icons/BasketIcon.d.ts +2 -1
  18. package/dist/components/icons/BellFilledIcon.d.ts +2 -1
  19. package/dist/components/icons/BellIcon.d.ts +2 -1
  20. package/dist/components/icons/BroomIcon.d.ts +2 -1
  21. package/dist/components/icons/CalendarFilledIcon.d.ts +2 -1
  22. package/dist/components/icons/CalendarIcon.d.ts +2 -1
  23. package/dist/components/icons/CashFilledIcon.d.ts +2 -1
  24. package/dist/components/icons/CashIcon.d.ts +2 -1
  25. package/dist/components/icons/ChevronDownIcon.d.ts +2 -1
  26. package/dist/components/icons/ChevronLeftIcon.d.ts +2 -1
  27. package/dist/components/icons/ChevronRightIcon.d.ts +2 -1
  28. package/dist/components/icons/ChevronUpIcon.d.ts +2 -1
  29. package/dist/components/icons/CircleBurgerFilledIcon.d.ts +2 -1
  30. package/dist/components/icons/CircleBurgerIcon.d.ts +2 -1
  31. package/dist/components/icons/ClipboardFilledIcon.d.ts +2 -1
  32. package/dist/components/icons/ClipboardIcon.d.ts +2 -1
  33. package/dist/components/icons/ClockFilledIcon.d.ts +2 -1
  34. package/dist/components/icons/ClockIcon.d.ts +2 -1
  35. package/dist/components/icons/CloseAltFilledIcon.d.ts +2 -1
  36. package/dist/components/icons/CloseAltIcon.d.ts +2 -1
  37. package/dist/components/icons/CogIcon.d.ts +2 -1
  38. package/dist/components/icons/CommunityFilledIcon.d.ts +2 -1
  39. package/dist/components/icons/CommunityIcon.d.ts +2 -1
  40. package/dist/components/icons/ComputerIcon.d.ts +2 -1
  41. package/dist/components/icons/ContactFilledIcon.d.ts +2 -1
  42. package/dist/components/icons/ContactIcon.d.ts +2 -1
  43. package/dist/components/icons/ContactlessFilledIcon.d.ts +2 -1
  44. package/dist/components/icons/ContactlessIcon.d.ts +2 -1
  45. package/dist/components/icons/CoopLiveIcon.d.ts +2 -1
  46. package/dist/components/icons/CoopLocationFilledIcon.d.ts +2 -1
  47. package/dist/components/icons/CoopLogoIcon.d.ts +2 -1
  48. package/dist/components/icons/CoopMembershipCardFilledIcon.d.ts +2 -1
  49. package/dist/components/icons/CreditCardFilledIcon.d.ts +2 -1
  50. package/dist/components/icons/CreditCardIcon.d.ts +2 -1
  51. package/dist/components/icons/CrossIcon.d.ts +2 -1
  52. package/dist/components/icons/DocumentIcon.d.ts +2 -1
  53. package/dist/components/icons/DownloadIcon.d.ts +2 -1
  54. package/dist/components/icons/EnterStoreIcon.d.ts +2 -1
  55. package/dist/components/icons/ExitStoreIcon.d.ts +2 -1
  56. package/dist/components/icons/EyeFilledIcon.d.ts +2 -1
  57. package/dist/components/icons/EyeIcon.d.ts +2 -1
  58. package/dist/components/icons/EyeStrikeFilledIcon.d.ts +2 -1
  59. package/dist/components/icons/EyeStrikeIcon.d.ts +2 -1
  60. package/dist/components/icons/FeedbackFilledIcon.d.ts +2 -1
  61. package/dist/components/icons/FeedbackIcon.d.ts +2 -1
  62. package/dist/components/icons/FilterIcon.d.ts +2 -1
  63. package/dist/components/icons/GiftCardFilledIcon.d.ts +2 -1
  64. package/dist/components/icons/GiftCardIcon.d.ts +2 -1
  65. package/dist/components/icons/GiftFilledIcon.d.ts +2 -1
  66. package/dist/components/icons/GiftIcon.d.ts +2 -1
  67. package/dist/components/icons/HelpFilledIcon.d.ts +2 -1
  68. package/dist/components/icons/HelpIcon.d.ts +2 -1
  69. package/dist/components/icons/HomeFilledIcon.d.ts +2 -1
  70. package/dist/components/icons/HomeIcon.d.ts +2 -1
  71. package/dist/components/icons/HowDoIAssistantIcon.d.ts +2 -1
  72. package/dist/components/icons/InfoIcon.d.ts +2 -1
  73. package/dist/components/icons/KebabIcon.d.ts +2 -1
  74. package/dist/components/icons/LoadingIcon.d.ts +2 -1
  75. package/dist/components/icons/LocationFilledIcon.d.ts +2 -1
  76. package/dist/components/icons/LocationIcon.d.ts +2 -1
  77. package/dist/components/icons/LogoutIcon.d.ts +2 -1
  78. package/dist/components/icons/MailIcon.d.ts +2 -1
  79. package/dist/components/icons/MenuIcon.d.ts +2 -1
  80. package/dist/components/icons/MessageIcon.d.ts +2 -1
  81. package/dist/components/icons/MinusIcon.d.ts +2 -1
  82. package/dist/components/icons/NotesFilledIcon.d.ts +2 -1
  83. package/dist/components/icons/NotesIcon.d.ts +2 -1
  84. package/dist/components/icons/OpenNewIcon.d.ts +2 -1
  85. package/dist/components/icons/OwnBagIcon.d.ts +2 -1
  86. package/dist/components/icons/PadlockIcon.d.ts +2 -1
  87. package/dist/components/icons/PencilIcon.d.ts +2 -1
  88. package/dist/components/icons/PhoneIcon.d.ts +2 -1
  89. package/dist/components/icons/PowerIcon.d.ts +2 -1
  90. package/dist/components/icons/SaveFilledIcon.d.ts +2 -1
  91. package/dist/components/icons/SaveIcon.d.ts +2 -1
  92. package/dist/components/icons/ScooterIcon.d.ts +2 -1
  93. package/dist/components/icons/SearchFilledIcon.d.ts +2 -1
  94. package/dist/components/icons/SearchIcon.d.ts +2 -1
  95. package/dist/components/icons/SendIcon.d.ts +2 -1
  96. package/dist/components/icons/SpannerIcon.d.ts +2 -1
  97. package/dist/components/icons/StarFilledIcon.d.ts +2 -1
  98. package/dist/components/icons/StarIcon.d.ts +2 -1
  99. package/dist/components/icons/TickAltFilledIcon.d.ts +2 -1
  100. package/dist/components/icons/TickAltIcon.d.ts +2 -1
  101. package/dist/components/icons/TickIcon.d.ts +2 -1
  102. package/dist/components/icons/TruckIcon.d.ts +2 -1
  103. package/dist/components/icons/UserWipeIcon.d.ts +2 -1
  104. package/dist/components/icons/VoucherFilledIcon.d.ts +2 -1
  105. package/dist/components/icons/VoucherIcon.d.ts +2 -1
  106. package/dist/components/icons/WarningCircleFilledIcon.d.ts +2 -1
  107. package/dist/components/icons/WarningCircleIcon.d.ts +2 -1
  108. package/dist/components/icons/WarningFilledIcon.d.ts +2 -1
  109. package/dist/components/icons/WarningIcon.d.ts +2 -1
  110. package/dist/components/icons/WifiIcon.d.ts +2 -1
  111. package/dist/components/icons/WriteIcon.d.ts +2 -1
  112. package/dist/hooks/index.d.ts +2 -1
  113. package/dist/hooks/index.js +2 -1
  114. package/dist/hooks/useFormReset.d.ts +6 -0
  115. package/dist/hooks/useFormReset.js +19 -0
  116. package/dist/hooks/useSlots.d.ts +2 -1
  117. package/dist/types/index.js +4 -0
  118. package/dist/utils/slots.d.ts +1 -1
  119. package/dist/utils/slots.js +20 -12
  120. package/package.json +19 -16
  121. package/src/components/Combobox/Combobox.context.ts +3 -1
  122. package/src/components/Combobox/Combobox.tsx +28 -4
  123. package/src/components/Textarea/Textarea.tsx +19 -4
  124. package/src/hooks/index.ts +1 -0
  125. package/src/hooks/useFormReset.ts +28 -0
  126. package/src/utils/slots.ts +37 -23
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const GiftFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const GiftIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const HelpFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const HelpIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const HomeFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const HomeIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const HowDoIAssistantIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const InfoIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const KebabIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const LoadingIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const LocationFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const LocationIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const LogoutIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const MailIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const MenuIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const MessageIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const MinusIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const NotesFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const NotesIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const OpenNewIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const OwnBagIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const PadlockIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const PencilIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const PhoneIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const PowerIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SaveFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SaveIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const ScooterIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SearchFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SearchIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SendIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const SpannerIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const StarFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const StarIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const TickAltFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const TickAltIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const TickIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const TruckIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const UserWipeIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const VoucherFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const VoucherIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WarningCircleFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WarningCircleIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WarningFilledIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WarningIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WifiIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -4,4 +4,5 @@ interface IconProps extends SVGProps<SVGSVGElement> {
4
4
  alt?: string;
5
5
  }
6
6
  export declare const WriteIcon: ({ alt, className, fill, id, ref, ...props }: IconProps) => JSX.Element;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { useDebounce } from "./useDebounce.js";
2
+ import { useFormReset } from "./useFormReset.js";
2
3
  import { useId } from "./useId.js";
3
4
  import { useSlots } from "./useSlots.js";
4
- export { useDebounce, useId, useSlots };
5
+ export { useDebounce, useFormReset, useId, useSlots };
@@ -1,4 +1,5 @@
1
1
  import { useId } from "./useId.js";
2
2
  import { useSlots } from "./useSlots.js";
3
3
  import { useDebounce } from "./useDebounce.js";
4
- export { useDebounce, useId, useSlots };
4
+ import { useFormReset } from "./useFormReset.js";
5
+ export { useDebounce, useFormReset, useId, useSlots };
@@ -0,0 +1,6 @@
1
+ import { RefObject } from "react";
2
+ //#region src/hooks/useFormReset.d.ts
3
+ type FormControl = HTMLButtonElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
4
+ export declare function useFormReset(ref: RefObject<FormControl | null>, onReset: () => void): void;
5
+ //#endregion
6
+ export {};
@@ -0,0 +1,19 @@
1
+ import { useEffect, useRef } from "react";
2
+ //#region src/hooks/useFormReset.ts
3
+ function useFormReset(ref, onReset) {
4
+ const onResetRef = useRef(onReset);
5
+ useEffect(() => {
6
+ onResetRef.current = onReset;
7
+ });
8
+ useEffect(() => {
9
+ const form = ref.current?.form;
10
+ if (!form) return;
11
+ const handleReset = (event) => {
12
+ if (!event.defaultPrevented) onResetRef.current();
13
+ };
14
+ form.addEventListener("reset", handleReset);
15
+ return () => form.removeEventListener("reset", handleReset);
16
+ }, [ref]);
17
+ }
18
+ //#endregion
19
+ export { useFormReset };
@@ -4,4 +4,5 @@ type Slots<T> = Record<keyof T, React.ReactNode>;
4
4
  export declare function useSlots<T>(componentSlots: Slots<T>, children: React.ReactNode, options?: {
5
5
  collect?: string[];
6
6
  }): Slots<T>;
7
- //#endregion
7
+ //#endregion
8
+ export {};
@@ -0,0 +1,4 @@
1
+ //#region src/types/index.ts
2
+ const REACT_LAZY_TYPE = Symbol.for("react.lazy");
3
+ //#endregion
4
+ export { REACT_LAZY_TYPE };
@@ -2,8 +2,8 @@ import { LazyComponent, SlotConfig } from "../types/index.js";
2
2
  import React, { ReactElement, ReactNode } from "react";
3
3
  //#region src/utils/slots.d.ts
4
4
  export declare function getSlotProp<R = unknown>(slot: React.ReactNode, prop: string): R | undefined;
5
- export declare const forEachSlot: (children: ReactNode, fn: (slot: SlotConfig, child: ReactElement) => void) => void;
6
5
  export declare function isLazy<T extends React.ComponentType<any>>(type: unknown): type is LazyComponent<T>;
6
+ export declare const forEachSlot: (children: ReactNode, fn: (slot: SlotConfig, child: ReactElement) => void) => void;
7
7
  export declare function resolveComponentName(child: React.ReactNode): string | null;
8
8
  export declare function getSlotName(node: React.ReactNode): string | false;
9
9
  //#endregion
@@ -1,26 +1,34 @@
1
+ import { REACT_LAZY_TYPE } from "../types/index.js";
1
2
  import { isValidElement } from "react";
2
3
  //#region src/utils/slots.ts
3
4
  function getSlotProp(slot, prop) {
4
5
  if (isValidElement(slot) && prop in slot.props) return slot.props[prop];
5
6
  }
7
+ function isLazy(type) {
8
+ return typeof type === "object" && type !== null && type.$$typeof === REACT_LAZY_TYPE;
9
+ }
10
+ const resolveType = (type) => {
11
+ if (!isLazy(type)) return type;
12
+ try {
13
+ return type._init(type._payload);
14
+ } catch {
15
+ return;
16
+ }
17
+ };
18
+ const getSlotConfig = (type) => {
19
+ const resolved = resolveType(type);
20
+ return typeof resolved === "function" && "slot" in resolved ? resolved.slot : void 0;
21
+ };
6
22
  const forEachSlot = (children, fn) => {
7
23
  Array.from([children].flat()).forEach((child) => {
8
- if (isValidElement(child) && typeof child.type === "function" && "slot" in child.type) fn(child.type.slot, child);
24
+ if (!isValidElement(child)) return;
25
+ const slot = getSlotConfig(child.type);
26
+ if (slot) fn(slot, child);
9
27
  });
10
28
  };
11
- function isLazy(type) {
12
- return typeof type === "object" && type !== null && "_payload" in type && "_init" in type;
13
- }
14
29
  function resolveComponentName(child) {
15
30
  if (child && typeof child === "object" && "type" in child) {
16
- const type = child.type;
17
- if (isLazy(type)) try {
18
- const resolved = type._init(type._payload);
19
- if ("slot" in resolved) return resolved.slot.name;
20
- return resolved.displayName ?? resolved.name ?? null;
21
- } catch {
22
- return null;
23
- }
31
+ const type = resolveType(child.type);
24
32
  if (typeof type === "function") {
25
33
  if ("slot" in type) return type.slot.name;
26
34
  return type.displayName ?? type.name ?? null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "1.30.0",
4
+ "version": "1.30.2",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -12,9 +12,10 @@
12
12
  "default": "./dist/index.js"
13
13
  },
14
14
  "./components/*": {
15
- "types": "./dist/components/*/*.d.ts",
16
- "default": "./dist/components/*/*.js"
15
+ "types": "./dist/components/*/index.d.ts",
16
+ "default": "./dist/components/*/index.js"
17
17
  },
18
+ "./components/icons": null,
18
19
  "./icons": {
19
20
  "types": "./dist/components/icons/index.d.ts",
20
21
  "default": "./dist/components/icons/index.js"
@@ -67,23 +68,25 @@
67
68
  "license": "MIT",
68
69
  "description": "React components for the Experience Library design system",
69
70
  "devDependencies": {
70
- "@axe-core/playwright": "^4.13.0",
71
- "@playwright/test": "^1.64.0",
72
- "@storybook/addon-a11y": "^10.6.1",
73
- "@storybook/addon-docs": "^10.6.1",
74
- "@storybook/addon-links": "^10.6.1",
75
- "@storybook/addon-onboarding": "^10.6.1",
76
- "@storybook/react-vite": "^10.6.1",
71
+ "@axe-core/playwright": "^4.14.0",
72
+ "@playwright/test": "^1.64.1",
73
+ "@storybook/addon-a11y": "^10.6.2",
74
+ "@storybook/addon-docs": "^10.6.2",
75
+ "@storybook/addon-links": "^10.6.2",
76
+ "@storybook/addon-onboarding": "^10.6.2",
77
+ "@storybook/react-vite": "^10.6.2",
77
78
  "@testing-library/jest-dom": "^7.0.1",
78
79
  "@testing-library/react": "^16.3.3",
79
80
  "@types/react": "^19.3.0",
80
81
  "@types/react-dom": "^19.3.0",
81
82
  "@whitespace/storybook-addon-html": "^9.0.0",
82
- "react": "^19.3.0",
83
- "react-dom": "^19.3.0",
83
+ "react": "^19.3.1",
84
+ "react-dom": "^19.3.1",
85
+ "react-element-to-jsx-string": "^18.0.0",
86
+ "react-hook-form": "^7.90.0",
84
87
  "resize-observer-polyfill": "^1.5.1",
85
88
  "serve": "^14.2.6",
86
- "storybook": "^10.6.1",
89
+ "storybook": "^10.6.2",
87
90
  "storybook-addon-tag-badges": "^3.1.0"
88
91
  },
89
92
  "peerDependencies": {
@@ -107,8 +110,8 @@
107
110
  "storybook": "$storybook"
108
111
  },
109
112
  "dependencies": {
110
- "@coopdigital/styles": "^1.21.0",
111
- "@radix-ui/react-popover": "^1.2.0",
113
+ "@coopdigital/styles": "^1.21.1",
114
+ "@radix-ui/react-popover": "^1.3.1",
112
115
  "clsx": "^2.1.1",
113
116
  "date-fns": "^4.4.0",
114
117
  "downshift": "^9.4.0",
@@ -116,5 +119,5 @@
116
119
  "merge-refs": "^2.0.0",
117
120
  "react-day-picker": "^10.0.2"
118
121
  },
119
- "gitHead": "3f7a257781401d8700ddc0e16feeaeab452bd79e"
122
+ "gitHead": "eb06ec9a3ea4bb441c5b6738949da6dfdd9f0ce2"
120
123
  }
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import type { UseComboboxReturnValue } from "downshift"
3
3
 
4
- import { createContext, useContext } from "react"
4
+ import { createContext, type RefObject, useContext } from "react"
5
5
 
6
6
  import type { ComboboxItem } from "@/components/Combobox/combobox-utils"
7
7
 
@@ -11,6 +11,8 @@ interface ComboboxContextValue {
11
11
  disabled: boolean
12
12
  downshift: UseComboboxReturnValue<ComboboxItem>
13
13
  error: boolean
14
+ // The visible input, which the form reset is looked up from
15
+ inputRef: RefObject<HTMLInputElement | null>
14
16
  // The options currently shown, after filtering and the maxResults cap
15
17
  items: ComboboxItem[]
16
18
  // The number of options that match the input, before the cap