@behavioral-agentic-design-system/core 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +35 -6
- package/scripts/bads-sync.mjs +1 -1
- package/scripts/build-fonts.cjs +15 -8
- package/scripts/build-tokens.cjs +139 -23
- package/src/api/brand-fonts.ts +27 -6
- package/src/api/layers/file.ts +4 -3
- package/src/api/layers.ts +41 -12
- package/src/api/onboarding-extract.ts +435 -0
- package/src/api/onboarding.ts +82 -0
- package/src/api/site-auth.ts +50 -0
- package/src/app/font-ready.tsx +1 -1
- package/src/app/layout.tsx +9 -3
- package/src/app/preview/components/page.tsx +78 -1
- package/src/app/preview/icons/page.tsx +5 -0
- package/src/app/shell.tsx +90 -23
- package/src/app/site-login/page.tsx +82 -0
- package/src/brand-fonts.css +5 -0
- package/src/components/Foundations/Colors.stories.tsx +10 -1
- package/src/components/Foundations/Motion.stories.tsx +66 -0
- package/src/components/customize/letter-spacing.tsx +3 -2
- package/src/components/customize/type-scale.tsx +3 -2
- package/src/components/customize-tab.tsx +11 -7
- package/src/components/home-tab.tsx +498 -235
- package/src/components/layers-tab.tsx +313 -10
- package/src/components/onboarding-wizard.tsx +1421 -0
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/bottom-sheet.tsx +124 -0
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/chart.tsx +115 -14
- package/src/components/ui/checkbox.tsx +3 -2
- package/src/components/ui/dialog.tsx +7 -4
- package/src/components/ui/dropdown-menu.tsx +4 -0
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/popover.tsx +6 -0
- package/src/components/ui/radio-group.tsx +4 -3
- package/src/components/ui/scroll-area.tsx +5 -0
- package/src/components/ui/select.tsx +4 -0
- package/src/components/ui/sheet.tsx +8 -1
- package/src/components/ui/slider.tsx +22 -7
- package/src/components/ui/switch.tsx +3 -3
- package/src/components/ui/tabs.tsx +6 -0
- package/src/components/ui/tooltip.tsx +4 -0
- package/src/fonts/HyperlegibleSans-Bold.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-BoldItalic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Italic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Medium.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-MediumItalic.woff2 +0 -0
- package/src/fonts/HyperlegibleSans-Regular.woff2 +0 -0
- package/src/fonts/InterVariable-Italic.woff2 +0 -0
- package/src/fonts/InterVariable.woff2 +0 -0
- package/src/fonts.css +99 -0
- package/src/hooks/use-global-primary-color.ts +114 -68
- package/src/hooks/use-global-serif-font.ts +1 -1
- package/src/hooks/use-portal-theme-class.tsx +90 -0
- package/src/lib/storage.ts +2 -2
- package/src/styles.css +151 -61
- package/src/tokens.default.json +4 -4
- package/src/tokens.json +159 -162
- package/src/app/preview/login/page.tsx +0 -5
- package/src/app/preview/mail/page.tsx +0 -4
- package/src/app/preview/pricing/page.tsx +0 -4
- package/src/components/admin-menu.stories.tsx +0 -68
- package/src/components/admin-menu.tsx +0 -59
package/src/tokens.json
CHANGED
|
@@ -68,17 +68,12 @@
|
|
|
68
68
|
"300": {
|
|
69
69
|
"$value": "#7292A1",
|
|
70
70
|
"$type": "color",
|
|
71
|
-
"$description": "Mid blue-gray —
|
|
72
|
-
},
|
|
73
|
-
"400": {
|
|
74
|
-
"$value": "#527081",
|
|
75
|
-
"$type": "color",
|
|
76
|
-
"$description": "Slate-blue — default borders/dividers on dark backgrounds (oklch L 0.485). ~3.5:1 on card, ~3.7:1 on page bg. AAA non-text."
|
|
71
|
+
"$description": "Mid blue-gray — input borders on dark backgrounds"
|
|
77
72
|
},
|
|
78
73
|
"500": {
|
|
79
74
|
"$value": "#324852",
|
|
80
75
|
"$type": "color",
|
|
81
|
-
"$description": "Deep blue-gray —
|
|
76
|
+
"$description": "Deep blue-gray — default borders/dividers on dark backgrounds"
|
|
82
77
|
}
|
|
83
78
|
},
|
|
84
79
|
"cream": {
|
|
@@ -163,14 +158,14 @@
|
|
|
163
158
|
},
|
|
164
159
|
"fontFamily": {
|
|
165
160
|
"sans": {
|
|
166
|
-
"$value": "'
|
|
161
|
+
"$value": "'Inter', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
|
|
167
162
|
"$type": "fontFamily",
|
|
168
|
-
"$description": "Primary sans (body, UI).
|
|
163
|
+
"$description": "Primary sans (body, UI). Inter Variable is the BADS default — a single variable woff2 covers weights 100–900, enabling responsive type axes and per-fork weight tuning via --font-variation-settings. Hyperlegible Sans (the Braille Institute's low-vision face) stays second in the stack as the accessibility-preserving fallback and is still self-hosted. ACCESSIBILITY NOTE: forks with a low-vision-heavy audience should reorder to lead with 'Hyperlegible Sans'. Override per client."
|
|
169
164
|
},
|
|
170
165
|
"serif": {
|
|
171
|
-
"$value": "
|
|
166
|
+
"$value": "ui-serif, Georgia, serif",
|
|
172
167
|
"$type": "fontFamily",
|
|
173
|
-
"$description": "
|
|
168
|
+
"$description": "Display/serif fallback stack. No default brand serif — clients should override."
|
|
174
169
|
},
|
|
175
170
|
"mono": {
|
|
176
171
|
"$value": "'JetBrains Mono', ui-monospace, monospace",
|
|
@@ -178,6 +173,11 @@
|
|
|
178
173
|
"$description": "Monospace (code, captions). JetBrains Mono is the default fallback."
|
|
179
174
|
}
|
|
180
175
|
},
|
|
176
|
+
"fontVariationSettings": {
|
|
177
|
+
"$value": "normal",
|
|
178
|
+
"$type": "other",
|
|
179
|
+
"$description": "Variable-font axis settings applied to html (emitted as --font-variation-settings). Default 'normal' lets the weight/optical-size axes resolve from font-weight + opsz auto. Forks tune type here without touching component source — e.g. \"'opsz' 18\" to pin optical size, or \"'wght' 450\" for a custom default weight. Only takes effect when the active sans is a variable font (Inter Variable ships by default)."
|
|
180
|
+
},
|
|
181
181
|
"fontSize": {
|
|
182
182
|
"xs": {
|
|
183
183
|
"$value": "14px",
|
|
@@ -447,7 +447,82 @@
|
|
|
447
447
|
},
|
|
448
448
|
"ease-spring": {
|
|
449
449
|
"$value": "cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
450
|
-
"$type": "cubic-bezier"
|
|
450
|
+
"$type": "cubic-bezier",
|
|
451
|
+
"$description": "Default spring overshoot. Alias of spring-bounce; kept for back-compat with existing component usage."
|
|
452
|
+
},
|
|
453
|
+
"spring-gentle": {
|
|
454
|
+
"$value": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
455
|
+
"$type": "cubic-bezier",
|
|
456
|
+
"$description": "No overshoot, soft settle. Use for large surfaces (sheets, dialogs, page transitions) where bounce would feel cheap."
|
|
457
|
+
},
|
|
458
|
+
"spring-snappy": {
|
|
459
|
+
"$value": "cubic-bezier(0.3, 0, 0, 1)",
|
|
460
|
+
"$type": "cubic-bezier",
|
|
461
|
+
"$description": "Fast attack, near-instant settle, no overshoot. Use for small, frequent UI (toggles, tabs, menu open) that should feel immediate."
|
|
462
|
+
},
|
|
463
|
+
"spring-bounce": {
|
|
464
|
+
"$value": "cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
465
|
+
"$type": "cubic-bezier",
|
|
466
|
+
"$description": "Playful overshoot. Use sparingly for delight moments (success ticks, badge pops). Auto-disabled under prefers-reduced-motion by the base layer."
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"motion": {
|
|
470
|
+
"$description": "Semantic motion layer — intent-named pairings of a duration + easing primitive, so humans and AI pick motion by what it should DO, not by raw numbers. Five intent groups (fade/slide/scale/expand/spin) mirror the slide/fade/scale/rotate/content families. Each emits --motion-<intent>-duration and --motion-<intent>-ease. All motion is auto-killed under prefers-reduced-motion by the base layer. See layer-6-patterns-and-rules/motion.md for the decision tree.",
|
|
471
|
+
"fade": {
|
|
472
|
+
"duration": {
|
|
473
|
+
"$value": "{duration.base}",
|
|
474
|
+
"$type": "dimension",
|
|
475
|
+
"$description": "Opacity in/out — overlays, content swaps, things appearing/disappearing in place."
|
|
476
|
+
},
|
|
477
|
+
"easing": {
|
|
478
|
+
"$value": "{easing.ease-out}",
|
|
479
|
+
"$type": "cubic-bezier"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
"slide": {
|
|
483
|
+
"duration": {
|
|
484
|
+
"$value": "{duration.base}",
|
|
485
|
+
"$type": "dimension",
|
|
486
|
+
"$description": "Positional translate — sheets, drawers, toasts entering from a screen edge."
|
|
487
|
+
},
|
|
488
|
+
"easing": {
|
|
489
|
+
"$value": "{easing.ease-out}",
|
|
490
|
+
"$type": "cubic-bezier"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
"scale": {
|
|
494
|
+
"duration": {
|
|
495
|
+
"$value": "{duration.fast}",
|
|
496
|
+
"$type": "dimension",
|
|
497
|
+
"$description": "Size in/out from an origin — popovers, dropdown menus, tooltips. Snappy spring so it feels instant."
|
|
498
|
+
},
|
|
499
|
+
"easing": {
|
|
500
|
+
"$value": "{easing.spring-snappy}",
|
|
501
|
+
"$type": "cubic-bezier"
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"expand": {
|
|
505
|
+
"duration": {
|
|
506
|
+
"$value": "{duration.slow}",
|
|
507
|
+
"$type": "dimension",
|
|
508
|
+
"$description": "Height / grid-rows reveal — accordions, collapsibles, disclosure (the 'content' family). Slower because the layout shifts around it."
|
|
509
|
+
},
|
|
510
|
+
"easing": {
|
|
511
|
+
"$value": "{easing.ease-in-out}",
|
|
512
|
+
"$type": "cubic-bezier"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"spin": {
|
|
516
|
+
"duration": {
|
|
517
|
+
"$value": "{duration.slow}",
|
|
518
|
+
"$type": "dimension",
|
|
519
|
+
"$description": "Continuous rotate — loaders, busy chevrons. Pair with infinite iteration; linear timing keeps angular velocity constant."
|
|
520
|
+
},
|
|
521
|
+
"easing": {
|
|
522
|
+
"$value": "cubic-bezier(0, 0, 1, 1)",
|
|
523
|
+
"$type": "cubic-bezier",
|
|
524
|
+
"$description": "Linear (no ease) — the cubic-bezier form of `linear` so $type stays consistent."
|
|
525
|
+
}
|
|
451
526
|
}
|
|
452
527
|
},
|
|
453
528
|
"typography": {
|
|
@@ -759,7 +834,7 @@
|
|
|
759
834
|
"$type": "color"
|
|
760
835
|
},
|
|
761
836
|
"primary": {
|
|
762
|
-
"$value": "#
|
|
837
|
+
"$value": "#1F1F1F",
|
|
763
838
|
"$type": "color",
|
|
764
839
|
"$description": "Primary brand. Override per client. Default = shadcn near-black."
|
|
765
840
|
},
|
|
@@ -824,34 +899,33 @@
|
|
|
824
899
|
"$description": "Focus ring base. AAA non-text + 2.4.13: ≥3:1 on every surface. Tracks --primary when brand color changes (luminance-clamped to keep 3:1)."
|
|
825
900
|
},
|
|
826
901
|
"chart-1": {
|
|
827
|
-
"$value": "oklch(0.
|
|
902
|
+
"$value": "oklch(0.6200 0.2000 220)",
|
|
828
903
|
"$type": "color",
|
|
829
|
-
"$description": "
|
|
904
|
+
"$description": "Tuned for AAA 3:1 on white card. Electric cyan-blue."
|
|
830
905
|
},
|
|
831
906
|
"chart-2": {
|
|
832
|
-
"$value": "oklch(0.
|
|
907
|
+
"$value": "oklch(0.6200 0.2200 145)",
|
|
833
908
|
"$type": "color",
|
|
834
|
-
"$description": "
|
|
909
|
+
"$description": "Tuned for AAA 3:1 on white card. Spring green."
|
|
835
910
|
},
|
|
836
911
|
"chart-3": {
|
|
837
|
-
"$value": "oklch(0.
|
|
912
|
+
"$value": "oklch(0.6700 0.2000 70)",
|
|
838
913
|
"$type": "color",
|
|
839
|
-
"$description": "
|
|
914
|
+
"$description": "Tuned for AAA 3:1 on white card. Bright orange-yellow."
|
|
840
915
|
},
|
|
841
916
|
"chart-4": {
|
|
842
|
-
"$value": "oklch(0.
|
|
917
|
+
"$value": "oklch(0.6000 0.2600 340)",
|
|
843
918
|
"$type": "color",
|
|
844
|
-
"$description": "
|
|
919
|
+
"$description": "Tuned for AAA 3:1 on white card. Hot fuchsia."
|
|
845
920
|
},
|
|
846
921
|
"chart-5": {
|
|
847
|
-
"$value": "oklch(0.
|
|
922
|
+
"$value": "oklch(0.6200 0.2200 25)",
|
|
848
923
|
"$type": "color",
|
|
849
|
-
"$description": "
|
|
924
|
+
"$description": "Tuned for AAA 3:1 on white card. Coral."
|
|
850
925
|
},
|
|
851
926
|
"sidebar": {
|
|
852
|
-
"$value": "oklch(0.
|
|
853
|
-
"$type": "color"
|
|
854
|
-
"$description": "Light mode sidebar surface — slightly darker than page background (1.0) so the sidebar reads as a distinct panel, not blank space. Matches --muted for a calm off-white."
|
|
927
|
+
"$value": "oklch(0.9850 0 0)",
|
|
928
|
+
"$type": "color"
|
|
855
929
|
},
|
|
856
930
|
"sidebar-foreground": {
|
|
857
931
|
"$value": "oklch(0.1450 0 0)",
|
|
@@ -934,31 +1008,27 @@
|
|
|
934
1008
|
},
|
|
935
1009
|
"dark": {
|
|
936
1010
|
"background": {
|
|
937
|
-
"$value": "
|
|
938
|
-
"$type": "color"
|
|
939
|
-
"$description": "Page background — deepest brand blue (blue.950). Swimtopia brand surfaces are navy-tinted, not charcoal; black is reserved for text."
|
|
1011
|
+
"$value": "oklch(0.1450 0 0)",
|
|
1012
|
+
"$type": "color"
|
|
940
1013
|
},
|
|
941
1014
|
"foreground": {
|
|
942
|
-
"$value": "
|
|
943
|
-
"$type": "color"
|
|
944
|
-
"$description": "Default text on dark navy surfaces (off-white, neutral.50)."
|
|
1015
|
+
"$value": "oklch(0.9850 0 0)",
|
|
1016
|
+
"$type": "color"
|
|
945
1017
|
},
|
|
946
1018
|
"card": {
|
|
947
|
-
"$value": "
|
|
948
|
-
"$type": "color"
|
|
949
|
-
"$description": "Card surface — deep navy (blue.850), one step lighter than page bg for elevation."
|
|
1019
|
+
"$value": "oklch(0.2050 0 0)",
|
|
1020
|
+
"$type": "color"
|
|
950
1021
|
},
|
|
951
1022
|
"card-foreground": {
|
|
952
|
-
"$value": "
|
|
1023
|
+
"$value": "oklch(0.9850 0 0)",
|
|
953
1024
|
"$type": "color"
|
|
954
1025
|
},
|
|
955
1026
|
"popover": {
|
|
956
|
-
"$value": "
|
|
957
|
-
"$type": "color"
|
|
958
|
-
"$description": "Popover/overlay surface — navy (blue.700), lifted from card for layered overlays."
|
|
1027
|
+
"$value": "oklch(0.2690 0 0)",
|
|
1028
|
+
"$type": "color"
|
|
959
1029
|
},
|
|
960
1030
|
"popover-foreground": {
|
|
961
|
-
"$value": "
|
|
1031
|
+
"$value": "oklch(0.9850 0 0)",
|
|
962
1032
|
"$type": "color"
|
|
963
1033
|
},
|
|
964
1034
|
"primary": {
|
|
@@ -977,31 +1047,28 @@
|
|
|
977
1047
|
"$description": "See light-mode --link. In dark mode --primary is near-white (#FAFAFA), so the default link reads at ~19:1 on the dark background. Forks with a dark-mode brand primary that fails contrast (e.g. mid-saturation blurple) should override --link to a lifted variant."
|
|
978
1048
|
},
|
|
979
1049
|
"secondary": {
|
|
980
|
-
"$value": "
|
|
981
|
-
"$type": "color"
|
|
982
|
-
"$description": "Secondary surface — mid-deep navy (blue.800)."
|
|
1050
|
+
"$value": "oklch(0.2690 0 0)",
|
|
1051
|
+
"$type": "color"
|
|
983
1052
|
},
|
|
984
1053
|
"secondary-foreground": {
|
|
985
|
-
"$value": "
|
|
1054
|
+
"$value": "oklch(0.9850 0 0)",
|
|
986
1055
|
"$type": "color"
|
|
987
1056
|
},
|
|
988
1057
|
"muted": {
|
|
989
|
-
"$value": "
|
|
990
|
-
"$type": "color"
|
|
991
|
-
"$description": "Muted surface — mid-deep navy (blue.800), same family as secondary."
|
|
1058
|
+
"$value": "oklch(0.2690 0 0)",
|
|
1059
|
+
"$type": "color"
|
|
992
1060
|
},
|
|
993
1061
|
"muted-foreground": {
|
|
994
|
-
"$value": "
|
|
1062
|
+
"$value": "oklch(0.7800 0 0)",
|
|
995
1063
|
"$type": "color",
|
|
996
|
-
"$description": "Captions, labels, secondary text
|
|
1064
|
+
"$description": "Captions, labels, secondary text. ~9:1 on dark bg (AAA)."
|
|
997
1065
|
},
|
|
998
1066
|
"accent": {
|
|
999
|
-
"$value": "
|
|
1000
|
-
"$type": "color"
|
|
1001
|
-
"$description": "Accent surface — navy (blue.700)."
|
|
1067
|
+
"$value": "oklch(0.3710 0 0)",
|
|
1068
|
+
"$type": "color"
|
|
1002
1069
|
},
|
|
1003
1070
|
"accent-foreground": {
|
|
1004
|
-
"$value": "
|
|
1071
|
+
"$value": "oklch(0.9850 0 0)",
|
|
1005
1072
|
"$type": "color"
|
|
1006
1073
|
},
|
|
1007
1074
|
"destructive": {
|
|
@@ -1015,52 +1082,52 @@
|
|
|
1015
1082
|
"$description": "Dark text on light-red destructive surface for AAA 7:1 in dark mode."
|
|
1016
1083
|
},
|
|
1017
1084
|
"border": {
|
|
1018
|
-
"$value": "
|
|
1085
|
+
"$value": "oklch(0.5500 0 0)",
|
|
1019
1086
|
"$type": "color",
|
|
1020
|
-
"$description": "
|
|
1087
|
+
"$description": "AAA non-text: ≥3:1 on dark background AND card."
|
|
1021
1088
|
},
|
|
1022
1089
|
"input": {
|
|
1023
|
-
"$value": "
|
|
1090
|
+
"$value": "oklch(0.5500 0 0)",
|
|
1024
1091
|
"$type": "color",
|
|
1025
|
-
"$description": "
|
|
1092
|
+
"$description": "AAA non-text: ≥3:1 on dark card."
|
|
1026
1093
|
},
|
|
1027
1094
|
"ring": {
|
|
1028
|
-
"$value": "
|
|
1095
|
+
"$value": "oklch(0.7000 0 0)",
|
|
1029
1096
|
"$type": "color",
|
|
1030
|
-
"$description": "Focus ring base, dark mode
|
|
1097
|
+
"$description": "Focus ring base, dark mode. AAA non-text 3:1 on dark."
|
|
1031
1098
|
},
|
|
1032
1099
|
"chart-1": {
|
|
1033
|
-
"$value": "oklch(0.7800 0.
|
|
1100
|
+
"$value": "oklch(0.7800 0.1800 220)",
|
|
1034
1101
|
"$type": "color",
|
|
1035
|
-
"$description": "
|
|
1102
|
+
"$description": "Tuned for AAA 3:1 on dark card. Bright cyan-blue."
|
|
1036
1103
|
},
|
|
1037
1104
|
"chart-2": {
|
|
1038
|
-
"$value": "oklch(0.
|
|
1105
|
+
"$value": "oklch(0.8000 0.2000 145)",
|
|
1039
1106
|
"$type": "color",
|
|
1040
|
-
"$description": "
|
|
1107
|
+
"$description": "Tuned for AAA 3:1 on dark card. Bright spring green."
|
|
1041
1108
|
},
|
|
1042
1109
|
"chart-3": {
|
|
1043
|
-
"$value": "oklch(0.
|
|
1110
|
+
"$value": "oklch(0.8500 0.2000 75)",
|
|
1044
1111
|
"$type": "color",
|
|
1045
|
-
"$description": "
|
|
1112
|
+
"$description": "Tuned for AAA 3:1 on dark card. Bright orange-yellow."
|
|
1046
1113
|
},
|
|
1047
1114
|
"chart-4": {
|
|
1048
|
-
"$value": "oklch(0.
|
|
1115
|
+
"$value": "oklch(0.7600 0.2200 340)",
|
|
1049
1116
|
"$type": "color",
|
|
1050
|
-
"$description": "
|
|
1117
|
+
"$description": "Tuned for AAA 3:1 on dark card. Bright fuchsia."
|
|
1051
1118
|
},
|
|
1052
1119
|
"chart-5": {
|
|
1053
|
-
"$value": "oklch(0.
|
|
1120
|
+
"$value": "oklch(0.7800 0.1800 25)",
|
|
1054
1121
|
"$type": "color",
|
|
1055
|
-
"$description": "
|
|
1122
|
+
"$description": "Tuned for AAA 3:1 on dark card. Bright coral."
|
|
1056
1123
|
},
|
|
1057
1124
|
"sidebar": {
|
|
1058
|
-
"$value": "
|
|
1125
|
+
"$value": "oklch(0.1450 0 0)",
|
|
1059
1126
|
"$type": "color",
|
|
1060
|
-
"$description": "
|
|
1127
|
+
"$description": "Recedes to the page background (matches --background) so chrome sits behind the floating content card (L0.205) instead of level with it. Linear/Vercel calmer-interface pattern. Was L0.205 (== card), which made the sidebar advance."
|
|
1061
1128
|
},
|
|
1062
1129
|
"sidebar-foreground": {
|
|
1063
|
-
"$value": "
|
|
1130
|
+
"$value": "oklch(0.9850 0 0)",
|
|
1064
1131
|
"$type": "color"
|
|
1065
1132
|
},
|
|
1066
1133
|
"sidebar-primary": {
|
|
@@ -1069,27 +1136,26 @@
|
|
|
1069
1136
|
"$description": "Tuned for AAA 7:1 with white foreground."
|
|
1070
1137
|
},
|
|
1071
1138
|
"sidebar-primary-foreground": {
|
|
1072
|
-
"$value": "
|
|
1139
|
+
"$value": "oklch(0.9850 0 0)",
|
|
1073
1140
|
"$type": "color"
|
|
1074
1141
|
},
|
|
1075
1142
|
"sidebar-accent": {
|
|
1076
|
-
"$value": "
|
|
1077
|
-
"$type": "color"
|
|
1078
|
-
"$description": "Sidebar accent surface — navy (blue.700)."
|
|
1143
|
+
"$value": "oklch(0.2690 0 0)",
|
|
1144
|
+
"$type": "color"
|
|
1079
1145
|
},
|
|
1080
1146
|
"sidebar-accent-foreground": {
|
|
1081
|
-
"$value": "
|
|
1147
|
+
"$value": "oklch(0.9850 0 0)",
|
|
1082
1148
|
"$type": "color"
|
|
1083
1149
|
},
|
|
1084
1150
|
"sidebar-border": {
|
|
1085
|
-
"$value": "
|
|
1151
|
+
"$value": "oklch(0.5500 0 0)",
|
|
1086
1152
|
"$type": "color",
|
|
1087
|
-
"$description": "AAA non-text
|
|
1153
|
+
"$description": "AAA non-text 3:1 on dark sidebar."
|
|
1088
1154
|
},
|
|
1089
1155
|
"sidebar-ring": {
|
|
1090
|
-
"$value": "
|
|
1156
|
+
"$value": "oklch(0.7000 0 0)",
|
|
1091
1157
|
"$type": "color",
|
|
1092
|
-
"$description": "
|
|
1158
|
+
"$description": "AAA non-text 3:1 on dark sidebar."
|
|
1093
1159
|
}
|
|
1094
1160
|
}
|
|
1095
1161
|
},
|
|
@@ -1098,112 +1164,43 @@
|
|
|
1098
1164
|
"light": {
|
|
1099
1165
|
"$value": "0.58",
|
|
1100
1166
|
"$type": "number",
|
|
1101
|
-
"$description": "
|
|
1167
|
+
"$description": "Absolute L for chart series in light mode (oklch). Tuned so all five series sit at readable contrast on white card surfaces."
|
|
1102
1168
|
},
|
|
1103
1169
|
"dark": {
|
|
1104
1170
|
"$value": "0.78",
|
|
1105
1171
|
"$type": "number",
|
|
1106
|
-
"$description": "
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
"lightnessSteps": {
|
|
1110
|
-
"$description": "Per-series absolute L in oklch. When defined, overrides chart.lightness for monochromatic ramp palettes. Light mode starts at brand L and gets darker; dark mode starts at the lightest readable tint and gets darker within the AAA-readable range.",
|
|
1111
|
-
"light": {
|
|
1112
|
-
"step1": {
|
|
1113
|
-
"$value": "0.58",
|
|
1114
|
-
"$type": "number"
|
|
1115
|
-
},
|
|
1116
|
-
"step2": {
|
|
1117
|
-
"$value": "0.50",
|
|
1118
|
-
"$type": "number"
|
|
1119
|
-
},
|
|
1120
|
-
"step3": {
|
|
1121
|
-
"$value": "0.42",
|
|
1122
|
-
"$type": "number"
|
|
1123
|
-
},
|
|
1124
|
-
"step4": {
|
|
1125
|
-
"$value": "0.34",
|
|
1126
|
-
"$type": "number"
|
|
1127
|
-
},
|
|
1128
|
-
"step5": {
|
|
1129
|
-
"$value": "0.27",
|
|
1130
|
-
"$type": "number"
|
|
1131
|
-
}
|
|
1132
|
-
},
|
|
1133
|
-
"dark": {
|
|
1134
|
-
"step1": {
|
|
1135
|
-
"$value": "0.78",
|
|
1136
|
-
"$type": "number"
|
|
1137
|
-
},
|
|
1138
|
-
"step2": {
|
|
1139
|
-
"$value": "0.70",
|
|
1140
|
-
"$type": "number"
|
|
1141
|
-
},
|
|
1142
|
-
"step3": {
|
|
1143
|
-
"$value": "0.62",
|
|
1144
|
-
"$type": "number"
|
|
1145
|
-
},
|
|
1146
|
-
"step4": {
|
|
1147
|
-
"$value": "0.56",
|
|
1148
|
-
"$type": "number"
|
|
1149
|
-
},
|
|
1150
|
-
"step5": {
|
|
1151
|
-
"$value": "0.52",
|
|
1152
|
-
"$type": "number",
|
|
1153
|
-
"$description": "Floor — any lower fails AAA 3:1 on the dark card."
|
|
1154
|
-
}
|
|
1172
|
+
"$description": "Absolute L for chart series in dark mode. Lifted from light so charts stay legible on near-black backgrounds."
|
|
1155
1173
|
}
|
|
1156
1174
|
},
|
|
1157
1175
|
"hueRotation": {
|
|
1158
1176
|
"step1": {
|
|
1159
1177
|
"$value": "0",
|
|
1160
1178
|
"$type": "number",
|
|
1161
|
-
"$description": "
|
|
1162
|
-
},
|
|
1163
|
-
"step2": {
|
|
1164
|
-
"$value": "0",
|
|
1165
|
-
"$type": "number"
|
|
1166
|
-
},
|
|
1167
|
-
"step3": {
|
|
1168
|
-
"$value": "0",
|
|
1169
|
-
"$type": "number"
|
|
1170
|
-
},
|
|
1171
|
-
"step4": {
|
|
1172
|
-
"$value": "0",
|
|
1173
|
-
"$type": "number"
|
|
1174
|
-
},
|
|
1175
|
-
"step5": {
|
|
1176
|
-
"$value": "0",
|
|
1177
|
-
"$type": "number"
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
"chromaSteps": {
|
|
1181
|
-
"$description": "Per-series chroma multiplier on --primary's chroma. Tapers saturation as L drops so deep shades don't go neon and out-of-gamut.",
|
|
1182
|
-
"step1": {
|
|
1183
|
-
"$value": "1.00",
|
|
1184
|
-
"$type": "number"
|
|
1179
|
+
"$description": "Series 1 — hue inherited from --primary as-is."
|
|
1185
1180
|
},
|
|
1186
1181
|
"step2": {
|
|
1187
|
-
"$value": "
|
|
1188
|
-
"$type": "number"
|
|
1182
|
+
"$value": "35",
|
|
1183
|
+
"$type": "number",
|
|
1184
|
+
"$description": "Series 2 — primary hue + 35deg, chroma damped to 0.65× for pairing."
|
|
1189
1185
|
},
|
|
1190
1186
|
"step3": {
|
|
1191
|
-
"$value": "
|
|
1187
|
+
"$value": "70",
|
|
1192
1188
|
"$type": "number"
|
|
1193
1189
|
},
|
|
1194
1190
|
"step4": {
|
|
1195
|
-
"$value": "
|
|
1191
|
+
"$value": "105",
|
|
1196
1192
|
"$type": "number"
|
|
1197
1193
|
},
|
|
1198
1194
|
"step5": {
|
|
1199
|
-
"$value": "
|
|
1200
|
-
"$type": "number"
|
|
1195
|
+
"$value": "140",
|
|
1196
|
+
"$type": "number",
|
|
1197
|
+
"$description": "Series 5 — final hue rotation, max separation from primary."
|
|
1201
1198
|
}
|
|
1202
1199
|
},
|
|
1203
1200
|
"chroma2Damping": {
|
|
1204
1201
|
"$value": "0.65",
|
|
1205
1202
|
"$type": "number",
|
|
1206
|
-
"$description": "
|
|
1203
|
+
"$description": "Chroma multiplier on series 2 only (others inherit primary chroma)."
|
|
1207
1204
|
}
|
|
1208
1205
|
}
|
|
1209
1206
|
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { AdminMenu } from "./admin-menu";
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof AdminMenu> = {
|
|
5
|
-
title: "Components/AdminMenu",
|
|
6
|
-
component: AdminMenu,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "padded",
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const Default: Story = {};
|
|
17
|
-
|
|
18
|
-
export const WithLabel: Story = {
|
|
19
|
-
args: {
|
|
20
|
-
label: "Admin",
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const WithChildren: Story = {
|
|
25
|
-
render: () => (
|
|
26
|
-
<AdminMenu>
|
|
27
|
-
<div className="space-y-2">
|
|
28
|
-
<button className="w-full px-2 py-1.5 text-sm font-medium text-left rounded hover:bg-muted transition-colors">
|
|
29
|
-
View 1: Calm
|
|
30
|
-
</button>
|
|
31
|
-
<button className="w-full px-2 py-1.5 text-sm font-medium text-left rounded hover:bg-muted transition-colors">
|
|
32
|
-
View 2: Rich
|
|
33
|
-
</button>
|
|
34
|
-
<button className="w-full px-2 py-1.5 text-sm font-medium text-left rounded hover:bg-muted transition-colors">
|
|
35
|
-
View 3: Editorial
|
|
36
|
-
</button>
|
|
37
|
-
</div>
|
|
38
|
-
</AdminMenu>
|
|
39
|
-
),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const RealisticUse: Story = {
|
|
43
|
-
render: () => (
|
|
44
|
-
<div className="relative w-full h-96 border border-dashed border-muted-foreground/30 rounded-lg flex items-center justify-center bg-muted/20">
|
|
45
|
-
<div className="absolute bottom-4 right-4">
|
|
46
|
-
<AdminMenu>
|
|
47
|
-
<div className="space-y-2">
|
|
48
|
-
<div className="text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3 px-2">
|
|
49
|
-
Navigation Views
|
|
50
|
-
</div>
|
|
51
|
-
<button className="w-full px-2 py-1.5 text-sm rounded hover:bg-muted transition-colors text-left">
|
|
52
|
-
Calm View
|
|
53
|
-
</button>
|
|
54
|
-
<button className="w-full px-2 py-1.5 text-sm rounded hover:bg-muted transition-colors text-left">
|
|
55
|
-
Rich View
|
|
56
|
-
</button>
|
|
57
|
-
<button className="w-full px-2 py-1.5 text-sm rounded hover:bg-muted transition-colors text-left">
|
|
58
|
-
Editorial View
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
</AdminMenu>
|
|
62
|
-
</div>
|
|
63
|
-
<span className="text-sm text-muted-foreground">
|
|
64
|
-
AdminMenu positioned bottom-right with children
|
|
65
|
-
</span>
|
|
66
|
-
</div>
|
|
67
|
-
),
|
|
68
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Settings, X } from "lucide-react";
|
|
5
|
-
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
|
-
import {
|
|
7
|
-
Popover,
|
|
8
|
-
PopoverContent,
|
|
9
|
-
PopoverTrigger,
|
|
10
|
-
} from "@behavioral-agentic-design-system/core/components/ui/popover";
|
|
11
|
-
|
|
12
|
-
export type AdminMenuChildren = React.ReactNode;
|
|
13
|
-
|
|
14
|
-
export type AdminMenuProps = {
|
|
15
|
-
children?: AdminMenuChildren;
|
|
16
|
-
/**
|
|
17
|
-
* Optional text shown next to the gear icon. When omitted the trigger
|
|
18
|
-
* stays icon-only (44×44px). When provided the button widens to fit the
|
|
19
|
-
* label while preserving the AAA touch target.
|
|
20
|
-
*/
|
|
21
|
-
label?: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export function AdminMenu({ children, label }: AdminMenuProps) {
|
|
25
|
-
const [open, setOpen] = useState(false);
|
|
26
|
-
const hasLabel = Boolean(label);
|
|
27
|
-
|
|
28
|
-
// bg-card/95 + backdrop-blur-md mirrors the DevIdentityBadge treatment so
|
|
29
|
-
// the trigger stays legible on any background — flat surfaces, gradient
|
|
30
|
-
// hero blocks, photo backgrounds, anywhere a fork wants to drop it. Ghost
|
|
31
|
-
// variants disappear against busy backgrounds; the resting fill prevents
|
|
32
|
-
// that without changing the hover invert.
|
|
33
|
-
return (
|
|
34
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
35
|
-
<PopoverTrigger asChild>
|
|
36
|
-
<Button
|
|
37
|
-
variant="ghost"
|
|
38
|
-
size={hasLabel ? "sm" : "icon"}
|
|
39
|
-
className={
|
|
40
|
-
hasLabel
|
|
41
|
-
? "group h-8 gap-1.5 border border-border bg-card/95 backdrop-blur-md shadow-sm hover:!bg-foreground hover:!text-background hover:border-foreground"
|
|
42
|
-
: "group size-8 border border-border bg-card/95 backdrop-blur-md shadow-sm hover:!bg-foreground hover:!text-background hover:border-foreground"
|
|
43
|
-
}
|
|
44
|
-
aria-label={open ? "Close admin menu" : "Open admin menu"}
|
|
45
|
-
>
|
|
46
|
-
{open ? (
|
|
47
|
-
<X className="h-4 w-4 transition-all group-hover:scale-110" strokeWidth={1.5} />
|
|
48
|
-
) : (
|
|
49
|
-
<Settings className="h-4 w-4 transition-all group-hover:scale-110" strokeWidth={1.5} />
|
|
50
|
-
)}
|
|
51
|
-
{hasLabel && <span className="text-xs font-medium">{label}</span>}
|
|
52
|
-
</Button>
|
|
53
|
-
</PopoverTrigger>
|
|
54
|
-
<PopoverContent align="end" side="top" className="w-64 p-3">
|
|
55
|
-
{children}
|
|
56
|
-
</PopoverContent>
|
|
57
|
-
</Popover>
|
|
58
|
-
);
|
|
59
|
-
}
|