@widgetic/design-system 0.5.30 → 0.5.31
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/chat/OptionRow.svelte +1 -1
- package/dist/components/modals/BaseModal.svelte +6 -6
- package/dist/components/shell/SettingsDialog.svelte +1 -23
- package/dist/components/toast/ToasterModal.svelte +19 -31
- package/dist/components/ui/button/button.svelte +1 -1
- package/dist/components/ui/command/command-item.svelte +1 -1
- package/dist/components/ui/command/command-link-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/dist/components/ui/slider/slider.svelte +17 -6
- package/dist/components/ui/tabs/tabs-trigger.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/fonts.css +4 -33
- package/dist/styles/global.css +114 -20
- package/dist/styles/tokens.css +6 -10
- package/dist/utils/overlayMotion.d.ts +11 -1
- package/dist/utils/overlayMotion.js +16 -8
- package/dist/utils/toastMotion.d.ts +12 -0
- package/dist/utils/toastMotion.js +12 -0
- package/package.json +2 -2
- package/tailwind.config.ts +4 -11
- package/dist/fonts/Cousine/Cousine-Bold.woff2 +0 -0
- package/dist/fonts/Cousine/Cousine-Regular.woff2 +0 -0
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
{disabled}
|
|
42
42
|
class={cn(
|
|
43
43
|
'border-border duration-fast hover:bg-accent focus-visible:ring-ring focus-visible:ring-offset-background flex h-9 w-full items-center gap-2 rounded-lg border px-3 py-2 text-start transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50',
|
|
44
|
-
selected && 'border-primary bg-
|
|
44
|
+
selected && 'border-primary bg-brand-subtle',
|
|
45
45
|
className
|
|
46
46
|
)}
|
|
47
47
|
onclick={() => onSelect?.()}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
// Svelte imports
|
|
3
|
-
import { fade,
|
|
3
|
+
import { fade, fly } from 'svelte/transition';
|
|
4
4
|
import { createEventDispatcher, onDestroy, onMount, tick } from 'svelte';
|
|
5
5
|
const dispatch = createEventDispatcher();
|
|
6
6
|
import {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
} from './modalStore';
|
|
28
28
|
import {
|
|
29
29
|
overlayBackdropBlurPx,
|
|
30
|
-
|
|
30
|
+
overlayContentSlidePx,
|
|
31
31
|
overlayTransitionDurationMs,
|
|
32
32
|
overlayTransitionEasing
|
|
33
33
|
} from '../../utils/overlayMotion.js';
|
|
@@ -466,19 +466,19 @@
|
|
|
466
466
|
z-index: 2;
|
|
467
467
|
"
|
|
468
468
|
bind:offsetHeight={modalHeight}
|
|
469
|
-
in:
|
|
469
|
+
in:fly|global={reduceMotion
|
|
470
470
|
? { duration: 0 }
|
|
471
471
|
: {
|
|
472
472
|
duration: transitionDuration,
|
|
473
|
-
|
|
473
|
+
y: overlayContentSlidePx,
|
|
474
474
|
opacity: 0,
|
|
475
475
|
easing
|
|
476
476
|
}}
|
|
477
|
-
out:
|
|
477
|
+
out:fly|global={reduceMotion
|
|
478
478
|
? { duration: 0 }
|
|
479
479
|
: {
|
|
480
480
|
duration: transitionDuration,
|
|
481
|
-
|
|
481
|
+
y: overlayContentSlidePx,
|
|
482
482
|
opacity: 0,
|
|
483
483
|
easing
|
|
484
484
|
}}
|
|
@@ -82,17 +82,6 @@
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// The close button is in the corner of the dialog, above whatever the page under the title shows. While that page is scrolled
|
|
86
|
-
// away from the top the button fades out (250 ms, none with reduced motion) and takes neither clicks nor focus (it is inert);
|
|
87
|
-
// at the top it comes back. Escape and a click on the scrim still close the dialog while the button is away.
|
|
88
|
-
// 1px of tolerance: a page at rest at the top can report a fraction of a pixel on a scaled screen.
|
|
89
|
-
const PANE_SCROLLED_AFTER_PX = 1;
|
|
90
|
-
let paneScrolled = $state(false);
|
|
91
|
-
|
|
92
|
-
function handlePaneScroll(event: Event): void {
|
|
93
|
-
paneScrolled = (event.currentTarget as HTMLElement).scrollTop > PANE_SCROLLED_AFTER_PX;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
85
|
// Parent keeps pe-8 (32px). A native bar always sits against the content box, so when the page scrolls we
|
|
97
86
|
// (1) pull the scroll area into that padding and (2) add matching padding-right so the cards stay on the
|
|
98
87
|
// pe-8 line and the bar is centred in the leftover space between the cards and the dialog edge.
|
|
@@ -182,23 +171,12 @@
|
|
|
182
171
|
class="settings-dialog-pane-scroll -mt-1.5 -me-1.5 flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto overflow-x-hidden ps-8 pt-1.5 pe-1.5 pb-8"
|
|
183
172
|
use:overlayScrollbar
|
|
184
173
|
style={paneScrollStyle}
|
|
185
|
-
onscroll={handlePaneScroll}
|
|
186
174
|
>
|
|
187
175
|
{@render children()}
|
|
188
176
|
</div>
|
|
189
177
|
</div>
|
|
190
178
|
</div>
|
|
191
|
-
|
|
192
|
-
tab order and of what a screen reader reads while it is hidden. -->
|
|
193
|
-
<div
|
|
194
|
-
class={cn(
|
|
195
|
-
'duration-slow absolute end-2 top-2 transition-opacity motion-reduce:transition-none',
|
|
196
|
-
paneScrolled && 'pointer-events-none opacity-0'
|
|
197
|
-
)}
|
|
198
|
-
inert={paneScrolled || undefined}
|
|
199
|
-
data-settings-dialog-close-box
|
|
200
|
-
data-scrolled={paneScrolled || undefined}
|
|
201
|
-
>
|
|
179
|
+
<div class="absolute end-2 top-2" data-settings-dialog-close-box>
|
|
202
180
|
<DialogPrimitive.Close
|
|
203
181
|
class="text-foreground hover:bg-accent duration-fast focus-visible:ring-ring focus-visible:ring-offset-background 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"
|
|
204
182
|
>
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
import IconExclamationCircle from '@tabler/icons-svelte/icons/exclamation-circle';
|
|
6
6
|
import IconInfoCircle from '@tabler/icons-svelte/icons/info-circle';
|
|
7
7
|
import { toastLookupRoots } from './toasterRoots';
|
|
8
|
+
import { toastEnterDurationMs, toastExitDurationMs } from '../../utils/toastMotion.js';
|
|
8
9
|
|
|
9
10
|
type ToastTypes = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
10
11
|
|
|
11
|
-
// Icon of each tone: the same glyphs as the Tone variants of the Toast in Figma (135:87).
|
|
12
|
-
// `info` is the Default tone of Figma. `loading` keeps the spinner of the library.
|
|
13
12
|
const toneIcons: Partial<Record<ToastTypes, typeof IconInfoCircle>> = {
|
|
14
13
|
info: IconInfoCircle,
|
|
15
14
|
success: IconCircleCheck,
|
|
@@ -24,26 +23,21 @@
|
|
|
24
23
|
export let element: HTMLElement | null = null;
|
|
25
24
|
|
|
26
25
|
let toastMainClass = 'toast-modal';
|
|
27
|
-
let isToastVisible = false;
|
|
28
26
|
|
|
29
27
|
export function showToast(
|
|
30
28
|
type: string = 'success',
|
|
31
29
|
title: string,
|
|
32
30
|
options: Record<string, unknown> | null = null
|
|
33
31
|
) {
|
|
34
|
-
isToastVisible = true;
|
|
35
|
-
|
|
36
32
|
if (options === null) {
|
|
37
33
|
options = {};
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
const duration = (options?.duration as number | undefined) || defaultDuration;
|
|
41
37
|
|
|
42
|
-
// Every tone has its own icon, the same one as in Figma, so a caller does not swap it.
|
|
43
38
|
const toneIcon = toneIcons[type as ToastTypes];
|
|
44
39
|
if (toneIcon) options.icon = toneIcon;
|
|
45
40
|
|
|
46
|
-
// A type the library does not know is shown as info instead of throwing, and says so once.
|
|
47
41
|
let toastKey: ToastTypes = type as ToastTypes;
|
|
48
42
|
if (typeof toast[toastKey] !== 'function') {
|
|
49
43
|
console.warn(`[showToast] Unknown toast type "${type}", showing it as info.`);
|
|
@@ -53,13 +47,7 @@
|
|
|
53
47
|
return toast[toastKey](title, {
|
|
54
48
|
...options,
|
|
55
49
|
duration,
|
|
56
|
-
unstyled: true
|
|
57
|
-
onAutoClose: () => {
|
|
58
|
-
isToastVisible = false;
|
|
59
|
-
},
|
|
60
|
-
onDismiss: () => {
|
|
61
|
-
isToastVisible = false;
|
|
62
|
-
}
|
|
50
|
+
unstyled: true
|
|
63
51
|
});
|
|
64
52
|
}
|
|
65
53
|
</script>
|
|
@@ -82,35 +70,35 @@
|
|
|
82
70
|
<Toaster
|
|
83
71
|
theme="light"
|
|
84
72
|
dir={$textDirection}
|
|
85
|
-
position=
|
|
73
|
+
position="top-center"
|
|
86
74
|
{containerAriaLabel}
|
|
87
75
|
{closeButtonAriaLabel}
|
|
88
76
|
closeButton
|
|
89
77
|
toastOptions={{
|
|
78
|
+
duration: defaultDuration,
|
|
90
79
|
classes: {
|
|
91
80
|
toast:
|
|
92
81
|
toastMainClass +
|
|
93
|
-
' !
|
|
94
|
-
title: toastMainClass + '-title text-
|
|
95
|
-
description: toastMainClass + '-description text-
|
|
82
|
+
' !flex !min-w-0 !max-w-[420px] !flex-wrap !items-center !gap-2 !rounded-xl !border !px-4 !py-2.5 !pe-9 !text-sm !font-medium !shadow-none [&>[data-icon]]:!hidden',
|
|
83
|
+
title: toastMainClass + '-title !text-inherit',
|
|
84
|
+
description: toastMainClass + '-description !text-inherit/90 !text-sm',
|
|
96
85
|
actionButton:
|
|
97
|
-
'!h-8 !rounded-lg !border !border-
|
|
86
|
+
'!h-8 !rounded-lg !border !border-current/30 !bg-transparent !px-2 !text-label !text-inherit hover:!bg-current/15',
|
|
98
87
|
cancelButton: '',
|
|
99
|
-
// The same X as the one of the settings dialog: a plain X, no background, inside the toast at its end and top
|
|
100
|
-
// (16px, 2 stroke; its 32px target tints on hover and on the keyboard focus, as the dialog's does).
|
|
101
88
|
closeButton:
|
|
102
89
|
toastMainClass +
|
|
103
|
-
'-close-button !absolute !end-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
warning: '[&>[data-icon]]:!
|
|
108
|
-
error:
|
|
90
|
+
'-close-button !absolute !end-1.5 !top-1/2 !-translate-y-1/2 !flex !size-7 !items-center justify-center !rounded-full !border-0 !bg-transparent !p-0 !text-inherit !transition-colors hover:!bg-current/20 focus-visible:!bg-current/20 focus-visible:!outline-hidden [&_svg]:!size-3.5 [&_svg]:!stroke-2',
|
|
91
|
+
info: '!border-border !bg-popover !text-popover-foreground',
|
|
92
|
+
success:
|
|
93
|
+
'!border-transparent !bg-toast-green !text-inverse-foreground [&>[data-icon]]:!hidden',
|
|
94
|
+
warning: '!border-transparent !bg-warning !text-primary-foreground [&>[data-icon]]:!hidden',
|
|
95
|
+
error:
|
|
96
|
+
'!border-transparent !bg-destructive !text-destructive-foreground [&>[data-icon]]:!hidden'
|
|
109
97
|
}
|
|
110
98
|
}}
|
|
111
|
-
expand={
|
|
112
|
-
visibleToasts={
|
|
99
|
+
expand={true}
|
|
100
|
+
visibleToasts={3}
|
|
113
101
|
offset="1rem"
|
|
114
|
-
class={className}
|
|
115
|
-
{style}
|
|
102
|
+
class="{className} toast-modal-host"
|
|
103
|
+
style="--toast-enter-ms: {toastEnterDurationMs}ms; --toast-exit-ms: {toastExitDurationMs}ms;{style}"
|
|
116
104
|
/>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
destructive:
|
|
23
23
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:bg-destructive/90",
|
|
24
24
|
outline:
|
|
25
|
-
"border border-input bg-background text-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground",
|
|
25
|
+
"border border-input bg-background text-foreground hover:bg-accent-hover hover:text-foreground focus-visible:bg-accent-hover focus-visible:text-foreground active:bg-accent-hover",
|
|
26
26
|
secondary:
|
|
27
27
|
"bg-secondary text-secondary-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground",
|
|
28
28
|
ghost: "text-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<CommandPrimitive.Item
|
|
17
17
|
class={cn(
|
|
18
|
-
"text-body
|
|
18
|
+
"text-body data-[selected]:bg-brand-subtle hover:not-data-[selected]:bg-accent relative flex h-8 cursor-pointer select-none items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2",
|
|
19
19
|
className
|
|
20
20
|
)}
|
|
21
21
|
bind:ref
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<CommandPrimitive.LinkItem
|
|
17
17
|
class={cn(
|
|
18
|
-
"
|
|
18
|
+
"data-[selected]:bg-brand-subtle hover:not-data-[selected]:bg-accent relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
19
19
|
className
|
|
20
20
|
)}
|
|
21
21
|
bind:ref
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
bind:checked
|
|
23
23
|
bind:indeterminate
|
|
24
24
|
class={cn(
|
|
25
|
-
"text-body data-highlighted:bg-accent data-highlighted:text-foreground relative flex h-8 cursor-pointer select-none items-center rounded-lg py-1.5 ps-8 pe-2 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
25
|
+
"text-body data-[state=checked]:bg-brand-subtle data-highlighted:data-[state=checked]:bg-brand-subtle data-highlighted:not-data-[state=checked]:bg-accent data-highlighted:text-foreground relative flex h-8 cursor-pointer select-none items-center rounded-lg py-1.5 ps-8 pe-2 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
26
26
|
className
|
|
27
27
|
)}
|
|
28
28
|
{...restProps}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<DropdownMenuPrimitive.Item
|
|
23
23
|
bind:ref
|
|
24
24
|
class={cn(
|
|
25
|
-
"text-body data-highlighted:bg-accent data-highlighted:text-foreground relative flex cursor-pointer select-none items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 data-[variant=destructive]:text-destructive data-highlighted:data-[variant=destructive]:text-destructive",
|
|
25
|
+
"text-body aria-current:bg-brand-subtle data-highlighted:aria-current:bg-brand-subtle data-highlighted:not-aria-current:bg-accent data-highlighted:text-foreground relative flex cursor-pointer select-none items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 data-[variant=destructive]:text-destructive data-highlighted:data-[variant=destructive]:text-destructive",
|
|
26
26
|
description ? "min-h-12" : "min-h-8",
|
|
27
27
|
inset && "ps-8",
|
|
28
28
|
className
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<DropdownMenuPrimitive.RadioItem
|
|
19
19
|
bind:ref
|
|
20
20
|
class={cn(
|
|
21
|
-
"text-body data-highlighted:bg-accent data-highlighted:text-foreground relative flex h-8 cursor-pointer select-none items-center rounded-lg py-1.5 ps-8 pe-2 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
21
|
+
"text-body data-[state=checked]:bg-brand-subtle data-highlighted:data-[state=checked]:bg-brand-subtle data-highlighted:not-data-[state=checked]:bg-accent data-highlighted:text-foreground relative flex h-8 cursor-pointer select-none items-center rounded-lg py-1.5 ps-8 pe-2 outline-hidden transition-colors duration-fast data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...restProps}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
Figma: IC Slider (Editor); track input, range primary, 4px track / 16px thumb.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
The root is as tall (or as wide, when vertical) as the thumb so a press anywhere in that band jumps the scrub, not only on the
|
|
5
|
+
thin track line. `aria-label` and `aria-labelledby` name the thumb, which is the element a screen reader lands on (the root is a
|
|
6
|
+
plain span with no role, so a name on it is never spoken). With two thumbs (a range) each one gets the name and its place:
|
|
7
|
+
"Price 1", "Price 2".
|
|
6
8
|
-->
|
|
7
9
|
<script lang="ts" module>
|
|
8
10
|
import { Slider as SliderPrimitive, type WithoutChildrenOrChild } from "bits-ui";
|
|
@@ -34,20 +36,29 @@
|
|
|
34
36
|
<SliderPrimitive.Root
|
|
35
37
|
bind:value={value as never}
|
|
36
38
|
bind:ref
|
|
37
|
-
class={cn(
|
|
39
|
+
class={cn(
|
|
40
|
+
"group relative flex w-full min-h-4 touch-none select-none items-center cursor-pointer data-[disabled]:cursor-not-allowed data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-0 data-[orientation=vertical]:w-auto data-[orientation=vertical]:min-w-4 data-[orientation=vertical]:flex-col data-[orientation=vertical]:justify-center",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
38
43
|
dir={$textDirection}
|
|
39
44
|
{...restProps}
|
|
40
45
|
>
|
|
41
46
|
{#snippet children({ thumbs })}
|
|
42
|
-
<span
|
|
43
|
-
|
|
47
|
+
<span
|
|
48
|
+
class="relative flex h-4 w-full grow items-center group-data-[orientation=vertical]:h-full group-data-[orientation=vertical]:w-4 group-data-[orientation=vertical]:flex-col group-data-[orientation=vertical]:justify-center"
|
|
49
|
+
>
|
|
50
|
+
<span
|
|
51
|
+
class="relative h-1 w-full overflow-hidden rounded-full bg-input group-data-[orientation=vertical]:h-full group-data-[orientation=vertical]:w-1"
|
|
52
|
+
>
|
|
53
|
+
<SliderPrimitive.Range class="absolute z-10 h-full w-full rounded-full bg-primary" />
|
|
54
|
+
</span>
|
|
44
55
|
</span>
|
|
45
56
|
{#each thumbs as thumb}
|
|
46
57
|
<SliderPrimitive.Thumb
|
|
47
58
|
index={thumb}
|
|
48
59
|
aria-label={thumbLabel(thumb, thumbs.length)}
|
|
49
60
|
aria-labelledby={ariaLabelledby}
|
|
50
|
-
class="relative z-20 block size-4 rounded-full border-2 border-primary bg-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50"
|
|
61
|
+
class="relative z-20 block size-4 cursor-grab rounded-full border-2 border-primary bg-background data-active:cursor-grabbing focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50"
|
|
51
62
|
/>
|
|
52
63
|
{/each}
|
|
53
64
|
{/snippet}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<TabsPrimitive.Trigger
|
|
17
17
|
bind:ref
|
|
18
18
|
class={cn(
|
|
19
|
-
"text-label focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground inline-flex h-7 items-center justify-center whitespace-nowrap rounded-lg px-3 transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[state=inactive]:hover:bg-accent data-[state=inactive]:hover:text-foreground",
|
|
19
|
+
"text-label focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground inline-flex h-7 cursor-pointer items-center justify-center whitespace-nowrap rounded-lg px-3 transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=inactive]:hover:bg-accent data-[state=inactive]:hover:text-foreground",
|
|
20
20
|
className
|
|
21
21
|
)}
|
|
22
22
|
{...restProps}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { VariantProps } from "tailwind-variants";
|
|
4
4
|
|
|
5
5
|
export const toggleVariants = tv({
|
|
6
|
-
base: "inline-flex items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent",
|
|
6
|
+
base: "inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent",
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "bg-transparent text-foreground",
|
|
@@ -9,7 +9,7 @@ export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
|
9
9
|
sm: string;
|
|
10
10
|
lg: string;
|
|
11
11
|
};
|
|
12
|
-
}, undefined, "inline-flex items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent", {
|
|
12
|
+
}, undefined, "inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent", {
|
|
13
13
|
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
14
14
|
size?: boolean | (string | number | symbol)[] | undefined;
|
|
15
15
|
variant?: boolean | (string | number | symbol)[] | undefined;
|
|
@@ -42,7 +42,7 @@ export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
|
42
42
|
sm: string;
|
|
43
43
|
lg: string;
|
|
44
44
|
};
|
|
45
|
-
}, undefined, "inline-flex items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
45
|
+
}, undefined, "inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg text-label 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-brand-subtle data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2 hover:bg-accent", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
46
46
|
variant: {
|
|
47
47
|
default: string;
|
|
48
48
|
outline: string;
|
package/dist/styles/fonts.css
CHANGED
|
@@ -124,24 +124,10 @@
|
|
|
124
124
|
font-display: swap;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/*
|
|
128
|
-
|
|
129
|
-
font-family: 'Cousine';
|
|
130
|
-
src: url('../fonts/Cousine/Cousine-Regular.woff2') format('woff2');
|
|
131
|
-
font-weight: 400;
|
|
132
|
-
font-style: normal;
|
|
133
|
-
font-display: swap;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@font-face {
|
|
137
|
-
font-family: 'Cousine';
|
|
138
|
-
src: url('../fonts/Cousine/Cousine-Bold.woff2') format('woff2');
|
|
139
|
-
font-weight: 700;
|
|
140
|
-
font-style: normal;
|
|
141
|
-
font-display: swap;
|
|
142
|
-
}
|
|
127
|
+
/* Cousine (Code & Embed Snippets) was removed in round 31: no Figma style, no utility in use and no consumer set a font in it.
|
|
128
|
+
Code is JetBrains Mono, everywhere. */
|
|
143
129
|
|
|
144
|
-
/* Typography Utilities updated to Inter, JetBrains Mono
|
|
130
|
+
/* Typography Utilities updated to Inter, JetBrains Mono and Figma Foundations (node 41:90) */
|
|
145
131
|
@utility h1 {
|
|
146
132
|
font-family: 'Inter', system-ui, sans-serif;
|
|
147
133
|
font-weight: 800;
|
|
@@ -436,22 +422,7 @@
|
|
|
436
422
|
letter-spacing: -3.24px;
|
|
437
423
|
}
|
|
438
424
|
|
|
439
|
-
/* 14.
|
|
440
|
-
@utility mono-code {
|
|
441
|
-
font-family: 'Cousine', monospace;
|
|
442
|
-
font-size: 12px;
|
|
443
|
-
line-height: 19.8px;
|
|
444
|
-
font-weight: 400;
|
|
445
|
-
letter-spacing: -0.24px;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
@utility code-snippet {
|
|
449
|
-
font-family: 'Cousine', monospace;
|
|
450
|
-
font-size: 12px;
|
|
451
|
-
line-height: 19.8px;
|
|
452
|
-
font-weight: 400;
|
|
453
|
-
letter-spacing: -0.24px;
|
|
454
|
-
}
|
|
425
|
+
/* 14. (mono-code and code-snippet, set in Cousine, were removed in round 31: nothing used them. Use text-code, or font-mono.) */
|
|
455
426
|
|
|
456
427
|
@utility label-cta {
|
|
457
428
|
font-family: 'Inter', system-ui, sans-serif;
|
package/dist/styles/global.css
CHANGED
|
@@ -28,18 +28,10 @@ go 3 levels up in development mode, 2 levels up in production mode*/
|
|
|
28
28
|
--color-grey6: hsl(var(--grey6));
|
|
29
29
|
--color-grey7: hsl(var(--grey7));
|
|
30
30
|
|
|
31
|
-
/* Figma Foundations Tokens (01 — Foundations 38:142) */
|
|
31
|
+
/* Figma Foundations Tokens (01 — Foundations 38:142). Round 31 removed the eight that no code read (ink-secondary, ink-muted, surface-canvas, surface-dark, surface-ink-on-dark, accent-orange, accent-green, primary-green-muted): see __docs/migrating-to-the-new-tokens.md. */
|
|
32
32
|
--color-ink-primary: hsl(var(--ink-primary));
|
|
33
33
|
--color-primary-green: hsl(var(--primary-green));
|
|
34
|
-
--color-ink-secondary: hsl(var(--ink-secondary));
|
|
35
|
-
--color-ink-muted: hsl(var(--ink-muted));
|
|
36
34
|
--color-ink-subtle: hsl(var(--ink-subtle));
|
|
37
|
-
--color-surface-canvas: hsl(var(--surface-canvas));
|
|
38
|
-
--color-surface-dark: hsl(var(--surface-dark));
|
|
39
|
-
--color-surface-ink-on-dark: hsl(var(--surface-ink-on-dark));
|
|
40
|
-
--color-accent-orange: hsl(var(--accent-orange));
|
|
41
|
-
--color-accent-green: hsl(var(--accent-green));
|
|
42
|
-
--color-primary-green-muted: hsl(var(--primary-green-muted));
|
|
43
35
|
|
|
44
36
|
--radius-pill: 100px;
|
|
45
37
|
--radius-large: 15px;
|
|
@@ -135,8 +127,7 @@ go 3 levels up in development mode, 2 levels up in production mode*/
|
|
|
135
127
|
--scrollbar-thumb-hover-color: hsl(var(--grey3));
|
|
136
128
|
--scrollbar-track-color: hsl(var(--grey1));
|
|
137
129
|
|
|
138
|
-
/* Icon Colors */
|
|
139
|
-
--icon-success: 142 71% 45%;
|
|
130
|
+
/* Icon Colors (--icon-success was removed in round 31: nothing read it) */
|
|
140
131
|
--icon-error: 0 84% 60%;
|
|
141
132
|
|
|
142
133
|
|
|
@@ -161,18 +152,10 @@ go 3 levels up in development mode, 2 levels up in production mode*/
|
|
|
161
152
|
--grey6: 0 0% 26.7%; /* #444444 */
|
|
162
153
|
--grey7: 124 36.2% 9.2%; /* #0F2010 */
|
|
163
154
|
|
|
164
|
-
/* Figma Foundations Tokens (01 — Foundations 38:142) */
|
|
155
|
+
/* Figma Foundations Tokens (01 — Foundations 38:142). The other eight of this block were removed in round 31 (nothing read them). */
|
|
165
156
|
--ink-primary: 124 36.2% 9.2%; /* #0F2010 */
|
|
166
157
|
--primary-green: 116.3 25.4% 24.7%; /* #314F2F */
|
|
167
|
-
--ink-secondary: 0 0% 26.7%; /* #444444 */
|
|
168
|
-
--ink-muted: 0 0% 45.9%; /* #757575 */
|
|
169
158
|
--ink-subtle: 0 0% 40%; /* #666666 */
|
|
170
|
-
--surface-canvas: 0 0% 100%; /* #FFFFFF */
|
|
171
|
-
--surface-dark: 124 36.2% 9.2%; /* #0F2010 */
|
|
172
|
-
--surface-ink-on-dark: 0 0% 100%; /* #FFFFFF */
|
|
173
|
-
--accent-orange: 0 88.6% 65.7%; /* #F55A5A */
|
|
174
|
-
--accent-green: 101.6 25.8% 52.9%; /* #7BA668 */
|
|
175
|
-
--primary-green-muted: 88.2 20% 83.3%; /* #D5DDCC */
|
|
176
159
|
|
|
177
160
|
|
|
178
161
|
|
|
@@ -953,6 +936,117 @@ go 3 levels up in development mode, 2 levels up in production mode*/
|
|
|
953
936
|
}
|
|
954
937
|
} /* End of Base Layer Styles */
|
|
955
938
|
|
|
939
|
+
/* Centred bits-ui dialog panels: fade + 20px slide (no zoom); composes with -translate-x/y-1/2 centering. */
|
|
940
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
941
|
+
[data-widgetic-overlay='dialog-panel'][data-state='open'] {
|
|
942
|
+
animation: widgetic-dialog-enter 200ms cubic-bezier(0.33, 1, 0.68, 1) both;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
[data-widgetic-overlay='dialog-panel'][data-state='closed'] {
|
|
946
|
+
animation: widgetic-dialog-exit 200ms cubic-bezier(0.33, 1, 0.68, 1) both;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
@media (prefers-reduced-motion: reduce) {
|
|
951
|
+
[data-widgetic-overlay='dialog-panel'][data-state='open'] {
|
|
952
|
+
animation: widgetic-dialog-fade-in 200ms cubic-bezier(0.33, 1, 0.68, 1) both;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
[data-widgetic-overlay='dialog-panel'][data-state='closed'] {
|
|
956
|
+
animation: widgetic-dialog-fade-out 200ms cubic-bezier(0.33, 1, 0.68, 1) both;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
@keyframes widgetic-dialog-enter {
|
|
961
|
+
from {
|
|
962
|
+
opacity: 0;
|
|
963
|
+
transform: translate(-50%, calc(-50% + 20px));
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
to {
|
|
967
|
+
opacity: 1;
|
|
968
|
+
transform: translate(-50%, -50%);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
@keyframes widgetic-dialog-exit {
|
|
973
|
+
from {
|
|
974
|
+
opacity: 1;
|
|
975
|
+
transform: translate(-50%, -50%);
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
to {
|
|
979
|
+
opacity: 0;
|
|
980
|
+
transform: translate(-50%, calc(-50% + 20px));
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
@keyframes widgetic-dialog-fade-in {
|
|
985
|
+
from {
|
|
986
|
+
opacity: 0;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
to {
|
|
990
|
+
opacity: 1;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
@keyframes widgetic-dialog-fade-out {
|
|
995
|
+
from {
|
|
996
|
+
opacity: 1;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
to {
|
|
1000
|
+
opacity: 0;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/* Toast (ToasterModal): top-centre pill, slide in, fade out in place. */
|
|
1005
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1006
|
+
[data-sonner-toaster][data-y-position='top'] {
|
|
1007
|
+
top: 1rem !important;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
[data-sonner-toaster][data-y-position='top'] [data-sonner-toast][data-mounted] {
|
|
1011
|
+
animation: widgetic-toast-enter var(--toast-enter-ms, 200ms) cubic-bezier(0.33, 1, 0.68, 1);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
[data-sonner-toaster][data-y-position='top'] [data-sonner-toast][data-removed='true'] {
|
|
1015
|
+
animation: widgetic-toast-exit var(--toast-exit-ms, 150ms) ease-out forwards;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
@keyframes widgetic-toast-enter {
|
|
1020
|
+
from {
|
|
1021
|
+
opacity: 0;
|
|
1022
|
+
transform: translate(-50%, -16px);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
to {
|
|
1026
|
+
opacity: 1;
|
|
1027
|
+
transform: translate(-50%, 0);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
@keyframes widgetic-toast-exit {
|
|
1032
|
+
from {
|
|
1033
|
+
opacity: 1;
|
|
1034
|
+
transform: translate(-50%, 0);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
to {
|
|
1038
|
+
opacity: 0;
|
|
1039
|
+
transform: translate(-50%, 0);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1044
|
+
[data-sonner-toaster][data-y-position='top'] [data-sonner-toast][data-mounted],
|
|
1045
|
+
[data-sonner-toaster][data-y-position='top'] [data-sonner-toast][data-removed='true'] {
|
|
1046
|
+
animation: none !important;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
956
1050
|
/* Debug styles */
|
|
957
1051
|
[data-debug="true"] [data-debug-footer] {
|
|
958
1052
|
@apply bg-blue-100/30;
|
package/dist/styles/tokens.css
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
--color-amber: #b45309;
|
|
17
17
|
--color-sage-green: #7ba668;
|
|
18
18
|
--color-light-green: #e3f0db;
|
|
19
|
+
/*
|
|
20
|
+
* Success toast pill (round 5): the green of the reference toast, one step darker so that white 14px/500 text keeps 4.5:1 (4.54:1).
|
|
21
|
+
* Used by the toast only, and not a Figma variable yet (add it to the Color collection before it is used anywhere else).
|
|
22
|
+
*/
|
|
23
|
+
--color-toast-green: #008932;
|
|
19
24
|
|
|
20
25
|
--color-alpha-dark-04: color-mix(in oklab, var(--color-dark) 4%, transparent);
|
|
21
26
|
--color-alpha-dark-08: color-mix(in oklab, var(--color-dark) 8%, transparent);
|
|
@@ -56,7 +61,7 @@
|
|
|
56
61
|
--accent-hover: var(--color-alpha-dark-08);
|
|
57
62
|
--destructive: var(--color-error);
|
|
58
63
|
--destructive-foreground: var(--color-white);
|
|
59
|
-
/* Warning icon and text, 5.0:1 on white
|
|
64
|
+
/* Warning icon and text, 5.0:1 on white, and the surface of the Warning toast (white text on it is 5.0:1 too). Never a button. */
|
|
60
65
|
--warning: var(--color-amber);
|
|
61
66
|
--brand: var(--color-sage-green);
|
|
62
67
|
--brand-foreground: var(--color-dark);
|
|
@@ -67,11 +72,8 @@
|
|
|
67
72
|
--ring: var(--color-deep-forest-green);
|
|
68
73
|
--sidebar: var(--color-neutral-100);
|
|
69
74
|
--sidebar-foreground: var(--color-dark);
|
|
70
|
-
--sidebar-primary: var(--color-deep-forest-green);
|
|
71
|
-
--sidebar-primary-foreground: var(--color-white);
|
|
72
75
|
--sidebar-accent: var(--color-alpha-dark-04);
|
|
73
76
|
--sidebar-accent-foreground: var(--color-dark);
|
|
74
|
-
--sidebar-border: var(--color-neutral-200);
|
|
75
77
|
--sidebar-ring: var(--color-deep-forest-green);
|
|
76
78
|
--shadow-soft: var(--color-alpha-dark-08);
|
|
77
79
|
--inverse: var(--color-dark);
|
|
@@ -170,11 +172,8 @@
|
|
|
170
172
|
--ring: var(--color-sage-green);
|
|
171
173
|
--sidebar: var(--color-dark);
|
|
172
174
|
--sidebar-foreground: var(--color-white);
|
|
173
|
-
--sidebar-primary: var(--color-sage-green);
|
|
174
|
-
--sidebar-primary-foreground: var(--color-dark);
|
|
175
175
|
--sidebar-accent: var(--color-alpha-light-10);
|
|
176
176
|
--sidebar-accent-foreground: var(--color-white);
|
|
177
|
-
--sidebar-border: var(--color-alpha-sage-25);
|
|
178
177
|
--sidebar-ring: var(--color-sage-green);
|
|
179
178
|
}
|
|
180
179
|
|
|
@@ -206,11 +205,8 @@
|
|
|
206
205
|
--color-ring: var(--ring);
|
|
207
206
|
--color-sidebar: var(--sidebar);
|
|
208
207
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
209
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
210
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
211
208
|
--color-sidebar-accent: var(--sidebar-accent);
|
|
212
209
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
213
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
214
210
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
215
211
|
--color-inverse: var(--inverse);
|
|
216
212
|
--color-inverse-foreground: var(--inverse-foreground);
|
|
@@ -15,6 +15,15 @@ export declare const overlayTransitionEasing: typeof cubicOut;
|
|
|
15
15
|
export declare const overlayBackdropBlurPx = 3;
|
|
16
16
|
/** Content scale at the start of the open transition / end of the close transition. */
|
|
17
17
|
export declare const overlayContentScaleStart = 0.95;
|
|
18
|
+
/**
|
|
19
|
+
* Centred dialogs slide this many pixels up on open and down on close, with the same duration as the fade.
|
|
20
|
+
* Tailwind spacing step (5 → 20px with the design-system scale).
|
|
21
|
+
*/
|
|
22
|
+
export declare const overlayContentSlideDistance = 5;
|
|
23
|
+
/** Pixel slide distance for Svelte `fly` on centred modals (Tailwind spacing step 5 → 20px). */
|
|
24
|
+
export declare const overlayContentSlidePx: number;
|
|
25
|
+
/** Tailwind slide utilities for centred dialog panels (not drawers/sheets that enter from the side). */
|
|
26
|
+
export declare const overlayDialogContentSlideClasses: readonly ["data-[state=closed]:slide-out-to-bottom-5", "data-[state=open]:slide-in-from-bottom-5"];
|
|
18
27
|
/**
|
|
19
28
|
* Tailwind duration class — must be a source literal so Tailwind's scanner emits `duration-[200ms]`.
|
|
20
29
|
* Kept in sync with `overlayTransitionDurationMs` (see tests/overlayMotionDuration.test.ts).
|
|
@@ -48,8 +57,9 @@ export declare const overlayEasingClass = "ease-[cubic-bezier(0.33,1,0.68,1)]";
|
|
|
48
57
|
* blur off. Literal so Tailwind's scanner emits it.
|
|
49
58
|
*/
|
|
50
59
|
export declare const overlayStackedScrimClass = "data-[stacked]:backdrop-blur-none";
|
|
51
|
-
/** Overlay + panel classes for bits-ui Dialog (
|
|
60
|
+
/** Overlay + panel classes for bits-ui Dialog (fade + slide, 200ms, cubic-out-like; no zoom). */
|
|
52
61
|
export declare const overlayDialogOverlayClasses: string;
|
|
62
|
+
/** Centred dialog panel motion is keyed in global.css (`widgetic-dialog-enter/exit`) so slide composes with -translate-x/y-1/2. */
|
|
53
63
|
export declare const overlayDialogContentClasses: string;
|
|
54
64
|
/** Applied with overlay dialog classes so users who prefer reduced motion get instant open/close. */
|
|
55
65
|
export declare const overlayReducedMotionClasses = "motion-reduce:!duration-0 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none";
|
|
@@ -15,6 +15,18 @@ export const overlayTransitionEasing = cubicOut;
|
|
|
15
15
|
export const overlayBackdropBlurPx = 3;
|
|
16
16
|
/** Content scale at the start of the open transition / end of the close transition. */
|
|
17
17
|
export const overlayContentScaleStart = 0.95;
|
|
18
|
+
/**
|
|
19
|
+
* Centred dialogs slide this many pixels up on open and down on close, with the same duration as the fade.
|
|
20
|
+
* Tailwind spacing step (5 → 20px with the design-system scale).
|
|
21
|
+
*/
|
|
22
|
+
export const overlayContentSlideDistance = 5;
|
|
23
|
+
/** Pixel slide distance for Svelte `fly` on centred modals (Tailwind spacing step 5 → 20px). */
|
|
24
|
+
export const overlayContentSlidePx = overlayContentSlideDistance * 4;
|
|
25
|
+
/** Tailwind slide utilities for centred dialog panels (not drawers/sheets that enter from the side). */
|
|
26
|
+
export const overlayDialogContentSlideClasses = [
|
|
27
|
+
`data-[state=closed]:slide-out-to-bottom-${overlayContentSlideDistance}`,
|
|
28
|
+
`data-[state=open]:slide-in-from-bottom-${overlayContentSlideDistance}`
|
|
29
|
+
];
|
|
18
30
|
/**
|
|
19
31
|
* Tailwind duration class — must be a source literal so Tailwind's scanner emits `duration-[200ms]`.
|
|
20
32
|
* Kept in sync with `overlayTransitionDurationMs` (see tests/overlayMotionDuration.test.ts).
|
|
@@ -51,7 +63,7 @@ export const overlayEasingClass = 'ease-[cubic-bezier(0.33,1,0.68,1)]';
|
|
|
51
63
|
* blur off. Literal so Tailwind's scanner emits it.
|
|
52
64
|
*/
|
|
53
65
|
export const overlayStackedScrimClass = 'data-[stacked]:backdrop-blur-none';
|
|
54
|
-
/** Overlay + panel classes for bits-ui Dialog (
|
|
66
|
+
/** Overlay + panel classes for bits-ui Dialog (fade + slide, 200ms, cubic-out-like; no zoom). */
|
|
55
67
|
export const overlayDialogOverlayClasses = [
|
|
56
68
|
overlayScrimClasses,
|
|
57
69
|
overlayStackedScrimClass,
|
|
@@ -63,16 +75,12 @@ export const overlayDialogOverlayClasses = [
|
|
|
63
75
|
`data-[state=closed]:fade-out-0`,
|
|
64
76
|
`data-[state=open]:fade-in-0`
|
|
65
77
|
].join(' ');
|
|
78
|
+
/** Centred dialog panel motion is keyed in global.css (`widgetic-dialog-enter/exit`) so slide composes with -translate-x/y-1/2. */
|
|
66
79
|
export const overlayDialogContentClasses = [
|
|
67
80
|
overlayDurationClass,
|
|
68
81
|
overlayEasingClass,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
`data-[state=closed]:animate-out`,
|
|
72
|
-
`data-[state=closed]:fade-out-0`,
|
|
73
|
-
`data-[state=open]:fade-in-0`,
|
|
74
|
-
`data-[state=closed]:zoom-out-95`,
|
|
75
|
-
`data-[state=open]:zoom-in-95`
|
|
82
|
+
'widgetic-dialog-panel-motion',
|
|
83
|
+
...overlayDialogOpenClosedAnimationDurationClasses
|
|
76
84
|
].join(' ');
|
|
77
85
|
/** Applied with overlay dialog classes so users who prefer reduced motion get instant open/close. */
|
|
78
86
|
export const overlayReducedMotionClasses = 'motion-reduce:!duration-0 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast enter/exit motion aligned with round-5 site spec (OpenAI-style top pill).
|
|
3
|
+
* Change here when Figma Toast (135:87) motion updates.
|
|
4
|
+
*/
|
|
5
|
+
/** Slide-in from the top uses the same base duration as overlay fades. */
|
|
6
|
+
export declare const toastEnterDurationMs = 200;
|
|
7
|
+
/** Dismiss fades in place (no slide), slightly quicker than enter. */
|
|
8
|
+
export declare const toastExitDurationMs = 150;
|
|
9
|
+
/** Long titles wrap inside this width (px). */
|
|
10
|
+
export declare const toastMaxWidthPx = 420;
|
|
11
|
+
/** Literal for Tailwind scanner — keep in sync with `toastMaxWidthPx`. */
|
|
12
|
+
export declare const toastMaxWidthClass = "!max-w-[420px]";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast enter/exit motion aligned with round-5 site spec (OpenAI-style top pill).
|
|
3
|
+
* Change here when Figma Toast (135:87) motion updates.
|
|
4
|
+
*/
|
|
5
|
+
/** Slide-in from the top uses the same base duration as overlay fades. */
|
|
6
|
+
export const toastEnterDurationMs = 200;
|
|
7
|
+
/** Dismiss fades in place (no slide), slightly quicker than enter. */
|
|
8
|
+
export const toastExitDurationMs = 150;
|
|
9
|
+
/** Long titles wrap inside this width (px). */
|
|
10
|
+
export const toastMaxWidthPx = 420;
|
|
11
|
+
/** Literal for Tailwind scanner — keep in sync with `toastMaxWidthPx`. */
|
|
12
|
+
export const toastMaxWidthClass = '!max-w-[420px]';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widgetic/design-system",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.31",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"llinks": "ls -la node_modules/@widgetic",
|
|
21
21
|
"glinks": "npm ls --global | grep widgetic",
|
|
22
22
|
"set-git": "git config core.ignorecase false",
|
|
23
|
-
"ensure-fonts": "mkdir -p static/fonts && ln -sfn ../../src/lib/fonts/Inter static/fonts/Inter && ln -sfn ../../src/lib/fonts/JetBrainsMono static/fonts/JetBrainsMono
|
|
23
|
+
"ensure-fonts": "mkdir -p static/fonts && ln -sfn ../../src/lib/fonts/Inter static/fonts/Inter && ln -sfn ../../src/lib/fonts/JetBrainsMono static/fonts/JetBrainsMono",
|
|
24
24
|
"predev": "npm run ensure-fonts && npx svelte-kit sync",
|
|
25
25
|
"predev-sv": "npm run ensure-fonts && npx svelte-kit sync",
|
|
26
26
|
"dev": "npm run dev-sv",
|
package/tailwind.config.ts
CHANGED
|
@@ -30,25 +30,18 @@ const config: Config = {
|
|
|
30
30
|
grey5: "hsl(var(--grey5) / <alpha-value>)",
|
|
31
31
|
grey7: "hsl(var(--grey7) / <alpha-value>)",
|
|
32
32
|
|
|
33
|
-
// Figma Foundations Tokens (01 — Foundations 38:142)
|
|
33
|
+
// Figma Foundations Tokens (01 — Foundations 38:142). Round 31 removed the eight that no code read
|
|
34
|
+
// (ink-secondary, ink-muted, surface-canvas, surface-dark, surface-ink-on-dark, accent-orange, accent-green, primary-green-muted).
|
|
34
35
|
"ink-primary": "hsl(var(--ink-primary) / <alpha-value>)",
|
|
35
36
|
"primary-green": "hsl(var(--primary-green) / <alpha-value>)",
|
|
36
|
-
"ink-secondary": "hsl(var(--ink-secondary) / <alpha-value>)",
|
|
37
|
-
"ink-muted": "hsl(var(--ink-muted) / <alpha-value>)",
|
|
38
37
|
"ink-subtle": "hsl(var(--ink-subtle) / <alpha-value>)",
|
|
39
|
-
"surface-canvas": "hsl(var(--surface-canvas) / <alpha-value>)",
|
|
40
|
-
"surface-dark": "hsl(var(--surface-dark) / <alpha-value>)",
|
|
41
|
-
"surface-ink-on-dark": "hsl(var(--surface-ink-on-dark) / <alpha-value>)",
|
|
42
|
-
"accent-orange": "hsl(var(--accent-orange) / <alpha-value>)",
|
|
43
|
-
"accent-green": "hsl(var(--accent-green) / <alpha-value>)",
|
|
44
|
-
"primary-green-muted": "hsl(var(--primary-green-muted) / <alpha-value>)",
|
|
45
38
|
},
|
|
39
|
+
// Inter for the interface, JetBrains Mono for code. (Cousine was removed in round 31: nothing set a font in it.)
|
|
46
40
|
fontFamily: {
|
|
47
41
|
sans: ["Inter", "ui-sans-serif", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "sans-serif"],
|
|
48
42
|
inter: ["Inter", "sans-serif"],
|
|
49
|
-
mono: ["JetBrains Mono", "
|
|
43
|
+
mono: ["JetBrains Mono", "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "monospace"],
|
|
50
44
|
"jetbrains-mono": ["JetBrains Mono", "monospace"],
|
|
51
|
-
cousine: ["Cousine", "monospace"],
|
|
52
45
|
},
|
|
53
46
|
borderRadius: {
|
|
54
47
|
sm: "var(--radius-sm)",
|
|
Binary file
|
|
Binary file
|