@fragments-sdk/ui 0.3.0 → 0.5.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/README.md +98 -2
- package/fragments.json +1 -1
- package/package.json +11 -5
- package/src/components/Accordion/Accordion.fragment.tsx +186 -0
- package/src/components/Accordion/Accordion.module.scss +111 -0
- package/src/components/Accordion/index.tsx +271 -0
- package/src/components/Alert/Alert.fragment.tsx +67 -42
- package/src/components/Alert/Alert.module.scss +31 -21
- package/src/components/Alert/index.tsx +202 -73
- package/src/components/AppShell/AppShell.fragment.tsx +315 -0
- package/src/components/AppShell/AppShell.module.scss +213 -0
- package/src/components/AppShell/index.tsx +398 -0
- package/src/components/Avatar/Avatar.fragment.tsx +2 -2
- package/src/components/Avatar/index.tsx +8 -9
- package/src/components/Badge/Badge.fragment.tsx +2 -2
- package/src/components/Badge/Badge.module.scss +16 -10
- package/src/components/Badge/index.tsx +20 -6
- package/src/components/Box/Box.fragment.tsx +168 -0
- package/src/components/Box/Box.module.scss +84 -0
- package/src/components/Box/index.tsx +78 -0
- package/src/components/Button/Button.fragment.tsx +2 -2
- package/src/components/Button/Button.module.scss +42 -0
- package/src/components/Button/index.tsx +67 -33
- package/src/components/ButtonGroup/ButtonGroup.fragment.tsx +153 -0
- package/src/components/ButtonGroup/ButtonGroup.module.scss +37 -0
- package/src/components/ButtonGroup/index.tsx +40 -0
- package/src/components/Card/Card.fragment.tsx +52 -26
- package/src/components/Card/Card.module.scss +52 -5
- package/src/components/Card/index.tsx +154 -53
- package/src/components/Chart/Chart.fragment.tsx +213 -0
- package/src/components/Chart/Chart.module.scss +123 -0
- package/src/components/Chart/index.tsx +267 -0
- package/src/components/Checkbox/Checkbox.fragment.tsx +1 -1
- package/src/components/Checkbox/Checkbox.module.scss +4 -4
- package/src/components/Checkbox/index.tsx +3 -4
- package/src/components/CodeBlock/CodeBlock.fragment.tsx +460 -0
- package/src/components/CodeBlock/CodeBlock.module.scss +362 -0
- package/src/components/CodeBlock/index.tsx +599 -0
- package/src/components/Collapsible/Collapsible.fragment.tsx +199 -0
- package/src/components/Collapsible/Collapsible.module.scss +117 -0
- package/src/components/Collapsible/index.tsx +219 -0
- package/src/components/ColorPicker/ColorPicker.fragment.tsx +196 -0
- package/src/components/ColorPicker/ColorPicker.module.scss +119 -0
- package/src/components/ColorPicker/index.tsx +129 -0
- package/src/components/ConversationList/ConversationList.fragment.tsx +202 -0
- package/src/components/ConversationList/ConversationList.module.scss +160 -0
- package/src/components/ConversationList/index.tsx +254 -0
- package/src/components/Dialog/Dialog.fragment.tsx +12 -3
- package/src/components/Dialog/Dialog.module.scss +26 -7
- package/src/components/Dialog/index.tsx +12 -15
- package/src/components/EmptyState/EmptyState.fragment.tsx +55 -72
- package/src/components/EmptyState/EmptyState.module.scss +9 -9
- package/src/components/EmptyState/index.tsx +104 -69
- package/src/components/Field/Field.fragment.tsx +165 -0
- package/src/components/Field/Field.module.scss +31 -0
- package/src/components/Field/index.tsx +143 -0
- package/src/components/Fieldset/Fieldset.fragment.tsx +166 -0
- package/src/components/Fieldset/Fieldset.module.scss +22 -0
- package/src/components/Fieldset/index.tsx +47 -0
- package/src/components/Form/Form.fragment.tsx +286 -0
- package/src/components/Form/Form.module.scss +8 -0
- package/src/components/Form/index.tsx +53 -0
- package/src/components/Grid/Grid.fragment.tsx +18 -18
- package/src/components/Grid/index.tsx +6 -1
- package/src/components/Header/Header.fragment.tsx +192 -0
- package/src/components/Header/Header.module.scss +208 -0
- package/src/components/Header/index.tsx +363 -0
- package/src/components/Icon/Icon.fragment.tsx +138 -0
- package/src/components/Icon/Icon.module.scss +38 -0
- package/src/components/Icon/index.tsx +58 -0
- package/src/components/Image/Image.fragment.tsx +195 -0
- package/src/components/Image/Image.module.scss +77 -0
- package/src/components/Image/index.tsx +95 -0
- package/src/components/Input/Input.fragment.tsx +1 -1
- package/src/components/Input/Input.module.scss +75 -2
- package/src/components/Input/index.tsx +60 -21
- package/src/components/Link/Link.fragment.tsx +132 -0
- package/src/components/Link/Link.module.scss +67 -0
- package/src/components/Link/index.tsx +57 -0
- package/src/components/List/List.fragment.tsx +152 -0
- package/src/components/List/List.module.scss +71 -0
- package/src/components/List/index.tsx +106 -0
- package/src/components/Listbox/Listbox.fragment.tsx +191 -0
- package/src/components/Listbox/Listbox.module.scss +97 -0
- package/src/components/Listbox/index.tsx +121 -0
- package/src/components/Loading/Loading.fragment.tsx +153 -0
- package/src/components/Loading/Loading.module.scss +256 -0
- package/src/components/Loading/index.tsx +236 -0
- package/src/components/Menu/Menu.fragment.tsx +12 -3
- package/src/components/Menu/Menu.module.scss +17 -1
- package/src/components/Menu/index.tsx +3 -3
- package/src/components/Message/Message.fragment.tsx +200 -0
- package/src/components/Message/Message.module.scss +224 -0
- package/src/components/Message/index.tsx +278 -0
- package/src/components/Popover/Popover.fragment.tsx +13 -4
- package/src/components/Popover/Popover.module.scss +33 -10
- package/src/components/Popover/index.tsx +9 -11
- package/src/components/Progress/Progress.fragment.tsx +1 -1
- package/src/components/Progress/Progress.module.scss +11 -11
- package/src/components/Progress/index.tsx +34 -7
- package/src/components/Prompt/Prompt.fragment.tsx +231 -0
- package/src/components/Prompt/Prompt.module.scss +243 -0
- package/src/components/Prompt/index.tsx +439 -0
- package/src/components/RadioGroup/RadioGroup.fragment.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.module.scss +10 -7
- package/src/components/RadioGroup/index.tsx +3 -4
- package/src/components/Select/Select.fragment.tsx +10 -1
- package/src/components/Select/Select.module.scss +8 -0
- package/src/components/Select/index.tsx +91 -12
- package/src/components/Separator/Separator.fragment.tsx +1 -1
- package/src/components/Separator/index.tsx +7 -3
- package/src/components/Sidebar/Sidebar.fragment.tsx +11 -2
- package/src/components/Sidebar/Sidebar.module.scss +91 -47
- package/src/components/Sidebar/index.tsx +57 -14
- package/src/components/Skeleton/Skeleton.fragment.tsx +6 -6
- package/src/components/Skeleton/Skeleton.module.scss +11 -0
- package/src/components/Slider/Slider.fragment.tsx +201 -0
- package/src/components/Slider/Slider.module.scss +87 -0
- package/src/components/Slider/index.tsx +88 -0
- package/src/components/Stack/Stack.fragment.tsx +194 -0
- package/src/components/Stack/Stack.module.scss +120 -0
- package/src/components/Stack/index.tsx +148 -0
- package/src/components/Table/Table.fragment.tsx +10 -3
- package/src/components/Table/Table.module.scss +57 -0
- package/src/components/Table/index.tsx +44 -6
- package/src/components/Tabs/Tabs.fragment.tsx +10 -1
- package/src/components/Tabs/Tabs.module.scss +25 -10
- package/src/components/Tabs/index.tsx +11 -8
- package/src/components/Text/Text.fragment.tsx +188 -0
- package/src/components/Text/Text.module.scss +82 -0
- package/src/components/Text/index.tsx +58 -0
- package/src/components/Textarea/Textarea.fragment.tsx +1 -1
- package/src/components/Textarea/index.tsx +3 -7
- package/src/components/Theme/Theme.fragment.tsx +128 -0
- package/src/components/Theme/ThemeToggle.module.scss +82 -0
- package/src/components/Theme/index.tsx +343 -0
- package/src/components/ThinkingIndicator/ThinkingIndicator.fragment.tsx +182 -0
- package/src/components/ThinkingIndicator/ThinkingIndicator.module.scss +226 -0
- package/src/components/ThinkingIndicator/index.tsx +258 -0
- package/src/components/Toast/Toast.fragment.tsx +6 -6
- package/src/components/Toast/Toast.module.scss +16 -1
- package/src/components/Toast/index.tsx +27 -11
- package/src/components/Toggle/Toggle.fragment.tsx +1 -1
- package/src/components/Toggle/Toggle.module.scss +25 -10
- package/src/components/Toggle/index.tsx +12 -0
- package/src/components/ToggleGroup/ToggleGroup.fragment.tsx +207 -0
- package/src/components/ToggleGroup/ToggleGroup.module.scss +134 -0
- package/src/components/ToggleGroup/index.tsx +144 -0
- package/src/components/Tooltip/Tooltip.fragment.tsx +3 -3
- package/src/components/Tooltip/Tooltip.module.scss +4 -4
- package/src/components/Tooltip/index.tsx +4 -2
- package/src/components/VisuallyHidden/VisuallyHidden.fragment.tsx +134 -0
- package/src/components/VisuallyHidden/VisuallyHidden.module.scss +13 -0
- package/src/components/VisuallyHidden/index.tsx +29 -0
- package/src/index.ts +278 -3
- package/src/recipes/AIChat.recipe.ts +266 -0
- package/src/recipes/AppShell.recipe.ts +175 -0
- package/src/recipes/CardGrid.recipe.ts +6 -2
- package/src/recipes/ChatInterface.recipe.ts +87 -0
- package/src/recipes/CodeExamples.recipe.ts +66 -0
- package/src/recipes/DashboardLayout.recipe.ts +46 -12
- package/src/recipes/DashboardNav.recipe.ts +183 -0
- package/src/recipes/LoginForm.recipe.ts +8 -1
- package/src/recipes/SettingsPage.recipe.ts +37 -20
- package/src/styles/globals.scss +31 -0
- package/src/tokens/_computed.scss +212 -0
- package/src/tokens/_density.scss +171 -0
- package/src/tokens/_derive.scss +287 -0
- package/src/tokens/_index.scss +41 -0
- package/src/tokens/_mixins.scss +95 -1
- package/src/tokens/_palettes.scss +185 -0
- package/src/tokens/_radius.scss +107 -0
- package/src/tokens/_seeds.scss +59 -0
- package/src/tokens/_variables.scss +507 -101
- package/src/utils/a11y.tsx +439 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
@use '../../tokens/variables' as *;
|
|
2
|
+
@use '../../tokens/mixins' as *;
|
|
3
|
+
|
|
4
|
+
// External title label (above the code block)
|
|
5
|
+
.title {
|
|
6
|
+
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
7
|
+
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
8
|
+
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
letter-spacing: 0.05em;
|
|
11
|
+
margin-bottom: var(--fui-space-1, $fui-space-1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Code blocks always use dark theme styling (same in light and dark mode)
|
|
15
|
+
.wrapper {
|
|
16
|
+
position: relative;
|
|
17
|
+
border-radius: var(--fui-radius-lg, $fui-radius-lg);
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
background-color: var(--fui-code-bg, $fui-code-bg);
|
|
20
|
+
border: 1px solid var(--fui-code-border, $fui-code-border);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ============================================
|
|
24
|
+
// Header bar with filename
|
|
25
|
+
// ============================================
|
|
26
|
+
.hasHeader {
|
|
27
|
+
// Adjust copy button position when header is present
|
|
28
|
+
.copyButton {
|
|
29
|
+
top: calc(var(--fui-space-2, $fui-space-2) + 36px); // Account for header height
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding: var(--fui-space-2, $fui-space-2) var(--fui-space-4, $fui-space-4);
|
|
37
|
+
background-color: var(--fui-code-header-bg, $fui-code-header-bg);
|
|
38
|
+
border-bottom: 1px solid var(--fui-code-border, $fui-code-border);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.filename {
|
|
42
|
+
font-family: var(--fui-font-mono, $fui-font-mono);
|
|
43
|
+
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
44
|
+
font-weight: var(--fui-font-weight-normal, $fui-font-weight-normal);
|
|
45
|
+
color: var(--fui-code-text-muted, $fui-code-text-muted);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Copy button - always dark theme styling
|
|
49
|
+
.copyButton {
|
|
50
|
+
@include button-reset;
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: var(--fui-space-2, $fui-space-2);
|
|
53
|
+
right: var(--fui-space-2, $fui-space-2);
|
|
54
|
+
z-index: 10;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: var(--fui-space-1, $fui-space-1);
|
|
58
|
+
padding: var(--fui-space-1, $fui-space-1) var(--fui-space-2, $fui-space-2);
|
|
59
|
+
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
60
|
+
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
61
|
+
font-family: var(--fui-font-sans, $fui-font-sans);
|
|
62
|
+
// Use code-specific tokens for consistent dark theme styling
|
|
63
|
+
color: var(--fui-code-text-muted, $fui-code-text-muted);
|
|
64
|
+
background: transparent;
|
|
65
|
+
border: none;
|
|
66
|
+
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
transition:
|
|
70
|
+
opacity var(--fui-transition-fast, $fui-transition-fast),
|
|
71
|
+
background var(--fui-transition-fast, $fui-transition-fast),
|
|
72
|
+
color var(--fui-transition-fast, $fui-transition-fast);
|
|
73
|
+
|
|
74
|
+
// Show on wrapper hover
|
|
75
|
+
.wrapper:hover & {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
color: var(--fui-code-tab-text-active, $fui-code-tab-text-active);
|
|
81
|
+
background: var(--fui-code-copy-bg, $fui-code-copy-bg);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:focus-visible {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
outline: 2px solid rgba(255, 255, 255, 0.5);
|
|
87
|
+
outline-offset: 2px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.copied {
|
|
91
|
+
color: var(--fui-color-success, $fui-color-success);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.icon {
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Persistent copy — wrapper becomes flex row, button sits beside code
|
|
100
|
+
.persistentCopyWrapper {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
|
|
104
|
+
.codeContainer,
|
|
105
|
+
.loading {
|
|
106
|
+
flex: 1;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
|
|
109
|
+
:global(.shiki),
|
|
110
|
+
pre {
|
|
111
|
+
padding-right: var(--fui-space-3, $fui-space-3);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.persistentCopy {
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
padding-right: var(--fui-space-2, $fui-space-2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.loading {
|
|
122
|
+
pre {
|
|
123
|
+
margin: 0;
|
|
124
|
+
padding: var(--fui-space-4, $fui-space-4);
|
|
125
|
+
padding-right: var(--fui-space-10, $fui-space-10);
|
|
126
|
+
background-color: transparent !important;
|
|
127
|
+
border: none !important;
|
|
128
|
+
border-radius: 0 !important;
|
|
129
|
+
font-family: var(--fui-font-mono, $fui-font-mono);
|
|
130
|
+
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
131
|
+
line-height: 1.7;
|
|
132
|
+
color: var(--fui-code-text, $fui-code-text);
|
|
133
|
+
overflow-x: auto;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
code {
|
|
137
|
+
background: none !important;
|
|
138
|
+
padding: 0;
|
|
139
|
+
border: none;
|
|
140
|
+
color: inherit;
|
|
141
|
+
font-family: inherit;
|
|
142
|
+
font-size: inherit;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.codeContainer {
|
|
147
|
+
// Shiki output styling - always dark theme
|
|
148
|
+
:global(.shiki) {
|
|
149
|
+
margin: 0;
|
|
150
|
+
padding: var(--fui-space-4, $fui-space-4);
|
|
151
|
+
padding-right: var(--fui-space-10, $fui-space-10);
|
|
152
|
+
background-color: transparent !important;
|
|
153
|
+
border: none !important;
|
|
154
|
+
border-radius: 0 !important;
|
|
155
|
+
font-family: var(--fui-font-mono, $fui-font-mono);
|
|
156
|
+
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
157
|
+
line-height: 1.7;
|
|
158
|
+
overflow-x: auto;
|
|
159
|
+
tab-size: 2;
|
|
160
|
+
|
|
161
|
+
code {
|
|
162
|
+
background: none !important;
|
|
163
|
+
padding: 0;
|
|
164
|
+
border: none;
|
|
165
|
+
border-radius: 0;
|
|
166
|
+
font-family: inherit;
|
|
167
|
+
font-size: inherit;
|
|
168
|
+
counter-reset: line;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Line styles
|
|
173
|
+
:global(.line) {
|
|
174
|
+
display: inline-block;
|
|
175
|
+
width: 100%;
|
|
176
|
+
min-height: 1.6em;
|
|
177
|
+
|
|
178
|
+
&:global(.highlighted) {
|
|
179
|
+
background-color: var(--fui-code-highlight-bg, $fui-code-highlight-bg);
|
|
180
|
+
margin: 0 calc(-1 * var(--fui-space-3, $fui-space-3));
|
|
181
|
+
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
182
|
+
border-left: 3px solid var(--fui-color-info, $fui-color-info);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Line numbers
|
|
187
|
+
:global(.line-number) {
|
|
188
|
+
display: inline-block;
|
|
189
|
+
width: 2.5em;
|
|
190
|
+
padding-right: 1em;
|
|
191
|
+
text-align: right;
|
|
192
|
+
color: var(--fui-code-text-muted, $fui-code-text-muted);
|
|
193
|
+
user-select: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Custom selection highlight for better visibility
|
|
197
|
+
*::selection {
|
|
198
|
+
background: var(--fui-code-selection-bg, $fui-code-selection-bg);
|
|
199
|
+
color: white;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Custom scrollbar for code blocks
|
|
203
|
+
:global(.shiki)::-webkit-scrollbar {
|
|
204
|
+
height: 6px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:global(.shiki)::-webkit-scrollbar-track {
|
|
208
|
+
background: var(--fui-code-scrollbar-track, $fui-code-scrollbar-track);
|
|
209
|
+
border-radius: var(--fui-radius-sm, $fui-radius-sm);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
:global(.shiki)::-webkit-scrollbar-thumb {
|
|
213
|
+
background: var(--fui-code-scrollbar-thumb, $fui-code-scrollbar-thumb);
|
|
214
|
+
border-radius: var(--fui-radius-sm, $fui-radius-sm);
|
|
215
|
+
|
|
216
|
+
&:hover {
|
|
217
|
+
background: var(--fui-code-scrollbar-thumb-hover, $fui-code-scrollbar-thumb-hover);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Line numbers variant
|
|
223
|
+
.withLineNumbers {
|
|
224
|
+
.codeContainer :global(.shiki) {
|
|
225
|
+
padding-left: var(--fui-space-2, $fui-space-2);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Diff styling
|
|
230
|
+
.withDiff {
|
|
231
|
+
:global(.diff-marker) {
|
|
232
|
+
display: inline-block;
|
|
233
|
+
width: 1.5em;
|
|
234
|
+
text-align: center;
|
|
235
|
+
user-select: none;
|
|
236
|
+
color: var(--fui-code-text-muted, $fui-code-text-muted);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:global(.diff-added) {
|
|
240
|
+
background-color: var(--fui-color-success-bg, $fui-color-success-bg);
|
|
241
|
+
margin: 0 calc(-1 * var(--fui-space-3, $fui-space-3));
|
|
242
|
+
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
243
|
+
|
|
244
|
+
:global(.diff-marker) {
|
|
245
|
+
color: var(--fui-color-success, $fui-color-success);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:global(.diff-removed) {
|
|
250
|
+
background-color: var(--fui-color-danger-bg, $fui-color-danger-bg);
|
|
251
|
+
margin: 0 calc(-1 * var(--fui-space-3, $fui-space-3));
|
|
252
|
+
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
253
|
+
|
|
254
|
+
:global(.diff-marker) {
|
|
255
|
+
color: var(--fui-color-danger, $fui-color-danger);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Compact variant — reduced padding, vertically centred copy button
|
|
261
|
+
.compact {
|
|
262
|
+
.wrapper {
|
|
263
|
+
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.codeContainer :global(.shiki),
|
|
267
|
+
.loading pre {
|
|
268
|
+
padding: var(--fui-space-2, $fui-space-2) var(--fui-space-3, $fui-space-3);
|
|
269
|
+
padding-right: var(--fui-space-8, $fui-space-8);
|
|
270
|
+
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
271
|
+
line-height: 1.5;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.copyButton {
|
|
275
|
+
top: 50%;
|
|
276
|
+
transform: translateY(-50%);
|
|
277
|
+
right: var(--fui-space-1, $fui-space-1);
|
|
278
|
+
padding: var(--fui-space-1, $fui-space-1);
|
|
279
|
+
font-size: 0;
|
|
280
|
+
gap: 0;
|
|
281
|
+
|
|
282
|
+
span {
|
|
283
|
+
display: none;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Word wrap
|
|
289
|
+
.wordWrap {
|
|
290
|
+
.codeContainer :global(.shiki),
|
|
291
|
+
.loading pre {
|
|
292
|
+
white-space: pre-wrap;
|
|
293
|
+
word-break: break-word;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
:global(.line) {
|
|
297
|
+
display: block;
|
|
298
|
+
width: auto;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Caption below code block
|
|
303
|
+
.caption {
|
|
304
|
+
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
305
|
+
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
306
|
+
margin-top: var(--fui-space-2, $fui-space-2);
|
|
307
|
+
font-style: italic;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Collapse/expand button
|
|
311
|
+
.collapseButton {
|
|
312
|
+
@include button-reset;
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
justify-content: center;
|
|
316
|
+
gap: var(--fui-space-1, $fui-space-1);
|
|
317
|
+
width: 100%;
|
|
318
|
+
padding: var(--fui-space-2, $fui-space-2);
|
|
319
|
+
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
320
|
+
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
321
|
+
font-family: var(--fui-font-sans, $fui-font-sans);
|
|
322
|
+
color: var(--fui-code-text-muted, $fui-code-text-muted);
|
|
323
|
+
background: var(--fui-code-header-bg, $fui-code-header-bg);
|
|
324
|
+
border-top: 1px solid var(--fui-code-border, $fui-code-border);
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
transition:
|
|
327
|
+
background var(--fui-transition-fast, $fui-transition-fast),
|
|
328
|
+
color var(--fui-transition-fast, $fui-transition-fast);
|
|
329
|
+
|
|
330
|
+
&:hover {
|
|
331
|
+
background: var(--fui-code-copy-bg, $fui-code-copy-bg);
|
|
332
|
+
color: var(--fui-code-tab-text-active, $fui-code-tab-text-active);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&:focus-visible {
|
|
336
|
+
outline: 2px solid rgba(255, 255, 255, 0.5);
|
|
337
|
+
outline-offset: -2px;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Responsive
|
|
342
|
+
@media (max-width: $fui-breakpoint-md) {
|
|
343
|
+
.codeContainer :global(.shiki) {
|
|
344
|
+
font-size: 0.75rem;
|
|
345
|
+
padding: var(--fui-space-2, $fui-space-2);
|
|
346
|
+
padding-right: var(--fui-space-8, $fui-space-8);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.copyButton {
|
|
350
|
+
opacity: 0.8; // Always visible on mobile (no hover)
|
|
351
|
+
padding: 0.25rem 0.5rem;
|
|
352
|
+
font-size: 0.6875rem;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// ============================================
|
|
357
|
+
// Tabbed Code Block
|
|
358
|
+
// ============================================
|
|
359
|
+
|
|
360
|
+
.tabbedPanel {
|
|
361
|
+
margin-top: 0;
|
|
362
|
+
}
|