@diegopluna/narvi 0.3.11 → 0.3.13
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/dist/components/activity/ActivityContent.svelte +7 -3
- package/dist/components/activity/ActivityStep.svelte +9 -6
- package/dist/components/activity/ActivityTrigger.svelte +5 -2
- package/dist/components/app-shell/AppShellBar.svelte +9 -4
- package/dist/components/app-shell/AppShellHeader.svelte +9 -5
- package/dist/components/approval/Approval.svelte +7 -4
- package/dist/components/button/Button.svelte +50 -26
- package/dist/components/card/Card.svelte +5 -2
- package/dist/components/changes-summary/ChangesSummary.svelte +11 -8
- package/dist/components/choice-cards/ChoiceCards.svelte +5 -2
- package/dist/components/collapsible/CollapsibleTrigger.svelte +5 -2
- package/dist/components/color-field/ColorField.svelte +9 -6
- package/dist/components/command/styles.d.ts +8 -8
- package/dist/components/command/styles.js +11 -9
- package/dist/components/composer/ComposerAttachment.svelte +7 -3
- package/dist/components/composer/ComposerAttachments.svelte +5 -1
- package/dist/components/composer/ComposerModelPicker.svelte +37 -34
- package/dist/components/composer/ComposerRoot.svelte +9 -5
- package/dist/components/composer/ComposerTextarea.svelte +9 -5
- package/dist/components/composer/ComposerToggle.svelte +7 -4
- package/dist/components/composer/ComposerToolbar.svelte +5 -1
- package/dist/components/composer/ComposerTray.svelte +10 -7
- package/dist/components/conversation/ConversationScrollButton.svelte +10 -7
- package/dist/components/dialog/ConfirmDialog.svelte +5 -2
- package/dist/components/dialog/styles.d.ts +3 -3
- package/dist/components/dialog/styles.js +6 -4
- package/dist/components/frame/Frame.svelte +8 -5
- package/dist/components/hover-card/HoverCardContent.svelte +5 -1
- package/dist/components/input/Input.svelte +12 -8
- package/dist/components/kbd/Kbd.svelte +2 -0
- package/dist/components/message/MessageActions.svelte +8 -4
- package/dist/components/message/MessageContent.svelte +6 -2
- package/dist/components/message/MessagePending.svelte +5 -2
- package/dist/components/message/MessageRoot.svelte +10 -4
- package/dist/components/message/MessageTime.svelte +5 -2
- package/dist/components/message/styles.d.ts +2 -2
- package/dist/components/message/styles.js +5 -3
- package/dist/components/notice/Notice.svelte +13 -4
- package/dist/components/plan/Plan.svelte +13 -10
- package/dist/components/popover/PopoverContent.svelte +8 -1
- package/dist/components/questionnaire/Questionnaire.svelte +12 -9
- package/dist/components/queued-message/QueuedMessage.svelte +14 -7
- package/dist/components/rail/RailItem.svelte +16 -7
- package/dist/components/rail/RailRoot.svelte +9 -4
- package/dist/components/rail/RailSeparator.svelte +5 -2
- package/dist/components/reasoning/ReasoningContent.svelte +6 -3
- package/dist/components/reasoning/ReasoningTrigger.svelte +5 -2
- package/dist/components/search-button/SearchButton.svelte +6 -3
- package/dist/components/segmented/SegmentedControl.svelte +6 -3
- package/dist/components/settings-group/SettingsGroup.svelte +5 -2
- package/dist/components/sidebar/SidebarContent.svelte +8 -4
- package/dist/components/sidebar/SidebarFolder.svelte +8 -5
- package/dist/components/sidebar/SidebarFooter.svelte +5 -2
- package/dist/components/sidebar/SidebarGroup.svelte +11 -8
- package/dist/components/sidebar/SidebarHeader.svelte +9 -4
- package/dist/components/sidebar/SidebarItem.svelte +14 -9
- package/dist/components/split-button/SplitButton.svelte +5 -2
- package/dist/components/suggestions/SuggestionsItem.svelte +6 -3
- package/dist/components/suggestions/SuggestionsRoot.svelte +5 -1
- package/dist/components/tab-strip/TabStrip.svelte +21 -16
- package/dist/components/tabs/Tabs.svelte +7 -4
- package/dist/components/textarea/Textarea.svelte +6 -2
- package/dist/components/theme/Theme.svelte +28 -2
- package/dist/components/toast/Toaster.svelte +14 -5
- package/dist/components/toggle-group/ToggleGroupRoot.svelte +5 -1
- package/dist/components/tool/ToolContent.svelte +8 -4
- package/dist/components/tool/ToolSection.svelte +7 -4
- package/dist/components/tool/ToolTrigger.svelte +5 -2
- package/dist/components/tooltip/TooltipContent.svelte +7 -4
- package/dist/components/work-fold/WorkFold.svelte +9 -6
- package/dist/internal/Code.svelte +6 -3
- package/dist/internal/control.d.ts +6 -6
- package/dist/internal/control.js +9 -7
- package/dist/internal/layer.d.ts +10 -10
- package/dist/internal/layer.js +14 -12
- package/dist/internal/toggle.d.ts +8 -8
- package/dist/internal/toggle.js +22 -10
- package/dist/preset.d.ts +12 -3
- package/dist/preset.js +18 -4
- package/dist/tokens.stylex.d.ts +13 -3
- package/dist/tokens.stylex.js +25 -14
- package/package.json +1 -1
- package/skills/building-ui/SKILL.md +1 -1
- package/skills/building-ui/references/components.md +1 -1
- package/skills/markdown/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/styling/SKILL.md +5 -2
- package/skills/theming/SKILL.md +44 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as stylex from '@stylexjs/stylex';
|
|
2
|
-
import { colors, font, radius, space } from '../../tokens.stylex.js';
|
|
2
|
+
import { colors, density, font, radius, space } from '../../tokens.stylex.js';
|
|
3
3
|
import { media } from '../../media.stylex.js';
|
|
4
4
|
const SELECTED = ':is([data-selected])';
|
|
5
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
6
|
+
const d = (rem) => `calc(${rem} * ${density.factor})`;
|
|
5
7
|
export const command = stylex.create({
|
|
6
8
|
root: {
|
|
7
9
|
display: 'flex',
|
|
@@ -25,7 +27,7 @@ export const command = stylex.create({
|
|
|
25
27
|
input: {
|
|
26
28
|
flexGrow: 1,
|
|
27
29
|
minWidth: 0,
|
|
28
|
-
height: '3rem',
|
|
30
|
+
height: d('3rem'),
|
|
29
31
|
margin: 0,
|
|
30
32
|
padding: 0,
|
|
31
33
|
borderWidth: 0,
|
|
@@ -40,15 +42,15 @@ export const command = stylex.create({
|
|
|
40
42
|
maxHeight: 'min(24rem, 60dvh)',
|
|
41
43
|
overflowY: 'auto',
|
|
42
44
|
overscrollBehavior: 'contain',
|
|
43
|
-
padding: '0.375rem',
|
|
44
|
-
scrollPaddingBlock: '0.375rem'
|
|
45
|
+
padding: d('0.375rem'),
|
|
46
|
+
scrollPaddingBlock: d('0.375rem')
|
|
45
47
|
},
|
|
46
48
|
item: {
|
|
47
49
|
display: 'flex',
|
|
48
50
|
alignItems: 'center',
|
|
49
51
|
gap: '0.625rem',
|
|
50
|
-
minHeight: '2.375rem',
|
|
51
|
-
paddingInline: '0.625rem',
|
|
52
|
+
minHeight: d('2.375rem'),
|
|
53
|
+
paddingInline: d('0.625rem'),
|
|
52
54
|
borderRadius: radius.control,
|
|
53
55
|
color: colors.text,
|
|
54
56
|
cursor: 'default',
|
|
@@ -74,7 +76,7 @@ export const command = stylex.create({
|
|
|
74
76
|
alignItems: 'center',
|
|
75
77
|
gap: '0.125rem',
|
|
76
78
|
flexShrink: 0,
|
|
77
|
-
marginInlineEnd: '-0.5rem'
|
|
79
|
+
marginInlineEnd: d('-0.5rem')
|
|
78
80
|
},
|
|
79
81
|
badge: {
|
|
80
82
|
'--narvi-icon-size': '0.875rem',
|
|
@@ -91,7 +93,7 @@ export const command = stylex.create({
|
|
|
91
93
|
alignItems: 'center',
|
|
92
94
|
gap: space.x2,
|
|
93
95
|
minWidth: 0,
|
|
94
|
-
paddingBlock: '0.375rem'
|
|
96
|
+
paddingBlock: d('0.375rem')
|
|
95
97
|
},
|
|
96
98
|
wrapLabel: {
|
|
97
99
|
minWidth: 0,
|
|
@@ -128,7 +130,7 @@ export const command = stylex.create({
|
|
|
128
130
|
alignItems: 'center',
|
|
129
131
|
gap: space.x4,
|
|
130
132
|
flexShrink: 0,
|
|
131
|
-
minHeight: '2.5rem',
|
|
133
|
+
minHeight: d('2.5rem'),
|
|
132
134
|
paddingInline: space.x4,
|
|
133
135
|
borderTopWidth: '1px',
|
|
134
136
|
borderTopStyle: 'solid',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Glyph from '../../internal/Glyph.svelte';
|
|
5
5
|
import { shared } from '../../internal/shared.js';
|
|
6
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors, font, motion, radius } from '../../tokens.stylex.js';
|
|
7
|
+
import { colors, density, font, motion, radius } from '../../tokens.stylex.js';
|
|
8
8
|
import { media } from '../../media.stylex.js';
|
|
9
9
|
import { useComposer } from './context.js';
|
|
10
10
|
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
return `${(bytes / 1_000_000).toFixed(1)} MB`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
26
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
27
|
+
|
|
25
28
|
const styles = stylex.create({
|
|
26
29
|
// A chip: the thumbnail's radius plus the padding, so the corners sit concentric
|
|
27
30
|
chip: {
|
|
@@ -31,8 +34,9 @@
|
|
|
31
34
|
alignItems: 'center',
|
|
32
35
|
gap: '0.5rem',
|
|
33
36
|
maxWidth: '13.75rem',
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
// The thumbnail, which keeps its size, and the padding around it
|
|
38
|
+
height: `calc(2rem + ${d('0.75rem')})`,
|
|
39
|
+
padding: d('0.375rem'),
|
|
36
40
|
// Clear of the remove button on the corner
|
|
37
41
|
paddingInlineEnd: '1rem',
|
|
38
42
|
borderRadius: radius.card,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import * as stylex from '@stylexjs/stylex';
|
|
3
|
+
import { density } from '../../tokens.stylex.js';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
@@ -14,11 +15,14 @@
|
|
|
14
15
|
children?: Snippet<[File]> | undefined;
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
19
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
20
|
+
|
|
17
21
|
const styles = stylex.create({
|
|
18
22
|
list: {
|
|
19
23
|
display: 'flex',
|
|
20
24
|
flexWrap: 'wrap',
|
|
21
|
-
gap: '0.5rem',
|
|
25
|
+
gap: d('0.5rem'),
|
|
22
26
|
margin: 0,
|
|
23
27
|
// Room above for the remove buttons, which sit on the chips' corners
|
|
24
28
|
paddingTop: '0.375rem',
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { visuallyHidden } from '../../visually-hidden.js';
|
|
9
9
|
import { shared } from '../../internal/shared.js';
|
|
10
10
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
11
|
-
import { colors, font, motion, radius } from '../../tokens.stylex.js';
|
|
11
|
+
import { colors, density, font, motion, radius } from '../../tokens.stylex.js';
|
|
12
12
|
import { media } from '../../media.stylex.js';
|
|
13
13
|
import { getComposerContext } from './context.js';
|
|
14
14
|
|
|
@@ -118,6 +118,9 @@
|
|
|
118
118
|
const GAP = 6;
|
|
119
119
|
const MARGIN = 8;
|
|
120
120
|
|
|
121
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
122
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
123
|
+
|
|
121
124
|
const styles = stylex.create({
|
|
122
125
|
trigger: {
|
|
123
126
|
display: 'inline-flex',
|
|
@@ -125,10 +128,10 @@
|
|
|
125
128
|
flexShrink: 1,
|
|
126
129
|
gap: '0.25rem',
|
|
127
130
|
minWidth: 0,
|
|
128
|
-
height: '1.75rem',
|
|
131
|
+
height: d('1.75rem'),
|
|
129
132
|
margin: 0,
|
|
130
|
-
paddingInlineStart: '0.625rem',
|
|
131
|
-
paddingInlineEnd: '0.375rem',
|
|
133
|
+
paddingInlineStart: d('0.625rem'),
|
|
134
|
+
paddingInlineEnd: d('0.375rem'),
|
|
132
135
|
borderWidth: 0,
|
|
133
136
|
borderRadius: `calc(${radius.card} * 4 / 3)`,
|
|
134
137
|
backgroundColor: {
|
|
@@ -173,11 +176,11 @@
|
|
|
173
176
|
maxWidth: 'min(320px, calc(100vw - 16px))',
|
|
174
177
|
maxHeight: 'min(360px, var(--narvi-picker-room, 360px))',
|
|
175
178
|
margin: 0,
|
|
176
|
-
padding: '0.25rem',
|
|
179
|
+
padding: d('0.25rem'),
|
|
177
180
|
overflowY: 'auto',
|
|
178
181
|
overscrollBehavior: 'contain',
|
|
179
182
|
borderWidth: 0,
|
|
180
|
-
// Inner items are 8px round with 4px of padding: 12px outside
|
|
183
|
+
// Inner items are 8px round with 4px of padding: 12px outside, at the default density
|
|
181
184
|
borderRadius: radius.card,
|
|
182
185
|
backgroundColor: colors.bgRaised,
|
|
183
186
|
boxShadow: `inset 0 0 0 1px ${colors.borderStrong}, 0 16px 40px -12px ${colors.shadow}`,
|
|
@@ -205,7 +208,7 @@
|
|
|
205
208
|
list: {
|
|
206
209
|
display: 'flex',
|
|
207
210
|
flexDirection: 'column',
|
|
208
|
-
gap: '
|
|
211
|
+
gap: d('0.125rem'),
|
|
209
212
|
outlineStyle: 'none'
|
|
210
213
|
},
|
|
211
214
|
// The rail, then a hairline, then the list. The rail stays put as the list scrolls.
|
|
@@ -216,22 +219,22 @@
|
|
|
216
219
|
top: 0,
|
|
217
220
|
display: 'flex',
|
|
218
221
|
flexDirection: 'column',
|
|
219
|
-
gap: '
|
|
222
|
+
gap: d('0.125rem'),
|
|
220
223
|
flexShrink: 0
|
|
221
224
|
},
|
|
222
225
|
divider: {
|
|
223
226
|
alignSelf: 'stretch',
|
|
224
227
|
flexShrink: 0,
|
|
225
228
|
width: '1px',
|
|
226
|
-
marginInline: '0.25rem',
|
|
229
|
+
marginInline: d('0.25rem'),
|
|
227
230
|
backgroundColor: colors.border
|
|
228
231
|
},
|
|
229
232
|
provider: {
|
|
230
233
|
'--narvi-icon-size': '1rem',
|
|
231
234
|
display: 'grid',
|
|
232
235
|
placeItems: 'center',
|
|
233
|
-
width: '2rem',
|
|
234
|
-
height: '2rem',
|
|
236
|
+
width: d('2rem'),
|
|
237
|
+
height: d('2rem'),
|
|
235
238
|
margin: 0,
|
|
236
239
|
padding: 0,
|
|
237
240
|
borderWidth: 0,
|
|
@@ -262,13 +265,13 @@
|
|
|
262
265
|
group: {
|
|
263
266
|
display: 'flex',
|
|
264
267
|
flexDirection: 'column',
|
|
265
|
-
gap: '
|
|
266
|
-
paddingTop: '0.25rem'
|
|
268
|
+
gap: d('0.125rem'),
|
|
269
|
+
paddingTop: d('0.25rem')
|
|
267
270
|
},
|
|
268
271
|
groupLabel: {
|
|
269
|
-
paddingTop: '0.375rem',
|
|
270
|
-
paddingBottom: '0.25rem',
|
|
271
|
-
paddingInline: '0.625rem',
|
|
272
|
+
paddingTop: d('0.375rem'),
|
|
273
|
+
paddingBottom: d('0.25rem'),
|
|
274
|
+
paddingInline: d('0.625rem'),
|
|
272
275
|
color: colors.textSubtle,
|
|
273
276
|
fontSize: font.sizeCaption,
|
|
274
277
|
fontWeight: font.weightMedium,
|
|
@@ -279,9 +282,9 @@
|
|
|
279
282
|
gridTemplateColumns: 'minmax(0, 1fr) 16px',
|
|
280
283
|
alignItems: 'center',
|
|
281
284
|
columnGap: '0.75rem',
|
|
282
|
-
minHeight: '2.25rem',
|
|
283
|
-
paddingBlock: '0.4375rem',
|
|
284
|
-
paddingInline: '0.625rem',
|
|
285
|
+
minHeight: d('2.25rem'),
|
|
286
|
+
paddingBlock: d('0.4375rem'),
|
|
287
|
+
paddingInline: d('0.625rem'),
|
|
285
288
|
borderRadius: radius.control,
|
|
286
289
|
cursor: 'pointer',
|
|
287
290
|
userSelect: 'none',
|
|
@@ -371,16 +374,16 @@
|
|
|
371
374
|
search: {
|
|
372
375
|
'--narvi-icon-size': '0.875rem',
|
|
373
376
|
position: 'sticky',
|
|
374
|
-
top: '-0.25rem',
|
|
377
|
+
top: d('-0.25rem'),
|
|
375
378
|
zIndex: 1,
|
|
376
379
|
display: 'flex',
|
|
377
380
|
alignItems: 'center',
|
|
378
381
|
gap: '0.5rem',
|
|
379
|
-
marginTop: '-0.25rem',
|
|
380
|
-
marginBottom: '0.25rem',
|
|
381
|
-
paddingTop: '0.25rem',
|
|
382
|
-
paddingInline: '0.625rem',
|
|
383
|
-
minHeight: '2.25rem',
|
|
382
|
+
marginTop: d('-0.25rem'),
|
|
383
|
+
marginBottom: d('0.25rem'),
|
|
384
|
+
paddingTop: d('0.25rem'),
|
|
385
|
+
paddingInline: d('0.625rem'),
|
|
386
|
+
minHeight: d('2.25rem'),
|
|
384
387
|
backgroundColor: colors.bgRaised,
|
|
385
388
|
boxShadow: `inset 0 -1px 0 ${colors.border}`,
|
|
386
389
|
color: colors.textSubtle
|
|
@@ -388,7 +391,7 @@
|
|
|
388
391
|
searchField: {
|
|
389
392
|
flexGrow: 1,
|
|
390
393
|
minWidth: 0,
|
|
391
|
-
height: '2rem',
|
|
394
|
+
height: d('2rem'),
|
|
392
395
|
margin: 0,
|
|
393
396
|
padding: 0,
|
|
394
397
|
borderWidth: 0,
|
|
@@ -400,12 +403,12 @@
|
|
|
400
403
|
'::placeholder': { color: colors.textSubtle }
|
|
401
404
|
},
|
|
402
405
|
empty: {
|
|
403
|
-
paddingBlock: '0.75rem',
|
|
404
|
-
paddingInline: '0.625rem',
|
|
406
|
+
paddingBlock: d('0.75rem'),
|
|
407
|
+
paddingInline: d('0.625rem'),
|
|
405
408
|
color: colors.textMuted,
|
|
406
409
|
fontSize: font.sizeMeta
|
|
407
410
|
},
|
|
408
|
-
olderRow: { gridTemplateColumns: 'minmax(0, 1fr) 16px', minHeight: '2rem' },
|
|
411
|
+
olderRow: { gridTemplateColumns: 'minmax(0, 1fr) 16px', minHeight: d('2rem') },
|
|
409
412
|
olderName: { color: colors.textMuted, fontWeight: font.weightRegular },
|
|
410
413
|
olderChevron: {
|
|
411
414
|
gridColumn: '2',
|
|
@@ -419,10 +422,10 @@
|
|
|
419
422
|
// What Shift and ⌘ do, at the foot of the list
|
|
420
423
|
hint: {
|
|
421
424
|
margin: 0,
|
|
422
|
-
marginTop: '0.25rem',
|
|
423
|
-
paddingTop: '0.5rem',
|
|
424
|
-
paddingBottom: '0.25rem',
|
|
425
|
-
paddingInline: '0.625rem',
|
|
425
|
+
marginTop: d('0.25rem'),
|
|
426
|
+
paddingTop: d('0.5rem'),
|
|
427
|
+
paddingBottom: d('0.25rem'),
|
|
428
|
+
paddingInline: d('0.625rem'),
|
|
426
429
|
boxShadow: `inset 0 1px 0 ${colors.border}`,
|
|
427
430
|
color: colors.textSubtle,
|
|
428
431
|
fontSize: font.sizeCaption,
|
|
@@ -431,7 +434,7 @@
|
|
|
431
434
|
railRule: {
|
|
432
435
|
alignSelf: 'stretch',
|
|
433
436
|
height: '1px',
|
|
434
|
-
marginBlock: '0.125rem',
|
|
437
|
+
marginBlock: d('0.125rem'),
|
|
435
438
|
backgroundColor: colors.border
|
|
436
439
|
}
|
|
437
440
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { HTMLFormAttributes } from 'svelte/elements';
|
|
6
6
|
import { shared } from '../../internal/shared.js';
|
|
7
7
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
8
|
-
import { colors, font, motion, radius } from '../../tokens.stylex.js';
|
|
8
|
+
import { colors, density, font, motion, radius } from '../../tokens.stylex.js';
|
|
9
9
|
import { media } from '../../media.stylex.js';
|
|
10
10
|
import {
|
|
11
11
|
accepts,
|
|
@@ -79,19 +79,23 @@
|
|
|
79
79
|
return marked ?? form.querySelector<HTMLElement>(EDITABLE);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
83
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
84
|
+
|
|
82
85
|
const styles = stylex.create({
|
|
83
86
|
root: {
|
|
84
87
|
position: 'relative',
|
|
85
88
|
boxSizing: 'border-box',
|
|
86
89
|
display: 'flex',
|
|
87
90
|
flexDirection: 'column',
|
|
88
|
-
gap: '0.25rem',
|
|
91
|
+
gap: d('0.25rem'),
|
|
89
92
|
minWidth: 0,
|
|
90
93
|
margin: 0,
|
|
91
|
-
padding: '0.5rem',
|
|
94
|
+
padding: d('0.5rem'),
|
|
92
95
|
// The controls' radius plus this padding, so the corners sit concentric.
|
|
93
|
-
// Both follow the radius scale: 1rem and 1.5rem by default.
|
|
94
|
-
|
|
96
|
+
// Both follow the radius scale: 1rem and 1.5rem by default. The padding part follows the
|
|
97
|
+
// density.
|
|
98
|
+
borderRadius: `calc(${radius.card} * 4 / 3 + ${d('0.5rem')})`,
|
|
95
99
|
backgroundColor: colors.bgRaised,
|
|
96
100
|
color: colors.text,
|
|
97
101
|
fontFamily: font.body,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as stylex from '@stylexjs/stylex';
|
|
3
3
|
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
4
4
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
5
|
-
import { colors, font } from '../../tokens.stylex.js';
|
|
5
|
+
import { colors, density, font } from '../../tokens.stylex.js';
|
|
6
6
|
import { useComposer } from './context.js';
|
|
7
7
|
|
|
8
8
|
export type ComposerTextareaProps = Omit<HTMLTextareaAttributes, 'value' | 'children'> & {
|
|
@@ -10,17 +10,21 @@
|
|
|
10
10
|
ref?: HTMLTextAreaElement | null | undefined;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
14
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
15
|
+
|
|
13
16
|
const styles = stylex.create({
|
|
14
17
|
textarea: {
|
|
15
18
|
boxSizing: 'border-box',
|
|
16
19
|
display: 'block',
|
|
17
20
|
width: '100%',
|
|
18
|
-
// One line to start; it grows with what is typed, then scrolls
|
|
19
|
-
|
|
21
|
+
// One line to start; it grows with what is typed, then scrolls. The line keeps its
|
|
22
|
+
// height and the padding follows the density.
|
|
23
|
+
minHeight: `calc(1lh + ${d('0.75rem')})`,
|
|
20
24
|
maxHeight: '14rem',
|
|
21
25
|
margin: 0,
|
|
22
|
-
paddingBlock: '0.375rem',
|
|
23
|
-
paddingInline: '0.5rem',
|
|
26
|
+
paddingBlock: d('0.375rem'),
|
|
27
|
+
paddingInline: d('0.5rem'),
|
|
24
28
|
borderWidth: 0,
|
|
25
29
|
backgroundColor: 'transparent',
|
|
26
30
|
color: colors.text,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
5
5
|
import { shared } from '../../internal/shared.js';
|
|
6
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors, font, motion, radius } from '../../tokens.stylex.js';
|
|
7
|
+
import { colors, density, font, motion, radius } from '../../tokens.stylex.js';
|
|
8
8
|
import { media } from '../../media.stylex.js';
|
|
9
9
|
import { getComposerContext } from './context.js';
|
|
10
10
|
|
|
@@ -19,15 +19,18 @@
|
|
|
19
19
|
children?: Snippet | undefined;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
23
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
24
|
+
|
|
22
25
|
const styles = stylex.create({
|
|
23
26
|
toggle: {
|
|
24
27
|
display: 'inline-flex',
|
|
25
28
|
alignItems: 'center',
|
|
26
29
|
flexShrink: 0,
|
|
27
30
|
gap: '0.375rem',
|
|
28
|
-
height: '1.75rem',
|
|
31
|
+
height: d('1.75rem'),
|
|
29
32
|
margin: 0,
|
|
30
|
-
paddingInline: '0.625rem',
|
|
33
|
+
paddingInline: d('0.625rem'),
|
|
31
34
|
borderWidth: 0,
|
|
32
35
|
borderRadius: `calc(${radius.card} * 4 / 3)`,
|
|
33
36
|
backgroundColor: {
|
|
@@ -58,7 +61,7 @@
|
|
|
58
61
|
}
|
|
59
62
|
},
|
|
60
63
|
// The icon leads, so the pill is a touch tighter on that side
|
|
61
|
-
withIcon: { paddingInlineStart: '0.5rem' },
|
|
64
|
+
withIcon: { paddingInlineStart: d('0.5rem') },
|
|
62
65
|
// On: a fill of the accent, the one colour that marks state
|
|
63
66
|
on: {
|
|
64
67
|
backgroundColor: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import * as stylex from '@stylexjs/stylex';
|
|
3
|
+
import { density } from '../../tokens.stylex.js';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
@@ -10,11 +11,14 @@
|
|
|
10
11
|
children?: Snippet | undefined;
|
|
11
12
|
};
|
|
12
13
|
|
|
14
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
15
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
16
|
+
|
|
13
17
|
const styles = stylex.create({
|
|
14
18
|
toolbar: {
|
|
15
19
|
display: 'flex',
|
|
16
20
|
alignItems: 'center',
|
|
17
|
-
gap: '0.25rem',
|
|
21
|
+
gap: d('0.25rem'),
|
|
18
22
|
minWidth: 0
|
|
19
23
|
}
|
|
20
24
|
});
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { Snippet } from 'svelte';
|
|
13
13
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
14
14
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
15
|
-
import { colors, radius } from '../../tokens.stylex.js';
|
|
15
|
+
import { colors, density, radius } from '../../tokens.stylex.js';
|
|
16
16
|
|
|
17
17
|
export type ComposerTrayProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
18
18
|
/** Names what is waiting, for assistive technology. */
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
children?: Snippet | undefined;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
33
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
34
|
+
|
|
32
35
|
const styles = stylex.create({
|
|
33
36
|
tray: { display: 'flex', flexDirection: 'column', minWidth: 0 },
|
|
34
37
|
// A flat fill whose foot tucks in behind the composer by the composer's own radius, so
|
|
@@ -37,12 +40,12 @@
|
|
|
37
40
|
pending: {
|
|
38
41
|
display: { default: 'none', ':has(> :not(:empty, [hidden], template))': 'flex' },
|
|
39
42
|
flexDirection: 'column',
|
|
40
|
-
gap: '0.375rem',
|
|
41
|
-
padding: '0.375rem',
|
|
42
|
-
paddingBottom: `calc(${radius.card} * 4 / 3 + 0.875rem)`,
|
|
43
|
-
marginBottom: `calc(-1 * (${radius.card} * 4 / 3 + 0.5rem))`,
|
|
44
|
-
borderStartStartRadius: `calc(${radius.card} + 0.375rem)`,
|
|
45
|
-
borderStartEndRadius: `calc(${radius.card} + 0.375rem)`,
|
|
43
|
+
gap: d('0.375rem'),
|
|
44
|
+
padding: d('0.375rem'),
|
|
45
|
+
paddingBottom: `calc(${radius.card} * 4 / 3 + ${d('0.875rem')})`,
|
|
46
|
+
marginBottom: `calc(-1 * (${radius.card} * 4 / 3 + ${d('0.5rem')}))`,
|
|
47
|
+
borderStartStartRadius: `calc(${radius.card} + ${d('0.375rem')})`,
|
|
48
|
+
borderStartEndRadius: `calc(${radius.card} + ${d('0.375rem')})`,
|
|
46
49
|
backgroundColor: colors.fillMuted,
|
|
47
50
|
outlineStyle: 'solid',
|
|
48
51
|
outlineWidth: '1px',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Glyph from '../../internal/Glyph.svelte';
|
|
6
6
|
import { shared } from '../../internal/shared.js';
|
|
7
7
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
8
|
-
import { colors, font, motion, radius } from '../../tokens.stylex.js';
|
|
8
|
+
import { colors, density, font, motion, radius } from '../../tokens.stylex.js';
|
|
9
9
|
import { media } from '../../media.stylex.js';
|
|
10
10
|
import { useConversation } from './context.js';
|
|
11
11
|
|
|
@@ -18,21 +18,24 @@
|
|
|
18
18
|
children?: Snippet | undefined;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
22
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
23
|
+
|
|
21
24
|
const styles = stylex.create({
|
|
22
25
|
button: {
|
|
23
26
|
position: 'absolute',
|
|
24
27
|
insetInline: 0,
|
|
25
|
-
bottom: '1rem',
|
|
28
|
+
bottom: d('1rem'),
|
|
26
29
|
zIndex: 1,
|
|
27
30
|
display: 'inline-flex',
|
|
28
31
|
alignItems: 'center',
|
|
29
32
|
justifyContent: 'center',
|
|
30
33
|
gap: '0.375rem',
|
|
31
34
|
width: 'fit-content',
|
|
32
|
-
height: '2rem',
|
|
33
|
-
minWidth: '2rem',
|
|
35
|
+
height: d('2rem'),
|
|
36
|
+
minWidth: d('2rem'),
|
|
34
37
|
marginInline: 'auto',
|
|
35
|
-
paddingInline: '0.5rem',
|
|
38
|
+
paddingInline: d('0.5rem'),
|
|
36
39
|
borderWidth: 0,
|
|
37
40
|
borderRadius: radius.pill,
|
|
38
41
|
backgroundColor: colors.bgRaised,
|
|
@@ -60,8 +63,8 @@
|
|
|
60
63
|
transitionTimingFunction: motion.easeOut
|
|
61
64
|
},
|
|
62
65
|
withText: {
|
|
63
|
-
paddingInlineStart: '0.625rem',
|
|
64
|
-
paddingInlineEnd: '0.75rem'
|
|
66
|
+
paddingInlineStart: d('0.625rem'),
|
|
67
|
+
paddingInlineEnd: d('0.75rem')
|
|
65
68
|
},
|
|
66
69
|
hidden: {
|
|
67
70
|
opacity: 0,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { AlertDialog } from 'bits-ui';
|
|
12
12
|
import * as stylex from '@stylexjs/stylex';
|
|
13
13
|
import type { Snippet } from 'svelte';
|
|
14
|
-
import { colors, font, space } from '../../tokens.stylex.js';
|
|
14
|
+
import { colors, density, font, space } from '../../tokens.stylex.js';
|
|
15
15
|
import Button from '../button/Button.svelte';
|
|
16
16
|
import Notice from '../notice/Notice.svelte';
|
|
17
17
|
import { dialog } from './styles.js';
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
children?: Snippet | undefined;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
51
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
52
|
+
|
|
50
53
|
const styles = stylex.create({
|
|
51
54
|
content: { maxWidth: '26rem' },
|
|
52
55
|
// No close button in the corner, so no room kept for one
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
empty: { display: 'none' },
|
|
56
59
|
note: {
|
|
57
60
|
margin: 0,
|
|
58
|
-
marginTop: '0.25rem',
|
|
61
|
+
marginTop: d('0.25rem'),
|
|
59
62
|
fontSize: font.sizeMeta,
|
|
60
63
|
lineHeight: font.leadingSnug
|
|
61
64
|
},
|
|
@@ -60,7 +60,7 @@ export declare const dialog: Readonly<{
|
|
|
60
60
|
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
|
|
61
61
|
readonly paddingTop: stylex.StyleXClassNameFor<"paddingTop", string>;
|
|
62
62
|
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
63
|
-
readonly paddingInlineEnd: stylex.StyleXClassNameFor<"paddingInlineEnd",
|
|
63
|
+
readonly paddingInlineEnd: stylex.StyleXClassNameFor<"paddingInlineEnd", string>;
|
|
64
64
|
}>;
|
|
65
65
|
readonly title: Readonly<{
|
|
66
66
|
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
@@ -95,7 +95,7 @@ export declare const dialog: Readonly<{
|
|
|
95
95
|
}>;
|
|
96
96
|
readonly close: Readonly<{
|
|
97
97
|
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
98
|
-
readonly top: stylex.StyleXClassNameFor<"top",
|
|
99
|
-
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd",
|
|
98
|
+
readonly top: stylex.StyleXClassNameFor<"top", string>;
|
|
99
|
+
readonly insetInlineEnd: stylex.StyleXClassNameFor<"insetInlineEnd", string>;
|
|
100
100
|
}>;
|
|
101
101
|
}>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as stylex from '@stylexjs/stylex';
|
|
2
|
-
import { colors, font, motion, radius, space } from '../../tokens.stylex.js';
|
|
2
|
+
import { colors, density, font, motion, radius, space } from '../../tokens.stylex.js';
|
|
3
3
|
import { media } from '../../media.stylex.js';
|
|
4
4
|
const CLOSED = ':is([data-state="closed"])';
|
|
5
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
6
|
+
const d = (rem) => `calc(${rem} * ${density.factor})`;
|
|
5
7
|
export const dialog = stylex.create({
|
|
6
8
|
overlay: {
|
|
7
9
|
position: 'fixed',
|
|
@@ -62,7 +64,7 @@ export const dialog = stylex.create({
|
|
|
62
64
|
paddingTop: space.x6,
|
|
63
65
|
paddingInline: space.x6,
|
|
64
66
|
// Room for the close button in the corner
|
|
65
|
-
paddingInlineEnd: '3.5rem'
|
|
67
|
+
paddingInlineEnd: d('3.5rem')
|
|
66
68
|
},
|
|
67
69
|
title: {
|
|
68
70
|
margin: 0,
|
|
@@ -97,7 +99,7 @@ export const dialog = stylex.create({
|
|
|
97
99
|
},
|
|
98
100
|
close: {
|
|
99
101
|
position: 'absolute',
|
|
100
|
-
top: '0.875rem',
|
|
101
|
-
insetInlineEnd: '0.875rem'
|
|
102
|
+
top: d('0.875rem'),
|
|
103
|
+
insetInlineEnd: d('0.875rem')
|
|
102
104
|
}
|
|
103
105
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
5
|
import { shared } from '../../internal/shared.js';
|
|
6
6
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
7
|
-
import { colors, font, radius } from '../../tokens.stylex.js';
|
|
7
|
+
import { colors, density, font, radius } from '../../tokens.stylex.js';
|
|
8
8
|
|
|
9
9
|
export type FrameProps = Omit<HTMLAttributes<HTMLElement>, 'children' | 'title'> & {
|
|
10
10
|
/** Element to render. */
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
children?: Snippet | undefined;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
24
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
25
|
+
|
|
23
26
|
const styles = stylex.create({
|
|
24
27
|
// A tray around an inset panel: a flat fill, so the panel's own edge is the only line.
|
|
25
28
|
// Its radius is the Card's radius plus this padding.
|
|
@@ -37,10 +40,10 @@
|
|
|
37
40
|
header: {
|
|
38
41
|
display: 'flex',
|
|
39
42
|
alignItems: 'center',
|
|
40
|
-
gap: '0.625rem',
|
|
41
|
-
paddingTop: '0.6875rem',
|
|
42
|
-
paddingBottom: '0.75rem',
|
|
43
|
-
paddingInline: '0.75rem'
|
|
43
|
+
gap: d('0.625rem'),
|
|
44
|
+
paddingTop: d('0.6875rem'),
|
|
45
|
+
paddingBottom: d('0.75rem'),
|
|
46
|
+
paddingInline: d('0.75rem')
|
|
44
47
|
},
|
|
45
48
|
title: {
|
|
46
49
|
flexGrow: 1,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Loose } from '../../internal/loose.js';
|
|
3
3
|
import { LinkPreview } from 'bits-ui';
|
|
4
4
|
import * as stylex from '@stylexjs/stylex';
|
|
5
|
+
import { density } from '../../tokens.stylex.js';
|
|
5
6
|
import type { Snippet } from 'svelte';
|
|
6
7
|
import { layer } from '../../internal/layer.js';
|
|
7
8
|
import { attrs, type Sx } from '../../internal/sx.js';
|
|
@@ -17,12 +18,15 @@
|
|
|
17
18
|
}
|
|
18
19
|
>;
|
|
19
20
|
|
|
21
|
+
/** A length at the window's density (`density` in the tokens). */
|
|
22
|
+
const d = (rem: string) => `calc(${rem} * ${density.factor})`;
|
|
23
|
+
|
|
20
24
|
const styles = stylex.create({
|
|
21
25
|
// A card of its own content: a preview of a thread, a file, a person
|
|
22
26
|
card: {
|
|
23
27
|
width: '20rem',
|
|
24
28
|
minWidth: 0,
|
|
25
|
-
padding: '0.75rem'
|
|
29
|
+
padding: d('0.75rem')
|
|
26
30
|
},
|
|
27
31
|
bare: { padding: 0 }
|
|
28
32
|
});
|