@wso2/oxygen-ui 0.4.0 → 0.5.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.
- package/.ai/AGENTS.md +1 -0
- package/.ai/theming.md +3 -0
- package/.claude/theming.md +3 -0
- package/bin/cli.js +118 -31
- package/dist/components/ComplexSelect/ComplexSelectDivider.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectListHeader.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemAvatar.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemIcon.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemText.d.ts +3 -0
- package/dist/components/Footer/Footer.d.ts +29 -26
- package/dist/components/Footer/FooterCopyright.d.ts +37 -0
- package/dist/components/Footer/FooterDivider.d.ts +28 -0
- package/dist/components/Footer/FooterLink.d.ts +38 -0
- package/dist/components/Footer/FooterVersion.d.ts +35 -0
- package/dist/components/Footer/index.d.ts +7 -0
- package/dist/components/UserMenu/UserMenu.d.ts +27 -32
- package/dist/components/UserMenu/UserMenuContext.d.ts +33 -0
- package/dist/components/UserMenu/UserMenuDivider.d.ts +22 -0
- package/dist/components/UserMenu/UserMenuHeader.d.ts +35 -0
- package/dist/components/UserMenu/UserMenuItem.d.ts +35 -0
- package/dist/components/UserMenu/UserMenuLogout.d.ts +33 -0
- package/dist/components/UserMenu/UserMenuTrigger.d.ts +33 -0
- package/dist/components/UserMenu/index.d.ts +9 -0
- package/dist/index.js +1246 -379
- package/dist/index.js.map +4 -4
- package/dist/styles/Themes/ChoreoTheme.d.ts +20 -0
- package/dist/styles/Themes/PaleBaseTheme.d.ts +25 -0
- package/dist/styles/Themes/PaleGray.d.ts +20 -0
- package/dist/styles/Themes/PaleIndigo.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +4 -0
- package/package.json +2 -2
package/.ai/AGENTS.md
CHANGED
|
@@ -54,6 +54,7 @@ import { DataGrid, Charts, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
54
54
|
- `OxygenTheme` - Default theme (recommended)
|
|
55
55
|
- `AcrylicOrangeTheme` - Orange accent variant
|
|
56
56
|
- `AcrylicPurpleTheme` - Purple accent variant
|
|
57
|
+
- `ChoreoTheme` - Choreo product theme (indigo-violet gradient)
|
|
57
58
|
- `ClassicTheme` - Traditional styling
|
|
58
59
|
- `HighContrastTheme` - Accessibility-focused
|
|
59
60
|
|
package/.ai/theming.md
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
| OxygenTheme | `OxygenTheme` | Default theme (Acrylic Base) |
|
|
18
18
|
| Acrylic Orange | `AcrylicOrangeTheme` | Glass-morphism effects, orange primary |
|
|
19
19
|
| Acrylic Purple | `AcrylicPurpleTheme` | Glass-morphism with purple accents |
|
|
20
|
+
| Choreo | `ChoreoTheme` | Choreo product theme (indigo-violet gradient) |
|
|
20
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
21
22
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
22
23
|
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
OxygenTheme,
|
|
26
27
|
AcrylicOrangeTheme,
|
|
27
28
|
AcrylicPurpleTheme,
|
|
29
|
+
ChoreoTheme,
|
|
28
30
|
ClassicTheme,
|
|
29
31
|
HighContrastTheme
|
|
30
32
|
} from '@wso2/oxygen-ui';
|
|
@@ -68,6 +70,7 @@ import {
|
|
|
68
70
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
69
71
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
70
72
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
73
|
+
{ key: 'choreo', label: 'Choreo', theme: ChoreoTheme },
|
|
71
74
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
72
75
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
73
76
|
]}
|
package/.claude/theming.md
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
| OxygenTheme | `OxygenTheme` | Default theme (Acrylic Base) |
|
|
18
18
|
| Acrylic Orange | `AcrylicOrangeTheme` | Glass-morphism effects, orange primary |
|
|
19
19
|
| Acrylic Purple | `AcrylicPurpleTheme` | Glass-morphism with purple accents |
|
|
20
|
+
| Choreo | `ChoreoTheme` | Choreo product theme (indigo-violet gradient) |
|
|
20
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
21
22
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
22
23
|
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
OxygenTheme,
|
|
26
27
|
AcrylicOrangeTheme,
|
|
27
28
|
AcrylicPurpleTheme,
|
|
29
|
+
ChoreoTheme,
|
|
28
30
|
ClassicTheme,
|
|
29
31
|
HighContrastTheme
|
|
30
32
|
} from '@wso2/oxygen-ui';
|
|
@@ -68,6 +70,7 @@ import {
|
|
|
68
70
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
69
71
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
70
72
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
73
|
+
{ key: 'choreo', label: 'Choreo', theme: ChoreoTheme },
|
|
71
74
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
72
75
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
73
76
|
]}
|
package/bin/cli.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { fileURLToPath } from 'url';
|
|
24
24
|
import { dirname, join, resolve } from 'path';
|
|
25
|
+
import { createInterface } from 'readline';
|
|
25
26
|
import {
|
|
26
27
|
existsSync,
|
|
27
28
|
mkdirSync,
|
|
@@ -73,6 +74,56 @@ For Oxygen UI component guidelines and patterns, see [.ai/oxygen-ui/components.m
|
|
|
73
74
|
const CLAUDE_IMPORT_MARKER = '.claude/oxygen-ui/CLAUDE.md';
|
|
74
75
|
const AGENTS_IMPORT_MARKER = '.ai/oxygen-ui/';
|
|
75
76
|
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// Interactive Prompt
|
|
79
|
+
// ============================================================================
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Prompt the user to select their AI assistant.
|
|
83
|
+
* Returns true for Claude mode, false for universal mode.
|
|
84
|
+
* Falls back to universal mode in non-interactive environments (CI/CD).
|
|
85
|
+
*/
|
|
86
|
+
function promptSelection() {
|
|
87
|
+
// Non-interactive environment — default to universal mode
|
|
88
|
+
if (!process.stdin.isTTY) {
|
|
89
|
+
return Promise.resolve(false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return new Promise((resolve) => {
|
|
93
|
+
const rl = createInterface({
|
|
94
|
+
input: process.stdin,
|
|
95
|
+
output: process.stdout,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
console.log('\n? Which AI assistant are you using?\n');
|
|
99
|
+
console.log(' 1. Claude Code (recommended \u2014 includes skills & Claude-specific docs)');
|
|
100
|
+
console.log(' 2. Other AI assistant (universal docs for any AI tool)\n');
|
|
101
|
+
|
|
102
|
+
rl.question('Select [1-2]: ', (answer) => {
|
|
103
|
+
rl.close();
|
|
104
|
+
const choice = answer.trim();
|
|
105
|
+
if (choice === '1') {
|
|
106
|
+
resolve(true);
|
|
107
|
+
} else {
|
|
108
|
+
resolve(false);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Detect previous setup mode by checking for existing project directories.
|
|
116
|
+
* Returns 'claude' | 'other' | null.
|
|
117
|
+
*/
|
|
118
|
+
function detectPreviousMode() {
|
|
119
|
+
const claudeExists = existsSync(resolve(process.cwd(), '.claude', 'oxygen-ui'));
|
|
120
|
+
const aiExists = existsSync(resolve(process.cwd(), '.ai', 'oxygen-ui'));
|
|
121
|
+
|
|
122
|
+
if (claudeExists) return 'claude';
|
|
123
|
+
if (aiExists) return 'other';
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
76
127
|
// ============================================================================
|
|
77
128
|
// Argument Parsing
|
|
78
129
|
// ============================================================================
|
|
@@ -277,10 +328,13 @@ function copySkillsDir() {
|
|
|
277
328
|
|
|
278
329
|
console.log('Copying Claude Code skills...\n');
|
|
279
330
|
|
|
280
|
-
//
|
|
331
|
+
// Internal-only skills excluded from consumer distribution
|
|
332
|
+
const INTERNAL_SKILLS = ['oxygen-sync'];
|
|
333
|
+
|
|
334
|
+
// Get list of skill directories (excluding internal-only skills)
|
|
281
335
|
const skillDirs = readdirSync(skillsSourceDir).filter(entry => {
|
|
282
336
|
const fullPath = join(skillsSourceDir, entry);
|
|
283
|
-
return statSync(fullPath).isDirectory();
|
|
337
|
+
return statSync(fullPath).isDirectory() && !INTERNAL_SKILLS.includes(entry);
|
|
284
338
|
});
|
|
285
339
|
|
|
286
340
|
let totalCopied = 0;
|
|
@@ -328,7 +382,6 @@ function initDefault() {
|
|
|
328
382
|
console.log(' - .ai/oxygen-ui/patterns.md (common patterns)');
|
|
329
383
|
console.log(' - .ai/oxygen-ui/theming.md (theme customization)');
|
|
330
384
|
console.log(' - .ai/oxygen-ui/migration.md (migration guide)\n');
|
|
331
|
-
console.log('For Claude Code with skills: npx @wso2/oxygen-ui init --claude\n');
|
|
332
385
|
}
|
|
333
386
|
|
|
334
387
|
/**
|
|
@@ -366,7 +419,14 @@ function initClaude() {
|
|
|
366
419
|
/**
|
|
367
420
|
* Initialize Oxygen UI AI documentation
|
|
368
421
|
*/
|
|
369
|
-
function init(
|
|
422
|
+
async function init(claudeFlag) {
|
|
423
|
+
let claudeMode = claudeFlag;
|
|
424
|
+
|
|
425
|
+
if (!claudeFlag) {
|
|
426
|
+
console.log('\nOxygen UI - AI Integration Setup');
|
|
427
|
+
claudeMode = await promptSelection();
|
|
428
|
+
}
|
|
429
|
+
|
|
370
430
|
if (claudeMode) {
|
|
371
431
|
initClaude();
|
|
372
432
|
} else {
|
|
@@ -404,7 +464,26 @@ function updateClaude() {
|
|
|
404
464
|
/**
|
|
405
465
|
* Update Oxygen UI AI documentation
|
|
406
466
|
*/
|
|
407
|
-
function update(
|
|
467
|
+
async function update(claudeFlag) {
|
|
468
|
+
let claudeMode = claudeFlag;
|
|
469
|
+
|
|
470
|
+
if (!claudeFlag) {
|
|
471
|
+
const previousMode = detectPreviousMode();
|
|
472
|
+
|
|
473
|
+
if (previousMode === 'claude') {
|
|
474
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
475
|
+
console.log('\nDetected previous Claude Code setup. Updating Claude docs...');
|
|
476
|
+
claudeMode = true;
|
|
477
|
+
} else if (previousMode === 'other') {
|
|
478
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
479
|
+
console.log('\nDetected previous universal setup. Updating universal docs...');
|
|
480
|
+
claudeMode = false;
|
|
481
|
+
} else {
|
|
482
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
483
|
+
claudeMode = await promptSelection();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
408
487
|
if (claudeMode) {
|
|
409
488
|
updateClaude();
|
|
410
489
|
} else {
|
|
@@ -427,24 +506,30 @@ Commands:
|
|
|
427
506
|
help Show this help message
|
|
428
507
|
|
|
429
508
|
Options:
|
|
430
|
-
--claude
|
|
509
|
+
--claude Skip prompt and use Claude Code mode directly
|
|
510
|
+
|
|
511
|
+
Interactive Behavior:
|
|
512
|
+
init Prompts to select your AI assistant (Claude Code or Other)
|
|
513
|
+
update Auto-detects previous setup mode from project files;
|
|
514
|
+
prompts only if no prior setup is found
|
|
515
|
+
--claude Bypasses the interactive prompt for CI/CD or scripted usage
|
|
431
516
|
|
|
432
517
|
Modes:
|
|
433
|
-
|
|
518
|
+
Universal (Other AI assistant):
|
|
434
519
|
- Creates AGENTS.md at project root
|
|
435
520
|
- Creates .ai/oxygen-ui/ folder with documentation
|
|
436
521
|
- Works with any AI assistant
|
|
437
522
|
|
|
438
|
-
Claude
|
|
523
|
+
Claude Code:
|
|
439
524
|
- Creates .claude/oxygen-ui/ folder with documentation
|
|
440
525
|
- Creates .claude/skills/ with invokable skills
|
|
441
526
|
- Updates root CLAUDE.md with reference
|
|
442
527
|
|
|
443
528
|
Examples:
|
|
444
|
-
npx @wso2/oxygen-ui init
|
|
445
|
-
npx @wso2/oxygen-ui init --claude
|
|
446
|
-
npx @wso2/oxygen-ui update
|
|
447
|
-
npx @wso2/oxygen-ui update --claude #
|
|
529
|
+
npx @wso2/oxygen-ui init # Interactive — choose your AI assistant
|
|
530
|
+
npx @wso2/oxygen-ui init --claude # Claude Code setup (skip prompt)
|
|
531
|
+
npx @wso2/oxygen-ui update # Auto-detects previous mode
|
|
532
|
+
npx @wso2/oxygen-ui update --claude # Force Claude mode update
|
|
448
533
|
|
|
449
534
|
Available Skills (Claude mode only):
|
|
450
535
|
/oxygen-component Generate Oxygen UI React components
|
|
@@ -460,22 +545,24 @@ Available Skills (Claude mode only):
|
|
|
460
545
|
|
|
461
546
|
const { command, flags } = parseArgs();
|
|
462
547
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
init
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
update
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
548
|
+
(async () => {
|
|
549
|
+
switch (command) {
|
|
550
|
+
case 'init':
|
|
551
|
+
await init(flags.claude);
|
|
552
|
+
break;
|
|
553
|
+
case 'update':
|
|
554
|
+
await update(flags.claude);
|
|
555
|
+
break;
|
|
556
|
+
case 'help':
|
|
557
|
+
case '--help':
|
|
558
|
+
case '-h':
|
|
559
|
+
showHelp();
|
|
560
|
+
break;
|
|
561
|
+
default:
|
|
562
|
+
if (command) {
|
|
563
|
+
console.error(`Unknown command: ${command}\n`);
|
|
564
|
+
}
|
|
565
|
+
showHelp();
|
|
566
|
+
process.exit(command ? 1 : 0);
|
|
567
|
+
}
|
|
568
|
+
})();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { DividerProps } from '@mui/material/Divider';
|
|
2
2
|
export type ComplexSelectDividerProps = DividerProps;
|
|
3
3
|
export declare function ComplexSelectDivider({ ...props }: ComplexSelectDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace ComplexSelectDivider {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
4
7
|
export default ComplexSelectDivider;
|
|
@@ -4,4 +4,7 @@ export interface ComplexSelectListHeaderProps extends ListSubheaderProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function ComplexSelectListHeader({ children, ...props }: ComplexSelectListHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ComplexSelectListHeader {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
export default ComplexSelectListHeader;
|
|
@@ -4,4 +4,7 @@ export interface ComplexSelectMenuItemAvatarProps extends AvatarProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function ComplexSelectMenuItemAvatar({ children, ...props }: ComplexSelectMenuItemAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ComplexSelectMenuItemAvatar {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
export default ComplexSelectMenuItemAvatar;
|
|
@@ -4,4 +4,7 @@ export interface ComplexSelectMenuItemIconProps extends ListItemIconProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function ComplexSelectMenuItemIcon({ children, ...props }: ComplexSelectMenuItemIconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ComplexSelectMenuItemIcon {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
export default ComplexSelectMenuItemIcon;
|
|
@@ -5,4 +5,7 @@ export interface ComplexSelectMenuItemTextProps extends ListItemTextProps {
|
|
|
5
5
|
secondary?: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare function ComplexSelectMenuItemText({ primary, secondary, ...props }: ComplexSelectMenuItemTextProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace ComplexSelectMenuItemText {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
8
11
|
export default ComplexSelectMenuItemText;
|
|
@@ -17,25 +17,16 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
import type { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
import { FooterCopyright } from './FooterCopyright';
|
|
21
|
+
import { FooterVersion } from './FooterVersion';
|
|
22
|
+
import { FooterLink } from './FooterLink';
|
|
23
|
+
import { FooterDivider } from './FooterDivider';
|
|
20
24
|
/**
|
|
21
|
-
* Props for the Footer component.
|
|
25
|
+
* Props for the Footer root component.
|
|
22
26
|
*/
|
|
23
27
|
export interface FooterProps {
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/** Company/organization name */
|
|
27
|
-
companyName?: string;
|
|
28
|
-
/** Link to terms and conditions */
|
|
29
|
-
termsUrl?: string;
|
|
30
|
-
/** Link to privacy policy */
|
|
31
|
-
privacyUrl?: string;
|
|
32
|
-
/** Optional version string to display */
|
|
33
|
-
version?: string;
|
|
34
|
-
/** Additional links to display */
|
|
35
|
-
links?: Array<{
|
|
36
|
-
label: string;
|
|
37
|
-
url: string;
|
|
38
|
-
}>;
|
|
28
|
+
/** Child elements (Copyright, Version, Link, Divider components) */
|
|
29
|
+
children: React.ReactNode;
|
|
39
30
|
/** Additional sx props */
|
|
40
31
|
sx?: SxProps<Theme>;
|
|
41
32
|
}
|
|
@@ -56,16 +47,28 @@ export interface FooterProps {
|
|
|
56
47
|
* Usage:
|
|
57
48
|
* ```tsx
|
|
58
49
|
* <Footer
|
|
59
|
-
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
50
|
+
/**
|
|
51
|
+
* Footer - Application footer component.
|
|
52
|
+
*
|
|
53
|
+
* A compound component for building flexible footer layouts.
|
|
54
|
+
* Use the sub-components to compose your footer structure.
|
|
55
|
+
*
|
|
56
|
+
* Composition pattern example:
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <Footer>
|
|
59
|
+
* <Footer.Copyright>© 2024 Your Company. All rights reserved.</Footer.Copyright>
|
|
60
|
+
* <Footer.Divider />
|
|
61
|
+
* <Footer.Version>v2.1.0</Footer.Version>
|
|
62
|
+
* <Footer.Link href="/terms">Terms & Conditions</Footer.Link>
|
|
63
|
+
* <Footer.Link href="/privacy">Privacy Policy</Footer.Link>
|
|
64
|
+
* </Footer>
|
|
68
65
|
* ```
|
|
69
66
|
*/
|
|
70
|
-
|
|
67
|
+
declare const Footer: React.FC<FooterProps> & {
|
|
68
|
+
Copyright: typeof FooterCopyright;
|
|
69
|
+
Version: typeof FooterVersion;
|
|
70
|
+
Link: typeof FooterLink;
|
|
71
|
+
Divider: typeof FooterDivider;
|
|
72
|
+
};
|
|
73
|
+
export { Footer };
|
|
71
74
|
export default Footer;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Props for the FooterCopyright component.
|
|
21
|
+
*/
|
|
22
|
+
export interface FooterCopyrightProps {
|
|
23
|
+
/** Copyright text to display */
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* FooterCopyright - Copyright text for the footer.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Footer.Copyright>
|
|
32
|
+
* © 2024 Your Company. All rights reserved.
|
|
33
|
+
* </Footer.Copyright>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const FooterCopyright: React.FC<FooterCopyrightProps>;
|
|
37
|
+
export default FooterCopyright;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* FooterDivider - Vertical divider for the footer.
|
|
21
|
+
*
|
|
22
|
+
* Usage:
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Footer.Divider />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const FooterDivider: React.FC;
|
|
28
|
+
export default FooterDivider;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import { LinkProps } from '@mui/material/Link';
|
|
20
|
+
/**
|
|
21
|
+
* Props for the FooterLink component.
|
|
22
|
+
*/
|
|
23
|
+
export interface FooterLinkProps extends Omit<LinkProps, 'underline'> {
|
|
24
|
+
/** Link text */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Link URL */
|
|
27
|
+
href: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* FooterLink - Link element for the footer.
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Footer.Link href="/terms">Terms & Conditions</Footer.Link>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const FooterLink: React.FC<FooterLinkProps>;
|
|
38
|
+
export default FooterLink;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Props for the FooterVersion component.
|
|
21
|
+
*/
|
|
22
|
+
export interface FooterVersionProps {
|
|
23
|
+
/** Version text to display */
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* FooterVersion - Version display for the footer.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Footer.Version>v2.1.0</Footer.Version>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const FooterVersion: React.FC<FooterVersionProps>;
|
|
35
|
+
export default FooterVersion;
|
|
@@ -17,3 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export { Footer, default } from './Footer';
|
|
19
19
|
export type { FooterProps } from './Footer';
|
|
20
|
+
export { FooterCopyright } from './FooterCopyright';
|
|
21
|
+
export type { FooterCopyrightProps } from './FooterCopyright';
|
|
22
|
+
export { FooterVersion } from './FooterVersion';
|
|
23
|
+
export type { FooterVersionProps } from './FooterVersion';
|
|
24
|
+
export { FooterLink } from './FooterLink';
|
|
25
|
+
export type { FooterLinkProps } from './FooterLink';
|
|
26
|
+
export { FooterDivider } from './FooterDivider';
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
|
+
import { UserMenuTrigger } from './UserMenuTrigger';
|
|
20
|
+
import { UserMenuHeader } from './UserMenuHeader';
|
|
21
|
+
import { UserMenuItem } from './UserMenuItem';
|
|
22
|
+
import { UserMenuLogout } from './UserMenuLogout';
|
|
23
|
+
import { UserMenuDivider } from './UserMenuDivider';
|
|
19
24
|
/**
|
|
20
25
|
* User information for the UserMenu.
|
|
21
26
|
*/
|
|
@@ -30,45 +35,35 @@ export interface UserMenuUser {
|
|
|
30
35
|
role?: string;
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
|
-
* Props for the UserMenu component.
|
|
38
|
+
* Props for the UserMenu root component (composition pattern).
|
|
34
39
|
*/
|
|
35
40
|
export interface UserMenuProps {
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/** Callback when profile is clicked */
|
|
39
|
-
onProfileClick?: () => void;
|
|
40
|
-
/** Callback when settings is clicked */
|
|
41
|
-
onSettingsClick?: () => void;
|
|
42
|
-
/** Callback when billing is clicked */
|
|
43
|
-
onBillingClick?: () => void;
|
|
44
|
-
/** Callback when logout is clicked */
|
|
45
|
-
onLogout?: () => void;
|
|
41
|
+
/** Child elements (Trigger, Header, Item components) */
|
|
42
|
+
children: React.ReactNode;
|
|
46
43
|
}
|
|
47
44
|
/**
|
|
48
|
-
* UserMenu -
|
|
45
|
+
* UserMenu - Dropdown menu for user account actions.
|
|
49
46
|
*
|
|
50
|
-
*
|
|
51
|
-
* - User avatar button that opens dropdown
|
|
52
|
-
* - User info header with name, email, and role badge
|
|
53
|
-
* - Menu items for Profile, Settings, Billing, and Logout
|
|
54
|
-
* - Destructive styling for logout action
|
|
55
|
-
* - Role/plan badge display (e.g., "Pro")
|
|
47
|
+
* A compound component using the composition pattern for flexible menu customization.
|
|
56
48
|
*
|
|
57
|
-
*
|
|
49
|
+
* Composition pattern example:
|
|
58
50
|
* ```tsx
|
|
59
|
-
* <UserMenu
|
|
60
|
-
* user={
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* }}
|
|
66
|
-
*
|
|
67
|
-
* onSettingsClick={() => navigate('/settings')}
|
|
68
|
-
* onBillingClick={() => navigate('/billing')}
|
|
69
|
-
* onLogout={() => handleLogout()}
|
|
70
|
-
* />
|
|
51
|
+
* <UserMenu>
|
|
52
|
+
* <UserMenu.Trigger user={mockUser} />
|
|
53
|
+
* <UserMenu.Header user={mockUser} />
|
|
54
|
+
* <UserMenu.Item icon={<UserIcon />} label="Profile" onClick={...} />
|
|
55
|
+
* <UserMenu.Item icon={<Settings />} label="Settings" onClick={...} />
|
|
56
|
+
* <UserMenu.Divider />
|
|
57
|
+
* <UserMenu.Item icon={<LogOut />} label="Log out" destructive onClick={...} />
|
|
58
|
+
* </UserMenu>
|
|
71
59
|
* ```
|
|
72
60
|
*/
|
|
73
|
-
|
|
61
|
+
declare const UserMenu: React.FC<UserMenuProps> & {
|
|
62
|
+
Trigger: typeof UserMenuTrigger;
|
|
63
|
+
Header: typeof UserMenuHeader;
|
|
64
|
+
Item: typeof UserMenuItem;
|
|
65
|
+
Logout: typeof UserMenuLogout;
|
|
66
|
+
Divider: typeof UserMenuDivider;
|
|
67
|
+
};
|
|
68
|
+
export { UserMenu };
|
|
74
69
|
export default UserMenu;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Context for UserMenu state and actions.
|
|
21
|
+
*/
|
|
22
|
+
interface UserMenuContextType {
|
|
23
|
+
open: boolean;
|
|
24
|
+
anchorEl: null | HTMLElement;
|
|
25
|
+
handleOpen: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
26
|
+
handleClose: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const UserMenuContext: React.Context<UserMenuContextType | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Hook to use UserMenu context in sub-components.
|
|
31
|
+
*/
|
|
32
|
+
export declare const useUserMenu: () => UserMenuContextType;
|
|
33
|
+
export {};
|