@ctrl-ui/react 0.9.4 → 0.9.6
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 +27 -0
- package/dist/action-bar.js +16 -8
- package/dist/activity.d.ts +1 -1
- package/dist/activity.js +3 -1
- package/dist/audio-visualizer.js +1 -1
- package/dist/blocks/agent-run-clock.d.ts +5 -0
- package/dist/blocks/agent-run-clock.js +52 -0
- package/dist/blocks/agent-run-sidebar.d.ts +13 -0
- package/dist/blocks/agent-run-sidebar.js +100 -0
- package/dist/blocks/agent-run-status.d.ts +32 -0
- package/dist/blocks/agent-run-status.js +27 -0
- package/dist/blocks/agent-run.d.ts +80 -0
- package/dist/blocks/agent-run.js +254 -0
- package/dist/blocks/coding-agent.d.ts +1 -1
- package/dist/blocks/coding-agent.js +1 -4
- package/dist/blocks/design-canvas-data.d.ts +1 -1
- package/dist/blocks/design-canvas.d.ts +2 -1
- package/dist/blocks/design-canvas.js +15 -8
- package/dist/blocks/file-explorer.js +14 -16
- package/dist/chat-message.js +33 -39
- package/dist/knob-contracts/infinite-canvas-knobs.d.ts +1 -1
- package/dist/knob-contracts/infinite-canvas-knobs.js +1 -7
- package/dist/knob-contracts/swap-knobs.d.ts +4 -0
- package/dist/knob-contracts/swap-knobs.js +9 -0
- package/dist/knob-contracts/timeline-knobs.d.ts +1 -1
- package/dist/knob-contracts/timeline-knobs.js +1 -0
- package/dist/knob-contracts/tool-approval-knobs.d.ts +4 -0
- package/dist/knob-contracts/tool-approval-knobs.js +32 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +29 -24
- package/dist/lib/infinite-canvas-camera-store.d.ts +65 -0
- package/dist/lib/infinite-canvas-camera-store.js +233 -0
- package/dist/lib/infinite-canvas-camera.d.ts +33 -0
- package/dist/lib/infinite-canvas-camera.js +98 -0
- package/dist/lib/infinite-canvas-navigation.d.ts +19 -0
- package/dist/lib/infinite-canvas-navigation.js +395 -0
- package/dist/markdown-editor/bubble-menu.d.ts +6 -0
- package/dist/markdown-editor/bubble-menu.js +45 -0
- package/dist/markdown-editor/toolbar.d.ts +17 -1
- package/dist/markdown-editor/toolbar.js +103 -81
- package/dist/styles/index.css +10 -8
- package/dist/styles/recipes/activity.css +8 -0
- package/dist/styles/recipes/button-group.css +12 -6
- package/dist/styles/recipes/button-states.css +12 -0
- package/dist/styles/recipes/button.css +13 -3
- package/dist/styles/recipes/chat-composer-attachment.css +7 -0
- package/dist/styles/recipes/chat-message-edit.css +6 -21
- package/dist/styles/recipes/color-picker-details.css +7 -0
- package/dist/styles/recipes/field.css +7 -0
- package/dist/styles/recipes/infinite-canvas.css +17 -57
- package/dist/styles/recipes/inline-attachment.css +7 -0
- package/dist/styles/recipes/kbd.css +7 -0
- package/dist/styles/recipes/markdown-editor.css +12 -0
- package/dist/styles/recipes/pagination.css +8 -1
- package/dist/styles/recipes/scroll-area.css +1 -3
- package/dist/styles/recipes/swap.css +143 -0
- package/dist/styles/recipes/tabs.css +12 -0
- package/dist/styles/recipes/timeline.css +11 -0
- package/dist/styles/recipes/tool-approval.css +267 -0
- package/dist/styles/recipes/track-highlight.css +19 -6
- package/dist/styles/theme.css +6 -5
- package/dist/styles/type-scale.css +2 -1
- package/dist/tool-approval.d.ts +49 -0
- package/dist/tool-approval.js +260 -0
- package/dist/ui/code.js +13 -3
- package/dist/ui/command.js +1 -0
- package/dist/ui/infinite-canvas.d.ts +19 -22
- package/dist/ui/infinite-canvas.js +264 -325
- package/dist/ui/rich-tooltip.d.ts +2 -1
- package/dist/ui/rich-tooltip.js +32 -29
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/swap.d.ts +14 -0
- package/dist/ui/swap.js +69 -0
- package/dist/ui/timeline.d.ts +1 -1
- package/dist/ui/timeline.js +1 -1
- package/dist/ui/typography.d.ts +2 -0
- package/dist/ui/typography.js +2 -0
- package/dist/user-ask.js +1 -1
- package/lint/no-raw-type-classes.grit +7 -0
- package/package.json +4 -3
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
--cui-timeline-indicator-background: var(--background);
|
|
4
4
|
--cui-timeline-indicator-foreground: var(--muted-foreground);
|
|
5
5
|
--cui-timeline-running-foreground: var(--primary-text);
|
|
6
|
+
--cui-timeline-waiting-foreground: var(--warning-text);
|
|
6
7
|
--cui-timeline-success-foreground: var(--foreground);
|
|
7
8
|
--cui-timeline-error-foreground: var(--destructive-text);
|
|
8
9
|
--cui-timeline-separator-background: var(--border);
|
|
@@ -38,6 +39,10 @@
|
|
|
38
39
|
color: var(--cui-timeline-running-foreground);
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
:where([data-control-family="timeline"][data-slot="item"][data-state="waiting"] [data-control-family="timeline"][data-slot="indicator"]) {
|
|
43
|
+
color: var(--cui-timeline-waiting-foreground);
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
:where([data-control-family="timeline"][data-slot="item"][data-state="success"] [data-control-family="timeline"][data-slot="indicator"]) {
|
|
42
47
|
color: var(--cui-timeline-success-foreground);
|
|
43
48
|
}
|
|
@@ -84,6 +89,12 @@
|
|
|
84
89
|
initial-value: transparent;
|
|
85
90
|
}
|
|
86
91
|
|
|
92
|
+
@property --cui-timeline-waiting-foreground {
|
|
93
|
+
syntax: "<color>";
|
|
94
|
+
inherits: true;
|
|
95
|
+
initial-value: transparent;
|
|
96
|
+
}
|
|
97
|
+
|
|
87
98
|
@property --cui-timeline-success-foreground {
|
|
88
99
|
syntax: "<color>";
|
|
89
100
|
inherits: true;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
:where([data-control-family="tool-approval"][data-slot="root"]) {
|
|
3
|
+
--cui-tool-approval-background: var(--card);
|
|
4
|
+
--cui-tool-approval-foreground: var(--card-foreground);
|
|
5
|
+
--cui-tool-approval-border-color: var(--border);
|
|
6
|
+
--cui-tool-approval-border-width: var(--control-rim-width);
|
|
7
|
+
--cui-tool-approval-radius: var(--radius-lg);
|
|
8
|
+
--cui-tool-approval-shadow: var(--shadow-sm);
|
|
9
|
+
--cui-tool-approval-padding: 0px;
|
|
10
|
+
--cui-tool-approval-body-background: transparent;
|
|
11
|
+
--cui-tool-approval-body-border-color: transparent;
|
|
12
|
+
--cui-tool-approval-body-border-width: 0px;
|
|
13
|
+
--cui-tool-approval-body-radius: var(--radius-lg);
|
|
14
|
+
--cui-tool-approval-body-shadow: 0 0 transparent;
|
|
15
|
+
--cui-tool-approval-body-padding: calc(var(--spacing) * 3);
|
|
16
|
+
--cui-tool-approval-body-gap: calc(var(--spacing) * 3);
|
|
17
|
+
--cui-tool-approval-footer-border-color: var(--border);
|
|
18
|
+
--cui-tool-approval-footer-border-width: var(--control-rim-width);
|
|
19
|
+
--cui-tool-approval-footer-padding: calc(var(--spacing) * 2.5);
|
|
20
|
+
--cui-tool-approval-footer-gap: calc(var(--spacing) * 2);
|
|
21
|
+
--cui-tool-approval-preview-background: transparent;
|
|
22
|
+
--cui-tool-approval-preview-border-color: transparent;
|
|
23
|
+
--cui-tool-approval-preview-border-width: 0px;
|
|
24
|
+
--cui-tool-approval-preview-radius: var(--radius-md);
|
|
25
|
+
--cui-tool-approval-preview-padding: 0px;
|
|
26
|
+
--cui-tool-approval-preview-gap: calc(var(--spacing) * 1.5);
|
|
27
|
+
--cui-tool-approval-label-foreground: var(--muted-foreground);
|
|
28
|
+
--cui-tool-approval-description-foreground: var(--muted-foreground);
|
|
29
|
+
--cui-tool-approval-status-foreground: var(--muted-foreground);
|
|
30
|
+
display: grid;
|
|
31
|
+
padding: var(--cui-tool-approval-padding);
|
|
32
|
+
border-radius: var(--cui-tool-approval-radius);
|
|
33
|
+
background: var(--cui-tool-approval-background);
|
|
34
|
+
color: var(--cui-tool-approval-foreground);
|
|
35
|
+
box-shadow:
|
|
36
|
+
inset 0 0 0 var(--cui-tool-approval-border-width) var(--cui-tool-approval-border-color),
|
|
37
|
+
var(--cui-tool-approval-shadow);
|
|
38
|
+
font-size: var(--text-body);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:where([data-control-family="tool-approval"][data-slot="body"]) {
|
|
42
|
+
display: grid;
|
|
43
|
+
gap: var(--cui-tool-approval-body-gap);
|
|
44
|
+
padding: var(--cui-tool-approval-body-padding);
|
|
45
|
+
border-radius: var(--cui-tool-approval-body-radius);
|
|
46
|
+
background: var(--cui-tool-approval-body-background);
|
|
47
|
+
box-shadow:
|
|
48
|
+
inset 0 0 0 var(--cui-tool-approval-body-border-width) var(--cui-tool-approval-body-border-color),
|
|
49
|
+
var(--cui-tool-approval-body-shadow);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where([data-control-family="tool-approval"][data-slot="footer"]) {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: flex-end;
|
|
56
|
+
gap: var(--cui-tool-approval-footer-gap);
|
|
57
|
+
padding: var(--cui-tool-approval-footer-padding);
|
|
58
|
+
border-block-start: var(--cui-tool-approval-footer-border-width) solid var(--cui-tool-approval-footer-border-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where([data-control-family="tool-approval"][data-slot="preview"]) {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
64
|
+
column-gap: calc(var(--spacing) * 4);
|
|
65
|
+
row-gap: var(--cui-tool-approval-preview-gap);
|
|
66
|
+
padding: var(--cui-tool-approval-preview-padding);
|
|
67
|
+
border-radius: var(--cui-tool-approval-preview-radius);
|
|
68
|
+
background: var(--cui-tool-approval-preview-background);
|
|
69
|
+
box-shadow: inset 0 0 0 var(--cui-tool-approval-preview-border-width) var(--cui-tool-approval-preview-border-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where([data-control-family="tool-approval"][data-slot="field"]) {
|
|
73
|
+
display: contents;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where([data-control-family="tool-approval"][data-slot="field-label"]) {
|
|
77
|
+
color: var(--cui-tool-approval-label-foreground);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where([data-control-family="tool-approval"][data-slot="description"]) {
|
|
81
|
+
color: var(--cui-tool-approval-description-foreground);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-control-family="tool-approval"][data-slot="status"]) {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--spacing);
|
|
88
|
+
color: var(--cui-tool-approval-status-foreground);
|
|
89
|
+
transition-property: opacity;
|
|
90
|
+
transition-duration: var(--duration-base);
|
|
91
|
+
transition-timing-function: var(--ease-emphasized);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@starting-style {
|
|
95
|
+
:where([data-control-family="tool-approval"][data-slot="status"]) {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:where([data-control-family="tool-approval"][data-slot="root"][data-state="approved"] [data-slot="status-icon"]) {
|
|
101
|
+
color: var(--success-text);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:where([data-control-family="tool-approval"][data-slot="root"][data-state="denied"] [data-slot="status-icon"]) {
|
|
105
|
+
color: var(--destructive-text);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@property --cui-tool-approval-background {
|
|
110
|
+
syntax: "<color>";
|
|
111
|
+
inherits: true;
|
|
112
|
+
initial-value: transparent;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@property --cui-tool-approval-foreground {
|
|
116
|
+
syntax: "<color>";
|
|
117
|
+
inherits: true;
|
|
118
|
+
initial-value: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@property --cui-tool-approval-border-color {
|
|
122
|
+
syntax: "<color>";
|
|
123
|
+
inherits: true;
|
|
124
|
+
initial-value: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@property --cui-tool-approval-border-width {
|
|
128
|
+
syntax: "<length>";
|
|
129
|
+
inherits: true;
|
|
130
|
+
initial-value: 0px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@property --cui-tool-approval-radius {
|
|
134
|
+
syntax: "<length-percentage>";
|
|
135
|
+
inherits: true;
|
|
136
|
+
initial-value: 0px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@property --cui-tool-approval-shadow {
|
|
140
|
+
syntax: "*";
|
|
141
|
+
inherits: true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@property --cui-tool-approval-padding {
|
|
145
|
+
syntax: "<length-percentage>";
|
|
146
|
+
inherits: true;
|
|
147
|
+
initial-value: 0px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@property --cui-tool-approval-body-background {
|
|
151
|
+
syntax: "<color>";
|
|
152
|
+
inherits: true;
|
|
153
|
+
initial-value: transparent;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@property --cui-tool-approval-body-border-color {
|
|
157
|
+
syntax: "<color>";
|
|
158
|
+
inherits: true;
|
|
159
|
+
initial-value: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@property --cui-tool-approval-body-border-width {
|
|
163
|
+
syntax: "<length>";
|
|
164
|
+
inherits: true;
|
|
165
|
+
initial-value: 0px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@property --cui-tool-approval-body-radius {
|
|
169
|
+
syntax: "<length-percentage>";
|
|
170
|
+
inherits: true;
|
|
171
|
+
initial-value: 0px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@property --cui-tool-approval-body-shadow {
|
|
175
|
+
syntax: "*";
|
|
176
|
+
inherits: true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@property --cui-tool-approval-body-padding {
|
|
180
|
+
syntax: "<length-percentage>";
|
|
181
|
+
inherits: true;
|
|
182
|
+
initial-value: 0px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@property --cui-tool-approval-body-gap {
|
|
186
|
+
syntax: "<length-percentage>";
|
|
187
|
+
inherits: true;
|
|
188
|
+
initial-value: 0px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@property --cui-tool-approval-footer-border-color {
|
|
192
|
+
syntax: "<color>";
|
|
193
|
+
inherits: true;
|
|
194
|
+
initial-value: transparent;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@property --cui-tool-approval-footer-border-width {
|
|
198
|
+
syntax: "<length>";
|
|
199
|
+
inherits: true;
|
|
200
|
+
initial-value: 0px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@property --cui-tool-approval-footer-padding {
|
|
204
|
+
syntax: "<length-percentage>";
|
|
205
|
+
inherits: true;
|
|
206
|
+
initial-value: 0px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@property --cui-tool-approval-footer-gap {
|
|
210
|
+
syntax: "<length-percentage>";
|
|
211
|
+
inherits: true;
|
|
212
|
+
initial-value: 0px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@property --cui-tool-approval-preview-background {
|
|
216
|
+
syntax: "<color>";
|
|
217
|
+
inherits: true;
|
|
218
|
+
initial-value: transparent;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@property --cui-tool-approval-preview-border-color {
|
|
222
|
+
syntax: "<color>";
|
|
223
|
+
inherits: true;
|
|
224
|
+
initial-value: transparent;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@property --cui-tool-approval-preview-border-width {
|
|
228
|
+
syntax: "<length>";
|
|
229
|
+
inherits: true;
|
|
230
|
+
initial-value: 0px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@property --cui-tool-approval-preview-radius {
|
|
234
|
+
syntax: "<length-percentage>";
|
|
235
|
+
inherits: true;
|
|
236
|
+
initial-value: 0px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@property --cui-tool-approval-preview-padding {
|
|
240
|
+
syntax: "<length-percentage>";
|
|
241
|
+
inherits: true;
|
|
242
|
+
initial-value: 0px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@property --cui-tool-approval-preview-gap {
|
|
246
|
+
syntax: "<length-percentage>";
|
|
247
|
+
inherits: true;
|
|
248
|
+
initial-value: 0px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@property --cui-tool-approval-label-foreground {
|
|
252
|
+
syntax: "<color>";
|
|
253
|
+
inherits: true;
|
|
254
|
+
initial-value: transparent;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@property --cui-tool-approval-description-foreground {
|
|
258
|
+
syntax: "<color>";
|
|
259
|
+
inherits: true;
|
|
260
|
+
initial-value: transparent;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@property --cui-tool-approval-status-foreground {
|
|
264
|
+
syntax: "<color>";
|
|
265
|
+
inherits: true;
|
|
266
|
+
initial-value: transparent;
|
|
267
|
+
}
|
|
@@ -62,8 +62,7 @@
|
|
|
62
62
|
[data-control-family="checkbox-group"]
|
|
63
63
|
)
|
|
64
64
|
> [data-control-family="track-highlight"]
|
|
65
|
-
)
|
|
66
|
-
:where([data-track]:has(> [data-control-family="button"][data-track-item]) > [data-control-family="track-highlight"]) {
|
|
65
|
+
) {
|
|
67
66
|
--cui-track-highlight-radius: var(--radius-control);
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -73,13 +72,17 @@
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
@media (hover: hover) {
|
|
76
|
-
:where(
|
|
75
|
+
:where(
|
|
76
|
+
[data-control-family="button-group"][data-track="hover"]:has(
|
|
77
|
+
> :nth-child(1 of :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])):hover
|
|
78
|
+
)
|
|
79
|
+
) {
|
|
77
80
|
--_button-group-leading-cap: 1;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
:where(
|
|
81
84
|
[data-control-family="button-group"][data-track="hover"]:has(
|
|
82
|
-
> :nth-last-child(1 of :not([data-control-family="track-highlight"])):hover
|
|
85
|
+
> :nth-last-child(1 of :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])):hover
|
|
83
86
|
)
|
|
84
87
|
) {
|
|
85
88
|
--_button-group-trailing-cap: 1;
|
|
@@ -91,13 +94,23 @@
|
|
|
91
94
|
--_button-group-trailing-cap: 0;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
:where(
|
|
97
|
+
:where(
|
|
98
|
+
[data-control-family="button-group"][data-track="hover"]:has(
|
|
99
|
+
> :nth-child(1 of :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])):is(
|
|
100
|
+
:focus-visible,
|
|
101
|
+
:has(:focus-visible)
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
) {
|
|
95
105
|
--_button-group-leading-cap: 1;
|
|
96
106
|
}
|
|
97
107
|
|
|
98
108
|
:where(
|
|
99
109
|
[data-control-family="button-group"][data-track="hover"]:has(
|
|
100
|
-
> :nth-last-child(1 of :not([data-control-family="track-highlight"]
|
|
110
|
+
> :nth-last-child(1 of :not([data-control-family="track-highlight"], [data-base-ui-focus-guard], span[aria-owns])):is(
|
|
111
|
+
:focus-visible,
|
|
112
|
+
:has(:focus-visible)
|
|
113
|
+
)
|
|
101
114
|
)
|
|
102
115
|
) {
|
|
103
116
|
--_button-group-trailing-cap: 1;
|
package/dist/styles/theme.css
CHANGED
|
@@ -685,8 +685,8 @@
|
|
|
685
685
|
}
|
|
686
686
|
|
|
687
687
|
@layer components {
|
|
688
|
-
:where([data-control-family]):focus-visible,
|
|
689
|
-
:where([data-control-family][data-control="true"]):has(:focus-visible),
|
|
688
|
+
:where([data-control-family]:not([data-focus-ring="none"])):focus-visible,
|
|
689
|
+
:where([data-control-family][data-control="true"]:not([data-focus-ring="none"])):has(:focus-visible),
|
|
690
690
|
:where([data-control-family][data-focus-ring="within"]):has(:focus-visible) {
|
|
691
691
|
outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring);
|
|
692
692
|
outline-offset: var(--focus-ring-offset);
|
|
@@ -694,7 +694,8 @@
|
|
|
694
694
|
|
|
695
695
|
:where(
|
|
696
696
|
[data-control-family][data-control="true"] [data-control-family],
|
|
697
|
-
[data-control-family][data-focus-ring="within"] [data-control-family]
|
|
697
|
+
[data-control-family][data-focus-ring="within"] [data-control-family],
|
|
698
|
+
[data-control-family][data-focus-ring="none"] [data-control-family]
|
|
698
699
|
):focus-visible {
|
|
699
700
|
outline-width: 0;
|
|
700
701
|
}
|
|
@@ -704,8 +705,8 @@
|
|
|
704
705
|
}
|
|
705
706
|
|
|
706
707
|
@media (forced-colors: active) {
|
|
707
|
-
:where([data-control-family]):focus-visible,
|
|
708
|
-
:where([data-control-family][data-control="true"]):has(:focus-visible),
|
|
708
|
+
:where([data-control-family]:not([data-focus-ring="none"])):focus-visible,
|
|
709
|
+
:where([data-control-family][data-control="true"]:not([data-focus-ring="none"])):has(:focus-visible),
|
|
709
710
|
:where([data-control-family][data-focus-ring="within"]):has(:focus-visible) {
|
|
710
711
|
outline-color: Highlight;
|
|
711
712
|
}
|
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
/*
|
|
67
67
|
* History: fixed 3 competing type systems (Tailwind defaults + named rungs + raw text-[Npx]) into one rung/role; 14px = body.
|
|
68
|
-
* Usage:
|
|
68
|
+
* Usage: React text goes through <Text>/<Heading> (ui/typography): size, tone and weight are props, className stays layout-only.
|
|
69
|
+
* A bare rung is for HTML React doesn't render as components (email HTML, injected markdown); MDX maps its tags to <Heading>/<Text>.
|
|
69
70
|
* Heading LEVEL is the document outline; the RUNG is the look. They are decoupled on purpose: an <h3> may wear text-heading-2.
|
|
70
71
|
* Control chrome text is sized by its recipe (`--cui-button-font-size`, `--cui-field-font-size`), not by these utilities.
|
|
71
72
|
*/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RenderProp } from "./control-props.js";
|
|
2
|
+
import { Button } from "./ui/button.js";
|
|
3
|
+
import { ToolApprovalKnobStyle } from "./knob-contracts/tool-approval-knobs.js";
|
|
4
|
+
import { Badge } from "./ui/badge.js";
|
|
5
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
6
|
+
//#region src/tool-approval.d.ts
|
|
7
|
+
export type ToolApprovalState = "pending" | "approved" | "denied";
|
|
8
|
+
export type ToolApprovalRiskLevel = "low" | "medium" | "high";
|
|
9
|
+
type ToolApprovalStyleProps<Props> = Omit<Props, "style"> & {
|
|
10
|
+
style?: CSSProperties & ToolApprovalKnobStyle;
|
|
11
|
+
};
|
|
12
|
+
export type ToolApprovalProps = ToolApprovalStyleProps<ComponentProps<"section">> & {
|
|
13
|
+
state?: ToolApprovalState;
|
|
14
|
+
risk?: ToolApprovalRiskLevel;
|
|
15
|
+
onApprove?: () => void;
|
|
16
|
+
onDeny?: () => void;
|
|
17
|
+
autoFocus?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function ToolApproval({ state, risk, onApprove, onDeny, autoFocus, className, children, onKeyDown, ...props }: ToolApprovalProps): import("react").JSX.Element;
|
|
20
|
+
export type ToolApprovalBodyProps = ToolApprovalStyleProps<ComponentProps<"div">>;
|
|
21
|
+
export declare function ToolApprovalBody({ className, ...props }: ToolApprovalBodyProps): import("react").JSX.Element;
|
|
22
|
+
export type ToolApprovalHeaderProps = ToolApprovalStyleProps<ComponentProps<"div">>;
|
|
23
|
+
export declare function ToolApprovalHeader({ className, ...props }: ToolApprovalHeaderProps): import("react").JSX.Element;
|
|
24
|
+
export type ToolApprovalIconProps = ToolApprovalStyleProps<ComponentProps<"span">>;
|
|
25
|
+
export declare function ToolApprovalIcon({ className, children, ...props }: ToolApprovalIconProps): import("react").JSX.Element;
|
|
26
|
+
export type ToolApprovalTitleProps = ToolApprovalStyleProps<ComponentProps<"div">> & {
|
|
27
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
28
|
+
};
|
|
29
|
+
export declare function ToolApprovalTitle({ render, className, ...props }: ToolApprovalTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
30
|
+
export type ToolApprovalRiskProps = Omit<ComponentProps<typeof Badge>, "color">;
|
|
31
|
+
export declare function ToolApprovalRisk({ children, ...props }: ToolApprovalRiskProps): import("react").JSX.Element | null;
|
|
32
|
+
export type ToolApprovalStatusProps = ToolApprovalStyleProps<ComponentProps<"div">>;
|
|
33
|
+
export declare function ToolApprovalStatus({ className, children, ...props }: ToolApprovalStatusProps): import("react").JSX.Element | null;
|
|
34
|
+
export type ToolApprovalDescriptionProps = ToolApprovalStyleProps<ComponentProps<"p">>;
|
|
35
|
+
export declare function ToolApprovalDescription({ className, ...props }: ToolApprovalDescriptionProps): import("react").JSX.Element | null;
|
|
36
|
+
export type ToolApprovalPreviewProps = ToolApprovalStyleProps<ComponentProps<"dl">>;
|
|
37
|
+
export declare function ToolApprovalPreview({ className, ...props }: ToolApprovalPreviewProps): import("react").JSX.Element | null;
|
|
38
|
+
export type ToolApprovalFieldProps = Omit<ToolApprovalStyleProps<ComponentProps<"div">>, "children"> & {
|
|
39
|
+
label: ReactNode;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
export declare function ToolApprovalField({ label, children, className, ...props }: ToolApprovalFieldProps): import("react").JSX.Element;
|
|
43
|
+
export type ToolApprovalFooterProps = ToolApprovalStyleProps<ComponentProps<"div">>;
|
|
44
|
+
export declare function ToolApprovalFooter({ className, ...props }: ToolApprovalFooterProps): import("react").JSX.Element | null;
|
|
45
|
+
export type ToolApprovalDenyProps = ComponentProps<typeof Button>;
|
|
46
|
+
export declare function ToolApprovalDeny({ children, onClick, ...props }: ToolApprovalDenyProps): import("react").JSX.Element;
|
|
47
|
+
export type ToolApprovalApproveProps = ComponentProps<typeof Button>;
|
|
48
|
+
export declare function ToolApprovalApprove({ children, onClick, ...props }: ToolApprovalApproveProps): import("react").JSX.Element;
|
|
49
|
+
//#endregion
|