@admin-layout/tailwind-design-pro 12.2.4-alpha.8 → 12.2.4-alpha.84

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 (85) hide show
  1. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  2. package/lib/components/Layout/BasicLayout/index.js +16 -2
  3. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  4. package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.d.ts +12 -0
  5. package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.d.ts.map +1 -0
  6. package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.js +18 -0
  7. package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.js.map +1 -0
  8. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -2
  9. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  10. package/lib/components/Layout/GlobalHeader/RightContent.js +10 -72
  11. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  12. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  13. package/lib/components/Layout/GlobalHeader/RightMenu.js +16 -80
  14. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  15. package/lib/components/Layout/GlobalHeader/SearchBar.js +1 -1
  16. package/lib/components/Layout/GlobalHeader/index.d.ts +1 -0
  17. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
  18. package/lib/components/Layout/ProTailwindLayout.d.ts +1 -1
  19. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  20. package/lib/components/Layout/ProTailwindLayout.js +48 -36
  21. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  22. package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -1
  23. package/lib/components/Layout/Sidebar/BottomMenu.js +51 -78
  24. package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -1
  25. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -1
  26. package/lib/components/Layout/Sidebar/DynamicIcon.js +80 -19
  27. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
  28. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -1
  29. package/lib/components/Layout/Sidebar/MainSidebar.js +20 -17
  30. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -1
  31. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -1
  32. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +187 -16
  33. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -1
  34. package/lib/components/Layout/Sidebar/MenuDynamicDialog.d.ts +12 -0
  35. package/lib/components/Layout/Sidebar/MenuDynamicDialog.d.ts.map +1 -0
  36. package/lib/components/Layout/Sidebar/MenuDynamicDialog.js +79 -0
  37. package/lib/components/Layout/Sidebar/MenuDynamicDialog.js.map +1 -0
  38. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -1
  39. package/lib/components/Layout/Sidebar/PerplexSidebar.js +8 -12
  40. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -1
  41. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -1
  42. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +301 -39
  43. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -1
  44. package/lib/components/Layout/Sidebar/SidebarRailFX.d.ts +23 -0
  45. package/lib/components/Layout/Sidebar/SidebarRailFX.d.ts.map +1 -0
  46. package/lib/components/Layout/Sidebar/SidebarRailFX.js +229 -0
  47. package/lib/components/Layout/Sidebar/SidebarRailFX.js.map +1 -0
  48. package/lib/components/Layout/TailwindLayout.js +3 -1
  49. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  50. package/lib/components/Layout/getPageTitle.js +2 -2
  51. package/lib/components/Layout/getPageTitle.js.map +1 -1
  52. package/lib/components/Layout/slot-fill/RightContent.d.ts +3 -1
  53. package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -1
  54. package/lib/components/Layout/slot-fill/RightContent.js +4 -6
  55. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
  56. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -1
  57. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +2 -1
  58. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -1
  59. package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -1
  60. package/lib/components/SettingDrawer/utils/constants.js +3 -0
  61. package/lib/components/SettingDrawer/utils/constants.js.map +1 -1
  62. package/lib/components/SettingsThemeApplier/SettingsThemeApplier.d.ts +10 -0
  63. package/lib/components/SettingsThemeApplier/SettingsThemeApplier.d.ts.map +1 -0
  64. package/lib/components/SettingsThemeApplier/SettingsThemeApplier.js +23 -0
  65. package/lib/components/SettingsThemeApplier/SettingsThemeApplier.js.map +1 -0
  66. package/lib/components/SettingsThemeApplier/index.d.ts +2 -0
  67. package/lib/components/SettingsThemeApplier/index.d.ts.map +1 -0
  68. package/lib/components/index.js +1 -1
  69. package/lib/components/typings.d.ts +2 -0
  70. package/lib/components/typings.d.ts.map +1 -1
  71. package/lib/compute.js +2 -2
  72. package/lib/compute.js.map +1 -1
  73. package/lib/helpers/DynamicIcon.js +7 -1
  74. package/lib/helpers/DynamicIcon.js.map +1 -1
  75. package/lib/index.d.ts +2 -0
  76. package/lib/index.d.ts.map +1 -1
  77. package/lib/index.js +1 -1
  78. package/lib/index.js.map +1 -1
  79. package/lib/routes.json +5 -2
  80. package/lib/styles/index.css +282 -0
  81. package/lib/utils/settingsTheme.d.ts +40 -0
  82. package/lib/utils/settingsTheme.d.ts.map +1 -0
  83. package/lib/utils/settingsTheme.js +106 -0
  84. package/lib/utils/settingsTheme.js.map +1 -0
  85. package/package.json +8 -7
@@ -492,8 +492,290 @@
492
492
  --table-header: 141 10% 96%;
493
493
  --code-background: 141 10% 96%;
494
494
  }
495
+
496
+ /* Yantra Theme - Default (Dark)
497
+ Scene: AI engineer iterating on agentic workflows late evening on a 32"
498
+ monitor in a warm-lit home office. Warm blue-charcoal surface, amber-gold
499
+ signal color. Committed color strategy; neutrals tinted toward brand hue. */
500
+ [data-theme="yantra"] {
501
+ --background: 222 18% 9%;
502
+ --foreground: 38 30% 94%;
503
+ --card: 222 16% 12%;
504
+ --card-foreground: 38 30% 94%;
505
+ --popover: 222 16% 12%;
506
+ --popover-foreground: 38 30% 94%;
507
+ --primary: 38 92% 58%;
508
+ --primary-foreground: 222 30% 8%;
509
+ --secondary: 222 14% 17%;
510
+ --secondary-foreground: 38 30% 94%;
511
+ --muted: 222 14% 17%;
512
+ --muted-foreground: 222 10% 65%;
513
+ --accent: 222 14% 20%;
514
+ --accent-foreground: 38 92% 64%;
515
+ --destructive: 0 72% 55%;
516
+ --destructive-foreground: 38 30% 96%;
517
+ --border: 222 14% 20%;
518
+ --input: 222 14% 20%;
519
+ --ring: 38 92% 58%;
520
+ --radius: 0.625rem;
521
+
522
+ --brand-primary: 38 92% 58%;
523
+ --brand-secondary: 222 14% 17%;
524
+ --brand-accent: 38 80% 70%;
525
+
526
+ --success: 152 60% 45%;
527
+ --warning: 38 92% 58%;
528
+ --error: 0 72% 55%;
529
+ --info: 200 80% 55%;
530
+
531
+ --gradient-primary: linear-gradient(135deg, hsl(38 92% 58%), hsl(28 92% 52%));
532
+ --gradient-secondary: linear-gradient(135deg, hsl(222 14% 17%), hsl(222 14% 22%));
533
+ --gradient-brand: linear-gradient(135deg, hsl(38 92% 58%), hsl(14 80% 56%));
534
+
535
+ --shadow-sm: 0 1px 2px 0 hsl(222 30% 4% / 0.4);
536
+ --shadow-md: 0 4px 12px -2px hsl(222 30% 4% / 0.45);
537
+ --shadow-lg: 0 12px 32px -8px hsl(222 30% 4% / 0.55);
538
+ --shadow-xl: 0 24px 48px -12px hsl(222 30% 4% / 0.65);
539
+
540
+ --sidebar-background: 222 18% 7%;
541
+ --sidebar-foreground: 38 30% 94%;
542
+ --sidebar-border: 222 14% 14%;
543
+ --modal-backdrop: 222 30% 4% / 0.85;
544
+ --dropdown-background: 222 16% 12%;
545
+ --table-header: 222 14% 14%;
546
+ --code-background: 222 18% 7%;
547
+ }
548
+
549
+ /* Yantra Theme - Light Mode */
550
+ [data-theme="yantra"].light {
551
+ --background: 38 30% 98%;
552
+ --foreground: 222 30% 12%;
553
+ --card: 0 0% 100%;
554
+ --card-foreground: 222 30% 12%;
555
+ --popover: 0 0% 100%;
556
+ --popover-foreground: 222 30% 12%;
557
+ --primary: 28 88% 48%;
558
+ --primary-foreground: 38 30% 98%;
559
+ --secondary: 38 30% 95%;
560
+ --secondary-foreground: 222 30% 12%;
561
+ --muted: 38 22% 94%;
562
+ --muted-foreground: 222 14% 42%;
563
+ --accent: 38 60% 92%;
564
+ --accent-foreground: 28 88% 38%;
565
+ --destructive: 0 72% 50%;
566
+ --destructive-foreground: 38 30% 98%;
567
+ --border: 38 18% 88%;
568
+ --input: 38 18% 88%;
569
+ --ring: 28 88% 48%;
570
+
571
+ --brand-primary: 28 88% 48%;
572
+ --brand-secondary: 38 30% 95%;
573
+ --brand-accent: 38 92% 58%;
574
+
575
+ --gradient-primary: linear-gradient(135deg, hsl(28 88% 48%), hsl(14 80% 50%));
576
+ --gradient-secondary: linear-gradient(135deg, hsl(38 30% 95%), hsl(38 30% 92%));
577
+ --gradient-brand: linear-gradient(135deg, hsl(38 92% 58%), hsl(14 80% 56%));
578
+
579
+ --shadow-sm: 0 1px 2px 0 hsl(28 60% 30% / 0.06);
580
+ --shadow-md: 0 4px 12px -2px hsl(28 60% 30% / 0.1);
581
+ --shadow-lg: 0 12px 32px -8px hsl(28 60% 30% / 0.12);
582
+ --shadow-xl: 0 24px 48px -12px hsl(28 60% 30% / 0.16);
583
+
584
+ --sidebar-background: 38 30% 96%;
585
+ --sidebar-foreground: 222 30% 12%;
586
+ --sidebar-border: 38 18% 88%;
587
+ --modal-backdrop: 222 30% 12% / 0.7;
588
+ --dropdown-background: 0 0% 100%;
589
+ --table-header: 38 22% 94%;
590
+ --code-background: 38 22% 94%;
591
+ }
592
+
593
+ /* ─────────────────────────────────────────────────────────────
594
+ Yantra Editorial Layer — shared design system for marketing
595
+ and impeccable product surfaces (pricing, operator, landing,
596
+ gallery, etc.). Tokens use OKLCH; classes are unscoped so any
597
+ page can opt-in by writing `<div className="y-display">`.
598
+
599
+ Brand register: warm cream + persimmon accent, Josefin Sans
600
+ for display, ui-monospace for captions. Tinted neutrals (no
601
+ pure black/white). Animation easing committed to one curve.
602
+ ───────────────────────────────────────────────────────────── */
603
+ :root {
604
+ --y-cream: oklch(0.97 0.012 60);
605
+ --y-cream-2: oklch(0.94 0.014 60);
606
+ --y-cream-3: oklch(0.91 0.014 60);
607
+ --y-ink: oklch(0.18 0.012 60);
608
+ --y-ink-2: oklch(0.32 0.013 60);
609
+ --y-mute: oklch(0.55 0.012 60);
610
+ --y-rule: oklch(0.86 0.012 60);
611
+ --y-rule-2: oklch(0.78 0.012 60);
612
+ --y-accent: oklch(0.66 0.19 38);
613
+ --y-accent-ink: oklch(0.32 0.13 38);
614
+ --y-ease: cubic-bezier(0.16, 1, 0.3, 1);
615
+ --y-font-display: 'Josefin Sans', ui-sans-serif, system-ui, sans-serif;
616
+ --y-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
617
+ }
618
+
619
+ [data-theme="yantra"].dark,
620
+ [data-theme="yantra"]:not(.light) {
621
+ /* Inverted editorial palette for dark surfaces — same accent. */
622
+ --y-cream: oklch(0.20 0.013 60);
623
+ --y-cream-2: oklch(0.24 0.013 60);
624
+ --y-cream-3: oklch(0.28 0.013 60);
625
+ --y-ink: oklch(0.96 0.010 60);
626
+ --y-ink-2: oklch(0.82 0.010 60);
627
+ --y-mute: oklch(0.62 0.010 60);
628
+ --y-rule: oklch(0.32 0.010 60);
629
+ --y-rule-2: oklch(0.40 0.010 60);
630
+ --y-accent: oklch(0.74 0.18 38);
631
+ --y-accent-ink: oklch(0.86 0.16 38);
632
+ }
633
+ }
634
+
635
+ /* Yantra editorial — surface + typography utilities (unscoped) */
636
+ @layer components {
637
+ .y-surface {
638
+ background: var(--y-cream);
639
+ color: var(--y-ink);
640
+ font-feature-settings: 'ss01', 'cv01', 'cv11';
641
+ }
642
+
643
+ .y-display {
644
+ font-family: var(--y-font-display);
645
+ font-weight: 200;
646
+ font-size: clamp(2.5rem, 6.5vw, 6rem);
647
+ line-height: 0.95;
648
+ letter-spacing: -0.035em;
649
+ color: var(--y-ink);
650
+ }
651
+ .y-display em {
652
+ font-style: italic;
653
+ font-weight: 300;
654
+ color: var(--y-accent);
655
+ }
656
+ .y-display .y-period { color: var(--y-accent); }
657
+
658
+ .y-prose {
659
+ font-family: var(--y-font-display);
660
+ font-weight: 300;
661
+ font-size: clamp(1.4rem, 2.4vw, 2rem);
662
+ line-height: 1.4;
663
+ letter-spacing: -0.005em;
664
+ color: var(--y-ink);
665
+ }
666
+ .y-prose em { font-style: italic; color: var(--y-accent-ink); }
667
+
668
+ .y-lede {
669
+ font-family: var(--y-font-display);
670
+ font-weight: 300;
671
+ font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
672
+ line-height: 1.55;
673
+ color: var(--y-ink-2);
674
+ max-width: 56ch;
675
+ }
676
+ .y-lede em { font-style: italic; color: var(--y-accent); }
677
+
678
+ .y-mono {
679
+ font-family: var(--y-font-mono);
680
+ font-size: 0.72rem;
681
+ letter-spacing: 0.14em;
682
+ text-transform: uppercase;
683
+ color: var(--y-mute);
684
+ }
685
+
686
+ .y-num {
687
+ font-family: var(--y-font-display);
688
+ font-weight: 200;
689
+ font-size: clamp(2.5rem, 4vw, 3.75rem);
690
+ line-height: 0.9;
691
+ letter-spacing: -0.02em;
692
+ color: var(--y-ink);
693
+ }
694
+
695
+ .y-rule { height: 1px; background: var(--y-rule); border: 0; }
696
+ .y-dot {
697
+ width: 0.4rem;
698
+ height: 0.4rem;
699
+ border-radius: 50%;
700
+ background: var(--y-accent);
701
+ display: inline-block;
702
+ }
703
+
704
+ /* Section grid — paired meta column + content column */
705
+ .y-section { border-top: 1px solid var(--y-rule); }
706
+ .y-section-head {
707
+ display: grid;
708
+ grid-template-columns: 1fr;
709
+ gap: 0.5rem;
710
+ padding-top: clamp(2rem, 5vw, 3.5rem);
711
+ padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
712
+ }
713
+ @media (min-width: 768px) {
714
+ .y-section-head { grid-template-columns: 5fr 7fr; gap: 2rem; }
715
+ }
716
+ .y-section-num {
717
+ font-family: var(--y-font-mono);
718
+ font-size: 0.72rem;
719
+ letter-spacing: 0.16em;
720
+ text-transform: uppercase;
721
+ color: var(--y-mute);
722
+ }
723
+ .y-section-title {
724
+ font-family: var(--y-font-display);
725
+ font-weight: 300;
726
+ font-size: clamp(1.75rem, 3vw, 2.5rem);
727
+ line-height: 1.05;
728
+ letter-spacing: -0.02em;
729
+ color: var(--y-ink);
730
+ }
731
+ .y-section-title em { font-style: italic; color: var(--y-accent); }
732
+ .y-section-desc {
733
+ font-size: 1rem;
734
+ line-height: 1.6;
735
+ color: var(--y-ink-2);
736
+ max-width: 60ch;
737
+ margin-top: 0.75rem;
738
+ }
739
+
740
+ /* Reveal animation — committed to one easing curve */
741
+ .y-reveal {
742
+ opacity: 0;
743
+ transform: translateY(0.6rem);
744
+ animation: y-reveal 1100ms var(--y-ease) forwards;
745
+ }
746
+ .y-reveal[data-d="1"] { animation-delay: 80ms; }
747
+ .y-reveal[data-d="2"] { animation-delay: 160ms; }
748
+ .y-reveal[data-d="3"] { animation-delay: 240ms; }
749
+ .y-reveal[data-d="4"] { animation-delay: 320ms; }
750
+ .y-reveal[data-d="5"] { animation-delay: 440ms; }
751
+ @keyframes y-reveal {
752
+ to { opacity: 1; transform: translateY(0); }
753
+ }
754
+ @media (prefers-reduced-motion: reduce) {
755
+ .y-reveal { opacity: 1; transform: none; animation: none; }
756
+ }
757
+
758
+ /* Capability ticker — for spec lists */
759
+ .y-ticker {
760
+ font-family: var(--y-font-mono);
761
+ font-size: 0.72rem;
762
+ letter-spacing: 0.06em;
763
+ text-transform: uppercase;
764
+ color: var(--y-ink-2);
765
+ }
766
+ .y-ticker-row {
767
+ display: flex;
768
+ align-items: baseline;
769
+ justify-content: space-between;
770
+ gap: 1rem;
771
+ padding: 0.7rem 0;
772
+ border-top: 1px solid var(--y-rule);
773
+ }
774
+ .y-ticker-row:last-child { border-bottom: 1px solid var(--y-rule); }
775
+ .y-ticker-row .y-ticker-id { color: var(--y-mute); }
495
776
  }
496
777
 
778
+
497
779
  @layer base {
498
780
  * {
499
781
  @apply border-border;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Settings → DOM theme utilities.
3
+ *
4
+ * Three-layer cascade applied to <html>:
5
+ * 1. :root defaults ← package CSS
6
+ * 2. [data-theme="x"] ← brand theme (color + font + radius)
7
+ * 3. :root { ... } injected by settings ← user overrides (highest priority)
8
+ *
9
+ * `getServerThemeAttrs` produces the SSR payload (data-theme attr, dark class,
10
+ * <style> string) so the first paint already matches the user's saved
11
+ * customisations and there is no flash. `applyThemeToDom` performs the same
12
+ * mutation at runtime when the user changes a setting in the drawer; the
13
+ * SettingDrawer's existing reset handler clears storage + reloads, after which
14
+ * the override style block is empty and the page falls back to pure theme.
15
+ */
16
+ export declare const THEME_KEYS: readonly ["default", "github", "slack", "airbnb", "spotify", "yantra"];
17
+ export type ThemeKey = (typeof THEME_KEYS)[number];
18
+ export interface SettingsLikeShape {
19
+ theme?: string;
20
+ themeName?: string;
21
+ navTheme?: string;
22
+ primaryColor?: string;
23
+ fontFamily?: string;
24
+ }
25
+ export interface ServerThemeAttrs {
26
+ dataTheme: ThemeKey;
27
+ isDark: boolean;
28
+ /** Inline CSS for the user-overrides style block (without the surrounding <style> tag). */
29
+ overridesCss: string;
30
+ }
31
+ /** Convert `#rrggbb` (or `#rgb`) to `"H S% L%"` matching the package CSS convention. */
32
+ export declare function hexToHslSpace(hex?: string | null): string | null;
33
+ /** Build the `:root { ... }` body for the override style block. Empty string means no override. */
34
+ export declare function buildOverridesCss(settings?: SettingsLikeShape | null): string;
35
+ /** SSR helper: derive html attributes + inline style for the initial render. */
36
+ export declare function getServerThemeAttrs(settings?: SettingsLikeShape | null): ServerThemeAttrs;
37
+ /** Runtime applier — mirrors `getServerThemeAttrs` but mutates the live DOM. */
38
+ export declare function applyThemeToDom(settings?: SettingsLikeShape | null): void;
39
+ export declare const SETTINGS_THEME_STYLE_ID = "settings-theme-overrides";
40
+ //# sourceMappingURL=settingsTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsTheme.d.ts","sourceRoot":"","sources":["../../src/utils/settingsTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,UAAU,wEAAyE,CAAC;AACjG,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAInD,MAAM,WAAW,iBAAiB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAC;CACxB;AAgBD,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAwChE;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAiB7E;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,gBAAgB,CAMzF;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAmBzE;AAED,eAAO,MAAM,uBAAuB,6BAAmB,CAAC"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Settings → DOM theme utilities.
3
+ *
4
+ * Three-layer cascade applied to <html>:
5
+ * 1. :root defaults ← package CSS
6
+ * 2. [data-theme="x"] ← brand theme (color + font + radius)
7
+ * 3. :root { ... } injected by settings ← user overrides (highest priority)
8
+ *
9
+ * `getServerThemeAttrs` produces the SSR payload (data-theme attr, dark class,
10
+ * <style> string) so the first paint already matches the user's saved
11
+ * customisations and there is no flash. `applyThemeToDom` performs the same
12
+ * mutation at runtime when the user changes a setting in the drawer; the
13
+ * SettingDrawer's existing reset handler clears storage + reloads, after which
14
+ * the override style block is empty and the page falls back to pure theme.
15
+ */
16
+ const THEME_KEYS = ['default', 'github', 'slack', 'airbnb', 'spotify', 'yantra'];
17
+ const STYLE_ELEMENT_ID = 'settings-theme-overrides';
18
+ function isThemeKey(value) {
19
+ return typeof value === 'string' && THEME_KEYS.includes(value);
20
+ }
21
+ function resolveThemeKey(settings) {
22
+ const candidate = settings?.theme ?? settings?.themeName;
23
+ return isThemeKey(candidate) ? candidate : 'default';
24
+ }
25
+ function resolveIsDark(settings) {
26
+ const nav = settings?.navTheme;
27
+ return nav === 'realDark' || nav === 'dark';
28
+ }
29
+ /** Convert `#rrggbb` (or `#rgb`) to `"H S% L%"` matching the package CSS convention. */
30
+ function hexToHslSpace(hex) {
31
+ if (!hex || typeof hex !== 'string') return null;
32
+ let raw = hex.trim().replace(/^#/, '');
33
+ if (raw.length === 3) raw = raw.split('').map(c => c + c).join('');
34
+ if (!/^[0-9a-fA-F]{6}$/.test(raw)) return null;
35
+ const r = parseInt(raw.slice(0, 2), 16) / 255;
36
+ const g = parseInt(raw.slice(2, 4), 16) / 255;
37
+ const b = parseInt(raw.slice(4, 6), 16) / 255;
38
+ const max = Math.max(r, g, b);
39
+ const min = Math.min(r, g, b);
40
+ const l = (max + min) / 2;
41
+ let h = 0;
42
+ let s = 0;
43
+ if (max !== min) {
44
+ const d = max - min;
45
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
46
+ switch (max) {
47
+ case r:
48
+ h = (g - b) / d + (g < b ? 6 : 0);
49
+ break;
50
+ case g:
51
+ h = (b - r) / d + 2;
52
+ break;
53
+ default:
54
+ h = (r - g) / d + 4;
55
+ }
56
+ h *= 60;
57
+ }
58
+ const hh = Math.round(h);
59
+ const ss = Math.round(s * 100);
60
+ const ll = Math.round(l * 100);
61
+ return `${hh} ${ss}% ${ll}%`;
62
+ }
63
+ /** Build the `:root { ... }` body for the override style block. Empty string means no override. */
64
+ function buildOverridesCss(settings) {
65
+ if (!settings) return '';
66
+ const decls = [];
67
+ const hsl = hexToHslSpace(settings.primaryColor);
68
+ if (hsl) decls.push(`--primary:${hsl};--ring:${hsl};`);
69
+ const font = settings.fontFamily;
70
+ if (font && typeof font === 'string') {
71
+ // Whitelist-ish: only allow a comma-separated list of identifiers / quoted strings.
72
+ // Strip anything containing braces or semicolons (basic CSS-injection guard).
73
+ if (!/[{};]/.test(font)) {
74
+ decls.push(`--font-display:${font};--font-body:${font};`);
75
+ }
76
+ }
77
+ return decls.length > 0 ? `:root{${decls.join('')}}` : '';
78
+ }
79
+ /** SSR helper: derive html attributes + inline style for the initial render. */
80
+ function getServerThemeAttrs(settings) {
81
+ return {
82
+ dataTheme: resolveThemeKey(settings),
83
+ isDark: resolveIsDark(settings),
84
+ overridesCss: buildOverridesCss(settings)
85
+ };
86
+ }
87
+ /** Runtime applier — mirrors `getServerThemeAttrs` but mutates the live DOM. */
88
+ function applyThemeToDom(settings) {
89
+ if (typeof document === 'undefined') return;
90
+ const html = document.documentElement;
91
+ html.setAttribute('data-theme', resolveThemeKey(settings));
92
+ html.classList.toggle('dark', resolveIsDark(settings));
93
+ const css = buildOverridesCss(settings);
94
+ let node = document.getElementById(STYLE_ELEMENT_ID);
95
+ if (css) {
96
+ if (!node) {
97
+ node = document.createElement('style');
98
+ node.id = STYLE_ELEMENT_ID;
99
+ document.head.appendChild(node);
100
+ }
101
+ if (node.textContent !== css) node.textContent = css;
102
+ } else if (node) {
103
+ node.remove();
104
+ }
105
+ }
106
+ const SETTINGS_THEME_STYLE_ID = STYLE_ELEMENT_ID;export{SETTINGS_THEME_STYLE_ID,THEME_KEYS,applyThemeToDom,buildOverridesCss,getServerThemeAttrs,hexToHslSpace};//# sourceMappingURL=settingsTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsTheme.js","sources":["../../src/utils/settingsTheme.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;AAcG;AAEI,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;AAGtF,MAAM,gBAAgB,GAAG,0BAA0B;AAiBnD,SAAS,UAAU,CAAC,KAAc,EAAA;SAC9B,OAAO,KAAO,KAAK,QAAK,IAAQ,UAAK,CAAA,QAAiC,CAAA,KAAS,CAAA;AACnF;AAEA,SAAS,eAAe,CAAC,QAAmC,EAAA;QACxD,SAAM,WAAY,EAAQ,SAAO,QAAI,EAAQ,SAAE;AAC/C,EAAA,OAAA,UAAO,CAAA,SAAW,CAAA,GAAW,SAAE,GAAU,SAAE;AAC/C;AAEA,SAAS,aAAa,CAAC,QAAmC,EAAA;AACtD,EAAA,MAAA,GAAM,GAAG,QAAG,EAAQ;AACpB,EAAA,OAAA,QAAU,UAAK,OAAc,KAAG;AACpC;AAEA;AACM,SAAU,aAAa,CAAC,GAAmB,EAAA;AAC7C,EAAA,IAAA,CAAA,GAAK,IAAG,OAAI,GAAO,aAAQ,EAAQ,OAAA,IAAA;AAAE,EAAA,IAAA,GAAA,GAAA,GAAO,KAAK,EAAA,CAAA,OAAA,CAAA,IAAA,EAAA,EAAA,CAAA;AACjD,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YAAC,EAAA,iBAAA,CAAA,QAAA;;AAGL;AAEA;AACM,SAAU,eAAA,CAAA,QAAoB,EAAA;MAChC,OAAO,QAAA,KAAA,WAAA,EAAA;AACH,EAAA,MAAA,IAAA,GAAA,QAAW,CAAA,eAAgB;AAC3B,EAAA,IAAA,CAAA,YAAQ,CAAA,YAAc,EAAA,eAAS,CAAA,QAAA,CAAA,CAAA;AAC/B,EAAA,IAAA,CAAA,SAAA,CAAA,MAAc,CAAA,MAAA,EAAA,aAAkB,CAAA,QAAS,CAAA,CAAA;QAC3C,GAAA,GAAA,iBAAA,CAAA,QAAA,CAAA;AACN,EAAC,IAAA,IAAA,GAAA,QAAA,CAAA,cAAA,CAAA,gBAAA,CAAA;AAED,EAAA,IAAA,GAAA,EAAA;AACA,IAAA,IAAM,CAAA,IAAA,EAAA;MACF,IAAI,GAAA,QAAO,CAAA,aAAa,CAAA,OAAW,CAAA;UAAE,CAAA,EAAA,GAAO,gBAAA;AAC5C,MAAA,QAAU,CAAA,IAAG,CAAA;IAEb;AACA,IAAA,IAAI,IAAC,CAAA,WAAU,KAAO,GAAM,EAAE,IAAA,CAAA,WAAc,GAAA,GAAQ;AAEpD,EAAA,CAAA,MAAA,IAAS,IAAG,EAAA;IACZ,IAAI,CAAA,MAAO,EAAA;;;AAGH,MAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/tailwind-design-pro",
3
- "version": "12.2.4-alpha.8",
3
+ "version": "12.2.4-alpha.84",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -21,15 +21,16 @@
21
21
  "watch": "yarn build:lib:watch"
22
22
  },
23
23
  "dependencies": {
24
- "@admin-layout/assets": "12.2.4-alpha.6",
25
- "@admin-layout/client": "12.2.4-alpha.7",
26
- "@admin-layout/tailwind-ui": "12.2.4-alpha.7",
24
+ "@admin-layout/assets": "12.2.4-alpha.81",
25
+ "@admin-layout/client": "12.2.4-alpha.81",
26
+ "@admin-layout/tailwind-ui": "12.2.4-alpha.81",
27
+ "path-to-regexp": "^8.0.0",
27
28
  "react-favicon": "^0.0.23",
28
29
  "react-intl": "^6.1.1",
29
30
  "react-responsive": "^10.0.0"
30
31
  },
31
32
  "devDependencies": {
32
- "@adminide-stack/extension-api": "13.2.1-alpha.81",
33
+ "@adminide-stack/extension-api": "13.4.1-alpha.315",
33
34
  "@tailwindcss/aspect-ratio": "^0.4.2",
34
35
  "@tailwindcss/forms": "^0.5.4",
35
36
  "@tailwindcss/typography": "^0.5.9",
@@ -51,8 +52,8 @@
51
52
  }
52
53
  }
53
54
  },
55
+ "gitHead": "3d6a9b9581037405384b1f9b48b55546ce6ad848",
54
56
  "typescript": {
55
57
  "definition": "lib/index.d.ts"
56
- },
57
- "gitHead": "8aa1f3652e57ae6ba53f0d89502fa5cadf6bd154"
58
+ }
58
59
  }