@andre-gra/oryx-ui 1.0.0

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.
@@ -0,0 +1,622 @@
1
+ import { Context } from 'react';
2
+ import { default as default_2 } from 'react';
3
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
4
+ import { ReactNode } from 'react';
5
+
6
+ /**
7
+ * An accessible accordion component for expanding/collapsing content sections.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <Accordion items={[
12
+ * { mainText: "Section 1", collapsibleText: "Content 1" },
13
+ * { mainText: "Section 2", collapsibleText: "Content 2" }
14
+ * ]} />
15
+ * ```
16
+ */
17
+ export declare const Accordion: ({ items, className }: AccordionProps) => JSX_2.Element;
18
+
19
+ /**
20
+ * Item structure for Accordion
21
+ */
22
+ export declare interface AccordionItem {
23
+ /** Header text displayed on the trigger */
24
+ mainText: string;
25
+ /** Content revealed when expanded */
26
+ collapsibleText: string;
27
+ }
28
+
29
+ /**
30
+ * Props for the Accordion component
31
+ */
32
+ export declare interface AccordionProps {
33
+ /** Array of accordion items */
34
+ items: AccordionItem[];
35
+ /** Additional className for the root element */
36
+ className?: string;
37
+ }
38
+
39
+ /**
40
+ * Component that tracks theme and size changes and reports to the agent
41
+ * Should be placed inside ThemeProvider, SizeProvider, and ThemeAgentProvider
42
+ */
43
+ export declare const AgentInteractionTracker: () => null;
44
+
45
+ /**
46
+ * Agent automation mode
47
+ */
48
+ export declare type AgentMode = "passive" | "semi-automatic" | "full-automatic";
49
+
50
+ /**
51
+ * AI agent recommendation with confidence score
52
+ */
53
+ export declare interface AgentRecommendation {
54
+ theme: Theme;
55
+ size: Size;
56
+ confidence: number;
57
+ reason: string;
58
+ }
59
+
60
+ /**
61
+ * Overall agent state and configuration
62
+ */
63
+ export declare interface AgentState {
64
+ mode: AgentMode;
65
+ isActive: boolean;
66
+ isLearning: boolean;
67
+ interactionCount: number;
68
+ lastRecommendation?: AgentRecommendation;
69
+ currentSession: {
70
+ theme: Theme;
71
+ size: Size;
72
+ startTime: number;
73
+ };
74
+ }
75
+
76
+ /**
77
+ * A modal dialog for confirming destructive actions.
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * <AlertDialog
82
+ * texts={{
83
+ * buttonTrigger: "Delete",
84
+ * content: "Are you sure?",
85
+ * description: "This action cannot be undone.",
86
+ * buttonCancel: "Cancel",
87
+ * action: "Delete"
88
+ * }}
89
+ * onAction={() => handleDelete()}
90
+ * />
91
+ * ```
92
+ */
93
+ export declare const AlertDialog: ({ texts, onAction, onCancel, className }: AlertDialogProps) => JSX_2.Element;
94
+
95
+ /**
96
+ * Props for the AlertDialog component
97
+ */
98
+ export declare interface AlertDialogProps {
99
+ /** Text configuration */
100
+ texts: AlertDialogTexts;
101
+ /** Callback when action is confirmed */
102
+ onAction?: () => void;
103
+ /** Callback when dialog is cancelled */
104
+ onCancel?: () => void;
105
+ /** Additional className for trigger */
106
+ className?: string;
107
+ }
108
+
109
+ /**
110
+ * Text configuration for AlertDialog
111
+ */
112
+ export declare interface AlertDialogTexts {
113
+ /** Text for the trigger button */
114
+ buttonTrigger: string;
115
+ /** Title/heading content */
116
+ content: string;
117
+ /** Description text */
118
+ description: string;
119
+ /** Cancel button text */
120
+ buttonCancel: string;
121
+ /** Confirm action button text */
122
+ action: string;
123
+ }
124
+
125
+ declare type Amber = "amber";
126
+
127
+ declare type AmberDark = "amberDark";
128
+
129
+ declare type Blue = "blue";
130
+
131
+ declare type BlueDark = "blueDark";
132
+
133
+ declare type Brown = "brown";
134
+
135
+ declare type BrownDark = "brownDark";
136
+
137
+ declare type Crimson = "crimson";
138
+
139
+ declare type CrimsonDark = "crimsonDark";
140
+
141
+ declare type Cyan = "cyan";
142
+
143
+ declare type CyanDark = "cyanDark";
144
+
145
+ declare type Grass = "grass";
146
+
147
+ declare type GrassDark = "grassDark";
148
+
149
+ declare type Green = "green";
150
+
151
+ declare type GreenDark = "greenDark";
152
+
153
+ declare type Indigo = "indigo";
154
+
155
+ declare type IndigoDark = "indigoDark";
156
+
157
+ /**
158
+ * Tracks user interactions with theme and size selections
159
+ */
160
+ export declare class InteractionTracker {
161
+ private interactions;
162
+ private currentSession;
163
+ constructor();
164
+ /**
165
+ * Start tracking a new theme/size session
166
+ */
167
+ startSession(theme: Theme, size: Size): void;
168
+ /**
169
+ * End the current session and record the interaction
170
+ */
171
+ endSession(): void;
172
+ /**
173
+ * Get all recorded interactions
174
+ */
175
+ getInteractions(): StyleInteraction[];
176
+ /**
177
+ * Get interactions within a time range
178
+ */
179
+ getInteractionsInRange(startTime: number, endTime: number): StyleInteraction[];
180
+ /**
181
+ * Get recent interactions (last N days)
182
+ */
183
+ getRecentInteractions(days?: number): StyleInteraction[];
184
+ /**
185
+ * Clear all interaction history
186
+ */
187
+ clearHistory(): void;
188
+ /**
189
+ * Get total number of interactions
190
+ */
191
+ getInteractionCount(): number;
192
+ /**
193
+ * Load interactions from localStorage
194
+ */
195
+ private loadFromStorage;
196
+ /**
197
+ * Save interactions to localStorage
198
+ */
199
+ private saveToStorage;
200
+ }
201
+
202
+ declare type Lime = "lime";
203
+
204
+ declare type LimeDark = "limeDark";
205
+
206
+ declare type Mint = "mint";
207
+
208
+ declare type MintDark = "mintDark";
209
+
210
+ /**
211
+ * A responsive navigation menu with dropdowns and featured items.
212
+ *
213
+ * @example
214
+ * ```tsx
215
+ * <NavigationMenu items={[
216
+ * {
217
+ * title: "Products",
218
+ * item: [
219
+ * { type: "card", title: "Featured", href: "/", text: "Our main product" },
220
+ * { type: "text", title: "Other", href: "/other", text: "Description" }
221
+ * ]
222
+ * },
223
+ * { title: "About", href: "/about" }
224
+ * ]} />
225
+ * ```
226
+ */
227
+ export declare const NavigationMenu: ({ items, className }: NavigationMenuProps) => JSX_2.Element;
228
+
229
+ /**
230
+ * Navigation menu item content
231
+ */
232
+ export declare interface NavigationMenuItem {
233
+ /** Item display type: "card" for featured, "text" for simple */
234
+ type: "card" | "text";
235
+ /** Item title */
236
+ title: string;
237
+ /** Link URL */
238
+ href: string;
239
+ /** Description text */
240
+ text: string;
241
+ }
242
+
243
+ /**
244
+ * Props for the NavigationMenu component
245
+ */
246
+ export declare interface NavigationMenuProps {
247
+ /** Menu sections */
248
+ items: NavigationMenuSection[];
249
+ /** Additional className */
250
+ className?: string;
251
+ }
252
+
253
+ /**
254
+ * Navigation menu section
255
+ */
256
+ export declare interface NavigationMenuSection {
257
+ /** Items in this section (omit for simple link) */
258
+ item?: NavigationMenuItem[];
259
+ /** Section title */
260
+ title: string;
261
+ /** Direct link href (for sections without dropdown) */
262
+ href?: string;
263
+ }
264
+
265
+ declare type Orange = "orange";
266
+
267
+ declare type OrangeDark = "orangeDark";
268
+
269
+ /**
270
+ * Unified provider that wraps all Oryx UI context providers.
271
+ * Use this at the root of your application to enable theming, sizing, and AI agent features.
272
+ *
273
+ * @example
274
+ * ```tsx
275
+ * import { OryxProvider } from 'oryx-ui';
276
+ * import 'oryx-ui/styles';
277
+ *
278
+ * function App() {
279
+ * return (
280
+ * <OryxProvider>
281
+ * <YourApp />
282
+ * </OryxProvider>
283
+ * );
284
+ * }
285
+ * ```
286
+ */
287
+ export declare const OryxProvider: ({ children, defaultTheme: _defaultTheme, defaultSize: _defaultSize, enableAgent, }: OryxProviderProps) => JSX_2.Element;
288
+
289
+ /**
290
+ * Props for OryxProvider
291
+ */
292
+ export declare interface OryxProviderProps {
293
+ /** Child components */
294
+ children: ReactNode;
295
+ /** Default theme (reserved for future use) */
296
+ defaultTheme?: Theme;
297
+ /** Default size (reserved for future use) */
298
+ defaultSize?: Size;
299
+ /** Enable AI theme agent (defaults to true) */
300
+ enableAgent?: boolean;
301
+ }
302
+
303
+ declare type Pink = "pink";
304
+
305
+ declare type PinkDark = "pinkDark";
306
+
307
+ declare type Plum = "plum";
308
+
309
+ declare type PlumDark = "plumDark";
310
+
311
+ /**
312
+ * A popover component with form fields.
313
+ *
314
+ * @example
315
+ * ```tsx
316
+ * <Popover
317
+ * buttonTriggerLabel="Settings"
318
+ * fields={[
319
+ * {
320
+ * fieldTitle: "Dimensions",
321
+ * field: [{ label: "Width", htmlFor: "width", id: "width", defaultValue: "100%" }]
322
+ * }
323
+ * ]}
324
+ * />
325
+ * ```
326
+ */
327
+ export declare const Popover: ({ buttonTriggerLabel, fields, className }: PopoverProps) => JSX_2.Element;
328
+
329
+ /**
330
+ * Field definition for Popover form
331
+ */
332
+ export declare interface PopoverField {
333
+ /** Field label */
334
+ label: string;
335
+ /** htmlFor attribute */
336
+ htmlFor: string;
337
+ /** Input id */
338
+ id: string;
339
+ /** Default value */
340
+ defaultValue?: string;
341
+ }
342
+
343
+ /**
344
+ * Field group with title
345
+ */
346
+ export declare interface PopoverFieldGroup {
347
+ /** Fields in this group */
348
+ field: PopoverField[];
349
+ /** Group title */
350
+ fieldTitle: string;
351
+ }
352
+
353
+ /**
354
+ * Props for the Popover component
355
+ */
356
+ export declare interface PopoverProps {
357
+ /** Aria label for trigger button */
358
+ buttonTriggerLabel?: string;
359
+ /** Aria label for close button */
360
+ buttonCloseLabel?: string;
361
+ /** Field groups to render */
362
+ fields: PopoverFieldGroup[];
363
+ /** Additional className */
364
+ className?: string;
365
+ }
366
+
367
+ declare type ProviderProps = {
368
+ children: default_2.ReactNode;
369
+ };
370
+
371
+ declare type ProviderProps_2 = {
372
+ children: default_2.ReactNode;
373
+ };
374
+
375
+ declare type ProviderProps_3 = {
376
+ children: React.ReactNode;
377
+ onRecommendation?: (recommendation: AgentRecommendation) => void;
378
+ };
379
+
380
+ declare type Purple = "purple";
381
+
382
+ declare type PurpleDark = "purpleDark";
383
+
384
+ declare type Red = "red";
385
+
386
+ declare type RedDark = "redDark";
387
+
388
+ /**
389
+ * A styled select/dropdown component with grouped options.
390
+ *
391
+ * @example
392
+ * ```tsx
393
+ * <Select
394
+ * label="Fruits"
395
+ * placeholder="Select a fruit..."
396
+ * options={[
397
+ * { label: "Fruits", group: [{ value: "apple", label: "Apple" }] }
398
+ * ]}
399
+ * onValueChange={(value) => console.log(value)}
400
+ * />
401
+ * ```
402
+ */
403
+ export declare const Select: ({ label, placeholder, options, value, onValueChange, className, id, }: SelectProps) => JSX_2.Element;
404
+
405
+ /**
406
+ * Individual option item
407
+ */
408
+ export declare interface SelectOption {
409
+ /** Display label */
410
+ label: string;
411
+ /** Value to be submitted */
412
+ value: string;
413
+ /** Whether option is disabled */
414
+ disabled?: boolean;
415
+ }
416
+
417
+ /**
418
+ * Group of options with a label
419
+ */
420
+ export declare interface SelectOptionGroup {
421
+ /** Options in this group */
422
+ group: SelectOption[];
423
+ /** Group label */
424
+ label: string;
425
+ }
426
+
427
+ /**
428
+ * Props for the Select component
429
+ */
430
+ export declare interface SelectProps {
431
+ /** Accessible label for the select */
432
+ label: string;
433
+ /** Placeholder text when no value selected */
434
+ placeholder?: string;
435
+ /** Grouped options */
436
+ options: SelectOptionGroup[];
437
+ /** Controlled value */
438
+ value?: string;
439
+ /** Callback when value changes */
440
+ onValueChange?: (value: string) => void;
441
+ /** Additional className */
442
+ className?: string;
443
+ /** Optional ID for accessibility */
444
+ id?: string;
445
+ }
446
+
447
+ export declare type Size = "2" | "3" | "4";
448
+
449
+ export declare const SizeContext: default_2.Context<SizeContextProps | null>;
450
+
451
+ export declare interface SizeContextProps {
452
+ size: Size;
453
+ changeSize: (size: Size) => void;
454
+ }
455
+
456
+ export declare const SizeProvider: default_2.FC<ProviderProps_2>;
457
+
458
+ declare type Sky = "sky";
459
+
460
+ declare type SkyDark = "skyDark";
461
+
462
+ /**
463
+ * Represents a single interaction event when user changes theme or size
464
+ */
465
+ export declare interface StyleInteraction {
466
+ theme: Theme;
467
+ size: Size;
468
+ timestamp: number;
469
+ duration?: number;
470
+ dayOfWeek: number;
471
+ hourOfDay: number;
472
+ }
473
+
474
+ /**
475
+ * Aggregated preference data for a specific theme+size combination
476
+ */
477
+ export declare interface StylePreference {
478
+ theme: Theme;
479
+ size: Size;
480
+ usageCount: number;
481
+ totalDuration: number;
482
+ lastUsed: number;
483
+ score: number;
484
+ timePatterns: {
485
+ morning: number;
486
+ afternoon: number;
487
+ evening: number;
488
+ night: number;
489
+ };
490
+ dayPatterns: number[];
491
+ }
492
+
493
+ declare type Teal = "teal";
494
+
495
+ declare type TealDark = "tealDark";
496
+
497
+ export declare type Theme = `theme-${Amber | Teal | TealDark | AmberDark | Mint | MintDark | TomatoDark | Tomato | Red | RedDark | Crimson | CrimsonDark | Pink | PinkDark | Plum | PlumDark | Purple | PurpleDark | Violet | VioletDark | Indigo | IndigoDark | Blue | BlueDark | Cyan | CyanDark | GreenDark | Green | GrassDark | Grass | OrangeDark | Orange | BrownDark | Brown | SkyDark | Sky | Lime | LimeDark | Yellow | YellowDark}`;
498
+
499
+ /**
500
+ * AI Agent that learns user preferences and recommends theme/size combinations
501
+ */
502
+ export declare class ThemeAgent {
503
+ private tracker;
504
+ private preferences;
505
+ private mode;
506
+ constructor();
507
+ /**
508
+ * Record a theme/size change
509
+ */
510
+ recordChange(theme: Theme, size: Size): void;
511
+ /**
512
+ * Generates a theme based on a natural language prompt.
513
+ * For now, this is a simplified version using keyword matching.
514
+ */
515
+ generateThemeFromPrompt(prompt: string): Theme;
516
+ /**
517
+ * Get current recommendation based on learned preferences
518
+ */
519
+ getRecommendation(): AgentRecommendation | null;
520
+ /**
521
+ * Get insights about user preferences
522
+ */
523
+ getInsights(): string[];
524
+ /**
525
+ * Set agent mode
526
+ */
527
+ setMode(mode: AgentMode): void;
528
+ /**
529
+ * Get current mode
530
+ */
531
+ getMode(): AgentMode;
532
+ /**
533
+ * Get interaction count
534
+ */
535
+ getInteractionCount(): number;
536
+ /**
537
+ * Update preferences based on interaction history
538
+ */
539
+ private updatePreferences;
540
+ /**
541
+ * Calculate preference score
542
+ */
543
+ private calculateScore;
544
+ /**
545
+ * Update time pattern for a preference
546
+ */
547
+ private updateTimePattern;
548
+ /**
549
+ * Get time-based boost for a preference
550
+ */
551
+ private getTimeBoost;
552
+ /**
553
+ * Get user's time preferences as a string
554
+ */
555
+ private getTimePreferences;
556
+ /**
557
+ * Generate human-readable reason for recommendation
558
+ */
559
+ private generateReason;
560
+ /**
561
+ * Get preference key
562
+ */
563
+ private getPreferenceKey;
564
+ /**
565
+ * Load preferences from localStorage
566
+ */
567
+ private loadPreferences;
568
+ /**
569
+ * Save preferences to localStorage
570
+ */
571
+ private savePreferences;
572
+ }
573
+
574
+ export declare const ThemeAgentContext: Context<ThemeAgentContextValue | null>;
575
+
576
+ export declare interface ThemeAgentContextValue {
577
+ state: AgentState;
578
+ recommendation: AgentRecommendation | null;
579
+ enableAgent: () => void;
580
+ disableAgent: () => void;
581
+ setMode: (mode: AgentMode) => void;
582
+ getInsights: () => string[];
583
+ recordInteraction: (theme: Theme, size: Size) => void;
584
+ applyRecommendation: ((rec: AgentRecommendation) => void) | null;
585
+ generateThemeFromPrompt: (prompt: string) => Theme | null;
586
+ }
587
+
588
+ export declare const ThemeAgentPanel: () => JSX_2.Element | null;
589
+
590
+ export declare const ThemeAgentProvider: React.FC<ProviderProps_3>;
591
+
592
+ export declare const ThemeContext: default_2.Context<ThemeContextProps | null>;
593
+
594
+ export declare interface ThemeContextProps {
595
+ theme: Theme;
596
+ changeTheme: (theme: Theme) => void;
597
+ }
598
+
599
+ export declare const ThemeProvider: default_2.FC<ProviderProps>;
600
+
601
+ declare type Tomato = "tomato";
602
+
603
+ declare type TomatoDark = "tomatoDark";
604
+
605
+ export declare const useSize: () => SizeContextProps;
606
+
607
+ export declare const useTheme: () => ThemeContextProps;
608
+
609
+ /**
610
+ * Hook to access the theme agent from components
611
+ */
612
+ export declare const useThemeAgent: () => ThemeAgentContextValue;
613
+
614
+ declare type Violet = "violet";
615
+
616
+ declare type VioletDark = "violetDark";
617
+
618
+ declare type Yellow = "yellow";
619
+
620
+ declare type YellowDark = "yellowDark";
621
+
622
+ export { }