@human-kit/ui 1.0.0-beta.7 → 1.0.0-beta.8
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/FOCUS_STATE_CONTRACT.md +15 -4
- package/dist/FOCUS_STATE_REVIEW_TEMPLATE.md +8 -8
- package/dist/avatar/README.md +52 -0
- package/dist/avatar/count/avatar-count.svelte +56 -0
- package/dist/avatar/count/avatar-count.svelte.d.ts +4 -0
- package/dist/avatar/fallback/avatar-fallback.svelte +67 -0
- package/dist/avatar/fallback/avatar-fallback.svelte.d.ts +4 -0
- package/dist/avatar/group/avatar-group.svelte +65 -0
- package/dist/avatar/group/avatar-group.svelte.d.ts +4 -0
- package/dist/avatar/group/context.d.ts +15 -0
- package/dist/avatar/group/context.js +15 -0
- package/dist/avatar/image/avatar-image.svelte +104 -0
- package/dist/avatar/image/avatar-image.svelte.d.ts +4 -0
- package/dist/avatar/index.d.ts +22 -0
- package/dist/avatar/index.js +10 -0
- package/dist/avatar/index.parts.d.ts +5 -0
- package/dist/avatar/index.parts.js +5 -0
- package/dist/avatar/root/avatar-root.svelte +79 -0
- package/dist/avatar/root/avatar-root.svelte.d.ts +4 -0
- package/dist/avatar/root/context.d.ts +14 -0
- package/dist/avatar/root/context.js +15 -0
- package/dist/avatar/types.d.ts +84 -0
- package/dist/avatar/types.js +1 -0
- package/dist/breadcrumbs/README.md +65 -0
- package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte +62 -0
- package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte.d.ts +4 -0
- package/dist/breadcrumbs/index.d.ts +23 -0
- package/dist/breadcrumbs/index.js +10 -0
- package/dist/breadcrumbs/index.parts.d.ts +6 -0
- package/dist/breadcrumbs/index.parts.js +6 -0
- package/dist/breadcrumbs/item/breadcrumbs-item.svelte +42 -0
- package/dist/breadcrumbs/item/breadcrumbs-item.svelte.d.ts +4 -0
- package/dist/breadcrumbs/link/breadcrumbs-link.svelte +47 -0
- package/dist/breadcrumbs/link/breadcrumbs-link.svelte.d.ts +4 -0
- package/dist/breadcrumbs/list/breadcrumbs-list.svelte +31 -0
- package/dist/breadcrumbs/list/breadcrumbs-list.svelte.d.ts +4 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.svelte +112 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.svelte.d.ts +4 -0
- package/dist/breadcrumbs/root/context.d.ts +19 -0
- package/dist/breadcrumbs/root/context.js +15 -0
- package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte +35 -0
- package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte.d.ts +4 -0
- package/dist/breadcrumbs/types.d.ts +80 -0
- package/dist/breadcrumbs/types.js +1 -0
- package/dist/combobox/popover/combobox-popover.svelte +4 -56
- package/dist/dialog/root/dialog-root.svelte +15 -2
- package/dist/drawer/root/drawer-root.svelte +15 -2
- package/dist/index.d.ts +14 -0
- package/dist/index.js +13 -0
- package/dist/internal/localized-strings.d.ts +48 -0
- package/dist/internal/localized-strings.js +48 -0
- package/dist/internal/number-precision.d.ts +9 -0
- package/dist/internal/number-precision.js +27 -0
- package/dist/menu/root/focus-state.d.ts +2 -2
- package/dist/menu/root/focus-state.js +8 -32
- package/dist/menu/root/menu-state.svelte.js +5 -1
- package/dist/numberfield/root/number-utils.js +1 -20
- package/dist/popover/root/focus-state.d.ts +2 -2
- package/dist/popover/root/focus-state.js +7 -34
- package/dist/primitives/contain-wheel.d.ts +9 -0
- package/dist/primitives/contain-wheel.js +41 -0
- package/dist/primitives/floating.d.ts +6 -0
- package/dist/primitives/floating.js +26 -5
- package/dist/primitives/keyboard-navigation.d.ts +6 -0
- package/dist/primitives/keyboard-navigation.js +2 -1
- package/dist/primitives/trigger-focus-state.d.ts +29 -0
- package/dist/primitives/trigger-focus-state.js +57 -0
- package/dist/progress/README.md +54 -0
- package/dist/progress/index.d.ts +21 -0
- package/dist/progress/index.js +9 -0
- package/dist/progress/index.parts.d.ts +5 -0
- package/dist/progress/index.parts.js +5 -0
- package/dist/progress/indicator/progress-indicator.svelte +37 -0
- package/dist/progress/indicator/progress-indicator.svelte.d.ts +4 -0
- package/dist/progress/label/progress-label.svelte +34 -0
- package/dist/progress/label/progress-label.svelte.d.ts +4 -0
- package/dist/progress/root/context.d.ts +26 -0
- package/dist/progress/root/context.js +15 -0
- package/dist/progress/root/progress-root.svelte +136 -0
- package/dist/progress/root/progress-root.svelte.d.ts +4 -0
- package/dist/progress/root/progress-utils.d.ts +12 -0
- package/dist/progress/root/progress-utils.js +41 -0
- package/dist/progress/track/progress-track.svelte +27 -0
- package/dist/progress/track/progress-track.svelte.d.ts +4 -0
- package/dist/progress/types.d.ts +81 -0
- package/dist/progress/types.js +1 -0
- package/dist/progress/value/progress-value.svelte +36 -0
- package/dist/progress/value/progress-value.svelte.d.ts +4 -0
- package/dist/select/README.md +129 -0
- package/dist/select/index.d.ts +30 -0
- package/dist/select/index.js +16 -0
- package/dist/select/index.parts.d.ts +8 -0
- package/dist/select/index.parts.js +9 -0
- package/dist/select/item/select-item.svelte +68 -0
- package/dist/select/item/select-item.svelte.d.ts +10 -0
- package/dist/select/item-indicator/select-item-indicator.svelte +55 -0
- package/dist/select/item-indicator/select-item-indicator.svelte.d.ts +4 -0
- package/dist/select/label/select-label.svelte +46 -0
- package/dist/select/label/select-label.svelte.d.ts +4 -0
- package/dist/select/list/select-list.svelte +241 -0
- package/dist/select/list/select-list.svelte.d.ts +62 -0
- package/dist/select/popover/select-popover.svelte +80 -0
- package/dist/select/popover/select-popover.svelte.d.ts +9 -0
- package/dist/select/root/context.d.ts +106 -0
- package/dist/select/root/context.js +22 -0
- package/dist/select/root/select-root.svelte +544 -0
- package/dist/select/root/select-root.svelte.d.ts +25 -0
- package/dist/select/trigger/select-trigger.svelte +192 -0
- package/dist/select/trigger/select-trigger.svelte.d.ts +4 -0
- package/dist/select/types.d.ts +133 -0
- package/dist/select/types.js +1 -0
- package/dist/select/value/select-value.svelte +61 -0
- package/dist/select/value/select-value.svelte.d.ts +4 -0
- package/dist/separator/README.md +35 -0
- package/dist/separator/index.d.ts +7 -0
- package/dist/separator/index.js +3 -0
- package/dist/separator/separator.svelte +254 -0
- package/dist/separator/separator.svelte.d.ts +45 -0
- package/dist/separator/types.d.ts +1 -0
- package/dist/separator/types.js +1 -0
- package/dist/slider/README.md +61 -0
- package/dist/slider/fill/slider-fill.svelte +40 -0
- package/dist/slider/fill/slider-fill.svelte.d.ts +4 -0
- package/dist/slider/index.d.ts +9 -0
- package/dist/slider/index.js +8 -0
- package/dist/slider/index.parts.d.ts +6 -0
- package/dist/slider/index.parts.js +6 -0
- package/dist/slider/label/slider-label.svelte +44 -0
- package/dist/slider/label/slider-label.svelte.d.ts +4 -0
- package/dist/slider/output/slider-output.svelte +46 -0
- package/dist/slider/output/slider-output.svelte.d.ts +4 -0
- package/dist/slider/root/context.d.ts +106 -0
- package/dist/slider/root/context.js +15 -0
- package/dist/slider/root/slider-root.svelte +545 -0
- package/dist/slider/root/slider-root.svelte.d.ts +4 -0
- package/dist/slider/root/slider-utils.d.ts +57 -0
- package/dist/slider/root/slider-utils.js +88 -0
- package/dist/slider/thumb/slider-thumb.svelte +276 -0
- package/dist/slider/thumb/slider-thumb.svelte.d.ts +4 -0
- package/dist/slider/track/slider-track.svelte +60 -0
- package/dist/slider/track/slider-track.svelte.d.ts +4 -0
- package/dist/slider/types.d.ts +144 -0
- package/dist/slider/types.js +1 -0
- package/dist/tooltip/README.md +53 -0
- package/dist/tooltip/arrow/tooltip-arrow.svelte +36 -0
- package/dist/tooltip/arrow/tooltip-arrow.svelte.d.ts +4 -0
- package/dist/tooltip/content/tooltip-content.svelte +148 -0
- package/dist/tooltip/content/tooltip-content.svelte.d.ts +4 -0
- package/dist/tooltip/index.d.ts +8 -0
- package/dist/tooltip/index.js +7 -0
- package/dist/tooltip/index.parts.d.ts +5 -0
- package/dist/tooltip/index.parts.js +5 -0
- package/dist/tooltip/provider/tooltip-provider.svelte +36 -0
- package/dist/tooltip/provider/tooltip-provider.svelte.d.ts +4 -0
- package/dist/tooltip/root/context.d.ts +46 -0
- package/dist/tooltip/root/context.js +22 -0
- package/dist/tooltip/root/safe-polygon.d.ts +26 -0
- package/dist/tooltip/root/safe-polygon.js +66 -0
- package/dist/tooltip/root/tooltip-group.d.ts +26 -0
- package/dist/tooltip/root/tooltip-group.js +41 -0
- package/dist/tooltip/root/tooltip-root.svelte +454 -0
- package/dist/tooltip/root/tooltip-root.svelte.d.ts +4 -0
- package/dist/tooltip/trigger/tooltip-trigger.svelte +52 -0
- package/dist/tooltip/trigger/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/tooltip/types.d.ts +105 -0
- package/dist/tooltip/types.js +1 -0
- package/package.json +36 -1
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onDestroy, untrack } from 'svelte';
|
|
3
|
+
import { browser } from '../../internal/environment';
|
|
4
|
+
import { shouldShowFocusVisible } from '../../primitives/input-modality';
|
|
5
|
+
import { longPress } from '../../primitives/long-press';
|
|
6
|
+
import type { TooltipRootProps } from '../types';
|
|
7
|
+
import {
|
|
8
|
+
getTooltipProviderContext,
|
|
9
|
+
setTooltipContext,
|
|
10
|
+
type TooltipChangeReason,
|
|
11
|
+
type TooltipCloseReason,
|
|
12
|
+
type TooltipContext,
|
|
13
|
+
type TooltipOpenChangeDetails,
|
|
14
|
+
type TooltipOpenReason
|
|
15
|
+
} from './context';
|
|
16
|
+
import {
|
|
17
|
+
DEFAULT_TOOLTIP_CLOSE_DELAY,
|
|
18
|
+
DEFAULT_TOOLTIP_DELAY,
|
|
19
|
+
DEFAULT_TOOLTIP_SKIP_DELAY,
|
|
20
|
+
registerOpenTooltip,
|
|
21
|
+
shouldSkipDelay,
|
|
22
|
+
unregisterOpenTooltip
|
|
23
|
+
} from './tooltip-group';
|
|
24
|
+
import {
|
|
25
|
+
buildSafePolygon,
|
|
26
|
+
isPointInPolygon,
|
|
27
|
+
isPointInRect,
|
|
28
|
+
type Point,
|
|
29
|
+
type Side
|
|
30
|
+
} from './safe-polygon';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip.Root — the open state, the delays, and the interaction with the trigger.
|
|
34
|
+
*
|
|
35
|
+
* The interaction lives here and not in `Tooltip.Trigger`, thus any element can be the trigger
|
|
36
|
+
* through `triggerRef`. It opens after a delay on a pointer that is not a touch, at once on a
|
|
37
|
+
* keyboard focus, and never on a focus that a script gave. It closes when the pointer leaves
|
|
38
|
+
* the trigger and the content, on a blur, on Escape, and on a press on the trigger: a press
|
|
39
|
+
* does something, and the tooltip must get out of the way.
|
|
40
|
+
*/
|
|
41
|
+
const generatedId = $props.id();
|
|
42
|
+
|
|
43
|
+
let {
|
|
44
|
+
id: idProp,
|
|
45
|
+
open = $bindable(),
|
|
46
|
+
defaultOpen = false,
|
|
47
|
+
controlledOpen = false,
|
|
48
|
+
onOpenChange,
|
|
49
|
+
delay,
|
|
50
|
+
closeDelay,
|
|
51
|
+
disabled = false,
|
|
52
|
+
openOnLongPress = true,
|
|
53
|
+
triggerRef = $bindable<HTMLElement | null>(null),
|
|
54
|
+
children,
|
|
55
|
+
context = $bindable()
|
|
56
|
+
}: TooltipRootProps = $props();
|
|
57
|
+
|
|
58
|
+
const provider = getTooltipProviderContext();
|
|
59
|
+
const instanceId = untrack(() => idProp) ?? generatedId;
|
|
60
|
+
const contentId = `tooltip-${instanceId}`;
|
|
61
|
+
|
|
62
|
+
let isOpenInternal = $state(untrack(() => defaultOpen));
|
|
63
|
+
let contentRef: HTMLElement | null = $state(null);
|
|
64
|
+
let arrowRef: HTMLElement | null = $state(null);
|
|
65
|
+
// Whether `Tooltip.Trigger` set the trigger. It then renders the attributes of the trigger
|
|
66
|
+
// itself; for an element the consumer gave, the root writes them.
|
|
67
|
+
let triggerFromPart = false;
|
|
68
|
+
|
|
69
|
+
// `open` wins whenever it is supplied — that covers both `bind:open` and a plain
|
|
70
|
+
// `open={...}` — and the internal state only carries the fully uncontrolled case.
|
|
71
|
+
const isOpen = $derived(controlledOpen ? Boolean(open) : (open ?? isOpenInternal));
|
|
72
|
+
const resolvedDelay = $derived(delay ?? provider?.delay ?? DEFAULT_TOOLTIP_DELAY);
|
|
73
|
+
const resolvedCloseDelay = $derived(
|
|
74
|
+
closeDelay ?? provider?.closeDelay ?? DEFAULT_TOOLTIP_CLOSE_DELAY
|
|
75
|
+
);
|
|
76
|
+
const resolvedSkipDelay = $derived(provider?.skipDelay ?? DEFAULT_TOOLTIP_SKIP_DELAY);
|
|
77
|
+
|
|
78
|
+
// --- Open state ---------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
function setOpenWithDetails(
|
|
81
|
+
value: boolean,
|
|
82
|
+
incoming: { reason: TooltipChangeReason; event?: Event }
|
|
83
|
+
) {
|
|
84
|
+
let canceled = false;
|
|
85
|
+
const details: TooltipOpenChangeDetails = {
|
|
86
|
+
reason: incoming.reason,
|
|
87
|
+
event: incoming.event,
|
|
88
|
+
cancel: () => {
|
|
89
|
+
canceled = true;
|
|
90
|
+
},
|
|
91
|
+
get isCanceled() {
|
|
92
|
+
return canceled;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
onOpenChange?.(value, details);
|
|
97
|
+
if (details.isCanceled) return;
|
|
98
|
+
// Fully controlled: the parent owns the state and sends the value back down, or not.
|
|
99
|
+
if (controlledOpen) return;
|
|
100
|
+
|
|
101
|
+
isOpenInternal = value;
|
|
102
|
+
open = value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let openTimer: ReturnType<typeof setTimeout> | null = null;
|
|
106
|
+
let closeTimer: ReturnType<typeof setTimeout> | null = null;
|
|
107
|
+
|
|
108
|
+
function clearTimers() {
|
|
109
|
+
if (openTimer !== null) {
|
|
110
|
+
clearTimeout(openTimer);
|
|
111
|
+
openTimer = null;
|
|
112
|
+
}
|
|
113
|
+
if (closeTimer !== null) {
|
|
114
|
+
clearTimeout(closeTimer);
|
|
115
|
+
closeTimer = null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function openTooltip(reason: TooltipOpenReason = 'imperative-action', event?: Event) {
|
|
120
|
+
clearTimers();
|
|
121
|
+
if (disabled || isOpen) return;
|
|
122
|
+
setOpenWithDetails(true, { reason, event });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function closeTooltip(reason: TooltipCloseReason = 'imperative-action', event?: Event) {
|
|
126
|
+
clearTimers();
|
|
127
|
+
if (!isOpen) return;
|
|
128
|
+
setOpenWithDetails(false, { reason, event });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// The first tooltip of a row waits; the next ones open at once while the user reads along.
|
|
132
|
+
function scheduleOpen(reason: TooltipOpenReason, event: Event) {
|
|
133
|
+
clearTimers();
|
|
134
|
+
if (disabled || isOpen) return;
|
|
135
|
+
const wait = shouldSkipDelay(resolvedSkipDelay) ? 0 : resolvedDelay;
|
|
136
|
+
if (wait <= 0) {
|
|
137
|
+
openTooltip(reason, event);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
openTimer = setTimeout(() => {
|
|
141
|
+
openTimer = null;
|
|
142
|
+
openTooltip(reason, event);
|
|
143
|
+
}, wait);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// The pointer gets `closeDelay` to cross from the trigger to the content: a tooltip the
|
|
147
|
+
// pointer cannot reach is one the user cannot read to the end.
|
|
148
|
+
function scheduleClose(reason: TooltipCloseReason, event: Event) {
|
|
149
|
+
clearTimers();
|
|
150
|
+
if (!isOpen) return;
|
|
151
|
+
if (resolvedCloseDelay <= 0) {
|
|
152
|
+
closeTooltip(reason, event);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
closeTimer = setTimeout(() => {
|
|
156
|
+
closeTimer = null;
|
|
157
|
+
if (pointerOnContent) return;
|
|
158
|
+
closeTooltip(reason, event);
|
|
159
|
+
}, resolvedCloseDelay);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// One tooltip at most is open, whatever opened it: also a `bind:open` from the parent.
|
|
163
|
+
const groupEntry = { close: (reason: 'other-tooltip') => closeTooltip(reason) };
|
|
164
|
+
$effect(() => {
|
|
165
|
+
if (!isOpen) return;
|
|
166
|
+
registerOpenTooltip(groupEntry);
|
|
167
|
+
return () => unregisterOpenTooltip(groupEntry);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
$effect(() => {
|
|
171
|
+
if (!disabled) return;
|
|
172
|
+
untrack(() => closeTooltip('imperative-action'));
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// --- Trigger interaction ------------------------------------------------------------------
|
|
176
|
+
|
|
177
|
+
let pointerOnContent = false;
|
|
178
|
+
// A press on the trigger closes the tooltip, and it stays closed until the pointer leaves:
|
|
179
|
+
// the user is working with the control, not reading about it.
|
|
180
|
+
let pressSuppressed = false;
|
|
181
|
+
// A tooltip that a keyboard focus opened stays open while the focus is there, also when
|
|
182
|
+
// the pointer leaves.
|
|
183
|
+
let keyboardFocused = false;
|
|
184
|
+
|
|
185
|
+
function handleTriggerPointerEnter(event: PointerEvent) {
|
|
186
|
+
// A touch has no hover: the finger lands and presses.
|
|
187
|
+
if (event.pointerType === 'touch') return;
|
|
188
|
+
stopGapTracking();
|
|
189
|
+
if (pressSuppressed) return;
|
|
190
|
+
scheduleOpen('hover', event);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function handleTriggerPointerLeave(event: PointerEvent) {
|
|
194
|
+
if (event.pointerType === 'touch') return;
|
|
195
|
+
pressSuppressed = false;
|
|
196
|
+
if (openTimer !== null) {
|
|
197
|
+
clearTimeout(openTimer);
|
|
198
|
+
openTimer = null;
|
|
199
|
+
}
|
|
200
|
+
if (keyboardFocused) return;
|
|
201
|
+
if (isOpen && startGapTracking(event)) return;
|
|
202
|
+
scheduleClose('hover-out', event);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// --- The gap between the trigger and the content ------------------------------------------
|
|
206
|
+
|
|
207
|
+
// The pointer that leaves the trigger toward the content crosses a gap where it is on
|
|
208
|
+
// neither. While it moves inside the triangle from the exit point to the near edge of the
|
|
209
|
+
// content, the tooltip waits for it. Outside the triangle, or still for too long, it closes.
|
|
210
|
+
const GAP_STALL_MS = 300;
|
|
211
|
+
let gapPolygon: Point[] | null = null;
|
|
212
|
+
let gapStallTimer: ReturnType<typeof setTimeout> | null = null;
|
|
213
|
+
let gapLeaveEvent: Event | null = null;
|
|
214
|
+
|
|
215
|
+
function readContentSide(): Side {
|
|
216
|
+
const side = contentRef?.dataset.placement;
|
|
217
|
+
return side === 'bottom' || side === 'left' || side === 'right' ? side : 'top';
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function startGapTracking(event: PointerEvent): boolean {
|
|
221
|
+
if (!contentRef || !triggerRef) return false;
|
|
222
|
+
const content = contentRef.getBoundingClientRect();
|
|
223
|
+
const exit = { x: event.clientX, y: event.clientY };
|
|
224
|
+
gapPolygon = buildSafePolygon(exit, content, readContentSide());
|
|
225
|
+
gapLeaveEvent = event;
|
|
226
|
+
document.addEventListener('pointermove', handleGapPointerMove);
|
|
227
|
+
restartGapStall();
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function stopGapTracking() {
|
|
232
|
+
if (!gapPolygon) return;
|
|
233
|
+
gapPolygon = null;
|
|
234
|
+
gapLeaveEvent = null;
|
|
235
|
+
document.removeEventListener('pointermove', handleGapPointerMove);
|
|
236
|
+
if (gapStallTimer !== null) {
|
|
237
|
+
clearTimeout(gapStallTimer);
|
|
238
|
+
gapStallTimer = null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function restartGapStall() {
|
|
243
|
+
if (gapStallTimer !== null) clearTimeout(gapStallTimer);
|
|
244
|
+
gapStallTimer = setTimeout(() => {
|
|
245
|
+
gapStallTimer = null;
|
|
246
|
+
const event = gapLeaveEvent;
|
|
247
|
+
stopGapTracking();
|
|
248
|
+
if (!pointerOnContent && event) scheduleClose('hover-out', event);
|
|
249
|
+
}, GAP_STALL_MS);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function handleGapPointerMove(event: PointerEvent) {
|
|
253
|
+
if (!gapPolygon) return;
|
|
254
|
+
const point = { x: event.clientX, y: event.clientY };
|
|
255
|
+
const onContent = contentRef ? isPointInRect(point, contentRef.getBoundingClientRect()) : false;
|
|
256
|
+
const onTrigger = triggerRef ? isPointInRect(point, triggerRef.getBoundingClientRect()) : false;
|
|
257
|
+
if (onContent || onTrigger) {
|
|
258
|
+
// The `pointerenter` of the content or the trigger takes over from here.
|
|
259
|
+
stopGapTracking();
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (isPointInPolygon(point, gapPolygon)) {
|
|
263
|
+
restartGapStall();
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
stopGapTracking();
|
|
267
|
+
scheduleClose('hover-out', event);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// --- Long press ---------------------------------------------------------------------------
|
|
271
|
+
|
|
272
|
+
// A touch has no hover. A long press opens the tooltip, and it stays open until a press
|
|
273
|
+
// somewhere else, a tap on the trigger, or Escape. The press itself closes nothing here: it
|
|
274
|
+
// is the start of the gesture.
|
|
275
|
+
function handleLongPress(_point: unknown, event: PointerEvent) {
|
|
276
|
+
if (disabled) return;
|
|
277
|
+
openedByTouch = true;
|
|
278
|
+
openTooltip('hover', event);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
let openedByTouch = false;
|
|
282
|
+
|
|
283
|
+
function handleDocumentPointerDown(event: PointerEvent) {
|
|
284
|
+
if (!openedByTouch || !isOpen) return;
|
|
285
|
+
const target = event.target;
|
|
286
|
+
if (target instanceof Node && (triggerRef?.contains(target) || contentRef?.contains(target))) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
openedByTouch = false;
|
|
290
|
+
closeTooltip('hover-out', event);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function handleTriggerPointerDown(event: PointerEvent) {
|
|
294
|
+
if (event.pointerType !== 'mouse' && openOnLongPress) {
|
|
295
|
+
// A finger that lands on the trigger starts a long press when the tooltip is closed,
|
|
296
|
+
// and closes an open one: the user is done with the description.
|
|
297
|
+
if (!isOpen) return;
|
|
298
|
+
openedByTouch = false;
|
|
299
|
+
closeTooltip('trigger-press', event);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
pressSuppressed = true;
|
|
303
|
+
closeTooltip('trigger-press', event);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function handleTriggerFocus(event: FocusEvent) {
|
|
307
|
+
const target = event.currentTarget instanceof HTMLElement ? event.currentTarget : null;
|
|
308
|
+
// A focus from the keyboard, or a restored one with the keyboard modality, opens at once.
|
|
309
|
+
// A focus that a script gave for another reason, or a pointer press, does not.
|
|
310
|
+
if (!shouldShowFocusVisible(target)) return;
|
|
311
|
+
keyboardFocused = true;
|
|
312
|
+
openTooltip('focus', event);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function handleTriggerBlur(event: FocusEvent) {
|
|
316
|
+
keyboardFocused = false;
|
|
317
|
+
closeTooltip('focus-out', event);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function handleDocumentKeyDown(event: KeyboardEvent) {
|
|
321
|
+
if (event.key !== 'Escape' || !isOpen || event.defaultPrevented) return;
|
|
322
|
+
// One Escape dismisses one thing. The tooltip is above everything, thus it goes first,
|
|
323
|
+
// and the layers under it read `defaultPrevented` and stay.
|
|
324
|
+
event.preventDefault();
|
|
325
|
+
closeTooltip('escape-key', event);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function handleContentPointerEnter(event: PointerEvent) {
|
|
329
|
+
if (event.pointerType === 'touch') return;
|
|
330
|
+
pointerOnContent = true;
|
|
331
|
+
stopGapTracking();
|
|
332
|
+
if (closeTimer !== null) {
|
|
333
|
+
clearTimeout(closeTimer);
|
|
334
|
+
closeTimer = null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function handleContentPointerLeave(event: PointerEvent) {
|
|
339
|
+
if (event.pointerType === 'touch') return;
|
|
340
|
+
pointerOnContent = false;
|
|
341
|
+
if (keyboardFocused) return;
|
|
342
|
+
scheduleClose('hover-out', event);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
$effect(() => {
|
|
346
|
+
const trigger = triggerRef;
|
|
347
|
+
if (!trigger) return;
|
|
348
|
+
trigger.addEventListener('pointerenter', handleTriggerPointerEnter);
|
|
349
|
+
trigger.addEventListener('pointerleave', handleTriggerPointerLeave);
|
|
350
|
+
trigger.addEventListener('pointerdown', handleTriggerPointerDown);
|
|
351
|
+
trigger.addEventListener('focus', handleTriggerFocus);
|
|
352
|
+
trigger.addEventListener('blur', handleTriggerBlur);
|
|
353
|
+
return () => {
|
|
354
|
+
trigger.removeEventListener('pointerenter', handleTriggerPointerEnter);
|
|
355
|
+
trigger.removeEventListener('pointerleave', handleTriggerPointerLeave);
|
|
356
|
+
trigger.removeEventListener('pointerdown', handleTriggerPointerDown);
|
|
357
|
+
trigger.removeEventListener('focus', handleTriggerFocus);
|
|
358
|
+
trigger.removeEventListener('blur', handleTriggerBlur);
|
|
359
|
+
untrack(() => {
|
|
360
|
+
stopGapTracking();
|
|
361
|
+
pointerOnContent = false;
|
|
362
|
+
pressSuppressed = false;
|
|
363
|
+
keyboardFocused = false;
|
|
364
|
+
openedByTouch = false;
|
|
365
|
+
clearTimers();
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
$effect(() => {
|
|
371
|
+
const trigger = triggerRef;
|
|
372
|
+
if (!trigger || !openOnLongPress) return;
|
|
373
|
+
const press = longPress(trigger, { onLongPress: handleLongPress });
|
|
374
|
+
return () => press.destroy();
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
$effect(() => {
|
|
378
|
+
if (!isOpen || !openOnLongPress) return;
|
|
379
|
+
document.addEventListener('pointerdown', handleDocumentPointerDown, true);
|
|
380
|
+
return () => document.removeEventListener('pointerdown', handleDocumentPointerDown, true);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
$effect(() => {
|
|
384
|
+
if (!isOpen) return;
|
|
385
|
+
document.addEventListener('keydown', handleDocumentKeyDown, true);
|
|
386
|
+
return () => document.removeEventListener('keydown', handleDocumentKeyDown, true);
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
// An element the consumer gave gets the attributes written here; `Tooltip.Trigger` renders
|
|
390
|
+
// its own. The description points at the content only while the content is in the DOM.
|
|
391
|
+
$effect(() => {
|
|
392
|
+
const trigger = triggerRef;
|
|
393
|
+
if (!trigger || triggerFromPart) return;
|
|
394
|
+
const previousDescribedBy = trigger.getAttribute('aria-describedby');
|
|
395
|
+
if (isOpen) {
|
|
396
|
+
const ids = previousDescribedBy ? previousDescribedBy.split(/\s+/) : [];
|
|
397
|
+
if (!ids.includes(contentId)) ids.push(contentId);
|
|
398
|
+
trigger.setAttribute('aria-describedby', ids.join(' '));
|
|
399
|
+
}
|
|
400
|
+
trigger.dataset.state = isOpen ? 'open' : 'closed';
|
|
401
|
+
return () => {
|
|
402
|
+
const ids = (trigger.getAttribute('aria-describedby') ?? '')
|
|
403
|
+
.split(/\s+/)
|
|
404
|
+
.filter((id) => id && id !== contentId);
|
|
405
|
+
if (ids.length) trigger.setAttribute('aria-describedby', ids.join(' '));
|
|
406
|
+
else trigger.removeAttribute('aria-describedby');
|
|
407
|
+
delete trigger.dataset.state;
|
|
408
|
+
};
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
onDestroy(() => {
|
|
412
|
+
if (!browser) return;
|
|
413
|
+
clearTimers();
|
|
414
|
+
stopGapTracking();
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
const ctx: TooltipContext = {
|
|
418
|
+
instanceId,
|
|
419
|
+
contentId,
|
|
420
|
+
get isOpen() {
|
|
421
|
+
return isOpen;
|
|
422
|
+
},
|
|
423
|
+
get isDisabled() {
|
|
424
|
+
return disabled;
|
|
425
|
+
},
|
|
426
|
+
get triggerRef() {
|
|
427
|
+
return triggerRef ?? null;
|
|
428
|
+
},
|
|
429
|
+
get arrowRef() {
|
|
430
|
+
return arrowRef;
|
|
431
|
+
},
|
|
432
|
+
setTriggerRef(element) {
|
|
433
|
+
triggerFromPart = element !== null;
|
|
434
|
+
triggerRef = element;
|
|
435
|
+
},
|
|
436
|
+
setContentRef(element) {
|
|
437
|
+
contentRef = element;
|
|
438
|
+
},
|
|
439
|
+
setArrowRef(element) {
|
|
440
|
+
arrowRef = element;
|
|
441
|
+
},
|
|
442
|
+
open: openTooltip,
|
|
443
|
+
close: closeTooltip,
|
|
444
|
+
handleContentPointerEnter,
|
|
445
|
+
handleContentPointerLeave
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
setTooltipContext(ctx);
|
|
449
|
+
context = ctx;
|
|
450
|
+
</script>
|
|
451
|
+
|
|
452
|
+
{#if children}
|
|
453
|
+
{@render children()}
|
|
454
|
+
{/if}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { ButtonRoot } from '../../button/index.js';
|
|
4
|
+
import { useTooltipContext } from '../root/context';
|
|
5
|
+
import type { TooltipTriggerProps, TooltipTriggerRenderState } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip.Trigger — the button that the tooltip describes.
|
|
9
|
+
*
|
|
10
|
+
* The interaction lives in the root, on the element. This part renders the button, gives it
|
|
11
|
+
* to the root, and points at the content with `aria-describedby` while the content is in the
|
|
12
|
+
* DOM. Thus a screen reader reads the description after the name of the button.
|
|
13
|
+
*/
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
class: className = '',
|
|
17
|
+
element = $bindable<HTMLButtonElement | null>(null),
|
|
18
|
+
'aria-describedby': ariaDescribedBy,
|
|
19
|
+
...restProps
|
|
20
|
+
}: TooltipTriggerProps = $props();
|
|
21
|
+
|
|
22
|
+
const ctx = useTooltipContext('Tooltip.Trigger');
|
|
23
|
+
|
|
24
|
+
let buttonRef: HTMLButtonElement | null = $state(null);
|
|
25
|
+
|
|
26
|
+
$effect(() => {
|
|
27
|
+
element = buttonRef;
|
|
28
|
+
ctx.setTriggerRef(buttonRef);
|
|
29
|
+
return () => {
|
|
30
|
+
ctx.setTriggerRef(null);
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const describedBy = $derived(
|
|
35
|
+
ctx.isOpen ? [ariaDescribedBy, ctx.contentId].filter(Boolean).join(' ') : ariaDescribedBy
|
|
36
|
+
);
|
|
37
|
+
const renderState = $derived<TooltipTriggerRenderState>({ open: ctx.isOpen });
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<ButtonRoot
|
|
41
|
+
{...restProps}
|
|
42
|
+
bind:element={buttonRef}
|
|
43
|
+
class={className}
|
|
44
|
+
type="button"
|
|
45
|
+
aria-describedby={describedBy || undefined}
|
|
46
|
+
data-tooltip-trigger="true"
|
|
47
|
+
data-state={ctx.isOpen ? 'open' : 'closed'}
|
|
48
|
+
>
|
|
49
|
+
{#if children}
|
|
50
|
+
{@render (children as Snippet<[TooltipTriggerRenderState]>)(renderState)}
|
|
51
|
+
{/if}
|
|
52
|
+
</ButtonRoot>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import type { ExtendedPlacement } from '../primitives/floating';
|
|
4
|
+
import type { TooltipChangeReason, TooltipCloseReason, TooltipContext, TooltipOpenChangeDetails, TooltipOpenReason } from './root/context';
|
|
5
|
+
export type { TooltipChangeReason, TooltipCloseReason, TooltipOpenChangeDetails, TooltipOpenReason };
|
|
6
|
+
export type TooltipRootProps = {
|
|
7
|
+
/** A stable id, from which the component makes the id of the content. Give one on a server. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** The open state. By default it goes in the two directions: use `bind:open`. */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** The open state at the start, for when you give no `open`. */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Give your own code full control of the open state. The component stops to write back to
|
|
15
|
+
* `open`, and it reports only through `onOpenChange`. Thus the parent can refuse a change: the
|
|
16
|
+
* parent does not send the new value down. The default is off, because `bind:open` is the usual
|
|
17
|
+
* case and it needs the write-back.
|
|
18
|
+
*
|
|
19
|
+
* To refuse one change, use `details.cancel()`. That function works in the two modes.
|
|
20
|
+
*/
|
|
21
|
+
controlledOpen?: boolean;
|
|
22
|
+
/** The component calls it when the open state changes. */
|
|
23
|
+
onOpenChange?: (open: boolean, details: TooltipOpenChangeDetails) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The milliseconds between the pointer and the open. The default is 600, or the value of the
|
|
26
|
+
* `Tooltip.Provider`. A keyboard focus opens at once.
|
|
27
|
+
*/
|
|
28
|
+
delay?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The milliseconds between the pointer leaving and the close. The pointer can cross to the
|
|
31
|
+
* content in that time, and the content then keeps the tooltip open. The default is 100, or the
|
|
32
|
+
* value of the `Tooltip.Provider`.
|
|
33
|
+
*/
|
|
34
|
+
closeDelay?: number;
|
|
35
|
+
/** Stops the tooltip: it does not open. */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Opens the tooltip on a long press of a touch or a pen, because a touch has no hover. It then
|
|
39
|
+
* stays open until a press somewhere else, a tap on the trigger, or Escape. Set it to `false`
|
|
40
|
+
* on a control where a long press has a meaning of its own, such as a text selection.
|
|
41
|
+
*/
|
|
42
|
+
openOnLongPress?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The reference to the trigger element. Set it in your own code for an element that is not a
|
|
45
|
+
* `Tooltip.Trigger`, or let `Tooltip.Trigger` set it.
|
|
46
|
+
*/
|
|
47
|
+
triggerRef?: HTMLElement | null;
|
|
48
|
+
/** The children: the Trigger and the Content. */
|
|
49
|
+
children?: Snippet;
|
|
50
|
+
/** A bindable reference to the context, for a composition of your own. */
|
|
51
|
+
context?: TooltipContext;
|
|
52
|
+
};
|
|
53
|
+
export type TooltipProviderProps = {
|
|
54
|
+
/** The milliseconds between the pointer and the open, for every tooltip inside. */
|
|
55
|
+
delay?: number;
|
|
56
|
+
/** The milliseconds between the pointer leaving and the close, for every tooltip inside. */
|
|
57
|
+
closeDelay?: number;
|
|
58
|
+
/**
|
|
59
|
+
* The milliseconds after a close in which the next tooltip opens at once. The default is 300.
|
|
60
|
+
*/
|
|
61
|
+
skipDelay?: number;
|
|
62
|
+
children?: Snippet;
|
|
63
|
+
};
|
|
64
|
+
export type TooltipTriggerRenderState = {
|
|
65
|
+
/** Whether the tooltip is open. */
|
|
66
|
+
open: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type TooltipTriggerProps = Omit<HTMLButtonAttributes, 'type' | 'class' | 'children' | 'aria-describedby'> & {
|
|
69
|
+
/**
|
|
70
|
+
* The content. As a snippet with one argument, it receives the render state: `open`.
|
|
71
|
+
*/
|
|
72
|
+
children?: Snippet<[TooltipTriggerRenderState]> | Snippet;
|
|
73
|
+
/** The CSS class names of the button. */
|
|
74
|
+
class?: string;
|
|
75
|
+
/** A bindable reference to the button element. */
|
|
76
|
+
element?: HTMLButtonElement | null;
|
|
77
|
+
/** The ids of other elements that describe the button. The tooltip adds its own while open. */
|
|
78
|
+
'aria-describedby'?: string;
|
|
79
|
+
};
|
|
80
|
+
export type TooltipContentProps = {
|
|
81
|
+
/** The distance from the trigger, on the main axis. The default is 8. */
|
|
82
|
+
offset?: number;
|
|
83
|
+
/** The position against the trigger. The default is `top`. */
|
|
84
|
+
placement?: ExtendedPlacement;
|
|
85
|
+
/** Moves the panel to the opposite side when the space is not sufficient. */
|
|
86
|
+
shouldFlip?: boolean;
|
|
87
|
+
/** The element that gives the limits of the position. */
|
|
88
|
+
boundaryElement?: Element | null;
|
|
89
|
+
/**
|
|
90
|
+
* Moves the panel with the pointer along one axis, or both, in place of a fixed position
|
|
91
|
+
* against the trigger. For a wide trigger, `x` keeps the panel above the pointer. A tooltip
|
|
92
|
+
* that a keyboard focus opened stays against the trigger.
|
|
93
|
+
*/
|
|
94
|
+
followPointer?: 'x' | 'y' | 'both';
|
|
95
|
+
/** The content. */
|
|
96
|
+
children?: Snippet;
|
|
97
|
+
/** The CSS class names of the panel. */
|
|
98
|
+
class?: string;
|
|
99
|
+
/** A bindable reference to the panel element. */
|
|
100
|
+
element?: HTMLDivElement | null;
|
|
101
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children' | 'role' | 'id'>;
|
|
102
|
+
export type TooltipArrowProps = Omit<HTMLAttributes<HTMLSpanElement>, 'class'> & {
|
|
103
|
+
/** The CSS class names of the arrow. */
|
|
104
|
+
class?: string;
|
|
105
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@human-kit/ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"description": "Accessible, typed UI components for Svelte 5 — shipped as native ESM with per-component subpath exports so bundlers only include what you import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Agustin Delgado <agustindariodelgado@gmail.com>",
|
|
@@ -83,6 +83,16 @@
|
|
|
83
83
|
"svelte": "./dist/collapsible/index.js",
|
|
84
84
|
"default": "./dist/collapsible/index.js"
|
|
85
85
|
},
|
|
86
|
+
"./slider": {
|
|
87
|
+
"types": "./dist/slider/index.d.ts",
|
|
88
|
+
"svelte": "./dist/slider/index.js",
|
|
89
|
+
"default": "./dist/slider/index.js"
|
|
90
|
+
},
|
|
91
|
+
"./tooltip": {
|
|
92
|
+
"types": "./dist/tooltip/index.d.ts",
|
|
93
|
+
"svelte": "./dist/tooltip/index.js",
|
|
94
|
+
"default": "./dist/tooltip/index.js"
|
|
95
|
+
},
|
|
86
96
|
"./switch": {
|
|
87
97
|
"types": "./dist/switch/index.d.ts",
|
|
88
98
|
"svelte": "./dist/switch/index.js",
|
|
@@ -153,11 +163,21 @@
|
|
|
153
163
|
"svelte": "./dist/popover/index.js",
|
|
154
164
|
"default": "./dist/popover/index.js"
|
|
155
165
|
},
|
|
166
|
+
"./progress": {
|
|
167
|
+
"types": "./dist/progress/index.d.ts",
|
|
168
|
+
"svelte": "./dist/progress/index.js",
|
|
169
|
+
"default": "./dist/progress/index.js"
|
|
170
|
+
},
|
|
156
171
|
"./radio-group": {
|
|
157
172
|
"types": "./dist/radio-group/index.d.ts",
|
|
158
173
|
"svelte": "./dist/radio-group/index.js",
|
|
159
174
|
"default": "./dist/radio-group/index.js"
|
|
160
175
|
},
|
|
176
|
+
"./select": {
|
|
177
|
+
"types": "./dist/select/index.d.ts",
|
|
178
|
+
"svelte": "./dist/select/index.js",
|
|
179
|
+
"default": "./dist/select/index.js"
|
|
180
|
+
},
|
|
161
181
|
"./table": {
|
|
162
182
|
"types": "./dist/table/index.d.ts",
|
|
163
183
|
"svelte": "./dist/table/index.js",
|
|
@@ -183,6 +203,21 @@
|
|
|
183
203
|
"svelte": "./dist/tree/index.js",
|
|
184
204
|
"default": "./dist/tree/index.js"
|
|
185
205
|
},
|
|
206
|
+
"./avatar": {
|
|
207
|
+
"types": "./dist/avatar/index.d.ts",
|
|
208
|
+
"svelte": "./dist/avatar/index.js",
|
|
209
|
+
"default": "./dist/avatar/index.js"
|
|
210
|
+
},
|
|
211
|
+
"./breadcrumbs": {
|
|
212
|
+
"types": "./dist/breadcrumbs/index.d.ts",
|
|
213
|
+
"svelte": "./dist/breadcrumbs/index.js",
|
|
214
|
+
"default": "./dist/breadcrumbs/index.js"
|
|
215
|
+
},
|
|
216
|
+
"./separator": {
|
|
217
|
+
"types": "./dist/separator/index.d.ts",
|
|
218
|
+
"svelte": "./dist/separator/index.js",
|
|
219
|
+
"default": "./dist/separator/index.js"
|
|
220
|
+
},
|
|
186
221
|
"./input": {
|
|
187
222
|
"types": "./dist/input/index.d.ts",
|
|
188
223
|
"svelte": "./dist/input/index.js",
|