xiod-ui 1.0.0
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/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/components/label.d.ts
|
|
4
|
+
declare function Label({ className, render, ...props }: useRender.ComponentProps<"label">): React$1.ReactElement;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Label };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/label.tsx
|
|
6
|
+
function Label({ className, render, ...props }) {
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
className: cn("inline-flex items-center gap-2 text-base/4.5 sm:text-sm/4 font-medium text-foreground", className),
|
|
9
|
+
"data-slot": "label"
|
|
10
|
+
};
|
|
11
|
+
return useRender({
|
|
12
|
+
defaultTagName: "label",
|
|
13
|
+
props: mergeProps(defaultProps, props),
|
|
14
|
+
render
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Label };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/components/list-box.d.ts
|
|
4
|
+
type ListBoxValue = string | string[];
|
|
5
|
+
interface ListBoxProps extends useRender.ComponentProps<"div"> {
|
|
6
|
+
value?: ListBoxValue;
|
|
7
|
+
onValueChange?: (value: ListBoxValue) => void;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function ListBox({ className, value, onValueChange, multiple, render, ...props }: ListBoxProps): React$1.JSX.Element;
|
|
11
|
+
interface ListBoxItemProps extends useRender.ComponentProps<"div"> {
|
|
12
|
+
value: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function ListBoxItem({ className, value, disabled, render, ...props }: ListBoxItemProps): React$1.ReactElement;
|
|
16
|
+
declare function ListBoxGroup({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
17
|
+
declare function ListBoxLabel({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
18
|
+
declare function ListBoxSeparator({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ListBox, ListBoxGroup, ListBoxItem, ListBoxLabel, ListBoxSeparator };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
//#region src/components/list-box.tsx
|
|
8
|
+
const ListBoxContext = React$1.createContext(null);
|
|
9
|
+
function useListBox() {
|
|
10
|
+
const context = React$1.useContext(ListBoxContext);
|
|
11
|
+
if (!context) throw new Error("ListBox components must be used within a ListBox");
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
function ListBox({ className, value, onValueChange, multiple, render, ...props }) {
|
|
15
|
+
const [internalValue, setInternalValue] = React$1.useState(multiple ? [] : void 0);
|
|
16
|
+
const isControlled = value !== void 0;
|
|
17
|
+
const currentValue = isControlled ? value : internalValue;
|
|
18
|
+
const handleValueChange = React$1.useCallback((newValue) => {
|
|
19
|
+
if (!isControlled) setInternalValue(newValue);
|
|
20
|
+
onValueChange?.(newValue);
|
|
21
|
+
}, [isControlled, onValueChange]);
|
|
22
|
+
const contextValue = React$1.useMemo(() => ({
|
|
23
|
+
value: currentValue,
|
|
24
|
+
onValueChange: handleValueChange,
|
|
25
|
+
multiple
|
|
26
|
+
}), [
|
|
27
|
+
currentValue,
|
|
28
|
+
handleValueChange,
|
|
29
|
+
multiple
|
|
30
|
+
]);
|
|
31
|
+
const internalRef = React$1.useRef(null);
|
|
32
|
+
const handleKeyDown = (e) => {
|
|
33
|
+
if (!internalRef.current) return;
|
|
34
|
+
const items = Array.from(internalRef.current.querySelectorAll("[role='option']:not([data-disabled='true'])"));
|
|
35
|
+
if (!items.length) return;
|
|
36
|
+
const currentIndex = items.indexOf(document.activeElement);
|
|
37
|
+
if (e.key === "ArrowDown") {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
items[currentIndex < items.length - 1 ? currentIndex + 1 : 0]?.focus();
|
|
40
|
+
} else if (e.key === "ArrowUp") {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
items[currentIndex > 0 ? currentIndex - 1 : items.length - 1]?.focus();
|
|
43
|
+
} else if (e.key === "Home") {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
items[0]?.focus();
|
|
46
|
+
} else if (e.key === "End") {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
items[items.length - 1]?.focus();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const defaultProps = {
|
|
52
|
+
className: cn("flex flex-col gap-0.5 rounded-lg border bg-popover p-[calc(--spacing(1)-1px)] text-popover-foreground shadow-xs/5 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", className),
|
|
53
|
+
role: "listbox",
|
|
54
|
+
"aria-multiselectable": multiple,
|
|
55
|
+
"data-slot": "list-box",
|
|
56
|
+
onKeyDown: handleKeyDown,
|
|
57
|
+
tabIndex: 0
|
|
58
|
+
};
|
|
59
|
+
const element = useRender({
|
|
60
|
+
defaultTagName: "div",
|
|
61
|
+
props: mergeProps(defaultProps, props),
|
|
62
|
+
ref: internalRef,
|
|
63
|
+
render
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ jsx(ListBoxContext.Provider, {
|
|
66
|
+
value: contextValue,
|
|
67
|
+
children: element
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function ListBoxItem({ className, value, disabled, render, ...props }) {
|
|
71
|
+
const context = useListBox();
|
|
72
|
+
const isSelected = React$1.useMemo(() => {
|
|
73
|
+
if (context.multiple && Array.isArray(context.value)) return context.value.includes(value);
|
|
74
|
+
return context.value === value;
|
|
75
|
+
}, [
|
|
76
|
+
context.value,
|
|
77
|
+
context.multiple,
|
|
78
|
+
value
|
|
79
|
+
]);
|
|
80
|
+
const handleSelect = () => {
|
|
81
|
+
if (disabled) return;
|
|
82
|
+
if (context.multiple) {
|
|
83
|
+
const current = Array.isArray(context.value) ? context.value : [];
|
|
84
|
+
if (current.includes(value)) context.onValueChange?.(current.filter((v) => v !== value));
|
|
85
|
+
else context.onValueChange?.([...current, value]);
|
|
86
|
+
} else context.onValueChange?.(value);
|
|
87
|
+
};
|
|
88
|
+
const defaultProps = {
|
|
89
|
+
className: cn("relative flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-64 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground sm:min-h-7 sm:text-sm [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg]:pointer-events-none [&>svg]:shrink-0 gap-2 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11", className),
|
|
90
|
+
role: "option",
|
|
91
|
+
"aria-selected": isSelected,
|
|
92
|
+
"data-selected": isSelected,
|
|
93
|
+
"data-disabled": disabled,
|
|
94
|
+
"data-slot": "list-box-item",
|
|
95
|
+
onClick: (_e) => {
|
|
96
|
+
handleSelect();
|
|
97
|
+
},
|
|
98
|
+
onKeyDown: (e) => {
|
|
99
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
handleSelect();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
tabIndex: disabled ? -1 : -1
|
|
105
|
+
};
|
|
106
|
+
return useRender({
|
|
107
|
+
defaultTagName: "div",
|
|
108
|
+
props: mergeProps(defaultProps, props),
|
|
109
|
+
render
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function ListBoxGroup({ className, render, ...props }) {
|
|
113
|
+
const defaultProps = {
|
|
114
|
+
className: cn("py-1", className),
|
|
115
|
+
role: "group",
|
|
116
|
+
"data-slot": "list-box-group"
|
|
117
|
+
};
|
|
118
|
+
return useRender({
|
|
119
|
+
defaultTagName: "div",
|
|
120
|
+
props: mergeProps(defaultProps, props),
|
|
121
|
+
render
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function ListBoxLabel({ className, render, ...props }) {
|
|
125
|
+
const defaultProps = {
|
|
126
|
+
className: cn("px-2 py-1.5 font-medium text-muted-foreground text-xs", className),
|
|
127
|
+
"data-slot": "list-box-label"
|
|
128
|
+
};
|
|
129
|
+
return useRender({
|
|
130
|
+
defaultTagName: "div",
|
|
131
|
+
props: mergeProps(defaultProps, props),
|
|
132
|
+
render
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function ListBoxSeparator({ className, render, ...props }) {
|
|
136
|
+
const defaultProps = {
|
|
137
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
138
|
+
role: "separator",
|
|
139
|
+
"data-slot": "list-box-separator"
|
|
140
|
+
};
|
|
141
|
+
return useRender({
|
|
142
|
+
defaultTagName: "div",
|
|
143
|
+
props: mergeProps(defaultProps, props),
|
|
144
|
+
render
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { ListBox, ListBoxGroup, ListBoxItem, ListBoxLabel, ListBoxSeparator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/loader.d.ts
|
|
5
|
+
declare const loaderVariants: (props?: ({
|
|
6
|
+
intent?: "default" | "success" | "warning" | "primary" | "danger" | "muted" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
|
+
variant?: "expressive" | "ring" | "pulse" | "dots" | "circular-arrows" | "radial-pulse" | "arc-head" | "segmented-ring" | "chunked-circular" | "petal" | "orbiting-dots" | "dotted-ring" | "radial-arrow" | "bar-segment" | "orbiting-ball" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface LoaderProps extends useRender.ComponentProps<"div">, VariantProps<typeof loaderVariants> {}
|
|
11
|
+
declare function Loader({ className, intent, size, variant, render, ...props }: LoaderProps): React$1.ReactElement;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Loader, loaderVariants };
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/loader.tsx
|
|
9
|
+
const loaderVariants = cva("inline-flex items-center justify-center relative", {
|
|
10
|
+
variants: {
|
|
11
|
+
intent: {
|
|
12
|
+
default: "text-foreground",
|
|
13
|
+
primary: "text-primary",
|
|
14
|
+
success: "text-success",
|
|
15
|
+
warning: "text-warning",
|
|
16
|
+
danger: "text-destructive",
|
|
17
|
+
muted: "text-muted-foreground"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
sm: "size-4",
|
|
21
|
+
md: "size-6",
|
|
22
|
+
lg: "size-8",
|
|
23
|
+
xl: "size-12"
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
ring: "",
|
|
27
|
+
expressive: "",
|
|
28
|
+
pulse: "",
|
|
29
|
+
dots: "",
|
|
30
|
+
"circular-arrows": "",
|
|
31
|
+
"radial-pulse": "",
|
|
32
|
+
"arc-head": "",
|
|
33
|
+
"segmented-ring": "",
|
|
34
|
+
"chunked-circular": "",
|
|
35
|
+
petal: "",
|
|
36
|
+
"orbiting-dots": "",
|
|
37
|
+
"dotted-ring": "",
|
|
38
|
+
"radial-arrow": "",
|
|
39
|
+
"bar-segment": "",
|
|
40
|
+
"orbiting-ball": ""
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
intent: "default",
|
|
45
|
+
size: "md",
|
|
46
|
+
variant: "ring"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const morphPaths = [
|
|
50
|
+
"M 12 2 C 17.52 2 22 6.48 22 12 C 22 17.52 17.52 22 12 22 C 6.48 22 2 17.52 2 12 C 2 6.48 6.48 2 12 2 Z",
|
|
51
|
+
"M 12 2 C 19 2 22 5 22 12 C 22 19 19 22 12 22 C 5 22 2 19 2 12 C 2 5 5 2 12 2 Z",
|
|
52
|
+
"M 12 2 C 21.5 2 22 2.5 22 12 C 22 21.5 21.5 22 12 22 C 2.5 22 2 21.5 2 12 C 2 2.5 2.5 2 12 2 Z",
|
|
53
|
+
"M 12 2 C 14 4 18 10 22 12 C 18 14 14 18 12 22 C 10 18 6 14 2 12 C 6 10 10 4 12 2 Z",
|
|
54
|
+
"M 12 2 C 15 5 19 8 22 12 C 19 16 15 19 12 22 C 9 19 5 16 2 12 C 5 8 9 5 12 2 Z",
|
|
55
|
+
"M 12 4 C 16 2 20 8 20 12 C 20 16 16 22 12 20 C 8 22 4 16 4 12 C 4 8 8 2 12 4 Z",
|
|
56
|
+
"M 12 2 C 13 8 14 10 22 12 C 14 14 13 16 12 22 C 11 16 10 14 2 12 C 10 10 11 8 12 2 Z",
|
|
57
|
+
"M 12 3 C 15 5 18 9 19 12 C 18 15 15 19 12 21 C 9 19 6 15 5 12 C 6 9 9 5 12 3 Z",
|
|
58
|
+
"M 12 5 C 18 5 22 8 22 12 C 22 16 18 19 12 19 C 6 19 2 16 2 12 C 2 8 6 5 12 5 Z",
|
|
59
|
+
"M 12 2 C 15 2 18 6 18 12 C 18 18 15 22 12 22 C 9 22 6 18 6 12 C 6 6 9 2 12 2 Z",
|
|
60
|
+
"M 12 2 C 17.52 2 22 6.48 22 12 C 22 17.52 17.52 22 12 22 C 6.48 22 2 17.52 2 12 C 2 6.48 6.48 2 12 2 Z"
|
|
61
|
+
].join(";");
|
|
62
|
+
function Loader({ className, intent, size, variant, render, ...props }) {
|
|
63
|
+
const rootProps = {
|
|
64
|
+
className: cn(loaderVariants({
|
|
65
|
+
intent,
|
|
66
|
+
size,
|
|
67
|
+
variant,
|
|
68
|
+
className
|
|
69
|
+
})),
|
|
70
|
+
role: "status",
|
|
71
|
+
"aria-label": "Loading",
|
|
72
|
+
"data-slot": "loader"
|
|
73
|
+
};
|
|
74
|
+
const element = useRender({
|
|
75
|
+
defaultTagName: "div",
|
|
76
|
+
props: mergeProps(rootProps, props),
|
|
77
|
+
render
|
|
78
|
+
});
|
|
79
|
+
const gradientId = `loader-fade-${React$1.useId().replace(/:/g, "")}`;
|
|
80
|
+
const content = React$1.useMemo(() => {
|
|
81
|
+
switch (variant) {
|
|
82
|
+
case "expressive": return /* @__PURE__ */ jsxs("svg", {
|
|
83
|
+
className: "h-full w-full animate-spin text-current",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
fill: "none",
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
"data-slot": "loader-expressive",
|
|
88
|
+
children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
89
|
+
id: gradientId,
|
|
90
|
+
x1: "0%",
|
|
91
|
+
y1: "0%",
|
|
92
|
+
x2: "100%",
|
|
93
|
+
y2: "0%",
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx("stop", {
|
|
96
|
+
offset: "0%",
|
|
97
|
+
stopColor: "currentColor",
|
|
98
|
+
stopOpacity: "0"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("stop", {
|
|
101
|
+
offset: "50%",
|
|
102
|
+
stopColor: "currentColor",
|
|
103
|
+
stopOpacity: "0.5"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ jsx("stop", {
|
|
106
|
+
offset: "100%",
|
|
107
|
+
stopColor: "currentColor",
|
|
108
|
+
stopOpacity: "1"
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}) }), /* @__PURE__ */ jsx("path", {
|
|
112
|
+
stroke: `url(#${gradientId})`,
|
|
113
|
+
strokeWidth: "3",
|
|
114
|
+
strokeLinecap: "round",
|
|
115
|
+
pathLength: "100",
|
|
116
|
+
strokeDasharray: "75 25",
|
|
117
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
118
|
+
attributeName: "d",
|
|
119
|
+
dur: "6s",
|
|
120
|
+
repeatCount: "indefinite",
|
|
121
|
+
values: morphPaths
|
|
122
|
+
})
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
case "circular-arrows": return /* @__PURE__ */ jsxs("svg", {
|
|
126
|
+
className: "h-full w-full animate-spin text-current",
|
|
127
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
128
|
+
fill: "none",
|
|
129
|
+
viewBox: "0 0 24 24",
|
|
130
|
+
"data-slot": "loader-circular-arrows",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx("path", {
|
|
133
|
+
stroke: "currentColor",
|
|
134
|
+
strokeLinecap: "round",
|
|
135
|
+
strokeLinejoin: "round",
|
|
136
|
+
strokeWidth: "2.5",
|
|
137
|
+
d: "M12 22c5.523 0 10-4.477 10-10a10 10 0 0 0-4.713-8.495"
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ jsx("path", {
|
|
140
|
+
stroke: "currentColor",
|
|
141
|
+
strokeLinecap: "round",
|
|
142
|
+
strokeLinejoin: "round",
|
|
143
|
+
strokeWidth: "2.5",
|
|
144
|
+
d: "M17 3l.287.495m0 0L20 6.5M17.287 3.495 14 5"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx("path", {
|
|
147
|
+
stroke: "currentColor",
|
|
148
|
+
strokeLinecap: "round",
|
|
149
|
+
strokeLinejoin: "round",
|
|
150
|
+
strokeWidth: "2.5",
|
|
151
|
+
d: "M12 2C6.477 2 2 6.477 2 12a10 10 0 0 0 4.713 8.495"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx("path", {
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
strokeLinecap: "round",
|
|
156
|
+
strokeLinejoin: "round",
|
|
157
|
+
strokeWidth: "2.5",
|
|
158
|
+
d: "M7 21l-.287-.495m0 0L4 17.5m2.713 3.005L10 19"
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
case "radial-pulse": return /* @__PURE__ */ jsx("svg", {
|
|
163
|
+
className: "h-full w-full text-current",
|
|
164
|
+
viewBox: "0 0 24 24",
|
|
165
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
166
|
+
"data-slot": "loader-radial-pulse",
|
|
167
|
+
children: [...Array(12)].map((_, i) => /* @__PURE__ */ jsx("rect", {
|
|
168
|
+
x: "11",
|
|
169
|
+
y: "1",
|
|
170
|
+
width: "2",
|
|
171
|
+
height: "6",
|
|
172
|
+
rx: "1",
|
|
173
|
+
fill: "currentColor",
|
|
174
|
+
opacity: "0",
|
|
175
|
+
transform: `rotate(${i * 30} 12 12)`,
|
|
176
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
177
|
+
attributeName: "opacity",
|
|
178
|
+
values: "1;0",
|
|
179
|
+
dur: "1s",
|
|
180
|
+
begin: `${i * .083}s`,
|
|
181
|
+
repeatCount: "indefinite"
|
|
182
|
+
})
|
|
183
|
+
}, i))
|
|
184
|
+
});
|
|
185
|
+
case "arc-head": return /* @__PURE__ */ jsxs("svg", {
|
|
186
|
+
className: "h-full w-full animate-spin text-current",
|
|
187
|
+
viewBox: "0 0 24 24",
|
|
188
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
189
|
+
fill: "none",
|
|
190
|
+
"data-slot": "loader-arc-head",
|
|
191
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
192
|
+
cx: "12",
|
|
193
|
+
cy: "12",
|
|
194
|
+
r: "10",
|
|
195
|
+
stroke: "currentColor",
|
|
196
|
+
strokeOpacity: "0.15",
|
|
197
|
+
strokeWidth: "3"
|
|
198
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
199
|
+
d: "M12 2a10 10 0 0 1 10 10",
|
|
200
|
+
stroke: "currentColor",
|
|
201
|
+
strokeWidth: "3",
|
|
202
|
+
strokeLinecap: "round"
|
|
203
|
+
})]
|
|
204
|
+
});
|
|
205
|
+
case "segmented-ring": return /* @__PURE__ */ jsx("svg", {
|
|
206
|
+
className: "h-full w-full animate-spin text-current",
|
|
207
|
+
viewBox: "0 0 24 24",
|
|
208
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
209
|
+
"data-slot": "loader-segmented-ring",
|
|
210
|
+
style: { animationDuration: "3s" },
|
|
211
|
+
children: [...Array(8)].map((_, i) => /* @__PURE__ */ jsx("path", {
|
|
212
|
+
d: "M 12 2 A 10 10 0 0 1 19.07 4.93",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
strokeWidth: "2.5",
|
|
215
|
+
strokeLinecap: "round",
|
|
216
|
+
fill: "none",
|
|
217
|
+
transform: `rotate(${i * 45} 12 12)`,
|
|
218
|
+
opacity: 1 - i * .1
|
|
219
|
+
}, i))
|
|
220
|
+
});
|
|
221
|
+
case "chunked-circular": return /* @__PURE__ */ jsx("svg", {
|
|
222
|
+
className: "h-full w-full text-current",
|
|
223
|
+
viewBox: "0 0 24 24",
|
|
224
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
225
|
+
"data-slot": "loader-chunked-circular",
|
|
226
|
+
children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx("path", {
|
|
227
|
+
d: "M 12 2 A 10 10 0 0 1 22 12",
|
|
228
|
+
stroke: "currentColor",
|
|
229
|
+
strokeWidth: "4",
|
|
230
|
+
strokeLinecap: "round",
|
|
231
|
+
fill: "none",
|
|
232
|
+
transform: `rotate(${i * 90} 12 12)`,
|
|
233
|
+
strokeDasharray: "10 20",
|
|
234
|
+
opacity: "0.2",
|
|
235
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
236
|
+
attributeName: "opacity",
|
|
237
|
+
values: "0.2;1;0.2",
|
|
238
|
+
dur: "1.5s",
|
|
239
|
+
begin: `${i * .375}s`,
|
|
240
|
+
repeatCount: "indefinite"
|
|
241
|
+
})
|
|
242
|
+
}, i))
|
|
243
|
+
});
|
|
244
|
+
case "petal": return /* @__PURE__ */ jsx("svg", {
|
|
245
|
+
className: "h-full w-full animate-spin text-current",
|
|
246
|
+
viewBox: "0 0 24 24",
|
|
247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
248
|
+
"data-slot": "loader-petal",
|
|
249
|
+
style: { animationDuration: "4s" },
|
|
250
|
+
children: [...Array(6)].map((_, i) => /* @__PURE__ */ jsx("path", {
|
|
251
|
+
d: "M12 2 C 14 2 15 5 15 8 C 15 11 12 12 12 12 C 12 12 9 11 9 8 C 9 5 10 2 12 2 Z",
|
|
252
|
+
fill: "currentColor",
|
|
253
|
+
transform: `rotate(${i * 60} 12 12)`,
|
|
254
|
+
opacity: 1 - i * .15
|
|
255
|
+
}, i))
|
|
256
|
+
});
|
|
257
|
+
case "orbiting-dots": return /* @__PURE__ */ jsx("svg", {
|
|
258
|
+
className: "h-full w-full animate-spin text-current",
|
|
259
|
+
viewBox: "0 0 24 24",
|
|
260
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
261
|
+
"data-slot": "loader-orbiting-dots",
|
|
262
|
+
style: { animationDuration: "2.5s" },
|
|
263
|
+
children: [...Array(3)].map((_, i) => /* @__PURE__ */ jsx("circle", {
|
|
264
|
+
cx: "12",
|
|
265
|
+
cy: "3",
|
|
266
|
+
r: "2.5",
|
|
267
|
+
fill: "currentColor",
|
|
268
|
+
transform: `rotate(${i * 120} 12 12)`,
|
|
269
|
+
children: /* @__PURE__ */ jsx("animateTransform", {
|
|
270
|
+
attributeName: "transform",
|
|
271
|
+
type: "rotate",
|
|
272
|
+
from: `${i * 120} 12 12`,
|
|
273
|
+
to: `${i * 120 + 360} 12 12`,
|
|
274
|
+
dur: "1.5s",
|
|
275
|
+
repeatCount: "indefinite",
|
|
276
|
+
additive: "sum"
|
|
277
|
+
})
|
|
278
|
+
}, i))
|
|
279
|
+
});
|
|
280
|
+
case "dotted-ring": return /* @__PURE__ */ jsx("svg", {
|
|
281
|
+
className: "h-full w-full text-current",
|
|
282
|
+
viewBox: "0 0 24 24",
|
|
283
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
284
|
+
"data-slot": "loader-dotted-ring",
|
|
285
|
+
children: [...Array(16)].map((_, i) => /* @__PURE__ */ jsx("circle", {
|
|
286
|
+
cx: "12",
|
|
287
|
+
cy: "2",
|
|
288
|
+
r: "1.5",
|
|
289
|
+
fill: "currentColor",
|
|
290
|
+
transform: `rotate(${i * 22.5} 12 12)`,
|
|
291
|
+
opacity: "0.1",
|
|
292
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
293
|
+
attributeName: "opacity",
|
|
294
|
+
values: "0.1;1;0.1",
|
|
295
|
+
dur: "1.2s",
|
|
296
|
+
begin: `${i * .075}s`,
|
|
297
|
+
repeatCount: "indefinite"
|
|
298
|
+
})
|
|
299
|
+
}, i))
|
|
300
|
+
});
|
|
301
|
+
case "radial-arrow": return /* @__PURE__ */ jsx("svg", {
|
|
302
|
+
className: "h-full w-full animate-spin text-current",
|
|
303
|
+
viewBox: "0 0 24 24",
|
|
304
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
305
|
+
"data-slot": "loader-radial-arrow",
|
|
306
|
+
children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx("path", {
|
|
307
|
+
d: "M12 2 L15 6 L9 6 Z",
|
|
308
|
+
fill: "currentColor",
|
|
309
|
+
transform: `rotate(${i * 90} 12 12)`,
|
|
310
|
+
children: /* @__PURE__ */ jsx("animateTransform", {
|
|
311
|
+
attributeName: "transform",
|
|
312
|
+
type: "translate",
|
|
313
|
+
values: "0,0; 0,2; 0,0",
|
|
314
|
+
dur: "1s",
|
|
315
|
+
begin: `${i * .25}s`,
|
|
316
|
+
repeatCount: "indefinite",
|
|
317
|
+
additive: "sum"
|
|
318
|
+
})
|
|
319
|
+
}, i))
|
|
320
|
+
});
|
|
321
|
+
case "bar-segment": return /* @__PURE__ */ jsx("svg", {
|
|
322
|
+
className: "h-full w-full animate-spin text-current",
|
|
323
|
+
viewBox: "0 0 24 24",
|
|
324
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
325
|
+
"data-slot": "loader-bar-segment",
|
|
326
|
+
style: { animationDuration: "2s" },
|
|
327
|
+
children: /* @__PURE__ */ jsx("circle", {
|
|
328
|
+
cx: "12",
|
|
329
|
+
cy: "12",
|
|
330
|
+
r: "10",
|
|
331
|
+
stroke: "currentColor",
|
|
332
|
+
strokeWidth: "4",
|
|
333
|
+
strokeDasharray: "10 15",
|
|
334
|
+
fill: "none",
|
|
335
|
+
strokeLinecap: "square"
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
case "orbiting-ball": return /* @__PURE__ */ jsxs("svg", {
|
|
339
|
+
className: "h-full w-full text-current",
|
|
340
|
+
viewBox: "0 0 24 24",
|
|
341
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
342
|
+
"data-slot": "loader-orbiting-ball",
|
|
343
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
344
|
+
cx: "12",
|
|
345
|
+
cy: "12",
|
|
346
|
+
r: "10",
|
|
347
|
+
stroke: "currentColor",
|
|
348
|
+
strokeOpacity: "0.15",
|
|
349
|
+
strokeWidth: "2",
|
|
350
|
+
fill: "none"
|
|
351
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
352
|
+
cx: "12",
|
|
353
|
+
cy: "2",
|
|
354
|
+
r: "3",
|
|
355
|
+
fill: "currentColor",
|
|
356
|
+
children: /* @__PURE__ */ jsx("animateTransform", {
|
|
357
|
+
attributeName: "transform",
|
|
358
|
+
type: "rotate",
|
|
359
|
+
from: "0 12 12",
|
|
360
|
+
to: "360 12 12",
|
|
361
|
+
dur: "1.5s",
|
|
362
|
+
repeatCount: "indefinite"
|
|
363
|
+
})
|
|
364
|
+
})]
|
|
365
|
+
});
|
|
366
|
+
case "pulse": return /* @__PURE__ */ jsx("span", {
|
|
367
|
+
className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-75",
|
|
368
|
+
"data-slot": "loader-pulse"
|
|
369
|
+
});
|
|
370
|
+
case "dots": return /* @__PURE__ */ jsxs("span", {
|
|
371
|
+
className: "flex h-full w-full items-center justify-between",
|
|
372
|
+
"data-slot": "loader-dots",
|
|
373
|
+
children: [
|
|
374
|
+
/* @__PURE__ */ jsx("span", {
|
|
375
|
+
className: "h-[30%] w-[30%] animate-bounce rounded-full bg-current",
|
|
376
|
+
style: { animationDelay: "0ms" }
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ jsx("span", {
|
|
379
|
+
className: "h-[30%] w-[30%] animate-bounce rounded-full bg-current",
|
|
380
|
+
style: { animationDelay: "150ms" }
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ jsx("span", {
|
|
383
|
+
className: "h-[30%] w-[30%] animate-bounce rounded-full bg-current",
|
|
384
|
+
style: { animationDelay: "300ms" }
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
});
|
|
388
|
+
default: return /* @__PURE__ */ jsxs("svg", {
|
|
389
|
+
className: "h-full w-full animate-spin text-current",
|
|
390
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
391
|
+
fill: "none",
|
|
392
|
+
viewBox: "0 0 24 24",
|
|
393
|
+
"data-slot": "loader-ring",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
396
|
+
id: gradientId,
|
|
397
|
+
x1: "0%",
|
|
398
|
+
y1: "0%",
|
|
399
|
+
x2: "100%",
|
|
400
|
+
y2: "0%",
|
|
401
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
402
|
+
offset: "0%",
|
|
403
|
+
stopColor: "currentColor",
|
|
404
|
+
stopOpacity: "0"
|
|
405
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
406
|
+
offset: "100%",
|
|
407
|
+
stopColor: "currentColor",
|
|
408
|
+
stopOpacity: "1"
|
|
409
|
+
})]
|
|
410
|
+
}) }),
|
|
411
|
+
/* @__PURE__ */ jsx("path", {
|
|
412
|
+
d: "M 22 12 A 10 10 0 0 0 2 12",
|
|
413
|
+
stroke: `url(#${gradientId})`,
|
|
414
|
+
strokeWidth: "3",
|
|
415
|
+
strokeLinecap: "round"
|
|
416
|
+
}),
|
|
417
|
+
/* @__PURE__ */ jsx("path", {
|
|
418
|
+
d: "M 22 12 A 10 10 0 0 1 12 22",
|
|
419
|
+
stroke: "currentColor",
|
|
420
|
+
strokeWidth: "3",
|
|
421
|
+
strokeLinecap: "round"
|
|
422
|
+
})
|
|
423
|
+
]
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}, [variant, gradientId]);
|
|
427
|
+
return React$1.cloneElement(element, {}, content);
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
export { Loader, loaderVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/marker.d.ts
|
|
5
|
+
export declare const markerVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "border" | "separator" | null | undefined;
|
|
7
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface MarkerProps extends useRender.ComponentProps<"div">, VariantProps<typeof markerVariants> {}
|
|
10
|
+
export declare function Marker({ className, variant, size, render, ...props }: MarkerProps): React$1.ReactElement;
|
|
11
|
+
export interface MarkerIconProps extends React$1.HTMLAttributes<HTMLSpanElement> {}
|
|
12
|
+
export declare function MarkerIcon({ className, ...props }: MarkerIconProps): React$1.JSX.Element;
|
|
13
|
+
export interface MarkerContentProps extends React$1.HTMLAttributes<HTMLSpanElement> {}
|
|
14
|
+
export declare function MarkerContent({ className, ...props }: MarkerContentProps): React$1.JSX.Element;
|
|
15
|
+
//#endregion
|