lapikit 0.4.11 → 0.4.13

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.
Files changed (42) hide show
  1. package/dist/labs/compiler/components.js +14 -0
  2. package/dist/labs/components/appbar/appbar.svelte +196 -0
  3. package/dist/labs/components/appbar/appbar.svelte.d.ts +4 -0
  4. package/dist/labs/components/appbar/appbar.types.d.ts +16 -0
  5. package/dist/labs/components/appbar/appbar.types.js +1 -0
  6. package/dist/labs/components/dropdown/dropdown.svelte +249 -0
  7. package/dist/labs/components/dropdown/dropdown.svelte.d.ts +4 -0
  8. package/dist/labs/components/dropdown/dropdown.svelte.js +148 -0
  9. package/dist/labs/components/dropdown/dropdown.types.d.ts +28 -0
  10. package/dist/labs/components/dropdown/dropdown.types.js +1 -0
  11. package/dist/labs/components/index.d.ts +8 -0
  12. package/dist/labs/components/index.js +8 -0
  13. package/dist/labs/components/list/list.svelte +190 -0
  14. package/dist/labs/components/list/list.svelte.d.ts +4 -0
  15. package/dist/labs/components/list/list.types.d.ts +30 -0
  16. package/dist/labs/components/list/list.types.js +1 -0
  17. package/dist/labs/components/list/modules/list-item.svelte +195 -0
  18. package/dist/labs/components/list/modules/list-item.svelte.d.ts +4 -0
  19. package/dist/labs/components/popover/popover.svelte +188 -0
  20. package/dist/labs/components/popover/popover.svelte.d.ts +4 -0
  21. package/dist/labs/components/popover/popover.svelte.js +134 -0
  22. package/dist/labs/components/popover/popover.types.d.ts +22 -0
  23. package/dist/labs/components/popover/popover.types.js +1 -0
  24. package/dist/labs/components/textfield/textfield.svelte +587 -0
  25. package/dist/labs/components/textfield/textfield.svelte.d.ts +4 -0
  26. package/dist/labs/components/textfield/textfield.types.d.ts +41 -0
  27. package/dist/labs/components/textfield/textfield.types.js +1 -0
  28. package/dist/labs/components/toolbar/toolbar.svelte +262 -0
  29. package/dist/labs/components/toolbar/toolbar.svelte.d.ts +4 -0
  30. package/dist/labs/components/toolbar/toolbar.types.d.ts +21 -0
  31. package/dist/labs/components/toolbar/toolbar.types.js +1 -0
  32. package/dist/labs/components/tooltip/tooltip.svelte +372 -0
  33. package/dist/labs/components/tooltip/tooltip.svelte.d.ts +4 -0
  34. package/dist/labs/components/tooltip/tooltip.svelte.js +131 -0
  35. package/dist/labs/components/tooltip/tooltip.types.d.ts +26 -0
  36. package/dist/labs/components/tooltip/tooltip.types.js +1 -0
  37. package/dist/labs/utils/index.d.ts +1 -0
  38. package/dist/labs/utils/index.js +1 -0
  39. package/dist/labs/utils/outside.d.ts +5 -0
  40. package/dist/labs/utils/outside.js +34 -0
  41. package/dist/labs/utils/types/index.d.ts +4 -0
  42. package/package.json +1 -1
@@ -0,0 +1,262 @@
1
+ <script lang="ts">
2
+ import { useClassName, useStyles } from '../../utils/index.js';
3
+ import { makeComponentProps } from '../../compiler/mapped-code.js';
4
+ import type { ToolbarProps } from './toolbar.types.js';
5
+
6
+ let {
7
+ ref = $bindable(),
8
+ is = 'div',
9
+ children,
10
+ class: className = '',
11
+ style: styleAttr = '',
12
+ 's-class': sClass,
13
+ 's-style': sStyle,
14
+ classContent,
15
+ light = false,
16
+ dark = false,
17
+ variant = 'text',
18
+ rounded,
19
+ background,
20
+ color,
21
+ density = 'default',
22
+ orientation = 'horizontal',
23
+ location,
24
+ ...rest
25
+ }: ToolbarProps = $props();
26
+
27
+ let safeVariant = $derived(
28
+ typeof variant === 'string' &&
29
+ (variant === 'outline' || variant === 'text' || variant === 'dash')
30
+ ? variant
31
+ : 'text'
32
+ );
33
+
34
+ let safeDensity = $derived(
35
+ typeof density === 'string' &&
36
+ (density === 'compact' || density === 'comfortable' || density === 'default')
37
+ ? density
38
+ : 'default'
39
+ );
40
+
41
+ let safeOrientation = $derived(
42
+ typeof orientation === 'string' && (orientation === 'horizontal' || orientation === 'vertical')
43
+ ? orientation
44
+ : 'horizontal'
45
+ );
46
+
47
+ let safeLocation = $derived(
48
+ typeof location === 'string' && (location === 'top' || location === 'bottom')
49
+ ? location
50
+ : undefined
51
+ );
52
+
53
+ let { classProps, styleProps, restProps } = $derived(
54
+ makeComponentProps(rest as Record<string, unknown>)
55
+ );
56
+
57
+ let componentClass = $derived(
58
+ useClassName({
59
+ baseClass: 'kit-toolbar',
60
+ className: `${className ?? ''}`.trim(),
61
+ sClass,
62
+ classProps
63
+ })
64
+ );
65
+
66
+ let normalizedClassContent = $derived(
67
+ Array.isArray(classContent) ? classContent.filter(Boolean).join(' ') : classContent
68
+ );
69
+
70
+ let wrapperClass = $derived(
71
+ useClassName({
72
+ baseClass: 'kit-toolbar__wrapper',
73
+ className: normalizedClassContent
74
+ })
75
+ );
76
+
77
+ let componentStyle = $derived(
78
+ useStyles({
79
+ styleAttr,
80
+ sStyle,
81
+ styleProps
82
+ })
83
+ );
84
+
85
+ let mergedStyle = $derived(
86
+ [
87
+ componentStyle,
88
+ background ? `--kit-toolbar-background:${background}` : '',
89
+ color ? `--kit-toolbar-color:${color}` : '',
90
+ typeof rounded === 'string' && rounded.includes('px') ? `--kit-toolbar-radius:${rounded}` : ''
91
+ ]
92
+ .filter(Boolean)
93
+ .join('; ')
94
+ );
95
+ </script>
96
+
97
+ <svelte:element
98
+ this={is}
99
+ bind:this={ref}
100
+ class={componentClass}
101
+ style={mergedStyle}
102
+ {...restProps}
103
+ role="toolbar"
104
+ data-variant={safeVariant}
105
+ data-density={safeDensity}
106
+ data-orientation={safeOrientation}
107
+ data-location={safeLocation}
108
+ data-light={light || undefined}
109
+ data-dark={dark || undefined}
110
+ data-rounded={rounded}
111
+ >
112
+ {#if safeVariant === 'outline'}
113
+ <span class="outline"></span>
114
+ {/if}
115
+
116
+ <div class={wrapperClass}>
117
+ {@render children?.()}
118
+ </div>
119
+ </svelte:element>
120
+
121
+ <style>
122
+ .kit-toolbar {
123
+ --kit-toolbar-background: var(--kit-surface-2);
124
+ --kit-toolbar-color: var(--kit-fg);
125
+ --kit-toolbar-border: color-mix(in oklab, var(--kit-toolbar-color), transparent 82%);
126
+ --kit-toolbar-radius: 1rem;
127
+ --kit-toolbar-gap: 0.5rem;
128
+ --kit-toolbar-padding-x: 0.75rem;
129
+ --kit-toolbar-padding-y: 0.5rem;
130
+ --kit-toolbar-size: auto;
131
+
132
+ position: relative;
133
+ display: inline-flex;
134
+ max-width: 100%;
135
+ box-sizing: border-box;
136
+ border-radius: var(--kit-toolbar-radius);
137
+ background: var(--kit-toolbar-background);
138
+ color: var(--kit-toolbar-color);
139
+ border: 1px solid var(--kit-toolbar-background);
140
+ }
141
+
142
+ .kit-toolbar[data-density='compact'] {
143
+ --kit-toolbar-gap: 0.375rem;
144
+ --kit-toolbar-padding-x: 0.625rem;
145
+ --kit-toolbar-padding-y: 0.375rem;
146
+ --kit-toolbar-size: 2.625rem;
147
+ }
148
+
149
+ .kit-toolbar[data-density='default'] {
150
+ --kit-toolbar-size: 3rem;
151
+ }
152
+
153
+ .kit-toolbar[data-density='comfortable'] {
154
+ --kit-toolbar-gap: 0.625rem;
155
+ --kit-toolbar-padding-x: 0.875rem;
156
+ --kit-toolbar-padding-y: 0.625rem;
157
+ --kit-toolbar-size: 3.5rem;
158
+ }
159
+
160
+ .kit-toolbar[data-variant='dash'] {
161
+ border: 1px dashed var(--kit-toolbar-border);
162
+ }
163
+
164
+ .kit-toolbar[data-variant='text'],
165
+ .kit-toolbar[data-variant='outline'],
166
+ .kit-toolbar[data-variant='dash'] {
167
+ --kit-toolbar-background: transparent;
168
+ --kit-toolbar-color: var(--kit-accent);
169
+ }
170
+
171
+ .kit-toolbar[data-light='true'] {
172
+ --kit-toolbar-background: color-mix(in oklab, white 88%, var(--kit-surface-1));
173
+ --kit-toolbar-color: var(--kit-fg);
174
+ }
175
+
176
+ .kit-toolbar[data-dark='true'] {
177
+ --kit-toolbar-background: color-mix(in oklab, black 72%, var(--kit-surface-3));
178
+ --kit-toolbar-color: white;
179
+ --kit-toolbar-border: color-mix(in oklab, white, transparent 72%);
180
+ }
181
+
182
+ .kit-toolbar .outline {
183
+ position: absolute;
184
+ inset: 0;
185
+ border: 1px solid var(--kit-toolbar-border);
186
+ border-radius: inherit;
187
+ pointer-events: none;
188
+ }
189
+
190
+ .kit-toolbar__wrapper {
191
+ position: relative;
192
+ z-index: 1;
193
+ display: inline-flex;
194
+ align-items: center;
195
+ justify-content: flex-start;
196
+ gap: var(--kit-toolbar-gap);
197
+ width: 100%;
198
+ padding: var(--kit-toolbar-padding-y) var(--kit-toolbar-padding-x);
199
+ border-radius: inherit;
200
+ }
201
+
202
+ .kit-toolbar[data-orientation='horizontal'] {
203
+ width: 100%;
204
+ min-height: var(--kit-toolbar-size);
205
+ }
206
+
207
+ .kit-toolbar[data-orientation='vertical'] .kit-toolbar__wrapper {
208
+ flex-direction: column;
209
+ align-items: stretch;
210
+ }
211
+
212
+ .kit-toolbar[data-orientation='vertical'] {
213
+ width: fit-content;
214
+ min-height: fit-content;
215
+ }
216
+
217
+ .kit-toolbar[data-orientation='horizontal'] .kit-toolbar__wrapper {
218
+ flex-direction: row;
219
+ }
220
+
221
+ .kit-toolbar[data-rounded='0'] {
222
+ --kit-toolbar-radius: 0;
223
+ }
224
+
225
+ .kit-toolbar[data-rounded='xs'] {
226
+ --kit-toolbar-radius: 2px;
227
+ }
228
+
229
+ .kit-toolbar[data-rounded='sm'] {
230
+ --kit-toolbar-radius: 4px;
231
+ }
232
+
233
+ .kit-toolbar[data-rounded='md'] {
234
+ --kit-toolbar-radius: 8px;
235
+ }
236
+
237
+ .kit-toolbar[data-rounded='lg'] {
238
+ --kit-toolbar-radius: 16px;
239
+ }
240
+
241
+ .kit-toolbar[data-rounded='xl'] {
242
+ --kit-toolbar-radius: 99999px;
243
+ }
244
+
245
+ .kit-toolbar[data-location='top'] {
246
+ position: fixed;
247
+ top: 0;
248
+ left: 0;
249
+ z-index: 1004;
250
+ width: 100%;
251
+ border-radius: 0;
252
+ }
253
+
254
+ .kit-toolbar[data-location='bottom'] {
255
+ position: fixed;
256
+ left: 0;
257
+ bottom: 0;
258
+ z-index: 1004;
259
+ width: 100%;
260
+ border-radius: 0;
261
+ }
262
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { ToolbarProps } from './toolbar.types.ts';
2
+ declare const Toolbar: import("svelte").Component<ToolbarProps, {}, "ref">;
3
+ type Toolbar = ReturnType<typeof Toolbar>;
4
+ export default Toolbar;
@@ -0,0 +1,21 @@
1
+ import type { Component, PropValue, RoundedType } from '../../utils/types/index.js';
2
+ type Variant = 'outline' | 'text' | 'dash';
3
+ type Density = 'compact' | 'comfortable' | 'default';
4
+ type Orientation = 'horizontal' | 'vertical';
5
+ type Location = 'top' | 'bottom';
6
+ export interface ToolbarProps extends Component {
7
+ ref?: HTMLElement | null;
8
+ is?: 'div' | 'header' | 'nav';
9
+ variant?: Variant | Record<string, Variant>;
10
+ rounded?: RoundedType | string;
11
+ density?: Density | Record<string, Density>;
12
+ dark?: boolean;
13
+ light?: boolean;
14
+ color?: string;
15
+ orientation?: Orientation | Record<string, Orientation>;
16
+ background?: string;
17
+ location?: Location | Record<string, Location>;
18
+ classContent?: string | string[] | undefined;
19
+ [key: string]: PropValue | Record<string, PropValue> | unknown;
20
+ }
21
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,372 @@
1
+ <script lang="ts">
2
+ import { onDestroy } from 'svelte';
3
+ import { useClassName, useStyles } from '../../utils/index.js';
4
+ import { makeComponentProps } from '../../compiler/mapped-code.js';
5
+ import { getPositionsTooltip } from './tooltip.svelte.js';
6
+ import type { TooltipProps } from './tooltip.types.js';
7
+
8
+ let {
9
+ ref = $bindable(),
10
+ children,
11
+ tooltip,
12
+ open = $bindable(false),
13
+ forceMount = false,
14
+ label,
15
+ dark = false,
16
+ light = false,
17
+ rounded,
18
+ color,
19
+ background,
20
+ location = 'bottom',
21
+ delayDuration = 850,
22
+ density = 'default',
23
+ variant,
24
+ disabled = false,
25
+ avoidCollisions = true,
26
+ class: className = '',
27
+ style: styleAttr = '',
28
+ 's-class': sClass,
29
+ 's-style': sStyle,
30
+ ...rest
31
+ }: TooltipProps = $props();
32
+
33
+ let safeLocation = $derived(
34
+ location === 'top' || location === 'bottom' || location === 'left' || location === 'right'
35
+ ? location
36
+ : 'bottom'
37
+ );
38
+ let safeDensity = $derived(
39
+ density === 'compact' || density === 'comfortable' || density === 'default'
40
+ ? density
41
+ : 'default'
42
+ );
43
+ let safeVariant = $derived(variant === 'arrow' ? 'arrow' : undefined);
44
+
45
+ let { classProps, styleProps, restProps } = $derived(
46
+ makeComponentProps(rest as Record<string, unknown>)
47
+ );
48
+
49
+ let triggerClass = $derived(
50
+ useClassName({
51
+ baseClass: 'kit-tooltip-trigger',
52
+ className: '',
53
+ sClass,
54
+ classProps
55
+ })
56
+ );
57
+
58
+ let componentClass = $derived(
59
+ useClassName({
60
+ baseClass: 'kit-tooltip__content',
61
+ className: `${className ?? ''}`.trim()
62
+ })
63
+ );
64
+
65
+ let componentStyle = $derived(
66
+ useStyles({
67
+ styleAttr,
68
+ sStyle,
69
+ styleProps
70
+ })
71
+ );
72
+
73
+ let mergedStyle = $derived(
74
+ [
75
+ componentStyle,
76
+ background ? `--kit-tooltip-background:${background}` : '',
77
+ color ? `--kit-tooltip-color:${color}` : '',
78
+ typeof rounded === 'string' && rounded.includes('px') ? `--kit-tooltip-radius:${rounded}` : ''
79
+ ]
80
+ .filter(Boolean)
81
+ .join('; ')
82
+ );
83
+
84
+ const positioner = getPositionsTooltip();
85
+
86
+ let triggerRef = $state<HTMLElement | null>(null);
87
+ let tooltipRef = $state<HTMLElement | null>(null);
88
+ let axis = $state(positioner.values);
89
+ let timer = $state<ReturnType<typeof setTimeout> | null>(null);
90
+ let innerHeight = $state(0);
91
+ let innerWidth = $state(0);
92
+ let scrollX = $state(0);
93
+ let scrollY = $state(0);
94
+ const tooltipId = `kit-tooltip-${Math.random().toString(36).slice(2, 10)}`;
95
+
96
+ const clearTimer = () => {
97
+ if (timer) {
98
+ clearTimeout(timer);
99
+ timer = null;
100
+ }
101
+ };
102
+
103
+ const updatePosition = () => {
104
+ if (!triggerRef || !tooltipRef) return;
105
+ positioner.update(triggerRef, tooltipRef, safeLocation, true, avoidCollisions);
106
+ axis = positioner.values;
107
+ };
108
+
109
+ const handleHoverOpen = () => {
110
+ if (disabled) {
111
+ open = false;
112
+ return;
113
+ }
114
+
115
+ clearTimer();
116
+ timer = setTimeout(() => {
117
+ open = true;
118
+ timer = null;
119
+ }, delayDuration);
120
+ };
121
+
122
+ const handleFocusOpen = () => {
123
+ if (disabled) {
124
+ open = false;
125
+ return;
126
+ }
127
+
128
+ clearTimer();
129
+ open = true;
130
+ };
131
+
132
+ const handleClose = () => {
133
+ clearTimer();
134
+ open = false;
135
+ };
136
+
137
+ const handleKeydown = (event: KeyboardEvent) => {
138
+ if (event.key === 'Escape') handleClose();
139
+ };
140
+
141
+ $effect(() => {
142
+ if (tooltip) forceMount = true;
143
+ });
144
+
145
+ $effect(() => {
146
+ if (disabled) open = false;
147
+ });
148
+
149
+ $effect(() => {
150
+ if (open && triggerRef && tooltipRef) {
151
+ updatePosition();
152
+ }
153
+ });
154
+
155
+ $effect(() => {
156
+ if (
157
+ open &&
158
+ triggerRef &&
159
+ tooltipRef &&
160
+ (scrollX > 0 || scrollY > 0 || innerHeight > 0 || innerWidth > 0)
161
+ ) {
162
+ updatePosition();
163
+ }
164
+ });
165
+
166
+ $effect(() => {
167
+ ref = triggerRef;
168
+ });
169
+
170
+ onDestroy(() => {
171
+ clearTimer();
172
+ });
173
+ </script>
174
+
175
+ <svelte:window bind:innerHeight bind:innerWidth bind:scrollX bind:scrollY />
176
+
177
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
178
+ <span
179
+ bind:this={triggerRef}
180
+ class={triggerClass}
181
+ style="display:inline-flex"
182
+ aria-describedby={open ? tooltipId : undefined}
183
+ onmouseenter={handleHoverOpen}
184
+ onmouseleave={handleClose}
185
+ onfocusin={handleFocusOpen}
186
+ onfocusout={handleClose}
187
+ onkeydown={handleKeydown}
188
+ >
189
+ {@render children?.()}
190
+ </span>
191
+
192
+ {#if open || forceMount}
193
+ <div
194
+ bind:this={tooltipRef}
195
+ class="kit-tooltip"
196
+ id={tooltipId}
197
+ role="tooltip"
198
+ aria-label={label}
199
+ style={`transform: translate(${axis.x}px, ${axis.y}px); display:${open ? 'block' : 'none'}`}
200
+ >
201
+ <div
202
+ class={componentClass}
203
+ style={mergedStyle}
204
+ data-density={safeDensity}
205
+ data-location={axis.location ?? safeLocation}
206
+ data-variant={safeVariant}
207
+ data-light={light || undefined}
208
+ data-dark={dark || undefined}
209
+ data-rounded={rounded}
210
+ {...restProps}
211
+ >
212
+ {#if tooltip}
213
+ {@render tooltip?.()}
214
+ {:else}
215
+ {label}
216
+ {/if}
217
+ </div>
218
+ </div>
219
+ {/if}
220
+
221
+ <style>
222
+ .kit-tooltip-trigger {
223
+ display: inline-flex;
224
+ width: fit-content;
225
+ max-width: max-content;
226
+ justify-self: start;
227
+ align-self: start;
228
+ }
229
+
230
+ .kit-tooltip-trigger:focus-visible {
231
+ outline: 2px solid var(--kit-focus);
232
+ outline-offset: 2px;
233
+ }
234
+
235
+ .kit-tooltip {
236
+ position: fixed;
237
+ inset: 0 auto auto 0;
238
+ z-index: 2000;
239
+ margin: 0;
240
+ pointer-events: none;
241
+ }
242
+
243
+ .kit-tooltip__content {
244
+ --kit-tooltip-background: var(--kit-surface-3);
245
+ --kit-tooltip-color: var(--kit-fg);
246
+ --kit-tooltip-radius: 8px;
247
+ --kit-tooltip-border: color-mix(in oklab, var(--kit-tooltip-background), black 8%);
248
+ --kit-tooltip-py: 0.15rem;
249
+ --kit-tooltip-px: 0.625rem;
250
+
251
+ position: relative;
252
+ display: inline-block;
253
+ width: max-content;
254
+ max-width: min(20rem, calc(100vw - 1rem));
255
+ padding: var(--kit-tooltip-py) var(--kit-tooltip-px);
256
+ border: 1px solid var(--kit-tooltip-border);
257
+ border-radius: var(--kit-tooltip-radius);
258
+ background: var(--kit-tooltip-background);
259
+ color: var(--kit-tooltip-color);
260
+ font-size: 0.875rem;
261
+ overflow-wrap: break-word;
262
+ box-shadow: 0 16px 29px -10px color-mix(in oklab, black 18%, transparent);
263
+ animation: kit-tooltip-enter 150ms ease;
264
+ }
265
+
266
+ .kit-tooltip__content[data-density='compact'] {
267
+ --kit-tooltip-py: 0.125rem;
268
+ --kit-tooltip-px: 0.5rem;
269
+ }
270
+
271
+ .kit-tooltip__content[data-density='comfortable'] {
272
+ --kit-tooltip-py: 0.35rem;
273
+ --kit-tooltip-px: 0.75rem;
274
+ }
275
+
276
+ .kit-tooltip__content[data-light='true'] {
277
+ --kit-tooltip-background: color-mix(in oklab, white 92%, var(--kit-surface-1));
278
+ --kit-tooltip-color: var(--kit-fg);
279
+ }
280
+
281
+ .kit-tooltip__content[data-dark='true'] {
282
+ --kit-tooltip-background: color-mix(in oklab, black 76%, var(--kit-surface-3));
283
+ --kit-tooltip-color: white;
284
+ --kit-tooltip-border: color-mix(in oklab, white, transparent 78%);
285
+ }
286
+
287
+ .kit-tooltip__content[data-rounded='0'] {
288
+ --kit-tooltip-radius: 0;
289
+ }
290
+ .kit-tooltip__content[data-rounded='xs'] {
291
+ --kit-tooltip-radius: 2px;
292
+ }
293
+ .kit-tooltip__content[data-rounded='sm'] {
294
+ --kit-tooltip-radius: 4px;
295
+ }
296
+ .kit-tooltip__content[data-rounded='md'] {
297
+ --kit-tooltip-radius: 8px;
298
+ }
299
+ .kit-tooltip__content[data-rounded='lg'] {
300
+ --kit-tooltip-radius: 16px;
301
+ }
302
+ .kit-tooltip__content[data-rounded='xl'] {
303
+ --kit-tooltip-radius: 99999px;
304
+ }
305
+
306
+ .kit-tooltip__content[data-variant='arrow']::after {
307
+ content: '';
308
+ position: absolute;
309
+ border-style: solid;
310
+ }
311
+
312
+ .kit-tooltip__content[data-variant='arrow'][data-location='bottom']::after,
313
+ .kit-tooltip__content[data-variant='arrow'][data-location='top']::after {
314
+ left: 50%;
315
+ margin-left: -0.35rem;
316
+ border-width: 0.35rem;
317
+ }
318
+
319
+ .kit-tooltip__content[data-variant='arrow'][data-location='bottom']::after {
320
+ bottom: 100%;
321
+ border-color: transparent transparent var(--kit-tooltip-background) transparent;
322
+ }
323
+
324
+ .kit-tooltip__content[data-variant='arrow'][data-location='top']::after {
325
+ top: 100%;
326
+ border-color: var(--kit-tooltip-background) transparent transparent transparent;
327
+ }
328
+
329
+ .kit-tooltip__content[data-variant='arrow'][data-location='left']::after,
330
+ .kit-tooltip__content[data-variant='arrow'][data-location='right']::after {
331
+ top: 50%;
332
+ margin-top: -0.35rem;
333
+ border-width: 0.35rem;
334
+ }
335
+
336
+ .kit-tooltip__content[data-variant='arrow'][data-location='right']::after {
337
+ right: 100%;
338
+ border-color: transparent var(--kit-tooltip-background) transparent transparent;
339
+ }
340
+
341
+ .kit-tooltip__content[data-variant='arrow'][data-location='left']::after {
342
+ left: 100%;
343
+ border-color: transparent transparent transparent var(--kit-tooltip-background);
344
+ }
345
+
346
+ .kit-tooltip__content[data-location='top'] {
347
+ --kit-tooltip-enter-x: 0;
348
+ --kit-tooltip-enter-y: 0.5rem;
349
+ }
350
+
351
+ .kit-tooltip__content[data-location='bottom'] {
352
+ --kit-tooltip-enter-x: 0;
353
+ --kit-tooltip-enter-y: -0.5rem;
354
+ }
355
+
356
+ .kit-tooltip__content[data-location='right'] {
357
+ --kit-tooltip-enter-x: -0.5rem;
358
+ --kit-tooltip-enter-y: 0;
359
+ }
360
+
361
+ .kit-tooltip__content[data-location='left'] {
362
+ --kit-tooltip-enter-x: 0.5rem;
363
+ --kit-tooltip-enter-y: 0;
364
+ }
365
+
366
+ @keyframes kit-tooltip-enter {
367
+ from {
368
+ opacity: 0;
369
+ transform: translate(var(--kit-tooltip-enter-x, 0), var(--kit-tooltip-enter-y, 0)) scale(0.95);
370
+ }
371
+ }
372
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { TooltipProps } from './tooltip.types.ts';
2
+ declare const Tooltip: import("svelte").Component<TooltipProps, {}, "ref" | "open">;
3
+ type Tooltip = ReturnType<typeof Tooltip>;
4
+ export default Tooltip;