loseta 0.1.0 → 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.
- package/README.md +19 -6
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +2 -2
- package/dist/commands/add.js +47 -62
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/init.d.ts +2 -3
- package/dist/commands/init.js +57 -40
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/style.d.ts +1 -0
- package/dist/commands/style.js +65 -0
- package/dist/commands/style.js.map +1 -0
- package/dist/config.d.ts +4 -1
- package/dist/config.js +9 -2
- package/dist/config.js.map +1 -1
- package/dist/imports.d.ts +2 -2
- package/dist/imports.js +8 -7
- package/dist/imports.js.map +1 -1
- package/dist/install.d.ts +24 -0
- package/dist/install.js +61 -0
- package/dist/install.js.map +1 -0
- package/dist/registry.d.ts +10 -0
- package/dist/registry.js +22 -0
- package/dist/registry.js.map +1 -1
- package/dist/style-selection.d.ts +32 -0
- package/dist/style-selection.js +52 -0
- package/dist/style-selection.js.map +1 -0
- package/dist/style-switch.d.ts +37 -0
- package/dist/style-switch.js +70 -0
- package/dist/style-switch.js.map +1 -0
- package/dist/types.d.ts +10 -4
- package/package.json +3 -2
- package/registry/base.css +1 -1
- package/registry/components/code-block.css +173 -0
- package/registry/examples/code-block.html +73 -0
- package/registry/examples/skeleton.html +1 -1
- package/registry/registry.json +1313 -105
- package/registry/reset.css +332 -80
- package/registry/schema.json +19 -4
- package/registry/styles/luma/alert-dialog.css +74 -0
- package/registry/styles/luma/alert.css +114 -0
- package/registry/styles/luma/badge.css +84 -0
- package/registry/styles/luma/button-group.css +75 -0
- package/registry/styles/luma/button.css +222 -0
- package/registry/styles/luma/card.css +100 -0
- package/registry/styles/luma/checkbox.css +52 -0
- package/registry/styles/luma/code-block.css +186 -0
- package/registry/styles/luma/dialog.css +64 -0
- package/registry/styles/luma/dropdown-menu.css +104 -0
- package/registry/styles/luma/empty.css +54 -0
- package/registry/styles/luma/field.css +120 -0
- package/registry/styles/luma/input.css +56 -0
- package/registry/styles/luma/item.css +133 -0
- package/registry/styles/luma/kbd.css +22 -0
- package/registry/styles/luma/label.css +70 -0
- package/registry/styles/luma/native-select.css +73 -0
- package/registry/styles/luma/popover.css +25 -0
- package/registry/styles/luma/primitives/dialog-shell.css +19 -0
- package/registry/styles/luma/primitives/popover.css +16 -0
- package/registry/{themes/nova → styles/luma}/radio.css +13 -20
- package/registry/{themes/nova → styles/luma}/skeleton.css +1 -1
- package/registry/styles/luma/switch.css +81 -0
- package/registry/styles/luma/table.css +87 -0
- package/registry/styles/luma/tabs.css +133 -0
- package/registry/styles/luma/textarea.css +48 -0
- package/registry/styles/luma/tooltip.css +22 -0
- package/registry/styles/lyra/alert-dialog.css +74 -0
- package/registry/styles/lyra/alert.css +114 -0
- package/registry/styles/lyra/badge.css +84 -0
- package/registry/styles/lyra/button-group.css +74 -0
- package/registry/styles/lyra/button.css +221 -0
- package/registry/styles/lyra/card.css +99 -0
- package/registry/styles/lyra/checkbox.css +52 -0
- package/registry/styles/lyra/code-block.css +186 -0
- package/registry/styles/lyra/dialog.css +64 -0
- package/registry/styles/lyra/dropdown-menu.css +104 -0
- package/registry/styles/lyra/empty.css +54 -0
- package/registry/styles/lyra/field.css +120 -0
- package/registry/styles/lyra/input.css +57 -0
- package/registry/styles/lyra/item.css +133 -0
- package/registry/styles/lyra/kbd.css +22 -0
- package/registry/styles/lyra/label.css +70 -0
- package/registry/styles/lyra/native-select.css +74 -0
- package/registry/styles/lyra/popover.css +25 -0
- package/registry/styles/lyra/primitives/dialog-shell.css +19 -0
- package/registry/styles/lyra/primitives/popover.css +16 -0
- package/registry/styles/lyra/radio.css +46 -0
- package/registry/styles/lyra/skeleton.css +7 -0
- package/registry/{themes/nova → styles/lyra}/switch.css +16 -22
- package/registry/styles/lyra/table.css +87 -0
- package/registry/styles/lyra/tabs.css +133 -0
- package/registry/styles/lyra/textarea.css +49 -0
- package/registry/styles/lyra/tooltip.css +22 -0
- package/registry/styles/maia/alert-dialog.css +74 -0
- package/registry/styles/maia/alert.css +114 -0
- package/registry/{themes/nova → styles/maia}/badge.css +9 -11
- package/registry/styles/maia/button-group.css +75 -0
- package/registry/styles/maia/button.css +222 -0
- package/registry/styles/maia/card.css +99 -0
- package/registry/styles/maia/checkbox.css +52 -0
- package/registry/styles/maia/code-block.css +186 -0
- package/registry/styles/maia/dialog.css +64 -0
- package/registry/styles/maia/dropdown-menu.css +104 -0
- package/registry/styles/maia/empty.css +54 -0
- package/registry/styles/maia/field.css +120 -0
- package/registry/styles/maia/input.css +56 -0
- package/registry/styles/maia/item.css +133 -0
- package/registry/{themes/nova → styles/maia}/kbd.css +1 -1
- package/registry/styles/maia/label.css +70 -0
- package/registry/styles/maia/native-select.css +73 -0
- package/registry/styles/maia/popover.css +25 -0
- package/registry/styles/maia/primitives/dialog-shell.css +19 -0
- package/registry/styles/maia/primitives/popover.css +16 -0
- package/registry/styles/maia/radio.css +46 -0
- package/registry/styles/maia/skeleton.css +7 -0
- package/registry/styles/maia/switch.css +81 -0
- package/registry/styles/maia/table.css +87 -0
- package/registry/styles/maia/tabs.css +133 -0
- package/registry/styles/maia/textarea.css +48 -0
- package/registry/styles/maia/tooltip.css +22 -0
- package/registry/styles/mira/alert-dialog.css +74 -0
- package/registry/styles/mira/alert.css +114 -0
- package/registry/styles/mira/badge.css +84 -0
- package/registry/styles/mira/button-group.css +75 -0
- package/registry/styles/mira/button.css +222 -0
- package/registry/styles/mira/card.css +99 -0
- package/registry/{themes/nova → styles/mira}/checkbox.css +13 -20
- package/registry/styles/mira/code-block.css +186 -0
- package/registry/styles/mira/dialog.css +64 -0
- package/registry/styles/mira/dropdown-menu.css +105 -0
- package/registry/styles/mira/empty.css +54 -0
- package/registry/styles/mira/field.css +120 -0
- package/registry/styles/mira/input.css +57 -0
- package/registry/styles/mira/item.css +133 -0
- package/registry/styles/mira/kbd.css +22 -0
- package/registry/styles/mira/label.css +70 -0
- package/registry/styles/mira/native-select.css +75 -0
- package/registry/styles/mira/popover.css +25 -0
- package/registry/styles/mira/primitives/dialog-shell.css +19 -0
- package/registry/styles/mira/primitives/popover.css +16 -0
- package/registry/styles/mira/radio.css +46 -0
- package/registry/styles/mira/skeleton.css +7 -0
- package/registry/styles/mira/switch.css +81 -0
- package/registry/styles/mira/table.css +87 -0
- package/registry/styles/mira/tabs.css +133 -0
- package/registry/styles/mira/textarea.css +49 -0
- package/registry/{themes/nova → styles/mira}/tooltip.css +1 -1
- package/registry/{themes → styles}/nova/alert-dialog.css +1 -1
- package/registry/{themes → styles}/nova/alert.css +1 -1
- package/registry/styles/nova/badge.css +84 -0
- package/registry/{themes → styles}/nova/button-group.css +1 -1
- package/registry/{themes → styles}/nova/button.css +38 -44
- package/registry/{themes → styles}/nova/card.css +1 -1
- package/registry/styles/nova/checkbox.css +52 -0
- package/registry/styles/nova/code-block.css +186 -0
- package/registry/{themes → styles}/nova/dialog.css +1 -1
- package/registry/{themes → styles}/nova/dropdown-menu.css +5 -6
- package/registry/{themes → styles}/nova/empty.css +1 -1
- package/registry/{themes → styles}/nova/field.css +1 -1
- package/registry/{themes → styles}/nova/input.css +17 -18
- package/registry/{themes → styles}/nova/item.css +1 -1
- package/registry/styles/nova/kbd.css +22 -0
- package/registry/{themes → styles}/nova/label.css +9 -10
- package/registry/{themes → styles}/nova/native-select.css +20 -16
- package/registry/{themes → styles}/nova/popover.css +1 -1
- package/registry/{themes → styles}/nova/primitives/dialog-shell.css +1 -1
- package/registry/{themes → styles}/nova/primitives/popover.css +1 -1
- package/registry/styles/nova/radio.css +46 -0
- package/registry/styles/nova/skeleton.css +7 -0
- package/registry/styles/nova/switch.css +81 -0
- package/registry/{themes → styles}/nova/table.css +1 -1
- package/registry/{themes → styles}/nova/tabs.css +10 -23
- package/registry/{themes → styles}/nova/textarea.css +17 -18
- package/registry/styles/nova/tooltip.css +22 -0
- package/registry/styles/rhea/alert-dialog.css +74 -0
- package/registry/styles/rhea/alert.css +114 -0
- package/registry/styles/rhea/badge.css +84 -0
- package/registry/styles/rhea/button-group.css +75 -0
- package/registry/styles/rhea/button.css +222 -0
- package/registry/styles/rhea/card.css +100 -0
- package/registry/styles/rhea/checkbox.css +52 -0
- package/registry/styles/rhea/code-block.css +186 -0
- package/registry/styles/rhea/dialog.css +64 -0
- package/registry/styles/rhea/dropdown-menu.css +105 -0
- package/registry/styles/rhea/empty.css +54 -0
- package/registry/styles/rhea/field.css +120 -0
- package/registry/styles/rhea/input.css +56 -0
- package/registry/styles/rhea/item.css +133 -0
- package/registry/styles/rhea/kbd.css +22 -0
- package/registry/styles/rhea/label.css +70 -0
- package/registry/styles/rhea/native-select.css +73 -0
- package/registry/styles/rhea/popover.css +25 -0
- package/registry/styles/rhea/primitives/dialog-shell.css +19 -0
- package/registry/styles/rhea/primitives/popover.css +16 -0
- package/registry/styles/rhea/radio.css +46 -0
- package/registry/styles/rhea/skeleton.css +7 -0
- package/registry/styles/rhea/switch.css +81 -0
- package/registry/styles/rhea/table.css +87 -0
- package/registry/styles/rhea/tabs.css +133 -0
- package/registry/styles/rhea/textarea.css +48 -0
- package/registry/styles/rhea/tooltip.css +22 -0
- package/registry/styles/sera/alert-dialog.css +76 -0
- package/registry/styles/sera/alert.css +114 -0
- package/registry/styles/sera/badge.css +115 -0
- package/registry/styles/sera/button-group.css +75 -0
- package/registry/styles/sera/button.css +222 -0
- package/registry/styles/sera/card.css +102 -0
- package/registry/styles/sera/checkbox.css +52 -0
- package/registry/styles/sera/code-block.css +186 -0
- package/registry/styles/sera/dialog.css +67 -0
- package/registry/styles/sera/dropdown-menu.css +104 -0
- package/registry/styles/sera/empty.css +54 -0
- package/registry/styles/sera/field.css +120 -0
- package/registry/styles/sera/input.css +57 -0
- package/registry/styles/sera/item.css +133 -0
- package/registry/styles/sera/kbd.css +22 -0
- package/registry/styles/sera/label.css +70 -0
- package/registry/styles/sera/native-select.css +74 -0
- package/registry/styles/sera/popover.css +25 -0
- package/registry/styles/sera/primitives/dialog-shell.css +19 -0
- package/registry/styles/sera/primitives/popover.css +16 -0
- package/registry/styles/sera/radio.css +46 -0
- package/registry/styles/sera/skeleton.css +7 -0
- package/registry/styles/sera/switch.css +82 -0
- package/registry/styles/sera/table.css +88 -0
- package/registry/styles/sera/tabs.css +133 -0
- package/registry/styles/sera/textarea.css +49 -0
- package/registry/styles/sera/tooltip.css +22 -0
- package/registry/styles/vega/alert-dialog.css +74 -0
- package/registry/styles/vega/alert.css +114 -0
- package/registry/styles/vega/badge.css +84 -0
- package/registry/styles/vega/button-group.css +75 -0
- package/registry/styles/vega/button.css +222 -0
- package/registry/styles/vega/card.css +100 -0
- package/registry/styles/vega/checkbox.css +53 -0
- package/registry/styles/vega/code-block.css +186 -0
- package/registry/styles/vega/dialog.css +64 -0
- package/registry/styles/vega/dropdown-menu.css +104 -0
- package/registry/styles/vega/empty.css +54 -0
- package/registry/styles/vega/field.css +120 -0
- package/registry/styles/vega/input.css +57 -0
- package/registry/styles/vega/item.css +133 -0
- package/registry/styles/vega/kbd.css +22 -0
- package/registry/styles/vega/label.css +70 -0
- package/registry/styles/vega/native-select.css +74 -0
- package/registry/styles/vega/popover.css +25 -0
- package/registry/styles/vega/primitives/dialog-shell.css +19 -0
- package/registry/styles/vega/primitives/popover.css +16 -0
- package/registry/styles/vega/radio.css +46 -0
- package/registry/styles/vega/skeleton.css +7 -0
- package/registry/styles/vega/switch.css +82 -0
- package/registry/styles/vega/table.css +87 -0
- package/registry/styles/vega/tabs.css +133 -0
- package/registry/styles/vega/textarea.css +49 -0
- package/registry/styles/vega/tooltip.css +22 -0
- package/registry/tokens.css +116 -130
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/* Code Block */
|
|
2
|
+
@layer loseta.components {
|
|
3
|
+
.code-block {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
> header {
|
|
12
|
+
display: flex;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
|
|
18
|
+
> [data-slot='title'] {
|
|
19
|
+
min-width: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
|
|
24
|
+
& svg {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
> header > [data-slot='actions'],
|
|
32
|
+
> [data-slot='actions'] {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 0.25rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
> header > [data-slot='actions'] {
|
|
40
|
+
margin-inline-start: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
> [data-slot='actions'] {
|
|
44
|
+
position: absolute;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
margin: 0;
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transition-property: opacity;
|
|
49
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
50
|
+
transition-duration: 150ms;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:hover > [data-slot='actions'],
|
|
54
|
+
&:focus-within > [data-slot='actions'] {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (pointer: coarse) {
|
|
59
|
+
> [data-slot='actions'] {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
> pre {
|
|
65
|
+
min-height: 0;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
margin: 0;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
direction: ltr;
|
|
70
|
+
text-align: start;
|
|
71
|
+
outline-style: none;
|
|
72
|
+
white-space: pre;
|
|
73
|
+
|
|
74
|
+
> code {
|
|
75
|
+
display: block;
|
|
76
|
+
min-width: max-content;
|
|
77
|
+
font: inherit;
|
|
78
|
+
white-space: inherit;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
> code:has(> [data-slot='line']) {
|
|
82
|
+
display: grid;
|
|
83
|
+
min-width: max-content;
|
|
84
|
+
align-content: start;
|
|
85
|
+
grid-auto-flow: row;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&[data-line-numbers] {
|
|
89
|
+
counter-reset: line calc(var(--line-start, 1) - 1);
|
|
90
|
+
|
|
91
|
+
> code {
|
|
92
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
93
|
+
column-gap: 0.75rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-slot='line'] {
|
|
97
|
+
display: grid;
|
|
98
|
+
grid-column: 1 / -1;
|
|
99
|
+
grid-template-columns: subgrid;
|
|
100
|
+
column-gap: inherit;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-slot='line']::before {
|
|
104
|
+
grid-column: 1;
|
|
105
|
+
content: counter(line);
|
|
106
|
+
counter-increment: line;
|
|
107
|
+
min-width: 1.5rem;
|
|
108
|
+
align-self: start;
|
|
109
|
+
text-align: end;
|
|
110
|
+
-webkit-user-select: none;
|
|
111
|
+
user-select: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@supports (content: counter(line) / '') {
|
|
115
|
+
[data-slot='line']::before {
|
|
116
|
+
content: counter(line) / '';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-slot='line'] > [data-slot='line-content'] {
|
|
121
|
+
grid-column: 2;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&[data-wrap] {
|
|
126
|
+
white-space: pre-wrap;
|
|
127
|
+
overflow-wrap: anywhere;
|
|
128
|
+
|
|
129
|
+
> code {
|
|
130
|
+
min-width: 0;
|
|
131
|
+
white-space: inherit;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[data-slot='line'] {
|
|
137
|
+
min-height: 1lh;
|
|
138
|
+
|
|
139
|
+
> [data-slot='line-content'] {
|
|
140
|
+
position: relative;
|
|
141
|
+
display: block;
|
|
142
|
+
min-width: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&[data-variant='added'] > [data-slot='line-content']::before {
|
|
146
|
+
content: '+';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&[data-variant='removed'] > [data-slot='line-content']::before {
|
|
150
|
+
content: '−';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&[data-variant='added'] > [data-slot='line-content']::before,
|
|
154
|
+
&[data-variant='removed'] > [data-slot='line-content']::before {
|
|
155
|
+
position: absolute;
|
|
156
|
+
inset-block-start: 0;
|
|
157
|
+
inset-inline-start: -0.75rem;
|
|
158
|
+
width: 0.75rem;
|
|
159
|
+
text-align: center;
|
|
160
|
+
-webkit-user-select: none;
|
|
161
|
+
user-select: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
> footer {
|
|
166
|
+
display: flex;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
flex-shrink: 0;
|
|
169
|
+
align-items: center;
|
|
170
|
+
gap: 0.5rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!-- Header and actions -->
|
|
2
|
+
<div class="code-block">
|
|
3
|
+
<header>
|
|
4
|
+
<span data-slot="title">app/api/chat/route.ts</span>
|
|
5
|
+
<div data-slot="actions">
|
|
6
|
+
<button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy code"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
|
|
7
|
+
</div>
|
|
8
|
+
</header>
|
|
9
|
+
<pre dir="ltr" tabindex="0"><code>import { streamText } from "ai";
|
|
10
|
+
|
|
11
|
+
export async function POST(request: Request) {
|
|
12
|
+
const { messages } = await request.json();
|
|
13
|
+
const result = streamText({
|
|
14
|
+
model: "anthropic/claude-sonnet-4.5",
|
|
15
|
+
messages
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return result.toUIMessageStreamResponse();
|
|
19
|
+
}</code></pre>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- Line numbers -->
|
|
23
|
+
<div class="code-block">
|
|
24
|
+
<header>
|
|
25
|
+
<span data-slot="title">app/dashboard/page.tsx</span>
|
|
26
|
+
</header>
|
|
27
|
+
<pre data-line-numbers style="--line-start: 12" dir="ltr" tabindex="0"><code><span data-slot="line"><span data-slot="line-content"> if (!session) {</span></span>
|
|
28
|
+
<span data-slot="line"><span data-slot="line-content"> redirect("/login");</span></span>
|
|
29
|
+
<span data-slot="line"><span data-slot="line-content"> }</span></span>
|
|
30
|
+
<span data-slot="line"><span data-slot="line-content"></span></span>
|
|
31
|
+
<span data-slot="line"><span data-slot="line-content"> const projects = await db.project.findMany({</span></span>
|
|
32
|
+
<span data-slot="line"><span data-slot="line-content"> where: { ownerId: session.user.id },</span></span>
|
|
33
|
+
<span data-slot="line"><span data-slot="line-content"> orderBy: { updatedAt: "desc" }</span></span>
|
|
34
|
+
<span data-slot="line"><span data-slot="line-content"> });</span></span>
|
|
35
|
+
<span data-slot="line"><span data-slot="line-content"> return <ProjectList projects={projects} />;</span></span>
|
|
36
|
+
<span data-slot="line"><span data-slot="line-content">}</span></span></code></pre>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<!-- Diff and highlighted lines -->
|
|
40
|
+
<div class="code-block">
|
|
41
|
+
<header>
|
|
42
|
+
<span data-slot="title">components/greeting.tsx</span>
|
|
43
|
+
</header>
|
|
44
|
+
<pre dir="ltr" tabindex="0"><code><span data-slot="line"><span data-slot="line-content">export function Greeting({ name }: { name: string }) {</span></span>
|
|
45
|
+
<span data-slot="line"><span data-slot="line-content"> return <p>Hello, {name}</p>;</span></span>
|
|
46
|
+
<span data-slot="line" data-variant="removed"><span data-slot="line-content"> return <p className="text-sm text-muted-foreground">Hello, {name}!</p>;</span></span>
|
|
47
|
+
<span data-slot="line" data-variant="added"><span data-slot="line-content"> return <p>Hello, {name}!</p>;</span></span>
|
|
48
|
+
<span data-slot="line" data-variant="highlighted"><span data-slot="line-content"> const message = "Hello, " + name + "!";</span></span>
|
|
49
|
+
<span data-slot="line"><span data-slot="line-content">}</span></span></code></pre>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- Small, wrapped and destructive -->
|
|
53
|
+
<div class="code-block" data-size="sm" data-variant="destructive">
|
|
54
|
+
<header>
|
|
55
|
+
<span data-slot="title">Error</span>
|
|
56
|
+
<div data-slot="actions">
|
|
57
|
+
<button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Wrap lines" aria-pressed="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="6" y2="6"/><path d="M3 12h15a3 3 0 1 1 0 6h-4"/><polyline points="16 16 14 18 16 20"/><line x1="3" x2="10" y1="18" y2="18"/></svg></button>
|
|
58
|
+
<button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy output"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
|
|
59
|
+
</div>
|
|
60
|
+
</header>
|
|
61
|
+
<pre data-wrap dir="ltr" tabindex="0"><code>TypeError: The model "anthropic/claude-sonnet-4.5" returned an error: Request too large. The prompt is 212,431 tokens but the context window is 200,000 tokens.</code></pre>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- Floating actions -->
|
|
65
|
+
<div class="code-block">
|
|
66
|
+
<div data-slot="actions">
|
|
67
|
+
<button class="btn" data-variant="ghost" data-size="icon-xs" type="button" aria-label="Copy output"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
|
|
68
|
+
</div>
|
|
69
|
+
<pre dir="ltr" tabindex="0"><code>$ pnpm add ai @ai-sdk/react zod
|
|
70
|
+
Packages: +14
|
|
71
|
+
Progress: resolved 412, reused 398, downloaded 14, added 14, done
|
|
72
|
+
Done in 2.8s using pnpm v10.18.0</code></pre>
|
|
73
|
+
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Default -->
|
|
2
|
-
<div style="display: flex; flex-direction: column; gap: 0.5rem; max-width: 20rem">
|
|
2
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem; width: 100%; max-width: 20rem">
|
|
3
3
|
<div class="skeleton" style="height: 1rem; width: 60%"></div>
|
|
4
4
|
<div class="skeleton" style="height: 1rem; width: 100%"></div>
|
|
5
5
|
<div class="skeleton" style="height: 1rem; width: 80%"></div>
|