@zoiq.io/dev-kit 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -31,11 +31,11 @@ function App() {
31
31
 
32
32
  ## ZOIQProvider
33
33
 
34
- | Prop | Type | Description |
35
- |------|------|-------------|
36
- | `projectKey` | `string` | **Required.** Project ID or public front-end key used to fetch theme and config. |
37
- | `apiBaseUrl` | `string` | Optional. Base URL for the project config API. Defaults to `window.location.origin` (same origin). |
38
- | `fetchProjectConfig` | `(key: string) => Promise<ProjectSettings \| null>` | Optional. Custom fetcher; if provided, `apiBaseUrl` is ignored for config. |
34
+ | Prop | Type | Description |
35
+ | -------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
36
+ | `projectKey` | `string` | **Required.** Project ID or public front-end key used to fetch theme and config. |
37
+ | `apiBaseUrl` | `string` | Optional. Base URL for the project config API. Defaults to `window.location.origin` (same origin). |
38
+ | `fetchProjectConfig` | `(key: string) => Promise<ProjectSettings \| null>` | Optional. Custom fetcher; if provided, `apiBaseUrl` is ignored for config. |
39
39
 
40
40
  The provider:
41
41
 
@@ -0,0 +1,120 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { P as ProjectSettings } from './types-DaSMeWe9.mjs';
4
+ export { S as SectionFlag, a as SectionFlagsData } from './types-DaSMeWe9.mjs';
5
+ export { Z as ZOIQProvider, u as useZOIQContext, a as useZOIQEntity } from './useZOIQEntity-Cv9WBq8W.mjs';
6
+
7
+ interface ScrollButtonProps {
8
+ className?: string;
9
+ /** Scroll Y threshold above which the button is shown (default 200) */
10
+ threshold?: number;
11
+ }
12
+ declare const ScrollButton: ({ className, threshold }: ScrollButtonProps) => react_jsx_runtime.JSX.Element;
13
+
14
+ interface SubtitleProps {
15
+ children?: React.ReactNode;
16
+ className?: string;
17
+ }
18
+ declare const Subtitle: ({ children, className }: SubtitleProps) => react_jsx_runtime.JSX.Element;
19
+
20
+ interface TextProps extends React.HTMLAttributes<HTMLElement> {
21
+ children?: React.ReactNode;
22
+ className?: string;
23
+ as?: 'span' | 'p' | 'div';
24
+ }
25
+ declare const Text: ({ children, className, as: As, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
26
+
27
+ interface TitleProps {
28
+ children?: React.ReactNode;
29
+ className?: string;
30
+ }
31
+ declare const Title: ({ children, className }: TitleProps) => react_jsx_runtime.JSX.Element;
32
+
33
+ interface ToggleThemeProps {
34
+ className?: string;
35
+ /** Callback when user requests theme toggle; host app controls actual theme state */
36
+ onToggle?: () => void;
37
+ /** Optional current theme name for rendering (e.g. "light" | "dark") */
38
+ theme?: string;
39
+ /** Content to show (e.g. icon). If not provided, shows "Theme" */
40
+ children?: React.ReactNode;
41
+ }
42
+ declare const ToggleTheme: ({ className, onToggle, theme, children }: ToggleThemeProps) => react_jsx_runtime.JSX.Element;
43
+
44
+ interface FooterProps {
45
+ children?: React.ReactNode;
46
+ className?: string;
47
+ }
48
+ declare const Footer: ({ children, className }: FooterProps) => react_jsx_runtime.JSX.Element;
49
+
50
+ interface HeaderProps {
51
+ children?: React.ReactNode;
52
+ className?: string;
53
+ /** Optional left slot (e.g. logo, nav) */
54
+ left?: React.ReactNode;
55
+ /** Optional right slot (e.g. user menu, theme toggle) */
56
+ right?: React.ReactNode;
57
+ }
58
+ declare const Header: ({ children, className, left, right }: HeaderProps) => react_jsx_runtime.JSX.Element;
59
+
60
+ interface PageProps {
61
+ children?: React.ReactNode;
62
+ className?: string;
63
+ /** Optional full-width layout (no horizontal padding) */
64
+ fullWidth?: boolean;
65
+ }
66
+ declare const Page: ({ children, className, fullWidth }: PageProps) => react_jsx_runtime.JSX.Element;
67
+
68
+ interface SecondarySidebarItem {
69
+ label: string;
70
+ href: string;
71
+ icon?: React.ReactNode;
72
+ }
73
+ interface SecondarySidebarProps {
74
+ items: SecondarySidebarItem[];
75
+ className?: string;
76
+ /** Optional: return true if item is active (e.g. from pathname) */
77
+ isActive?: (item: SecondarySidebarItem) => boolean;
78
+ /** Optional: custom link renderer (e.g. Next.js Link). Default: <a> */
79
+ renderLink?: (item: SecondarySidebarItem, children: React.ReactNode) => React.ReactNode;
80
+ }
81
+ declare const SecondarySidebar: ({ items, className, isActive, renderLink }: SecondarySidebarProps) => react_jsx_runtime.JSX.Element;
82
+
83
+ interface SectionProps {
84
+ children?: React.ReactNode;
85
+ className?: string;
86
+ }
87
+ declare const Section: ({ children, className }: SectionProps) => react_jsx_runtime.JSX.Element;
88
+
89
+ /**
90
+ * Placeholder for toast container. Host app should render Toaster from "sonner" (or similar)
91
+ * inside the app; ZOIQ does not bundle a toast library.
92
+ */
93
+ declare const ToastContainer: () => null;
94
+
95
+ interface UseProjectSettingsResult {
96
+ data: ProjectSettings | null;
97
+ loading: boolean;
98
+ error: Error | null;
99
+ refetch: () => Promise<void>;
100
+ }
101
+ /**
102
+ * Returns the full project theme/settings for the current project key.
103
+ * Must be used within ZOIQProvider. Data is the same that the provider used to apply theme.
104
+ */
105
+ declare function useProjectSettings(): UseProjectSettingsResult;
106
+
107
+ interface UseSectionFlagsResult {
108
+ enabledIds: Set<string>;
109
+ disabledIds: Set<string>;
110
+ loading: boolean;
111
+ error: Error | null;
112
+ refetch: () => Promise<void>;
113
+ }
114
+ /**
115
+ * Returns which section IDs are enabled or disabled for the current project.
116
+ * Must be used within ZOIQProvider. Uses the same apiBaseUrl as the provider.
117
+ */
118
+ declare function useSectionFlags(): UseSectionFlagsResult;
119
+
120
+ export { Footer, Header, Page, ProjectSettings, ScrollButton, SecondarySidebar, type SecondarySidebarItem, type SecondarySidebarProps, Section, Subtitle, Text, Title, ToastContainer, ToggleTheme, useProjectSettings, useSectionFlags };
@@ -0,0 +1,120 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { P as ProjectSettings } from './types-DaSMeWe9.js';
4
+ export { S as SectionFlag, a as SectionFlagsData } from './types-DaSMeWe9.js';
5
+ export { Z as ZOIQProvider, u as useZOIQContext, a as useZOIQEntity } from './useZOIQEntity-CfY8Ag40.js';
6
+
7
+ interface ScrollButtonProps {
8
+ className?: string;
9
+ /** Scroll Y threshold above which the button is shown (default 200) */
10
+ threshold?: number;
11
+ }
12
+ declare const ScrollButton: ({ className, threshold }: ScrollButtonProps) => react_jsx_runtime.JSX.Element;
13
+
14
+ interface SubtitleProps {
15
+ children?: React.ReactNode;
16
+ className?: string;
17
+ }
18
+ declare const Subtitle: ({ children, className }: SubtitleProps) => react_jsx_runtime.JSX.Element;
19
+
20
+ interface TextProps extends React.HTMLAttributes<HTMLElement> {
21
+ children?: React.ReactNode;
22
+ className?: string;
23
+ as?: 'span' | 'p' | 'div';
24
+ }
25
+ declare const Text: ({ children, className, as: As, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
26
+
27
+ interface TitleProps {
28
+ children?: React.ReactNode;
29
+ className?: string;
30
+ }
31
+ declare const Title: ({ children, className }: TitleProps) => react_jsx_runtime.JSX.Element;
32
+
33
+ interface ToggleThemeProps {
34
+ className?: string;
35
+ /** Callback when user requests theme toggle; host app controls actual theme state */
36
+ onToggle?: () => void;
37
+ /** Optional current theme name for rendering (e.g. "light" | "dark") */
38
+ theme?: string;
39
+ /** Content to show (e.g. icon). If not provided, shows "Theme" */
40
+ children?: React.ReactNode;
41
+ }
42
+ declare const ToggleTheme: ({ className, onToggle, theme, children }: ToggleThemeProps) => react_jsx_runtime.JSX.Element;
43
+
44
+ interface FooterProps {
45
+ children?: React.ReactNode;
46
+ className?: string;
47
+ }
48
+ declare const Footer: ({ children, className }: FooterProps) => react_jsx_runtime.JSX.Element;
49
+
50
+ interface HeaderProps {
51
+ children?: React.ReactNode;
52
+ className?: string;
53
+ /** Optional left slot (e.g. logo, nav) */
54
+ left?: React.ReactNode;
55
+ /** Optional right slot (e.g. user menu, theme toggle) */
56
+ right?: React.ReactNode;
57
+ }
58
+ declare const Header: ({ children, className, left, right }: HeaderProps) => react_jsx_runtime.JSX.Element;
59
+
60
+ interface PageProps {
61
+ children?: React.ReactNode;
62
+ className?: string;
63
+ /** Optional full-width layout (no horizontal padding) */
64
+ fullWidth?: boolean;
65
+ }
66
+ declare const Page: ({ children, className, fullWidth }: PageProps) => react_jsx_runtime.JSX.Element;
67
+
68
+ interface SecondarySidebarItem {
69
+ label: string;
70
+ href: string;
71
+ icon?: React.ReactNode;
72
+ }
73
+ interface SecondarySidebarProps {
74
+ items: SecondarySidebarItem[];
75
+ className?: string;
76
+ /** Optional: return true if item is active (e.g. from pathname) */
77
+ isActive?: (item: SecondarySidebarItem) => boolean;
78
+ /** Optional: custom link renderer (e.g. Next.js Link). Default: <a> */
79
+ renderLink?: (item: SecondarySidebarItem, children: React.ReactNode) => React.ReactNode;
80
+ }
81
+ declare const SecondarySidebar: ({ items, className, isActive, renderLink }: SecondarySidebarProps) => react_jsx_runtime.JSX.Element;
82
+
83
+ interface SectionProps {
84
+ children?: React.ReactNode;
85
+ className?: string;
86
+ }
87
+ declare const Section: ({ children, className }: SectionProps) => react_jsx_runtime.JSX.Element;
88
+
89
+ /**
90
+ * Placeholder for toast container. Host app should render Toaster from "sonner" (or similar)
91
+ * inside the app; ZOIQ does not bundle a toast library.
92
+ */
93
+ declare const ToastContainer: () => null;
94
+
95
+ interface UseProjectSettingsResult {
96
+ data: ProjectSettings | null;
97
+ loading: boolean;
98
+ error: Error | null;
99
+ refetch: () => Promise<void>;
100
+ }
101
+ /**
102
+ * Returns the full project theme/settings for the current project key.
103
+ * Must be used within ZOIQProvider. Data is the same that the provider used to apply theme.
104
+ */
105
+ declare function useProjectSettings(): UseProjectSettingsResult;
106
+
107
+ interface UseSectionFlagsResult {
108
+ enabledIds: Set<string>;
109
+ disabledIds: Set<string>;
110
+ loading: boolean;
111
+ error: Error | null;
112
+ refetch: () => Promise<void>;
113
+ }
114
+ /**
115
+ * Returns which section IDs are enabled or disabled for the current project.
116
+ * Must be used within ZOIQProvider. Uses the same apiBaseUrl as the provider.
117
+ */
118
+ declare function useSectionFlags(): UseSectionFlagsResult;
119
+
120
+ export { Footer, Header, Page, ProjectSettings, ScrollButton, SecondarySidebar, type SecondarySidebarItem, type SecondarySidebarProps, Section, Subtitle, Text, Title, ToastContainer, ToggleTheme, useProjectSettings, useSectionFlags };