@widgetic/design-system 0.5.24 → 0.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/components/CopyableHeader.svelte +45 -10
  2. package/dist/components/PasswordInput.svelte +2 -2
  3. package/dist/components/chat/ActivityRow.svelte +6 -6
  4. package/dist/components/chat/ChatHeader.svelte +5 -5
  5. package/dist/components/chat/Composer.svelte +2 -2
  6. package/dist/components/chat/Message.svelte +4 -4
  7. package/dist/components/chat/OptionRow.svelte +1 -1
  8. package/dist/components/chat/PlanCard.svelte +57 -4
  9. package/dist/components/chat/PlanCard.svelte.d.ts +15 -0
  10. package/dist/components/chat/ScrollToBottom.svelte +1 -1
  11. package/dist/components/chat/SuggestionCard.svelte +2 -2
  12. package/dist/components/chat/TaskRow.svelte +3 -3
  13. package/dist/components/index.d.ts +1 -1
  14. package/dist/components/index.js +1 -1
  15. package/dist/components/modals/BaseModal.svelte +1 -1
  16. package/dist/components/search-input/SearchInput.svelte +2 -2
  17. package/dist/components/shell/Banner.svelte +4 -4
  18. package/dist/components/shell/Link.svelte +1 -1
  19. package/dist/components/shell/Link.svelte.d.ts +2 -2
  20. package/dist/components/shell/NavRow.svelte +5 -2
  21. package/dist/components/shell/NavRow.svelte.d.ts +2 -2
  22. package/dist/components/shell/SettingsDialog.svelte +1 -27
  23. package/dist/components/shell/SettingsDialog.svelte.d.ts +0 -4
  24. package/dist/components/shell/WidgetRow.svelte.d.ts +1 -1
  25. package/dist/components/shell/index.d.ts +0 -1
  26. package/dist/components/shell/index.js +0 -1
  27. package/dist/components/toast/ToasterModal.svelte +2 -2
  28. package/dist/components/ui/accordion/accordion-content.svelte +1 -1
  29. package/dist/components/ui/accordion/accordion-trigger.svelte +1 -1
  30. package/dist/components/ui/alert/index.d.ts +2 -2
  31. package/dist/components/ui/alert/index.js +4 -1
  32. package/dist/components/ui/avatar/avatar.svelte +22 -3
  33. package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +1 -1
  34. package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +1 -1
  35. package/dist/components/ui/button/button.svelte +1 -1
  36. package/dist/components/ui/button/button.svelte.d.ts +2 -2
  37. package/dist/components/ui/calendar/calendar-next-button.svelte +1 -1
  38. package/dist/components/ui/calendar/calendar-prev-button.svelte +1 -1
  39. package/dist/components/ui/calendar/calendar.svelte.d.ts +1 -1
  40. package/dist/components/ui/checkbox/checkbox.svelte +3 -3
  41. package/dist/components/ui/chip/chip.svelte +1 -1
  42. package/dist/components/ui/command/command-input.svelte +1 -1
  43. package/dist/components/ui/command/command-item.svelte +1 -1
  44. package/dist/components/ui/dialog/dialog-content.svelte +1 -1
  45. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +2 -2
  46. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
  47. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -2
  48. package/dist/components/ui/icon-button/icon-button.svelte +1 -1
  49. package/dist/components/ui/icon-button/icon-button.svelte.d.ts +2 -2
  50. package/dist/components/ui/input-otp/input-otp-separator.svelte +1 -1
  51. package/dist/components/ui/radio-group/radio-group-item.svelte +1 -1
  52. package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +1 -1
  53. package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +1 -1
  54. package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +1 -1
  55. package/dist/components/ui/select/select-content.svelte +134 -4
  56. package/dist/components/ui/select/select-item.svelte +9 -2
  57. package/dist/components/ui/select/select-scroll-down-button.svelte +1 -1
  58. package/dist/components/ui/select/select-scroll-up-button.svelte +1 -1
  59. package/dist/components/ui/select/select-trigger.svelte +3 -2
  60. package/dist/components/ui/stepper-button/stepper-button.svelte +9 -4
  61. package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +1 -0
  62. package/dist/components/ui/switch/switch.svelte +4 -1
  63. package/dist/components/ui/tag/tag.svelte +1 -1
  64. package/dist/components/ui/toggle/toggle.svelte +1 -1
  65. package/dist/components/ui/toggle/toggle.svelte.d.ts +2 -2
  66. package/dist/styles/tokens.css +25 -3
  67. package/dist/utils/inputModality.d.ts +16 -0
  68. package/dist/utils/inputModality.js +55 -0
  69. package/package.json +1 -1
  70. package/dist/components/shell/messages.d.ts +0 -7
  71. package/dist/components/shell/messages.js +0 -5
@@ -60,6 +60,7 @@
60
60
  let showCopyTooltip = false;
61
61
  let tooltipDebounce = false;
62
62
  let contentElement: HTMLDivElement | null = null;
63
+ let isSelectingSnippet = false;
63
64
  let copied = false;
64
65
  let copiedTimeout: ReturnType<typeof setTimeout> | undefined;
65
66
  let isToastVisible = false;
@@ -114,6 +115,32 @@
114
115
  }
115
116
  }
116
117
 
118
+ /** Select the full snippet on click unless the user is dragging to pick a range. */
119
+ function handleSnippetClick(event: MouseEvent) {
120
+ if (!contentElement || isSelectingSnippet) return;
121
+ const selection = window.getSelection();
122
+ if (selection && !selection.isCollapsed && selection.anchorNode && contentElement.contains(selection.anchorNode)) {
123
+ return;
124
+ }
125
+ event.preventDefault();
126
+ try {
127
+ const range = document.createRange();
128
+ range.selectNodeContents(contentElement);
129
+ selection?.removeAllRanges();
130
+ selection?.addRange(range);
131
+ } catch (err) {
132
+ console.error('[CopyableHeader] Could not select embed snippet:', err);
133
+ }
134
+ }
135
+
136
+ function handleSnippetMouseDown() {
137
+ isSelectingSnippet = false;
138
+ }
139
+
140
+ function handleSnippetMouseMove() {
141
+ isSelectingSnippet = true;
142
+ }
143
+
117
144
  function showToast(type: 'success' | 'error', message: string, options = {}) {
118
145
  if (isToastVisible) return;
119
146
  isToastVisible = true;
@@ -130,9 +157,10 @@
130
157
  }
131
158
  </script>
132
159
 
133
- <div class={cn('copyable-header flex w-full flex-col gap-3', className)} {style}>
160
+ <!-- `min-w-0` on the root and on the title row: a `truncate` title has its whole text as min-content, so inside a grid or flex parent (a dialog) the row would push the copy button out of the parent instead of cutting the title. -->
161
+ <div class={cn('copyable-header flex w-full min-w-0 flex-col gap-4', className)} {style}>
134
162
  <!-- Title row: section label + copy control (Figma 32px). -->
135
- <div class={cn('flex h-8 items-center justify-between gap-3', headerBackgroundColor)}>
163
+ <div class={cn('flex h-8 min-w-0 items-center justify-between gap-3', headerBackgroundColor)}>
136
164
  <div class={cn('text-heading-section text-foreground min-w-0 truncate', headerTextClass)}>
137
165
  {headerText}
138
166
  </div>
@@ -159,9 +187,9 @@
159
187
  }}
160
188
  >
161
189
  {#if copied}
162
- <IconCheck class="size-4 stroke-[1.333]" />
190
+ <IconCheck class="size-4 stroke-2" />
163
191
  {:else}
164
- <IconCopy class="size-4 stroke-[1.333]" />
192
+ <IconCopy class="size-4 stroke-2" />
165
193
  {/if}
166
194
  {#if showButtonText}
167
195
  <span class="ms-2">{standaloneCopyButtonText}</span>
@@ -201,9 +229,9 @@
201
229
  }}
202
230
  >
203
231
  {#if copied}
204
- <IconCheck class="size-4 stroke-[1.333]" />
232
+ <IconCheck class="size-4 stroke-2" />
205
233
  {:else}
206
- <IconCopy class="text-muted-foreground size-4 stroke-[1.333]" />
234
+ <IconCopy class="text-muted-foreground size-4 stroke-2" />
207
235
  {/if}
208
236
  </IconButton>
209
237
  {/snippet}
@@ -223,7 +251,7 @@
223
251
  <!-- Code card: accent surface; loading skeleton, error, or selectable snippet. -->
224
252
  <div
225
253
  class={cn(
226
- 'bg-accent flex flex-col gap-2 rounded-xl p-3',
254
+ 'embed-code-surface bg-accent flex flex-col gap-2 rounded-xl p-3 transition-colors duration-fast hover:bg-accent-hover',
227
255
  contentBorderColor && 'border-border border'
228
256
  )}
229
257
  style={contentBorderColor && !contentBorderColor.startsWith('border')
@@ -239,7 +267,7 @@
239
267
  {:else if errorTitle}
240
268
  <div class="flex flex-col items-center gap-2 py-2 text-center">
241
269
  <div class="bg-destructive/10 flex size-10 items-center justify-center rounded-lg">
242
- <IconAlertTriangle class="text-destructive size-4 stroke-[1.333]" aria-hidden="true" />
270
+ <IconAlertTriangle class="text-destructive size-4 stroke-2" aria-hidden="true" />
243
271
  </div>
244
272
  <p class="text-body-medium text-foreground">{errorTitle}</p>
245
273
  {#if errorDetail}
@@ -251,10 +279,16 @@
251
279
  <div
252
280
  bind:this={contentElement}
253
281
  class={cn(
254
- 'text-code text-foreground max-h-36 w-full cursor-text overflow-y-auto text-start break-all whitespace-pre-wrap',
282
+ // Three lines of the snippet are visible (`3lh` follows the line height of the text style); the rest scrolls inside the card.
283
+ 'embed-code-snippet text-code text-foreground max-h-[3lh] w-full cursor-text overflow-y-auto text-start break-all whitespace-pre-wrap',
255
284
  monospaceContent ? '' : 'text-body'
256
285
  )}
257
286
  tabindex="0"
287
+ role="textbox"
288
+ aria-readonly="true"
289
+ on:click={handleSnippetClick}
290
+ on:mousedown={handleSnippetMouseDown}
291
+ on:mousemove={handleSnippetMouseMove}
258
292
  >
259
293
  {content}
260
294
  </div>
@@ -262,7 +296,8 @@
262
296
  </div>
263
297
 
264
298
  {#if showHelpRow}
265
- <div class="flex flex-wrap items-center gap-1">
299
+ <!-- Figma: the help row is 20 high (the 14/20 link sets it), whatever the size of the link. -->
300
+ <div class="flex min-h-5 flex-wrap items-center gap-1">
266
301
  {#if helpPrompt}
267
302
  <span class="text-caption text-muted-foreground">{helpPrompt}</span>
268
303
  {/if}
@@ -39,9 +39,9 @@
39
39
  {disabled}
40
40
  >
41
41
  {#if showPassword}
42
- <IconEyeOff class="size-4 stroke-[1.333]" aria-hidden="true" />
42
+ <IconEyeOff class="size-4 stroke-2" aria-hidden="true" />
43
43
  {:else}
44
- <IconEye class="size-4 stroke-[1.333]" aria-hidden="true" />
44
+ <IconEye class="size-4 stroke-2" aria-hidden="true" />
45
45
  {/if}
46
46
  </button>
47
47
  </div>
@@ -70,15 +70,15 @@
70
70
  <span class="text-muted-foreground flex size-4 shrink-0 items-center justify-center">
71
71
  {#if status === 'running'}
72
72
  <IconLoader2
73
- class="size-4 animate-spin stroke-[1.333] motion-reduce:animate-none"
73
+ class="size-4 animate-spin stroke-2 motion-reduce:animate-none"
74
74
  aria-hidden="true"
75
75
  />
76
76
  {:else if status === 'done'}
77
- <IconCircleCheck class="text-brand size-4 stroke-[1.333]" aria-hidden="true" />
77
+ <IconCircleCheck class="text-brand size-4 stroke-2" aria-hidden="true" />
78
78
  {:else if status === 'failed'}
79
- <IconCircleX class="text-destructive size-4 stroke-[1.333]" aria-hidden="true" />
79
+ <IconCircleX class="text-destructive size-4 stroke-2" aria-hidden="true" />
80
80
  {:else}
81
- <IconCircle class="size-4 stroke-[1.333]" aria-hidden="true" />
81
+ <IconCircle class="size-4 stroke-2" aria-hidden="true" />
82
82
  {/if}
83
83
  </span>
84
84
  <span
@@ -92,12 +92,12 @@
92
92
  {#if hasDetail}
93
93
  {#if expanded}
94
94
  <IconChevronDown
95
- class="text-muted-foreground size-4 shrink-0 stroke-[1.333]"
95
+ class="text-muted-foreground size-4 shrink-0 stroke-2"
96
96
  aria-hidden="true"
97
97
  />
98
98
  {:else}
99
99
  <IconChevronRight
100
- class="text-muted-foreground size-4 shrink-0 stroke-[1.333] rtl:-scale-x-100"
100
+ class="text-muted-foreground size-4 shrink-0 stroke-2 rtl:-scale-x-100"
101
101
  aria-hidden="true"
102
102
  />
103
103
  {/if}
@@ -83,7 +83,7 @@
83
83
  aria-label={messages.openHistory}
84
84
  >
85
85
  <span class="truncate">{displayTitle}</span>
86
- <IconChevronDown class="size-4 shrink-0 stroke-[1.333]" aria-hidden="true" />
86
+ <IconChevronDown class="size-4 shrink-0 stroke-2" aria-hidden="true" />
87
87
  </Button>
88
88
 
89
89
  {#if status}
@@ -93,22 +93,22 @@
93
93
  <span class="min-w-0 flex-1" aria-hidden="true"></span>
94
94
 
95
95
  <IconButton variant="ghost" label={messages.pin} onclick={onPin}>
96
- <IconPin class="stroke-[1.333]" />
96
+ <IconPin class="stroke-2" />
97
97
  </IconButton>
98
98
 
99
99
  <IconButton variant="ghost" label={messages.newChat} onclick={onNewChat}>
100
- <IconMessagePlus class="stroke-[1.333]" />
100
+ <IconMessagePlus class="stroke-2" />
101
101
  </IconButton>
102
102
 
103
103
  {#if onHistory}
104
104
  <IconButton variant="ghost" label={messages.history} onclick={onHistory}>
105
- <IconMessages class="stroke-[1.333]" />
105
+ <IconMessages class="stroke-2" />
106
106
  </IconButton>
107
107
  {/if}
108
108
 
109
109
  {#if showClose}
110
110
  <IconButton variant="ghost" label={messages.close} onclick={onClose}>
111
- <IconX class="stroke-[1.333]" />
111
+ <IconX class="stroke-2" />
112
112
  </IconButton>
113
113
  {/if}
114
114
  </header>
@@ -163,9 +163,9 @@
163
163
  onclick={handleSend}
164
164
  >
165
165
  {#if busy}
166
- <IconPlayerStop class="size-4 stroke-[1.333]" aria-hidden="true" />
166
+ <IconPlayerStop class="size-4 stroke-2" aria-hidden="true" />
167
167
  {:else}
168
- <IconSend class="size-4 stroke-[1.333]" aria-hidden="true" />
168
+ <IconSend class="size-4 stroke-2" aria-hidden="true" />
169
169
  {/if}
170
170
  </IconButton>
171
171
  </div>
@@ -97,13 +97,13 @@
97
97
  >
98
98
  {#if onRestoreCheckpoint}
99
99
  <Button variant="ghost" size="sm" onclick={onRestoreCheckpoint}>
100
- <IconRestore class="size-4 stroke-[1.333]" aria-hidden="true" />
100
+ <IconRestore class="size-4 stroke-2" aria-hidden="true" />
101
101
  {messages.restoreCheckpoint}
102
102
  </Button>
103
103
  {/if}
104
104
  {#if onCopy}
105
105
  <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
106
- <IconCopy class="size-4 stroke-[1.333]" aria-hidden="true" />
106
+ <IconCopy class="size-4 stroke-2" aria-hidden="true" />
107
107
  </IconButton>
108
108
  {/if}
109
109
  {#if actions}
@@ -142,12 +142,12 @@
142
142
  >
143
143
  {#if onCopy}
144
144
  <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
145
- <IconCopy class="size-4 stroke-[1.333]" aria-hidden="true" />
145
+ <IconCopy class="size-4 stroke-2" aria-hidden="true" />
146
146
  </IconButton>
147
147
  {/if}
148
148
  {#if onRegenerate}
149
149
  <IconButton variant="ghost" label={messages.regenerate} onclick={onRegenerate}>
150
- <IconRefresh class="size-4 stroke-[1.333]" aria-hidden="true" />
150
+ <IconRefresh class="size-4 stroke-2" aria-hidden="true" />
151
151
  </IconButton>
152
152
  {/if}
153
153
  {#if actions}
@@ -53,7 +53,7 @@
53
53
  </span>
54
54
  {#if selected}
55
55
  <span class="text-foreground flex size-4 shrink-0 items-center justify-center" aria-hidden="true">
56
- <IconCheck class="size-4 stroke-[1.333]" />
56
+ <IconCheck class="size-4 stroke-2" />
57
57
  </span>
58
58
  {/if}
59
59
  </button>
@@ -7,6 +7,9 @@
7
7
  import IconChevronDown from '@tabler/icons-svelte/icons/chevron-down';
8
8
  import IconCircle from '@tabler/icons-svelte/icons/circle';
9
9
  import IconCircleCheck from '@tabler/icons-svelte/icons/circle-check';
10
+ import IconDeviceDesktop from '@tabler/icons-svelte/icons/device-desktop';
11
+ import IconDeviceMobile from '@tabler/icons-svelte/icons/device-mobile';
12
+ import IconDeviceTablet from '@tabler/icons-svelte/icons/device-tablet';
10
13
  import IconListCheck from '@tabler/icons-svelte/icons/list-check';
11
14
  import IconLoader2 from '@tabler/icons-svelte/icons/loader-2';
12
15
  import { Badge } from '../ui/badge';
@@ -20,12 +23,26 @@
20
23
  status: 'pending' | 'active' | 'done';
21
24
  };
22
25
 
26
+ /**
27
+ * How the widget behaves on each screen (the `decisions.responsive` of a widget plan). The plan of a first build always
28
+ * carries it, so the card shows it whenever it is given.
29
+ */
30
+ export type PlanResponsive = {
31
+ mobile: string;
32
+ tablet: string;
33
+ desktop: string;
34
+ };
35
+
23
36
  export type PlanCardMessages = {
24
37
  progress: string;
25
38
  showMoreTasks: string;
26
39
  showFewerTasks: string;
27
40
  primaryAction: string;
28
41
  secondaryAction: string;
42
+ responsiveTitle: string;
43
+ responsiveMobile: string;
44
+ responsiveTablet: string;
45
+ responsiveDesktop: string;
29
46
  };
30
47
 
31
48
  const defaultMessages: PlanCardMessages = {
@@ -33,7 +50,11 @@
33
50
  showMoreTasks: 'Show {count} more tasks',
34
51
  showFewerTasks: 'Show fewer tasks',
35
52
  primaryAction: 'Build',
36
- secondaryAction: 'Edit plan'
53
+ secondaryAction: 'Edit plan',
54
+ responsiveTitle: 'Responsive',
55
+ responsiveMobile: 'Mobile',
56
+ responsiveTablet: 'Tablet',
57
+ responsiveDesktop: 'Desktop'
37
58
  };
38
59
 
39
60
  type Props = HTMLAttributes<HTMLDivElement> & {
@@ -46,6 +67,8 @@
46
67
  progressTotal?: number;
47
68
  /** Tasks shown before the collapsible section. */
48
69
  visibleTaskCount?: number;
70
+ /** The responsive view of the widget (mobile, tablet, desktop), shown under the tasks when it is given. */
71
+ responsive?: PlanResponsive | null;
49
72
  messages?: Partial<PlanCardMessages>;
50
73
  onPrimary?: () => void;
51
74
  onSecondary?: () => void;
@@ -62,6 +85,7 @@
62
85
  progressCurrent,
63
86
  progressTotal,
64
87
  visibleTaskCount = 3,
88
+ responsive = null,
65
89
  messages: messagesProp,
66
90
  onPrimary,
67
91
  onSecondary,
@@ -101,6 +125,17 @@
101
125
  : messages.showMoreTasks.replace('{count}', String(hiddenCount))
102
126
  );
103
127
 
128
+ // The three screens of the responsive view, in the order of the plan: small to large. A screen without text is left out.
129
+ const responsiveRows = $derived(
130
+ responsive
131
+ ? [
132
+ { id: 'mobile', Icon: IconDeviceMobile, label: messages.responsiveMobile, text: responsive.mobile },
133
+ { id: 'tablet', Icon: IconDeviceTablet, label: messages.responsiveTablet, text: responsive.tablet },
134
+ { id: 'desktop', Icon: IconDeviceDesktop, label: messages.responsiveDesktop, text: responsive.desktop }
135
+ ].filter((row) => row.text.trim() !== '')
136
+ : []
137
+ );
138
+
104
139
  function taskIcon(status: PlanTask['status']) {
105
140
  if (status === 'done') return IconCircleCheck;
106
141
  if (status === 'active') return IconLoader2;
@@ -131,7 +166,7 @@
131
166
  <div class="flex min-h-7 items-center gap-2 px-0 py-1">
132
167
  <Icon
133
168
  class={cn(
134
- 'size-4 shrink-0 stroke-[1.333]',
169
+ 'size-4 shrink-0 stroke-2',
135
170
  task.status === 'active' && 'animate-spin motion-reduce:animate-none',
136
171
  task.status === 'done' ? 'text-muted-foreground' : 'text-foreground'
137
172
  )}
@@ -163,7 +198,7 @@
163
198
  {#if headerIcon}
164
199
  {@render headerIcon()}
165
200
  {:else}
166
- <IconListCheck class="size-4 stroke-[1.333]" aria-hidden="true" />
201
+ <IconListCheck class="size-4 stroke-2" aria-hidden="true" />
167
202
  {/if}
168
203
  </span>
169
204
  <h3 class="text-body-medium text-foreground min-w-0 flex-1 truncate">{title}</h3>
@@ -183,7 +218,7 @@
183
218
  {showMoreLabel}
184
219
  <IconChevronDown
185
220
  class={cn(
186
- 'duration-base size-4 stroke-[1.333] transition-transform motion-reduce:transition-none',
221
+ 'duration-base size-4 stroke-2 transition-transform motion-reduce:transition-none',
187
222
  expanded && 'rotate-180'
188
223
  )}
189
224
  aria-hidden="true"
@@ -198,6 +233,24 @@
198
233
  {/if}
199
234
  </div>
200
235
 
236
+ {#if responsiveRows.length > 0}
237
+ <section class="border-border flex flex-col gap-1 border-t pt-3" aria-labelledby="plan-card-responsive-title">
238
+ <h4 id="plan-card-responsive-title" class="text-label-small text-muted-foreground">
239
+ {messages.responsiveTitle}
240
+ </h4>
241
+ {#each responsiveRows as row (row.id)}
242
+ {@const RowIcon = row.Icon}
243
+ <div class="flex items-start gap-2 py-1">
244
+ <RowIcon class="text-foreground mt-0.5 size-4 shrink-0 stroke-2" aria-hidden="true" />
245
+ <p class="text-body min-w-0 flex-1">
246
+ <span class="text-body-medium text-foreground">{row.label}</span>
247
+ <span class="text-muted-foreground">{row.text}</span>
248
+ </p>
249
+ </div>
250
+ {/each}
251
+ </section>
252
+ {/if}
253
+
201
254
  {#if showFooter}
202
255
  <footer class="flex flex-wrap items-center gap-2 pt-1">
203
256
  {#if secondaryAction}
@@ -5,12 +5,25 @@ export type PlanTask = {
5
5
  label: string;
6
6
  status: 'pending' | 'active' | 'done';
7
7
  };
8
+ /**
9
+ * How the widget behaves on each screen (the `decisions.responsive` of a widget plan). The plan of a first build always
10
+ * carries it, so the card shows it whenever it is given.
11
+ */
12
+ export type PlanResponsive = {
13
+ mobile: string;
14
+ tablet: string;
15
+ desktop: string;
16
+ };
8
17
  export type PlanCardMessages = {
9
18
  progress: string;
10
19
  showMoreTasks: string;
11
20
  showFewerTasks: string;
12
21
  primaryAction: string;
13
22
  secondaryAction: string;
23
+ responsiveTitle: string;
24
+ responsiveMobile: string;
25
+ responsiveTablet: string;
26
+ responsiveDesktop: string;
14
27
  };
15
28
  type Props = HTMLAttributes<HTMLDivElement> & {
16
29
  ref?: HTMLDivElement | null;
@@ -22,6 +35,8 @@ type Props = HTMLAttributes<HTMLDivElement> & {
22
35
  progressTotal?: number;
23
36
  /** Tasks shown before the collapsible section. */
24
37
  visibleTaskCount?: number;
38
+ /** The responsive view of the widget (mobile, tablet, desktop), shown under the tasks when it is given. */
39
+ responsive?: PlanResponsive | null;
25
40
  messages?: Partial<PlanCardMessages>;
26
41
  onPrimary?: () => void;
27
42
  onSecondary?: () => void;
@@ -46,6 +46,6 @@
46
46
  onclick={() => onScroll?.()}
47
47
  {...restProps}
48
48
  >
49
- <IconArrowDown class="size-4 stroke-[1.333]" aria-hidden="true" />
49
+ <IconArrowDown class="size-4 stroke-2" aria-hidden="true" />
50
50
  </IconButton>
51
51
  </div>
@@ -61,7 +61,7 @@
61
61
  >
62
62
  {#if icon}
63
63
  <span
64
- class="text-foreground flex size-4 shrink-0 items-center justify-center [&_svg]:size-4 [&_svg]:stroke-[1.333]"
64
+ class="text-foreground flex size-4 shrink-0 items-center justify-center [&_svg]:size-4 [&_svg]:stroke-2"
65
65
  >
66
66
  {@render icon()}
67
67
  </span>
@@ -73,7 +73,7 @@
73
73
  {/if}
74
74
  </span>
75
75
  <IconChevronRight
76
- class="text-foreground duration-fast size-4 shrink-0 stroke-[1.333] opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 rtl:-scale-x-100"
76
+ class="text-foreground duration-fast size-4 shrink-0 stroke-2 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 rtl:-scale-x-100"
77
77
  aria-hidden="true"
78
78
  />
79
79
  </button>
@@ -37,13 +37,13 @@
37
37
  <span class="flex size-4 shrink-0 items-center justify-center">
38
38
  {#if status === 'active'}
39
39
  <IconLoader2
40
- class="text-foreground size-4 animate-spin stroke-[1.333] motion-reduce:animate-none"
40
+ class="text-foreground size-4 animate-spin stroke-2 motion-reduce:animate-none"
41
41
  aria-hidden="true"
42
42
  />
43
43
  {:else if status === 'done'}
44
- <IconCircleCheck class="text-brand size-4 stroke-[1.333]" aria-hidden="true" />
44
+ <IconCircleCheck class="text-brand size-4 stroke-2" aria-hidden="true" />
45
45
  {:else}
46
- <IconCircle class="text-muted-foreground size-4 stroke-[1.333]" aria-hidden="true" />
46
+ <IconCircle class="text-muted-foreground size-4 stroke-2" aria-hidden="true" />
47
47
  {/if}
48
48
  </span>
49
49
  <span
@@ -16,7 +16,7 @@ export { Breadcrumbs, type BreadcrumbsProps } from './navigation';
16
16
  export { default as PDFViewer } from './pdf/PDFViewer.svelte';
17
17
  export { SearchInput } from './search-input';
18
18
  export { ShadEditor, checkShadEditorMessages, type ShadEditorMessageKey, type TipTapEditor, type TipTapEditorLevel } from './shad-editor';
19
- export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, type ErrorStateMessages, NotificationRow, type NotificationRowProps, SettingsNav, type SettingsNavProps, SettingsDialog, type SettingsDialogProps, Stat, type StatProps, statVariants, Banner, type BannerProps, type BannerTone, bannerVariants, Link, type LinkProps, type LinkSize, linkVariants, type SettingsNavGroup, type SettingsNavItem, settingsNavItemIsActive, externalLinkAttributes, statHintClass, type StatTone, type SettingsDialogMessages, defaultSettingsDialogMessages } from './shell';
19
+ export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, type ErrorStateMessages, NotificationRow, type NotificationRowProps, SettingsNav, type SettingsNavProps, SettingsDialog, type SettingsDialogProps, Stat, type StatProps, statVariants, Banner, type BannerProps, type BannerTone, bannerVariants, Link, type LinkProps, type LinkSize, linkVariants, type SettingsNavGroup, type SettingsNavItem, settingsNavItemIsActive, externalLinkAttributes, statHintClass, type StatTone } from './shell';
20
20
  export { ToasterModal, showToast } from './toast';
21
21
  export * as Accordion from './ui/accordion';
22
22
  export * as Alert from './ui/alert';
@@ -17,7 +17,7 @@ export { Breadcrumbs } from './navigation';
17
17
  export { default as PDFViewer } from './pdf/PDFViewer.svelte';
18
18
  export { SearchInput } from './search-input';
19
19
  export { ShadEditor, checkShadEditorMessages } from './shad-editor';
20
- export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, NotificationRow, SettingsNav, SettingsDialog, Stat, statVariants, Banner, bannerVariants, Link, linkVariants, settingsNavItemIsActive, externalLinkAttributes, statHintClass, defaultSettingsDialogMessages } from './shell';
20
+ export { NavRow, navRowVariants, NavSectionLabel, ProfileRow, profileRowVariants, Sidebar, WidgetRow, widgetRowVariants, PageHeader, TopBar, NavDrawer, AppShell, ErrorState, defaultErrorStateMessages, NotificationRow, SettingsNav, SettingsDialog, Stat, statVariants, Banner, bannerVariants, Link, linkVariants, settingsNavItemIsActive, externalLinkAttributes, statHintClass } from './shell';
21
21
  export { ToasterModal, showToast } from './toast';
22
22
  export * as Accordion from './ui/accordion';
23
23
  export * as Alert from './ui/alert';
@@ -391,7 +391,7 @@
391
391
  <div class="min-w-0 flex-1"></div>
392
392
  {/if}
393
393
  <IconButton variant="ghost" label={closeLabel} onclick={handleClose}>
394
- <IconX class="size-4 stroke-[1.333]" />
394
+ <IconX class="size-4 stroke-2" />
395
395
  </IconButton>
396
396
  </div>
397
397
  {/if}
@@ -31,7 +31,7 @@
31
31
  class="group bg-accent duration-fast focus-within:bg-accent hover:bg-accent-hover relative flex h-9 w-full items-center gap-2 rounded-lg px-3 transition-colors"
32
32
  >
33
33
  <IconSearch
34
- class="text-muted-foreground duration-fast group-focus-within:text-foreground size-4 shrink-0 stroke-[1.333] transition-colors {value
34
+ class="text-muted-foreground duration-fast group-focus-within:text-foreground size-4 shrink-0 stroke-2 transition-colors {value
35
35
  ? 'text-foreground'
36
36
  : ''}"
37
37
  aria-hidden="true"
@@ -62,7 +62,7 @@
62
62
  aria-label={clearLabel}
63
63
  onclick={onClear}
64
64
  >
65
- <IconX class="size-4 stroke-[1.333]" aria-hidden="true" />
65
+ <IconX class="size-4 stroke-2" aria-hidden="true" />
66
66
  </button>
67
67
  {/if}
68
68
  </div>
@@ -61,11 +61,11 @@
61
61
  {#if icon}
62
62
  {@render icon()}
63
63
  {:else if tone === 'brand'}
64
- <IconCircleCheck class="size-4 stroke-[1.333]" aria-hidden="true" />
64
+ <IconCircleCheck class="size-4 stroke-2" aria-hidden="true" />
65
65
  {:else if tone === 'destructive'}
66
- <IconAlertTriangle class="size-4 stroke-[1.333]" aria-hidden="true" />
66
+ <IconAlertTriangle class="size-4 stroke-2" aria-hidden="true" />
67
67
  {:else}
68
- <IconInfoCircle class="size-4 stroke-[1.333]" aria-hidden="true" />
68
+ <IconInfoCircle class="size-4 stroke-2" aria-hidden="true" />
69
69
  {/if}
70
70
  </span>
71
71
  <div class="min-w-0 flex-1">
@@ -84,7 +84,7 @@
84
84
  aria-label={dismissLabel}
85
85
  onclick={onDismiss}
86
86
  >
87
- <IconX class="size-4 stroke-[1.333]" aria-hidden="true" />
87
+ <IconX class="size-4 stroke-2" aria-hidden="true" />
88
88
  </button>
89
89
  {/if}
90
90
  </div>
@@ -7,7 +7,7 @@
7
7
  import type { VariantProps } from 'tailwind-variants';
8
8
 
9
9
  export const linkVariants = tv({
10
- base: 'inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]',
10
+ base: 'inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2',
11
11
  variants: {
12
12
  size: {
13
13
  default: 'text-body-medium',
@@ -6,7 +6,7 @@ export declare const linkVariants: import("tailwind-variants").TVReturnType<{
6
6
  default: string;
7
7
  small: string;
8
8
  };
9
- }, undefined, "inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", {
9
+ }, undefined, "inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", {
10
10
  responsiveVariants?: boolean | (string | number | symbol)[] | {
11
11
  size?: boolean | (string | number | symbol)[] | undefined;
12
12
  } | undefined;
@@ -28,7 +28,7 @@ export declare const linkVariants: import("tailwind-variants").TVReturnType<{
28
28
  default: string;
29
29
  small: string;
30
30
  };
31
- }, undefined, "inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", import("tailwind-variants/dist/config.js").TVConfig<{
31
+ }, undefined, "inline-flex items-center gap-1 text-primary transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background hover:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", import("tailwind-variants/dist/config.js").TVConfig<{
32
32
  size: {
33
33
  default: string;
34
34
  small: string;
@@ -4,11 +4,14 @@
4
4
  import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
5
5
 
6
6
  export const navRowVariants = tv({
7
- base: 'group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]',
7
+ base: 'group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2',
8
8
  variants: {
9
9
  active: {
10
10
  true: 'bg-sidebar-accent text-sidebar-accent-foreground text-body-medium',
11
- false: 'text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground'
11
+ // The inactive row carries its own type style (14/20 regular, Figma Nav Row): without it the label took the size
12
+ // of whatever it sat in (16px in a dialog), bigger than the active row's 14/20 medium.
13
+ false:
14
+ 'text-body text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground'
12
15
  }
13
16
  },
14
17
  defaultVariants: {
@@ -5,7 +5,7 @@ export declare const navRowVariants: import("tailwind-variants").TVReturnType<{
5
5
  true: string;
6
6
  false: string;
7
7
  };
8
- }, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", {
8
+ }, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", {
9
9
  responsiveVariants?: boolean | (string | number | symbol)[] | {
10
10
  active?: boolean | (string | number | symbol)[] | undefined;
11
11
  } | undefined;
@@ -27,7 +27,7 @@ export declare const navRowVariants: import("tailwind-variants").TVReturnType<{
27
27
  true: string;
28
28
  false: string;
29
29
  };
30
- }, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.333]", import("tailwind-variants/dist/config.js").TVConfig<{
30
+ }, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", import("tailwind-variants/dist/config.js").TVConfig<{
31
31
  active: {
32
32
  true: string;
33
33
  false: string;