@almadar/ui 1.0.13 → 1.0.14
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/{chunk-QFAKJLOK.js → chunk-4FRUCUO5.js} +1 -1
- package/dist/{chunk-DTKTZ3UR.js → chunk-I5RSZIOE.js} +24 -24
- package/dist/{chunk-4AIGHVQK.js → chunk-MLS5KU5U.js} +1 -1248
- package/dist/chunk-PKBMQBKP.js +5 -0
- package/dist/{chunk-AQREMI4N.js → chunk-PL7MD6GF.js} +1 -1
- package/dist/components/index.d.ts +1418 -391
- package/dist/components/index.js +4820 -1376
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.d.ts +58 -58
- package/dist/hooks/index.js +2 -2
- package/dist/lib/index.js +1 -1
- package/dist/providers/index.js +3 -3
- package/dist/renderer/index.js +3 -3
- package/dist/stores/index.js +1 -1
- package/package.json +20 -16
- package/LICENSE +0 -72
- package/dist/chunk-S7EYY36U.js +0 -13
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { useUISlotManager } from './chunk-7NEWMNNU.js';
|
|
2
|
-
import { createContext, useMemo, useState, useEffect, useCallback
|
|
2
|
+
import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
var UISlotContext = createContext(null);
|
|
6
|
+
function UISlotProvider({ children }) {
|
|
7
|
+
const slotManager = useUISlotManager();
|
|
8
|
+
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
9
|
+
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
10
|
+
}
|
|
11
|
+
function useUISlots() {
|
|
12
|
+
const context = useContext(UISlotContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function useSlotContent(slot) {
|
|
21
|
+
const { getContent } = useUISlots();
|
|
22
|
+
return getContent(slot);
|
|
23
|
+
}
|
|
24
|
+
function useSlotHasContent(slot) {
|
|
25
|
+
const { hasContent } = useUISlots();
|
|
26
|
+
return hasContent(slot);
|
|
27
|
+
}
|
|
5
28
|
var BUILT_IN_THEMES = [
|
|
6
29
|
{
|
|
7
30
|
name: "wireframe",
|
|
@@ -163,28 +186,5 @@ function useTheme() {
|
|
|
163
186
|
return context;
|
|
164
187
|
}
|
|
165
188
|
var ThemeContext_default = ThemeContext;
|
|
166
|
-
var UISlotContext = createContext(null);
|
|
167
|
-
function UISlotProvider({ children }) {
|
|
168
|
-
const slotManager = useUISlotManager();
|
|
169
|
-
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
170
|
-
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
171
|
-
}
|
|
172
|
-
function useUISlots() {
|
|
173
|
-
const context = useContext(UISlotContext);
|
|
174
|
-
if (!context) {
|
|
175
|
-
throw new Error(
|
|
176
|
-
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
return context;
|
|
180
|
-
}
|
|
181
|
-
function useSlotContent(slot) {
|
|
182
|
-
const { getContent } = useUISlots();
|
|
183
|
-
return getContent(slot);
|
|
184
|
-
}
|
|
185
|
-
function useSlotHasContent(slot) {
|
|
186
|
-
const { hasContent } = useUISlots();
|
|
187
|
-
return hasContent(slot);
|
|
188
|
-
}
|
|
189
189
|
|
|
190
190
|
export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };
|