@zoiq.io/dev-kit 0.1.0 → 0.1.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/dist/index.d.mts CHANGED
@@ -1,236 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
1
+ export { Z as ZOIQProvider, b as useStyleGuide, c as useZOIQBranding, u as useZOIQContext, a as useZOIQEntity } from './useZOIQEntity-oTb7n2Cg.mjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import './types-DaSMeWe9.mjs';
3
5
 
4
- /**
5
- * Project theme/settings shape returned by the config API and consumed by ZOIQProvider.
6
- */
7
- interface ProjectSettings {
8
- styleGuide?: Record<string, string | null> | null;
9
- branding?: {
10
- navbarLogo?: {
11
- fileID?: string | null;
12
- link?: string | null;
13
- } | null;
14
- footerLogo?: {
15
- fileID?: string | null;
16
- link?: string | null;
17
- } | null;
18
- loaderLogo?: {
19
- fileID?: string | null;
20
- link?: string | null;
21
- } | null;
22
- faviconLogo?: {
23
- fileID?: string | null;
24
- link?: string | null;
25
- } | null;
26
- authImage?: {
27
- fileID?: string | null;
28
- link?: string | null;
29
- } | null;
30
- customLogos?: Array<{
31
- name: string;
32
- description?: string | null;
33
- fileID?: string | null;
34
- link?: string | null;
35
- } | null> | null;
36
- primaryFont?: {
37
- name?: string | null;
38
- link?: string | null;
39
- } | null;
40
- secondaryFont?: {
41
- name?: string | null;
42
- link?: string | null;
43
- } | null;
44
- tertiaryFont?: {
45
- name?: string | null;
46
- link?: string | null;
47
- } | null;
48
- } | null;
49
- definedColors?: Array<{
50
- id: string;
51
- name: string;
52
- value: string;
53
- } | null> | null;
54
- clientDefinedColors?: Array<{
55
- name: string;
56
- description?: string | null;
57
- definedColor?: {
58
- name: string;
59
- value: string;
60
- } | null;
61
- } | null> | null;
62
- navbarSettings?: {
63
- isSticky?: boolean | null;
64
- fontSize?: string | null;
65
- alignment?: string | null;
66
- logoSize?: string | null;
67
- navbarType?: string | null;
68
- gutters?: string | null;
69
- subCategoryAnimation?: string | null;
70
- } | null;
71
- }
72
- /**
73
- * Section flag: enabled/disabled per section ID.
74
- */
75
- interface SectionFlag {
76
- id: string;
77
- enabled: boolean;
78
- }
79
- /**
80
- * Response shape for section flags API.
81
- */
82
- interface SectionFlagsData {
83
- enabledIds: string[];
84
- disabledIds: string[];
85
- }
6
+ declare function test(): void;
86
7
 
87
- interface ZOIQProviderProps {
88
- /** Project key (e.g. project ID or public API key) to fetch theme and config */
89
- projectKey: string;
90
- /** Base URL for the project config API (e.g. https://your-portal.com/api/zoiq) */
91
- apiBaseUrl?: string;
92
- /** Optional custom fetcher; if provided, apiBaseUrl is ignored for config fetch */
93
- fetchProjectConfig?: (key: string) => Promise<ProjectSettings | null>;
94
- children: React.ReactNode;
95
- }
96
- interface ZOIQContextValue {
97
- projectKey: string;
98
- apiBaseUrl?: string;
99
- settings: ProjectSettings | null;
100
- loading: boolean;
101
- error: Error | null;
102
- refetch: () => Promise<void>;
103
- }
104
- declare function ZOIQProvider({ projectKey, apiBaseUrl, fetchProjectConfig: customFetch, children, }: ZOIQProviderProps): react_jsx_runtime.JSX.Element;
105
- declare function useZOIQContext(): ZOIQContextValue | null;
106
-
107
- interface UseProjectSettingsResult {
108
- data: ProjectSettings | null;
109
- loading: boolean;
110
- error: Error | null;
111
- refetch: () => Promise<void>;
112
- }
113
- /**
114
- * Returns the full project theme/settings for the current project key.
115
- * Must be used within ZOIQProvider. Data is the same that the provider used to apply theme.
116
- */
117
- declare function useProjectSettings(): UseProjectSettingsResult;
118
-
119
- interface UseSectionFlagsResult {
120
- enabledIds: Set<string>;
121
- disabledIds: Set<string>;
122
- loading: boolean;
123
- error: Error | null;
124
- refetch: () => Promise<void>;
125
- }
126
- /**
127
- * Returns which section IDs are enabled or disabled for the current project.
128
- * Must be used within ZOIQProvider. Uses the same apiBaseUrl as the provider.
129
- */
130
- declare function useSectionFlags(): UseSectionFlagsResult;
131
-
132
- interface UseZOIQApiOptions {
133
- id?: string;
134
- query?: Record<string, string>;
135
- }
136
- interface UseZOIQApiResult<T> {
137
- data: T | null;
138
- loading: boolean;
139
- error: Error | null;
140
- refetch: () => Promise<void>;
141
- }
142
- /**
143
- * Fetches custom entity data for the current project.
144
- * Must be used within ZOIQProvider.
145
- */
146
- declare function useZOIQApi<T = unknown>(entity: string, options?: UseZOIQApiOptions): UseZOIQApiResult<T>;
147
-
148
- interface TextProps extends React.HTMLAttributes<HTMLElement> {
149
- children?: React.ReactNode;
150
- className?: string;
151
- as?: 'span' | 'p' | 'div';
152
- }
153
- declare const Text: ({ children, className, as: As, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
154
-
155
- interface TitleProps {
156
- children?: React.ReactNode;
157
- className?: string;
158
- }
159
- declare const Title: ({ children, className }: TitleProps) => react_jsx_runtime.JSX.Element;
160
-
161
- interface SubtitleProps {
162
- children?: React.ReactNode;
163
- className?: string;
164
- }
165
- declare const Subtitle: ({ children, className }: SubtitleProps) => react_jsx_runtime.JSX.Element;
166
-
167
- interface ScrollButtonProps {
168
- className?: string;
169
- /** Scroll Y threshold above which the button is shown (default 200) */
170
- threshold?: number;
171
- }
172
- declare const ScrollButton: ({ className, threshold }: ScrollButtonProps) => react_jsx_runtime.JSX.Element;
173
-
174
- interface ToggleThemeProps {
175
- className?: string;
176
- /** Callback when user requests theme toggle; host app controls actual theme state */
177
- onToggle?: () => void;
178
- /** Optional current theme name for rendering (e.g. "light" | "dark") */
179
- theme?: string;
180
- /** Content to show (e.g. icon). If not provided, shows "Theme" */
181
- children?: React.ReactNode;
182
- }
183
- declare const ToggleTheme: ({ className, onToggle, theme, children }: ToggleThemeProps) => react_jsx_runtime.JSX.Element;
184
-
185
- interface SectionProps {
186
- children?: React.ReactNode;
187
- className?: string;
188
- }
189
- declare const Section: ({ children, className }: SectionProps) => react_jsx_runtime.JSX.Element;
190
-
191
- /**
192
- * Placeholder for toast container. Host app should render Toaster from "sonner" (or similar)
193
- * inside the app; ZOIQ does not bundle a toast library.
194
- */
195
- declare const ToastContainer: () => null;
196
-
197
- interface PageProps {
198
- children?: React.ReactNode;
199
- className?: string;
200
- /** Optional full-width layout (no horizontal padding) */
201
- fullWidth?: boolean;
202
- }
203
- declare const Page: ({ children, className, fullWidth }: PageProps) => react_jsx_runtime.JSX.Element;
204
-
205
- interface HeaderProps {
206
- children?: React.ReactNode;
207
- className?: string;
208
- /** Optional left slot (e.g. logo, nav) */
209
- left?: React.ReactNode;
210
- /** Optional right slot (e.g. user menu, theme toggle) */
211
- right?: React.ReactNode;
212
- }
213
- declare const Header: ({ children, className, left, right }: HeaderProps) => react_jsx_runtime.JSX.Element;
214
-
215
- interface FooterProps {
216
- children?: React.ReactNode;
217
- className?: string;
218
- }
219
- declare const Footer: ({ children, className }: FooterProps) => react_jsx_runtime.JSX.Element;
220
-
221
- interface SecondarySidebarItem {
222
- label: string;
223
- href: string;
224
- icon?: React.ReactNode;
225
- }
226
- interface SecondarySidebarProps {
227
- items: SecondarySidebarItem[];
228
- className?: string;
229
- /** Optional: return true if item is active (e.g. from pathname) */
230
- isActive?: (item: SecondarySidebarItem) => boolean;
231
- /** Optional: custom link renderer (e.g. Next.js Link). Default: <a> */
232
- renderLink?: (item: SecondarySidebarItem, children: React.ReactNode) => React.ReactNode;
233
- }
234
- declare const SecondarySidebar: ({ items, className, isActive, renderLink }: SecondarySidebarProps) => react_jsx_runtime.JSX.Element;
235
-
236
- export { Footer, Header, Page, type ProjectSettings, ScrollButton, SecondarySidebar, type SecondarySidebarItem, type SecondarySidebarProps, Section, type SectionFlag, type SectionFlagsData, Subtitle, Text, Title, ToastContainer, ToggleTheme, ZOIQProvider, useProjectSettings, useSectionFlags, useZOIQApi, useZOIQContext };
8
+ export { test };
package/dist/index.d.ts CHANGED
@@ -1,236 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
1
+ export { Z as ZOIQProvider, b as useStyleGuide, c as useZOIQBranding, u as useZOIQContext, a as useZOIQEntity } from './useZOIQEntity-CkkGzG6D.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import './types-DaSMeWe9.js';
3
5
 
4
- /**
5
- * Project theme/settings shape returned by the config API and consumed by ZOIQProvider.
6
- */
7
- interface ProjectSettings {
8
- styleGuide?: Record<string, string | null> | null;
9
- branding?: {
10
- navbarLogo?: {
11
- fileID?: string | null;
12
- link?: string | null;
13
- } | null;
14
- footerLogo?: {
15
- fileID?: string | null;
16
- link?: string | null;
17
- } | null;
18
- loaderLogo?: {
19
- fileID?: string | null;
20
- link?: string | null;
21
- } | null;
22
- faviconLogo?: {
23
- fileID?: string | null;
24
- link?: string | null;
25
- } | null;
26
- authImage?: {
27
- fileID?: string | null;
28
- link?: string | null;
29
- } | null;
30
- customLogos?: Array<{
31
- name: string;
32
- description?: string | null;
33
- fileID?: string | null;
34
- link?: string | null;
35
- } | null> | null;
36
- primaryFont?: {
37
- name?: string | null;
38
- link?: string | null;
39
- } | null;
40
- secondaryFont?: {
41
- name?: string | null;
42
- link?: string | null;
43
- } | null;
44
- tertiaryFont?: {
45
- name?: string | null;
46
- link?: string | null;
47
- } | null;
48
- } | null;
49
- definedColors?: Array<{
50
- id: string;
51
- name: string;
52
- value: string;
53
- } | null> | null;
54
- clientDefinedColors?: Array<{
55
- name: string;
56
- description?: string | null;
57
- definedColor?: {
58
- name: string;
59
- value: string;
60
- } | null;
61
- } | null> | null;
62
- navbarSettings?: {
63
- isSticky?: boolean | null;
64
- fontSize?: string | null;
65
- alignment?: string | null;
66
- logoSize?: string | null;
67
- navbarType?: string | null;
68
- gutters?: string | null;
69
- subCategoryAnimation?: string | null;
70
- } | null;
71
- }
72
- /**
73
- * Section flag: enabled/disabled per section ID.
74
- */
75
- interface SectionFlag {
76
- id: string;
77
- enabled: boolean;
78
- }
79
- /**
80
- * Response shape for section flags API.
81
- */
82
- interface SectionFlagsData {
83
- enabledIds: string[];
84
- disabledIds: string[];
85
- }
6
+ declare function test(): void;
86
7
 
87
- interface ZOIQProviderProps {
88
- /** Project key (e.g. project ID or public API key) to fetch theme and config */
89
- projectKey: string;
90
- /** Base URL for the project config API (e.g. https://your-portal.com/api/zoiq) */
91
- apiBaseUrl?: string;
92
- /** Optional custom fetcher; if provided, apiBaseUrl is ignored for config fetch */
93
- fetchProjectConfig?: (key: string) => Promise<ProjectSettings | null>;
94
- children: React.ReactNode;
95
- }
96
- interface ZOIQContextValue {
97
- projectKey: string;
98
- apiBaseUrl?: string;
99
- settings: ProjectSettings | null;
100
- loading: boolean;
101
- error: Error | null;
102
- refetch: () => Promise<void>;
103
- }
104
- declare function ZOIQProvider({ projectKey, apiBaseUrl, fetchProjectConfig: customFetch, children, }: ZOIQProviderProps): react_jsx_runtime.JSX.Element;
105
- declare function useZOIQContext(): ZOIQContextValue | null;
106
-
107
- interface UseProjectSettingsResult {
108
- data: ProjectSettings | null;
109
- loading: boolean;
110
- error: Error | null;
111
- refetch: () => Promise<void>;
112
- }
113
- /**
114
- * Returns the full project theme/settings for the current project key.
115
- * Must be used within ZOIQProvider. Data is the same that the provider used to apply theme.
116
- */
117
- declare function useProjectSettings(): UseProjectSettingsResult;
118
-
119
- interface UseSectionFlagsResult {
120
- enabledIds: Set<string>;
121
- disabledIds: Set<string>;
122
- loading: boolean;
123
- error: Error | null;
124
- refetch: () => Promise<void>;
125
- }
126
- /**
127
- * Returns which section IDs are enabled or disabled for the current project.
128
- * Must be used within ZOIQProvider. Uses the same apiBaseUrl as the provider.
129
- */
130
- declare function useSectionFlags(): UseSectionFlagsResult;
131
-
132
- interface UseZOIQApiOptions {
133
- id?: string;
134
- query?: Record<string, string>;
135
- }
136
- interface UseZOIQApiResult<T> {
137
- data: T | null;
138
- loading: boolean;
139
- error: Error | null;
140
- refetch: () => Promise<void>;
141
- }
142
- /**
143
- * Fetches custom entity data for the current project.
144
- * Must be used within ZOIQProvider.
145
- */
146
- declare function useZOIQApi<T = unknown>(entity: string, options?: UseZOIQApiOptions): UseZOIQApiResult<T>;
147
-
148
- interface TextProps extends React.HTMLAttributes<HTMLElement> {
149
- children?: React.ReactNode;
150
- className?: string;
151
- as?: 'span' | 'p' | 'div';
152
- }
153
- declare const Text: ({ children, className, as: As, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
154
-
155
- interface TitleProps {
156
- children?: React.ReactNode;
157
- className?: string;
158
- }
159
- declare const Title: ({ children, className }: TitleProps) => react_jsx_runtime.JSX.Element;
160
-
161
- interface SubtitleProps {
162
- children?: React.ReactNode;
163
- className?: string;
164
- }
165
- declare const Subtitle: ({ children, className }: SubtitleProps) => react_jsx_runtime.JSX.Element;
166
-
167
- interface ScrollButtonProps {
168
- className?: string;
169
- /** Scroll Y threshold above which the button is shown (default 200) */
170
- threshold?: number;
171
- }
172
- declare const ScrollButton: ({ className, threshold }: ScrollButtonProps) => react_jsx_runtime.JSX.Element;
173
-
174
- interface ToggleThemeProps {
175
- className?: string;
176
- /** Callback when user requests theme toggle; host app controls actual theme state */
177
- onToggle?: () => void;
178
- /** Optional current theme name for rendering (e.g. "light" | "dark") */
179
- theme?: string;
180
- /** Content to show (e.g. icon). If not provided, shows "Theme" */
181
- children?: React.ReactNode;
182
- }
183
- declare const ToggleTheme: ({ className, onToggle, theme, children }: ToggleThemeProps) => react_jsx_runtime.JSX.Element;
184
-
185
- interface SectionProps {
186
- children?: React.ReactNode;
187
- className?: string;
188
- }
189
- declare const Section: ({ children, className }: SectionProps) => react_jsx_runtime.JSX.Element;
190
-
191
- /**
192
- * Placeholder for toast container. Host app should render Toaster from "sonner" (or similar)
193
- * inside the app; ZOIQ does not bundle a toast library.
194
- */
195
- declare const ToastContainer: () => null;
196
-
197
- interface PageProps {
198
- children?: React.ReactNode;
199
- className?: string;
200
- /** Optional full-width layout (no horizontal padding) */
201
- fullWidth?: boolean;
202
- }
203
- declare const Page: ({ children, className, fullWidth }: PageProps) => react_jsx_runtime.JSX.Element;
204
-
205
- interface HeaderProps {
206
- children?: React.ReactNode;
207
- className?: string;
208
- /** Optional left slot (e.g. logo, nav) */
209
- left?: React.ReactNode;
210
- /** Optional right slot (e.g. user menu, theme toggle) */
211
- right?: React.ReactNode;
212
- }
213
- declare const Header: ({ children, className, left, right }: HeaderProps) => react_jsx_runtime.JSX.Element;
214
-
215
- interface FooterProps {
216
- children?: React.ReactNode;
217
- className?: string;
218
- }
219
- declare const Footer: ({ children, className }: FooterProps) => react_jsx_runtime.JSX.Element;
220
-
221
- interface SecondarySidebarItem {
222
- label: string;
223
- href: string;
224
- icon?: React.ReactNode;
225
- }
226
- interface SecondarySidebarProps {
227
- items: SecondarySidebarItem[];
228
- className?: string;
229
- /** Optional: return true if item is active (e.g. from pathname) */
230
- isActive?: (item: SecondarySidebarItem) => boolean;
231
- /** Optional: custom link renderer (e.g. Next.js Link). Default: <a> */
232
- renderLink?: (item: SecondarySidebarItem, children: React.ReactNode) => React.ReactNode;
233
- }
234
- declare const SecondarySidebar: ({ items, className, isActive, renderLink }: SecondarySidebarProps) => react_jsx_runtime.JSX.Element;
235
-
236
- export { Footer, Header, Page, type ProjectSettings, ScrollButton, SecondarySidebar, type SecondarySidebarItem, type SecondarySidebarProps, Section, type SectionFlag, type SectionFlagsData, Subtitle, Text, Title, ToastContainer, ToggleTheme, ZOIQProvider, useProjectSettings, useSectionFlags, useZOIQApi, useZOIQContext };
8
+ export { test };