@urbicon-ui/blocks 6.21.0 → 6.21.2
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/Calendar/calendar.variants.d.ts +132 -419
- package/dist/components/CommandPalette/commandPalette.variants.d.ts +24 -51
- package/dist/components/CompositionBar/CompositionBar.svelte +6 -1
- package/dist/components/CompositionBar/composition-bar.variants.d.ts +23 -83
- package/dist/components/CompositionBar/composition-bar.variants.js +9 -3
- package/dist/components/EmptyState/emptyState.variants.d.ts +11 -27
- package/dist/components/FileUpload/fileUpload.variants.d.ts +24 -93
- package/dist/components/Guide/GuidePanel.svelte +38 -0
- package/dist/components/Guide/guide.variants.d.ts +69 -124
- package/dist/components/Guide/guide.variants.js +6 -1
- package/dist/components/NumberInput/NumberInput.svelte +197 -0
- package/dist/components/NumberInput/NumberInput.svelte.d.ts +4 -0
- package/dist/components/NumberInput/index.d.ts +55 -0
- package/dist/components/NumberInput/index.js +1 -0
- package/dist/components/Planner/planner.variants.d.ts +23 -94
- package/dist/components/Sankey/sankey.variants.d.ts +15 -48
- package/dist/components/SidebarLayout/sidebar-layout.variants.d.ts +10 -38
- package/dist/components/SidebarLayout/sidebar-layout.variants.js +12 -2
- package/dist/components/ThemeSwitcher/themeSwitcher.variants.d.ts +9 -36
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/i18n/index.d.ts +8 -372
- package/dist/internal/charts/variants.d.ts +18 -31
- package/dist/primitives/Accordion/Accordion.svelte +11 -0
- package/dist/primitives/Accordion/AccordionItem.svelte +9 -3
- package/dist/primitives/Accordion/accordion.variants.d.ts +12 -43
- package/dist/primitives/Accordion/accordion.variants.js +6 -2
- package/dist/primitives/Accordion/index.d.ts +12 -0
- package/dist/primitives/Alert/alert.variants.d.ts +21 -62
- package/dist/primitives/Avatar/avatar.variants.d.ts +18 -138
- package/dist/primitives/Badge/Badge.svelte +12 -4
- package/dist/primitives/Badge/badge.variants.d.ts +19 -92
- package/dist/primitives/Badge/badge.variants.js +11 -4
- package/dist/primitives/Badge/index.d.ts +26 -6
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +11 -6
- package/dist/primitives/Breadcrumb/breadcrumb.variants.d.ts +13 -40
- package/dist/primitives/Breadcrumb/index.d.ts +2 -2
- package/dist/primitives/Button/button.variants.d.ts +19 -98
- package/dist/primitives/Button/button.variants.js +13 -9
- package/dist/primitives/ButtonGroup/buttongroup.variants.d.ts +9 -29
- package/dist/primitives/ButtonGroup/buttongroup.variants.js +3 -1
- package/dist/primitives/Card/card.variants.d.ts +14 -81
- package/dist/primitives/Checkbox/Checkbox.svelte +3 -3
- package/dist/primitives/Checkbox/checkbox.variants.d.ts +18 -77
- package/dist/primitives/Collapsible/Collapsible.svelte +10 -0
- package/dist/primitives/Collapsible/collapsible.variants.d.ts +11 -40
- package/dist/primitives/Collapsible/collapsible.variants.js +7 -2
- package/dist/primitives/Collapsible/index.d.ts +16 -0
- package/dist/primitives/Combobox/Combobox.svelte +478 -104
- package/dist/primitives/Combobox/combobox.variants.d.ts +112 -94
- package/dist/primitives/Combobox/combobox.variants.js +94 -13
- package/dist/primitives/Combobox/index.d.ts +166 -51
- package/dist/primitives/ConfirmDialog/index.d.ts +19 -0
- package/dist/primitives/Dialog/Dialog.svelte +95 -10
- package/dist/primitives/Dialog/dialog.variants.d.ts +15 -54
- package/dist/primitives/Dialog/index.d.ts +12 -1
- package/dist/primitives/Drawer/Drawer.svelte +23 -11
- package/dist/primitives/Drawer/drawer.variants.d.ts +22 -49
- package/dist/primitives/Drawer/drawer.variants.js +45 -10
- package/dist/primitives/Drawer/index.d.ts +13 -4
- package/dist/primitives/FormField/FormField.svelte +6 -6
- package/dist/primitives/FormField/index.d.ts +13 -4
- package/dist/primitives/Input/Input.svelte +8 -4
- package/dist/primitives/Input/input.variants.d.ts +32 -139
- package/dist/primitives/Input/input.variants.js +12 -10
- package/dist/primitives/JourneyTimeline/journey-timeline.variants.d.ts +55 -197
- package/dist/primitives/JourneyTimeline/journey-timeline.variants.js +4 -1
- package/dist/primitives/Menu/Menu.svelte +66 -4
- package/dist/primitives/Menu/index.d.ts +25 -0
- package/dist/primitives/Menu/menu.variants.d.ts +29 -93
- package/dist/primitives/Pagination/Pagination.svelte +28 -13
- package/dist/primitives/Pagination/index.d.ts +44 -0
- package/dist/primitives/Pagination/pagination.variants.d.ts +16 -54
- package/dist/primitives/Pagination/pagination.variants.js +16 -14
- package/dist/primitives/Popover/Popover.svelte +11 -1
- package/dist/primitives/Popover/index.d.ts +3 -3
- package/dist/primitives/Popover/popover.variants.d.ts +4 -2
- package/dist/primitives/Progress/progress.variants.d.ts +19 -83
- package/dist/primitives/Progress/progress.variants.js +2 -1
- package/dist/primitives/RadioGroup/RadioGroup.svelte +3 -3
- package/dist/primitives/RadioGroup/radioGroup.variants.d.ts +28 -109
- package/dist/primitives/SegmentGroup/SegmentGroup.svelte +14 -6
- package/dist/primitives/SegmentGroup/segmentgroup.variants.d.ts +12 -53
- package/dist/primitives/SegmentGroup/segmentgroup.variants.js +10 -10
- package/dist/primitives/Select/Select.svelte +21 -11
- package/dist/primitives/Select/index.d.ts +7 -0
- package/dist/primitives/Select/select.variants.d.ts +61 -150
- package/dist/primitives/Select/select.variants.js +24 -4
- package/dist/primitives/Separator/separator.variants.d.ts +4 -2
- package/dist/primitives/Sidebar/Sidebar.svelte +10 -15
- package/dist/primitives/Sidebar/sidebar.variants.d.ts +11 -29
- package/dist/primitives/Skeleton/skeleton.variants.d.ts +9 -36
- package/dist/primitives/Slider/Slider.svelte +4 -8
- package/dist/primitives/Slider/slider.variants.d.ts +37 -136
- package/dist/primitives/Slider/slider.variants.js +8 -5
- package/dist/primitives/Spinner/spinner.variants.d.ts +38 -135
- package/dist/primitives/Stepper/stepper.variants.d.ts +32 -130
- package/dist/primitives/Tab/Tab.svelte +14 -6
- package/dist/primitives/Tab/tab.variants.d.ts +17 -78
- package/dist/primitives/Textarea/Textarea.svelte +4 -5
- package/dist/primitives/Textarea/textarea.variants.d.ts +33 -118
- package/dist/primitives/Textarea/textarea.variants.js +17 -12
- package/dist/primitives/Toast/Toaster.svelte +58 -5
- package/dist/primitives/Toast/index.d.ts +39 -0
- package/dist/primitives/Toast/toast.store.svelte.d.ts +25 -1
- package/dist/primitives/Toast/toast.store.svelte.js +91 -1
- package/dist/primitives/Toast/toast.variants.d.ts +40 -78
- package/dist/primitives/Toast/toast.variants.js +15 -0
- package/dist/primitives/Toggle/Toggle.svelte +17 -3
- package/dist/primitives/Toggle/index.d.ts +8 -2
- package/dist/primitives/Toggle/toggle.variants.d.ts +24 -71
- package/dist/primitives/Toggle/toggle.variants.js +26 -0
- package/dist/primitives/Toolbar/toolbar.variants.d.ts +9 -60
- package/dist/primitives/Tooltip/Tooltip.svelte +58 -21
- package/dist/primitives/Tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/primitives/Tooltip/index.d.ts +45 -3
- package/dist/primitives/Tooltip/tooltip.variants.d.ts +14 -53
- package/dist/primitives/Tooltip/tooltip.variants.js +9 -3
- package/dist/primitives/index.d.ts +3 -3
- package/dist/style/foundation.css +4 -1
- package/dist/style/interaction.css +39 -11
- package/dist/style/semantic.css +2 -2
- package/dist/style/themes/index.css +1 -1
- package/dist/translations/de.d.ts +3 -0
- package/dist/translations/de.js +4 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +4 -1
- package/dist/utils/guide.svelte.d.ts +8 -2
- package/dist/utils/guide.svelte.js +86 -5
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/overlay.d.ts +33 -4
- package/dist/utils/overlay.js +61 -18
- package/dist/utils/roving.d.ts +15 -0
- package/dist/utils/roving.js +44 -0
- package/dist/utils/use-floating-panel.svelte.d.ts +4 -1
- package/dist/utils/use-floating-panel.svelte.js +23 -1
- package/dist/utils/use-form-field.svelte.d.ts +9 -9
- package/dist/utils/use-form-field.svelte.js +12 -12
- package/dist/utils/variants.d.ts +60 -16
- package/dist/utils/variants.js +424 -123
- package/package.json +9 -6
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
placement = 'top',
|
|
22
22
|
showDelay = 200,
|
|
23
23
|
hideDelay = 100,
|
|
24
|
+
transitionDuration,
|
|
25
|
+
transitionEasing,
|
|
24
26
|
disabled = false,
|
|
25
27
|
arrow = true,
|
|
26
|
-
|
|
28
|
+
open = $bindable(false),
|
|
29
|
+
onOpenChange,
|
|
27
30
|
class: className,
|
|
28
31
|
unstyled: unstyledProp = false,
|
|
29
32
|
slotClasses: slotClassesProp = {},
|
|
@@ -34,7 +37,13 @@
|
|
|
34
37
|
const blocksConfig = getBlocksConfig();
|
|
35
38
|
const unstyled = $derived(unstyledProp || blocksConfig?.unstyled || false);
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
// ACC-3 follow-up: per-instance fade motion. Set the shared tooltip CSS
|
|
41
|
+
// variables inline only when a prop is provided, so the unset default keeps
|
|
42
|
+
// inheriting the reduced-motion-aware token.
|
|
43
|
+
const tooltipDuration = $derived(
|
|
44
|
+
transitionDuration != null ? `${transitionDuration}ms` : undefined
|
|
45
|
+
);
|
|
46
|
+
|
|
38
47
|
let triggerElement = $state<HTMLElement>();
|
|
39
48
|
let tooltipElement = $state<HTMLElement>();
|
|
40
49
|
let arrowElement = $state<HTMLElement>();
|
|
@@ -43,7 +52,7 @@
|
|
|
43
52
|
const propsId = $props.id();
|
|
44
53
|
const tooltipId = `tooltip-${propsId}`;
|
|
45
54
|
|
|
46
|
-
const variantProps: VariantProps<typeof tooltipVariants> = $derived({
|
|
55
|
+
const variantProps: VariantProps<typeof tooltipVariants> = $derived({ open, intent, size });
|
|
47
56
|
const styles = $derived(tooltipVariants(variantProps));
|
|
48
57
|
const slotClasses = $derived(
|
|
49
58
|
resolveSlotClasses(blocksConfig, 'Tooltip', preset, variantProps, slotClassesProp)
|
|
@@ -51,16 +60,38 @@
|
|
|
51
60
|
|
|
52
61
|
// Inside an open modal <dialog>, a popover shown via showPopover() forms a
|
|
53
62
|
// second top-layer element WebKit won't render above the dialog (Codeberg
|
|
54
|
-
// #23). Evaluated while `
|
|
63
|
+
// #23). Evaluated while `open` so the check runs once the dialog is
|
|
55
64
|
// already modal; the tooltip then renders in place (position:fixed + the
|
|
56
|
-
// opacity `
|
|
65
|
+
// opacity `open` variant + pointer-events-none) within the dialog's own
|
|
57
66
|
// top-layer subtree, no showPopover() needed.
|
|
58
|
-
const topLayer = $derived(
|
|
67
|
+
const topLayer = $derived(open ? !isAnchoredInModalDialog(triggerElement) : true);
|
|
59
68
|
|
|
60
69
|
let showTimeout: number;
|
|
61
70
|
let hideTimeout: number;
|
|
62
71
|
let cleanup: (() => void) | undefined = undefined;
|
|
63
72
|
|
|
73
|
+
// Clear pending show/hide timers on unmount — a hover followed by a
|
|
74
|
+
// teardown within `showDelay` (route change, {#if} removal) would
|
|
75
|
+
// otherwise fire setOpen after destroy: a write to the destroyed
|
|
76
|
+
// $bindable plus a ghost onOpenChange(true) for a tooltip that no
|
|
77
|
+
// longer exists. Dependency-free effect → runs once, teardown on destroy.
|
|
78
|
+
$effect(() => {
|
|
79
|
+
return () => {
|
|
80
|
+
clearTimeout(showTimeout);
|
|
81
|
+
clearTimeout(hideTimeout);
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Single mutation point for interaction-driven changes, so `onOpenChange`
|
|
86
|
+
// fires exactly once per transition. The no-change guard keeps a re-hover
|
|
87
|
+
// during the hide delay quiet (open never flipped). Consumer writes via
|
|
88
|
+
// `bind:open` bypass this on purpose — they don't re-announce themselves.
|
|
89
|
+
function setOpen(next: boolean) {
|
|
90
|
+
if (open === next) return;
|
|
91
|
+
open = next;
|
|
92
|
+
onOpenChange?.(next);
|
|
93
|
+
}
|
|
94
|
+
|
|
64
95
|
function show() {
|
|
65
96
|
if (disabled) return;
|
|
66
97
|
clearTimeout(hideTimeout);
|
|
@@ -71,24 +102,21 @@
|
|
|
71
102
|
// call would briefly flash the tooltip before the effect tears it
|
|
72
103
|
// back down.
|
|
73
104
|
if (disabled) return;
|
|
74
|
-
|
|
75
|
-
onVisibleChange?.(true);
|
|
105
|
+
setOpen(true);
|
|
76
106
|
}, showDelay);
|
|
77
107
|
}
|
|
78
108
|
|
|
79
109
|
function hide() {
|
|
80
110
|
clearTimeout(showTimeout);
|
|
81
111
|
hideTimeout = window.setTimeout(() => {
|
|
82
|
-
|
|
83
|
-
onVisibleChange?.(false);
|
|
112
|
+
setOpen(false);
|
|
84
113
|
}, hideDelay);
|
|
85
114
|
}
|
|
86
115
|
|
|
87
116
|
function handleKeydown(e: KeyboardEvent) {
|
|
88
|
-
if (e.key === 'Escape' &&
|
|
117
|
+
if (e.key === 'Escape' && open) {
|
|
89
118
|
clearTimeout(showTimeout);
|
|
90
|
-
|
|
91
|
-
onVisibleChange?.(false);
|
|
119
|
+
setOpen(false);
|
|
92
120
|
}
|
|
93
121
|
}
|
|
94
122
|
|
|
@@ -147,7 +175,7 @@
|
|
|
147
175
|
});
|
|
148
176
|
}
|
|
149
177
|
|
|
150
|
-
// Drive native popover state from `
|
|
178
|
+
// Drive native popover state from `open`. `popover="manual"` puts the
|
|
151
179
|
// element in the browser top layer when shown, so the tooltip is never
|
|
152
180
|
// clipped by ancestor `overflow` (e.g. Toolbar). We deliberately avoid
|
|
153
181
|
// `popover="auto"` here — auto would dismiss the tooltip on any outside
|
|
@@ -161,13 +189,13 @@
|
|
|
161
189
|
$effect(() => {
|
|
162
190
|
if (!triggerElement || !tooltipElement) return;
|
|
163
191
|
|
|
164
|
-
const shouldShow = !disabled &&
|
|
192
|
+
const shouldShow = !disabled && open && !!label;
|
|
165
193
|
|
|
166
194
|
if (!shouldShow) {
|
|
167
|
-
// Force-clear `
|
|
195
|
+
// Force-clear `open` so a stale show timeout that fired right
|
|
168
196
|
// before `disabled` flipped doesn't immediately re-trigger this
|
|
169
197
|
// effect into the show branch on the next mouse event.
|
|
170
|
-
if (disabled &&
|
|
198
|
+
if (disabled && open) setOpen(false);
|
|
171
199
|
cleanup?.();
|
|
172
200
|
cleanup = undefined;
|
|
173
201
|
if (tooltipElement.matches(':popover-open')) {
|
|
@@ -210,15 +238,22 @@
|
|
|
210
238
|
</script>
|
|
211
239
|
|
|
212
240
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
241
|
+
<!--
|
|
242
|
+
focusin/focusout (not focus/blur): the wrapper span is never focusable
|
|
243
|
+
itself — the actual trigger is the consumer's child element. focus/blur
|
|
244
|
+
don't bubble, so a keyboard focus on the child never reached the wrapper
|
|
245
|
+
and the tooltip silently skipped its WCAG 1.4.13 focus-open path;
|
|
246
|
+
focusin/focusout bubble and cover any focusable descendant.
|
|
247
|
+
-->
|
|
213
248
|
<span
|
|
214
249
|
class="inline-flex"
|
|
215
250
|
bind:this={triggerElement}
|
|
216
251
|
onmouseenter={show}
|
|
217
252
|
onmouseleave={hide}
|
|
218
|
-
|
|
219
|
-
|
|
253
|
+
onfocusin={show}
|
|
254
|
+
onfocusout={hide}
|
|
220
255
|
onkeydown={handleKeydown}
|
|
221
|
-
aria-describedby={!disabled && label &&
|
|
256
|
+
aria-describedby={!disabled && label && open ? tooltipId : undefined}
|
|
222
257
|
>
|
|
223
258
|
{@render children()}
|
|
224
259
|
</span>
|
|
@@ -230,7 +265,7 @@
|
|
|
230
265
|
the arrow node existed). In top-layer mode the `popover="manual"` attribute
|
|
231
266
|
hides it via the UA stylesheet until `showPopover()` is called; inside a
|
|
232
267
|
modal dialog (`topLayer === false`) the attribute is dropped and the
|
|
233
|
-
`
|
|
268
|
+
`open` opacity variant drives visibility instead (Codeberg #23).
|
|
234
269
|
|
|
235
270
|
Load-bearing attributes (`popover`, `style`, `role`, `id`) intentionally
|
|
236
271
|
follow `{...restProps}` so a consumer-supplied `popover="auto"`, custom
|
|
@@ -245,6 +280,8 @@
|
|
|
245
280
|
{...restProps}
|
|
246
281
|
popover={topLayer ? 'manual' : null}
|
|
247
282
|
style="position: fixed; margin: 0; inset: auto; overflow: visible;"
|
|
283
|
+
style:--blocks-tooltip-duration={tooltipDuration}
|
|
284
|
+
style:--blocks-tooltip-easing={transitionEasing}
|
|
248
285
|
role="tooltip"
|
|
249
286
|
id={tooltipId}
|
|
250
287
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TooltipProps } from './index.js';
|
|
2
|
-
declare const Tooltip: import("svelte").Component<TooltipProps, {}, "">;
|
|
2
|
+
declare const Tooltip: import("svelte").Component<TooltipProps, {}, "open">;
|
|
3
3
|
type Tooltip = ReturnType<typeof Tooltip>;
|
|
4
4
|
export default Tooltip;
|
|
@@ -4,7 +4,7 @@ import type { Placement } from '../../utils/floating.js';
|
|
|
4
4
|
import type { TooltipSlots, TooltipVariants } from './tooltip.variants.js';
|
|
5
5
|
/**
|
|
6
6
|
* @description Contextual overlay that displays brief, supplementary text on hover or focus.
|
|
7
|
-
* Built
|
|
7
|
+
* Built on the library's own positioning engine for precise placement and accessibility support.
|
|
8
8
|
*
|
|
9
9
|
* @tag display
|
|
10
10
|
* @related Popover
|
|
@@ -22,6 +22,22 @@ import type { TooltipSlots, TooltipVariants } from './tooltip.variants.js';
|
|
|
22
22
|
* <Button variant="ghost" size="sm" onclick={handleCopy}>Copy</Button>
|
|
23
23
|
* </Tooltip>
|
|
24
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Controlled mode — programmatic "Copied!" feedback via `bind:open`
|
|
27
|
+
* ```svelte
|
|
28
|
+
* <script lang="ts">
|
|
29
|
+
* let copied = $state(false);
|
|
30
|
+
* async function copy() {
|
|
31
|
+
* await navigator.clipboard.writeText(text);
|
|
32
|
+
* copied = true;
|
|
33
|
+
* setTimeout(() => (copied = false), 1500);
|
|
34
|
+
* }
|
|
35
|
+
* </script>
|
|
36
|
+
*
|
|
37
|
+
* <Tooltip label="Copied!" bind:open={copied}>
|
|
38
|
+
* <Button onclick={copy}>Copy</Button>
|
|
39
|
+
* </Tooltip>
|
|
40
|
+
* ```
|
|
25
41
|
*/
|
|
26
42
|
export interface TooltipProps extends TooltipVariants, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
27
43
|
/** Text displayed inside the tooltip bubble. */
|
|
@@ -34,12 +50,38 @@ export interface TooltipProps extends TooltipVariants, Omit<HTMLAttributes<HTMLD
|
|
|
34
50
|
showDelay?: number;
|
|
35
51
|
/** Milliseconds before the tooltip disappears after leaving the trigger. @default 100 */
|
|
36
52
|
hideDelay?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Override the fade duration in milliseconds. Distinct from `showDelay` /
|
|
55
|
+
* `hideDelay`, which time *when* the tooltip appears — this is how fast the
|
|
56
|
+
* opacity fade itself runs. Defaults to the tooltip token
|
|
57
|
+
* `--blocks-tooltip-duration` (fast, 150ms). Respects `prefers-reduced-motion`.
|
|
58
|
+
*/
|
|
59
|
+
transitionDuration?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Override the fade easing as a CSS `<easing-function>` (e.g. `'linear'`,
|
|
62
|
+
* `'ease-out'`, `'cubic-bezier(0.4,0,0.2,1)'`). Defaults to the tooltip token
|
|
63
|
+
* `--blocks-tooltip-easing`. A CSS string, not a JS easing fn, because the
|
|
64
|
+
* tooltip fade is a pure CSS transition.
|
|
65
|
+
*/
|
|
66
|
+
transitionEasing?: string;
|
|
37
67
|
/** Whether to show a directional arrow pointing at the trigger. @default true */
|
|
38
68
|
arrow?: boolean;
|
|
39
69
|
/** Prevent the tooltip from appearing regardless of hover/focus. @default false */
|
|
40
70
|
disabled?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Controls tooltip visibility. Supports `bind:open` for programmatic
|
|
73
|
+
* display (e.g. a transient "Copied!" confirmation). Hover/focus keep
|
|
74
|
+
* driving the state in parallel — the delays apply only to those
|
|
75
|
+
* interaction paths, a `bind:open` write takes effect immediately.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
open?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Fires when the tooltip opens or closes from user interaction (hover
|
|
81
|
+
* in/out, focus/blur, Escape). Receives the new open state. Not called
|
|
82
|
+
* when the consumer writes `bind:open` directly.
|
|
83
|
+
*/
|
|
84
|
+
onOpenChange?: (open: boolean) => void;
|
|
43
85
|
/** Remove default tv classes; only consumer classes apply. */
|
|
44
86
|
unstyled?: boolean;
|
|
45
87
|
/** Per-slot class overrides merged with (or replacing, when unstyled) tv styles. */
|
|
@@ -1,65 +1,26 @@
|
|
|
1
1
|
import { type SlotNames, type VariantProps } from '../../utils/variants.js';
|
|
2
|
-
export declare const tooltipVariants: (props?:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
false: {
|
|
8
|
-
base: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
intent: {
|
|
12
|
-
primary: {
|
|
13
|
-
base: string;
|
|
14
|
-
};
|
|
15
|
-
secondary: {
|
|
16
|
-
base: string;
|
|
17
|
-
};
|
|
18
|
-
info: {
|
|
19
|
-
base: string;
|
|
20
|
-
};
|
|
21
|
-
success: {
|
|
22
|
-
base: string;
|
|
23
|
-
};
|
|
24
|
-
warning: {
|
|
25
|
-
base: string;
|
|
26
|
-
};
|
|
27
|
-
danger: {
|
|
28
|
-
base: string;
|
|
29
|
-
};
|
|
30
|
-
neutral: {
|
|
31
|
-
base: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
size: {
|
|
35
|
-
sm: {
|
|
36
|
-
base: string;
|
|
37
|
-
};
|
|
38
|
-
md: {
|
|
39
|
-
base: string;
|
|
40
|
-
};
|
|
41
|
-
lg: {
|
|
42
|
-
base: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}> | undefined) => {
|
|
2
|
+
export declare const tooltipVariants: ((props?: {
|
|
3
|
+
open?: boolean | undefined;
|
|
4
|
+
intent?: "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
6
|
+
} | undefined) => {
|
|
46
7
|
base: (props?: ({
|
|
47
|
-
|
|
48
|
-
intent?: "
|
|
8
|
+
open?: boolean | undefined;
|
|
9
|
+
intent?: "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
49
10
|
size?: "sm" | "md" | "lg" | undefined;
|
|
50
11
|
} & {
|
|
51
|
-
class?: string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
|
|
52
|
-
className?: string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
|
|
12
|
+
class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
|
|
53
13
|
}) | undefined) => string;
|
|
54
14
|
arrow: (props?: ({
|
|
55
|
-
|
|
56
|
-
intent?: "
|
|
15
|
+
open?: boolean | undefined;
|
|
16
|
+
intent?: "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
57
17
|
size?: "sm" | "md" | "lg" | undefined;
|
|
58
18
|
} & {
|
|
59
|
-
class?: string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
|
|
60
|
-
className?: string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | (string | false | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
|
|
19
|
+
class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
|
|
61
20
|
}) | undefined) => string;
|
|
21
|
+
}) & {
|
|
22
|
+
readonly config: import("../../utils/variants.js").TVConfig;
|
|
62
23
|
};
|
|
63
|
-
export type TooltipVariants = Omit<VariantProps<typeof tooltipVariants>, '
|
|
24
|
+
export type TooltipVariants = Omit<VariantProps<typeof tooltipVariants>, 'open'>;
|
|
64
25
|
/** Slot names derived from the `tv()` config above — single source of truth for `slotClasses`. */
|
|
65
26
|
export type TooltipSlots = SlotNames<typeof tooltipVariants>;
|
|
@@ -21,13 +21,19 @@ export const tooltipVariants = tv({
|
|
|
21
21
|
'z-[var(--z-tooltip)] overflow-visible',
|
|
22
22
|
'font-medium text-center whitespace-normal max-w-xs',
|
|
23
23
|
'rounded-contain pointer-events-none',
|
|
24
|
-
|
|
24
|
+
// Tooltip fade tokens (ACC-3 follow-up) so `transitionDuration`/
|
|
25
|
+
// `transitionEasing` can retune the opacity fade per instance. `motion-reduce`
|
|
26
|
+
// guards the inline-override path (an inline duration bypasses the token that
|
|
27
|
+
// reduced-motion collapses to 1ms). The default easing token resolves to
|
|
28
|
+
// Tailwind's implicit transition curve, so the resting fade is unchanged.
|
|
29
|
+
'transition-opacity duration-[var(--blocks-tooltip-duration)] ease-[var(--blocks-tooltip-easing)]',
|
|
30
|
+
'motion-reduce:duration-[1ms]',
|
|
25
31
|
'bg-surface-inverted text-text-inverted'
|
|
26
32
|
],
|
|
27
33
|
arrow: ['absolute w-2 h-2', 'bg-inherit transform rotate-45']
|
|
28
34
|
},
|
|
29
35
|
variants: {
|
|
30
|
-
|
|
36
|
+
open: {
|
|
31
37
|
true: { base: 'opacity-100' },
|
|
32
38
|
false: { base: 'opacity-0' }
|
|
33
39
|
},
|
|
@@ -47,7 +53,7 @@ export const tooltipVariants = tv({
|
|
|
47
53
|
}
|
|
48
54
|
},
|
|
49
55
|
defaultVariants: {
|
|
50
|
-
|
|
56
|
+
open: false,
|
|
51
57
|
intent: 'neutral',
|
|
52
58
|
size: 'md'
|
|
53
59
|
}
|
|
@@ -18,7 +18,7 @@ export type { CheckboxProps } from './Checkbox/index.js';
|
|
|
18
18
|
export * from './Checkbox/index.js';
|
|
19
19
|
export type { CollapsibleProps } from './Collapsible/index.js';
|
|
20
20
|
export * from './Collapsible/index.js';
|
|
21
|
-
export type { ComboboxOptionType, ComboboxProps } from './Combobox/index.js';
|
|
21
|
+
export type { ComboboxGroup, ComboboxOptionType, ComboboxProps } from './Combobox/index.js';
|
|
22
22
|
export * from './Combobox/index.js';
|
|
23
23
|
export type { ConfirmDialogProps, ConfirmIntent } from './ConfirmDialog/index.js';
|
|
24
24
|
export * from './ConfirmDialog/index.js';
|
|
@@ -34,7 +34,7 @@ export type { JourneyNode, JourneyStatus, JourneyTimelineProps } from './Journey
|
|
|
34
34
|
export * from './JourneyTimeline/index.js';
|
|
35
35
|
export type { MenuContext, MenuCustomSlots, MenuItemType, MenuObjectOption, MenuOption, MenuProps, MenuSectionHeader } from './Menu/index.js';
|
|
36
36
|
export * from './Menu/index.js';
|
|
37
|
-
export type { PaginationItemProps, PaginationProps } from './Pagination/index.js';
|
|
37
|
+
export type { PaginationItemContext, PaginationItemProps, PaginationProps } from './Pagination/index.js';
|
|
38
38
|
export * from './Pagination/index.js';
|
|
39
39
|
export * from './Popover/index.js';
|
|
40
40
|
export type { ProgressProps } from './Progress/index.js';
|
|
@@ -61,7 +61,7 @@ export type { TabItemProps, TabPanelProps, TabProps } from './Tab/index.js';
|
|
|
61
61
|
export * from './Tab/index.js';
|
|
62
62
|
export type { TextareaProps } from './Textarea/index.js';
|
|
63
63
|
export * from './Textarea/index.js';
|
|
64
|
-
export type { ToastData, ToastInput, ToastIntent, ToastPlacement, ToastProps, ToastShorthandOpts } from './Toast/index.js';
|
|
64
|
+
export type { ToastAction, ToastData, ToastInput, ToastIntent, ToastPlacement, ToastPromiseOptions, ToastProps, ToastShorthandOpts } from './Toast/index.js';
|
|
65
65
|
export * from './Toast/index.js';
|
|
66
66
|
export { TOAST_INTENTS } from './Toast/index.js';
|
|
67
67
|
export type { ToggleProps } from './Toggle/index.js';
|
|
@@ -163,8 +163,11 @@
|
|
|
163
163
|
--z-auto: auto;
|
|
164
164
|
--z-base: 0;
|
|
165
165
|
--z-docked: 10;
|
|
166
|
-
--z-dropdown: 9999;
|
|
167
166
|
--z-sticky: 1100;
|
|
167
|
+
/* Anchored dropdown panels (menus, listboxes) rendered in normal flow:
|
|
168
|
+
above sticky headers/toolbars (a table menu must clear its own sticky
|
|
169
|
+
header), below banner and every overlay/chrome layer that follows. */
|
|
170
|
+
--z-dropdown: 1150;
|
|
168
171
|
--z-banner: 1200;
|
|
169
172
|
--z-overlay: 1300;
|
|
170
173
|
--z-sidebar: 1350;
|
|
@@ -93,17 +93,19 @@
|
|
|
93
93
|
--blocks-stagger-cards: 150ms;
|
|
94
94
|
|
|
95
95
|
/* === OVERLAY ANIMATION TOKENS (XC-11) ===
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
Shared enter/exit motion for the panel overlays: Dialog, Drawer,
|
|
97
|
+
ConfirmDialog (via Dialog) and Toast. All four drive Svelte `fly`/`scale`
|
|
98
|
+
transitions, so they read these through the JS mirror in
|
|
99
|
+
`utils/overlay-tokens.ts` (`getOverlayMotion`) — Svelte transitions need
|
|
100
|
+
numeric input. Tooltip runs a deliberately faster CSS opacity fade off its
|
|
101
|
+
own `--blocks-tooltip-*` tokens below; Popover has no enter/exit motion yet
|
|
102
|
+
(ACC-3 follow-up).
|
|
103
|
+
|
|
104
|
+
Override globally with a `BlocksProvider` style block, or per instance via
|
|
105
|
+
the component's `transitionDuration` / `transitionEasing` props.
|
|
106
|
+
`prefers-reduced-motion` below collapses both enter and exit to 1ms and
|
|
107
|
+
removes scale/fly distance — kept in one place so motion reduction is
|
|
108
|
+
consistent across every overlay. */
|
|
107
109
|
--blocks-overlay-enter-duration: 200ms;
|
|
108
110
|
--blocks-overlay-exit-duration: 180ms;
|
|
109
111
|
--blocks-overlay-backdrop-enter-duration: 200ms;
|
|
@@ -112,6 +114,32 @@
|
|
|
112
114
|
--blocks-overlay-panel-scale-start: 0.96;
|
|
113
115
|
--blocks-overlay-panel-fly-distance: 320px;
|
|
114
116
|
--blocks-overlay-backdrop-blur: 4px;
|
|
117
|
+
|
|
118
|
+
/* === TOOLTIP FADE TOKENS (ACC-3 follow-up) ===
|
|
119
|
+
The CSS opacity fade shared by the hover/focus tooltip. Deliberately faster
|
|
120
|
+
than the panel overlays above — a hint should feel instant, not staged — so
|
|
121
|
+
it defaults to the `fast` duration (150ms) + the `confident` easing. That
|
|
122
|
+
easing token is `cubic-bezier(0.4,0,0.2,1)` — exactly Tailwind's implicit
|
|
123
|
+
transition curve, which the fade used before it carried an explicit `ease-*`
|
|
124
|
+
class — so the resting fade is unchanged. Defaulting the duration through
|
|
125
|
+
`--blocks-duration-fast` means `prefers-reduced-motion` below collapses it
|
|
126
|
+
to 1ms for free. Override globally here, or per instance via Tooltip's
|
|
127
|
+
`transitionDuration` / `transitionEasing` props (which set these inline +
|
|
128
|
+
carry a `motion-reduce` guard, since an inline duration can't see the media
|
|
129
|
+
query). */
|
|
130
|
+
--blocks-tooltip-duration: var(--blocks-duration-fast);
|
|
131
|
+
--blocks-tooltip-easing: var(--blocks-ease-confident);
|
|
132
|
+
|
|
133
|
+
/* === COLLAPSE ANIMATION TOKENS (ACC-3) ===
|
|
134
|
+
The CSS-driven grid-template-rows collapse shared by Accordion +
|
|
135
|
+
Collapsible (and their chevron spin). Default to the normal/smooth
|
|
136
|
+
tokens — so `prefers-reduced-motion` below collapses them to 1ms via
|
|
137
|
+
the inherited `--blocks-duration-normal`. Override globally here, or per
|
|
138
|
+
instance via the component's `transitionDuration` / `transitionEasing`
|
|
139
|
+
props (which set these variables inline + carry a `motion-reduce` guard,
|
|
140
|
+
since an inline duration can't see the media query). */
|
|
141
|
+
--blocks-collapse-duration: var(--blocks-duration-normal);
|
|
142
|
+
--blocks-collapse-easing: var(--blocks-ease-smooth);
|
|
115
143
|
}
|
|
116
144
|
|
|
117
145
|
/* ===== TOUCH DEVICE ADAPTATIONS ===== */
|
package/dist/style/semantic.css
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
`--neutral-chrome-hue` defaults to 240 (:root, below), so the library
|
|
86
86
|
default reads as a cool grey matching its cool chassis. Each theme
|
|
87
|
-
overrides it to its accent temperature;
|
|
87
|
+
overrides it to its accent temperature; rooms-docs.css re-pins the neutral
|
|
88
88
|
intent to the warm ramp directly. Uses the same relative-color syntax
|
|
89
89
|
already relied on by `--color-interactive-*` below. */
|
|
90
90
|
--color-neutral: light-dark(
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
The neutral intent (above) keeps the warm-neutral ramp's lightness but
|
|
233
233
|
takes its hue from here. Default 240 = cool grey, matching the default
|
|
234
234
|
cool chassis. Each theme overrides this to its accent temperature;
|
|
235
|
-
|
|
235
|
+
rooms-docs.css re-pins the neutral intent to the warm ramp instead. */
|
|
236
236
|
--neutral-chrome-hue: 240;
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
* overrides these ramps. Use the Theme Builder at /customization/theme-builder
|
|
46
46
|
* in the docs app to generate matched OKLCH palettes (accent + chassis)
|
|
47
47
|
* interactively. To art-direct further (re-tuned intents, custom surface
|
|
48
|
-
* stops, warm shadow tint), see apps/docs/src/lib/style/
|
|
48
|
+
* stops, warm shadow tint), see apps/docs/src/lib/style/rooms-docs.css for a
|
|
49
49
|
* fully worked example.
|
|
50
50
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly accessibility: {
|
|
3
3
|
readonly avatar: "Avatar";
|
|
4
|
+
readonly breadcrumb: "Pfadnavigation";
|
|
5
|
+
readonly breadcrumbExpand: "Alle Pfadebenen anzeigen";
|
|
4
6
|
readonly clearInput: "Eingabe löschen";
|
|
5
7
|
readonly clearSearch: "Suche löschen";
|
|
6
8
|
readonly clearSelection: "Auswahl löschen";
|
|
@@ -19,6 +21,7 @@ declare const _default: {
|
|
|
19
21
|
readonly removableBadge: "Entfernbarer Badge";
|
|
20
22
|
readonly removeBadge: "Badge entfernen";
|
|
21
23
|
readonly removeFile: "{{name}} entfernen";
|
|
24
|
+
readonly removeTag: "{{label}} entfernen";
|
|
22
25
|
};
|
|
23
26
|
readonly button: {
|
|
24
27
|
readonly close: "Schließen";
|
package/dist/translations/de.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
accessibility: {
|
|
3
3
|
avatar: 'Avatar',
|
|
4
|
+
breadcrumb: 'Pfadnavigation',
|
|
5
|
+
breadcrumbExpand: 'Alle Pfadebenen anzeigen',
|
|
4
6
|
clearInput: 'Eingabe löschen',
|
|
5
7
|
clearSearch: 'Suche löschen',
|
|
6
8
|
clearSelection: 'Auswahl löschen',
|
|
@@ -18,7 +20,8 @@ export default {
|
|
|
18
20
|
toggleOptions: 'Optionen umschalten',
|
|
19
21
|
removableBadge: 'Entfernbarer Badge',
|
|
20
22
|
removeBadge: 'Badge entfernen',
|
|
21
|
-
removeFile: '{{name}} entfernen'
|
|
23
|
+
removeFile: '{{name}} entfernen',
|
|
24
|
+
removeTag: '{{label}} entfernen'
|
|
22
25
|
},
|
|
23
26
|
button: {
|
|
24
27
|
close: 'Schließen',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly accessibility: {
|
|
3
3
|
readonly avatar: "Avatar";
|
|
4
|
+
readonly breadcrumb: "Breadcrumb";
|
|
5
|
+
readonly breadcrumbExpand: "Show all breadcrumb items";
|
|
4
6
|
readonly clearInput: "Clear input";
|
|
5
7
|
readonly clearSearch: "Clear search";
|
|
6
8
|
readonly clearSelection: "Clear selection";
|
|
@@ -19,6 +21,7 @@ declare const _default: {
|
|
|
19
21
|
readonly removableBadge: "Removable badge";
|
|
20
22
|
readonly removeBadge: "Remove badge";
|
|
21
23
|
readonly removeFile: "Remove {{name}}";
|
|
24
|
+
readonly removeTag: "Remove {{label}}";
|
|
22
25
|
};
|
|
23
26
|
readonly button: {
|
|
24
27
|
readonly close: "Close";
|
package/dist/translations/en.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
accessibility: {
|
|
3
3
|
avatar: 'Avatar',
|
|
4
|
+
breadcrumb: 'Breadcrumb',
|
|
5
|
+
breadcrumbExpand: 'Show all breadcrumb items',
|
|
4
6
|
clearInput: 'Clear input',
|
|
5
7
|
clearSearch: 'Clear search',
|
|
6
8
|
clearSelection: 'Clear selection',
|
|
@@ -18,7 +20,8 @@ export default {
|
|
|
18
20
|
toggleOptions: 'Toggle options',
|
|
19
21
|
removableBadge: 'Removable badge',
|
|
20
22
|
removeBadge: 'Remove badge',
|
|
21
|
-
removeFile: 'Remove {{name}}'
|
|
23
|
+
removeFile: 'Remove {{name}}',
|
|
24
|
+
removeTag: 'Remove {{label}}'
|
|
22
25
|
},
|
|
23
26
|
button: {
|
|
24
27
|
close: 'Close',
|
|
@@ -103,8 +103,14 @@ export interface GuideTour {
|
|
|
103
103
|
* consumer can inject a server-state adapter. Kept deliberately tiny.
|
|
104
104
|
*/
|
|
105
105
|
export interface GuideStorageAdapter {
|
|
106
|
-
/**
|
|
107
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Returns the persisted set of seen/completed ids. Return a `string[]`
|
|
108
|
+
* synchronously (localStorage, the default) or a `Promise<string[]>` for a
|
|
109
|
+
* DB-/remote-backed store. While an async load is pending the seen set starts
|
|
110
|
+
* empty and is merged (union) with the resolved ids once they arrive — so a
|
|
111
|
+
* tour may briefly be startable before the store answers.
|
|
112
|
+
*/
|
|
113
|
+
load(): string[] | Promise<string[]>;
|
|
108
114
|
/** Persists the full set of seen/completed ids. */
|
|
109
115
|
save(ids: string[]): void;
|
|
110
116
|
}
|