@fragments-sdk/ui 0.2.3 → 0.4.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 (133) hide show
  1. package/fragments.json +1 -1
  2. package/package.json +9 -4
  3. package/src/components/Accordion/Accordion.fragment.tsx +186 -0
  4. package/src/components/Accordion/Accordion.module.scss +111 -0
  5. package/src/components/Accordion/index.tsx +271 -0
  6. package/src/components/Alert/Alert.fragment.tsx +66 -41
  7. package/src/components/Alert/Alert.module.scss +31 -21
  8. package/src/components/Alert/index.tsx +202 -73
  9. package/src/components/AppShell/AppShell.fragment.tsx +315 -0
  10. package/src/components/AppShell/AppShell.module.scss +213 -0
  11. package/src/components/AppShell/index.tsx +398 -0
  12. package/src/components/Avatar/index.tsx +8 -9
  13. package/src/components/Badge/Badge.module.scss +16 -10
  14. package/src/components/Badge/index.tsx +20 -6
  15. package/src/components/Box/Box.fragment.tsx +168 -0
  16. package/src/components/Box/Box.module.scss +84 -0
  17. package/src/components/Box/index.tsx +78 -0
  18. package/src/components/Button/Button.module.scss +42 -0
  19. package/src/components/Button/index.tsx +67 -33
  20. package/src/components/ButtonGroup/ButtonGroup.module.scss +37 -0
  21. package/src/components/ButtonGroup/index.tsx +40 -0
  22. package/src/components/Card/Card.fragment.tsx +51 -25
  23. package/src/components/Card/Card.module.scss +52 -5
  24. package/src/components/Card/index.tsx +154 -53
  25. package/src/components/Checkbox/Checkbox.module.scss +4 -4
  26. package/src/components/Checkbox/index.tsx +3 -4
  27. package/src/components/CodeBlock/CodeBlock.fragment.tsx +201 -0
  28. package/src/components/CodeBlock/CodeBlock.module.scss +224 -0
  29. package/src/components/CodeBlock/index.tsx +385 -0
  30. package/src/components/ColorChip/ColorChip.module.scss +165 -0
  31. package/src/components/ColorChip/index.tsx +157 -0
  32. package/src/components/ColorPicker/ColorPicker.module.scss +109 -0
  33. package/src/components/ColorPicker/index.tsx +107 -0
  34. package/src/components/Dialog/Dialog.fragment.tsx +9 -0
  35. package/src/components/Dialog/Dialog.module.scss +26 -7
  36. package/src/components/Dialog/index.tsx +12 -15
  37. package/src/components/EmptyState/EmptyState.fragment.tsx +54 -71
  38. package/src/components/EmptyState/EmptyState.module.scss +9 -9
  39. package/src/components/EmptyState/index.tsx +104 -69
  40. package/src/components/Field/Field.fragment.tsx +165 -0
  41. package/src/components/Field/Field.module.scss +31 -0
  42. package/src/components/Field/index.tsx +143 -0
  43. package/src/components/Fieldset/Fieldset.fragment.tsx +166 -0
  44. package/src/components/Fieldset/Fieldset.module.scss +22 -0
  45. package/src/components/Fieldset/index.tsx +47 -0
  46. package/src/components/Form/Form.fragment.tsx +286 -0
  47. package/src/components/Form/Form.module.scss +8 -0
  48. package/src/components/Form/index.tsx +53 -0
  49. package/src/components/Grid/Grid.fragment.tsx +17 -17
  50. package/src/components/Grid/index.tsx +6 -1
  51. package/src/components/Header/Header.fragment.tsx +192 -0
  52. package/src/components/Header/Header.module.scss +209 -0
  53. package/src/components/Header/index.tsx +363 -0
  54. package/src/components/Icon/Icon.fragment.tsx +138 -0
  55. package/src/components/Icon/Icon.module.scss +38 -0
  56. package/src/components/Icon/index.tsx +58 -0
  57. package/src/components/Image/Image.fragment.tsx +195 -0
  58. package/src/components/Image/Image.module.scss +77 -0
  59. package/src/components/Image/index.tsx +95 -0
  60. package/src/components/Input/Input.module.scss +75 -2
  61. package/src/components/Input/index.tsx +60 -21
  62. package/src/components/Link/Link.fragment.tsx +132 -0
  63. package/src/components/Link/Link.module.scss +67 -0
  64. package/src/components/Link/index.tsx +57 -0
  65. package/src/components/List/List.fragment.tsx +152 -0
  66. package/src/components/List/List.module.scss +71 -0
  67. package/src/components/List/index.tsx +106 -0
  68. package/src/components/Listbox/Listbox.fragment.tsx +191 -0
  69. package/src/components/Listbox/Listbox.module.scss +97 -0
  70. package/src/components/Listbox/index.tsx +121 -0
  71. package/src/components/Menu/Menu.fragment.tsx +9 -0
  72. package/src/components/Menu/Menu.module.scss +17 -1
  73. package/src/components/Menu/index.tsx +3 -3
  74. package/src/components/Popover/Popover.fragment.tsx +9 -0
  75. package/src/components/Popover/Popover.module.scss +33 -10
  76. package/src/components/Popover/index.tsx +9 -11
  77. package/src/components/Progress/Progress.module.scss +11 -11
  78. package/src/components/Progress/index.tsx +34 -7
  79. package/src/components/Prompt/Prompt.fragment.tsx +231 -0
  80. package/src/components/Prompt/Prompt.module.scss +243 -0
  81. package/src/components/Prompt/index.tsx +439 -0
  82. package/src/components/RadioGroup/RadioGroup.module.scss +3 -3
  83. package/src/components/RadioGroup/index.tsx +3 -4
  84. package/src/components/Select/Select.fragment.tsx +9 -0
  85. package/src/components/Select/index.tsx +6 -7
  86. package/src/components/Separator/index.tsx +7 -3
  87. package/src/components/Sidebar/Sidebar.fragment.tsx +783 -0
  88. package/src/components/Sidebar/Sidebar.module.scss +586 -0
  89. package/src/components/Sidebar/index.tsx +1013 -0
  90. package/src/components/Skeleton/Skeleton.fragment.tsx +5 -5
  91. package/src/components/Skeleton/Skeleton.module.scss +11 -0
  92. package/src/components/Slider/Slider.module.scss +87 -0
  93. package/src/components/Slider/index.tsx +88 -0
  94. package/src/components/Stack/Stack.module.scss +120 -0
  95. package/src/components/Stack/index.tsx +148 -0
  96. package/src/components/Table/Table.fragment.tsx +7 -0
  97. package/src/components/Table/Table.module.scss +57 -0
  98. package/src/components/Table/index.tsx +44 -6
  99. package/src/components/Tabs/Tabs.fragment.tsx +9 -0
  100. package/src/components/Tabs/Tabs.module.scss +25 -10
  101. package/src/components/Tabs/index.tsx +11 -8
  102. package/src/components/Text/Text.module.scss +82 -0
  103. package/src/components/Text/index.tsx +58 -0
  104. package/src/components/Textarea/index.tsx +3 -7
  105. package/src/components/Theme/Theme.fragment.tsx +128 -0
  106. package/src/components/Theme/ThemeToggle.module.scss +82 -0
  107. package/src/components/Theme/index.tsx +343 -0
  108. package/src/components/Toast/Toast.fragment.tsx +5 -5
  109. package/src/components/Toast/Toast.module.scss +16 -1
  110. package/src/components/Toast/index.tsx +27 -11
  111. package/src/components/Toggle/Toggle.module.scss +25 -10
  112. package/src/components/Toggle/index.tsx +12 -0
  113. package/src/components/ToggleGroup/ToggleGroup.module.scss +134 -0
  114. package/src/components/ToggleGroup/index.tsx +144 -0
  115. package/src/components/Tooltip/Tooltip.module.scss +4 -4
  116. package/src/components/Tooltip/index.tsx +4 -2
  117. package/src/components/VisuallyHidden/VisuallyHidden.fragment.tsx +134 -0
  118. package/src/components/VisuallyHidden/VisuallyHidden.module.scss +13 -0
  119. package/src/components/VisuallyHidden/index.tsx +29 -0
  120. package/src/index.ts +241 -3
  121. package/src/recipes/AppShell.recipe.ts +175 -0
  122. package/src/recipes/CardGrid.recipe.ts +6 -2
  123. package/src/recipes/ChatInterface.recipe.ts +87 -0
  124. package/src/recipes/CodeExamples.recipe.ts +66 -0
  125. package/src/recipes/DashboardLayout.recipe.ts +46 -12
  126. package/src/recipes/DashboardNav.recipe.ts +183 -0
  127. package/src/recipes/LoginForm.recipe.ts +8 -1
  128. package/src/recipes/SettingsPage.recipe.ts +37 -20
  129. package/src/styles/globals.scss +31 -0
  130. package/src/tokens/_index.scss +3 -0
  131. package/src/tokens/_mixins.scss +54 -1
  132. package/src/tokens/_variables.scss +429 -64
  133. package/src/utils/a11y.tsx +439 -0
@@ -10,18 +10,36 @@
10
10
  // Or use CSS custom properties for runtime theming.
11
11
  // ============================================
12
12
 
13
+ // --------------------------------------------
14
+ // Base Configuration
15
+ // --------------------------------------------
16
+ // Base font size: 14px (change to 16px for larger UI)
17
+ // Base unit: 7px (change to 8px for standard 8pt grid)
18
+ // All spacing and sizing derives from these values.
19
+
20
+ $fui-base-font-size: 14px !default;
21
+ $fui-base-unit: 7px !default;
22
+
23
+ // Helper function to convert base units to rem
24
+ // Usage: fui-unit(2) = 2 * 7px = 14px = 1rem (when base is 14px)
25
+ @function fui-unit($multiplier) {
26
+ @return calc(#{$multiplier} * #{$fui-base-unit} / #{$fui-base-font-size} * 1rem);
27
+ }
28
+
13
29
  // --------------------------------------------
14
30
  // Typography
15
31
  // --------------------------------------------
16
32
  $fui-font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !default;
17
33
  $fui-font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace !default;
18
34
 
19
- $fui-font-size-2xs: 0.6875rem !default; // 11px
20
- $fui-font-size-xs: 0.75rem !default; // 12px
21
- $fui-font-size-sm: 0.875rem !default; // 14px
22
- $fui-font-size-base: 1rem !default; // 16px
23
- $fui-font-size-lg: 1.125rem !default; // 18px
24
- $fui-font-size-xl: 1.5rem !default; // 24px
35
+ // Font sizes (rem based on 14px root)
36
+ $fui-font-size-2xs: 0.714rem !default; // 10px
37
+ $fui-font-size-xs: 0.857rem !default; // 12px
38
+ $fui-font-size-sm: 1rem !default; // 14px (base)
39
+ $fui-font-size-base: 1.143rem !default; // 16px
40
+ $fui-font-size-lg: 1.286rem !default; // 18px
41
+ $fui-font-size-xl: 1.714rem !default; // 24px
42
+ $fui-font-size-2xl: 2.143rem !default; // 30px
25
43
 
26
44
  $fui-font-weight-normal: 400 !default;
27
45
  $fui-font-weight-medium: 500 !default;
@@ -31,24 +49,49 @@ $fui-line-height-tight: 1.25 !default;
31
49
  $fui-line-height-normal: 1.5 !default;
32
50
 
33
51
  // --------------------------------------------
34
- // Spacing (4px base unit)
52
+ // Spacing (7px base unit)
35
53
  // --------------------------------------------
36
- $fui-space-1: 0.25rem !default; // 4px
37
- $fui-space-2: 0.5rem !default; // 8px
38
- $fui-space-3: 0.75rem !default; // 12px
39
- $fui-space-4: 1rem !default; // 16px
40
- $fui-space-5: 1.25rem !default; // 20px
41
- $fui-space-6: 1.5rem !default; // 24px
42
- $fui-space-8: 2rem !default; // 32px
43
- $fui-space-10: 2.5rem !default; // 40px
44
- $fui-space-12: 3rem !default; // 48px
54
+ // Micro-spacing for small internal alignments (margins, thumb offsets)
55
+ $fui-space-px: 1px !default; // 1px (pixel-precise)
56
+ $fui-space-0-5: 0.143rem !default; // ~2px (micro alignment)
57
+ $fui-space-0-75: 0.214rem !default; // ~3px (micro alignment)
58
+
59
+ // 7px grid: 7, 14, 21, 28, 35, 42, 56, 70, 84
60
+ $fui-space-1: 0.5rem !default; // 7px (1 unit)
61
+ $fui-space-2: 1rem !default; // 14px (2 units)
62
+ $fui-space-3: 1.5rem !default; // 21px (3 units)
63
+ $fui-space-4: 2rem !default; // 28px (4 units)
64
+ $fui-space-5: 2.5rem !default; // 35px (5 units)
65
+ $fui-space-6: 3rem !default; // 42px (6 units)
66
+ $fui-space-8: 4rem !default; // 56px (8 units)
67
+ $fui-space-10: 5rem !default; // 70px (10 units)
68
+ $fui-space-12: 6rem !default; // 84px (12 units)
69
+
70
+ // --------------------------------------------
71
+ // Density Padding (7px base unit)
72
+ // --------------------------------------------
73
+ // Container padding: Cards, Dialogs, Popovers
74
+ $fui-padding-container-sm: 1.5rem !default; // 21px (3 units)
75
+ $fui-padding-container-md: 2rem !default; // 28px (4 units)
76
+ $fui-padding-container-lg: 3rem !default; // 42px (6 units)
77
+
78
+ // Inline padding: Alerts, Toasts
79
+ $fui-padding-inline-sm: 1rem !default; // 14px (2 units)
80
+ $fui-padding-inline-md: 1.5rem !default; // 21px (3 units)
81
+ $fui-padding-inline-lg: 2rem !default; // 28px (4 units)
82
+
83
+ // Item padding: Accordion, Tabs, Menu items
84
+ $fui-padding-item-sm: 1rem !default; // 14px (2 units)
85
+ $fui-padding-item-md: 1.5rem !default; // 21px (3 units)
86
+ $fui-padding-item-lg: 2rem !default; // 28px (4 units)
45
87
 
46
88
  // --------------------------------------------
47
89
  // Border Radius
48
90
  // --------------------------------------------
49
- $fui-radius-sm: 0.25rem !default; // 4px
50
- $fui-radius-md: 0.375rem !default; // 6px
51
- $fui-radius-lg: 0.5rem !default; // 8px
91
+ $fui-radius-sm: 0.25rem !default; // 3.5px
92
+ $fui-radius-md: 0.429rem !default; // 6px
93
+ $fui-radius-lg: 0.571rem !default; // 8px
94
+ $fui-radius-xl: 0.857rem !default; // 12px
52
95
  $fui-radius-full: 9999px !default;
53
96
 
54
97
  // --------------------------------------------
@@ -58,12 +101,14 @@ $fui-transition-fast: 150ms ease !default;
58
101
  $fui-transition-normal: 200ms ease !default;
59
102
 
60
103
  // --------------------------------------------
61
- // Colors - Light Mode
104
+ // Colors - Light Mode (Grayscale Default)
62
105
  // --------------------------------------------
63
- $fui-color-accent: #6366f1 !default;
64
- $fui-color-accent-hover: #4f46e5 !default;
65
- $fui-color-accent-active: #4338ca !default;
106
+ // Accent colors (dark on light background)
107
+ $fui-color-accent: #18181b !default;
108
+ $fui-color-accent-hover: #27272a !default;
109
+ $fui-color-accent-active: #3f3f46 !default;
66
110
 
111
+ // Semantic colors
67
112
  $fui-color-danger: #ef4444 !default;
68
113
  $fui-color-danger-hover: #dc2626 !default;
69
114
  $fui-color-success: #22c55e !default;
@@ -76,53 +121,74 @@ $fui-color-success-bg: rgba(34, 197, 94, 0.1) !default;
76
121
  $fui-color-warning-bg: rgba(245, 158, 11, 0.1) !default;
77
122
  $fui-color-info-bg: rgba(59, 130, 246, 0.1) !default;
78
123
 
79
- // Surface colors (light)
124
+ // Surface colors (light) - neutral grayscale
80
125
  $fui-bg-primary: #ffffff !default;
81
- $fui-bg-secondary: #f8fafc !default;
82
- $fui-bg-tertiary: #f1f5f9 !default;
126
+ $fui-bg-secondary: #f2f2f2 !default;
127
+ $fui-bg-tertiary: #f4f4f5 !default;
83
128
  $fui-bg-elevated: #ffffff !default;
129
+ $fui-bg-subtle: #fafafa !default;
84
130
  $fui-bg-hover: rgba(0, 0, 0, 0.04) !default;
85
131
  $fui-bg-active: rgba(0, 0, 0, 0.06) !default;
86
132
 
87
- // Text colors (light)
88
- $fui-text-primary: #0f172a !default;
89
- $fui-text-secondary: #64748b !default;
90
- $fui-text-tertiary: #94a3b8 !default;
91
- $fui-text-inverse: #ffffff !default;
133
+ // Text colors (light) - neutral grayscale
134
+ $fui-text-primary: #18181b !default;
135
+ $fui-text-secondary: #52525b !default;
136
+ $fui-text-tertiary: #71717a !default;
137
+ $fui-text-inverse: #f2f2f2 !default;
92
138
 
93
- // Border colors (light)
94
- $fui-border: #e2e8f0 !default;
95
- $fui-border-strong: #cbd5e1 !default;
139
+ // Border colors (light) - neutral grayscale
140
+ $fui-border: #e4e4e7 !default;
141
+ $fui-border-default: #e4e4e7 !default; // Alias for compatibility
142
+ $fui-border-strong: #d4d4d8 !default;
96
143
 
97
144
  // Shadows (light)
98
145
  $fui-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default;
99
146
  $fui-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !default;
147
+ $fui-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !default;
100
148
 
101
149
  // Focus ring
102
- $fui-focus-ring-color: $fui-color-accent !default;
150
+ $fui-focus-ring-color: #18181b !default;
103
151
  $fui-focus-ring-offset: 2px !default;
104
152
  $fui-focus-ring-width: 2px !default;
105
153
 
154
+ // Scrollbar (light mode)
155
+ $fui-scrollbar-width: 8px !default;
156
+ $fui-scrollbar-track: #f4f4f5 !default;
157
+ $fui-scrollbar-thumb: #d4d4d8 !default;
158
+ $fui-scrollbar-thumb-hover: #a1a1aa !default;
159
+
106
160
  // --------------------------------------------
107
- // Colors - Dark Mode
161
+ // Colors - Dark Mode (Inverted Grayscale)
108
162
  // --------------------------------------------
109
- $fui-dark-bg-primary: #0f172a !default;
110
- $fui-dark-bg-secondary: #1e293b !default;
111
- $fui-dark-bg-tertiary: #334155 !default;
112
- $fui-dark-bg-elevated: #1e293b !default;
163
+ // Accent colors (light on dark background)
164
+ $fui-dark-color-accent: #f2f2f2 !default;
165
+ $fui-dark-color-accent-hover: #f4f4f5 !default;
166
+ $fui-dark-color-accent-active: #e4e4e7 !default;
167
+
168
+ // Surface colors (dark) - neutral grayscale
169
+ $fui-dark-bg-primary: #09090b !default;
170
+ $fui-dark-bg-secondary: #18181b !default;
171
+ $fui-dark-bg-tertiary: #27272a !default;
172
+ $fui-dark-bg-elevated: #18181b !default;
173
+ $fui-dark-bg-subtle: #0f0f11 !default;
113
174
  $fui-dark-bg-hover: rgba(255, 255, 255, 0.06) !default;
114
175
  $fui-dark-bg-active: rgba(255, 255, 255, 0.08) !default;
115
176
 
116
- $fui-dark-text-primary: #f8fafc !default;
117
- $fui-dark-text-secondary: #94a3b8 !default;
118
- $fui-dark-text-tertiary: #64748b !default;
119
- $fui-dark-text-inverse: #0f172a !default;
177
+ // Text colors (dark) - neutral grayscale
178
+ $fui-dark-text-primary: #f2f2f2 !default;
179
+ $fui-dark-text-secondary: #a1a1aa !default;
180
+ $fui-dark-text-tertiary: #71717a !default;
181
+ $fui-dark-text-inverse: #18181b !default;
120
182
 
121
- $fui-dark-border: #334155 !default;
122
- $fui-dark-border-strong: #475569 !default;
183
+ // Border colors (dark) - neutral grayscale
184
+ $fui-dark-border: #27272a !default;
185
+ $fui-dark-border-default: #27272a !default; // Alias for compatibility
186
+ $fui-dark-border-strong: #3f3f46 !default;
123
187
 
188
+ // Shadows (dark)
124
189
  $fui-dark-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !default;
125
190
  $fui-dark-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3) !default;
191
+ $fui-dark-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4) !default;
126
192
 
127
193
  // Semantic backgrounds (dark) - increased opacity for visibility
128
194
  $fui-dark-color-danger-bg: rgba(239, 68, 68, 0.15) !default;
@@ -130,35 +196,158 @@ $fui-dark-color-success-bg: rgba(34, 197, 94, 0.15) !default;
130
196
  $fui-dark-color-warning-bg: rgba(245, 158, 11, 0.15) !default;
131
197
  $fui-dark-color-info-bg: rgba(59, 130, 246, 0.15) !default;
132
198
 
199
+ // Dark mode focus ring
200
+ $fui-dark-focus-ring-color: #f2f2f2 !default;
201
+
202
+ // Scrollbar (dark mode)
203
+ $fui-dark-scrollbar-track: #27272a !default;
204
+ $fui-dark-scrollbar-thumb: #52525b !default;
205
+ $fui-dark-scrollbar-thumb-hover: #71717a !default;
206
+
133
207
  // Overlay/backdrop
134
208
  $fui-backdrop: rgba(0, 0, 0, 0.5) !default;
135
- $fui-dark-backdrop: rgba(0, 0, 0, 0.7) !default;
209
+ $fui-dark-backdrop: rgba(0, 0, 0, 0.8) !default;
136
210
 
137
211
  // --------------------------------------------
138
212
  // Breakpoints
139
213
  // --------------------------------------------
140
- $fui-breakpoint-sm: 640px !default; // Large phones
141
- $fui-breakpoint-md: 768px !default; // Tablets
142
- $fui-breakpoint-lg: 1024px !default; // Small laptops
143
- $fui-breakpoint-xl: 1280px !default; // Desktops
214
+ $fui-breakpoint-sm: 640px !default;
215
+ $fui-breakpoint-md: 768px !default;
216
+ $fui-breakpoint-lg: 1024px !default;
217
+ $fui-breakpoint-xl: 1280px !default;
144
218
 
145
219
  // --------------------------------------------
146
220
  // Component-specific tokens
147
221
  // --------------------------------------------
148
222
 
149
- // Button
150
- $fui-button-height-sm: 2rem !default; // 32px
151
- $fui-button-height-md: 2.25rem !default; // 36px
152
- $fui-button-height-lg: 2.75rem !default; // 44px
223
+ // Button heights (based on 7px grid)
224
+ $fui-button-height-sm: 2.25rem !default; // 28px (4 units)
225
+ $fui-button-height-md: 2.571rem !default; // 36px (~5 units)
226
+ $fui-button-height-lg: 3.143rem !default; // 44px (~6 units)
153
227
 
154
- // Input
155
- $fui-input-height: 2.5rem !default; // 40px
228
+ // Input height
229
+ $fui-input-height: 2.857rem !default; // 40px (~6 units)
156
230
 
157
231
  // Toggle/Switch
158
- $fui-toggle-width-sm: 2rem !default; // 32px
159
- $fui-toggle-width-md: 2.5rem !default; // 40px
160
- $fui-toggle-height-sm: 1.125rem !default; // 18px
161
- $fui-toggle-height-md: 1.375rem !default; // 22px
232
+ $fui-toggle-width-sm: 2.286rem !default; // 32px
233
+ $fui-toggle-width-md: 2.857rem !default; // 40px
234
+ $fui-toggle-height-sm: 1.286rem !default; // 18px
235
+ $fui-toggle-height-md: 1.571rem !default; // 22px
236
+ $fui-toggle-thumb-sm: 1rem !default; // 14px
237
+ $fui-toggle-thumb-md: 1.286rem !default; // 18px
238
+ $fui-toggle-thumb-offset: 2px !default; // Thumb inset from track edge
239
+
240
+ // Badge
241
+ $fui-badge-dot-sm: 5px !default;
242
+ $fui-badge-dot-md: 6px !default;
243
+
244
+ // Icon sizes (standard conventions)
245
+ $fui-icon-sm: 1rem !default; // 14px (2 units)
246
+ $fui-icon-md: 1.143rem !default; // 16px (standard small icon)
247
+ $fui-icon-lg: 1.429rem !default; // 20px (standard medium icon)
248
+ $fui-icon-xl: 1.714rem !default; // 24px (standard large icon)
249
+
250
+ // Interactive element sizes (touch targets)
251
+ $fui-touch-sm: 1.714rem !default; // 24px (minimum touch target)
252
+ $fui-touch-md: 2.286rem !default; // 32px (comfortable touch target)
253
+ $fui-touch-lg: 3.143rem !default; // 44px (large touch target, WCAG)
254
+
255
+ // Animation offsets
256
+ $fui-anim-offset-sm: 4px !default; // Small slide animation
257
+ $fui-anim-offset-md: 8px !default; // Medium slide animation
258
+
259
+ // Popover/Tooltip arrow
260
+ $fui-arrow-size: 10px !default;
261
+
262
+ // Sidebar-specific
263
+ $fui-sidebar-item-height: 2.5rem !default; // 35px (5 units)
264
+ $fui-sidebar-subitem-height: 2.571rem !default; // 36px
265
+ $fui-sidebar-indicator-width: 2px !default;
266
+ $fui-sidebar-indicator-height: 1.143rem !default; // 16px
267
+ $fui-sidebar-rail-width: 1.143rem !default; // 16px
268
+ $fui-sidebar-rail-indicator-width: 4px !default;
269
+ $fui-sidebar-rail-indicator-height: 2.857rem !default; // 40px
270
+ $fui-sidebar-rail-indicator-height-hover: 4rem !default; // 56px
271
+
272
+ // Slider
273
+ $fui-slider-track-height: 4px !default;
274
+ $fui-slider-thumb-size: $fui-icon-md !default; // 16px
275
+ $fui-slider-thumb-border: 2px !default;
276
+
277
+ // EmptyState content max-widths
278
+ $fui-emptystate-width-sm: 240px !default;
279
+ $fui-emptystate-width-md: 320px !default;
280
+ $fui-emptystate-width-lg: 400px !default;
281
+
282
+ // EmptyState icon sizes
283
+ $fui-emptystate-icon-sm: $fui-icon-xl !default; // 24px
284
+ $fui-emptystate-icon-md: 2.286rem !default; // 32px
285
+ $fui-emptystate-icon-lg: 2.857rem !default; // 40px
286
+
287
+ // ColorChip/ColorPicker
288
+ $fui-colorpicker-size: 180px !default;
289
+ $fui-colorpicker-hue-height: 10px !default;
290
+ $fui-colorpicker-pointer-size: 1rem !default; // 14px
291
+ $fui-colorpicker-pointer-border: 2px !default;
292
+
293
+ // AppShell Layout
294
+ $fui-appshell-header-height: 56px !default;
295
+ $fui-appshell-sidebar-width: 240px !default;
296
+ $fui-appshell-sidebar-collapsed-width: 64px !default;
297
+ $fui-appshell-aside-width: 280px !default;
298
+ $fui-header-z-index: 40 !default;
299
+
300
+ // CodeBlock (light mode)
301
+ $fui-code-bg: #1e1e1e !default;
302
+ $fui-code-header-bg: #252526 !default;
303
+ $fui-code-text: #d4d4d4 !default;
304
+ $fui-code-text-muted: #6b7280 !default;
305
+ $fui-code-border: rgba(255, 255, 255, 0.1) !default;
306
+ $fui-code-tab-bg: rgba(255, 255, 255, 0.03) !default;
307
+ $fui-code-tab-border: rgba(255, 255, 255, 0.08) !default;
308
+ $fui-code-tab-text: #9ca3af !default;
309
+ $fui-code-tab-text-active: #e5e7eb !default;
310
+ $fui-code-copy-bg: rgba(255, 255, 255, 0.1) !default;
311
+ $fui-code-copy-bg-hover: rgba(255, 255, 255, 0.15) !default;
312
+ $fui-code-highlight-bg: rgba(255, 255, 255, 0.08) !default;
313
+ $fui-code-selection-bg: rgba(59, 130, 246, 0.4) !default;
314
+ $fui-code-scrollbar-track: rgba(255, 255, 255, 0.05) !default;
315
+ $fui-code-scrollbar-thumb: rgba(255, 255, 255, 0.15) !default;
316
+ $fui-code-scrollbar-thumb-hover: rgba(255, 255, 255, 0.25) !default;
317
+
318
+ // Tooltip (always dark bg with light text)
319
+ $fui-tooltip-bg: #1e293b !default;
320
+ $fui-tooltip-text: #f8fafc !default;
321
+ $fui-tooltip-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15) !default;
322
+
323
+ // Hero/Marketing gradient accent
324
+ $fui-hero-gradient-color: rgba(120, 119, 198, 0.15) !default;
325
+
326
+ // CodeBlock (dark mode) - same as light, code blocks stay dark
327
+ $fui-dark-code-bg: #1e1e1e !default;
328
+ $fui-dark-code-header-bg: #252526 !default;
329
+ $fui-dark-code-text: #d4d4d4 !default;
330
+ $fui-dark-code-text-muted: #6b7280 !default;
331
+ $fui-dark-code-border: rgba(255, 255, 255, 0.1) !default;
332
+ $fui-dark-code-tab-bg: rgba(255, 255, 255, 0.03) !default;
333
+ $fui-dark-code-tab-border: rgba(255, 255, 255, 0.08) !default;
334
+ $fui-dark-code-tab-text: #9ca3af !default;
335
+ $fui-dark-code-tab-text-active: #e5e7eb !default;
336
+ $fui-dark-code-copy-bg: rgba(255, 255, 255, 0.1) !default;
337
+ $fui-dark-code-copy-bg-hover: rgba(255, 255, 255, 0.15) !default;
338
+ $fui-dark-code-highlight-bg: rgba(255, 255, 255, 0.08) !default;
339
+ $fui-dark-code-selection-bg: rgba(59, 130, 246, 0.4) !default;
340
+ $fui-dark-code-scrollbar-track: rgba(255, 255, 255, 0.05) !default;
341
+ $fui-dark-code-scrollbar-thumb: rgba(255, 255, 255, 0.15) !default;
342
+ $fui-dark-code-scrollbar-thumb-hover: rgba(255, 255, 255, 0.25) !default;
343
+
344
+ // Tooltip (dark mode) - same as light, tooltips stay dark
345
+ $fui-dark-tooltip-bg: #1e293b !default;
346
+ $fui-dark-tooltip-text: #f8fafc !default;
347
+ $fui-dark-tooltip-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.25) !default;
348
+
349
+ // Hero/Marketing gradient accent (dark mode)
350
+ $fui-dark-hero-gradient-color: rgba(120, 119, 198, 0.25) !default;
162
351
 
163
352
  // --------------------------------------------
164
353
  // CSS Custom Properties Export
@@ -168,6 +357,10 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
168
357
 
169
358
  @mixin fui-css-variables {
170
359
  :root {
360
+ // Base configuration
361
+ font-size: #{$fui-base-font-size};
362
+ --fui-base-unit: #{$fui-base-unit};
363
+
171
364
  // Typography
172
365
  --fui-font-sans: #{$fui-font-sans};
173
366
  --fui-font-mono: #{$fui-font-mono};
@@ -177,12 +370,18 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
177
370
  --fui-font-size-base: #{$fui-font-size-base};
178
371
  --fui-font-size-lg: #{$fui-font-size-lg};
179
372
  --fui-font-size-xl: #{$fui-font-size-xl};
373
+ --fui-font-size-2xl: #{$fui-font-size-2xl};
180
374
  --fui-font-weight-normal: #{$fui-font-weight-normal};
181
375
  --fui-font-weight-medium: #{$fui-font-weight-medium};
182
376
  --fui-font-weight-semibold: #{$fui-font-weight-semibold};
183
377
  --fui-line-height-tight: #{$fui-line-height-tight};
184
378
  --fui-line-height-normal: #{$fui-line-height-normal};
185
379
 
380
+ // Spacing (micro)
381
+ --fui-space-px: #{$fui-space-px};
382
+ --fui-space-0-5: #{$fui-space-0-5};
383
+ --fui-space-0-75: #{$fui-space-0-75};
384
+
186
385
  // Spacing
187
386
  --fui-space-1: #{$fui-space-1};
188
387
  --fui-space-2: #{$fui-space-2};
@@ -194,10 +393,22 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
194
393
  --fui-space-10: #{$fui-space-10};
195
394
  --fui-space-12: #{$fui-space-12};
196
395
 
396
+ // Density padding
397
+ --fui-padding-container-sm: #{$fui-padding-container-sm};
398
+ --fui-padding-container-md: #{$fui-padding-container-md};
399
+ --fui-padding-container-lg: #{$fui-padding-container-lg};
400
+ --fui-padding-inline-sm: #{$fui-padding-inline-sm};
401
+ --fui-padding-inline-md: #{$fui-padding-inline-md};
402
+ --fui-padding-inline-lg: #{$fui-padding-inline-lg};
403
+ --fui-padding-item-sm: #{$fui-padding-item-sm};
404
+ --fui-padding-item-md: #{$fui-padding-item-md};
405
+ --fui-padding-item-lg: #{$fui-padding-item-lg};
406
+
197
407
  // Border radius
198
408
  --fui-radius-sm: #{$fui-radius-sm};
199
409
  --fui-radius-md: #{$fui-radius-md};
200
410
  --fui-radius-lg: #{$fui-radius-lg};
411
+ --fui-radius-xl: #{$fui-radius-xl};
201
412
  --fui-radius-full: #{$fui-radius-full};
202
413
 
203
414
  // Transitions
@@ -224,6 +435,7 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
224
435
  --fui-bg-secondary: #{$fui-bg-secondary};
225
436
  --fui-bg-tertiary: #{$fui-bg-tertiary};
226
437
  --fui-bg-elevated: #{$fui-bg-elevated};
438
+ --fui-bg-subtle: #{$fui-bg-subtle};
227
439
  --fui-bg-hover: #{$fui-bg-hover};
228
440
  --fui-bg-active: #{$fui-bg-active};
229
441
 
@@ -235,16 +447,57 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
235
447
 
236
448
  // Borders
237
449
  --fui-border: #{$fui-border};
450
+ --fui-border-default: #{$fui-border-default};
238
451
  --fui-border-strong: #{$fui-border-strong};
239
452
 
240
453
  // Shadows
241
454
  --fui-shadow-sm: #{$fui-shadow-sm};
242
455
  --fui-shadow-md: #{$fui-shadow-md};
456
+ --fui-shadow-lg: #{$fui-shadow-lg};
243
457
 
244
458
  // Focus
245
459
  --fui-focus-ring-color: #{$fui-focus-ring-color};
246
460
  --fui-focus-ring-offset: #{$fui-focus-ring-offset};
247
461
  --fui-focus-ring-width: #{$fui-focus-ring-width};
462
+
463
+ // Scrollbar
464
+ --fui-scrollbar-width: #{$fui-scrollbar-width};
465
+ --fui-scrollbar-track: #{$fui-scrollbar-track};
466
+ --fui-scrollbar-thumb: #{$fui-scrollbar-thumb};
467
+ --fui-scrollbar-thumb-hover: #{$fui-scrollbar-thumb-hover};
468
+
469
+ // AppShell Layout
470
+ --fui-appshell-header-height: #{$fui-appshell-header-height};
471
+ --fui-appshell-sidebar-width: #{$fui-appshell-sidebar-width};
472
+ --fui-appshell-sidebar-collapsed-width: #{$fui-appshell-sidebar-collapsed-width};
473
+ --fui-appshell-aside-width: #{$fui-appshell-aside-width};
474
+ --fui-header-z-index: #{$fui-header-z-index};
475
+
476
+ // CodeBlock
477
+ --fui-code-bg: #{$fui-code-bg};
478
+ --fui-code-header-bg: #{$fui-code-header-bg};
479
+ --fui-code-text: #{$fui-code-text};
480
+ --fui-code-text-muted: #{$fui-code-text-muted};
481
+ --fui-code-border: #{$fui-code-border};
482
+ --fui-code-tab-bg: #{$fui-code-tab-bg};
483
+ --fui-code-tab-border: #{$fui-code-tab-border};
484
+ --fui-code-tab-text: #{$fui-code-tab-text};
485
+ --fui-code-tab-text-active: #{$fui-code-tab-text-active};
486
+ --fui-code-copy-bg: #{$fui-code-copy-bg};
487
+ --fui-code-copy-bg-hover: #{$fui-code-copy-bg-hover};
488
+ --fui-code-highlight-bg: #{$fui-code-highlight-bg};
489
+ --fui-code-selection-bg: #{$fui-code-selection-bg};
490
+ --fui-code-scrollbar-track: #{$fui-code-scrollbar-track};
491
+ --fui-code-scrollbar-thumb: #{$fui-code-scrollbar-thumb};
492
+ --fui-code-scrollbar-thumb-hover: #{$fui-code-scrollbar-thumb-hover};
493
+
494
+ // Tooltip
495
+ --fui-tooltip-bg: #{$fui-tooltip-bg};
496
+ --fui-tooltip-text: #{$fui-tooltip-text};
497
+ --fui-tooltip-shadow: #{$fui-tooltip-shadow};
498
+
499
+ // Hero/Marketing gradient
500
+ --fui-hero-gradient-color: #{$fui-hero-gradient-color};
248
501
  }
249
502
 
250
503
  // Dark mode via data-theme attribute (manual toggle)
@@ -252,33 +505,145 @@ $fui-toggle-height-md: 1.375rem !default; // 22px
252
505
  @include _fui-dark-tokens;
253
506
  }
254
507
 
255
- // Dark mode via .dark class on html (used by viewer and many frameworks)
256
- // This is the primary method - applications handle system preference detection
257
- // and apply .dark class accordingly
508
+ // Dark mode via .dark class on html
258
509
  :root.dark {
259
510
  @include _fui-dark-tokens;
260
511
  }
512
+
513
+ // High contrast mode via system preference
514
+ @media (prefers-contrast: more) {
515
+ :root {
516
+ @include _fui-high-contrast-tokens;
517
+ }
518
+
519
+ :root[data-theme="dark"],
520
+ :root.dark {
521
+ --fui-bg-hover: rgba(255, 255, 255, 0.15);
522
+ --fui-bg-active: rgba(255, 255, 255, 0.22);
523
+ }
524
+ }
525
+
526
+ // High contrast mode via data attribute (manual toggle)
527
+ :root[data-high-contrast="true"] {
528
+ @include _fui-high-contrast-tokens;
529
+ }
530
+
531
+ // Global scrollbar styling
532
+ * {
533
+ // Firefox
534
+ scrollbar-width: thin;
535
+ scrollbar-color: var(--fui-scrollbar-thumb) var(--fui-scrollbar-track);
536
+ }
537
+
538
+ // Webkit browsers (Chrome, Safari, Edge)
539
+ *::-webkit-scrollbar {
540
+ width: var(--fui-scrollbar-width);
541
+ height: var(--fui-scrollbar-width);
542
+ }
543
+
544
+ *::-webkit-scrollbar-track {
545
+ background: var(--fui-scrollbar-track);
546
+ border-radius: calc(var(--fui-scrollbar-width) / 2);
547
+ }
548
+
549
+ *::-webkit-scrollbar-thumb {
550
+ background: var(--fui-scrollbar-thumb);
551
+ border-radius: calc(var(--fui-scrollbar-width) / 2);
552
+
553
+ &:hover {
554
+ background: var(--fui-scrollbar-thumb-hover);
555
+ }
556
+ }
557
+
558
+ *::-webkit-scrollbar-corner {
559
+ background: var(--fui-scrollbar-track);
560
+ }
561
+ }
562
+
563
+ // High contrast mode support
564
+ @mixin _fui-high-contrast-tokens {
565
+ // Increase focus ring visibility
566
+ --fui-focus-ring-width: 3px;
567
+
568
+ // Stronger borders for better visibility
569
+ --fui-border: var(--fui-text-primary);
570
+ --fui-border-strong: var(--fui-text-primary);
571
+
572
+ // Ensure minimum contrast on interactive elements
573
+ --fui-bg-hover: rgba(0, 0, 0, 0.12);
574
+ --fui-bg-active: rgba(0, 0, 0, 0.18);
261
575
  }
262
576
 
263
577
  // Private mixin for dark mode token values
264
578
  @mixin _fui-dark-tokens {
579
+ // Accent colors invert for dark mode (light on dark)
580
+ --fui-color-accent: #{$fui-dark-color-accent};
581
+ --fui-color-accent-hover: #{$fui-dark-color-accent-hover};
582
+ --fui-color-accent-active: #{$fui-dark-color-accent-active};
583
+
584
+ // Surfaces
265
585
  --fui-bg-primary: #{$fui-dark-bg-primary};
266
586
  --fui-bg-secondary: #{$fui-dark-bg-secondary};
267
587
  --fui-bg-tertiary: #{$fui-dark-bg-tertiary};
268
588
  --fui-bg-elevated: #{$fui-dark-bg-elevated};
589
+ --fui-bg-subtle: #{$fui-dark-bg-subtle};
269
590
  --fui-bg-hover: #{$fui-dark-bg-hover};
270
591
  --fui-bg-active: #{$fui-dark-bg-active};
592
+
593
+ // Text
271
594
  --fui-text-primary: #{$fui-dark-text-primary};
272
595
  --fui-text-secondary: #{$fui-dark-text-secondary};
273
596
  --fui-text-tertiary: #{$fui-dark-text-tertiary};
274
597
  --fui-text-inverse: #{$fui-dark-text-inverse};
598
+
599
+ // Borders
275
600
  --fui-border: #{$fui-dark-border};
601
+ --fui-border-default: #{$fui-dark-border-default};
276
602
  --fui-border-strong: #{$fui-dark-border-strong};
603
+
604
+ // Shadows
277
605
  --fui-shadow-sm: #{$fui-dark-shadow-sm};
278
606
  --fui-shadow-md: #{$fui-dark-shadow-md};
607
+ --fui-shadow-lg: #{$fui-dark-shadow-lg};
608
+
609
+ // Semantic backgrounds
279
610
  --fui-color-danger-bg: #{$fui-dark-color-danger-bg};
280
611
  --fui-color-success-bg: #{$fui-dark-color-success-bg};
281
612
  --fui-color-warning-bg: #{$fui-dark-color-warning-bg};
282
613
  --fui-color-info-bg: #{$fui-dark-color-info-bg};
614
+
615
+ // Focus & backdrop
616
+ --fui-focus-ring-color: #{$fui-dark-focus-ring-color};
283
617
  --fui-backdrop: #{$fui-dark-backdrop};
618
+
619
+ // Scrollbar
620
+ --fui-scrollbar-track: #{$fui-dark-scrollbar-track};
621
+ --fui-scrollbar-thumb: #{$fui-dark-scrollbar-thumb};
622
+ --fui-scrollbar-thumb-hover: #{$fui-dark-scrollbar-thumb-hover};
623
+
624
+ // CodeBlock
625
+ --fui-code-bg: #{$fui-dark-code-bg};
626
+ --fui-code-header-bg: #{$fui-dark-code-header-bg};
627
+ --fui-code-text: #{$fui-dark-code-text};
628
+ --fui-code-text-muted: #{$fui-dark-code-text-muted};
629
+ --fui-code-border: #{$fui-dark-code-border};
630
+ --fui-code-tab-bg: #{$fui-dark-code-tab-bg};
631
+ --fui-code-tab-border: #{$fui-dark-code-tab-border};
632
+ --fui-code-tab-text: #{$fui-dark-code-tab-text};
633
+ --fui-code-tab-text-active: #{$fui-dark-code-tab-text-active};
634
+ --fui-code-copy-bg: #{$fui-dark-code-copy-bg};
635
+ --fui-code-copy-bg-hover: #{$fui-dark-code-copy-bg-hover};
636
+ --fui-code-highlight-bg: #{$fui-dark-code-highlight-bg};
637
+ --fui-code-selection-bg: #{$fui-dark-code-selection-bg};
638
+ --fui-code-scrollbar-track: #{$fui-dark-code-scrollbar-track};
639
+ --fui-code-scrollbar-thumb: #{$fui-dark-code-scrollbar-thumb};
640
+ --fui-code-scrollbar-thumb-hover: #{$fui-dark-code-scrollbar-thumb-hover};
641
+
642
+ // Tooltip
643
+ --fui-tooltip-bg: #{$fui-dark-tooltip-bg};
644
+ --fui-tooltip-text: #{$fui-dark-tooltip-text};
645
+ --fui-tooltip-shadow: #{$fui-dark-tooltip-shadow};
646
+
647
+ // Hero/Marketing gradient
648
+ --fui-hero-gradient-color: #{$fui-dark-hero-gradient-color};
284
649
  }