@umituz/web-dashboard 6.10.0 → 7.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.
Files changed (92) hide show
  1. package/package.json +11 -12
  2. package/src/domains/analytics/components/AnalyticsCard.tsx +11 -0
  3. package/src/domains/analytics/components/AnalyticsChart.tsx +24 -5
  4. package/src/domains/analytics/components/AnalyticsLayout.tsx +26 -26
  5. package/src/domains/analytics/components/MetricCard.tsx +2 -5
  6. package/src/domains/analytics/hooks/useAnalytics.ts +1 -7
  7. package/src/domains/analytics/index.ts +0 -1
  8. package/src/domains/analytics/types/analytics.ts +11 -0
  9. package/src/domains/analytics/utils/analytics.ts +2 -115
  10. package/src/domains/analytics/utils/index.ts +0 -1
  11. package/src/domains/calendar/services/CalendarService.ts +2 -25
  12. package/src/domains/charts/components.test.tsx +1 -0
  13. package/src/domains/charts/components.tsx +65 -0
  14. package/src/domains/layouts/components/BrandLogo.tsx +1 -0
  15. package/src/domains/layouts/components/DashboardHeader.tsx +57 -21
  16. package/src/domains/layouts/components/DashboardLayout.test.tsx +40 -22
  17. package/src/domains/layouts/components/DashboardLayout.tsx +60 -28
  18. package/src/domains/layouts/components/DashboardSidebar.tsx +34 -33
  19. package/src/domains/layouts/components/FilterBar.test.tsx +3 -0
  20. package/src/domains/layouts/components/FilterBar.tsx +5 -9
  21. package/src/domains/layouts/components/FilterSelect.test.tsx +28 -0
  22. package/src/domains/layouts/components/FilterSelect.tsx +47 -0
  23. package/src/domains/layouts/components/PageHeader.test.tsx +18 -0
  24. package/src/domains/layouts/components/PageHeader.tsx +13 -3
  25. package/src/domains/layouts/components/SectionHeader.tsx +7 -4
  26. package/src/domains/layouts/components/index.ts +2 -0
  27. package/src/domains/layouts/hooks/dashboard.ts +4 -7
  28. package/src/domains/layouts/types/index.ts +12 -1
  29. package/src/domains/layouts/types/layout.ts +72 -58
  30. package/src/domains/layouts/types/sidebar.ts +0 -8
  31. package/src/domains/layouts/utils/dashboard.test.ts +2 -2
  32. package/src/domains/layouts/utils/dashboard.ts +15 -11
  33. package/src/domains/layouts/utils/index.ts +2 -1
  34. package/src/domains/modules/build.test.tsx +4 -0
  35. package/src/domains/modules/build.tsx +1 -0
  36. package/src/domains/onboarding/calc/slider-value-bounds.ts +1 -1
  37. package/src/domains/onboarding/components/AnimationWrapper.tsx +3 -0
  38. package/src/domains/onboarding/components/OnboardingErrorBoundary.tsx +6 -0
  39. package/src/domains/onboarding/components/OnboardingFlow.test.tsx +48 -27
  40. package/src/domains/onboarding/components/OnboardingFlow.tsx +10 -2
  41. package/src/domains/onboarding/components/OnboardingIntl.tsx +7 -65
  42. package/src/domains/onboarding/components/PrimaryButton.tsx +3 -0
  43. package/src/domains/onboarding/components/ProgressBar.tsx +5 -1
  44. package/src/domains/onboarding/components/QuestionWrapper.tsx +5 -0
  45. package/src/domains/onboarding/components/ScreenContainer.tsx +4 -0
  46. package/src/domains/onboarding/components/SwipeCard.test.tsx +43 -1
  47. package/src/domains/onboarding/components/SwipeCard.tsx +7 -0
  48. package/src/domains/onboarding/components/screens/AccountGateScreen.tsx +7 -0
  49. package/src/domains/onboarding/components/screens/AppDemoScreen.tsx +4 -0
  50. package/src/domains/onboarding/components/screens/ComparisonScreen.tsx +9 -0
  51. package/src/domains/onboarding/components/screens/GoalQuestionScreen.tsx +3 -0
  52. package/src/domains/onboarding/components/screens/PainPointsScreen.tsx +3 -0
  53. package/src/domains/onboarding/components/screens/PaywallScreen.tsx +17 -0
  54. package/src/domains/onboarding/components/screens/PermissionPrimingScreen.tsx +10 -0
  55. package/src/domains/onboarding/components/screens/PersonalizedSolutionScreen.tsx +9 -0
  56. package/src/domains/onboarding/components/screens/PreferencesScreen.tsx +15 -0
  57. package/src/domains/onboarding/components/screens/ProcessingScreen.tsx +8 -0
  58. package/src/domains/onboarding/components/screens/SocialProofScreen.tsx +17 -0
  59. package/src/domains/onboarding/components/screens/TinderCardsScreen.tsx +12 -0
  60. package/src/domains/onboarding/components/screens/ValueDeliveryScreen.tsx +9 -0
  61. package/src/domains/onboarding/components/screens/WelcomeScreen.tsx +7 -0
  62. package/src/domains/onboarding/hooks/useOnboardingProgress.test.tsx +4 -5
  63. package/src/domains/onboarding/index.ts +0 -12
  64. package/src/domains/onboarding/predicates/predicates.test.ts +1 -1
  65. package/src/domains/onboarding/types/config.ts +1 -1
  66. package/src/domains/onboarding/types/labels.ts +1 -0
  67. package/src/domains/onboarding/utils/analytics-dispatch.ts +2 -2
  68. package/src/domains/onboarding/utils/local-storage-bridge.ts +1 -1
  69. package/src/domains/onboarding/validation/validation.test.ts +2 -2
  70. package/src/domains/permissions/PermissionsContext.tsx +6 -18
  71. package/src/domains/permissions/index.ts +0 -1
  72. package/src/domains/search/searchItems.test.ts +1 -1
  73. package/src/domains/search/searchItems.ts +0 -3
  74. package/src/domains/settings/components/AuditLogList.tsx +14 -7
  75. package/src/domains/settings/components/PermissionMatrixScreen.tsx +10 -0
  76. package/src/domains/settings/components/SettingsLayout.tsx +21 -4
  77. package/src/domains/settings/components/SettingsSection.tsx +13 -7
  78. package/src/domains/settings/components/UserManagementTable.tsx +16 -9
  79. package/src/domains/settings/types/settings.ts +7 -1
  80. package/src/domains/settings/utils/index.ts +0 -1
  81. package/src/domains/timing/hooks/useCountdown.test.ts +1 -2
  82. package/src/domains/timing/hooks/useCountdown.ts +0 -4
  83. package/src/internal/formatPattern.ts +8 -0
  84. package/src/domains/analytics/utils/i18nKeys.ts +0 -31
  85. package/src/domains/onboarding/templates/TemplateDemoFallback.tsx +0 -92
  86. package/src/domains/onboarding/templates/art-onboarding.ts +0 -71
  87. package/src/domains/onboarding/templates/health-onboarding.ts +0 -92
  88. package/src/domains/onboarding/templates/index.ts +0 -6
  89. package/src/domains/onboarding/templates/platform-onboarding.ts +0 -201
  90. package/src/domains/onboarding/templates/video-onboarding.ts +0 -95
  91. package/src/domains/permissions/utils/i18nKeys.ts +0 -6
  92. package/src/domains/settings/utils/i18nKeys.ts +0 -12
@@ -25,6 +25,7 @@ export function SocialProofScreen({ config, onNext }: SocialProofScreenProps) {
25
25
  return (
26
26
  <div className="udb-onb-proof">
27
27
  {config.title && <h2 className="udb-onb-title">{config.title}</h2>}
28
+
28
29
  <div className="udb-onb-proof__stage">
29
30
  <AnimatePresence mode="wait">
30
31
  <motion.blockquote
@@ -44,16 +45,24 @@ export function SocialProofScreen({ config, onNext }: SocialProofScreenProps) {
44
45
  />
45
46
  ))}
46
47
  </div>
48
+
47
49
  )}
48
50
  <p className="udb-onb-quote__content">“{current.content}”</p>
51
+
49
52
  <footer className="udb-onb-quote__footer">
50
53
  {current.avatar && <img src={current.avatar} alt="" className="udb-onb-quote__avatar" />}
51
54
  <cite className="udb-onb-quote__cite">{current.name}</cite>
55
+
52
56
  <span className="udb-onb-quote__role">{current.role}</span>
57
+
53
58
  </footer>
59
+
54
60
  </motion.blockquote>
61
+
55
62
  </AnimatePresence>
63
+
56
64
  </div>
65
+
57
66
  <div className="udb-onb-proof__bar">
58
67
  <div className="udb-onb-dots" role="tablist" aria-label="Testimonials">
59
68
  {config.testimonials.map((t, i) => (
@@ -68,20 +77,28 @@ export function SocialProofScreen({ config, onNext }: SocialProofScreenProps) {
68
77
  />
69
78
  ))}
70
79
  </div>
80
+
71
81
  <div className="udb-onb-proof__nav">
72
82
  {total > 1 && (
73
83
  <>
74
84
  <Button variant="outline" size="sm" onClick={() => go(-1)}>
75
85
  {labels.previous}
76
86
  </Button>
87
+
77
88
  <Button variant="outline" size="sm" onClick={() => go(1)}>
78
89
  {labels.nextAction}
79
90
  </Button>
91
+
80
92
  </>
93
+
81
94
  )}
82
95
  </div>
96
+
83
97
  </div>
98
+
84
99
  <PrimaryButton onClick={onNext}>{config.cta ?? labels.continueAction}</PrimaryButton>
100
+
85
101
  </div>
102
+
86
103
  );
87
104
  }
@@ -46,16 +46,20 @@ export function TinderCardsScreen({ config, onNext }: TinderCardsScreenProps) {
46
46
  return (
47
47
  <div className="udb-onb-stage">
48
48
  <p className="udb-onb-lead">{labels.allDone}</p>
49
+
49
50
  <PrimaryButton onClick={() => onNext({ liked: likedRef.current })}>
50
51
  {config.cta ?? labels.continueAction}
51
52
  </PrimaryButton>
53
+
52
54
  </div>
55
+
53
56
  );
54
57
  }
55
58
 
56
59
  return (
57
60
  <div className="udb-onb-proof">
58
61
  {config.title && <h2 className="udb-onb-title">{config.title}</h2>}
62
+
59
63
  <div className="udb-onb-proof__stage">
60
64
  <AnimatePresence mode="wait">
61
65
  <motion.div
@@ -73,19 +77,27 @@ export function TinderCardsScreen({ config, onNext }: TinderCardsScreenProps) {
73
77
  onSwipeRight={onSwipeRight}
74
78
  />
75
79
  </motion.div>
80
+
76
81
  </AnimatePresence>
82
+
77
83
  </div>
84
+
78
85
  <div className="udb-onb-proof__nav">
79
86
  <button type="button" onClick={onSwipeLeft} className="udb-onb-choice udb-onb-choice--no">
80
87
  {labels.disagree}
81
88
  </button>
89
+
82
90
  <button type="button" onClick={onSwipeRight} className="udb-onb-choice udb-onb-choice--yes">
83
91
  {labels.agree}
84
92
  </button>
93
+
85
94
  </div>
95
+
86
96
  <p className="udb-onb-note" aria-live="polite">
87
97
  {formatLabel(labels.countOfPattern, { current: index + 1, total })}
88
98
  </p>
99
+
89
100
  </div>
101
+
90
102
  );
91
103
  }
@@ -51,19 +51,28 @@ export function ValueDeliveryScreen<TResult = unknown>({
51
51
  <div className="udb-onb-hero udb-onb-hero--lg" aria-hidden="true">
52
52
  <Sparkles className="udb-onb-icon--lg" />
53
53
  </div>
54
+
54
55
  <h2 className="udb-onb-title udb-onb-title--display">{config.title}</h2>
56
+
55
57
  <div className="udb-onb-result">
56
58
  <pre className="udb-onb-result__pre">{JSON.stringify(config.result, null, 2)}</pre>
59
+
57
60
  </div>
61
+
58
62
  {config.shareConfig && (
59
63
  <div className="udb-onb-share">
60
64
  <Button variant="outline" size="sm" onClick={handleShare}>
61
65
  {copied ? labels.copied : labels.share}
62
66
  </Button>
67
+
63
68
  <span>{config.shareConfig.text}</span>
69
+
64
70
  </div>
71
+
65
72
  )}
66
73
  <PrimaryButton onClick={onNext}>{config.cta ?? labels.continueAction}</PrimaryButton>
74
+
67
75
  </div>
76
+
68
77
  );
69
78
  }
@@ -18,15 +18,22 @@ export function WelcomeScreen({ config, onNext, isLoading }: WelcomeScreenProps)
18
18
  <div className="udb-onb-hero udb-onb-hero--xl" aria-hidden="true">
19
19
  {renderBundledIcon(config.heroIconName, 'udb-onb-icon--xl')}
20
20
  </div>
21
+
21
22
  )}
22
23
  <div className="udb-onb-welcome__group">
23
24
  {config.title && <h1 className="udb-onb-welcome__title">{config.title}</h1>}
25
+
24
26
  {config.subtitle && <p className="udb-onb-welcome__subtitle">{config.subtitle}</p>}
27
+
25
28
  {config.highlight && <p className="udb-onb-welcome__highlight">{config.highlight}</p>}
29
+
26
30
  </div>
31
+
27
32
  <PrimaryButton onClick={config.onCta ?? onNext} loading={isLoading}>
28
33
  {config.cta ?? labels.continueAction}
29
34
  </PrimaryButton>
35
+
30
36
  </div>
37
+
31
38
  );
32
39
  }
@@ -48,7 +48,7 @@ describe('useOnboardingProgress — state machine (§1.1, §1.2)', () => {
48
48
  act(() => result.current.prev());
49
49
  expect(result.current.currentStep).toBe(1);
50
50
  act(() => result.current.prev());
51
- act(() => result.current.prev()); // below zero — must clamp
51
+ act(() => result.current.prev());
52
52
  expect(result.current.currentStep).toBe(0);
53
53
  });
54
54
 
@@ -72,7 +72,7 @@ describe('useOnboardingProgress — state machine (§1.1, §1.2)', () => {
72
72
  useOnboardingProgress({ screens: makeScreens(2), ephemeral: true }),
73
73
  );
74
74
  act(() => result.current.next());
75
- act(() => result.current.next()); // last screen -> finish
75
+ act(() => result.current.next());
76
76
  expect(result.current.isFinished).toBe(true);
77
77
  expect(result.current.completedSteps).toEqual(['s0', 's1']);
78
78
  });
@@ -87,7 +87,7 @@ describe('useOnboardingProgress — state machine (§1.1, §1.2)', () => {
87
87
  expect(result.current.currentStep).toBe(0);
88
88
  expect(result.current.completedSteps).toEqual([]);
89
89
  expect(result.current.collected).toEqual({});
90
- // The stale checkpoint is gone; the persist effect re-saves a fresh one.
90
+
91
91
  const stored = JSON.parse(localStorage.getItem('k') ?? 'null');
92
92
  expect(stored).not.toBeNull();
93
93
  expect(stored.currentStep).toBe(0);
@@ -129,8 +129,7 @@ describe('useOnboardingProgress — persistence (§1.4, §1.5, §1.6)', () => {
129
129
  });
130
130
 
131
131
  it('rehydration past the end of a shortened flow starts fresh', () => {
132
- // Progress stored for 4 screens; the app now ships 2. currentStep=3 is
133
- // out of bounds and must not be restored.
132
+
134
133
  localStorage.setItem(
135
134
  'short',
136
135
  JSON.stringify({
@@ -5,7 +5,6 @@ export {
5
5
  OnboardingIntlProvider,
6
6
  OnboardingIntlContext,
7
7
  useOnboardingIntl,
8
- defaultOnboardingLabels,
9
8
  formatLabel,
10
9
  } from './components/OnboardingIntl';
11
10
  export type { OnboardingIntl, OnboardingIntlProviderProps } from './components/OnboardingIntl';
@@ -54,17 +53,6 @@ export type {
54
53
  UseOnboardingAnalyticsReturn,
55
54
  } from './hooks';
56
55
 
57
- export {
58
- healthOnboardingTemplate,
59
- artOnboardingTemplate,
60
- videoOnboardingTemplate,
61
- platformOnboardingTemplate,
62
- withDefaultDemo,
63
- defaultDemoResult,
64
- TemplateDemoFallback,
65
- } from './templates';
66
- export type { TemplateDemoResult } from './templates';
67
-
68
56
  export {
69
57
  computeProgressFraction,
70
58
  computeProgressPercentage,
@@ -45,7 +45,7 @@ describe('icon-name-resolves (§24.4)', () => {
45
45
  expect(resolveIconByName('Infinity')).toBeTruthy();
46
46
  });
47
47
 
48
- it('resolves every icon used by the bundled templates — including the video set', () => {
48
+ it('resolves the curated icon set — including the video set', () => {
49
49
  const templateIcons = [
50
50
  'Activity', 'Apple', 'Award', 'Ban', 'Bell', 'BookOpen', 'Camera', 'Check',
51
51
  'CheckCircle2', 'Download', 'Dumbbell', 'GraduationCap', 'Headphones',
@@ -40,7 +40,7 @@ export interface OnboardingConfig {
40
40
  demo?: DemoConfig;
41
41
  paywall?: PaywallScreenConfig;
42
42
  analytics?: AnalyticsConfig;
43
- labels?: Partial<OnboardingLabels>;
43
+ labels: OnboardingLabels;
44
44
  locale?: string;
45
45
  headerSlot?: ReactNode;
46
46
  footerSlot?: ReactNode;
@@ -1,4 +1,5 @@
1
1
  export interface OnboardingLabels {
2
+ progressLabel: string;
2
3
  continueAction: string;
3
4
  back: string;
4
5
  skip: string;
@@ -34,7 +34,7 @@ function dispatchToCustomTracker(
34
34
  customTracker: ((e: OnboardingAnalyticsEvent) => void) | undefined,
35
35
  ): void {
36
36
  if (typeof customTracker !== 'function') {
37
-
37
+
38
38
  console.warn(
39
39
  '[web-onboarding] analytics provider is "custom" but no customTracker was provided; event dropped:',
40
40
  event.name,
@@ -57,7 +57,7 @@ export function dispatchAnalyticsEvent(
57
57
  if (!provider) return;
58
58
  dispatchToProvider(event, provider);
59
59
  } catch (error) {
60
-
60
+
61
61
  console.error('[web-onboarding] analytics dispatch failed; event dropped:', event.name, error);
62
62
  }
63
63
  }
@@ -39,7 +39,7 @@ export function saveOnboardingProgress(
39
39
  window.localStorage.setItem(buildKey(key), serialized);
40
40
  return true;
41
41
  } catch (error) {
42
-
42
+
43
43
  console.error('[web-onboarding] failed to persist progress', error);
44
44
  return false;
45
45
  }
@@ -40,9 +40,9 @@ describe('flow-structure-check (§23.1)', () => {
40
40
 
41
41
  describe('screen-config-check (§23.2)', () => {
42
42
  it('rejects malformed screens', () => {
43
- // @ts-expect-error -- deliberately malformed input (null is not a screen)
43
+ // @ts-expect-error deliberately malformed input
44
44
  expect(checkScreenConfig(null).ok).toBe(false);
45
- // @ts-expect-error -- deliberately malformed input (missing id)
45
+ // @ts-expect-error deliberately malformed input
46
46
  expect(checkScreenConfig({ type: 'welcome' }).ok).toBe(false);
47
47
  expect(checkScreenConfig({ id: '', type: 'welcome' } as OnboardingScreen).ok).toBe(false);
48
48
  expect(
@@ -1,8 +1,5 @@
1
1
  import { createContext, useCallback, useContext, useMemo, type ReactNode } from "react";
2
- import { Lock } from "lucide-react";
3
- import { useT } from "@umituz/web-localization/react";
4
2
  import { hasPermission } from "./hasPermission";
5
- import { PERMISSIONS_KEYS } from "./utils/i18nKeys";
6
3
  import type { Permission, PermissionMatrix, RoleKey } from "./types";
7
4
 
8
5
  export interface PermissionsProviderProps {
@@ -38,6 +35,7 @@ export const PermissionsProvider = ({
38
35
  <PermissionsContext.Provider value={value}>
39
36
  {children}
40
37
  </PermissionsContext.Provider>
38
+
41
39
  );
42
40
  };
43
41
 
@@ -49,19 +47,6 @@ export const usePermissions = (): PermissionsContextValue => {
49
47
  return context;
50
48
  };
51
49
 
52
- const ForbiddenFallback = () => {
53
- const t = useT();
54
- return (
55
- <div className="udb-empty" role="alert">
56
- <div className="udb-empty__icon">
57
- <Lock className="udb-empty__glyph" aria-hidden="true" />
58
- </div>
59
- <p className="udb-empty__text">{t(PERMISSIONS_KEYS.forbidden.title)}</p>
60
- <p className="udb-empty__hint">{t(PERMISSIONS_KEYS.forbidden.hint)}</p>
61
- </div>
62
- );
63
- };
64
-
65
50
  export interface RequirePermissionProps {
66
51
  permission: Permission;
67
52
  children: ReactNode;
@@ -71,11 +56,13 @@ export interface RequirePermissionProps {
71
56
  export const RequirePermission = ({
72
57
  permission,
73
58
  children,
74
- fallback,
59
+ fallback = null,
75
60
  }: RequirePermissionProps) => {
76
61
  const { can } = usePermissions();
77
62
  if (can(permission)) return <>{children}</>;
78
- return <>{fallback ?? <ForbiddenFallback />}</>;
63
+
64
+ return <>{fallback}</>;
65
+
79
66
  };
80
67
 
81
68
  export interface CanProps extends RequirePermissionProps {}
@@ -84,4 +71,5 @@ export const Can = ({ permission, children, fallback }: CanProps) => (
84
71
  <RequirePermission permission={permission} fallback={fallback}>
85
72
  {children}
86
73
  </RequirePermission>
74
+
87
75
  );
@@ -16,4 +16,3 @@ export {
16
16
  type RoleKey,
17
17
  type RoleInfo,
18
18
  } from "./types";
19
- export { PERMISSIONS_KEYS } from "./utils/i18nKeys";
@@ -29,7 +29,7 @@ describe('searchItems', () => {
29
29
  });
30
30
 
31
31
  it('ranks title matches above body-only matches', () => {
32
- // "present" is in c1's title and c3's blurb — title wins.
32
+
33
33
  const hits = searchItems(COURSES, 'present', toHit);
34
34
  expect(hits[0]?.id).toBe('c1');
35
35
  expect(hits).toHaveLength(2);
@@ -6,9 +6,6 @@ export interface SearchHit {
6
6
  to: string;
7
7
  }
8
8
 
9
- /** Case-insensitive substring scoring across a haystack of fields.
10
- * Title matches weigh 3×; every additional field hit adds 1. Empty
11
- * queries return no hits. Results are sorted by descending score. */
12
9
  export function searchItems<T extends object>(
13
10
  items: readonly T[],
14
11
  query: string,
@@ -1,6 +1,4 @@
1
1
  import { ScrollText } from "lucide-react";
2
- import { useT } from "@umituz/web-localization/react";
3
- import { SETTINGS_ADMIN_KEYS } from "../utils/i18nKeys";
4
2
 
5
3
  export interface AuditEntry {
6
4
  id: string;
@@ -12,24 +10,27 @@ export interface AuditEntry {
12
10
 
13
11
  export interface AuditLogListProps {
14
12
  entries: AuditEntry[];
13
+ emptyLabel: string;
14
+ formatAt?: (iso: string) => string;
15
15
  }
16
16
 
17
- const formatAt = (iso: string): string => {
17
+ const defaultFormatAt = (iso: string): string => {
18
18
  const date = new Date(iso);
19
19
  return Number.isNaN(date.getTime()) ? iso : date.toISOString().slice(0, 16).replace("T", " ");
20
20
  };
21
21
 
22
- export const AuditLogList = ({ entries }: AuditLogListProps) => {
23
- const t = useT();
24
-
22
+ export const AuditLogList = ({ entries, emptyLabel, formatAt = defaultFormatAt }: AuditLogListProps) => {
25
23
  if (entries.length === 0) {
26
24
  return (
27
25
  <div className="udb-empty">
28
26
  <div className="udb-empty__icon">
29
27
  <ScrollText className="udb-empty__glyph" aria-hidden="true" />
30
28
  </div>
31
- <p className="udb-empty__text">{t(SETTINGS_ADMIN_KEYS.audit.empty)}</p>
29
+
30
+ <p className="udb-empty__text">{emptyLabel}</p>
31
+
32
32
  </div>
33
+
33
34
  );
34
35
  }
35
36
 
@@ -38,12 +39,18 @@ export const AuditLogList = ({ entries }: AuditLogListProps) => {
38
39
  {entries.map((entry) => (
39
40
  <li key={entry.id} className="udb-audit__item">
40
41
  <span className="udb-audit__at">{formatAt(entry.at)}</span>
42
+
41
43
  <span className="udb-audit__actor">{entry.actor}</span>
44
+
42
45
  <span className="udb-audit__action">{entry.action}</span>
46
+
43
47
  {entry.target && <span className="udb-audit__target">{entry.target}</span>}
48
+
44
49
  </li>
50
+
45
51
  ))}
46
52
  </ul>
53
+
47
54
  );
48
55
  };
49
56
 
@@ -29,13 +29,17 @@ export const PermissionMatrixScreen = ({
29
29
  <th key={permission} className="udb-table__th udb-table__th--code">
30
30
  {permission}
31
31
  </th>
32
+
32
33
  ))}
33
34
  </tr>
35
+
34
36
  </thead>
37
+
35
38
  <tbody>
36
39
  {roles.map((role) => (
37
40
  <tr key={role.key} className="udb-table__row">
38
41
  <td className="udb-table__td udb-table__td--strong">{role.label}</td>
42
+
39
43
  {permissions.map((permission) => {
40
44
  const granted = hasPermission(matrix, role.key, permission);
41
45
  const cell = granted ? (
@@ -57,17 +61,23 @@ export const PermissionMatrixScreen = ({
57
61
  >
58
62
  {cell}
59
63
  </button>
64
+
60
65
  ) : (
61
66
  cell
62
67
  )}
63
68
  </td>
69
+
64
70
  );
65
71
  })}
66
72
  </tr>
73
+
67
74
  ))}
68
75
  </tbody>
76
+
69
77
  </table>
78
+
70
79
  </div>
80
+
71
81
  );
72
82
 
73
83
  export default PermissionMatrixScreen;
@@ -1,17 +1,19 @@
1
1
  import { useEffect, useState } from "react";
2
- import { Outlet, useLocation, useNavigate } from "react-router-dom";
2
+ import { Outlet, useLocation, useNavigate } from "react-router";
3
3
  import { Skeleton, Button } from "@umituz/web-design-system/atoms";
4
4
  import { ChevronLeft, Menu } from "lucide-react";
5
5
  import { SettingsSection } from "./SettingsSection";
6
- import type { SettingsConfig } from "../types/settings";
6
+ import type { SettingsConfig, SettingsLayoutLabels } from "../types/settings";
7
7
 
8
8
  interface SettingsLayoutProps {
9
9
  config: SettingsConfig;
10
+ labels: SettingsLayoutLabels;
10
11
  routeTransitionMs?: number;
11
12
  }
12
13
 
13
14
  export const SettingsLayout = ({
14
15
  config,
16
+ labels,
15
17
  routeTransitionMs = 0,
16
18
  }: SettingsLayoutProps) => {
17
19
  const location = useLocation();
@@ -41,13 +43,14 @@ export const SettingsLayout = ({
41
43
  <h2 className="udb-settings__sidebar-title">
42
44
  {config.brandName}
43
45
  </h2>
46
+
44
47
  )}
45
48
  <Button
46
49
  variant="ghost"
47
50
  size="icon"
48
51
  onClick={onMenuClick}
49
52
  className="udb-settings__sidebar-toggle"
50
- aria-label={showMenuButton ? "Open sidebar" : "Toggle sidebar"}
53
+ aria-label={showMenuButton ? labels.openSidebar : labels.toggleSidebar}
51
54
  >
52
55
  {showMenuButton ? (
53
56
  <Menu className="udb-settings__toggle-icon" />
@@ -57,7 +60,9 @@ export const SettingsLayout = ({
57
60
  <ChevronLeft className="udb-settings__toggle-icon" />
58
61
  )}
59
62
  </Button>
63
+
60
64
  </div>
65
+
61
66
  );
62
67
 
63
68
  return (
@@ -75,6 +80,7 @@ export const SettingsLayout = ({
75
80
  />
76
81
  ))}
77
82
  </nav>
83
+
78
84
  </aside>
79
85
 
80
86
  {mobileOpen && (
@@ -96,8 +102,11 @@ export const SettingsLayout = ({
96
102
  />
97
103
  ))}
98
104
  </nav>
105
+
99
106
  </aside>
107
+
100
108
  </div>
109
+
101
110
  )}
102
111
 
103
112
  <div className="udb-settings__main">
@@ -107,14 +116,17 @@ export const SettingsLayout = ({
107
116
  variant="ghost"
108
117
  size="icon"
109
118
  onClick={() => setMobileOpen(true)}
110
- aria-label="Open mobile menu"
119
+ aria-label={labels.openMobileMenu}
111
120
  >
112
121
  <Menu className="udb-settings__toggle-icon-lg" />
113
122
  </Button>
123
+
114
124
  <h2 className="udb-settings__mobile-title">
115
125
  {config.brandName}
116
126
  </h2>
127
+
117
128
  </div>
129
+
118
130
  </header>
119
131
 
120
132
  <main className="udb-settings__content">
@@ -126,13 +138,18 @@ export const SettingsLayout = ({
126
138
  <Skeleton key={i} className="udb-settings__skeleton-row" />
127
139
  ))}
128
140
  </div>
141
+
129
142
  </div>
143
+
130
144
  ) : (
131
145
  <Outlet />
132
146
  )}
133
147
  </main>
148
+
134
149
  </div>
150
+
135
151
  </div>
152
+
136
153
  );
137
154
  };
138
155
 
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from "react";
2
- import { Link } from "react-router-dom";
2
+ import { Link } from "react-router";
3
3
  import { ChevronRight } from "lucide-react";
4
4
  import { cn } from "@umituz/web-design-system/utils/cn";
5
5
  import type { SettingsSection as SettingsSectionType } from "../types/settings";
@@ -30,6 +30,7 @@ export const SettingsSection = ({
30
30
  <h3 className="udb-settings-nav__title">
31
31
  {section.title}
32
32
  </h3>
33
+
33
34
  )}
34
35
 
35
36
  <div className="udb-settings-nav__items">
@@ -49,13 +50,12 @@ export const SettingsSection = ({
49
50
  {!collapsed && (
50
51
  <>
51
52
  <span className="udb-settings-nav__item-label">{item.label}</span>
52
- {item.badge !== undefined && item.badge > 0 && (
53
- <span
54
- className="udb-settings-nav__badge"
55
- aria-label={`${item.badge} notifications`}
56
- >
57
- {item.badge > 99 ? "99+" : item.badge}
53
+
54
+ {item.badge !== undefined && item.badge !== "" && item.badge !== 0 && (
55
+ <span className="udb-settings-nav__badge">
56
+ {item.badge}
58
57
  </span>
58
+
59
59
  )}
60
60
  {item.path && (
61
61
  <ChevronRight
@@ -64,8 +64,10 @@ export const SettingsSection = ({
64
64
  />
65
65
  )}
66
66
  </>
67
+
67
68
  )}
68
69
  </>
70
+
69
71
  );
70
72
 
71
73
  const itemClassName = cn(
@@ -85,6 +87,7 @@ export const SettingsSection = ({
85
87
  >
86
88
  {itemContent}
87
89
  </Link>
90
+
88
91
  );
89
92
  }
90
93
 
@@ -99,9 +102,12 @@ export const SettingsSection = ({
99
102
  >
100
103
  {itemContent}
101
104
  </button>
105
+
102
106
  );
103
107
  })}
104
108
  </div>
109
+
105
110
  </div>
111
+
106
112
  );
107
113
  };