@donotdev/ui 0.0.2 → 0.0.4
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/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +19 -32
- package/dist/components/common/FeatureCard.d.ts +7 -19
- package/dist/components/common/FeatureCard.d.ts.map +1 -1
- package/dist/components/common/FeatureCard.js +5 -29
- package/dist/components/common/TechBento.d.ts +15 -3
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +20 -2
- package/dist/components/cookie-consent/CookieConsent.d.ts.map +1 -1
- package/dist/components/cookie-consent/CookieConsent.js +2 -41
- package/dist/components/cookie-consent/index.d.ts +0 -1
- package/dist/components/cookie-consent/index.d.ts.map +1 -1
- package/dist/components/cookie-consent/index.js +1 -1
- package/dist/components/layout/components/DropdownNavigation.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.d.ts +1 -1
- package/dist/components/layout/components/header/ThemeToggle.d.ts.map +1 -1
- package/dist/components/layout/components/header/ThemeToggle.js +5 -4
- package/dist/dndev.css +373 -249
- package/dist/index.js +4 -4
- package/dist/internal/devtools/DebugTools.d.ts.map +1 -1
- package/dist/internal/devtools/DebugTools.js +8 -4
- package/dist/internal/devtools/components/ConfigTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/ConfigTab.js +33 -133
- package/dist/internal/devtools/components/DebugDialog.d.ts.map +1 -1
- package/dist/internal/devtools/components/DebugDialog.js +11 -520
- package/dist/internal/devtools/components/DesignTab.d.ts +2 -0
- package/dist/internal/devtools/components/DesignTab.d.ts.map +1 -0
- package/dist/internal/devtools/components/DesignTab.js +431 -0
- package/dist/internal/devtools/components/StoresTab.d.ts.map +1 -1
- package/dist/internal/devtools/components/StoresTab.js +54 -102
- package/dist/internal/devtools/components/index.d.ts +1 -6
- package/dist/internal/devtools/components/index.d.ts.map +1 -1
- package/dist/internal/devtools/components/index.js +1 -6
- package/dist/internal/devtools/utils/index.d.ts +0 -1
- package/dist/internal/devtools/utils/index.d.ts.map +1 -1
- package/dist/internal/devtools/utils/index.js +0 -1
- package/dist/internal/initializers/BaseStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/BaseStoresInitializer.js +36 -59
- package/dist/internal/layout/DnDevLayout.js +3 -3
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +6 -1
- package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +3 -1
- package/dist/internal/layout/zones/DnDevFooter.js +2 -2
- package/dist/routing/AuthGuard.d.ts +14 -10
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +25 -22
- package/dist/routing/Link.d.ts +2 -2
- package/dist/routing/Link.js +2 -2
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/hooks.vite.js +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.d.ts +2 -36
- package/dist/routing/hooks/useRedirectGuard.next.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +14 -55
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts +2 -36
- package/dist/routing/hooks/useRedirectGuard.vite.d.ts.map +1 -1
- package/dist/routing/hooks/useRedirectGuard.vite.js +14 -55
- package/dist/routing/index.d.ts +0 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +1 -1
- package/dist/styles/index.css +373 -249
- package/dist/utils/assetResolver.d.ts +5 -5
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +26 -15
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/tList.d.ts +30 -0
- package/dist/utils/tList.d.ts.map +1 -0
- package/dist/utils/tList.js +51 -0
- package/dist/utils/useAuthSafe.d.ts +25 -12
- package/dist/utils/useAuthSafe.d.ts.map +1 -1
- package/dist/utils/useAuthSafe.js +3 -1
- package/dist/utils/useAuthVisibility.d.ts +3 -3
- package/dist/utils/useAuthVisibility.d.ts.map +1 -1
- package/dist/utils/useAuthVisibility.js +25 -21
- package/dist/utils/useBillingVisibility.d.ts +2 -2
- package/dist/utils/useBillingVisibility.d.ts.map +1 -1
- package/dist/utils/useBillingVisibility.js +12 -13
- package/dist/utils/useCrudSafe.d.ts +1 -1
- package/dist/utils/useCrudSafe.d.ts.map +1 -1
- package/dist/utils/useCrudSafe.js +26 -13
- package/dist/utils/useOAuthSafe.d.ts +25 -12
- package/dist/utils/useOAuthSafe.d.ts.map +1 -1
- package/dist/utils/useStripeBillingSafe.d.ts +30 -18
- package/dist/utils/useStripeBillingSafe.d.ts.map +1 -1
- package/dist/utils/useStripeBillingSafe.js +5 -6
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +5 -5
- package/dist/vite-routing/RootLayout.d.ts.map +1 -1
- package/dist/vite-routing/RootLayout.js +34 -7
- package/package.json +9 -9
- package/dist/internal/devtools/components/AuthTab.d.ts +0 -2
- package/dist/internal/devtools/components/AuthTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/AuthTab.js +0 -98
- package/dist/internal/devtools/components/ColorRatioTab.d.ts +0 -2
- package/dist/internal/devtools/components/ColorRatioTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/ColorRatioTab.js +0 -322
- package/dist/internal/devtools/components/DebugToggle.d.ts +0 -2
- package/dist/internal/devtools/components/DebugToggle.d.ts.map +0 -1
- package/dist/internal/devtools/components/DebugToggle.js +0 -57
- package/dist/internal/devtools/components/EnvironmentTab.d.ts +0 -2
- package/dist/internal/devtools/components/EnvironmentTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/EnvironmentTab.js +0 -26
- package/dist/internal/devtools/components/I18nTab.d.ts +0 -2
- package/dist/internal/devtools/components/I18nTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/I18nTab.js +0 -76
- package/dist/internal/devtools/components/OAuthGuideButton.d.ts +0 -10
- package/dist/internal/devtools/components/OAuthGuideButton.d.ts.map +0 -1
- package/dist/internal/devtools/components/OAuthGuideButton.js +0 -71
- package/dist/internal/devtools/components/StripeDebugTab.d.ts +0 -2
- package/dist/internal/devtools/components/StripeDebugTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/StripeDebugTab.js +0 -175
- package/dist/internal/devtools/components/ThemesTab.d.ts +0 -2
- package/dist/internal/devtools/components/ThemesTab.d.ts.map +0 -1
- package/dist/internal/devtools/components/ThemesTab.js +0 -77
- package/dist/internal/devtools/utils/spacingAnalyzer.d.ts +0 -15
- package/dist/internal/devtools/utils/spacingAnalyzer.d.ts.map +0 -1
- package/dist/internal/devtools/utils/spacingAnalyzer.js +0 -88
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"AA4EA,OAAO,
|
|
1
|
+
{"version":3,"file":"AuthMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AuthMenu.tsx"],"names":[],"mappings":"AA4EA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAEvD,OAAO,EAML,OAAO,EACR,MAAM,sBAAsB,CAAC;AAc9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAqE3C;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IAEjD,sBAAsB;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAsBD,eAAO,MAAM,QAAQ,GAAI,+DAKtB,aAAa,mDAwOf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* - Screen reader friendly
|
|
64
64
|
* - Focus management
|
|
65
65
|
*
|
|
66
|
-
* @version 0.0.
|
|
66
|
+
* @version 0.0.3
|
|
67
67
|
* @since 0.0.1
|
|
68
68
|
* @author AMBROISE PARK Consulting
|
|
69
69
|
*/
|
|
@@ -72,25 +72,16 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
72
72
|
// packages/core/ui/src/components/layout/components/AuthMenu.tsx
|
|
73
73
|
import { User, LogOut, Settings, UserCheck, Trash2 } from 'lucide-react';
|
|
74
74
|
import * as LucideIcons from 'lucide-react';
|
|
75
|
-
import React, { useMemo,
|
|
76
|
-
import { Avatar, Button, BUTTON_VARIANT, DropdownMenu, Text,
|
|
75
|
+
import React, { useMemo, lazy, Suspense } from 'react';
|
|
76
|
+
import { Avatar, Button, BUTTON_VARIANT, DropdownMenu, Text, DISPLAY, } from '@donotdev/components';
|
|
77
77
|
import { useTranslation } from '@donotdev/core';
|
|
78
|
-
import {
|
|
78
|
+
import { getEnabledAuthPartners, useAuthConfig, isClient, } from '@donotdev/core';
|
|
79
79
|
import { useBreakpoint } from '@donotdev/core';
|
|
80
|
-
import {
|
|
80
|
+
import { useNavigationItems } from '../../routing';
|
|
81
|
+
import { useNavigate } from '@donotdev/ui/routing/hooks';
|
|
81
82
|
import { useAuthSafe, useAuthVisibility } from '../../utils';
|
|
82
83
|
const NullComponent = () => null;
|
|
83
84
|
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
84
|
-
const AuthPartnerButton = lazy(async () => {
|
|
85
|
-
try {
|
|
86
|
-
const module = await import('@donotdev/auth');
|
|
87
|
-
return { default: module.AuthPartnerButton };
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
return { default: NullComponent };
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
// @ts-expect-error - lazy() type doesn't account for graceful degradation fallback
|
|
94
85
|
const ReauthDialog = lazy(async () => {
|
|
95
86
|
try {
|
|
96
87
|
const module = await import('@donotdev/auth');
|
|
@@ -165,17 +156,14 @@ const getIcon = (iconName) => {
|
|
|
165
156
|
};
|
|
166
157
|
export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTooltip = false, customItems = [], }) => {
|
|
167
158
|
const { t } = useTranslation('dndev');
|
|
168
|
-
const { shouldHide,
|
|
159
|
+
const { shouldHide, isReady, isAuthenticated } = useAuthVisibility();
|
|
169
160
|
const authConfig = useAuthConfig();
|
|
170
161
|
// Get real auth state from the store (self-aware)
|
|
171
162
|
const user = useAuthSafe('user');
|
|
172
|
-
const loading = useAuthSafe('loading');
|
|
173
163
|
const signOut = useAuthSafe('signOut');
|
|
174
|
-
const
|
|
175
|
-
const sendEmailVerification = useAuthSafe('sendEmailVerification');
|
|
176
|
-
const isDesktop = useBreakpoint('isDesktop');
|
|
164
|
+
const isLaptop = useBreakpoint('isLaptop');
|
|
177
165
|
const navigationItems = useNavigationItems();
|
|
178
|
-
const
|
|
166
|
+
const navigate = useNavigate();
|
|
179
167
|
const profilePath = authConfig.profilePath;
|
|
180
168
|
const configMenuItems = authConfig.authMenuItems || [];
|
|
181
169
|
// Account deletion flow - managed by useDeleteAccount hook
|
|
@@ -219,9 +207,10 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
219
207
|
const menuItems = useMemo(() => {
|
|
220
208
|
const items = [];
|
|
221
209
|
// Mobile: Add disabled info item as first entry
|
|
222
|
-
if (!
|
|
210
|
+
if (!isLaptop && user) {
|
|
223
211
|
items.push({
|
|
224
|
-
|
|
212
|
+
// Use Text component as children instead of label
|
|
213
|
+
children: (_jsx(Text, { variant: "muted", as: "span", children: `${getUserDisplayName()}${user.email ? `\n${user.email}` : ''}` })),
|
|
225
214
|
disabled: true,
|
|
226
215
|
});
|
|
227
216
|
}
|
|
@@ -230,8 +219,7 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
230
219
|
items.push({
|
|
231
220
|
label: t('auth.profile', { defaultValue: 'Profile' }),
|
|
232
221
|
icon: User,
|
|
233
|
-
|
|
234
|
-
children: (_jsx(Link, { path: profilePath, children: t('auth.profile', { defaultValue: 'Profile' }) })),
|
|
222
|
+
onClick: () => navigate(profilePath),
|
|
235
223
|
});
|
|
236
224
|
}
|
|
237
225
|
// Config menu items (if configured in appConfig.auth.authMenuItems)
|
|
@@ -250,8 +238,7 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
250
238
|
items.push({
|
|
251
239
|
label,
|
|
252
240
|
icon: Icon,
|
|
253
|
-
|
|
254
|
-
children: _jsx(Link, { path: item.path, children: label }),
|
|
241
|
+
onClick: () => navigate(item.path),
|
|
255
242
|
});
|
|
256
243
|
});
|
|
257
244
|
// Custom items from props (merged with config items)
|
|
@@ -264,8 +251,7 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
264
251
|
items.push({
|
|
265
252
|
label,
|
|
266
253
|
icon: Icon,
|
|
267
|
-
|
|
268
|
-
children: _jsx(Link, { path: item.path, children: label }),
|
|
254
|
+
onClick: () => navigate(item.path),
|
|
269
255
|
disabled: item.disabled,
|
|
270
256
|
style: item.style,
|
|
271
257
|
});
|
|
@@ -305,9 +291,10 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
305
291
|
deletion,
|
|
306
292
|
t,
|
|
307
293
|
navigationItems,
|
|
308
|
-
|
|
294
|
+
isLaptop,
|
|
309
295
|
user,
|
|
310
296
|
getUserDisplayName,
|
|
297
|
+
navigate,
|
|
311
298
|
]);
|
|
312
299
|
// Get enabled providers
|
|
313
300
|
const enabled = getEnabledAuthPartners();
|
|
@@ -321,10 +308,10 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
321
308
|
if (!isAuthenticated) {
|
|
322
309
|
return null;
|
|
323
310
|
}
|
|
324
|
-
return (_jsxs(_Fragment, { children: [_jsx(Suspense, { fallback: null, children: _jsx(ReauthDialog, { open: deletion.showPasswordDialog, isLoading: deletion.isDeleting, error: deletion.error, onReauth: (password) => deletion.confirmDelete(password), onCancel: deletion.cancel }) }), _jsx(Suspense, { fallback: null, children: _jsx(ConfirmDeleteDialog, { open: deletion.showConfirmDialog, isLoading: deletion.isDeleting, error: deletion.error, onConfirm: () => deletion.confirmDelete(), onCancel: deletion.cancel }) }), _jsx(DropdownMenu, { trigger: _jsx(Button, { variant: BUTTON_VARIANT.OUTLINE, icon: user ? (_jsx(Avatar, { src: user.photoURL ?? undefined, fallback: getUserInitials(), alt: getUserDisplayName(), style: { margin: '-4px 0' } })) : (UserCheck), display: display, "aria-label": t('auth.userMenu', { defaultValue: 'User menu' }), tooltip: !noTooltip &&
|
|
311
|
+
return (_jsxs(_Fragment, { children: [_jsx(Suspense, { fallback: null, children: _jsx(ReauthDialog, { open: deletion.showPasswordDialog, isLoading: deletion.isDeleting, error: deletion.error, onReauth: (password) => deletion.confirmDelete(password), onCancel: deletion.cancel }) }), _jsx(Suspense, { fallback: null, children: _jsx(ConfirmDeleteDialog, { open: deletion.showConfirmDialog, isLoading: deletion.isDeleting, error: deletion.error, onConfirm: () => deletion.confirmDelete(), onCancel: deletion.cancel }) }), _jsx(DropdownMenu, { trigger: _jsx(Button, { variant: BUTTON_VARIANT.OUTLINE, icon: user ? (_jsx(Avatar, { src: user.photoURL ?? undefined, fallback: getUserInitials(), alt: getUserDisplayName(), style: { margin: '-4px 0' } })) : (UserCheck), display: display, "aria-label": t('auth.userMenu', { defaultValue: 'User menu' }), tooltip: !noTooltip && isLaptop && user
|
|
325
312
|
? getUserTooltip()
|
|
326
313
|
: !noTooltip
|
|
327
314
|
? t('auth.userMenu', { defaultValue: 'User menu' })
|
|
328
|
-
: undefined, children: getUserDisplayName() }), items: menuItems,
|
|
315
|
+
: undefined, children: getUserDisplayName() }), items: menuItems, contentAlign: "end" })] }));
|
|
329
316
|
};
|
|
330
317
|
export default AuthMenu;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardProps, CardVariant,
|
|
1
|
+
import type { CardProps, CardVariant, CardContent } from '@donotdev/components';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type FeatureCardVariant = CardVariant;
|
|
4
4
|
export interface FeatureCardProps extends Omit<CardProps, 'content' | 'href' | 'title' | 'subtitle' | 'children'> {
|
|
@@ -6,25 +6,13 @@ export interface FeatureCardProps extends Omit<CardProps, 'content' | 'href' | '
|
|
|
6
6
|
title: string | ReactNode;
|
|
7
7
|
/** Subtitle (required) - 2 rows max with ellipsis */
|
|
8
8
|
subtitle: string | ReactNode;
|
|
9
|
-
/** Content as array (required) */
|
|
10
|
-
content: (string | ReactNode)[];
|
|
11
|
-
/** Route path - enables routing via Link */
|
|
12
|
-
href?: string;
|
|
13
|
-
/**
|
|
14
|
-
* List density for content rendering (page-level preset)
|
|
15
|
-
* @default 'default'
|
|
16
|
-
*/
|
|
17
|
-
listDensity?: 'dense' | 'narrow' | 'default' | 'expressive';
|
|
18
9
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
10
|
+
* Card content - string, string[], or ReactNode.
|
|
11
|
+
* For lists with icons, pass `<List icon={...} items={...} />` directly.
|
|
21
12
|
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
showBullets?: boolean;
|
|
13
|
+
content?: CardContent;
|
|
14
|
+
/** Route path - enables routing via Link */
|
|
15
|
+
href?: string;
|
|
28
16
|
}
|
|
29
17
|
/**
|
|
30
18
|
* FeatureCard - Card wrapper with content array and routing
|
|
@@ -33,6 +21,6 @@ export interface FeatureCardProps extends Omit<CardProps, 'content' | 'href' | '
|
|
|
33
21
|
* Uses Card component internally.
|
|
34
22
|
* Routing via Link when href provided.
|
|
35
23
|
*/
|
|
36
|
-
declare const FeatureCard: ({ icon, title, subtitle, content, href, variant, elevated, onClick, className, footer, style,
|
|
24
|
+
declare const FeatureCard: ({ icon, title, subtitle, content, href, variant, elevated, onClick, className, footer, style, ...cardProps }: FeatureCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
25
|
export default FeatureCard;
|
|
38
26
|
//# sourceMappingURL=FeatureCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureCard.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeatureCard.d.ts","sourceRoot":"","sources":["../../../src/components/common/FeatureCard.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,SAAS,EACT,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CACvD;IACC,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,GAAI,8GAalB,gBAAgB,4CAmIlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -12,8 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* @since 0.0.1
|
|
13
13
|
* @author AMBROISE PARK Consulting
|
|
14
14
|
*/
|
|
15
|
-
import { Card, IconBox, Stack,
|
|
16
|
-
import { Check } from 'lucide-react';
|
|
15
|
+
import { Card, IconBox, Stack, Text, renderCardContent, } from '@donotdev/components';
|
|
17
16
|
import { Link } from '../../routing';
|
|
18
17
|
/**
|
|
19
18
|
* FeatureCard - Card wrapper with content array and routing
|
|
@@ -22,31 +21,8 @@ import { Link } from '../../routing';
|
|
|
22
21
|
* Uses Card component internally.
|
|
23
22
|
* Routing via Link when href provided.
|
|
24
23
|
*/
|
|
25
|
-
const FeatureCard = ({ icon, title, subtitle, content, href, variant, elevated, onClick, className, footer, style,
|
|
26
|
-
|
|
27
|
-
// Strip manual bullet characters (•) if present
|
|
28
|
-
const cleanContent = content?.map((item) => {
|
|
29
|
-
if (typeof item === 'string') {
|
|
30
|
-
return item.replace(/^[\s•\-\*]+/, '').trim();
|
|
31
|
-
}
|
|
32
|
-
return item;
|
|
33
|
-
}) || [];
|
|
34
|
-
// Convert to ListItem objects with checkmark icons when showBullets is true
|
|
35
|
-
const listItems = showBullets
|
|
36
|
-
? cleanContent.map((item) => {
|
|
37
|
-
if (typeof item === 'string') {
|
|
38
|
-
return {
|
|
39
|
-
icon: _jsx(Check, { size: 16 }),
|
|
40
|
-
content: item,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
// If already a ListItem or ReactNode, keep as is
|
|
44
|
-
return item;
|
|
45
|
-
})
|
|
46
|
-
: cleanContent;
|
|
47
|
-
// If single string item, render as plain text (not a list)
|
|
48
|
-
// If multiple items or contains ReactNodes, use List component
|
|
49
|
-
const contentNode = listItems && listItems.length > 0 ? (listItems.length === 1 && typeof listItems[0] === 'string' ? (_jsx("div", { className: "dndev-text-sm", children: listItems[0] })) : (_jsx(List, { items: listItems, density: listDensity, gap: listGap, style: { listStyle: 'none', paddingInlineStart: 0 } }))) : null;
|
|
24
|
+
const FeatureCard = ({ icon, title, subtitle, content, href, variant, elevated, onClick, className, footer, style, ...cardProps }) => {
|
|
25
|
+
const contentNode = renderCardContent(content);
|
|
50
26
|
// Fixed height constants for consistent text sizing (2 rows each)
|
|
51
27
|
const titleRowHeight = `calc(var(--font-size-lg) * var(--line-height) * 2 + var(--gap-md))`;
|
|
52
28
|
const subtitleRowHeight = `calc(var(--font-size-base) * var(--line-height) * 2 + var(--gap-md))`;
|
|
@@ -76,12 +52,12 @@ const FeatureCard = ({ icon, title, subtitle, content, href, variant, elevated,
|
|
|
76
52
|
...lineClampStyle,
|
|
77
53
|
fontSize: 'var(--font-size-base)',
|
|
78
54
|
fontWeight: 600,
|
|
79
|
-
color: '
|
|
55
|
+
color: 'var(--muted-foreground)', // Muted for hierarchy
|
|
80
56
|
margin: 0,
|
|
81
57
|
};
|
|
82
58
|
// Build title with icon if provided
|
|
83
59
|
const titleContent = icon ? (_jsxs(Stack, { direction: "row", align: "center", gap: "medium", style: { width: '100%' }, children: [_jsx(IconBox, { icon: icon }), _jsx(Text, { as: "div", level: "h3", style: titleStyle, children: title })] })) : (_jsx(Text, { as: "div", level: "h3", style: titleStyle, children: title }));
|
|
84
|
-
const card = (_jsx(Card, { variant: variant, elevated: elevated, onClick: onClick, className: className, "data-clickable": href ? 'true' : undefined, style: {
|
|
60
|
+
const card = (_jsx(Card, { variant: variant, elevated: elevated, onClick: onClick, className: className, "data-clickable": href || onClick ? 'true' : undefined, style: {
|
|
85
61
|
paddingInlineStart: 'var(--gap-md)',
|
|
86
62
|
paddingInlineEnd: 'var(--gap-md)',
|
|
87
63
|
gap: 'var(--gap-md)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BentoColumns, BentoGap, CardVariant } from '@donotdev/components';
|
|
1
|
+
import type { BentoColumns, BentoGap, CardVariant, ResponsiveCols } from '@donotdev/components';
|
|
2
2
|
import { type TechKey } from '../../data/techLogos';
|
|
3
3
|
export type TechBentoProps = {
|
|
4
4
|
title?: string;
|
|
@@ -7,11 +7,23 @@ export type TechBentoProps = {
|
|
|
7
7
|
size?: 'normal' | 'long' | 'high' | 'huge';
|
|
8
8
|
variant?: CardVariant;
|
|
9
9
|
}>;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Number of columns - fixed or responsive (same as Grid)
|
|
12
|
+
* - number: fixed columns (same on all breakpoints)
|
|
13
|
+
* - [mobile, tablet, laptop, desktop]: responsive columns per breakpoint
|
|
14
|
+
* @default 3
|
|
15
|
+
* @example 3 - always 3 columns
|
|
16
|
+
* @example [1, 1, 2, 3] - 1 col mobile/tablet, 2 laptop, 3 desktop
|
|
17
|
+
*/
|
|
18
|
+
cols?: number | ResponsiveCols;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `cols` prop instead. Kept for backward compatibility.
|
|
21
|
+
*/
|
|
22
|
+
columns?: BentoColumns;
|
|
11
23
|
gap?: BentoGap;
|
|
12
24
|
separator?: boolean;
|
|
13
25
|
className?: string;
|
|
14
26
|
};
|
|
15
|
-
export declare function TechBento({ title, techs, columns, gap, separator, className, }: TechBentoProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function TechBento({ title, techs, cols, columns, gap, separator, className, }: TechBentoProps): import("react/jsx-runtime").JSX.Element;
|
|
16
28
|
export default TechBento;
|
|
17
29
|
//# sourceMappingURL=TechBento.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TechBento.d.ts","sourceRoot":"","sources":["../../../src/components/common/TechBento.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAC3C,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,CAAC,CAAC;IACH;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAwCF,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,IAAQ,EACR,OAAO,EACP,GAAc,EACd,SAAiB,EACjB,SAAS,GACV,EAAE,cAAc,2CAsDhB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -11,7 +11,25 @@ function TechCard({ techKey, variant, }) {
|
|
|
11
11
|
const decodedSvg = decodeURIComponent(svgContent);
|
|
12
12
|
return (_jsx(Card, { variant: variant, className: "dndev-tech-card", style: { '--tech-color': logo.color }, "data-hover": isHovered, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: _jsxs(Stack, { direction: "column", align: "center", gap: "tight", children: [_jsx("div", { className: "dndev-tech-card-logo", "data-tech": techKey, dangerouslySetInnerHTML: { __html: decodedSvg } }), _jsx(Text, { as: "span", level: "small", children: logo.name })] }) }));
|
|
13
13
|
}
|
|
14
|
-
export function TechBento({ title, techs, columns, gap = 'medium', separator = false, className, }) {
|
|
14
|
+
export function TechBento({ title, techs, cols = 3, columns, gap = 'medium', separator = false, className, }) {
|
|
15
|
+
// Convert Grid's cols format to Bento's columns format
|
|
16
|
+
// Grid: [mobile, tablet, laptop, desktop]
|
|
17
|
+
// Bento: { mobile, tablet, desktop, wide }
|
|
18
|
+
const bentoColumns = columns
|
|
19
|
+
? columns
|
|
20
|
+
: typeof cols === 'number'
|
|
21
|
+
? {
|
|
22
|
+
mobile: cols,
|
|
23
|
+
tablet: cols,
|
|
24
|
+
desktop: cols,
|
|
25
|
+
wide: cols,
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
mobile: cols[0],
|
|
29
|
+
tablet: cols[1],
|
|
30
|
+
desktop: cols[2], // Grid's laptop → Bento's desktop
|
|
31
|
+
wide: cols[3], // Grid's desktop → Bento's wide
|
|
32
|
+
};
|
|
15
33
|
const getSpan = (size) => {
|
|
16
34
|
if (size === 'long')
|
|
17
35
|
return { cols: 2, rows: 1 };
|
|
@@ -28,7 +46,7 @@ export function TechBento({ title, techs, columns, gap = 'medium', separator = f
|
|
|
28
46
|
content: _jsx(TechCard, { techKey: tech.name, variant: tech.variant }),
|
|
29
47
|
span: getSpan(tech.size),
|
|
30
48
|
}));
|
|
31
|
-
const bento = (_jsx(Bento, { items: items, columns:
|
|
49
|
+
const bento = (_jsx(Bento, { items: items, columns: bentoColumns, gap: gap, className: className, ariaLabel: "Technology stack" }));
|
|
32
50
|
if (title) {
|
|
33
51
|
return (_jsx(Section, { title: title, separator: separator, className: "dndev-tech-bento", children: _jsx("div", { className: "dndev-tech-bento-grid", children: bento }) }));
|
|
34
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CookieConsent.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/CookieConsent.tsx"],"names":[],"mappings":"AA6BA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CAAC,EACrB,QAAmB,EACnB,YAAmB,EACnB,YAA8C,EAC9C,SAAc,GACf,EAAE,kBAAkB,kDAuUpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// packages/ui/src/components/cookie-consent/CookieConsent.tsx
|
|
3
|
-
import { Cookie, Settings, Shield, BarChart3, Target
|
|
3
|
+
import { Cookie, Settings, Shield, BarChart3, Target } from 'lucide-react';
|
|
4
4
|
import { useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { Accordion, Button, BUTTON_VARIANT, Card, Switch, Text, cn, Stack, } from '@donotdev/components';
|
|
6
|
-
import { handleError, useConsent, getCookieExamples, hasOptionalCookies as checkHasOptionalCookies,
|
|
6
|
+
import { handleError, useConsent, getCookieExamples, hasOptionalCookies as checkHasOptionalCookies, } from '@donotdev/core';
|
|
7
7
|
import { CONSENT_CATEGORY, } from '@donotdev/core';
|
|
8
8
|
import { useTranslation } from '@donotdev/core';
|
|
9
9
|
import { isClient } from '@donotdev/core';
|
|
@@ -20,7 +20,6 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
|
|
|
20
20
|
const [showBanner, setShowBanner] = useState(!hasConsented || storeShowBanner);
|
|
21
21
|
const [preferenceCategories, setPreferenceCategories] = useState(categories);
|
|
22
22
|
const bannerRef = useRef(null);
|
|
23
|
-
const [showEssentialNotice, setShowEssentialNotice] = useState(true);
|
|
24
23
|
useEffect(() => {
|
|
25
24
|
if (storeShowBanner) {
|
|
26
25
|
setShowBanner(true);
|
|
@@ -72,25 +71,6 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
|
|
|
72
71
|
acceptAll(); // Accepts only necessary cookies, show notice instead of banner
|
|
73
72
|
}
|
|
74
73
|
}, [hasConsented, hasOptionalCategories, acceptAll]);
|
|
75
|
-
// Check sessionStorage for notice dismissal
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (!isClient())
|
|
78
|
-
return;
|
|
79
|
-
const dismissed = sessionStorage.getItem('dndev-essential-notice-dismissed');
|
|
80
|
-
if (dismissed === 'true') {
|
|
81
|
-
setShowEssentialNotice(false);
|
|
82
|
-
}
|
|
83
|
-
}, []);
|
|
84
|
-
// Auto-dismiss notice after 15 seconds
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (!hasOptionalCategories && hasConsented && showEssentialNotice) {
|
|
87
|
-
const timer = setTimeout(() => {
|
|
88
|
-
setShowEssentialNotice(false);
|
|
89
|
-
sessionStorage.setItem('dndev-essential-notice-dismissed', 'true');
|
|
90
|
-
}, 15000);
|
|
91
|
-
return () => clearTimeout(timer);
|
|
92
|
-
}
|
|
93
|
-
}, [hasOptionalCategories, hasConsented, showEssentialNotice]);
|
|
94
74
|
// Sync local draft state with store when categories change
|
|
95
75
|
// Default all optional categories to ON for better UX (easier to uncheck than check all)
|
|
96
76
|
useEffect(() => {
|
|
@@ -126,25 +106,6 @@ function CookieConsent({ position = 'bottom', showBranding = true, brandingText
|
|
|
126
106
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
127
107
|
};
|
|
128
108
|
}, [hasConsented, showBanner]);
|
|
129
|
-
// Early return after all hooks (Rules of Hooks)
|
|
130
|
-
// Show essential-only notice if no optional categories
|
|
131
|
-
if (hasConsented && !hasOptionalCategories && showEssentialNotice) {
|
|
132
|
-
const necessaryCookies = getCookiesByCategory('necessary');
|
|
133
|
-
const cookieList = necessaryCookies
|
|
134
|
-
.map((c) => `${c.name} (${c.provider})`)
|
|
135
|
-
.join(', ');
|
|
136
|
-
return (_jsx("div", { className: "dndev-fixed dndev-z-toast", style: {
|
|
137
|
-
left: 'var(--sidebar-width, 0)',
|
|
138
|
-
bottom: 'var(--footer-height, 0)',
|
|
139
|
-
right: 0,
|
|
140
|
-
width: 'calc(100% - var(--sidebar-width, 0))',
|
|
141
|
-
borderTop: '1px solid var(--border)',
|
|
142
|
-
background: 'var(--card)',
|
|
143
|
-
}, children: _jsxs(Stack, { direction: "row", align: "center", gap: "medium", style: { padding: 'var(--gap-md) var(--gap-lg)' }, children: [_jsx(Shield, { className: "dndev-size-md", style: { color: 'var(--primary)' } }), _jsxs(Stack, { gap: "tight", style: { flex: 1 }, children: [_jsx(Text, { as: "p", variant: "default", level: "small", children: t('essentialOnlyNotice') }), _jsx(Text, { as: "p", variant: "muted", level: "small", children: cookieList })] }), _jsx(Button, { onClick: () => {
|
|
144
|
-
setShowEssentialNotice(false);
|
|
145
|
-
sessionStorage.setItem('dndev-essential-notice-dismissed', 'true');
|
|
146
|
-
}, variant: BUTTON_VARIANT.GHOST, icon: X, title: t('form.close', 'Close') })] }) }));
|
|
147
|
-
}
|
|
148
109
|
if (hasConsented && !storeShowBanner)
|
|
149
110
|
return null;
|
|
150
111
|
const handleSave = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-consent/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAGH,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/DropdownNavigation.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DropdownNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/components/DropdownNavigation.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CAyF9D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -17,7 +17,7 @@ interface ThemeToggleProps {
|
|
|
17
17
|
* Allows users to switch between available themes (light, dark, system, custom).
|
|
18
18
|
* Integrates with the theme store for state management.
|
|
19
19
|
*
|
|
20
|
-
* @version 0.0.
|
|
20
|
+
* @version 0.0.3
|
|
21
21
|
* @since 0.0.1
|
|
22
22
|
* @author AMBROISE PARK Consulting
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,OAAO,CAAC;AAE3D,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAM9B,UAAU,gBAAgB;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/header/ThemeToggle.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,OAAO,CAAC;AAE3D,OAAO,EAIL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAM9B,UAAU,gBAAgB;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAUD;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CA0FhD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
* @fileoverview ThemeToggle component
|
|
6
6
|
* @description Theme switching component with dropdown menu
|
|
7
7
|
*
|
|
8
|
-
* @version 0.0.
|
|
8
|
+
* @version 0.0.3
|
|
9
9
|
* @since 0.0.1
|
|
10
10
|
* @author AMBROISE PARK Consulting
|
|
11
11
|
*/
|
|
@@ -26,7 +26,7 @@ const getIcon = (iconName) => {
|
|
|
26
26
|
* Allows users to switch between available themes (light, dark, system, custom).
|
|
27
27
|
* Integrates with the theme store for state management.
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0.
|
|
29
|
+
* @version 0.0.3
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
*/
|
|
@@ -51,6 +51,7 @@ const ThemeToggle = ({ display = DISPLAY.AUTO, 'no-tooltip': noTooltip = false,
|
|
|
51
51
|
: null;
|
|
52
52
|
const nextIcon = nextThemeInfo ? getIcon(nextThemeInfo.meta?.icon) : null;
|
|
53
53
|
const currentLabel = currentThemeInfo?.displayName || currentThemeInfo?.name || 'Theme';
|
|
54
|
+
const nextLabel = nextThemeInfo?.displayName || nextThemeInfo?.name || 'Theme';
|
|
54
55
|
// Determine button props based on theme count
|
|
55
56
|
const isTwoThemes = availableThemes.length === 2 && nextThemeInfo && nextIcon;
|
|
56
57
|
const buttonIcon = isTwoThemes ? nextIcon : currentIcon;
|
|
@@ -68,9 +69,9 @@ const ThemeToggle = ({ display = DISPLAY.AUTO, 'no-tooltip': noTooltip = false,
|
|
|
68
69
|
icon: buttonIcon,
|
|
69
70
|
display,
|
|
70
71
|
};
|
|
71
|
-
// 2 themes: direct toggle button
|
|
72
|
+
// 2 themes: direct toggle button - show next theme (what you'll switch to)
|
|
72
73
|
if (isTwoThemes && nextThemeInfo) {
|
|
73
|
-
return (_jsx(Button, { ...buttonProps, onClick: () => setTheme(nextThemeInfo.name), children:
|
|
74
|
+
return (_jsx(Button, { ...buttonProps, onClick: () => setTheme(nextThemeInfo.name), children: nextLabel }));
|
|
74
75
|
}
|
|
75
76
|
// 3+ themes: dropdown with current theme icon
|
|
76
77
|
if (!currentThemeInfo || !currentIcon)
|