@4alldigital/foundation-ui--core 3.9.0 → 3.10.1
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/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/index.ts +6 -0
- package/src/features/Search/Search.tsx +9 -0
- package/src/features/Search/Search.types.ts +1 -0
- package/src/features/index.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4alldigital/foundation-ui--core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Foundation UI Core Component Library (source distribution)",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"type-check": "tsc --noEmit",
|
|
20
20
|
"dev": "tsc --noEmit --watch"
|
|
21
21
|
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"sonner": "^2.0.0"
|
|
24
|
+
},
|
|
22
25
|
"peerDependencies": {
|
|
23
26
|
"next": "^14.0.0 || ^15.0.0",
|
|
24
27
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -32,5 +35,5 @@
|
|
|
32
35
|
},
|
|
33
36
|
"author": "Joe Mewes",
|
|
34
37
|
"license": "MIT",
|
|
35
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b113a4c018016b27fd3cdfa1d991b9aec006f086"
|
|
36
39
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Toaster as SonnerToaster } from "sonner";
|
|
4
|
+
import type { ToasterProps } from "./Toast.types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Toaster component — wraps Sonner with Foundation UI defaults.
|
|
8
|
+
* Place once in the root layout.
|
|
9
|
+
*/
|
|
10
|
+
export function Toaster({ position = "top-right", ...props }: ToasterProps) {
|
|
11
|
+
return <SonnerToaster richColors position={position} {...props} />;
|
|
12
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -72,6 +72,9 @@ export { default as FullScreenVideoModal } from './FullScreenVideoModal';
|
|
|
72
72
|
export { default as Cart } from './Cart';
|
|
73
73
|
export { default as FullContentBackgroundImage } from './FullContentBackgroundImage';
|
|
74
74
|
|
|
75
|
+
// TOAST
|
|
76
|
+
export { Toaster, toast } from './Toast';
|
|
77
|
+
|
|
75
78
|
// SHADCN UI COMPONENTS
|
|
76
79
|
export { ShadcnCarousel } from './ShadcnCarousel';
|
|
77
80
|
|
|
@@ -153,6 +156,9 @@ export type { Props as CartProps } from './Cart/Cart.types';
|
|
|
153
156
|
export type { Props as FullContentBackgroundImageProps } from './FullContentBackgroundImage/FullContentBackgroundImage.types';
|
|
154
157
|
export type { Props as HeaderProps } from './Header/Header.types';
|
|
155
158
|
|
|
159
|
+
// TOAST TYPES
|
|
160
|
+
export type { ToasterProps } from './Toast';
|
|
161
|
+
|
|
156
162
|
// SHADCN UI TYPES
|
|
157
163
|
|
|
158
164
|
// PRODUCT COMPONENT TYPES
|
|
@@ -46,6 +46,7 @@ export default function Search({
|
|
|
46
46
|
gridClasses,
|
|
47
47
|
initialState = {},
|
|
48
48
|
showTextSearch = true,
|
|
49
|
+
children,
|
|
49
50
|
}: Props) {
|
|
50
51
|
const T = useLanguage();
|
|
51
52
|
const connector = useMemo(() => {
|
|
@@ -117,6 +118,14 @@ export default function Search({
|
|
|
117
118
|
};
|
|
118
119
|
}, [config]);
|
|
119
120
|
|
|
121
|
+
if (typeof children === 'function') {
|
|
122
|
+
return (
|
|
123
|
+
<SearchProvider config={searchConfig}>
|
|
124
|
+
{children({ searchConfig })}
|
|
125
|
+
</SearchProvider>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
120
129
|
const [showSidebar, setShowSidebar] = useState(false);
|
|
121
130
|
|
|
122
131
|
const handleShowFilters = () => {
|
package/src/features/index.ts
CHANGED
|
@@ -6,6 +6,20 @@ export { default as SingleSelectFacet } from './Search/views/SingleSelectFacet';
|
|
|
6
6
|
export { default as SingleLinksFacet } from './Search/views/SingleLinksFacet';
|
|
7
7
|
export { default as MultiCheckboxFacet } from './Search/views/MultiCheckboxFacet';
|
|
8
8
|
|
|
9
|
+
// View Helpers
|
|
10
|
+
export { getEscapedField } from './Search/view-helpers';
|
|
11
|
+
|
|
12
|
+
// Re-export Elastic Search UI components so consumers share the same module instance
|
|
13
|
+
// (avoids React context mismatch when using the children render prop)
|
|
14
|
+
export {
|
|
15
|
+
WithSearch,
|
|
16
|
+
Results,
|
|
17
|
+
Facet,
|
|
18
|
+
Paging,
|
|
19
|
+
Sorting,
|
|
20
|
+
SearchBox,
|
|
21
|
+
} from '@elastic/react-search-ui';
|
|
22
|
+
|
|
9
23
|
// Types
|
|
10
24
|
export { ResultAsTypes } from './Search/Search.types';
|
|
11
25
|
export type { Props as SearchProps } from './Search/Search.types';
|