@widgetic/design-system 0.5.25 → 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.
- package/dist/components/CopyableHeader.svelte +41 -8
- package/dist/components/PasswordInput.svelte +2 -2
- package/dist/components/chat/ActivityRow.svelte +6 -6
- package/dist/components/chat/ChatHeader.svelte +5 -5
- package/dist/components/chat/Composer.svelte +2 -2
- package/dist/components/chat/Message.svelte +4 -4
- package/dist/components/chat/OptionRow.svelte +1 -1
- package/dist/components/chat/PlanCard.svelte +57 -4
- package/dist/components/chat/PlanCard.svelte.d.ts +15 -0
- package/dist/components/chat/ScrollToBottom.svelte +1 -1
- package/dist/components/chat/SuggestionCard.svelte +2 -2
- package/dist/components/chat/TaskRow.svelte +3 -3
- package/dist/components/modals/BaseModal.svelte +1 -1
- package/dist/components/search-input/SearchInput.svelte +2 -2
- package/dist/components/shell/Banner.svelte +4 -4
- package/dist/components/shell/Link.svelte +1 -1
- package/dist/components/shell/Link.svelte.d.ts +2 -2
- package/dist/components/shell/NavRow.svelte +1 -1
- package/dist/components/shell/NavRow.svelte.d.ts +2 -2
- package/dist/components/shell/SettingsDialog.svelte +1 -1
- package/dist/components/shell/WidgetRow.svelte.d.ts +1 -1
- package/dist/components/toast/ToasterModal.svelte +2 -2
- package/dist/components/ui/accordion/accordion-content.svelte +1 -1
- package/dist/components/ui/accordion/accordion-trigger.svelte +1 -1
- package/dist/components/ui/alert/index.d.ts +2 -2
- package/dist/components/ui/alert/index.js +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +1 -1
- package/dist/components/ui/button/button.svelte +1 -1
- package/dist/components/ui/button/button.svelte.d.ts +2 -2
- package/dist/components/ui/calendar/calendar-next-button.svelte +1 -1
- package/dist/components/ui/calendar/calendar-prev-button.svelte +1 -1
- package/dist/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte +3 -3
- package/dist/components/ui/chip/chip.svelte +1 -1
- package/dist/components/ui/command/command-input.svelte +1 -1
- package/dist/components/ui/command/command-item.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -2
- package/dist/components/ui/icon-button/icon-button.svelte +1 -1
- package/dist/components/ui/icon-button/icon-button.svelte.d.ts +2 -2
- package/dist/components/ui/input-otp/input-otp-separator.svelte +1 -1
- package/dist/components/ui/radio-group/radio-group-item.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +1 -1
- package/dist/components/ui/select/select-content.svelte +131 -6
- package/dist/components/ui/select/select-item.svelte +1 -1
- package/dist/components/ui/select/select-scroll-down-button.svelte +1 -1
- package/dist/components/ui/select/select-scroll-up-button.svelte +1 -1
- package/dist/components/ui/select/select-trigger.svelte +1 -1
- package/dist/components/ui/stepper-button/stepper-button.svelte +9 -4
- package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +1 -0
- package/dist/components/ui/switch/switch.svelte +1 -1
- package/dist/components/ui/tag/tag.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte.d.ts +2 -2
- package/dist/styles/tokens.css +4 -2
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -131,7 +158,7 @@
|
|
|
131
158
|
</script>
|
|
132
159
|
|
|
133
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. -->
|
|
134
|
-
<div class={cn('copyable-header flex w-full min-w-0 flex-col gap-
|
|
161
|
+
<div class={cn('copyable-header flex w-full min-w-0 flex-col gap-4', className)} {style}>
|
|
135
162
|
<!-- Title row: section label + copy control (Figma 32px). -->
|
|
136
163
|
<div class={cn('flex h-8 min-w-0 items-center justify-between gap-3', headerBackgroundColor)}>
|
|
137
164
|
<div class={cn('text-heading-section text-foreground min-w-0 truncate', headerTextClass)}>
|
|
@@ -160,9 +187,9 @@
|
|
|
160
187
|
}}
|
|
161
188
|
>
|
|
162
189
|
{#if copied}
|
|
163
|
-
<IconCheck class="size-4 stroke-
|
|
190
|
+
<IconCheck class="size-4 stroke-2" />
|
|
164
191
|
{:else}
|
|
165
|
-
<IconCopy class="size-4 stroke-
|
|
192
|
+
<IconCopy class="size-4 stroke-2" />
|
|
166
193
|
{/if}
|
|
167
194
|
{#if showButtonText}
|
|
168
195
|
<span class="ms-2">{standaloneCopyButtonText}</span>
|
|
@@ -202,9 +229,9 @@
|
|
|
202
229
|
}}
|
|
203
230
|
>
|
|
204
231
|
{#if copied}
|
|
205
|
-
<IconCheck class="size-4 stroke-
|
|
232
|
+
<IconCheck class="size-4 stroke-2" />
|
|
206
233
|
{:else}
|
|
207
|
-
<IconCopy class="text-muted-foreground size-4 stroke-
|
|
234
|
+
<IconCopy class="text-muted-foreground size-4 stroke-2" />
|
|
208
235
|
{/if}
|
|
209
236
|
</IconButton>
|
|
210
237
|
{/snippet}
|
|
@@ -224,7 +251,7 @@
|
|
|
224
251
|
<!-- Code card: accent surface; loading skeleton, error, or selectable snippet. -->
|
|
225
252
|
<div
|
|
226
253
|
class={cn(
|
|
227
|
-
'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',
|
|
228
255
|
contentBorderColor && 'border-border border'
|
|
229
256
|
)}
|
|
230
257
|
style={contentBorderColor && !contentBorderColor.startsWith('border')
|
|
@@ -240,7 +267,7 @@
|
|
|
240
267
|
{:else if errorTitle}
|
|
241
268
|
<div class="flex flex-col items-center gap-2 py-2 text-center">
|
|
242
269
|
<div class="bg-destructive/10 flex size-10 items-center justify-center rounded-lg">
|
|
243
|
-
<IconAlertTriangle class="text-destructive size-4 stroke-
|
|
270
|
+
<IconAlertTriangle class="text-destructive size-4 stroke-2" aria-hidden="true" />
|
|
244
271
|
</div>
|
|
245
272
|
<p class="text-body-medium text-foreground">{errorTitle}</p>
|
|
246
273
|
{#if errorDetail}
|
|
@@ -252,10 +279,16 @@
|
|
|
252
279
|
<div
|
|
253
280
|
bind:this={contentElement}
|
|
254
281
|
class={cn(
|
|
255
|
-
|
|
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',
|
|
256
284
|
monospaceContent ? '' : 'text-body'
|
|
257
285
|
)}
|
|
258
286
|
tabindex="0"
|
|
287
|
+
role="textbox"
|
|
288
|
+
aria-readonly="true"
|
|
289
|
+
on:click={handleSnippetClick}
|
|
290
|
+
on:mousedown={handleSnippetMouseDown}
|
|
291
|
+
on:mousemove={handleSnippetMouseMove}
|
|
259
292
|
>
|
|
260
293
|
{content}
|
|
261
294
|
</div>
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
{disabled}
|
|
40
40
|
>
|
|
41
41
|
{#if showPassword}
|
|
42
|
-
<IconEyeOff class="size-4 stroke-
|
|
42
|
+
<IconEyeOff class="size-4 stroke-2" aria-hidden="true" />
|
|
43
43
|
{:else}
|
|
44
|
-
<IconEye class="size-4 stroke-
|
|
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-
|
|
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-
|
|
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-
|
|
79
|
+
<IconCircleX class="text-destructive size-4 stroke-2" aria-hidden="true" />
|
|
80
80
|
{:else}
|
|
81
|
-
<IconCircle class="size-4 stroke-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
96
|
+
<IconPin class="stroke-2" />
|
|
97
97
|
</IconButton>
|
|
98
98
|
|
|
99
99
|
<IconButton variant="ghost" label={messages.newChat} onclick={onNewChat}>
|
|
100
|
-
<IconMessagePlus class="stroke-
|
|
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-
|
|
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-
|
|
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-
|
|
166
|
+
<IconPlayerStop class="size-4 stroke-2" aria-hidden="true" />
|
|
167
167
|
{:else}
|
|
168
|
-
<IconSend class="size-4 stroke-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
150
|
+
<IconRefresh class="size-4 stroke-2" aria-hidden="true" />
|
|
151
151
|
</IconButton>
|
|
152
152
|
{/if}
|
|
153
153
|
{#if actions}
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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;
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
44
|
+
<IconCircleCheck class="text-brand size-4 stroke-2" aria-hidden="true" />
|
|
45
45
|
{:else}
|
|
46
|
-
<IconCircle class="text-muted-foreground size-4 stroke-
|
|
46
|
+
<IconCircle class="text-muted-foreground size-4 stroke-2" aria-hidden="true" />
|
|
47
47
|
{/if}
|
|
48
48
|
</span>
|
|
49
49
|
<span
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
64
|
+
<IconCircleCheck class="size-4 stroke-2" aria-hidden="true" />
|
|
65
65
|
{:else if tone === 'destructive'}
|
|
66
|
-
<IconAlertTriangle class="size-4 stroke-
|
|
66
|
+
<IconAlertTriangle class="size-4 stroke-2" aria-hidden="true" />
|
|
67
67
|
{:else}
|
|
68
|
-
<IconInfoCircle class="size-4 stroke-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,7 +4,7 @@
|
|
|
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-
|
|
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',
|
|
@@ -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-
|
|
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-
|
|
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;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
<DialogPrimitive.Close
|
|
130
130
|
class="text-foreground hover:bg-accent duration-fast focus-visible:ring-ring focus-visible:ring-offset-background absolute end-4 top-4 inline-flex size-8 items-center justify-center rounded-lg transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden"
|
|
131
131
|
>
|
|
132
|
-
<IconX class="size-4 stroke-
|
|
132
|
+
<IconX class="size-4 stroke-2" aria-hidden="true" />
|
|
133
133
|
<span class="sr-only">{closeLabel}</span>
|
|
134
134
|
</DialogPrimitive.Close>
|
|
135
135
|
</DialogPrimitive.Content>
|
|
@@ -9,8 +9,8 @@ export declare const widgetRowVariants: import("tailwind-variants").TVReturnType
|
|
|
9
9
|
};
|
|
10
10
|
}, undefined, "group/widget-row flex min-h-16 w-full max-w-content items-center gap-4 rounded-xl py-3 ps-4 pe-4 transition-colors duration-fast focus-within:outline-hidden", {
|
|
11
11
|
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
12
|
-
loading?: boolean | (string | number | symbol)[] | undefined;
|
|
13
12
|
selected?: boolean | (string | number | symbol)[] | undefined;
|
|
13
|
+
loading?: boolean | (string | number | symbol)[] | undefined;
|
|
14
14
|
} | undefined;
|
|
15
15
|
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
16
16
|
twMergeConfig: {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
classes: {
|
|
91
91
|
toast:
|
|
92
92
|
toastMainClass +
|
|
93
|
-
' !fixed !bottom-5 !end-5 !flex !min-w-[20rem] !max-w-[22.25rem] !items-start !gap-3 !rounded-xl !border !border-border !bg-popover !p-4 !text-popover-foreground !shadow-none [&>[data-icon]]:!mt-0.5 [&>[data-icon]]:!size-4 [&>[data-icon]_svg]:!size-4 [&>[data-icon]_svg]:!stroke-
|
|
93
|
+
' !fixed !bottom-5 !end-5 !flex !min-w-[20rem] !max-w-[22.25rem] !items-start !gap-3 !rounded-xl !border !border-border !bg-popover !p-4 !text-popover-foreground !shadow-none [&>[data-icon]]:!mt-0.5 [&>[data-icon]]:!size-4 [&>[data-icon]_svg]:!size-4 [&>[data-icon]_svg]:!stroke-2',
|
|
94
94
|
title: toastMainClass + '-title text-body-medium text-foreground',
|
|
95
95
|
description: toastMainClass + '-description text-body text-muted-foreground',
|
|
96
96
|
actionButton:
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
cancelButton: '',
|
|
99
99
|
closeButton:
|
|
100
100
|
toastMainClass +
|
|
101
|
-
'-close-button !absolute !-start-2 !-top-2 !flex !size-5 !items-center !justify-center !rounded-full !border !border-border !bg-foreground !text-primary-foreground [&_svg]:!size-3 [&_svg]:!stroke-[
|
|
101
|
+
'-close-button !absolute !-start-2 !-top-2 !flex !size-5 !items-center !justify-center !rounded-full !border !border-border !bg-foreground !text-primary-foreground [&_svg]:!size-3 [&_svg]:!stroke-[2.667]',
|
|
102
102
|
// The icon takes the colour of its tone, the Icon modes of Figma: Muted for info (Default), Brand, Warning and Destructive.
|
|
103
103
|
info: '[&>[data-icon]]:!text-muted-foreground',
|
|
104
104
|
success: '[&>[data-icon]]:!text-brand',
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<AccordionPrimitive.Content
|
|
14
14
|
bind:ref
|
|
15
15
|
class={cn(
|
|
16
|
-
"text-body data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden transition-
|
|
16
|
+
"text-body data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden transition-[height]",
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...restProps}
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
{...restProps}
|
|
26
26
|
>
|
|
27
27
|
{@render children?.()}
|
|
28
|
-
<IconChevronDown class="size-4 shrink-0 stroke-
|
|
28
|
+
<IconChevronDown class="size-4 shrink-0 stroke-2 transition-transform duration-base" />
|
|
29
29
|
</AccordionPrimitive.Trigger>
|
|
30
30
|
</AccordionPrimitive.Header>
|