@widgetic/design-system 0.5.23 → 0.5.24
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/modals/BaseModal.svelte +257 -166
- package/dist/components/modals/BaseModal.svelte.d.ts +3 -0
- package/dist/components/modals/NewItemDialog.svelte +5 -7
- package/dist/components/modals/Portal.svelte +9 -7
- package/dist/components/modals/RenameDialog.svelte +5 -7
- package/dist/components/modals/modalStore.d.ts +9 -1
- package/dist/components/modals/modalStore.js +44 -11
- package/dist/components/navigation/Breadcrumbs.svelte +10 -4
- package/dist/components/navigation/breadcrumbsAvailableWidth.d.ts +10 -0
- package/dist/components/navigation/breadcrumbsAvailableWidth.js +10 -0
- package/dist/components/search-input/SearchInput.svelte +25 -13
- package/dist/components/search-input/SearchInput.svelte.d.ts +4 -0
- package/dist/components/search-input/index2.d.ts +14 -9
- package/dist/components/shell/NavDrawer.svelte +1 -1
- package/dist/components/shell/SettingsDialog.svelte +48 -3
- package/dist/components/shell/WidgetRow.svelte.d.ts +1 -1
- package/dist/components/shell/nested-modal-guard.d.ts +25 -0
- package/dist/components/shell/nested-modal-guard.js +33 -0
- package/dist/components/ui/calendar/calendar.svelte.d.ts +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/dialog/dialog-content.svelte +8 -1
- package/dist/components/ui/dialog/dialog-overlay.svelte +8 -1
- package/dist/components/ui/drawer/drawer-overlay.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/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +1 -1
- package/dist/components/ui/select/select-item.svelte +1 -1
- package/dist/styles/global.css +3 -2
- package/dist/utils/overlayMotion.d.ts +49 -0
- package/dist/utils/overlayMotion.js +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared overlay motion tokens so BaseModal, bits-ui Dialog, and related surfaces stay in sync.
|
|
3
|
+
* FilePreview / legacy modals: backdrop fades 200ms with cubicOut; the card scales from 0.95 with the same timing.
|
|
4
|
+
* Change here when Figma updates overlay motion.
|
|
5
|
+
*/
|
|
6
|
+
import { cubicOut } from 'svelte/easing';
|
|
7
|
+
/** Backdrop scrim + card motion duration (ms). Intentionally 200ms; DS `--duration-base` is 160ms for small UI. */
|
|
8
|
+
export declare const overlayTransitionDurationMs = 200;
|
|
9
|
+
/** Easing for open/close (Svelte transition easing function — matches “cubic out” in the legacy modals). */
|
|
10
|
+
export declare const overlayTransitionEasing: typeof cubicOut;
|
|
11
|
+
/**
|
|
12
|
+
* Backdrop blur (px) of the scrim behind every modal, dialog, drawer and sheet. It is the Figma effect style
|
|
13
|
+
* `Overlay/Scrim blur` (a background blur of 3).
|
|
14
|
+
*/
|
|
15
|
+
export declare const overlayBackdropBlurPx = 3;
|
|
16
|
+
/** Content scale at the start of the open transition / end of the close transition. */
|
|
17
|
+
export declare const overlayContentScaleStart = 0.95;
|
|
18
|
+
/**
|
|
19
|
+
* Tailwind duration class — must be a source literal so Tailwind's scanner emits `duration-[200ms]`.
|
|
20
|
+
* Kept in sync with `overlayTransitionDurationMs` (see tests/overlayMotionDuration.test.ts).
|
|
21
|
+
*/
|
|
22
|
+
export declare const overlayDurationClass = "duration-[200ms]";
|
|
23
|
+
/**
|
|
24
|
+
* bits-ui applies `data-[state=open]:animate-in` at specificity 0,2,0 with a 150ms default duration, which beats a
|
|
25
|
+
* plain `duration-[200ms]` (0,1,0). These state-scoped arbitrary properties match open/closed and win in cascade.
|
|
26
|
+
* Literal strings — keep in sync with `overlayTransitionDurationMs`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const overlayDialogOpenClosedAnimationDurationClasses: readonly ["data-[state=open]:[animation-duration:200ms]", "data-[state=closed]:[animation-duration:200ms]"];
|
|
29
|
+
/**
|
|
30
|
+
* The scrim colour: the muted foreground token (neutral 550 in the design system) at 80%. The opacity is part of the colour, not of
|
|
31
|
+
* the layer, because an element that is itself translucent would not blur what is behind it. Literal so Tailwind's
|
|
32
|
+
* scanner emits it; `bg-muted-foreground/80` is the Figma scrim (`Foundations / Overlay`).
|
|
33
|
+
*/
|
|
34
|
+
export declare const overlayScrimColorClass = "bg-muted-foreground/80";
|
|
35
|
+
/** Backdrop blur class — matches `overlayBackdropBlurPx`. Literal for the same reason as the colour. */
|
|
36
|
+
export declare const overlayBackdropBlurClass = "backdrop-blur-[3px]";
|
|
37
|
+
/**
|
|
38
|
+
* The whole scrim: colour and blur. Every surface that dims the page behind a panel (dialogs, modals, drawers, the
|
|
39
|
+
* navigation drawer) uses these two classes, so the overlay looks the same everywhere. Written out, not joined from the
|
|
40
|
+
* two constants above, so the scanner of Tailwind finds both classes in this one literal as well.
|
|
41
|
+
*/
|
|
42
|
+
export declare const overlayScrimClasses = "bg-muted-foreground/80 backdrop-blur-[3px]";
|
|
43
|
+
/** Tailwind arbitrary easing approximating Svelte `cubicOut` (ease-out cubic, 1 − (1 − t)³). */
|
|
44
|
+
export declare const overlayEasingClass = "ease-[cubic-bezier(0.33,1,0.68,1)]";
|
|
45
|
+
/** Overlay + panel classes for bits-ui Dialog (aligned with BaseModal motion: fade, 200ms, cubic-out-like, zoom from 0.95). */
|
|
46
|
+
export declare const overlayDialogOverlayClasses: string;
|
|
47
|
+
export declare const overlayDialogContentClasses: string;
|
|
48
|
+
/** Applied with overlay dialog classes so users who prefer reduced motion get instant open/close. */
|
|
49
|
+
export declare const overlayReducedMotionClasses = "motion-reduce:!duration-0 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared overlay motion tokens so BaseModal, bits-ui Dialog, and related surfaces stay in sync.
|
|
3
|
+
* FilePreview / legacy modals: backdrop fades 200ms with cubicOut; the card scales from 0.95 with the same timing.
|
|
4
|
+
* Change here when Figma updates overlay motion.
|
|
5
|
+
*/
|
|
6
|
+
import { cubicOut } from 'svelte/easing';
|
|
7
|
+
/** Backdrop scrim + card motion duration (ms). Intentionally 200ms; DS `--duration-base` is 160ms for small UI. */
|
|
8
|
+
export const overlayTransitionDurationMs = 200;
|
|
9
|
+
/** Easing for open/close (Svelte transition easing function — matches “cubic out” in the legacy modals). */
|
|
10
|
+
export const overlayTransitionEasing = cubicOut;
|
|
11
|
+
/**
|
|
12
|
+
* Backdrop blur (px) of the scrim behind every modal, dialog, drawer and sheet. It is the Figma effect style
|
|
13
|
+
* `Overlay/Scrim blur` (a background blur of 3).
|
|
14
|
+
*/
|
|
15
|
+
export const overlayBackdropBlurPx = 3;
|
|
16
|
+
/** Content scale at the start of the open transition / end of the close transition. */
|
|
17
|
+
export const overlayContentScaleStart = 0.95;
|
|
18
|
+
/**
|
|
19
|
+
* Tailwind duration class — must be a source literal so Tailwind's scanner emits `duration-[200ms]`.
|
|
20
|
+
* Kept in sync with `overlayTransitionDurationMs` (see tests/overlayMotionDuration.test.ts).
|
|
21
|
+
*/
|
|
22
|
+
export const overlayDurationClass = 'duration-[200ms]';
|
|
23
|
+
/**
|
|
24
|
+
* bits-ui applies `data-[state=open]:animate-in` at specificity 0,2,0 with a 150ms default duration, which beats a
|
|
25
|
+
* plain `duration-[200ms]` (0,1,0). These state-scoped arbitrary properties match open/closed and win in cascade.
|
|
26
|
+
* Literal strings — keep in sync with `overlayTransitionDurationMs`.
|
|
27
|
+
*/
|
|
28
|
+
export const overlayDialogOpenClosedAnimationDurationClasses = [
|
|
29
|
+
'data-[state=open]:[animation-duration:200ms]',
|
|
30
|
+
'data-[state=closed]:[animation-duration:200ms]'
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* The scrim colour: the muted foreground token (neutral 550 in the design system) at 80%. The opacity is part of the colour, not of
|
|
34
|
+
* the layer, because an element that is itself translucent would not blur what is behind it. Literal so Tailwind's
|
|
35
|
+
* scanner emits it; `bg-muted-foreground/80` is the Figma scrim (`Foundations / Overlay`).
|
|
36
|
+
*/
|
|
37
|
+
export const overlayScrimColorClass = 'bg-muted-foreground/80';
|
|
38
|
+
/** Backdrop blur class — matches `overlayBackdropBlurPx`. Literal for the same reason as the colour. */
|
|
39
|
+
export const overlayBackdropBlurClass = 'backdrop-blur-[3px]';
|
|
40
|
+
/**
|
|
41
|
+
* The whole scrim: colour and blur. Every surface that dims the page behind a panel (dialogs, modals, drawers, the
|
|
42
|
+
* navigation drawer) uses these two classes, so the overlay looks the same everywhere. Written out, not joined from the
|
|
43
|
+
* two constants above, so the scanner of Tailwind finds both classes in this one literal as well.
|
|
44
|
+
*/
|
|
45
|
+
export const overlayScrimClasses = 'bg-muted-foreground/80 backdrop-blur-[3px]';
|
|
46
|
+
/** Tailwind arbitrary easing approximating Svelte `cubicOut` (ease-out cubic, 1 − (1 − t)³). */
|
|
47
|
+
export const overlayEasingClass = 'ease-[cubic-bezier(0.33,1,0.68,1)]';
|
|
48
|
+
/** Overlay + panel classes for bits-ui Dialog (aligned with BaseModal motion: fade, 200ms, cubic-out-like, zoom from 0.95). */
|
|
49
|
+
export const overlayDialogOverlayClasses = [
|
|
50
|
+
overlayScrimClasses,
|
|
51
|
+
overlayDurationClass,
|
|
52
|
+
overlayEasingClass,
|
|
53
|
+
...overlayDialogOpenClosedAnimationDurationClasses,
|
|
54
|
+
`data-[state=open]:animate-in`,
|
|
55
|
+
`data-[state=closed]:animate-out`,
|
|
56
|
+
`data-[state=closed]:fade-out-0`,
|
|
57
|
+
`data-[state=open]:fade-in-0`
|
|
58
|
+
].join(' ');
|
|
59
|
+
export const overlayDialogContentClasses = [
|
|
60
|
+
overlayDurationClass,
|
|
61
|
+
overlayEasingClass,
|
|
62
|
+
...overlayDialogOpenClosedAnimationDurationClasses,
|
|
63
|
+
`data-[state=open]:animate-in`,
|
|
64
|
+
`data-[state=closed]:animate-out`,
|
|
65
|
+
`data-[state=closed]:fade-out-0`,
|
|
66
|
+
`data-[state=open]:fade-in-0`,
|
|
67
|
+
`data-[state=closed]:zoom-out-95`,
|
|
68
|
+
`data-[state=open]:zoom-in-95`
|
|
69
|
+
].join(' ');
|
|
70
|
+
/** Applied with overlay dialog classes so users who prefer reduced motion get instant open/close. */
|
|
71
|
+
export const overlayReducedMotionClasses = 'motion-reduce:!duration-0 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none';
|