reburn-ui 0.4.9 → 0.4.11
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/core/CodeHighlight/CodeHighlight.context.svelte.d.ts +2 -5
- package/dist/core/CodeHighlight/CodeHighlight.context.svelte.js +4 -3
- package/dist/core/CodeHighlight/CodeHighlight.svelte +6 -10
- package/dist/core/CodeHighlight/CodeHighlightControl.svelte +51 -1
- package/dist/core/CodeHighlight/CopyCodeButton/CopyCodeButton.svelte +2 -2
- package/dist/core/Notifications/NotificationContainer.svelte +4 -3
- package/dist/core/Notifications/Notifications.svelte +2 -2
- package/dist/core/Notifications/NotificationsStore.svelte.d.ts +1 -1
- package/dist/core/Notifications/NotificationsStore.svelte.js +1 -1
- package/dist/core/charts/ChartRoot/ChartContext.svelte.d.ts +2 -13
- package/dist/core/charts/ChartRoot/ChartContext.svelte.js +4 -3
- package/dist/core/charts/ChartRoot/ChartRoot.svelte +6 -8
- package/dist/core/charts/ChartTooltip/ChartTooltip.svelte +21 -6
- package/dist/core/charts/ScatterChart/ScatterChartInner.svelte +7 -5
- package/dist/core/charts/ScatterChart/ScatterChartInner.svelte.d.ts +1 -1
- package/dist/core/components/Anchor/Anchor.svelte +65 -0
- package/dist/core/components/Anchor/Anchor.svelte.d.ts +9 -0
- package/dist/core/components/AppShell/AppShell.svelte +2 -4
- package/dist/core/components/AppShell/AppShellContext.svelte.d.ts +7 -12
- package/dist/core/components/AppShell/AppShellContext.svelte.js +4 -3
- package/dist/core/components/Checkbox/Checkbox.svelte +37 -18
- package/dist/core/components/Checkbox/CheckboxCard/CheckboxCard.svelte +1 -4
- package/dist/core/components/Checkbox/CheckboxCard/CheckboxCardContext.svelte.d.ts +1 -2
- package/dist/core/components/Checkbox/CheckboxCard/CheckboxCardContext.svelte.js +4 -3
- package/dist/core/components/Checkbox/CheckboxGroup/CheckboxGroup.svelte +6 -7
- package/dist/core/components/Checkbox/CheckboxGroup/CheckboxGroup.svelte.d.ts +2 -2
- package/dist/core/components/Checkbox/CheckboxGroup/CheckboxGroupContext.svelte.d.ts +1 -2
- package/dist/core/components/Checkbox/CheckboxGroup/CheckboxGroupContext.svelte.js +4 -3
- package/dist/core/components/Checkbox/CheckboxIndicator.svelte +5 -7
- package/dist/core/components/Chip/ChipGroup/ChipGroup.svelte +1 -4
- package/dist/core/components/Chip/ChipGroup/ChipGroupContext.svelte.d.ts +1 -2
- package/dist/core/components/Chip/ChipGroup/ChipGroupContext.svelte.js +4 -3
- package/dist/core/components/Combobox/Combobox.svelte +3 -6
- package/dist/core/components/Combobox/Combobox.svelte.d.ts +1 -1
- package/dist/core/components/Combobox/ComboboxContext.svelte.d.ts +1 -2
- package/dist/core/components/Combobox/ComboboxContext.svelte.js +4 -3
- package/dist/core/components/CopyButton/CopyButton.svelte +2 -3
- package/dist/core/components/Floating/CreateFloating.svelte.d.ts +1 -1
- package/dist/core/components/Floating/CreateFloating.svelte.js +4 -4
- package/dist/core/components/Input/Input.context.svelte.d.ts +1 -2
- package/dist/core/components/Input/Input.context.svelte.js +4 -3
- package/dist/core/components/Input/Input.svelte +2 -4
- package/dist/core/components/Input/InputWrapper.context.svelte.d.ts +1 -2
- package/dist/core/components/Input/InputWrapper.context.svelte.js +4 -3
- package/dist/core/components/Input/InputWrapper.svelte +2 -4
- package/dist/core/components/ModalBase/CreateModal.svelte.js +2 -2
- package/dist/core/components/ModalBase/LockScroll.svelte.js +2 -2
- package/dist/core/components/Overlay/Overlay.svelte +2 -4
- package/dist/core/components/Pill/PillGroup.svelte +1 -4
- package/dist/core/components/Pill/PillGroupContext.svelte.d.ts +4 -8
- package/dist/core/components/Pill/PillGroupContext.svelte.js +3 -2
- package/dist/core/components/Popover/Popover.svelte +8 -10
- package/dist/core/components/Popover/PopoverContext.svelte.d.ts +7 -7
- package/dist/core/components/Popover/PopoverContext.svelte.js +33 -56
- package/dist/core/components/Popover/PopoverDropdown.svelte +5 -5
- package/dist/core/components/Progress/ProgressContext.svelte.d.ts +1 -2
- package/dist/core/components/Progress/ProgressContext.svelte.js +4 -3
- package/dist/core/components/Progress/ProgressRoot.svelte +3 -5
- package/dist/core/components/ScrollArea/ScrollAreaCorner.svelte +3 -3
- package/dist/core/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.svelte +3 -3
- package/dist/core/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.svelte +3 -3
- package/dist/core/components/Select/Select.svelte +2 -2
- package/dist/core/components/Slider/CreateRangeSlider.svelte.d.ts +1 -1
- package/dist/core/components/Slider/CreateRangeSlider.svelte.js +1 -1
- package/dist/core/components/Slider/CreateSlider.svelte.d.ts +1 -1
- package/dist/core/components/Slider/CreateSlider.svelte.js +1 -1
- package/dist/core/components/Stack/Stack.svelte +33 -0
- package/dist/core/components/Stack/Stack.svelte.d.ts +14 -0
- package/dist/core/components/Switch/SwitchGroup/SwitchGroup.svelte +2 -5
- package/dist/core/components/Switch/SwitchGroup/SwitchGroupContext.svelte.d.ts +1 -2
- package/dist/core/components/Switch/SwitchGroup/SwitchGroupContext.svelte.js +4 -3
- package/dist/core/components/Table/Table.svelte +1 -4
- package/dist/core/components/Table/TableContext.svelte.d.ts +1 -2
- package/dist/core/components/Table/TableContext.svelte.js +4 -3
- package/dist/core/components/Tabs/Tabs.svelte +87 -0
- package/dist/core/components/Tabs/Tabs.svelte.d.ts +41 -0
- package/dist/core/components/Tooltip/CreateTooltip.svelte.d.ts +1 -1
- package/dist/core/components/Tooltip/Tooltip.svelte +4 -3
- package/dist/core/components/Tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/core/components/Transitions/transitions.d.ts +31 -11
- package/dist/core/components/Transitions/transitions.js +13 -12
- package/dist/core/components/index.d.ts +3 -0
- package/dist/core/components/index.js +3 -0
- package/dist/core/hooks/index.d.ts +1 -0
- package/dist/core/hooks/index.js +1 -0
- package/dist/core/hooks/use-click-outside.svelte.d.ts +3 -5
- package/dist/core/hooks/use-click-outside.svelte.js +18 -15
- package/dist/core/hooks/use-clipboard.svelte.d.ts +6 -5
- package/dist/core/hooks/use-clipboard.svelte.js +17 -11
- package/dist/core/hooks/use-color-scheme.svelte.d.ts +3 -1
- package/dist/core/hooks/use-color-scheme.svelte.js +4 -1
- package/dist/core/hooks/use-counter.svelte.d.ts +3 -1
- package/dist/core/hooks/use-counter.svelte.js +4 -1
- package/dist/core/hooks/use-disclosur.svelte.d.ts +2 -1
- package/dist/core/hooks/use-disclosur.svelte.js +4 -1
- package/dist/core/hooks/use-focus-return.svelte.d.ts +3 -1
- package/dist/core/hooks/use-focus-return.svelte.js +4 -1
- package/dist/core/hooks/use-previous.svelte.d.ts +3 -1
- package/dist/core/hooks/use-previous.svelte.js +4 -1
- package/dist/core/hooks/use-reduced-motion.svelte.d.ts +1 -1
- package/dist/core/hooks/use-reduced-motion.svelte.js +1 -1
- package/dist/core/hooks/use-resize-observer.svelte.d.ts +3 -1
- package/dist/core/hooks/use-resize-observer.svelte.js +4 -1
- package/dist/core/hooks/utils/random-id.d.ts +1 -0
- package/dist/core/hooks/utils/random-id.js +3 -0
- package/dist/core/utils/data-attr.d.ts +1 -0
- package/dist/core/utils/data-attr.js +3 -0
- package/dist/docs/CodeDemo.svelte +23 -0
- package/dist/docs/CodeDemo.svelte.d.ts +7 -0
- package/dist/docs/DocsNavbar.svelte +47 -0
- package/dist/docs/DocsNavbar.svelte.d.ts +18 -0
- package/dist/docs/DocsTitle.svelte +36 -0
- package/dist/docs/DocsTitle.svelte.d.ts +6 -0
- package/dist/docs/StaticDemo.svelte +62 -0
- package/dist/docs/StaticDemo.svelte.d.ts +11 -0
- package/dist/docs/UsageDemo.svelte +65 -17
- package/dist/docs/UsageDemo.svelte.d.ts +15 -7
- package/dist/docs/UsageDemoSizeSlider.svelte +41 -0
- package/dist/docs/UsageDemoSizeSlider.svelte.d.ts +14 -0
- package/dist/docs/formatProps.d.ts +6 -0
- package/dist/docs/formatProps.js +37 -0
- package/dist/dropzone/Child.svelte +11 -0
- package/dist/dropzone/Child.svelte.d.ts +18 -0
- package/dist/dropzone/Dropzone.svelte +141 -0
- package/dist/dropzone/Dropzone.svelte.d.ts +90 -0
- package/dist/dropzone/DropzoneContext.svelte.d.ts +7 -0
- package/dist/dropzone/DropzoneContext.svelte.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ports/index.d.ts +1 -0
- package/dist/ports/index.js +1 -0
- package/dist/ports/svelte-dropzone/CreateDropzone.svelte.d.ts +23 -0
- package/dist/ports/svelte-dropzone/CreateDropzone.svelte.js +402 -0
- package/dist/ports/svelte-dropzone/types.d.ts +28 -0
- package/dist/ports/svelte-dropzone/types.js +1 -0
- package/dist/ports/svelte-dropzone/utils.d.ts +133 -0
- package/dist/ports/svelte-dropzone/utils.js +235 -0
- package/dist/styles/default-css-variables.css +14 -6
- package/dist/svelte-utils/CreateSvelteEvent.svelte.d.ts +20 -0
- package/dist/svelte-utils/CreateSvelteEvent.svelte.js +13 -0
- package/dist/{core/context → svelte-utils}/extract.d.ts +8 -1
- package/package.json +20 -18
- /package/dist/{core/context → svelte-utils}/extract.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import { getDefaultZIndex } from '../../utils/get-default-z-index.js';
|
|
3
3
|
import type { ArrowPosition, FloatingAxesOffsets, FloatingPosition, FloatingStrategy } from '../Floating/types.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { TransitionOverrides } from '../Transitions/transitions.js';
|
|
5
5
|
import type { TooltipBaseProps } from './Tooltip.types.js';
|
|
6
6
|
|
|
7
7
|
export interface TooltipProps extends TooltipBaseProps {
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
import FloatingArrow from '../Floating/FloatingArrow.svelte';
|
|
68
68
|
import { getFloatingPosition } from '../Floating/get-floating-position.js';
|
|
69
69
|
import OptionalPortal from '../Portal/OptionalPortal.svelte';
|
|
70
|
+
import { fade, transitions } from '../Transitions/transitions.js';
|
|
70
71
|
import { getTooltipMiddlewares } from './getTooltipMiddleware.js';
|
|
71
72
|
|
|
72
73
|
let {
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
...props
|
|
103
104
|
}: TooltipProps = $props();
|
|
104
105
|
|
|
105
|
-
const transition = transitions[transitionProps.transition];
|
|
106
|
+
const transition = $derived(transitions[transitionProps.transition] || fade);
|
|
106
107
|
|
|
107
108
|
const dir = $derived(getDirection().current);
|
|
108
109
|
|
|
@@ -194,7 +195,7 @@
|
|
|
194
195
|
|
|
195
196
|
{@render children({
|
|
196
197
|
[createAttachmentKey()]: (node: HTMLElement) => (referenceRef = node),
|
|
197
|
-
onclick,
|
|
198
|
+
onclick: onclick,
|
|
198
199
|
onmouseenter: handleMouseEnter,
|
|
199
200
|
onmouseleave: handleMouseLeave,
|
|
200
201
|
onmousemove,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArrowPosition, FloatingAxesOffsets, FloatingPosition, FloatingStrategy } from '../Floating/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import type { TransitionOverrides } from '../Transitions/transitions.js';
|
|
3
3
|
import type { TooltipBaseProps } from './Tooltip.types.js';
|
|
4
4
|
export interface TooltipProps extends TooltipBaseProps {
|
|
5
5
|
/** Called when tooltip position changes */
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
+
import { fadeDown } from './fade/fade-down.js';
|
|
2
|
+
import { fadeLeft } from './fade/fade-left.js';
|
|
3
|
+
import { fadeRight } from './fade/fade-right.js';
|
|
4
|
+
import { fadeUp } from './fade/fade-up.js';
|
|
1
5
|
import { fade } from './fade/fade.js';
|
|
6
|
+
import { popBottomLeft } from './pop/pop-bottom-left.js';
|
|
7
|
+
import { popBottomRight } from './pop/pop-bottom-right.js';
|
|
8
|
+
import { popTopLeft } from './pop/pop-top-left.js';
|
|
9
|
+
import { popTopRight } from './pop/pop-top-right.js';
|
|
10
|
+
import { pop } from './pop/pop.js';
|
|
11
|
+
import { rotateLeft } from './rotate/rotate-left.js';
|
|
12
|
+
import { rotateRight } from './rotate/rotate-right.js';
|
|
13
|
+
import { scaleX } from './scale/scale-x.js';
|
|
14
|
+
import { scaleY } from './scale/scale-y.js';
|
|
15
|
+
import { scale } from './scale/scale.js';
|
|
16
|
+
import { skewDown } from './skew/skew-down.js';
|
|
17
|
+
import { skewUp } from './skew/skew-up.js';
|
|
18
|
+
import { slideDown } from './slide/slide-down.js';
|
|
19
|
+
import { slideLeft } from './slide/slide-left.js';
|
|
20
|
+
import { slideRight } from './slide/slide-right.js';
|
|
21
|
+
import { slideUp } from './slide/slide-up.js';
|
|
22
|
+
export { fade, fadeDown, fadeLeft, fadeRight, fadeUp, pop, popBottomLeft, popBottomRight, popTopLeft, popTopRight, rotateLeft, rotateRight, scale, scaleX, scaleY, skewDown, skewUp, slideDown, slideLeft, slideRight, slideUp, };
|
|
2
23
|
export declare const transitions: {
|
|
3
24
|
fade: typeof fade;
|
|
4
25
|
'fade-down': (node: Element, props?: import("./fade/createFadeTransition.js").FadeTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
5
|
-
'fade-up': (node: Element, props?: import("./fade/createFadeTransition.js").FadeTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
6
26
|
'fade-left': (node: Element, props?: import("./fade/createFadeTransition.js").FadeTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
7
27
|
'fade-right': (node: Element, props?: import("./fade/createFadeTransition.js").FadeTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
28
|
+
'fade-up': (node: Element, props?: import("./fade/createFadeTransition.js").FadeTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
29
|
+
pop: (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
30
|
+
'pop-bottom-left': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
31
|
+
'pop-bottom-right': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
32
|
+
'pop-top-left': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
33
|
+
'pop-top-right': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
34
|
+
'rotate-left': (node: Element, props?: import("./rotate/createRotationTransition.js").RotationTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
35
|
+
'rotate-right': (node: Element, props?: import("./rotate/createRotationTransition.js").RotationTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
8
36
|
scale: (node: Element, props?: import("./scale/createScaleTransition.js").ScaleTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
9
37
|
'scale-x': (node: Element, props?: import("./scale/createScaleTransition.js").ScaleTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
10
38
|
'scale-y': (node: Element, props?: import("./scale/createScaleTransition.js").ScaleTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
11
|
-
'skew-up': (node: Element, props?: import("./skew/createSkewTransition.js").SkewTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
12
39
|
'skew-down': (node: Element, props?: import("./skew/createSkewTransition.js").SkewTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
13
|
-
'
|
|
14
|
-
'rotate-right': (node: Element, props?: import("./rotate/createRotationTransition.js").RotationTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
40
|
+
'skew-up': (node: Element, props?: import("./skew/createSkewTransition.js").SkewTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
15
41
|
'slide-down': (node: Element, props?: import("./slide/createSlideTransition.js").SlideTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
16
|
-
'slide-up': (node: Element, props?: import("./slide/createSlideTransition.js").SlideTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
17
42
|
'slide-left': (node: Element, props?: import("./slide/createSlideTransition.js").SlideTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
18
43
|
'slide-right': (node: Element, props?: import("./slide/createSlideTransition.js").SlideTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
19
|
-
|
|
20
|
-
'pop-bottom-left': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
21
|
-
'pop-bottom-right': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
22
|
-
'pop-top-left': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
23
|
-
'pop-top-right': (node: Element, props?: import("./pop/createPopTransition.js").PopTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
44
|
+
'slide-up': (node: Element, props?: import("./slide/createSlideTransition.js").SlideTransitionProps) => import("svelte/transition").TransitionConfig;
|
|
24
45
|
};
|
|
25
46
|
export type TransitionNames = keyof typeof transitions;
|
|
26
47
|
type TransitionPropsMap = {
|
|
@@ -30,4 +51,3 @@ export type TransitionOverrides<T extends TransitionNames = TransitionNames> = {
|
|
|
30
51
|
transition: T;
|
|
31
52
|
options?: TransitionPropsMap[T];
|
|
32
53
|
};
|
|
33
|
-
export {};
|
|
@@ -19,26 +19,27 @@ import { slideDown } from './slide/slide-down.js';
|
|
|
19
19
|
import { slideLeft } from './slide/slide-left.js';
|
|
20
20
|
import { slideRight } from './slide/slide-right.js';
|
|
21
21
|
import { slideUp } from './slide/slide-up.js';
|
|
22
|
+
export { fade, fadeDown, fadeLeft, fadeRight, fadeUp, pop, popBottomLeft, popBottomRight, popTopLeft, popTopRight, rotateLeft, rotateRight, scale, scaleX, scaleY, skewDown, skewUp, slideDown, slideLeft, slideRight, slideUp, };
|
|
22
23
|
export const transitions = {
|
|
23
|
-
fade,
|
|
24
|
+
fade: fade,
|
|
24
25
|
'fade-down': fadeDown,
|
|
25
|
-
'fade-up': fadeUp,
|
|
26
26
|
'fade-left': fadeLeft,
|
|
27
27
|
'fade-right': fadeRight,
|
|
28
|
-
|
|
28
|
+
'fade-up': fadeUp,
|
|
29
|
+
pop: pop,
|
|
30
|
+
'pop-bottom-left': popBottomLeft,
|
|
31
|
+
'pop-bottom-right': popBottomRight,
|
|
32
|
+
'pop-top-left': popTopLeft,
|
|
33
|
+
'pop-top-right': popTopRight,
|
|
34
|
+
'rotate-left': rotateLeft,
|
|
35
|
+
'rotate-right': rotateRight,
|
|
36
|
+
scale: scale,
|
|
29
37
|
'scale-x': scaleX,
|
|
30
38
|
'scale-y': scaleY,
|
|
31
|
-
'skew-up': skewUp,
|
|
32
39
|
'skew-down': skewDown,
|
|
33
|
-
'
|
|
34
|
-
'rotate-right': rotateRight,
|
|
40
|
+
'skew-up': skewUp,
|
|
35
41
|
'slide-down': slideDown,
|
|
36
|
-
'slide-up': slideUp,
|
|
37
42
|
'slide-left': slideLeft,
|
|
38
43
|
'slide-right': slideRight,
|
|
39
|
-
|
|
40
|
-
'pop-bottom-left': popBottomLeft,
|
|
41
|
-
'pop-bottom-right': popBottomRight,
|
|
42
|
-
'pop-top-left': popTopLeft,
|
|
43
|
-
'pop-top-right': popTopRight,
|
|
44
|
+
'slide-up': slideUp,
|
|
44
45
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
2
2
|
export { default as ActionIcon } from './ActionIcon/index.js';
|
|
3
|
+
export { default as Anchor } from './Anchor/Anchor.svelte';
|
|
3
4
|
export { default as Badge } from './Badge/Badge.svelte';
|
|
4
5
|
export { default as Burger } from './Burger/Burger.svelte';
|
|
5
6
|
export { default as Button } from './Button/Button.svelte';
|
|
@@ -34,8 +35,10 @@ export { default as ScrollArea } from './ScrollArea/index.js';
|
|
|
34
35
|
export { default as SegmentedControl } from './SegmentedControl/SegmentedControl.svelte';
|
|
35
36
|
export { default as Select } from './Select/Select.svelte';
|
|
36
37
|
export * from './Slider/index.js';
|
|
38
|
+
export { default as Stack } from './Stack/Stack.svelte';
|
|
37
39
|
export { default as Switch } from './Switch/index.js';
|
|
38
40
|
export { default as Table } from './Table/index.js';
|
|
41
|
+
export { default as Tabs } from './Tabs/Tabs.svelte';
|
|
39
42
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
40
43
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
41
44
|
export * from './Transitions/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
2
2
|
export { default as ActionIcon } from './ActionIcon/index.js';
|
|
3
|
+
export { default as Anchor } from './Anchor/Anchor.svelte';
|
|
3
4
|
export { default as Badge } from './Badge/Badge.svelte';
|
|
4
5
|
export { default as Burger } from './Burger/Burger.svelte';
|
|
5
6
|
export { default as Button } from './Button/Button.svelte';
|
|
@@ -34,8 +35,10 @@ export { default as ScrollArea } from './ScrollArea/index.js';
|
|
|
34
35
|
export { default as SegmentedControl } from './SegmentedControl/SegmentedControl.svelte';
|
|
35
36
|
export { default as Select } from './Select/Select.svelte';
|
|
36
37
|
export * from './Slider/index.js';
|
|
38
|
+
export { default as Stack } from './Stack/Stack.svelte';
|
|
37
39
|
export { default as Switch } from './Switch/index.js';
|
|
38
40
|
export { default as Table } from './Table/index.js';
|
|
41
|
+
export { default as Tabs } from './Tabs/Tabs.svelte';
|
|
39
42
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
|
40
43
|
export { default as Tooltip } from './Tooltip/Tooltip.svelte';
|
|
41
44
|
export * from './Transitions/index.js';
|
package/dist/core/hooks/index.js
CHANGED
|
@@ -5,13 +5,11 @@ interface ClickOutsideOptions {
|
|
|
5
5
|
events?: ClickOutsideEvents;
|
|
6
6
|
refs?: RefType[];
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
declare class ClickOutside {
|
|
9
|
+
#private;
|
|
9
10
|
ref: RefType[];
|
|
10
|
-
private callback;
|
|
11
|
-
private events;
|
|
12
|
-
private hasRefs;
|
|
13
|
-
private unbind;
|
|
14
11
|
constructor(options: ClickOutsideOptions);
|
|
15
12
|
listener: (event: Event) => void;
|
|
16
13
|
}
|
|
14
|
+
export declare function useClickOutside(options: ClickOutsideOptions): ClickOutside;
|
|
17
15
|
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { on } from 'svelte/events';
|
|
2
|
-
|
|
2
|
+
class ClickOutside {
|
|
3
3
|
ref = [];
|
|
4
|
-
callback;
|
|
5
|
-
events;
|
|
6
|
-
hasRefs = $derived(Array.isArray(this.ref) ? this.ref.some((ref) => !!ref) : !!this.ref);
|
|
7
|
-
unbind = [];
|
|
4
|
+
#callback;
|
|
5
|
+
#events;
|
|
6
|
+
#hasRefs = $derived(Array.isArray(this.ref) ? this.ref.some((ref) => !!ref) : !!this.ref);
|
|
7
|
+
#unbind = [];
|
|
8
8
|
constructor(options) {
|
|
9
|
-
this
|
|
10
|
-
this
|
|
9
|
+
this.#callback = options.callback;
|
|
10
|
+
this.#events = options.events ?? ['mousedown', 'touchstart'];
|
|
11
11
|
this.ref = options.refs ?? [];
|
|
12
12
|
$effect(() => {
|
|
13
|
-
for (let i = 0; i < this
|
|
14
|
-
const unbindEvent = on(document, this
|
|
15
|
-
this
|
|
13
|
+
for (let i = 0; i < this.#events.length; i++) {
|
|
14
|
+
const unbindEvent = on(document, this.#events[i], this.listener);
|
|
15
|
+
this.#unbind.push(unbindEvent);
|
|
16
16
|
}
|
|
17
17
|
return () => {
|
|
18
|
-
for (let i = 0; i < this
|
|
19
|
-
this
|
|
18
|
+
for (let i = 0; i < this.#unbind.length; i++) {
|
|
19
|
+
this.#unbind[i]();
|
|
20
20
|
}
|
|
21
|
-
this
|
|
21
|
+
this.#unbind = [];
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
listener = (event) => {
|
|
26
|
-
if (!this
|
|
26
|
+
if (!this.#hasRefs)
|
|
27
27
|
return;
|
|
28
28
|
const target = event.target;
|
|
29
29
|
const shouldIgnore = target.hasAttribute('data-ignore-outside-click') || (!document.body.contains(target) && target.tagName !== 'HTML');
|
|
@@ -35,6 +35,9 @@ export class ClickOutside {
|
|
|
35
35
|
});
|
|
36
36
|
if (!shouldTrigger)
|
|
37
37
|
return;
|
|
38
|
-
this
|
|
38
|
+
this.#callback();
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
+
export function useClickOutside(options) {
|
|
42
|
+
return new ClickOutside(options);
|
|
43
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { type MaybeGetter } from '../../svelte-utils/extract.js';
|
|
1
2
|
export interface ClipboardOptions {
|
|
2
3
|
/** Time in ms after which the copied state will reset, `2000` by default */
|
|
3
|
-
timeout?: number
|
|
4
|
+
timeout?: MaybeGetter<number>;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
+
declare class Clipboard {
|
|
7
|
+
#private;
|
|
6
8
|
error: Error | null;
|
|
7
9
|
copied: boolean;
|
|
8
|
-
copyTimeout: number | null;
|
|
9
10
|
options: ClipboardOptions;
|
|
10
11
|
constructor(options?: ClipboardOptions);
|
|
11
|
-
handleCopyResult: (value: boolean) => void;
|
|
12
12
|
copy: (value: string) => void;
|
|
13
|
-
_clearTimeout: () => void;
|
|
14
13
|
reset: () => void;
|
|
15
14
|
}
|
|
15
|
+
export declare function useClipboard(options?: ClipboardOptions): Clipboard;
|
|
16
|
+
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { extract } from '../../svelte-utils/extract.js';
|
|
2
|
+
const defaultOptions = { timeout: 2000 };
|
|
3
|
+
class Clipboard {
|
|
2
4
|
error = $state(null);
|
|
3
5
|
copied = $state(false);
|
|
4
|
-
copyTimeout = $state(null);
|
|
6
|
+
#copyTimeout = $state(null);
|
|
5
7
|
options;
|
|
6
|
-
|
|
8
|
+
#timeout = $derived(extract(this.options.timeout));
|
|
9
|
+
constructor(options = defaultOptions) {
|
|
7
10
|
this.options = options;
|
|
8
11
|
}
|
|
9
|
-
handleCopyResult = (value) => {
|
|
10
|
-
this
|
|
11
|
-
this
|
|
12
|
+
#handleCopyResult = (value) => {
|
|
13
|
+
this.#clearTimeout();
|
|
14
|
+
this.#copyTimeout = window.setTimeout(() => (this.copied = false), this.#timeout);
|
|
12
15
|
this.copied = value;
|
|
13
16
|
};
|
|
14
17
|
copy = (value) => {
|
|
15
18
|
if ('clipboard' in navigator) {
|
|
16
19
|
navigator.clipboard
|
|
17
20
|
.writeText(value)
|
|
18
|
-
.then(() => this
|
|
21
|
+
.then(() => this.#handleCopyResult(true))
|
|
19
22
|
.catch((error) => {
|
|
20
23
|
this.error = error;
|
|
21
24
|
});
|
|
@@ -24,13 +27,16 @@ export class Clipboard {
|
|
|
24
27
|
this.error = new Error('Clipboard: navigator.clipboard is not supported');
|
|
25
28
|
}
|
|
26
29
|
};
|
|
27
|
-
|
|
28
|
-
if (this
|
|
29
|
-
window.clearTimeout(this
|
|
30
|
+
#clearTimeout = () => {
|
|
31
|
+
if (this.#copyTimeout)
|
|
32
|
+
window.clearTimeout(this.#copyTimeout);
|
|
30
33
|
};
|
|
31
34
|
reset = () => {
|
|
32
35
|
this.copied = false;
|
|
33
36
|
this.error = null;
|
|
34
|
-
this
|
|
37
|
+
this.#clearTimeout();
|
|
35
38
|
};
|
|
36
39
|
}
|
|
40
|
+
export function useClipboard(options = defaultOptions) {
|
|
41
|
+
return new Clipboard(options);
|
|
42
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { MediaQuery } from 'svelte/reactivity';
|
|
2
|
-
|
|
2
|
+
class ColorScheme {
|
|
3
3
|
query = new MediaQuery('(prefers-color-scheme: dark)');
|
|
4
4
|
get current() {
|
|
5
5
|
return this.query.current ? 'dark' : 'light';
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
export function useColorScheme() {
|
|
9
|
+
return new ColorScheme();
|
|
10
|
+
}
|
|
@@ -3,7 +3,7 @@ export interface UseCounterOptions {
|
|
|
3
3
|
max?: number;
|
|
4
4
|
initialValue?: number;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
declare class Counter {
|
|
7
7
|
count: number;
|
|
8
8
|
min: number;
|
|
9
9
|
max: number;
|
|
@@ -14,3 +14,5 @@ export declare class Counter {
|
|
|
14
14
|
reset: () => void;
|
|
15
15
|
set: (value: number) => void;
|
|
16
16
|
}
|
|
17
|
+
export declare function useCounter(options?: UseCounterOptions): Counter;
|
|
18
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clamp } from 'es-toolkit';
|
|
2
|
-
|
|
2
|
+
class Counter {
|
|
3
3
|
count = $state(0);
|
|
4
4
|
min = $state(-Infinity);
|
|
5
5
|
max = $state(Infinity);
|
|
@@ -25,3 +25,6 @@ export class Counter {
|
|
|
25
25
|
this.count = clamp(value, this.min, this.max);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
export function useCounter(options) {
|
|
29
|
+
return new Counter(options);
|
|
30
|
+
}
|
|
@@ -3,7 +3,7 @@ interface DisclosureOptions {
|
|
|
3
3
|
onOpen?: () => void;
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
declare class Disclosure {
|
|
7
7
|
#private;
|
|
8
8
|
current: boolean;
|
|
9
9
|
constructor(options?: DisclosureOptions);
|
|
@@ -11,4 +11,5 @@ export declare class Disclosure {
|
|
|
11
11
|
open: () => void;
|
|
12
12
|
close: () => void;
|
|
13
13
|
}
|
|
14
|
+
export declare function useDisclosure(options?: DisclosureOptions): Disclosure;
|
|
14
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
class Disclosure {
|
|
2
2
|
current = $state(false);
|
|
3
3
|
#options;
|
|
4
4
|
constructor(options = {}) {
|
|
@@ -21,3 +21,6 @@ export class Disclosure {
|
|
|
21
21
|
this.#options.onClose?.();
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
export function useDisclosure(options = {}) {
|
|
25
|
+
return new Disclosure(options);
|
|
26
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
declare class FocusReturn {
|
|
2
2
|
lastActiveElement: HTMLElement | null;
|
|
3
3
|
constructor(opened: () => boolean, shouldReturnFocus: () => boolean);
|
|
4
4
|
returnFocus: () => void;
|
|
5
5
|
}
|
|
6
|
+
export declare function useFocusReturn(opened: () => boolean, shouldReturnFocus: () => boolean): FocusReturn;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onMount } from 'svelte';
|
|
2
2
|
import { on } from 'svelte/events';
|
|
3
|
-
|
|
3
|
+
class FocusReturn {
|
|
4
4
|
lastActiveElement = $state(null);
|
|
5
5
|
constructor(opened, shouldReturnFocus) {
|
|
6
6
|
// use onMount since document is not available in SSR
|
|
@@ -33,3 +33,6 @@ export class FocusReturn {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
+
export function useFocusReturn(opened, shouldReturnFocus) {
|
|
37
|
+
return new FocusReturn(opened, shouldReturnFocus);
|
|
38
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MediaQuery } from 'svelte/reactivity';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useReducedMotion: MediaQuery;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MediaQuery } from 'svelte/reactivity';
|
|
2
|
-
export const
|
|
2
|
+
export const useReducedMotion = new MediaQuery('(prefers-reduced-motion: reduce)');
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
declare class CreateResizeObserver<T extends HTMLElement> {
|
|
2
2
|
rAF: number;
|
|
3
3
|
constructor(element: () => T | null, onResize: () => void);
|
|
4
4
|
}
|
|
5
|
+
export declare function useResizeObserver<T extends HTMLElement>(element: () => T | null, onResize: () => void): CreateResizeObserver<T>;
|
|
6
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
class CreateResizeObserver {
|
|
2
2
|
rAF = $state(0);
|
|
3
3
|
constructor(element, onResize) {
|
|
4
4
|
$effect(() => {
|
|
@@ -16,3 +16,6 @@ export class CreateResizeObserver {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
export function useResizeObserver(element, onResize) {
|
|
20
|
+
return new CreateResizeObserver(element, onResize);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function randomId(prefix?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataAttr(v: unknown): {} | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CodeHighlight from '../core/CodeHighlight/CodeHighlight.svelte';
|
|
3
|
+
import DocsTitle from './DocsTitle.svelte';
|
|
4
|
+
|
|
5
|
+
interface UsageDemoProps {
|
|
6
|
+
title: string;
|
|
7
|
+
code: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { title, code }: UsageDemoProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<DocsTitle {title} />
|
|
14
|
+
|
|
15
|
+
<div class="container">
|
|
16
|
+
<CodeHighlight {code} language="svelte" />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>.container {
|
|
20
|
+
container-type: inline-size;
|
|
21
|
+
border-radius: var(--mantine-radius-md);
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const items = {
|
|
3
|
+
'/': 'Home',
|
|
4
|
+
'/accordion': 'Accordion',
|
|
5
|
+
'/action-icon': 'ActionIcon',
|
|
6
|
+
'/badge': 'Badge',
|
|
7
|
+
'/charts': 'Charts',
|
|
8
|
+
'/checkbox': 'Checkbox',
|
|
9
|
+
'/code-highlight': 'CodeHighlight',
|
|
10
|
+
'/color-picker': 'ColorPicker',
|
|
11
|
+
'/combobox': 'Combobox',
|
|
12
|
+
'/dropzone': 'Dropzone',
|
|
13
|
+
'/fieldset': 'Fieldset',
|
|
14
|
+
'/group': 'Group',
|
|
15
|
+
'/icons': 'Icons',
|
|
16
|
+
'/input': 'Input',
|
|
17
|
+
'/nav-link': 'NavLink',
|
|
18
|
+
'/notification': 'Notification',
|
|
19
|
+
'/pin-input': 'PinInput',
|
|
20
|
+
'/popover': 'Popover',
|
|
21
|
+
'/scroll-area': 'ScrollArea',
|
|
22
|
+
'/segmented-control': 'SegmentedControl',
|
|
23
|
+
'/select': 'Select',
|
|
24
|
+
'/slider': 'Slider',
|
|
25
|
+
'/switch': 'Switch',
|
|
26
|
+
'/table': 'Table',
|
|
27
|
+
'/tabs': 'Tabs',
|
|
28
|
+
'/text-input': 'TextInput',
|
|
29
|
+
'/textarea': 'Textarea',
|
|
30
|
+
'/tooltip': 'Tooltip',
|
|
31
|
+
'/transitions': 'Transitions',
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<!-- <div></div> -->
|
|
36
|
+
|
|
37
|
+
<nav class="links">
|
|
38
|
+
{#each Object.entries(items) as [key, value]}
|
|
39
|
+
<a href={key}>{value}</a>
|
|
40
|
+
{/each}
|
|
41
|
+
</nav>
|
|
42
|
+
|
|
43
|
+
<style>.links {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: 0.5rem;
|
|
47
|
+
}</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const DocsNavbar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type DocsNavbar = InstanceType<typeof DocsNavbar>;
|
|
18
|
+
export default DocsNavbar;
|