@donotdev/ui 0.0.2 → 0.0.3
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 +15 -28
- package/dist/components/common/FeatureCard.js +1 -1
- 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 +137 -120
- 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 +31 -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 +220 -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 +25 -58
- package/dist/internal/layout/DnDevLayout.js +3 -3
- package/dist/internal/layout/components/footer/FooterBranding.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/FooterBranding.js +3 -1
- 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 +137 -120
- package/dist/utils/assetResolver.d.ts +5 -5
- package/dist/utils/assetResolver.js +4 -4
- 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,mDAyOf,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 emailVerification = useAuthSafe('emailVerification');
|
|
175
|
-
const sendEmailVerification = useAuthSafe('sendEmailVerification');
|
|
176
164
|
const isDesktop = useBreakpoint('isDesktop');
|
|
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
|
|
@@ -221,7 +209,8 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
221
209
|
// Mobile: Add disabled info item as first entry
|
|
222
210
|
if (!isDesktop && 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
|
});
|
|
@@ -308,6 +294,7 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
308
294
|
isDesktop,
|
|
309
295
|
user,
|
|
310
296
|
getUserDisplayName,
|
|
297
|
+
navigate,
|
|
311
298
|
]);
|
|
312
299
|
// Get enabled providers
|
|
313
300
|
const enabled = getEnabledAuthPartners();
|
|
@@ -325,6 +312,6 @@ export const AuthMenu = ({ loginPath, display = DISPLAY.AUTO, 'no-tooltip': noTo
|
|
|
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;
|
|
@@ -81,7 +81,7 @@ const FeatureCard = ({ icon, title, subtitle, content, href, variant, elevated,
|
|
|
81
81
|
};
|
|
82
82
|
// Build title with icon if provided
|
|
83
83
|
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: {
|
|
84
|
+
const card = (_jsx(Card, { variant: variant, elevated: elevated, onClick: onClick, className: className, "data-clickable": href || onClick ? 'true' : undefined, style: {
|
|
85
85
|
paddingInlineStart: 'var(--gap-md)',
|
|
86
86
|
paddingInlineEnd: 'var(--gap-md)',
|
|
87
87
|
gap: 'var(--gap-md)',
|
|
@@ -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)
|